-// Default: See individual properties (1 1 0).
-//
-// http://w3.org/tr/css3-flexbox/#flex-property
-
-@mixin flex($fg: 1, $fs: null, $fb: null) {
-
- // Set a variable to be used by box-flex properties
- $fg-boxflex: $fg;
-
- // Box-Flex only supports a flex-grow value so let's grab the
- // first item in the list and just return that.
- @if type-of($fg) == 'list' {
- $fg-boxflex: nth($fg, 1);
- }
-
- -webkit-box-flex: $fg-boxflex;
- -webkit-flex: $fg $fs $fb;
- -moz-box-flex: $fg-boxflex;
- -moz-flex: $fg $fs $fb;
- -ms-flex: $fg $fs $fb;
- flex: $fg $fs $fb;
-}
-
-//----------------------------------------------------------------------
-
-// Flexbox Justify Content
-//
-// The 'justify-content' property aligns flex items along the main axis
-// of the current line of the flex container. This is done after any flexible
-// lengths and any auto margins have been resolved. Typically it helps distribute
-// extra free space leftover when either all the flex items on a line are
-// inflexible, or are flexible but have reached their maximum size. It also
-// exerts some control over the alignment of items when they overflow the line.
-//
-// Note: 'space-*' values not supported in older syntaxes.
-//
-// Values: flex-start | flex-end | center | space-between | space-around
-// Default: flex-start
-//
-// http://w3.org/tr/css3-flexbox/#justify-content-property
-
-@mixin justify-content($value: flex-start) {
- @if $value == flex-start {
- -webkit-box-pack: start;
- -ms-flex-pack: start;
- } @else if $value == flex-end {
- -webkit-box-pack: end;
- -ms-flex-pack: end;
- } @else if $value == space-between {
- -webkit-box-pack: justify;
- -ms-flex-pack: justify;
- } @else if $value == space-around {
- -ms-flex-pack: distribute;
- } @else {
- -webkit-box-pack: $value;
- -ms-flex-pack: $value;
- }
- -webkit-justify-content: $value;
- -moz-justify-content: $value;
- justify-content: $value;
-}
- // Shorter version:
- @mixin flex-just($args...) { @include justify-content($args...); }
-
-//----------------------------------------------------------------------
-
-// Flexbox Align Items
-//
-// Flex items can be aligned in the cross axis of the current line of the
-// flex container, similar to 'justify-content' but in the perpendicular
-// direction. 'align-items' sets the default alignment for all of the flex
-// container's items, including anonymous flex items. 'align-self' allows
-// this default alignment to be overridden for individual flex items. (For
-// anonymous flex items, 'align-self' always matches the value of 'align-items'
-// on their associated flex container.)
-//
-// Values: flex-start | flex-end | center | baseline | stretch
-// Default: stretch
-//
-// http://w3.org/tr/css3-flexbox/#align-items-property
-
-@mixin align-items($value: stretch) {
- @if $value == flex-start {
- -webkit-box-align: start;
- -ms-flex-align: start;
- } @else if $value == flex-end {
- -webkit-box-align: end;
- -ms-flex-align: end;
- } @else {
- -webkit-box-align: $value;
- -ms-flex-align: $value;
- }
- -webkit-align-items: $value;
- -moz-align-items: $value;
- align-items: $value;
-}
-
-//----------------------------------
-
-// Flexbox Align Self
-//
-// Values: auto | flex-start | flex-end | center | baseline | stretch
-// Default: auto
-
-@mixin align-self($value: auto) {
- // No Webkit Box Fallback.
- -webkit-align-self: $value;
- -moz-align-self: $value;
- @if $value == flex-start {
- -ms-flex-item-align: start;
- } @else if $value == flex-end {
- -ms-flex-item-align: end;
- } @else {
- -ms-flex-item-align: $value;
- }
- align-self: $value;
-}
-
-//----------------------------------------------------------------------
-
-// Flexbox Align Content
-//
-// The 'align-content' property aligns a flex container's lines within the
-// flex container when there is extra space in the cross-axis, similar to
-// how 'justify-content' aligns individual items within the main-axis. Note,
-// this property has no effect when the flexbox has only a single line.
-//
-// Values: flex-start | flex-end | center | space-between | space-around | stretch
-// Default: stretch
-//
-// http://w3.org/tr/css3-flexbox/#align-content-property
-
-@mixin align-content($value: stretch) {
- // No Webkit Box Fallback.
- -webkit-align-content: $value;
- -moz-align-content: $value;
- @if $value == flex-start {
- -ms-flex-line-pack: start;
- } @else if $value == flex-end {
- -ms-flex-line-pack: end;
- } @else {
- -ms-flex-line-pack: $value;
- }
- align-content: $value;
-}
\ No newline at end of file
diff --git a/_sass/_layout.scss b/_sass/_layout.scss
deleted file mode 100644
index 2a27269..0000000
--- a/_sass/_layout.scss
+++ /dev/null
@@ -1,15 +0,0 @@
-// Layout
-//
-// Styles for managing the structural hierarchy of the site.
-
-.container {
- max-width: 38rem;
- padding-left: 1.5rem;
- padding-right: 1.5rem;
- margin-left: auto;
- margin-right: auto;
-}
-
-footer {
- margin-bottom: 2rem;
-}
diff --git a/_sass/_masthead.scss b/_sass/_masthead.scss
deleted file mode 100644
index 34306f5..0000000
--- a/_sass/_masthead.scss
+++ /dev/null
@@ -1,26 +0,0 @@
-// Masthead
-//
-// Super small header above the content for site name and short description.
-
-.masthead {
- padding-top: 1rem;
- padding-bottom: 1rem;
- margin-bottom: 3rem;
-}
-
-.masthead-title {
- margin-top: 0;
- margin-bottom: 0;
- color: #505050;
-
- a {
- color: #505050;
- }
-
- small {
- font-size: 75%;
- font-weight: 400;
- color: #c0c0c0;
- letter-spacing: 0;
- }
-}
diff --git a/_sass/_message.scss b/_sass/_message.scss
deleted file mode 100644
index 42bf2e5..0000000
--- a/_sass/_message.scss
+++ /dev/null
@@ -1,11 +0,0 @@
-// Messages
-//
-// Show alert messages to users. You may add it to single elements like a ``,
-// or to a parent if there are multiple elements to show.
-
-.message {
- margin-bottom: 1rem;
- padding: 1rem;
- color: #717171;
- background-color: #f9f9f9;
-}
diff --git a/_sass/_pagination.scss b/_sass/_pagination.scss
deleted file mode 100644
index 4308134..0000000
--- a/_sass/_pagination.scss
+++ /dev/null
@@ -1,52 +0,0 @@
-// Pagination
-//
-// Super lightweight (HTML-wise) blog pagination. `span`s are provide for when
-// there are no more previous or next posts to show.
-
-.pagination {
- overflow: hidden; // clearfix
- margin: 0 -1.5rem 1rem;
- font-family: "PT Sans", Helvetica, Arial, sans-serif;
- color: #ccc;
- text-align: center;
-}
-
-// Pagination items can be `span`s or `a`s
-.pagination-item {
- display: block;
- padding: 1rem;
- border: solid #eee;
- border-width: 1px 0;
-
- &:first-child {
- margin-bottom: -1px;
- }
-}
-
-// Only provide a hover state for linked pagination items
-a.pagination-item:hover {
- background-color: #f5f5f5;
-}
-
-@media (min-width: 30em) {
- .pagination {
- margin: 3rem 0;
- }
-
- .pagination-item {
- float: left;
- width: 50%;
- border-width: 1px;
-
- &:first-child {
- margin-bottom: 0;
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
- }
- &:last-child {
- margin-left: -1px;
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
- }
- }
-}
diff --git a/_sass/_posts.scss b/_sass/_posts.scss
deleted file mode 100644
index 5acf278..0000000
--- a/_sass/_posts.scss
+++ /dev/null
@@ -1,61 +0,0 @@
-// Posts and pages
-//
-// Each post is wrapped in `.post` and is used on default and post layouts. Each
-// page is wrapped in `.page` and is only used on the page layout.
-
-.page,
-.post {
- margin-bottom: 4em;
-}
-
-// Blog post or page title
-.page-title,
-.post-title,
-.post-title a {
- color: #303030;
-}
-.page-title,
-.post-title {
- margin-top: 0;
-}
-
-// Meta data line below post title
-.post-date {
- display: block;
- margin-top: -.5rem;
- margin-bottom: 1rem;
- color: #9a9a9a;
-}
-
-
-// Related posts
-.related {
- padding-top: 2rem;
- padding-bottom: 2rem;
- border-top: 1px solid #eee;
-}
-
-.related-posts {
- padding-left: 0;
- list-style: none;
-
- h3 {
- margin-top: 0;
- }
-
- li {
- small {
- font-size: 75%;
- color: #999;
- }
-
- a:hover {
- color: #268bd2;
- text-decoration: none;
-
- small {
- color: inherit;
- }
- }
- }
-}
diff --git a/_sass/_syntax.scss b/_sass/_syntax.scss
deleted file mode 100644
index 15ad797..0000000
--- a/_sass/_syntax.scss
+++ /dev/null
@@ -1,65 +0,0 @@
-.highlight .hll { background-color: #ffc; }
-.highlight .c { color: #999; } /* Comment */
-.highlight .err { color: #a00; background-color: #faa } /* Error */
-.highlight .k { color: #069; } /* Keyword */
-.highlight .o { color: #555 } /* Operator */
-.highlight .cm { color: #09f; font-style: italic } /* Comment.Multiline */
-.highlight .cp { color: #099 } /* Comment.Preproc */
-.highlight .c1 { color: #999; } /* Comment.Single */
-.highlight .cs { color: #999; } /* Comment.Special */
-.highlight .gd { background-color: #fcc; border: 1px solid #c00 } /* Generic.Deleted */
-.highlight .ge { font-style: italic } /* Generic.Emph */
-.highlight .gr { color: #f00 } /* Generic.Error */
-.highlight .gh { color: #030; } /* Generic.Heading */
-.highlight .gi { background-color: #cfc; border: 1px solid #0c0 } /* Generic.Inserted */
-.highlight .go { color: #aaa } /* Generic.Output */
-.highlight .gp { color: #009; } /* Generic.Prompt */
-.highlight .gs { } /* Generic.Strong */
-.highlight .gu { color: #030; } /* Generic.Subheading */
-.highlight .gt { color: #9c6 } /* Generic.Traceback */
-.highlight .kc { color: #069; } /* Keyword.Constant */
-.highlight .kd { color: #069; } /* Keyword.Declaration */
-.highlight .kn { color: #069; } /* Keyword.Namespace */
-.highlight .kp { color: #069 } /* Keyword.Pseudo */
-.highlight .kr { color: #069; } /* Keyword.Reserved */
-.highlight .kt { color: #078; } /* Keyword.Type */
-.highlight .m { color: #f60 } /* Literal.Number */
-.highlight .s { color: #d44950 } /* Literal.String */
-.highlight .na { color: #4f9fcf } /* Name.Attribute */
-.highlight .nb { color: #366 } /* Name.Builtin */
-.highlight .nc { color: #0a8; } /* Name.Class */
-.highlight .no { color: #360 } /* Name.Constant */
-.highlight .nd { color: #99f } /* Name.Decorator */
-.highlight .ni { color: #999; } /* Name.Entity */
-.highlight .ne { color: #c00; } /* Name.Exception */
-.highlight .nf { color: #c0f } /* Name.Function */
-.highlight .nl { color: #99f } /* Name.Label */
-.highlight .nn { color: #0cf; } /* Name.Namespace */
-.highlight .nt { color: #2f6f9f; } /* Name.Tag */
-.highlight .nv { color: #033 } /* Name.Variable */
-.highlight .ow { color: #000; } /* Operator.Word */
-.highlight .w { color: #bbb } /* Text.Whitespace */
-.highlight .mf { color: #f60 } /* Literal.Number.Float */
-.highlight .mh { color: #f60 } /* Literal.Number.Hex */
-.highlight .mi { color: #f60 } /* Literal.Number.Integer */
-.highlight .mo { color: #f60 } /* Literal.Number.Oct */
-.highlight .sb { color: #c30 } /* Literal.String.Backtick */
-.highlight .sc { color: #c30 } /* Literal.String.Char */
-.highlight .sd { color: #c30; font-style: italic } /* Literal.String.Doc */
-.highlight .s2 { color: #c30 } /* Literal.String.Double */
-.highlight .se { color: #c30; } /* Literal.String.Escape */
-.highlight .sh { color: #c30 } /* Literal.String.Heredoc */
-.highlight .si { color: #a00 } /* Literal.String.Interpol */
-.highlight .sx { color: #c30 } /* Literal.String.Other */
-.highlight .sr { color: #3aa } /* Literal.String.Regex */
-.highlight .s1 { color: #c30 } /* Literal.String.Single */
-.highlight .ss { color: #fc3 } /* Literal.String.Symbol */
-.highlight .bp { color: #366 } /* Name.Builtin.Pseudo */
-.highlight .vc { color: #033 } /* Name.Variable.Class */
-.highlight .vg { color: #033 } /* Name.Variable.Global */
-.highlight .vi { color: #033 } /* Name.Variable.Instance */
-.highlight .il { color: #f60 } /* Literal.Number.Integer.Long */
-
-.css .o,
-.css .o + .nt,
-.css .nt + .nt { color: #999; }
diff --git a/_sass/_type.scss b/_sass/_type.scss
deleted file mode 100644
index 290d1db..0000000
--- a/_sass/_type.scss
+++ /dev/null
@@ -1,117 +0,0 @@
-// Typography
-//
-// Headings, body text, lists, and other misc typographic elements.
-
-h1, h2, h3, h4, h5, h6 {
- margin-bottom: .5rem;
- font-weight: bold;
- line-height: 1.25;
- color: #313131;
- text-rendering: optimizeLegibility;
-}
-
-h1 {
- font-size: 2rem;
-}
-
-h2 {
- margin-top: 1rem;
- font-size: 1.5rem;
-}
-
-h3 {
- margin-top: 1.5rem;
- font-size: 1.25rem;
-}
-
-h4, h5, h6 {
- margin-top: 1rem;
- font-size: 1rem;
-}
-
-p {
- margin-top: 0;
- margin-bottom: 1rem;
-}
-
-strong {
- color: #303030;
-}
-
-ul, ol, dl {
- margin-top: 0;
- margin-bottom: 1rem;
-}
-
-dt {
- font-weight: bold;
-}
-
-dd {
- margin-bottom: .5rem;
-}
-
-hr {
- position: relative;
- margin: 1.5rem 0;
- border: 0;
- border-top: 1px solid #eee;
- border-bottom: 1px solid #fff;
-}
-
-abbr {
- font-size: 85%;
- font-weight: bold;
- color: #555;
- text-transform: uppercase;
-
- &[title] {
- cursor: help;
- border-bottom: 1px dotted #e5e5e5;
- }
-}
-
-blockquote {
- padding: .5rem 1rem;
- margin: .8rem 0;
- color: #7a7a7a;
- border-left: .25rem solid #e5e5e5;
-
- p:last-child {
- margin-bottom: 0;
- }
-
- @media (min-width: 30em) {
- padding-right: 5rem;
- padding-left: 1.25rem;
- }
-}
-
-
-// Markdown footnotes
-//
-// See the example content post for an example.
-
-// Footnote number within body text
-a[href^="#fn:"],
-// Back to footnote link
-a[href^="#fnref:"] {
- display: inline-block;
- margin-left: .1rem;
- font-weight: bold;
-}
-
-// List of footnotes
-.footnotes {
- margin-top: 2rem;
- font-size: 85%;
-}
-
-// Custom type
-//
-// Extend paragraphs with `.lead` for larger introductory text.
-
-.lead {
- font-size: 1.25rem;
- font-weight: 300;
-}
diff --git a/_sass/_utilities.scss b/_sass/_utilities.scss
deleted file mode 100644
index 4a9933f..0000000
--- a/_sass/_utilities.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-@mixin overflow-ellipsis {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-@mixin keyframes($animation-name) {
- @-webkit-keyframes #{$animation-name} { @content; }
- @-moz-keyframes #{$animation-name} { @content; }
- @-o-keyframes #{$animation-name} { @content; }
- @keyframes #{$animation-name} { @content; }
-}
-
-@mixin transition($transition) {
- -webkit-transition: $transition;
- -moz-transition: $transition;
- -o-transition: $transition;
- transition: $transition;
-}
-
-@mixin animation($animation) {
- -webkit-animation: $animation;
- -moz-animation: $animation;
- -o-animation: $animation;
- animation: $animation;
-}
-
-@mixin transform($transform) {
- -webkit-transform: $transform;
- -moz-transform: $transform;
- -ms-transform: $transform;
- -o-transform: $transform;
- transform: $transform;
-}
-
-.remove-link {
- color: #999;
-
- &:hover {
- color: #f18794;
- text-decoration: none;
- }
-}
diff --git a/about.md b/about.md
deleted file mode 100644
index 058cfd4..0000000
--- a/about.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-layout: page
-title: About
----
-
-
- I'm John Le, a co-founder at Statwing , part of a company summer camp batch in 2012 (YC).
- I'm using this blog as a sandbox for small experiments. Particularly with
- code, data, visualization, statistics, or whatever else I find
- interesting.
-
diff --git a/atom.xml b/atom.xml
deleted file mode 100644
index bafc806..0000000
--- a/atom.xml
+++ /dev/null
@@ -1,28 +0,0 @@
----
-layout: null
----
-
-
-
-
- {{ site.title }}
-
-
- {{ site.time | date_to_xmlschema }}
- {{ site.url }}
-
- {{ site.author.name }}
- {{ site.author.email }}
-
-
- {% for post in site.posts %}
-
- {{ post.title }}
-
- {{ post.date | date_to_xmlschema }}
- {{ site.url }}{{ post.id }}
- {{ post.content | xml_escape }}
-
- {% endfor %}
-
-
diff --git a/demos.md b/demos.md
deleted file mode 100644
index b1bc7a6..0000000
--- a/demos.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-layout: page
-title: Demos
----
-
-{% for post in site.demos %}
- * {{ post.title }}
-{% endfor %}
diff --git a/gulpfile.js b/gulpfile.js
deleted file mode 100644
index d9e0f9e..0000000
--- a/gulpfile.js
+++ /dev/null
@@ -1,38 +0,0 @@
-var gulp = require('gulp');
-var browserSync = require('browser-sync').create();
-var cp = require('child_process');
-var env = require('gulp-env');
-
-gulp.task('jekyll-build', [], function (done) {
- var jekyll = cp.spawn('bundle', ['exec', 'jekyll build'], {stdio: 'inherit'}).on('close', done);
-});
-
-gulp.task('browser-stream', [], function () {
- gulp.src(['_site/public/css/*.css',
- '!_site/public/css/hyde.css',
- '!_site/public/css/poole.css',
- '!_site/public/css/styles.css',
- '!_site/public/css/syntax.css']).pipe(browserSync.stream());
-});
-
-gulp.task('set-env', function () {
- env({
- vars: {
- JEKYLL_SERVING: true
- }
- });
-});
-
-gulp.task('browser-sync', [], function (gulpCallback) {
- browserSync.init({
- server: {
- baseDir: '_site'
- }
- }, function () {
- gulp.watch(['_sass/*', '_sass/**', 'public/css/*'], ['jekyll-build']);
- gulp.watch(['_site/public/css/*.css'], ['browser-stream']);
- gulpCallback();
- });
-});
-
-gulp.task('default', ['set-env', 'jekyll-build', 'browser-sync']);
diff --git a/index.html b/index.html
index 558d1b4..ea2f734 100644
--- a/index.html
+++ b/index.html
@@ -1,33 +1 @@
----
-layout: default
-title: Home
----
-
-
- {% for post in paginator.posts %}
-
-
-
- {{ post.date | date_to_string }}
-
- {{ post.content }}
-
- {% endfor %}
-
-
-
+My Github Page
diff --git a/package.json b/package.json
deleted file mode 100644
index 9a8dc4f..0000000
--- a/package.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "name": "sandbox.github.com",
- "version": "1.0.0",
- "description": "Sandbox blog node setup",
- "main": "webpack.config.js",
- "dependencies": {
- "d3": "^3.5.12",
- "datalib": "^1.5.8",
- "es6-promise": "^3.0.2",
- "fixed-data-table": "^0.6.0",
- "immutable": "^3.7.5",
- "isomorphic-fetch": "^2.1.1",
- "lodash": "^3.10.1",
- "react": "^0.14.3",
- "react-dnd": "^2.0.2",
- "react-dnd-html5-backend": "^2.0.0",
- "react-dom": "^0.14.0",
- "react-redux": "^2.1.2",
- "react-tween-state": "^0.1.3",
- "redux": "^3.0.3",
- "redux-thunk": "^1.0.0",
- "updeep": "^0.10.1"
- },
- "devDependencies": {
- "babel-core": "^5.8.34",
- "babel-loader": "^5.4.0",
- "browser-sync": "^2.9.3",
- "cjsx-loader": "^2.0.1",
- "coffee-loader": "^0.7.2",
- "coffee-react-transform": "^3.2.0",
- "coffee-script": "^1.10.0",
- "css-loader": "^0.19.0",
- "gulp": "^3.9.0",
- "gulp-env": "^0.2.0",
- "raw-loader": "^0.5.1",
- "react-hot-loader": "^1.2.9",
- "redux-devtools": "^2.1.2",
- "style-loader": "^0.12.4",
- "webpack": "^1.12.2",
- "webpack-dev-server": "^1.12.1"
- },
- "scripts": {
- "start": "foreman start -f Procfile.dev",
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/sandbox/sandbox.github.com.git"
- },
- "author": "John Le",
- "license": "ISC",
- "bugs": {
- "url": "https://github.com/sandbox/sandbox.github.com/issues"
- },
- "homepage": "https://github.com/sandbox/sandbox.github.com#readme"
-}
diff --git a/posts.md b/posts.md
deleted file mode 100644
index b0065c7..0000000
--- a/posts.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-layout: page
-title: Posts
----
-
-### Archive
-
-{% for post in site.posts %}
- * {{ post.date | date_to_string }} » [ {{ post.title }} ]({{ post.url }})
-{% endfor %}
diff --git a/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png
deleted file mode 100644
index 99523e4..0000000
Binary files a/public/apple-touch-icon-precomposed.png and /dev/null differ
diff --git a/public/css/demo.scss b/public/css/demo.scss
deleted file mode 100644
index 463647c..0000000
--- a/public/css/demo.scss
+++ /dev/null
@@ -1,50 +0,0 @@
----
-# scss file jekkyl
----
-
-.demo {
- margin: 1em auto 4em auto;
- position: relative;
- tab-size: 2;
-}
-
-.demo-title {
- overflow: auto;
-}
-
-@media (min-width: 48em) {
- .demo-title h1 {
- float: left;
- }
-}
-
-.demo-title a {
- margin-top: 1rem;
- padding-left: 1rem;
- float: right;
-}
-
-@media (max-width: 48em) {
- .demo-title {
- margin-bottom: 1rem;
- }
-}
-
-@media (max-width: 960px) {
- .demo {
- padding-left: 4rem;
- padding-right: 4rem;
- }
-}
-
-@media (min-width: 960px) {
- .demo {
- width: 960px;
- padding-left: 2rem;
- padding-right: 2rem;
- }
-}
-
-.demo h1 {
- font-weight: 400;
-}
diff --git a/public/css/hyde.css b/public/css/hyde.css
deleted file mode 100644
index 937006b..0000000
--- a/public/css/hyde.css
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * __ __
- * /\ \ /\ \
- * \ \ \___ __ __ \_\ \ __
- * \ \ _ `\/\ \/\ \ /'_` \ /'__`\
- * \ \ \ \ \ \ \_\ \/\ \_\ \/\ __/
- * \ \_\ \_\/`____ \ \___,_\ \____\
- * \/_/\/_/`/___/> \/__,_ /\/____/
- * /\___/
- * \/__/
- *
- * Designed, built, and released under MIT license by @mdo. Learn more at
- * https://github.com/poole/hyde.
- */
-
-
-/*
- * Contents
- *
- * Global resets
- * Sidebar
- * Container
- * Reverse layout
- * Themes
- */
-
-
-/*
- * Global resets
- *
- * Update the foundational and global aspects of the page.
- */
-
-html {
- font-family: "PT Sans", Helvetica, Arial, sans-serif;
-}
-@media (min-width: 48em) {
- html {
- font-size: 16px;
- }
-}
-@media (min-width: 58em) {
- html {
- font-size: 20px;
- }
-}
-
-
-/*
- * Sidebar
- *
- * Flexible banner for housing site name, intro, and "footer" content. Starts
- * out above content in mobile and later moves to the side with wider viewports.
- */
-
-.sidebar {
- text-align: center;
- padding: 2rem 1rem;
- color: rgba(255,255,255,.5);
- background-color: #202020;
-}
-@media (min-width: 48em) {
- .sidebar {
- position: fixed;
- top: 0;
- left: 0;
- bottom: 0;
- width: 12rem;
- text-align: left;
- }
-}
-
-/* Sidebar links */
-.sidebar a {
- color: #fff;
-}
-
-/* About section */
-.sidebar-about h1 {
- color: #fff;
- margin-top: 0;
- font-family: "Bitter", sans-serif;
- font-size: 2rem;
-}
-
-/* Sidebar nav */
-.sidebar-nav {
- margin-bottom: 1rem;
-}
-.sidebar-nav-item {
- display: block;
- line-height: 1.75;
-}
-a.sidebar-nav-item:hover,
-a.sidebar-nav-item:focus {
- text-decoration: underline;
-}
-.sidebar-nav-item.active {
- font-weight: bold;
-}
-
-/* Sticky sidebar
- *
- * Add the `sidebar-sticky` class to the sidebar's container to affix it the
- * contents to the bottom of the sidebar in tablets and up.
- */
-
-.sidebar-sticky-bottom img{
- margin-left: auto;
- margin-right: auto;
-}
-
-@media (min-width: 48em) {
- .sidebar-sticky {
- position: absolute;
- right: 1rem;
- left: 1rem;
- }
-
- .sidebar-sticky-bottom {
- position: absolute;
- bottom: 0rem;
- right: 1rem;
- left: 1rem;
- }
-}
-
-
-/* Container
- *
- * Align the contents of the site above the proper threshold with some margin-fu
- * with a 25%-wide `.sidebar`.
- */
-
-.content {
- padding-top: 4rem;
- padding-bottom: 4rem;
-}
-
-@media (min-width: 48em) {
- .content {
- max-width: 48rem;
- margin-left: 14rem;
- margin-right: 2rem;
- }
-}
-
-@media (min-width: 64em) {
- .content {
- margin-left: 18rem;
- margin-right: 2rem;
- }
-}
-
-
-/*
- * Reverse layout
- *
- * Flip the orientation of the page by placing the `.sidebar` on the right.
- */
-
-@media (min-width: 48em) {
- .layout-reverse .sidebar {
- left: auto;
- right: 0;
- }
- .layout-reverse .content {
- margin-left: 2rem;
- margin-right: 20rem;
- }
-}
-
-@media (min-width: 64em) {
- .layout-reverse .content {
- margin-left: 4rem;
- margin-right: 22rem;
- }
-}
-
-/*
- * Themes
- *
- * As of v1.1, Hyde includes optional themes to color the sidebar and links
- * within blog posts. To use, add the class of your choosing to the `body`.
- */
-
-/* Base16 (http://chriskempson.github.io/base16/#default) */
-
-/* Red */
-.theme-base-08 .sidebar {
- background-color: #ac4142;
-}
-.theme-base-08 .content a,
-.theme-base-08 .related-posts li a:hover {
- color: #ac4142;
-}
-
-/* Orange */
-.theme-base-09 .sidebar {
- background-color: #d28445;
-}
-.theme-base-09 .content a,
-.theme-base-09 .related-posts li a:hover {
- color: #d28445;
-}
-
-/* Yellow */
-.theme-base-0a .sidebar {
- background-color: #f4bf75;
-}
-.theme-base-0a .content a,
-.theme-base-0a .related-posts li a:hover {
- color: #f4bf75;
-}
-
-/* Green */
-.theme-base-0b .sidebar {
- background-color: #90a959;
-}
-.theme-base-0b .content a,
-.theme-base-0b .related-posts li a:hover {
- color: #90a959;
-}
-
-/* Cyan */
-.theme-base-0c .sidebar {
- background-color: #75b5aa;
-}
-.theme-base-0c .content a,
-.theme-base-0c .related-posts li a:hover {
- color: #75b5aa;
-}
-
-/* Blue */
-.theme-base-0d .sidebar {
- background-color: #6a9fb5;
-}
-.theme-base-0d .content a,
-.theme-base-0d .related-posts li a:hover {
- color: #6a9fb5;
-}
-
-/* Magenta */
-.theme-base-0e .sidebar {
- background-color: #aa759f;
-}
-.theme-base-0e .content a,
-.theme-base-0e .related-posts li a:hover {
- color: #aa759f;
-}
-
-/* Brown */
-.theme-base-0f .sidebar {
- background-color: #8f5536;
-}
-.theme-base-0f .content a,
-.theme-base-0f .related-posts li a:hover {
- color: #8f5536;
-}
diff --git a/public/css/poole.css b/public/css/poole.css
deleted file mode 100644
index 8ec27e7..0000000
--- a/public/css/poole.css
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * ___
- * /\_ \
- * _____ ___ ___\//\ \ __
- * /\ '__`\ / __`\ / __`\\ \ \ /'__`\
- * \ \ \_\ \/\ \_\ \/\ \_\ \\_\ \_/\ __/
- * \ \ ,__/\ \____/\ \____//\____\ \____\
- * \ \ \/ \/___/ \/___/ \/____/\/____/
- * \ \_\
- * \/_/
- *
- * Designed, built, and released under MIT license by @mdo. Learn more at
- * https://github.com/poole/poole.
- */
-
-
-/*
- * Contents
- *
- * Body resets
- * Custom type
- * Messages
- * Container
- * Masthead
- * Posts and pages
- * Pagination
- * Reverse layout
- * Themes
- */
-
-
-/*
- * Body resets
- *
- * Update the foundational and global aspects of the page.
- */
-
-* {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-html,
-body {
- margin: 0;
- padding: 0;
-}
-
-html {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 16px;
- line-height: 1.5;
-}
-@media (min-width: 38em) {
- html {
- font-size: 20px;
- }
-}
-
-body {
- color: #515151;
- background-color: #fff;
- -webkit-text-size-adjust: 100%;
- -ms-text-size-adjust: 100%;
-}
-
-/* No `:visited` state is required by default (browsers will use `a`) */
-a {
- color: #268bd2;
- text-decoration: none;
-}
-a strong {
- color: inherit;
-}
-/* `:focus` is linked to `:hover` for basic accessibility */
-a:hover,
-a:focus {
- text-decoration: underline;
-}
-
-/* Headings */
-h1, h2, h3, h4, h5, h6 {
- margin-bottom: .5rem;
- font-weight: bold;
- line-height: 1.25;
- color: #313131;
- text-rendering: optimizeLegibility;
-}
-h1 {
- font-size: 2rem;
-}
-h2 {
- margin-top: 1rem;
- font-size: 1.5rem;
-}
-h3 {
- margin-top: 1.5rem;
- font-size: 1.25rem;
-}
-h4, h5, h6 {
- margin-top: 1rem;
- font-size: 1rem;
-}
-
-/* Body text */
-p {
- margin-top: 0;
- margin-bottom: 1rem;
-}
-
-strong {
- color: #303030;
-}
-
-
-/* Lists */
-ul, ol, dl {
- margin-top: 0;
- margin-bottom: 1rem;
-}
-
-dt {
- font-weight: bold;
-}
-dd {
- margin-bottom: .5rem;
-}
-
-/* Misc */
-hr {
- position: relative;
- margin: 1.5rem 0;
- border: 0;
- border-top: 1px solid #eee;
- border-bottom: 1px solid #fff;
-}
-
-abbr {
- font-size: 85%;
- font-weight: bold;
- color: #555;
- text-transform: uppercase;
-}
-abbr[title] {
- cursor: help;
- border-bottom: 1px dotted #e5e5e5;
-}
-
-/* Code */
-code,
-pre {
- font-family: Menlo, Monaco, "Courier New", monospace;
-}
-code {
- padding: .25em .5em;
- font-size: 85%;
- color: #bf616a;
- background-color: #f9f9f9;
- border-radius: 3px;
-}
-pre {
- display: block;
- margin-top: 0;
- margin-bottom: 1rem;
- padding: 1rem;
- font-size: .8rem;
- line-height: 1.4;
- white-space: pre;
- white-space: pre-wrap;
- word-break: break-all;
- word-wrap: break-word;
- background-color: #f9f9f9;
-}
-pre code {
- padding: 0;
- font-size: 100%;
- color: inherit;
- background-color: transparent;
-}
-
-/* Pygments via Jekyll */
-.highlight {
- margin-bottom: 1rem;
- border-radius: 4px;
-}
-.highlight pre {
- margin-bottom: 0;
-}
-
-/* Gist via GitHub Pages */
-.gist .gist-file {
- font-family: Menlo, Monaco, "Courier New", monospace !important;
-}
-.gist .markdown-body {
- padding: 15px;
-}
-.gist pre {
- padding: 0;
- background-color: transparent;
-}
-.gist .gist-file .gist-data {
- font-size: .8rem !important;
- line-height: 1.4;
-}
-.gist code {
- padding: 0;
- color: inherit;
- background-color: transparent;
- border-radius: 0;
-}
-
-/* Quotes */
-blockquote {
- padding: .5rem 1rem;
- margin: .8rem 0;
- color: #7a7a7a;
- border-left: .25rem solid #e5e5e5;
-}
-blockquote p:last-child {
- margin-bottom: 0;
-}
-@media (min-width: 30em) {
- blockquote {
- padding-right: 5rem;
- padding-left: 1.25rem;
- }
-}
-
-img {
- display: block;
- max-width: 100%;
- margin: 0 0 1rem;
- border-radius: 5px;
-}
-
-/* Tables */
-table {
- margin-bottom: 1rem;
- width: 100%;
- border: 1px solid #e5e5e5;
- border-collapse: collapse;
-}
-td,
-th {
- padding: .25rem .5rem;
- border: 1px solid #e5e5e5;
-}
-tbody tr:nth-child(odd) td,
-tbody tr:nth-child(odd) th {
- background-color: #f9f9f9;
-}
-
-
-/*
- * Custom type
- *
- * Extend paragraphs with `.lead` for larger introductory text.
- */
-
-.lead {
- font-size: 1.25rem;
- font-weight: 300;
-}
-
-
-/*
- * Messages
- *
- * Show alert messages to users. You may add it to single elements like a ``,
- * or to a parent if there are multiple elements to show.
- */
-
-.message {
- margin-bottom: 1rem;
- padding: 1rem;
- color: #717171;
- background-color: #f9f9f9;
-}
-
-
-/*
- * Container
- *
- * Center the page content.
- */
-
-.container {
- max-width: 38rem;
- padding-left: 1rem;
- padding-right: 1rem;
- margin-left: auto;
- margin-right: auto;
-}
-
-
-/*
- * Masthead
- *
- * Super small header above the content for site name and short description.
- */
-
-.masthead {
- padding-top: 1rem;
- padding-bottom: 1rem;
- margin-bottom: 3rem;
-}
-.masthead-title {
- margin-top: 0;
- margin-bottom: 0;
- color: #505050;
-}
-.masthead-title a {
- color: #505050;
-}
-.masthead-title small {
- font-size: 75%;
- font-weight: 400;
- color: #c0c0c0;
- letter-spacing: 0;
-}
-
-
-/*
- * Posts and pages
- *
- * Each post is wrapped in `.post` and is used on default and post layouts. Each
- * page is wrapped in `.page` and is only used on the page layout.
- */
-
-.page,
-.post {
- margin-bottom: 4em;
-}
-
-/* Blog post or page title */
-.page-title,
-.post-title,
-.post-title a {
- color: #303030;
-}
-.page-title,
-.post-title {
- margin-top: 0;
-}
-
-/* Meta data line below post title */
-.post-date {
- display: block;
- margin-top: -.5rem;
- margin-bottom: 1rem;
- color: #9a9a9a;
-}
-
-/* Related posts */
-.related {
- padding-top: 2rem;
- padding-bottom: 2rem;
- border-top: 1px solid #eee;
-}
-.related-posts {
- padding-left: 0;
- list-style: none;
-}
-.related-posts h3 {
- margin-top: 0;
-}
-.related-posts li small {
- font-size: 75%;
- color: #999;
-}
-.related-posts li a:hover {
- color: #268bd2;
- text-decoration: none;
-}
-.related-posts li a:hover small {
- color: inherit;
-}
-
-
-/*
- * Pagination
- *
- * Super lightweight (HTML-wise) blog pagination. `span`s are provide for when
- * there are no more previous or next posts to show.
- */
-
-.pagination {
- overflow: hidden; /* clearfix */
- margin-left: -1rem;
- margin-right: -1rem;
- font-family: "PT Sans", Helvetica, Arial, sans-serif;
- color: #ccc;
- text-align: center;
-}
-
-/* Pagination items can be `span`s or `a`s */
-.pagination-item {
- display: block;
- padding: 1rem;
- border: 1px solid #eee;
-}
-.pagination-item:first-child {
- margin-bottom: -1px;
-}
-
-/* Only provide a hover state for linked pagination items */
-a.pagination-item:hover {
- background-color: #f5f5f5;
-}
-
-@media (min-width: 30em) {
- .pagination {
- margin: 3rem 0;
- }
- .pagination-item {
- float: left;
- width: 50%;
- }
- .pagination-item:first-child {
- margin-bottom: 0;
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
- }
- .pagination-item:last-child {
- margin-left: -1px;
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
- }
-}
diff --git a/public/css/styles.scss b/public/css/styles.scss
deleted file mode 100644
index ada33da..0000000
--- a/public/css/styles.scss
+++ /dev/null
@@ -1,7 +0,0 @@
----
-# comment to ensure Jekyll properly reads file.
----
-
-@import "base";
-@import "type";
-@import "layout";
\ No newline at end of file
diff --git a/public/css/syntax.css b/public/css/syntax.css
deleted file mode 100644
index 15ad797..0000000
--- a/public/css/syntax.css
+++ /dev/null
@@ -1,65 +0,0 @@
-.highlight .hll { background-color: #ffc; }
-.highlight .c { color: #999; } /* Comment */
-.highlight .err { color: #a00; background-color: #faa } /* Error */
-.highlight .k { color: #069; } /* Keyword */
-.highlight .o { color: #555 } /* Operator */
-.highlight .cm { color: #09f; font-style: italic } /* Comment.Multiline */
-.highlight .cp { color: #099 } /* Comment.Preproc */
-.highlight .c1 { color: #999; } /* Comment.Single */
-.highlight .cs { color: #999; } /* Comment.Special */
-.highlight .gd { background-color: #fcc; border: 1px solid #c00 } /* Generic.Deleted */
-.highlight .ge { font-style: italic } /* Generic.Emph */
-.highlight .gr { color: #f00 } /* Generic.Error */
-.highlight .gh { color: #030; } /* Generic.Heading */
-.highlight .gi { background-color: #cfc; border: 1px solid #0c0 } /* Generic.Inserted */
-.highlight .go { color: #aaa } /* Generic.Output */
-.highlight .gp { color: #009; } /* Generic.Prompt */
-.highlight .gs { } /* Generic.Strong */
-.highlight .gu { color: #030; } /* Generic.Subheading */
-.highlight .gt { color: #9c6 } /* Generic.Traceback */
-.highlight .kc { color: #069; } /* Keyword.Constant */
-.highlight .kd { color: #069; } /* Keyword.Declaration */
-.highlight .kn { color: #069; } /* Keyword.Namespace */
-.highlight .kp { color: #069 } /* Keyword.Pseudo */
-.highlight .kr { color: #069; } /* Keyword.Reserved */
-.highlight .kt { color: #078; } /* Keyword.Type */
-.highlight .m { color: #f60 } /* Literal.Number */
-.highlight .s { color: #d44950 } /* Literal.String */
-.highlight .na { color: #4f9fcf } /* Name.Attribute */
-.highlight .nb { color: #366 } /* Name.Builtin */
-.highlight .nc { color: #0a8; } /* Name.Class */
-.highlight .no { color: #360 } /* Name.Constant */
-.highlight .nd { color: #99f } /* Name.Decorator */
-.highlight .ni { color: #999; } /* Name.Entity */
-.highlight .ne { color: #c00; } /* Name.Exception */
-.highlight .nf { color: #c0f } /* Name.Function */
-.highlight .nl { color: #99f } /* Name.Label */
-.highlight .nn { color: #0cf; } /* Name.Namespace */
-.highlight .nt { color: #2f6f9f; } /* Name.Tag */
-.highlight .nv { color: #033 } /* Name.Variable */
-.highlight .ow { color: #000; } /* Operator.Word */
-.highlight .w { color: #bbb } /* Text.Whitespace */
-.highlight .mf { color: #f60 } /* Literal.Number.Float */
-.highlight .mh { color: #f60 } /* Literal.Number.Hex */
-.highlight .mi { color: #f60 } /* Literal.Number.Integer */
-.highlight .mo { color: #f60 } /* Literal.Number.Oct */
-.highlight .sb { color: #c30 } /* Literal.String.Backtick */
-.highlight .sc { color: #c30 } /* Literal.String.Char */
-.highlight .sd { color: #c30; font-style: italic } /* Literal.String.Doc */
-.highlight .s2 { color: #c30 } /* Literal.String.Double */
-.highlight .se { color: #c30; } /* Literal.String.Escape */
-.highlight .sh { color: #c30 } /* Literal.String.Heredoc */
-.highlight .si { color: #a00 } /* Literal.String.Interpol */
-.highlight .sx { color: #c30 } /* Literal.String.Other */
-.highlight .sr { color: #3aa } /* Literal.String.Regex */
-.highlight .s1 { color: #c30 } /* Literal.String.Single */
-.highlight .ss { color: #fc3 } /* Literal.String.Symbol */
-.highlight .bp { color: #366 } /* Name.Builtin.Pseudo */
-.highlight .vc { color: #033 } /* Name.Variable.Class */
-.highlight .vg { color: #033 } /* Name.Variable.Global */
-.highlight .vi { color: #033 } /* Name.Variable.Instance */
-.highlight .il { color: #f60 } /* Literal.Number.Integer.Long */
-
-.css .o,
-.css .o + .nt,
-.css .nt + .nt { color: #999; }
diff --git a/public/favicon.ico b/public/favicon.ico
deleted file mode 100644
index e82b821..0000000
Binary files a/public/favicon.ico and /dev/null differ
diff --git a/public/images/sandbox.png b/public/images/sandbox.png
deleted file mode 100644
index c6f928e..0000000
Binary files a/public/images/sandbox.png and /dev/null differ
diff --git a/public/images/shot-chart-harden-screen-shot.png b/public/images/shot-chart-harden-screen-shot.png
deleted file mode 100644
index 3ae568c..0000000
Binary files a/public/images/shot-chart-harden-screen-shot.png and /dev/null differ
diff --git a/public/js/datalib.js b/public/js/datalib.js
deleted file mode 100644
index 5140e74..0000000
--- a/public/js/datalib.js
+++ /dev/null
@@ -1,4590 +0,0 @@
-(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.dl = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= N) return EOF; // special case: end of file
- if (eol) return eol = false, EOL; // special case: end of line
-
- // special case: quotes
- var j = I;
- if (text.charCodeAt(j) === 34) {
- var i = j;
- while (i++ < N) {
- if (text.charCodeAt(i) === 34) {
- if (text.charCodeAt(i + 1) !== 34) break;
- ++i;
- }
- }
- I = i + 2;
- var c = text.charCodeAt(i + 1);
- if (c === 13) {
- eol = true;
- if (text.charCodeAt(i + 2) === 10) ++I;
- } else if (c === 10) {
- eol = true;
- }
- return text.slice(j + 1, i).replace(/""/g, "\"");
- }
-
- // common case: find next delimiter or newline
- while (I < N) {
- var c = text.charCodeAt(I++), k = 1;
- if (c === 10) eol = true; // \n
- else if (c === 13) { eol = true; if (text.charCodeAt(I) === 10) ++I, ++k; } // \r|\r\n
- else if (c !== delimiterCode) continue;
- return text.slice(j, I - k);
- }
-
- // special case: last token before EOF
- return text.slice(j);
- }
-
- while ((t = token()) !== EOF) {
- var a = [];
- while (t !== EOL && t !== EOF) {
- a.push(t);
- t = token();
- }
- if (f && (a = f(a, n++)) == null) continue;
- rows.push(a);
- }
-
- return rows;
- }
-
- function format(rows) {
- if (Array.isArray(rows[0])) return formatRows(rows); // deprecated; use formatRows
- var fieldSet = Object.create(null), fields = [];
-
- // Compute unique fields in order of discovery.
- rows.forEach(function(row) {
- for (var field in row) {
- if (!((field += "") in fieldSet)) {
- fields.push(fieldSet[field] = field);
- }
- }
- });
-
- return [fields.map(formatValue).join(delimiter)].concat(rows.map(function(row) {
- return fields.map(function(field) {
- return formatValue(row[field]);
- }).join(delimiter);
- })).join("\n");
- }
-
- function formatRows(rows) {
- return rows.map(formatRow).join("\n");
- }
-
- function formatRow(row) {
- return row.map(formatValue).join(delimiter);
- }
-
- function formatValue(text) {
- return reFormat.test(text) ? "\"" + text.replace(/\"/g, "\"\"") + "\"" : text;
- }
-
- return {
- parse: parse,
- parseRows: parseRows,
- format: format,
- formatRows: formatRows
- };
- }
-
- exports.csv = dsv(",");
- exports.tsv = dsv("\t");
-
- exports.dsv = dsv;
-
-}));
-},{}],3:[function(require,module,exports){
-if (typeof Map === "undefined") {
- Map = function() { this.clear(); };
- Map.prototype = {
- set: function(k, v) { this._[k] = v; return this; },
- get: function(k) { return this._[k]; },
- has: function(k) { return k in this._; },
- delete: function(k) { return k in this._ && delete this._[k]; },
- clear: function() { this._ = Object.create(null); },
- get size() { var n = 0; for (var k in this._) ++n; return n; },
- forEach: function(c) { for (var k in this._) c(this._[k], k, this); }
- };
-} else (function() {
- var m = new Map;
- if (m.set(0, 0) !== m) {
- m = m.set;
- Map.prototype.set = function() { m.apply(this, arguments); return this; };
- }
-})();
-
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- factory((global.format = {}));
-}(this, function (exports) { 'use strict';
-
- var zhCn = {
- decimal: ".",
- thousands: ",",
- grouping: [3],
- currency: ["¥", ""]
- };
-
- var ruRu = {
- decimal: ",",
- thousands: "\xa0",
- grouping: [3],
- currency: ["", "\xa0руб."]
- };
-
- var ptBr = {
- decimal: ",",
- thousands: ".",
- grouping: [3],
- currency: ["R$", ""]
- };
-
- var plPl = {
- decimal: ",",
- thousands: ".",
- grouping: [3],
- currency: ["", "zł"]
- };
-
- var nlNl = {
- decimal: ",",
- thousands: ".",
- grouping: [3],
- currency: ["€\xa0", ""]
- };
-
- var mkMk = {
- decimal: ",",
- thousands: ".",
- grouping: [3],
- currency: ["", "\xa0ден."]
- };
-
- var itIt = {
- decimal: ",",
- thousands: ".",
- grouping: [3],
- currency: ["€", ""]
- };
-
- var heIl = {
- decimal: ".",
- thousands: ",",
- grouping: [3],
- currency: ["₪", ""]
- };
-
- var frFr = {
- decimal: ",",
- thousands: ".",
- grouping: [3],
- currency: ["", "\xa0€"]
- };
-
- var frCa = {
- decimal: ",",
- thousands: "\xa0",
- grouping: [3],
- currency: ["", "$"]
- };
-
- var fiFi = {
- decimal: ",",
- thousands: "\xa0",
- grouping: [3],
- currency: ["", "\xa0€"]
- };
-
- var esEs = {
- decimal: ",",
- thousands: ".",
- grouping: [3],
- currency: ["", "\xa0€"]
- };
-
- var enUs = {
- decimal: ".",
- thousands: ",",
- grouping: [3],
- currency: ["$", ""]
- };
-
- var enGb = {
- decimal: ".",
- thousands: ",",
- grouping: [3],
- currency: ["£", ""]
- };
-
- var enCa = {
- decimal: ".",
- thousands: ",",
- grouping: [3],
- currency: ["$", ""]
- };
-
- var deDe = {
- decimal: ",",
- thousands: ".",
- grouping: [3],
- currency: ["", "\xa0€"]
- };
-
- var caEs = {
- decimal: ",",
- thousands: ".",
- grouping: [3],
- currency: ["", "\xa0€"]
- };
-
-
- // Computes the decimal coefficient and exponent of the specified number x with
- // significant digits p, where x is positive and p is in [1, 21] or undefined.
- // For example, formatDecimal(1.23) returns ["123", 0].
- function formatDecimal(x, p) {
- if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
- var i, coefficient = x.slice(0, i);
-
- // The string returned by toExponential either has the form \d\.\d+e[-+]\d+
- // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
- return [
- coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
- +x.slice(i + 1)
- ];
- }
-
- function exponent(x) {
- return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;
- }
-
- var prefixExponent;
-
- function formatPrefixAuto(x, p) {
- var d = formatDecimal(x, p);
- if (!d) return x + "";
- var coefficient = d[0],
- exponent = d[1],
- i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 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, p + i - 1)[0]; // less than 1y!
- }
-
- function formatRounded(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");
- }
-
- function formatDefault(x, p) {
- x = x.toPrecision(p);
-
- out: for (var n = x.length, i = 1, i0 = -1, i1; i < n; ++i) {
- switch (x[i]) {
- case ".": i0 = i1 = i; break;
- case "0": if (i0 === 0) i0 = i; i1 = i; break;
- case "e": break out;
- default: if (i0 > 0) i0 = 0; break;
- }
- }
-
- return i0 > 0 ? x.slice(0, i0) + x.slice(i1 + 1) : x;
- }
-
- var formatTypes = {
- "": formatDefault,
- "%": function(x, p) { return (x * 100).toFixed(p); },
- "b": function(x) { return Math.round(x).toString(2); },
- "c": function(x) { return x + ""; },
- "d": function(x) { return Math.round(x).toString(10); },
- "e": function(x, p) { return x.toExponential(p); },
- "f": function(x, p) { return x.toFixed(p); },
- "g": function(x, p) { return x.toPrecision(p); },
- "o": function(x) { return Math.round(x).toString(8); },
- "p": function(x, p) { return formatRounded(x * 100, p); },
- "r": formatRounded,
- "s": formatPrefixAuto,
- "X": function(x) { return Math.round(x).toString(16).toUpperCase(); },
- "x": function(x) { return Math.round(x).toString(16); }
- };
-
-
- // [[fill]align][sign][symbol][0][width][,][.precision][type]
- var re = /^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;
-
- function formatSpecifier(specifier) {
- return new FormatSpecifier(specifier);
- }
-
- function FormatSpecifier(specifier) {
- if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
-
- var match,
- fill = match[1] || " ",
- align = match[2] || ">",
- sign = match[3] || "-",
- symbol = match[4] || "",
- zero = !!match[5],
- width = match[6] && +match[6],
- comma = !!match[7],
- precision = match[8] && +match[8].slice(1),
- type = match[9] || "";
-
- // The "n" type is an alias for ",g".
- if (type === "n") comma = true, type = "g";
-
- // Map invalid types to the default format.
- else if (!formatTypes[type]) type = "";
-
- // If zero fill is specified, padding goes after sign and before digits.
- if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";
-
- this.fill = fill;
- this.align = align;
- this.sign = sign;
- this.symbol = symbol;
- this.zero = zero;
- this.width = width;
- this.comma = comma;
- this.precision = precision;
- this.type = type;
- }
-
- FormatSpecifier.prototype.toString = function() {
- return this.fill
- + this.align
- + this.sign
- + this.symbol
- + (this.zero ? "0" : "")
- + (this.width == null ? "" : Math.max(1, this.width | 0))
- + (this.comma ? "," : "")
- + (this.precision == null ? "" : "." + Math.max(0, this.precision | 0))
- + this.type;
- };
-
- function formatGroup(grouping, thousands) {
- return function(value, width) {
- var i = value.length,
- t = [],
- j = 0,
- g = grouping[0],
- length = 0;
-
- while (i > 0 && g > 0) {
- if (length + g + 1 > width) g = Math.max(1, width - length);
- t.push(value.substring(i -= g, i + g));
- if ((length += g + 1) > width) break;
- g = grouping[j = (j + 1) % grouping.length];
- }
-
- return t.reverse().join(thousands);
- };
- }
-
- var prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];
-
- function identity(x) {
- return x;
- }
-
- function locale(locale) {
- var group = locale.grouping && locale.thousands ? formatGroup(locale.grouping, locale.thousands) : identity,
- currency = locale.currency,
- decimal = locale.decimal;
-
- function format(specifier) {
- specifier = formatSpecifier(specifier);
-
- var fill = specifier.fill,
- align = specifier.align,
- sign = specifier.sign,
- symbol = specifier.symbol,
- zero = specifier.zero,
- width = specifier.width,
- comma = specifier.comma,
- precision = specifier.precision,
- type = specifier.type;
-
- // Compute the prefix and suffix.
- // For SI-prefix, the suffix is lazily computed.
- var prefix = symbol === "$" ? currency[0] : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
- suffix = symbol === "$" ? currency[1] : /[%p]/.test(type) ? "%" : "";
-
- // What format function should we use?
- // Is this an integer type?
- // Can this type generate exponential notation?
- var formatType = formatTypes[type],
- maybeSuffix = !type || /[defgprs%]/.test(type);
-
- // Set the default precision if not specified,
- // or clamp the specified precision to the supported range.
- // For significant precision, it must be in [1, 21].
- // For fixed precision, it must be in [0, 20].
- precision = precision == null ? (type ? 6 : 12)
- : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
- : Math.max(0, Math.min(20, precision));
-
- return function(value) {
- var valuePrefix = prefix,
- valueSuffix = suffix;
-
- if (type === "c") {
- valueSuffix = formatType(value) + valueSuffix;
- value = "";
- } else {
- value = +value;
-
- // Convert negative to positive, and compute the prefix.
- // Note that -0 is not less than 0, but 1 / -0 is!
- var valueNegative = (value < 0 || 1 / value < 0) && (value *= -1, true);
-
- // Perform the initial formatting.
- value = formatType(value, precision);
-
- // Compute the prefix and suffix.
- valuePrefix = (valueNegative ? (sign === "(" ? sign : "-") : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
- valueSuffix = valueSuffix + (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + (valueNegative && sign === "(" ? ")" : "");
-
- // Break the formatted value into the integer “value” part that can be
- // grouped, and fractional or exponential “suffix” part that is not.
- if (maybeSuffix) {
- var i = -1, n = value.length, c;
- while (++i < n) {
- if (c = value.charCodeAt(i), 48 > c || c > 57) {
- valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
- value = value.slice(0, i);
- break;
- }
- }
- }
- }
-
- // If the fill character is not "0", grouping is applied before padding.
- if (comma && !zero) value = group(value, Infinity);
-
- // Compute the padding.
- var length = valuePrefix.length + value.length + valueSuffix.length,
- padding = length < width ? new Array(width - length + 1).join(fill) : "";
-
- // If the fill character is "0", grouping is applied after padding.
- if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
-
- // Reconstruct the final output based on the desired alignment.
- switch (align) {
- case "<": return valuePrefix + value + valueSuffix + padding;
- case "=": return valuePrefix + padding + value + valueSuffix;
- case "^": return padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);
- }
- return padding + valuePrefix + value + valueSuffix;
- };
- }
-
- function formatPrefix(specifier, value) {
- var f = format((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
- e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
- k = Math.pow(10, -e),
- prefix = prefixes[8 + e / 3];
- return function(value) {
- return f(k * value) + prefix;
- };
- }
-
- return {
- format: format,
- formatPrefix: formatPrefix
- };
- }
-
- function precisionRound(step, max) {
- return Math.max(0, exponent(Math.abs(max)) - exponent(Math.abs(step))) + 1;
- }
-
- function precisionPrefix(step, value) {
- return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
- }
-
- function precisionFixed(step) {
- return Math.max(0, -exponent(Math.abs(step)));
- }
-
- var localeDefinitions = (new Map)
- .set("ca-ES", caEs)
- .set("de-DE", deDe)
- .set("en-CA", enCa)
- .set("en-GB", enGb)
- .set("en-US", enUs)
- .set("es-ES", esEs)
- .set("fi-FI", fiFi)
- .set("fr-CA", frCa)
- .set("fr-FR", frFr)
- .set("he-IL", heIl)
- .set("it-IT", itIt)
- .set("mk-MK", mkMk)
- .set("nl-NL", nlNl)
- .set("pl-PL", plPl)
- .set("pt-BR", ptBr)
- .set("ru-RU", ruRu)
- .set("zh-CN", zhCn);
-
- var defaultLocale = locale(enUs);
- exports.format = defaultLocale.format;
- exports.formatPrefix = defaultLocale.formatPrefix;
-
- function localeFormat(definition) {
- if (typeof definition === "string") {
- definition = localeDefinitions.get(definition);
- if (!definition) return null;
- }
- return locale(definition);
- }
- ;
-
- exports.localeFormat = localeFormat;
- exports.formatSpecifier = formatSpecifier;
- exports.precisionFixed = precisionFixed;
- exports.precisionPrefix = precisionPrefix;
- exports.precisionRound = precisionRound;
-
-}));
-},{}],4:[function(require,module,exports){
-if (typeof Map === "undefined") {
- Map = function() { this.clear(); };
- Map.prototype = {
- set: function(k, v) { this._[k] = v; return this; },
- get: function(k) { return this._[k]; },
- has: function(k) { return k in this._; },
- delete: function(k) { return k in this._ && delete this._[k]; },
- clear: function() { this._ = Object.create(null); },
- get size() { var n = 0; for (var k in this._) ++n; return n; },
- forEach: function(c) { for (var k in this._) c(this._[k], k, this); }
- };
-} else (function() {
- var m = new Map;
- if (m.set(0, 0) !== m) {
- m = m.set;
- Map.prototype.set = function() { m.apply(this, arguments); return this; };
- }
-})();
-
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- factory((global.timeFormat = {}));
-}(this, function (exports) { 'use strict';
-
- var zhCn = {
- dateTime: "%a %b %e %X %Y",
- date: "%Y/%-m/%-d",
- time: "%H:%M:%S",
- periods: ["上午", "下午"],
- days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
- shortDays: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
- months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
- shortMonths: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
- };
-
- var ruRu = {
- dateTime: "%A, %e %B %Y г. %X",
- date: "%d.%m.%Y",
- time: "%H:%M:%S",
- periods: ["AM", "PM"],
- days: ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"],
- shortDays: ["вс", "пн", "вт", "ср", "чт", "пт", "сб"],
- months: ["января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"],
- shortMonths: ["янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"]
- };
-
- var ptBr = {
- dateTime: "%A, %e de %B de %Y. %X",
- date: "%d/%m/%Y",
- time: "%H:%M:%S",
- periods: ["AM", "PM"],
- days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"],
- shortDays: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"],
- months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
- shortMonths: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"]
- };
-
- var plPl = {
- dateTime: "%A, %e %B %Y, %X",
- date: "%d/%m/%Y",
- time: "%H:%M:%S",
- periods: ["AM", "PM"], // unused
- days: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"],
- shortDays: ["Niedz.", "Pon.", "Wt.", "Śr.", "Czw.", "Pt.", "Sob."],
- months: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"],
- shortMonths: ["Stycz.", "Luty", "Marz.", "Kwie.", "Maj", "Czerw.", "Lipc.", "Sierp.", "Wrz.", "Paźdz.", "Listop.", "Grudz."]/* In Polish language abbraviated months are not commonly used so there is a dispute about the proper abbraviations. */
- };
-
- var nlNl = {
- dateTime: "%a %e %B %Y %T",
- date: "%d-%m-%Y",
- time: "%H:%M:%S",
- periods: ["AM", "PM"], // unused
- days: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"],
- shortDays: ["zo", "ma", "di", "wo", "do", "vr", "za"],
- months: ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"],
- shortMonths: ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"]
- };
-
- var mkMk = {
- dateTime: "%A, %e %B %Y г. %X",
- date: "%d.%m.%Y",
- time: "%H:%M:%S",
- periods: ["AM", "PM"],
- days: ["недела", "понеделник", "вторник", "среда", "четврток", "петок", "сабота"],
- shortDays: ["нед", "пон", "вто", "сре", "чет", "пет", "саб"],
- months: ["јануари", "февруари", "март", "април", "мај", "јуни", "јули", "август", "септември", "октомври", "ноември", "декември"],
- shortMonths: ["јан", "фев", "мар", "апр", "мај", "јун", "јул", "авг", "сеп", "окт", "ное", "дек"]
- };
-
- var itIt = {
- dateTime: "%A %e %B %Y, %X",
- date: "%d/%m/%Y",
- time: "%H:%M:%S",
- periods: ["AM", "PM"], // unused
- days: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"],
- shortDays: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"],
- months: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],
- shortMonths: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"]
- };
-
- var heIl = {
- dateTime: "%A, %e ב%B %Y %X",
- date: "%d.%m.%Y",
- time: "%H:%M:%S",
- periods: ["AM", "PM"],
- days: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"],
- shortDays: ["א׳", "ב׳", "ג׳", "ד׳", "ה׳", "ו׳", "ש׳"],
- months: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"],
- shortMonths: ["ינו׳", "פבר׳", "מרץ", "אפר׳", "מאי", "יוני", "יולי", "אוג׳", "ספט׳", "אוק׳", "נוב׳", "דצמ׳"]
- };
-
- var frFr = {
- dateTime: "%A, le %e %B %Y, %X",
- date: "%d/%m/%Y",
- time: "%H:%M:%S",
- periods: ["AM", "PM"], // unused
- days: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"],
- shortDays: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
- months: ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"],
- shortMonths: ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."]
- };
-
- var frCa = {
- dateTime: "%a %e %b %Y %X",
- date: "%Y-%m-%d",
- time: "%H:%M:%S",
- periods: ["", ""],
- days: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"],
- shortDays: ["dim", "lun", "mar", "mer", "jeu", "ven", "sam"],
- months: ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"],
- shortMonths: ["jan", "fév", "mar", "avr", "mai", "jui", "jul", "aoû", "sep", "oct", "nov", "déc"]
- };
-
- var fiFi = {
- dateTime: "%A, %-d. %Bta %Y klo %X",
- date: "%-d.%-m.%Y",
- time: "%H:%M:%S",
- periods: ["a.m.", "p.m."],
- days: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"],
- shortDays: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"],
- months: ["tammikuu", "helmikuu", "maaliskuu", "huhtikuu", "toukokuu", "kesäkuu", "heinäkuu", "elokuu", "syyskuu", "lokakuu", "marraskuu", "joulukuu"],
- shortMonths: ["Tammi", "Helmi", "Maalis", "Huhti", "Touko", "Kesä", "Heinä", "Elo", "Syys", "Loka", "Marras", "Joulu"]
- };
-
- var esEs = {
- dateTime: "%A, %e de %B de %Y, %X",
- date: "%d/%m/%Y",
- time: "%H:%M:%S",
- periods: ["AM", "PM"],
- days: ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"],
- shortDays: ["dom", "lun", "mar", "mié", "jue", "vie", "sáb"],
- months: ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"],
- shortMonths: ["ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic"]
- };
-
- var enUs = {
- dateTime: "%a %b %e %X %Y",
- date: "%m/%d/%Y",
- time: "%H:%M:%S",
- 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 enGb = {
- dateTime: "%a %e %b %X %Y",
- date: "%d/%m/%Y",
- time: "%H:%M:%S",
- 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 enCa = {
- dateTime: "%a %b %e %X %Y",
- date: "%Y-%m-%d",
- time: "%H:%M:%S",
- 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 deDe = {
- dateTime: "%A, der %e. %B %Y, %X",
- date: "%d.%m.%Y",
- time: "%H:%M:%S",
- periods: ["AM", "PM"], // unused
- days: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
- shortDays: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
- months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
- shortMonths: ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"]
- };
-
- var caEs = {
- dateTime: "%A, %e de %B de %Y, %X",
- date: "%d/%m/%Y",
- time: "%H:%M:%S",
- periods: ["AM", "PM"],
- days: ["diumenge", "dilluns", "dimarts", "dimecres", "dijous", "divendres", "dissabte"],
- shortDays: ["dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."],
- months: ["gener", "febrer", "març", "abril", "maig", "juny", "juliol", "agost", "setembre", "octubre", "novembre", "desembre"],
- shortMonths: ["gen.", "febr.", "març", "abr.", "maig", "juny", "jul.", "ag.", "set.", "oct.", "nov.", "des."]
- };
-
- var t0 = new Date;
- var t1 = new Date;
-
- function newInterval(floori, offseti, count) {
-
- function interval(date) {
- return floori(date = new Date(+date)), date;
- }
-
- interval.floor = interval;
-
- interval.round = function(date) {
- var d0 = new Date(+date),
- d1 = new Date(date - 1);
- floori(d0), floori(d1), offseti(d1, 1);
- return date - d0 < d1 - date ? d0 : d1;
- };
-
- interval.ceil = function(date) {
- return floori(date = new Date(date - 1)), offseti(date, 1), date;
- };
-
- interval.offset = function(date, step) {
- return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
- };
-
- interval.range = function(start, stop, step) {
- var range = [];
- start = new Date(start - 1);
- stop = new Date(+stop);
- step = step == null ? 1 : Math.floor(step);
- if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
- offseti(start, 1), floori(start);
- if (start < stop) range.push(new Date(+start));
- while (offseti(start, step), floori(start), start < stop) range.push(new Date(+start));
- return range;
- };
-
- interval.filter = function(test) {
- return newInterval(function(date) {
- while (floori(date), !test(date)) date.setTime(date - 1);
- }, function(date, step) {
- while (--step >= 0) while (offseti(date, 1), !test(date));
- });
- };
-
- if (count) interval.count = function(start, end) {
- t0.setTime(+start), t1.setTime(+end);
- floori(t0), floori(t1);
- return Math.floor(count(t0, t1));
- };
-
- return interval;
- }
-
- var day = 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()) * 6e4) / 864e5;
- });
-
- function weekday(i) {
- return newInterval(function(date) {
- date.setHours(0, 0, 0, 0);
- date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
- }, function(date, step) {
- date.setDate(date.getDate() + step * 7);
- }, function(start, end) {
- return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * 6e4) / 6048e5;
- });
- }
-
- var sunday = weekday(0);
- var monday = weekday(1);
-
- var year = newInterval(function(date) {
- date.setHours(0, 0, 0, 0);
- date.setMonth(0, 1);
- }, function(date, step) {
- date.setFullYear(date.getFullYear() + step);
- }, function(start, end) {
- return end.getFullYear() - start.getFullYear();
- });
-
- var utcDay = 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 utcWeekday(i) {
- return newInterval(function(date) {
- date.setUTCHours(0, 0, 0, 0);
- date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
- }, function(date, step) {
- date.setUTCDate(date.getUTCDate() + step * 7);
- }, function(start, end) {
- return (end - start) / 6048e5;
- });
- }
-
- var utcSunday = utcWeekday(0);
- var utcMonday = utcWeekday(1);
-
- var utcYear = newInterval(function(date) {
- date.setUTCHours(0, 0, 0, 0);
- date.setUTCMonth(0, 1);
- }, function(date, step) {
- date.setUTCFullYear(date.getUTCFullYear() + step);
- }, function(start, end) {
- return end.getUTCFullYear() - start.getUTCFullYear();
- });
-
- 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);
- date.setFullYear(d.y);
- return 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));
- date.setUTCFullYear(d.y);
- return 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};
- }
-
- function locale(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;
-
- var 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);
-
- var formats = {
- "a": formatShortWeekday,
- "A": formatWeekday,
- "b": formatShortMonth,
- "B": formatMonth,
- "c": null,
- "d": formatDayOfMonth,
- "e": formatDayOfMonth,
- "H": formatHour24,
- "I": formatHour12,
- "j": formatDayOfYear,
- "L": formatMilliseconds,
- "m": formatMonthNumber,
- "M": formatMinutes,
- "p": formatPeriod,
- "S": formatSeconds,
- "U": formatWeekNumberSunday,
- "w": formatWeekdayNumber,
- "W": formatWeekNumberMonday,
- "x": null,
- "X": null,
- "y": formatYear,
- "Y": formatFullYear,
- "Z": formatZone,
- "%": formatLiteralPercent
- };
-
- var utcFormats = {
- "a": formatUTCShortWeekday,
- "A": formatUTCWeekday,
- "b": formatUTCShortMonth,
- "B": formatUTCMonth,
- "c": null,
- "d": formatUTCDayOfMonth,
- "e": formatUTCDayOfMonth,
- "H": formatUTCHour24,
- "I": formatUTCHour12,
- "j": formatUTCDayOfYear,
- "L": formatUTCMilliseconds,
- "m": formatUTCMonthNumber,
- "M": formatUTCMinutes,
- "p": formatUTCPeriod,
- "S": formatUTCSeconds,
- "U": formatUTCWeekNumberSunday,
- "w": formatUTCWeekdayNumber,
- "W": formatUTCWeekNumberMonday,
- "x": null,
- "X": null,
- "y": formatUTCYear,
- "Y": formatUTCFullYear,
- "Z": formatUTCZone,
- "%": formatLiteralPercent
- };
-
- var parses = {
- "a": parseShortWeekday,
- "A": parseWeekday,
- "b": parseShortMonth,
- "B": parseMonth,
- "c": parseLocaleDateTime,
- "d": parseDayOfMonth,
- "e": parseDayOfMonth,
- "H": parseHour24,
- "I": parseHour24,
- "j": parseDayOfYear,
- "L": parseMilliseconds,
- "m": parseMonthNumber,
- "M": parseMinutes,
- "p": parsePeriod,
- "S": parseSeconds,
- "U": parseWeekNumberSunday,
- "w": parseWeekdayNumber,
- "W": parseWeekNumberMonday,
- "x": parseLocaleDate,
- "X": parseLocaleTime,
- "y": parseYear,
- "Y": parseFullYear,
- "Z": parseZone,
- "%": parseLiteralPercent
- };
-
- // These recursive directive definitions must be deferred.
- 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);
-
- function newFormat(specifier, formats) {
- return function(date) {
- var string = [],
- i = -1,
- j = 0,
- n = specifier.length,
- c,
- pad,
- format;
-
- while (++i < n) {
- if (specifier.charCodeAt(i) === 37) {
- string.push(specifier.slice(j, i));
- if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
- if (format = formats[c]) c = format(date, pad == null ? (c === "e" ? " " : "0") : pad);
- string.push(c);
- j = i + 1;
- }
- }
-
- string.push(specifier.slice(j, i));
- return string.join("");
- };
- }
-
- function newParse(specifier, newDate) {
- return function(string) {
- var d = newYear(1900),
- i = parseSpecifier(d, specifier, string, 0);
- if (i != string.length) return null;
-
- // The am-pm flag is 0 for AM, and 1 for PM.
- if ("p" in d) d.H = d.H % 12 + d.p * 12;
-
- // If a time zone is specified, all fields are interpreted as UTC and then
- // offset according to the specified time zone.
- if ("Z" in d) {
- if ("w" in d && ("W" in d || "U" in d)) {
- var day = utcDate(newYear(d.y)).getUTCDay();
- if ("W" in d) d.U = d.W, d.w = (d.w + 6) % 7, --day;
- d.m = 0;
- d.d = d.w + d.U * 7 - (day + 6) % 7;
- }
- d.H += d.Z / 100 | 0;
- d.M += d.Z % 100;
- return utcDate(d);
- }
-
- // Otherwise, all fields are in local time.
- if ("w" in d && ("W" in d || "U" in d)) {
- var day = newDate(newYear(d.y)).getDay();
- if ("W" in d) d.U = d.W, d.w = (d.w + 6) % 7, --day;
- d.m = 0;
- d.d = d.w + d.U * 7 - (day + 6) % 7;
- }
- return newDate(d);
- };
- }
-
- function parseSpecifier(d, specifier, string, j) {
- var i = 0,
- n = specifier.length,
- m = string.length,
- c,
- parse;
-
- while (i < n) {
- if (j >= m) return -1;
- c = specifier.charCodeAt(i++);
- if (c === 37) {
- c = specifier.charAt(i++);
- parse = parses[c in pads ? specifier.charAt(i++) : c];
- if (!parse || ((j = parse(d, string, j)) < 0)) return -1;
- } else if (c != string.charCodeAt(j++)) {
- return -1;
- }
- }
-
- return j;
- }
-
- function parseShortWeekday(d, string, i) {
- var n = shortWeekdayRe.exec(string.slice(i));
- return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
-
- function parseWeekday(d, string, i) {
- var n = weekdayRe.exec(string.slice(i));
- return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
-
- function parseShortMonth(d, string, i) {
- var n = shortMonthRe.exec(string.slice(i));
- return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
-
- function parseMonth(d, string, i) {
- var n = monthRe.exec(string.slice(i));
- return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
-
- function parseLocaleDateTime(d, string, i) {
- return parseSpecifier(d, locale_dateTime, string, i);
- }
-
- function parseLocaleDate(d, string, i) {
- return parseSpecifier(d, locale_date, string, i);
- }
-
- function parseLocaleTime(d, string, i) {
- return parseSpecifier(d, locale_time, string, i);
- }
-
- function parsePeriod(d, string, i) {
- var n = periodLookup.get(string.slice(i, i += 2).toLowerCase());
- return n == null ? -1 : (d.p = n, i);
- }
-
- function formatShortWeekday(d) {
- return locale_shortWeekdays[d.getDay()];
- }
-
- function formatWeekday(d) {
- return locale_weekdays[d.getDay()];
- }
-
- function formatShortMonth(d) {
- return locale_shortMonths[d.getMonth()];
- }
-
- function formatMonth(d) {
- return locale_months[d.getMonth()];
- }
-
- function formatPeriod(d) {
- return locale_periods[+(d.getHours() >= 12)];
- }
-
- function formatUTCShortWeekday(d) {
- return locale_shortWeekdays[d.getUTCDay()];
- }
-
- function formatUTCWeekday(d) {
- return locale_weekdays[d.getUTCDay()];
- }
-
- function formatUTCShortMonth(d) {
- return locale_shortMonths[d.getUTCMonth()];
- }
-
- function formatUTCMonth(d) {
- return locale_months[d.getUTCMonth()];
- }
-
- function formatUTCPeriod(d) {
- return locale_periods[+(d.getUTCHours() >= 12)];
- }
-
- return {
- format: function(specifier) {
- var f = newFormat(specifier += "", formats);
- f.parse = newParse(specifier, localDate);
- f.toString = function() { return specifier; };
- return f;
- },
- utcFormat: function(specifier) {
- var f = newFormat(specifier += "", utcFormats);
- f.parse = newParse(specifier, utcDate);
- f.toString = function() { return specifier; };
- return f;
- }
- };
- }
-
- var pads = {"-": "", "_": " ", "0": "0"};
- var numberRe = /^\s*\d+/;
- var percentRe = /^%/;
- var requoteRe = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
-
- function pad(value, fill, width) {
- var sign = value < 0 ? "-" : "",
- string = (sign ? -value : value) + "",
- length = string.length;
- return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
- }
-
- function requote(s) {
- return s.replace(requoteRe, "\\$&");
- }
-
- function formatRe(names) {
- return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
- }
-
- function formatLookup(names) {
- var map = new Map, i = -1, n = names.length;
- while (++i < n) map.set(names[i].toLowerCase(), i);
- return map;
- }
-
- function parseWeekdayNumber(d, string, i) {
- var n = numberRe.exec(string.slice(i, i + 1));
- return n ? (d.w = +n[0], i + n[0].length) : -1;
- }
-
- function parseWeekNumberSunday(d, string, i) {
- var n = numberRe.exec(string.slice(i));
- return n ? (d.U = +n[0], i + n[0].length) : -1;
- }
-
- function parseWeekNumberMonday(d, string, i) {
- var n = numberRe.exec(string.slice(i));
- return n ? (d.W = +n[0], i + n[0].length) : -1;
- }
-
- function parseFullYear(d, string, i) {
- var n = numberRe.exec(string.slice(i, i + 4));
- return n ? (d.y = +n[0], i + n[0].length) : -1;
- }
-
- function parseYear(d, string, i) {
- var n = numberRe.exec(string.slice(i, i + 2));
- return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;
- }
-
- function parseZone(d, string, i) {
- return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5))
- ? (d.Z = -string, i + 5) // sign differs from getTimezoneOffset!
- : -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 parseLiteralPercent(d, string, i) {
- var n = percentRe.exec(string.slice(i, i + 1));
- return n ? i + n[0].length : -1;
- }
-
- function formatDayOfMonth(d, p) {
- return pad(d.getDate(), p, 2);
- }
-
- function formatHour24(d, p) {
- return pad(d.getHours(), p, 2);
- }
-
- function formatHour12(d, p) {
- return pad(d.getHours() % 12 || 12, p, 2);
- }
-
- function formatDayOfYear(d, p) {
- return pad(1 + day.count(year(d), d), p, 3);
- }
-
- function formatMilliseconds(d, p) {
- return pad(d.getMilliseconds(), p, 3);
- }
-
- function formatMonthNumber(d, p) {
- return pad(d.getMonth() + 1, p, 2);
- }
-
- function formatMinutes(d, p) {
- return pad(d.getMinutes(), p, 2);
- }
-
- function formatSeconds(d, p) {
- return pad(d.getSeconds(), p, 2);
- }
-
- function formatWeekNumberSunday(d, p) {
- return pad(sunday.count(year(d), d), p, 2);
- }
-
- function formatWeekdayNumber(d) {
- return d.getDay();
- }
-
- function formatWeekNumberMonday(d, p) {
- return pad(monday.count(year(d), d), p, 2);
- }
-
- function formatYear(d, p) {
- return pad(d.getFullYear() % 100, p, 2);
- }
-
- function formatFullYear(d, p) {
- return pad(d.getFullYear() % 10000, p, 4);
- }
-
- function formatZone(d) {
- var z = d.getTimezoneOffset();
- return (z > 0 ? "-" : (z *= -1, "+"))
- + pad(z / 60 | 0, "0", 2)
- + pad(z % 60, "0", 2);
- }
-
- function formatUTCDayOfMonth(d, p) {
- return pad(d.getUTCDate(), p, 2);
- }
-
- function formatUTCHour24(d, p) {
- return pad(d.getUTCHours(), p, 2);
- }
-
- function formatUTCHour12(d, p) {
- return pad(d.getUTCHours() % 12 || 12, p, 2);
- }
-
- function formatUTCDayOfYear(d, p) {
- return pad(1 + utcDay.count(utcYear(d), d), p, 3);
- }
-
- function formatUTCMilliseconds(d, p) {
- return pad(d.getUTCMilliseconds(), p, 3);
- }
-
- function formatUTCMonthNumber(d, p) {
- return pad(d.getUTCMonth() + 1, p, 2);
- }
-
- function formatUTCMinutes(d, p) {
- return pad(d.getUTCMinutes(), p, 2);
- }
-
- function formatUTCSeconds(d, p) {
- return pad(d.getUTCSeconds(), p, 2);
- }
-
- function formatUTCWeekNumberSunday(d, p) {
- return pad(utcSunday.count(utcYear(d), d), p, 2);
- }
-
- function formatUTCWeekdayNumber(d) {
- return d.getUTCDay();
- }
-
- function formatUTCWeekNumberMonday(d, p) {
- return pad(utcMonday.count(utcYear(d), d), p, 2);
- }
-
- function formatUTCYear(d, p) {
- return pad(d.getUTCFullYear() % 100, p, 2);
- }
-
- function formatUTCFullYear(d, p) {
- return pad(d.getUTCFullYear() % 10000, p, 4);
- }
-
- function formatUTCZone() {
- return "+0000";
- }
-
- function formatLiteralPercent() {
- return "%";
- }
-
- var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ";
-
- function formatIsoNative(date) {
- return date.toISOString();
- }
-
- formatIsoNative.parse = function(string) {
- var date = new Date(string);
- return isNaN(date) ? null : date;
- };
-
- formatIsoNative.toString = function() {
- return isoSpecifier;
- };
-
- var formatIso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z")
- ? formatIsoNative
- : enUs.utcFormat(isoSpecifier);
-
- var isoFormat = formatIso;
-
- var localeDefinitions = (new Map)
- .set("ca-ES", caEs)
- .set("de-DE", deDe)
- .set("en-CA", enCa)
- .set("en-GB", enGb)
- .set("en-US", enUs)
- .set("es-ES", esEs)
- .set("fi-FI", fiFi)
- .set("fr-CA", frCa)
- .set("fr-FR", frFr)
- .set("he-IL", heIl)
- .set("it-IT", itIt)
- .set("mk-MK", mkMk)
- .set("nl-NL", nlNl)
- .set("pl-PL", plPl)
- .set("pt-BR", ptBr)
- .set("ru-RU", ruRu)
- .set("zh-CN", zhCn);
-
- var defaultLocale = locale(enUs);
- exports.format = defaultLocale.format;
- exports.utcFormat = defaultLocale.utcFormat;
-
- function localeFormat(definition) {
- if (typeof definition === "string") {
- definition = localeDefinitions.get(definition);
- if (!definition) return null;
- }
- return locale(definition);
- }
- ;
-
- exports.localeFormat = localeFormat;
- exports.isoFormat = isoFormat;
-
-}));
-},{}],5:[function(require,module,exports){
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- factory((global.time = {}));
-}(this, function (exports) { 'use strict';
-
- var t1 = new Date;
-
- var t0 = new Date;
-
- function newInterval(floori, offseti, count) {
-
- function interval(date) {
- return floori(date = new Date(+date)), date;
- }
-
- interval.floor = interval;
-
- interval.round = function(date) {
- var d0 = new Date(+date),
- d1 = new Date(date - 1);
- floori(d0), floori(d1), offseti(d1, 1);
- return date - d0 < d1 - date ? d0 : d1;
- };
-
- interval.ceil = function(date) {
- return floori(date = new Date(date - 1)), offseti(date, 1), date;
- };
-
- interval.offset = function(date, step) {
- return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
- };
-
- interval.range = function(start, stop, step) {
- var range = [];
- start = new Date(start - 1);
- stop = new Date(+stop);
- step = step == null ? 1 : Math.floor(step);
- if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
- offseti(start, 1), floori(start);
- if (start < stop) range.push(new Date(+start));
- while (offseti(start, step), floori(start), start < stop) range.push(new Date(+start));
- return range;
- };
-
- interval.filter = function(test) {
- return newInterval(function(date) {
- while (floori(date), !test(date)) date.setTime(date - 1);
- }, function(date, step) {
- while (--step >= 0) while (offseti(date, 1), !test(date));
- });
- };
-
- if (count) interval.count = function(start, end) {
- t0.setTime(+start), t1.setTime(+end);
- floori(t0), floori(t1);
- return Math.floor(count(t0, t1));
- };
-
- return interval;
- }
-
- var second = newInterval(function(date) {
- date.setMilliseconds(0);
- }, function(date, step) {
- date.setTime(+date + step * 1e3);
- }, function(start, end) {
- return (end - start) / 1e3;
- });
-
- exports.seconds = second.range;
-
- var minute = newInterval(function(date) {
- date.setSeconds(0, 0);
- }, function(date, step) {
- date.setTime(+date + step * 6e4);
- }, function(start, end) {
- return (end - start) / 6e4;
- });
-
- exports.minutes = minute.range;
-
- var hour = newInterval(function(date) {
- date.setMinutes(0, 0, 0);
- }, function(date, step) {
- date.setTime(+date + step * 36e5);
- }, function(start, end) {
- return (end - start) / 36e5;
- });
-
- exports.hours = hour.range;
-
- var day = 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()) * 6e4) / 864e5;
- });
-
- exports.days = day.range;
-
- function weekday(i) {
- return newInterval(function(date) {
- date.setHours(0, 0, 0, 0);
- date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
- }, function(date, step) {
- date.setDate(date.getDate() + step * 7);
- }, function(start, end) {
- return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * 6e4) / 6048e5;
- });
- }
-
- exports.sunday = weekday(0);
-
- exports.sundays = exports.sunday.range;
-
- exports.monday = weekday(1);
-
- exports.mondays = exports.monday.range;
-
- exports.tuesday = weekday(2);
-
- exports.tuesdays = exports.tuesday.range;
-
- exports.wednesday = weekday(3);
-
- exports.wednesdays = exports.wednesday.range;
-
- exports.thursday = weekday(4);
-
- exports.thursdays = exports.thursday.range;
-
- exports.friday = weekday(5);
-
- exports.fridays = exports.friday.range;
-
- exports.saturday = weekday(6);
-
- exports.saturdays = exports.saturday.range;
-
- var week = exports.sunday;
-
- exports.weeks = week.range;
-
- var month = newInterval(function(date) {
- date.setHours(0, 0, 0, 0);
- date.setDate(1);
- }, function(date, step) {
- date.setMonth(date.getMonth() + step);
- }, function(start, end) {
- return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
- });
-
- exports.months = month.range;
-
- var year = newInterval(function(date) {
- date.setHours(0, 0, 0, 0);
- date.setMonth(0, 1);
- }, function(date, step) {
- date.setFullYear(date.getFullYear() + step);
- }, function(start, end) {
- return end.getFullYear() - start.getFullYear();
- });
-
- exports.years = year.range;
-
- var utcSecond = newInterval(function(date) {
- date.setUTCMilliseconds(0);
- }, function(date, step) {
- date.setTime(+date + step * 1e3);
- }, function(start, end) {
- return (end - start) / 1e3;
- });
-
- exports.utcSeconds = utcSecond.range;
-
- var utcMinute = newInterval(function(date) {
- date.setUTCSeconds(0, 0);
- }, function(date, step) {
- date.setTime(+date + step * 6e4);
- }, function(start, end) {
- return (end - start) / 6e4;
- });
-
- exports.utcMinutes = utcMinute.range;
-
- var utcHour = newInterval(function(date) {
- date.setUTCMinutes(0, 0, 0);
- }, function(date, step) {
- date.setTime(+date + step * 36e5);
- }, function(start, end) {
- return (end - start) / 36e5;
- });
-
- exports.utcHours = utcHour.range;
-
- var utcDay = newInterval(function(date) {
- date.setUTCHours(0, 0, 0, 0);
- }, function(date, step) {
- date.setUTCDate(date.getUTCDate() + step);
- }, function(start, end) {
- return (end - start) / 864e5;
- });
-
- exports.utcDays = utcDay.range;
-
- function utcWeekday(i) {
- return newInterval(function(date) {
- date.setUTCHours(0, 0, 0, 0);
- date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
- }, function(date, step) {
- date.setUTCDate(date.getUTCDate() + step * 7);
- }, function(start, end) {
- return (end - start) / 6048e5;
- });
- }
-
- exports.utcSunday = utcWeekday(0);
-
- exports.utcSundays = exports.utcSunday.range;
-
- exports.utcMonday = utcWeekday(1);
-
- exports.utcMondays = exports.utcMonday.range;
-
- exports.utcTuesday = utcWeekday(2);
-
- exports.utcTuesdays = exports.utcTuesday.range;
-
- exports.utcWednesday = utcWeekday(3);
-
- exports.utcWednesdays = exports.utcWednesday.range;
-
- exports.utcThursday = utcWeekday(4);
-
- exports.utcThursdays = exports.utcThursday.range;
-
- exports.utcFriday = utcWeekday(5);
-
- exports.utcFridays = exports.utcFriday.range;
-
- exports.utcSaturday = utcWeekday(6);
-
- exports.utcSaturdays = exports.utcSaturday.range;
-
- var utcWeek = exports.utcSunday;
-
- exports.utcWeeks = utcWeek.range;
-
- var utcMonth = newInterval(function(date) {
- date.setUTCHours(0, 0, 0, 0);
- date.setUTCDate(1);
- }, function(date, step) {
- date.setUTCMonth(date.getUTCMonth() + step);
- }, function(start, end) {
- return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
- });
-
- exports.utcMonths = utcMonth.range;
-
- var utcYear = newInterval(function(date) {
- date.setUTCHours(0, 0, 0, 0);
- date.setUTCMonth(0, 1);
- }, function(date, step) {
- date.setUTCFullYear(date.getUTCFullYear() + step);
- }, function(start, end) {
- return end.getUTCFullYear() - start.getUTCFullYear();
- });
-
- exports.utcYears = utcYear.range;
-
- exports.interval = newInterval;
- exports.second = second;
- exports.minute = minute;
- exports.hour = hour;
- exports.day = day;
- exports.week = week;
- exports.month = month;
- exports.year = year;
- exports.utcSecond = utcSecond;
- exports.utcMinute = utcMinute;
- exports.utcHour = utcHour;
- exports.utcDay = utcDay;
- exports.utcWeek = utcWeek;
- exports.utcMonth = utcMonth;
- exports.utcYear = utcYear;
-
-}));
-},{}],6:[function(require,module,exports){
-var util = require('../util'),
- Measures = require('./measures'),
- Collector = require('./collector');
-
-function Aggregator() {
- this._cells = {};
- this._aggr = [];
- this._stream = false;
-}
-
-var Flags = Aggregator.Flags = {
- ADD_CELL: 1,
- MOD_CELL: 2
-};
-
-var proto = Aggregator.prototype;
-
-// Parameters
-
-proto.stream = function(v) {
- if (v == null) return this._stream;
- this._stream = !!v;
- this._aggr = [];
- return this;
-};
-
-// key accessor to use for streaming removes
-proto.key = function(key) {
- if (key == null) return this._key;
- this._key = util.$(key);
- return this;
-};
-
-// Input: array of objects of the form
-// {name: string, get: function}
-proto.groupby = function(dims) {
- this._dims = util.array(dims).map(function(d, i) {
- d = util.isString(d) ? {name: d, get: util.$(d)}
- : util.isFunction(d) ? {name: util.name(d) || d.name || ('_' + i), get: d}
- : (d.name && util.isFunction(d.get)) ? d : null;
- if (d == null) throw 'Invalid groupby argument: ' + d;
- return d;
- });
- return this.clear();
-};
-
-// Input: array of objects of the form
-// {name: string, ops: [string, ...]}
-proto.summarize = function(fields) {
- fields = summarize_args(fields);
- this._count = true;
- var aggr = (this._aggr = []),
- m, f, i, j, op, as, get;
-
- for (i=0; i 0) {
- // consolidate collector values
- if (cell.collect) {
- cell.data.values();
- }
- // update tuple properties
- for (i=0; i 0) {
- m[a[i]] -= 1;
- } else {
- x[j++] = a[i];
- }
- }
- } else if (k) {
- // has unique key field, so use that
- m = util.toMap(r, k);
- for (i=0, j=0, n=a.length; i 1 ? this.dev / (this.valid-1) : 0',
- req: ['mean'], idx: 1
- }),
- 'variancep': measure({
- name: 'variancep',
- set: 'this.valid > 1 ? this.dev / this.valid : 0',
- req: ['variance'], idx: 2
- }),
- 'stdev': measure({
- name: 'stdev',
- set: 'this.valid > 1 ? Math.sqrt(this.dev / (this.valid-1)) : 0',
- req: ['variance'], idx: 2
- }),
- 'stdevp': measure({
- name: 'stdevp',
- set: 'this.valid > 1 ? Math.sqrt(this.dev / this.valid) : 0',
- req: ['variance'], idx: 2
- }),
- 'median': measure({
- name: 'median',
- set: 'cell.data.q2(this.get)',
- req: ['values'], idx: 3
- }),
- 'q1': measure({
- name: 'q1',
- set: 'cell.data.q1(this.get)',
- req: ['values'], idx: 3
- }),
- 'q3': measure({
- name: 'q3',
- set: 'cell.data.q3(this.get)',
- req: ['values'], idx: 3
- }),
- 'distinct': measure({
- name: 'distinct',
- set: 'this.distinct(cell.data.values(), this.get)',
- req: ['values'], idx: 3
- }),
- 'argmin': measure({
- name: 'argmin',
- add: 'if (v < this.min) this.argmin = t;',
- rem: 'if (v <= this.min) this.argmin = null;',
- set: 'this.argmin = this.argmin || cell.data.argmin(this.get)',
- req: ['min'], str: ['values'], idx: 3
- }),
- 'argmax': measure({
- name: 'argmax',
- add: 'if (v > this.max) this.argmax = t;',
- rem: 'if (v >= this.max) this.argmax = null;',
- set: 'this.argmax = this.argmax || cell.data.argmax(this.get)',
- req: ['max'], str: ['values'], idx: 3
- }),
- 'min': measure({
- name: 'min',
- init: 'this.min = +Infinity;',
- add: 'if (v < this.min) this.min = v;',
- rem: 'if (v <= this.min) this.min = NaN;',
- set: 'this.min = (isNaN(this.min) ? cell.data.min(this.get) : this.min)',
- str: ['values'], idx: 4
- }),
- 'max': measure({
- name: 'max',
- init: 'this.max = -Infinity;',
- add: 'if (v > this.max) this.max = v;',
- rem: 'if (v >= this.max) this.max = NaN;',
- set: 'this.max = (isNaN(this.max) ? cell.data.max(this.get) : this.max)',
- str: ['values'], idx: 4
- }),
- 'modeskew': measure({
- name: 'modeskew',
- set: 'this.dev===0 ? 0 : (this.mean - cell.data.q2(this.get)) / Math.sqrt(this.dev/(this.valid-1))',
- req: ['mean', 'stdev', 'median'], idx: 5
- })
-};
-
-function measure(base) {
- return function(out) {
- var m = util.extend({init:'', add:'', rem:'', idx:0}, base);
- m.out = out || base.name;
- return m;
- };
-}
-
-function resolve(agg, stream) {
- function collect(m, a) {
- function helper(r) { if (!m[r]) collect(m, m[r] = types[r]()); }
- if (a.req) a.req.forEach(helper);
- if (stream && a.str) a.str.forEach(helper);
- return m;
- }
- var map = agg.reduce(
- collect,
- agg.reduce(function(m, a) { return (m[a.name] = a, m); }, {})
- );
- return util.vals(map).sort(function(a, b) { return a.idx - b.idx; });
-}
-
-function create(agg, stream, accessor, mutator) {
- var all = resolve(agg, stream),
- ctr = 'this.cell = cell; this.tuple = t; this.valid = 0; this.missing = 0;',
- add = 'if (v==null) this.missing++; if (!this.isValid(v)) return; ++this.valid;',
- rem = 'if (v==null) this.missing--; if (!this.isValid(v)) return; --this.valid;',
- set = 'var t = this.tuple; var cell = this.cell;';
-
- all.forEach(function(a) {
- if (a.idx < 0) {
- ctr = a.init + ctr;
- add = a.add + add;
- rem = a.rem + rem;
- } else {
- ctr += a.init;
- add += a.add;
- rem += a.rem;
- }
- });
- agg.slice()
- .sort(function(a, b) { return a.idx - b.idx; })
- .forEach(function(a) {
- set += 'this.assign(t,\''+a.out+'\','+a.set+');';
- });
- set += 'return t;';
-
- /* jshint evil: true */
- ctr = Function('cell', 't', ctr);
- ctr.prototype.assign = mutator;
- ctr.prototype.add = Function('t', 'var v = this.get(t);' + add);
- ctr.prototype.rem = Function('t', 'var v = this.get(t);' + rem);
- ctr.prototype.set = Function(set);
- ctr.prototype.get = accessor;
- ctr.prototype.distinct = require('../stats').count.distinct;
- ctr.prototype.isValid = util.isValid;
- ctr.fields = agg.map(util.$('out'));
- return ctr;
-}
-
-types.create = create;
-module.exports = types;
-},{"../stats":25,"../util":28}],10:[function(require,module,exports){
-var util = require('../util'),
- time = require('../time'),
- EPSILON = 1e-15;
-
-function bins(opt) {
- if (!opt) { throw Error("Missing binning options."); }
-
- // determine range
- var maxb = opt.maxbins || 15,
- base = opt.base || 10,
- logb = Math.log(base),
- div = opt.div || [5, 2],
- min = opt.min,
- max = opt.max,
- span = max - min,
- step, level, minstep, precision, v, i, eps;
-
- if (opt.step) {
- // if step size is explicitly given, use that
- step = opt.step;
- } else if (opt.steps) {
- // if provided, limit choice to acceptable step sizes
- step = opt.steps[Math.min(
- opt.steps.length - 1,
- bisect(opt.steps, span/maxb, 0, opt.steps.length)
- )];
- } else {
- // else use span to determine step size
- level = Math.ceil(Math.log(maxb) / logb);
- minstep = opt.minstep || 0;
- step = Math.max(
- minstep,
- Math.pow(base, Math.round(Math.log(span) / logb) - level)
- );
-
- // increase step size if too many bins
- do { step *= base; } while (Math.ceil(span/step) > maxb);
-
- // decrease step size if allowed
- for (i=0; i= minstep && span / v <= maxb) step = v;
- }
- }
-
- // update precision, min and max
- v = Math.log(step);
- precision = v >= 0 ? 0 : ~~(-v / logb) + 1;
- eps = Math.pow(base, -precision - 1);
- min = Math.min(min, Math.floor(min / step + eps) * step);
- max = Math.ceil(max / step) * step;
-
- return {
- start: min,
- stop: max,
- step: step,
- unit: {precision: precision},
- value: value,
- index: index
- };
-}
-
-function bisect(a, x, lo, hi) {
- while (lo < hi) {
- var mid = lo + hi >>> 1;
- if (util.cmp(a[mid], x) < 0) { lo = mid + 1; }
- else { hi = mid; }
- }
- return lo;
-}
-
-function value(v) {
- return this.step * Math.floor(v / this.step + EPSILON);
-}
-
-function index(v) {
- return Math.floor((v - this.start) / this.step + EPSILON);
-}
-
-function date_value(v) {
- return this.unit.date(value.call(this, v));
-}
-
-function date_index(v) {
- return index.call(this, this.unit.unit(v));
-}
-
-bins.date = function(opt) {
- if (!opt) { throw Error("Missing date binning options."); }
-
- // find time step, then bin
- var units = opt.utc ? time.utc : time,
- dmin = opt.min,
- dmax = opt.max,
- maxb = opt.maxbins || 20,
- minb = opt.minbins || 4,
- span = (+dmax) - (+dmin),
- unit = opt.unit ? units[opt.unit] : units.find(span, minb, maxb),
- spec = bins({
- min: unit.min != null ? unit.min : unit.unit(dmin),
- max: unit.max != null ? unit.max : unit.unit(dmax),
- maxbins: maxb,
- minstep: unit.minstep,
- steps: unit.step
- });
-
- spec.unit = unit;
- spec.index = date_index;
- if (!opt.raw) spec.value = date_value;
- return spec;
-};
-
-module.exports = bins;
-
-},{"../time":27,"../util":28}],11:[function(require,module,exports){
-var bins = require('./bins'),
- gen = require('../generate'),
- type = require('../import/type'),
- util = require('../util'),
- stats = require('../stats');
-
-var qtype = {
- 'integer': 1,
- 'number': 1,
- 'date': 1
-};
-
-function $bin(values, f, opt) {
- opt = options(values, f, opt);
- var b = spec(opt);
- return !b ? (opt.accessor || util.identity) :
- util.$func('bin', b.unit.unit ?
- function(x) { return b.value(b.unit.unit(x)); } :
- function(x) { return b.value(x); }
- )(opt.accessor);
-}
-
-function histogram(values, f, opt) {
- opt = options(values, f, opt);
- var b = spec(opt);
- return b ?
- numerical(values, opt.accessor, b) :
- categorical(values, opt.accessor, opt && opt.sort);
-}
-
-function spec(opt) {
- var t = opt.type, b = null;
- if (t == null || qtype[t]) {
- if (t === 'integer' && opt.minstep == null) opt.minstep = 1;
- b = (t === 'date') ? bins.date(opt) : bins(opt);
- }
- return b;
-}
-
-function options() {
- var a = arguments,
- i = 0,
- values = util.isArray(a[i]) ? a[i++] : null,
- f = util.isFunction(a[i]) || util.isString(a[i]) ? util.$(a[i++]) : null,
- opt = util.extend({}, a[i]);
-
- if (values) {
- opt.type = opt.type || type(values, f);
- if (qtype[opt.type]) {
- var ext = stats.extent(values, f);
- opt = util.extend({min: ext[0], max: ext[1]}, opt);
- }
- }
- if (f) { opt.accessor = f; }
- return opt;
-}
-
-function numerical(values, f, b) {
- var h = gen.range(b.start, b.stop + b.step/2, b.step)
- .map(function(v) { return {value: b.value(v), count: 0}; });
-
- for (var i=0, v, j; i= h.length || !isFinite(j)) continue;
- h[j].count += 1;
- }
- }
- h.bins = b;
- return h;
-}
-
-function categorical(values, f, sort) {
- var u = stats.unique(values, f),
- c = stats.count.map(values, f);
- return u.map(function(k) { return {value: k, count: c[k]}; })
- .sort(util.comparator(sort ? '-count' : '+value'));
-}
-
-module.exports = {
- $bin: $bin,
- histogram: histogram
-};
-},{"../generate":13,"../import/type":22,"../stats":25,"../util":28,"./bins":10}],12:[function(require,module,exports){
-var d3_time = require('d3-time'),
- d3_timeF = require('d3-time-format'),
- d3_numberF = require('d3-format'),
- numberF = d3_numberF, // defaults to EN-US
- timeF = d3_timeF; // defaults to EN-US
-
-function numberLocale(l) {
- var f = d3_numberF.localeFormat(l);
- if (f == null) throw Error('Unrecognized locale: ' + l);
- numberF = f;
-}
-
-function timeLocale(l) {
- var f = d3_timeF.localeFormat(l);
- if (f == null) throw Error('Unrecognized locale: ' + l);
- timeF = f;
-}
-
-module.exports = {
- // Update number formatter to use provided locale configuration.
- // For more see https://github.com/d3/d3-format
- numberLocale: numberLocale,
- number: function(f) { return numberF.format(f); },
- numberPrefix: function(f, v) { return numberF.formatPrefix(f, v); },
-
- // Update time formatter to use provided locale configuration.
- // For more see https://github.com/d3/d3-time-format
- timeLocale: timeLocale,
- time: function(f) { return timeF.format(f); },
- utc: function(f) { return timeF.utcFormat(f); },
-
- // Set number and time locale simultaneously.
- locale: function(l) { numberLocale(l); timeLocale(l); },
-
- // automatic formatting functions
- auto: {
- number: numberAutoFormat,
- time: function() { return timeAutoFormat(); },
- utc: function() { return utcAutoFormat(); }
- }
-};
-
-var e10 = Math.sqrt(50),
- e5 = Math.sqrt(10),
- e2 = Math.sqrt(2);
-
-function intervals(domain, count) {
- if (count == null) count = 10;
-
- var start = domain[0],
- stop = domain[domain.length - 1];
-
- if (stop < start) { error = stop; stop = start; start = error; }
-
- var span = stop - start,
- step = Math.pow(10, Math.floor(Math.log(span / count) / Math.LN10)),
- error = span / count / step;
-
- // Filter ticks to get closer to the desired count.
- if (error >= e10) step *= 10;
- else if (error >= e5) step *= 5;
- else if (error >= e2) step *= 2;
-
- // Round start and stop values to step interval.
- return [
- Math.ceil(start / step) * step,
- Math.floor(stop / step) * step + step / 2, // inclusive
- step
- ];
-}
-
-function numberAutoFormat(domain, count, f) {
- var range = intervals(domain, count);
- if (f == null) {
- f = ',.' + d3_numberF.precisionFixed(range[2]) + 'f';
- } else {
- switch (f = d3_numberF.formatSpecifier(f), f.type) {
- case 's': {
- var value = Math.max(Math.abs(range[0]), Math.abs(range[1]));
- if (f.precision == null) f.precision = d3_numberF.precisionPrefix(range[2], value);
- return numberF.formatPrefix(f, value);
- }
- case '':
- case 'e':
- case 'g':
- case 'p':
- case 'r': {
- if (f.precision == null) f.precision = d3_numberF.precisionRound(range[2], Math.max(Math.abs(range[0]), Math.abs(range[1]))) - (f.type === 'e');
- break;
- }
- case 'f':
- case '%': {
- if (f.precision == null) f.precision = d3_numberF.precisionFixed(range[2]) - (f.type === '%') * 2;
- break;
- }
- }
- }
- return numberF.format(f);
-}
-
-function timeAutoFormat() {
- var f = timeF.format,
- formatMillisecond = f('.%L'),
- formatSecond = f(':%S'),
- formatMinute = f('%I:%M'),
- formatHour = f('%I %p'),
- formatDay = f('%a %d'),
- formatWeek = f('%b %d'),
- formatMonth = f('%B'),
- formatYear = f('%Y');
-
- return function(date) {
- var d = +date;
- return (d3_time.second(date) < d ? formatMillisecond
- : d3_time.minute(date) < d ? formatSecond
- : d3_time.hour(date) < d ? formatMinute
- : d3_time.day(date) < d ? formatHour
- : d3_time.month(date) < d ?
- (d3_time.week(date) < d ? formatDay : formatWeek)
- : d3_time.year(date) < d ? formatMonth
- : formatYear)(date);
- };
-}
-
-function utcAutoFormat() {
- var f = timeF.utcFormat,
- formatMillisecond = f('.%L'),
- formatSecond = f(':%S'),
- formatMinute = f('%I:%M'),
- formatHour = f('%I %p'),
- formatDay = f('%a %d'),
- formatWeek = f('%b %d'),
- formatMonth = f('%B'),
- formatYear = f('%Y');
-
- return function(date) {
- var d = +date;
- return (d3_time.utcSecond(date) < d ? formatMillisecond
- : d3_time.utcMinute(date) < d ? formatSecond
- : d3_time.utcHour(date) < d ? formatMinute
- : d3_time.utcDay(date) < d ? formatHour
- : d3_time.utcMonth(date) < d ?
- (d3_time.utcWeek(date) < d ? formatDay : formatWeek)
- : d3_time.utcYear(date) < d ? formatMonth
- : formatYear)(date);
- };
-}
-
-},{"d3-format":3,"d3-time":5,"d3-time-format":4}],13:[function(require,module,exports){
-var gen = module.exports = {};
-
-gen.repeat = function(val, n) {
- var a = Array(n), i;
- for (i=0; i stop) range.push(j);
- else while ((j = start + step * ++i) < stop) range.push(j);
- return range;
-};
-
-gen.random = {};
-
-gen.random.uniform = function(min, max) {
- if (max === undefined) {
- max = min === undefined ? 1 : min;
- min = 0;
- }
- var d = max - min;
- var f = function() {
- return min + d * Math.random();
- };
- f.samples = function(n) { return gen.zeros(n).map(f); };
- return f;
-};
-
-gen.random.integer = function(a, b) {
- if (b === undefined) {
- b = a;
- a = 0;
- }
- var d = b - a;
- var f = function() {
- return a + Math.floor(d * Math.random());
- };
- f.samples = function(n) { return gen.zeros(n).map(f); };
- return f;
-};
-
-gen.random.normal = function(mean, stdev) {
- mean = mean || 0;
- stdev = stdev || 1;
- var next;
- var f = function() {
- var x = 0, y = 0, rds, c;
- if (next !== undefined) {
- x = next;
- next = undefined;
- return x;
- }
- do {
- x = Math.random()*2-1;
- y = Math.random()*2-1;
- rds = x*x + y*y;
- } while (rds === 0 || rds > 1);
- c = Math.sqrt(-2*Math.log(rds)/rds); // Box-Muller transform
- next = mean + y*c*stdev;
- return mean + x*c*stdev;
- };
- f.samples = function(n) { return gen.zeros(n).map(f); };
- return f;
-};
-},{}],14:[function(require,module,exports){
-var util = require('../../util');
-var d3_dsv = require('d3-dsv');
-
-function dsv(data, format) {
- if (data) {
- var h = format.header;
- data = (h ? h.join(format.delimiter) + '\n' : '') + data;
- }
- return d3_dsv.dsv(format.delimiter).parse(data);
-}
-
-dsv.delimiter = function(delim) {
- var fmt = {delimiter: delim};
- return function(data, format) {
- return dsv(data, format ? util.extend(format, fmt) : fmt);
- };
-};
-
-module.exports = dsv;
-},{"../../util":28,"d3-dsv":2}],15:[function(require,module,exports){
-var dsv = require('./dsv');
-
-module.exports = {
- json: require('./json'),
- topojson: require('./topojson'),
- treejson: require('./treejson'),
- dsv: dsv,
- csv: dsv.delimiter(','),
- tsv: dsv.delimiter('\t')
-};
-},{"./dsv":14,"./json":16,"./topojson":17,"./treejson":18}],16:[function(require,module,exports){
-var util = require('../../util');
-
-module.exports = function(data, format) {
- var d = util.isObject(data) && !util.isBuffer(data) ?
- data : JSON.parse(data);
- if (format && format.property) {
- d = util.accessor(format.property)(d);
- }
- return d;
-};
-
-},{"../../util":28}],17:[function(require,module,exports){
-(function (global){
-var json = require('./json');
-
-var reader = function(data, format) {
- var topojson = reader.topojson;
- if (topojson == null) { throw Error('TopoJSON library not loaded.'); }
-
- var t = json(data, format), obj;
-
- if (format && format.feature) {
- if ((obj = t.objects[format.feature])) {
- return topojson.feature(t, obj).features;
- } else {
- throw Error('Invalid TopoJSON object: ' + format.feature);
- }
- } else if (format && format.mesh) {
- if ((obj = t.objects[format.mesh])) {
- return [topojson.mesh(t, t.objects[format.mesh])];
- } else {
- throw Error('Invalid TopoJSON object: ' + format.mesh);
- }
- } else {
- throw Error('Missing TopoJSON feature or mesh parameter.');
- }
-};
-
-reader.topojson = (typeof window !== "undefined" ? window['topojson'] : typeof global !== "undefined" ? global['topojson'] : null);
-module.exports = reader;
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-
-},{"./json":16}],18:[function(require,module,exports){
-var json = require('./json');
-
-module.exports = function(data, format) {
- data = json(data, format);
- return toTable(data, (format && format.children));
-};
-
-function toTable(root, childrenField) {
- childrenField = childrenField || 'children';
- var table = [];
-
- function visit(node) {
- table.push(node);
- var children = node[childrenField];
- if (children) {
- for (var i=0; i 1 && domain[idx-1] === '.' && domain.lastIndexOf(d) === idx);
- });
- if (!whiteListed) {
- throw 'URL is not whitelisted: ' + url;
- }
- }
- }
- return url;
-}
-
-function load(opt, callback) {
- var error = callback || function(e) { throw e; }, url;
-
- try {
- url = load.sanitizeUrl(opt); // enable override
- } catch (err) {
- error(err);
- return;
- }
-
- if (!url) {
- error('Invalid URL: ' + opt.url);
- } else if (load.useXHR) {
- // on client, use xhr
- return xhr(url, callback);
- } else if (startsWith(url, fileProtocol)) {
- // on server, if url starts with 'file://', strip it and load from file
- return file(url.slice(fileProtocol.length), callback);
- } else if (url.indexOf('://') < 0) { // TODO better protocol check?
- // on server, if no protocol assume file
- return file(url, callback);
- } else {
- // for regular URLs on server
- return http(url, callback);
- }
-}
-
-function xhrHasResponse(request) {
- var type = request.responseType;
- return type && type !== 'text' ?
- request.response : // null on error
- request.responseText; // '' on error
-}
-
-function xhr(url, callback) {
- var async = !!callback;
- var request = new XMLHttpRequest();
- // If IE does not support CORS, use XDomainRequest (copied from d3.xhr)
- if (this.XDomainRequest &&
- !('withCredentials' in request) &&
- /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest();
-
- function respond() {
- var status = request.status;
- if (!status && xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) {
- callback(null, request.responseText);
- } else {
- callback(request, null);
- }
- }
-
- if (async) {
- if ('onload' in request) {
- request.onload = request.onerror = respond;
- } else {
- request.onreadystatechange = function() {
- if (request.readyState > 3) respond();
- };
- }
- }
-
- request.open('GET', url, async);
- request.send();
-
- if (!async && xhrHasResponse(request)) {
- return request.responseText;
- }
-}
-
-function file(filename, callback) {
- var fs = require('fs');
- if (!callback) {
- return fs.readFileSync(filename, 'utf8');
- }
- fs.readFile(filename, callback);
-}
-
-function http(url, callback) {
- if (!callback) {
- return require('sync-request')('GET', url).getBody();
- }
-
- var options = {url: url, encoding: null, gzip: true};
- require('request')(options, function(error, response, body) {
- if (!error && response.statusCode === 200) {
- callback(null, body);
- } else {
- error = error ||
- 'Load failed with response code ' + response.statusCode + '.';
- callback(error, null);
- }
- });
-}
-
-function startsWith(string, searchString) {
- return string == null ? false : string.lastIndexOf(searchString, 0) === 0;
-}
-
-load.sanitizeUrl = sanitizeUrl;
-
-load.useXHR = (typeof XMLHttpRequest !== 'undefined');
-
-module.exports = load;
-
-},{"fs":1,"request":1,"sync-request":1,"url":1}],20:[function(require,module,exports){
-var util = require('../util');
-var type = require('./type');
-var formats = require('./formats');
-
-function read(data, format) {
- var type = (format && format.type) || 'json';
- data = formats[type](data, format);
- if (format && format.parse) parse(data, format.parse);
- return data;
-}
-
-function parse(data, types) {
- var cols, parsers, d, i, j, clen, len = data.length;
-
- types = (types==='auto') ? type.inferAll(data) : util.duplicate(types);
- cols = util.keys(types);
- parsers = cols.map(function(c) { return type.parsers[types[c]]; });
-
- for (i=0, clen=cols.length; i 0 ? Math.min(l, opt.maxwidth) : l;
- });
-
- // print header row
- var head = fields.map(function(name, i) {
- return util.truncate(util.pad(name, lens[i], 'center'), lens[i]);
- }).join(opt.separator);
-
- // build template function for each row
- var tmpl = template(fields.map(function(name, i) {
- return '{{' +
- name +
- (FMT[types[name]] || '') +
- ('|pad:' + lens[i] + ',' + (POS[types[name]] || 'right')) +
- ('|truncate:' + lens[i]) +
- '}}';
- }).join(opt.separator));
-
- // print table
- return head + "\n" + data.map(tmpl).join('\n');
-};
-
-module.exports.summary = function(s) {
- s = s ? s.__summary__ ? s : stats.summary(s) : this;
- var str = [], i, n;
- for (i=0, n=s.length; i b) b = v;
- }
- }
- return [a, b];
-};
-
-// Find the integer indices of the minimum and maximum values.
-stats.extent.index = function(values, f) {
- f = util.$(f);
- var x = -1, y = -1, a, b, v, i, n = values.length;
- for (i=0; i b) { b = v; y = i; }
- }
- }
- return [x, y];
-};
-
-// Compute the dot product of two arrays of numbers.
-stats.dot = function(values, a, b) {
- var sum = 0, i, v;
- if (!b) {
- if (values.length !== a.length) {
- throw Error('Array lengths must match.');
- }
- for (i=0; i -1 && p !== v) {
- mu = 1 + (i-1 + tie) / 2;
- for (; tie -1) {
- mu = 1 + (n-1 + tie) / 2;
- for (; tie max) max = x;
- delta = x - mean;
- mean = mean + delta / (++valid);
- M2 = M2 + delta * (x - mean);
- vals.push(x);
- }
- }
- M2 = M2 / (valid - 1);
- sd = Math.sqrt(M2);
-
- // sort values for median and iqr
- vals.sort(util.cmp);
-
- return {
- type: type(values, f),
- unique: u,
- count: values.length,
- valid: valid,
- missing: missing,
- distinct: distinct,
- min: min,
- max: max,
- mean: mean,
- stdev: sd,
- median: (v = stats.quantile(vals, 0.5)),
- q1: stats.quantile(vals, 0.25),
- q3: stats.quantile(vals, 0.75),
- modeskew: sd === 0 ? 0 : (mean - v) / sd
- };
-};
-
-// Compute profiles for all variables in a data set.
-stats.summary = function(data, fields) {
- fields = fields || util.keys(data[0]);
- var s = fields.map(function(f) {
- var p = stats.profile(data, util.$(f));
- return (p.field = f, p);
- });
- return (s.__summary__ = true, s);
-};
-
-module.exports = stats;
-},{"./generate":13,"./import/type":22,"./util":28}],26:[function(require,module,exports){
-var util = require('./util'),
- format = require('./format');
-
-var context = {
- formats: [],
- format_map: {},
- truncate: util.truncate,
- pad: util.pad
-};
-
-function template(text) {
- var src = source(text, 'd');
- src = 'var __t; return ' + src + ';';
-
- /* jshint evil: true */
- return (new Function('d', src)).bind(context);
-}
-
-template.source = source;
-template.context = context;
-module.exports = template;
-
-// Clear cache of format objects.
-// This can *break* prior template functions, so invoke with care!
-template.clearFormatCache = function() {
- context.formats = [];
- context.format_map = {};
-};
-
-// Generate property access code for use within template source.
-// object: the name of the object (variable) containing template data
-// property: the property access string, verbatim from template tag
-template.property = function(object, property) {
- var src = util.field(property).map(util.str).join('][');
- return object + '[' + src + ']';
-};
-
-// Generate source code for a template function.
-// text: the template text
-// variable: the name of the data object variable ('obj' by default)
-// properties: optional hash for collecting all accessed properties
-function source(text, variable, properties) {
- variable = variable || 'obj';
- var index = 0;
- var src = '\'';
- var regex = template_re;
-
- // Compile the template source, escaping string literals appropriately.
- text.replace(regex, function(match, interpolate, offset) {
- src += text
- .slice(index, offset)
- .replace(template_escaper, template_escapeChar);
- index = offset + match.length;
-
- if (interpolate) {
- src += '\'\n+((__t=(' +
- template_var(interpolate, variable, properties) +
- '))==null?\'\':__t)+\n\'';
- }
-
- // Adobe VMs need the match returned to produce the correct offest.
- return match;
- });
- return src + '\'';
-}
-
-function template_var(text, variable, properties) {
- var filters = text.match(filter_re);
- var prop = filters.shift().trim();
- var stringCast = true;
-
- function strcall(fn) {
- fn = fn || '';
- if (stringCast) {
- stringCast = false;
- src = 'String(' + src + ')' + fn;
- } else {
- src += fn;
- }
- return src;
- }
-
- function date() {
- return '(typeof ' + src + '==="number"?new Date('+src+'):'+src+')';
- }
-
- function number_format(fmt, key) {
- a = template_format(args[0], key, fmt);
- stringCast = false;
- src = 'this.formats['+a+']('+src+')';
- }
-
- function time_format(fmt, key) {
- a = template_format(args[0], key, fmt);
- stringCast = false;
- src = 'this.formats['+a+']('+date()+')';
- }
-
- if (properties) properties[prop] = 1;
- var src = template.property(variable, prop);
-
- for (var i=0; i 0) {
- f = f.slice(0, pidx);
- args = filters[i].slice(pidx+1)
- .match(args_re)
- .map(function(s) { return s.trim(); });
- }
- f = f.trim();
-
- switch (f) {
- case 'length':
- strcall('.length');
- break;
- case 'lower':
- strcall('.toLowerCase()');
- break;
- case 'upper':
- strcall('.toUpperCase()');
- break;
- case 'lower-locale':
- strcall('.toLocaleLowerCase()');
- break;
- case 'upper-locale':
- strcall('.toLocaleUpperCase()');
- break;
- case 'trim':
- strcall('.trim()');
- break;
- case 'left':
- a = util.number(args[0]);
- strcall('.slice(0,' + a + ')');
- break;
- case 'right':
- a = util.number(args[0]);
- strcall('.slice(-' + a +')');
- break;
- case 'mid':
- a = util.number(args[0]);
- b = a + util.number(args[1]);
- strcall('.slice(+'+a+','+b+')');
- break;
- case 'slice':
- a = util.number(args[0]);
- strcall('.slice('+ a +
- (args.length > 1 ? ',' + util.number(args[1]) : '') +
- ')');
- break;
- case 'truncate':
- a = util.number(args[0]);
- b = args[1];
- b = (b!=='left' && b!=='middle' && b!=='center') ? 'right' : b;
- src = 'this.truncate(' + strcall() + ',' + a + ',\'' + b + '\')';
- break;
- case 'pad':
- a = util.number(args[0]);
- b = args[1];
- b = (b!=='left' && b!=='middle' && b!=='center') ? 'right' : b;
- src = 'this.pad(' + strcall() + ',' + a + ',\'' + b + '\')';
- break;
- case 'number':
- number_format(format.number, 'number');
- break;
- case 'time':
- time_format(format.time, 'time');
- break;
- case 'time-utc':
- time_format(format.utc, 'time-utc');
- break;
- default:
- throw Error('Unrecognized template filter: ' + f);
- }
- }
-
- return src;
-}
-
-var template_re = /\{\{(.+?)\}\}|$/g,
- filter_re = /(?:"[^"]*"|\'[^\']*\'|[^\|"]+|[^\|\']+)+/g,
- args_re = /(?:"[^"]*"|\'[^\']*\'|[^,"]+|[^,\']+)+/g;
-
-// Certain characters need to be escaped so that they can be put into a
-// string literal.
-var template_escapes = {
- '\'': '\'',
- '\\': '\\',
- '\r': 'r',
- '\n': 'n',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
-};
-
-var template_escaper = /\\|'|\r|\n|\u2028|\u2029/g;
-
-function template_escapeChar(match) {
- return '\\' + template_escapes[match];
-}
-
-function template_format(pattern, key, fmt) {
- if ((pattern[0] === '\'' && pattern[pattern.length-1] === '\'') ||
- (pattern[0] === '"' && pattern[pattern.length-1] === '"')) {
- pattern = pattern.slice(1, -1);
- } else {
- throw Error('Format pattern must be quoted: ' + pattern);
- }
- key = key + ':' + pattern;
- if (!context.format_map[key]) {
- var f = fmt(pattern);
- var i = context.formats.length;
- context.formats.push(f);
- context.format_map[key] = i;
- }
- return context.format_map[key];
-}
-
-},{"./format":12,"./util":28}],27:[function(require,module,exports){
-var d3_time = require('d3-time');
-
-var tempDate = new Date(),
- baseDate = new Date(0, 0, 1).setFullYear(0), // Jan 1, 0 AD
- utcBaseDate = new Date(Date.UTC(0, 0, 1)).setUTCFullYear(0);
-
-function date(d) {
- return (tempDate.setTime(+d), tempDate);
-}
-
-// create a time unit entry
-function entry(type, date, unit, step, min, max) {
- var e = {
- type: type,
- date: date,
- unit: unit
- };
- if (step) {
- e.step = step;
- } else {
- e.minstep = 1;
- }
- if (min != null) e.min = min;
- if (max != null) e.max = max;
- return e;
-}
-
-function create(type, unit, base, step, min, max) {
- return entry(type,
- function(d) { return unit.offset(base, d); },
- function(d) { return unit.count(base, d); },
- step, min, max);
-}
-
-var locale = [
- create('second', d3_time.second, baseDate),
- create('minute', d3_time.minute, baseDate),
- create('hour', d3_time.hour, baseDate),
- create('day', d3_time.day, baseDate, [1, 7]),
- create('month', d3_time.month, baseDate, [1, 3, 6]),
- create('year', d3_time.year, baseDate),
-
- // periodic units
- entry('seconds',
- function(d) { return new Date(1970, 0, 1, 0, 0, d); },
- function(d) { return date(d).getSeconds(); },
- null, 0, 59
- ),
- entry('minutes',
- function(d) { return new Date(1970, 0, 1, 0, d); },
- function(d) { return date(d).getMinutes(); },
- null, 0, 59
- ),
- entry('hours',
- function(d) { return new Date(1970, 0, 1, d); },
- function(d) { return date(d).getHours(); },
- null, 0, 23
- ),
- entry('weekdays',
- function(d) { return new Date(1970, 0, 4+d); },
- function(d) { return date(d).getDay(); },
- [1], 0, 6
- ),
- entry('dates',
- function(d) { return new Date(1970, 0, d); },
- function(d) { return date(d).getDate(); },
- [1], 1, 31
- ),
- entry('months',
- function(d) { return new Date(1970, d % 12, 1); },
- function(d) { return date(d).getMonth(); },
- [1], 0, 11
- )
-];
-
-var utc = [
- create('second', d3_time.utcSecond, utcBaseDate),
- create('minute', d3_time.utcMinute, utcBaseDate),
- create('hour', d3_time.utcHour, utcBaseDate),
- create('day', d3_time.utcDay, utcBaseDate, [1, 7]),
- create('month', d3_time.utcMonth, utcBaseDate, [1, 3, 6]),
- create('year', d3_time.utcYear, utcBaseDate),
-
- // periodic units
- entry('seconds',
- function(d) { return new Date(Date.UTC(1970, 0, 1, 0, 0, d)); },
- function(d) { return date(d).getUTCSeconds(); },
- null, 0, 59
- ),
- entry('minutes',
- function(d) { return new Date(Date.UTC(1970, 0, 1, 0, d)); },
- function(d) { return date(d).getUTCMinutes(); },
- null, 0, 59
- ),
- entry('hours',
- function(d) { return new Date(Date.UTC(1970, 0, 1, d)); },
- function(d) { return date(d).getUTCHours(); },
- null, 0, 23
- ),
- entry('weekdays',
- function(d) { return new Date(Date.UTC(1970, 0, 4+d)); },
- function(d) { return date(d).getUTCDay(); },
- [1], 0, 6
- ),
- entry('dates',
- function(d) { return new Date(Date.UTC(1970, 0, d)); },
- function(d) { return date(d).getUTCDate(); },
- [1], 1, 31
- ),
- entry('months',
- function(d) { return new Date(Date.UTC(1970, d % 12, 1)); },
- function(d) { return date(d).getUTCMonth(); },
- [1], 0, 11
- )
-];
-
-var STEPS = [
- [31536e6, 5], // 1-year
- [7776e6, 4], // 3-month
- [2592e6, 4], // 1-month
- [12096e5, 3], // 2-week
- [6048e5, 3], // 1-week
- [1728e5, 3], // 2-day
- [864e5, 3], // 1-day
- [432e5, 2], // 12-hour
- [216e5, 2], // 6-hour
- [108e5, 2], // 3-hour
- [36e5, 2], // 1-hour
- [18e5, 1], // 30-minute
- [9e5, 1], // 15-minute
- [3e5, 1], // 5-minute
- [6e4, 1], // 1-minute
- [3e4, 0], // 30-second
- [15e3, 0], // 15-second
- [5e3, 0], // 5-second
- [1e3, 0] // 1-second
-];
-
-function find(units, span, minb, maxb) {
- var step = STEPS[0], i, n, bins;
-
- for (i=1, n=STEPS.length; i step[0]) {
- bins = span / step[0];
- if (bins > maxb) {
- return units[STEPS[i-1][1]];
- }
- if (bins >= minb) {
- return units[step[1]];
- }
- }
- }
- return units[STEPS[n-1][1]];
-}
-
-function toUnitMap(units) {
- var map = {}, i, n;
- for (i=0, n=units.length; i 1 ?
- function(x) { return s.reduce(function(x,f) { return x[f]; }, x); } :
- function(x) { return x[f]; }
- );
-};
-
-// short-cut for accessor
-u.$ = u.accessor;
-
-u.mutator = function(f) {
- var s;
- return u.isString(f) && (s=u.field(f)).length > 1 ?
- function(x, v) {
- for (var i=0; i y) return sign[i];
- }
- return 0;
- };
-};
-
-u.cmp = function(a, b) {
- if (a < b) {
- return -1;
- } else if (a > b) {
- return 1;
- } else if (a >= b) {
- return 0;
- } else if (a === null) {
- return -1;
- } else if (b === null) {
- return 1;
- }
- return NaN;
-};
-
-u.numcmp = function(a, b) { return a - b; };
-
-u.stablesort = function(array, sortBy, keyFn) {
- var indices = array.reduce(function(idx, v, i) {
- return (idx[keyFn(v)] = i, idx);
- }, {});
-
- array.sort(function(a, b) {
- var sa = sortBy(a),
- sb = sortBy(b);
- return sa < sb ? -1 : sa > sb ? 1
- : (indices[keyFn(a)] - indices[keyFn(b)]);
- });
-
- return array;
-};
-
-
-// string functions
-
-u.pad = function(s, length, pos, padchar) {
- padchar = padchar || " ";
- var d = length - s.length;
- if (d <= 0) return s;
- switch (pos) {
- case 'left':
- return strrep(d, padchar) + s;
- case 'middle':
- case 'center':
- return strrep(Math.floor(d/2), padchar) +
- s + strrep(Math.ceil(d/2), padchar);
- default:
- return s + strrep(d, padchar);
- }
-};
-
-function strrep(n, str) {
- var s = "", i;
- for (i=0; i=c)return a;if(i)return i=!1,u;var e=l;if(34===t.charCodeAt(e)){for(var n=e;n++l;){var r=t.charCodeAt(l++),o=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(l)&&(++l,++o);else if(r!==s)continue;return t.slice(e,l-o)}return t.slice(e)}for(var r,i,u={},a={},o=[],c=t.length,l=0,f=0;(r=n())!==a;){for(var d=[];r!==u&&r!==a;)d.push(r),r=n();e&&null==(d=e(d,f++))||o.push(d)}return o}function r(e){if(Array.isArray(e[0]))return i(e);var n=Object.create(null),r=[];return e.forEach(function(t){for(var e in t)(e+="")in n||r.push(n[e]=e)}),[r.map(a).join(t)].concat(e.map(function(e){return r.map(function(t){return a(e[t])}).join(t)})).join("\n")}function i(t){return t.map(u).join("\n")}function u(e){return e.map(a).join(t)}function a(t){return o.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var o=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return{parse:e,parseRows:n,format:r,formatRows:i}};t.csv=e(","),t.tsv=e(" "),t.dsv=e})},{}],3:[function(e,n,r){"undefined"==typeof Map?(Map=function(){this.clear()},Map.prototype={set:function(t,e){return this._[t]=e,this},get:function(t){return this._[t]},has:function(t){return t in this._},"delete":function(t){return t in this._&&delete this._[t]},clear:function(){this._=Object.create(null)},get size(){var t=0;for(var e in this._)++t;return t},forEach:function(t){for(var e in this._)t(this._[e],e,this)}}):function(){var t=new Map;t.set(0,0)!==t&&(t=t.set,Map.prototype.set=function(){return t.apply(this,arguments),this})}(),function(e,i){"object"==typeof r&&"undefined"!=typeof n?i(r):"function"==typeof t&&t.amd?t(["exports"],i):i(e.format={})}(this,function(t){"use strict";function e(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function n(t){return t=e(Math.abs(t)),t?t[1]:NaN}function r(t,n){var r=e(t,n);if(!r)return t+"";var i=r[0],u=r[1],a=u-(g=3*Math.max(-8,Math.min(8,Math.floor(u/3))))+1,o=i.length;return a===o?i:a>o?i+new Array(a-o+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+e(t,n+a-1)[0]}function i(t,n){var r=e(t,n);if(!r)return t+"";var i=r[0],u=r[1];return 0>u?"0."+new Array(-u).join("0")+i:i.length>u+1?i.slice(0,u+1)+"."+i.slice(u+1):i+new Array(u-i.length+2).join("0")}function u(t,e){t=t.toPrecision(e);t:for(var n,r=t.length,i=1,u=-1;r>i;++i)switch(t[i]){case".":u=n=i;break;case"0":0===u&&(u=i),n=i;break;case"e":break t;default:u>0&&(u=0)}return u>0?t.slice(0,u)+t.slice(n+1):t}function a(t){return new o(t)}function o(t){if(!(e=L.exec(t)))throw new Error("invalid format: "+t);var e,n=e[1]||" ",r=e[2]||">",i=e[3]||"-",u=e[4]||"",a=!!e[5],o=e[6]&&+e[6],s=!!e[7],c=e[8]&&+e[8].slice(1),l=e[9]||"";"n"===l?(s=!0,l="g"):$[l]||(l=""),(a||"0"===n&&"="===r)&&(a=!0,n="0",r="="),this.fill=n,this.align=r,this.sign=i,this.symbol=u,this.zero=a,this.width=o,this.comma=s,this.precision=c,this.type=l}function s(t,e){return function(n,r){for(var i=n.length,u=[],a=0,o=t[0],s=0;i>0&&o>0&&(s+o+1>r&&(o=Math.max(1,r-s)),u.push(n.substring(i-=o,i+o)),!((s+=o+1)>r));)o=t[a=(a+1)%t.length];return u.reverse().join(e)}}function c(t){return t}function l(t){function e(t){t=a(t);var e=t.fill,n=t.align,r=t.sign,s=t.symbol,c=t.zero,l=t.width,f=t.comma,d=t.precision,m=t.type,h="$"===s?u[0]:"#"===s&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",p="$"===s?u[1]:/[%p]/.test(m)?"%":"",v=$[m],y=!m||/[defgprs%]/.test(m);return d=null==d?m?6:12:/[gprs]/.test(m)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),function(t){var u=h,a=p;if("c"===m)a=v(t)+a,t="";else{t=+t;var s=(0>t||0>1/t)&&(t*=-1,!0);if(t=v(t,d),u=(s?"("===r?r:"-":"-"===r||"("===r?"":r)+u,a=a+("s"===m?Y[8+g/3]:"")+(s&&"("===r?")":""),y)for(var M,b=-1,x=t.length;++bM||M>57){a=(46===M?o+t.slice(b+1):t.slice(b))+a,t=t.slice(0,b);break}}f&&!c&&(t=i(t,1/0));var w=u.length+t.length+a.length,_=l>w?new Array(l-w+1).join(e):"";switch(f&&c&&(t=i(_+t,_.length?l-a.length:1/0),_=""),n){case"<":return u+t+a+_;case"=":return u+_+t+a;case"^":return _.slice(0,w=_.length>>1)+u+t+a+_.slice(w)}return _+u+t+a}}function r(t,r){var i=e((t=a(t),t.type="f",t)),u=3*Math.max(-8,Math.min(8,Math.floor(n(r)/3))),o=Math.pow(10,-u),s=Y[8+u/3];return function(t){return i(o*t)+s}}var i=t.grouping&&t.thousands?s(t.grouping,t.thousands):c,u=t.currency,o=t.decimal;return{format:e,formatPrefix:r}}function f(t,e){return Math.max(0,n(Math.abs(e))-n(Math.abs(t)))+1}function d(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(n(e)/3)))-n(Math.abs(t)))}function m(t){return Math.max(0,-n(Math.abs(t)))}function h(t){return"string"!=typeof t||(t=q.get(t))?l(t):null}var g,p={decimal:".",thousands:",",grouping:[3],currency:["¥",""]},v={decimal:",",thousands:" ",grouping:[3],currency:[""," руб."]},y={decimal:",",thousands:".",grouping:[3],currency:["R$",""]},M={decimal:",",thousands:".",grouping:[3],currency:["","zł"]},b={decimal:",",thousands:".",grouping:[3],currency:["€ ",""]},x={decimal:",",thousands:".",grouping:[3],currency:[""," ден."]},w={decimal:",",thousands:".",grouping:[3],currency:["€",""]},_={decimal:".",thousands:",",grouping:[3],currency:["₪",""]},D={decimal:",",thousands:".",grouping:[3],currency:[""," €"]},T={decimal:",",thousands:" ",grouping:[3],currency:["","$"]},S={decimal:",",thousands:" ",grouping:[3],currency:[""," €"]},C={decimal:",",thousands:".",grouping:[3],currency:[""," €"]},j={decimal:".",thousands:",",grouping:[3],currency:["$",""]},A={decimal:".",thousands:",",grouping:[3],currency:["£",""]},U={decimal:".",thousands:",",grouping:[3],currency:["$",""]},k={decimal:",",thousands:".",grouping:[3],currency:[""," €"]},F={decimal:",",thousands:".",grouping:[3],currency:[""," €"]},$={"":u,"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return i(100*t,e)},r:i,s:r,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},L=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var Y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],q=(new Map).set("ca-ES",F).set("de-DE",k).set("en-CA",U).set("en-GB",A).set("en-US",j).set("es-ES",C).set("fi-FI",S).set("fr-CA",T).set("fr-FR",D).set("he-IL",_).set("it-IT",w).set("mk-MK",x).set("nl-NL",b).set("pl-PL",M).set("pt-BR",y).set("ru-RU",v).set("zh-CN",p),H=l(j);t.format=H.format,t.formatPrefix=H.formatPrefix,t.localeFormat=h,t.formatSpecifier=a,t.precisionFixed=m,t.precisionPrefix=d,t.precisionRound=f})},{}],4:[function(e,n,r){"undefined"==typeof Map?(Map=function(){this.clear()},Map.prototype={set:function(t,e){return this._[t]=e,this},get:function(t){return this._[t]},has:function(t){return t in this._},"delete":function(t){return t in this._&&delete this._[t]},clear:function(){this._=Object.create(null)},get size(){var t=0;for(var e in this._)++t;return t},forEach:function(t){for(var e in this._)t(this._[e],e,this)}}):function(){var t=new Map;t.set(0,0)!==t&&(t=t.set,Map.prototype.set=function(){return t.apply(this,arguments),this})}(),function(e,i){"object"==typeof r&&"undefined"!=typeof n?i(r):"function"==typeof t&&t.amd?t(["exports"],i):i(e.timeFormat={})}(this,function(t){"use strict";function e(t,n,r){function i(e){return t(e=new Date(+e)),e}return i.floor=i,i.round=function(e){var r=new Date(+e),i=new Date(e-1);return t(r),t(i),n(i,1),i-e>e-r?r:i},i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),e},i.offset=function(t,e){return n(t=new Date(+t),null==e?1:Math.floor(e)),t},i.range=function(e,r,i){var u=[];if(e=new Date(e-1),r=new Date(+r),i=null==i?1:Math.floor(i),!(r>e&&i>0))return u;for(n(e,1),t(e),r>e&&u.push(new Date(+e));n(e,i),t(e),r>e;)u.push(new Date(+e));return u},i.filter=function(r){return e(function(e){for(;t(e),!r(e);)e.setTime(e-1)},function(t,e){for(;--e>=0;)for(;n(t,1),!r(t););})},r&&(i.count=function(e,n){return bt.setTime(+e),xt.setTime(+n),t(bt),t(xt),Math.floor(r(bt,xt))}),i}function n(t){return e(function(e){e.setHours(0,0,0,0),e.setDate(e.getDate()-(e.getDay()+7-t)%7)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5})}function r(t){return e(function(e){e.setUTCHours(0,0,0,0),e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/6048e5})}function i(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function u(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function a(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function o(t){function e(t,e){return function(n){for(var r,i,u,a=[],o=-1,s=0,c=t.length;++oa;){if(r>=s)return-1;if(i=e.charCodeAt(a++),37===i){if(i=e.charAt(a++),u=qt[i in Ut?e.charAt(a++):i],!u||(r=u(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function o(t,e,n){var r=Ct.exec(e.slice(n));return r?(t.w=jt.get(r[0].toLowerCase()),n+r[0].length):-1}function s(t,e,n){var r=Tt.exec(e.slice(n));return r?(t.w=St.get(r[0].toLowerCase()),n+r[0].length):-1}function c(t,e,n){var r=Ft.exec(e.slice(n));return r?(t.m=$t.get(r[0].toLowerCase()),n+r[0].length):-1}function et(t,e,n){var r=At.exec(e.slice(n));return r?(t.m=kt.get(r[0].toLowerCase()),n+r[0].length):-1}function nt(t,e,n){return r(t,pt,e,n)}function rt(t,e,n){return r(t,vt,e,n)}function it(t,e,n){return r(t,yt,e,n)}function ut(t,e,n){var r=Dt.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}function at(t){return xt[t.getDay()]}function ot(t){return bt[t.getDay()]}function st(t){return _t[t.getMonth()]}function ct(t){return wt[t.getMonth()]}function lt(t){return Mt[+(t.getHours()>=12)]}function ft(t){return xt[t.getUTCDay()]}function dt(t){return bt[t.getUTCDay()]}function mt(t){return _t[t.getUTCMonth()]}function ht(t){return wt[t.getUTCMonth()]}function gt(t){return Mt[+(t.getUTCHours()>=12)]}var pt=t.dateTime,vt=t.date,yt=t.time,Mt=t.periods,bt=t.days,xt=t.shortDays,wt=t.months,_t=t.shortMonths,Dt=f(Mt),Tt=l(bt),St=f(bt),Ct=l(xt),jt=f(xt),At=l(wt),kt=f(wt),Ft=l(_t),$t=f(_t),Lt={a:at,A:ot,b:st,B:ct,c:null,d:S,e:S,H:C,I:j,j:A,L:U,m:k,M:F,p:lt,S:$,U:L,w:Y,W:q,x:null,X:null,y:H,Y:z,Z:O,"%":tt},Yt={a:ft,A:dt,b:mt,B:ht,c:null,d:N,e:N,H:E,I:J,j:P,L:B,m:X,M:W,p:gt,S:R,U:I,w:V,W:G,x:null,X:null,y:Z,Y:K,Z:Q,"%":tt},qt={a:o,A:s,b:c,B:et,c:nt,d:M,e:M,H:x,I:x,j:b,L:D,m:y,M:w,p:ut,S:_,U:m,w:d,W:h,x:rt,X:it,y:p,Y:g,Z:v,"%":T};return Lt.x=e(vt,Lt),Lt.X=e(yt,Lt),Lt.c=e(pt,Lt),Yt.x=e(vt,Yt),Yt.X=e(yt,Yt),Yt.c=e(pt,Yt),{format:function(t){var r=e(t+="",Lt);return r.parse=n(t,i),r.toString=function(){return t},r},utcFormat:function(t){var r=e(t+="",Yt);return r.parse=n(t,u),r.toString=function(){return t},r}}}function s(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",u=i.length;return r+(n>u?new Array(n-u+1).join(e)+i:i)}function c(t){return t.replace($t,"\\$&")}function l(t){return new RegExp("^(?:"+t.map(c).join("|")+")","i")}function f(t){for(var e=new Map,n=-1,r=t.length;++n68?1900:2e3),n+r[0].length):-1}function v(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function y(t,e,n){var r=kt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function M(t,e,n){var r=kt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function b(t,e,n){var r=kt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function x(t,e,n){var r=kt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function w(t,e,n){var r=kt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function _(t,e,n){var r=kt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function D(t,e,n){var r=kt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function T(t,e,n){var r=Ft.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function S(t,e){return s(t.getDate(),e,2)}function C(t,e){return s(t.getHours(),e,2)}function j(t,e){return s(t.getHours()%12||12,e,2)}function A(t,e){return s(1+wt.count(Tt(t),t),e,3)}function U(t,e){return s(t.getMilliseconds(),e,3)}function k(t,e){return s(t.getMonth()+1,e,2)}function F(t,e){return s(t.getMinutes(),e,2)}function $(t,e){return s(t.getSeconds(),e,2)}function L(t,e){return s(_t.count(Tt(t),t),e,2)}function Y(t){return t.getDay()}function q(t,e){return s(Dt.count(Tt(t),t),e,2)}function H(t,e){return s(t.getFullYear()%100,e,2)}function z(t,e){return s(t.getFullYear()%1e4,e,4)}function O(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+s(e/60|0,"0",2)+s(e%60,"0",2)}function N(t,e){return s(t.getUTCDate(),e,2)}function E(t,e){return s(t.getUTCHours(),e,2)}function J(t,e){return s(t.getUTCHours()%12||12,e,2)}function P(t,e){return s(1+St.count(At(t),t),e,3)}function B(t,e){return s(t.getUTCMilliseconds(),e,3)}function X(t,e){return s(t.getUTCMonth()+1,e,2)}function W(t,e){return s(t.getUTCMinutes(),e,2)}function R(t,e){return s(t.getUTCSeconds(),e,2)}function I(t,e){return s(Ct.count(At(t),t),e,2)}function V(t){return t.getUTCDay()}function G(t,e){return s(jt.count(At(t),t),e,2)}function Z(t,e){return s(t.getUTCFullYear()%100,e,2)}function K(t,e){return s(t.getUTCFullYear()%1e4,e,4)}function Q(){return"+0000"}function tt(){return"%"}function et(t){return t.toISOString()}function nt(t){return"string"!=typeof t||(t=Ht.get(t))?o(t):null}var rt={dateTime:"%a %b %e %X %Y",date:"%Y/%-m/%-d",time:"%H:%M:%S",periods:["上午","下午"],days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],shortDays:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortMonths:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},it={dateTime:"%A, %e %B %Y г. %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],shortDays:["вс","пн","вт","ср","чт","пт","сб"],months:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],shortMonths:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"]},ut={dateTime:"%A, %e de %B de %Y. %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]},at={dateTime:"%A, %e %B %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],shortDays:["Niedz.","Pon.","Wt.","Śr.","Czw.","Pt.","Sob."],months:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],shortMonths:["Stycz.","Luty","Marz.","Kwie.","Maj","Czerw.","Lipc.","Sierp.","Wrz.","Paźdz.","Listop.","Grudz."]},ot={dateTime:"%a %e %B %Y %T",date:"%d-%m-%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],shortDays:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortMonths:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"]},st={dateTime:"%A, %e %B %Y г. %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["недела","понеделник","вторник","среда","четврток","петок","сабота"],shortDays:["нед","пон","вто","сре","чет","пет","саб"],months:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],shortMonths:["јан","фев","мар","апр","мај","јун","јул","авг","сеп","окт","ное","дек"]},ct={dateTime:"%A %e %B %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],shortDays:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],shortMonths:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"]},lt={dateTime:"%A, %e ב%B %Y %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת"],shortDays:["א׳","ב׳","ג׳","ד׳","ה׳","ו׳","ש׳"],months:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],shortMonths:["ינו׳","פבר׳","מרץ","אפר׳","מאי","יוני","יולי","אוג׳","ספט׳","אוק׳","נוב׳","דצמ׳"]},ft={dateTime:"%A, le %e %B %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortMonths:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."]},dt={dateTime:"%a %e %b %Y %X",date:"%Y-%m-%d",time:"%H:%M:%S",periods:["",""],days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim","lun","mar","mer","jeu","ven","sam"],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortMonths:["jan","fév","mar","avr","mai","jui","jul","aoû","sep","oct","nov","déc"]},mt={dateTime:"%A, %-d. %Bta %Y klo %X",date:"%-d.%-m.%Y",time:"%H:%M:%S",periods:["a.m.","p.m."],days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],shortDays:["Su","Ma","Ti","Ke","To","Pe","La"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],shortMonths:["Tammi","Helmi","Maalis","Huhti","Touko","Kesä","Heinä","Elo","Syys","Loka","Marras","Joulu"]},ht={dateTime:"%A, %e de %B de %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],shortDays:["dom","lun","mar","mié","jue","vie","sáb"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],shortMonths:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"]},gt={dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]},pt={dateTime:"%a %e %b %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",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"]},vt={dateTime:"%a %b %e %X %Y",date:"%Y-%m-%d",time:"%H:%M:%S",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"]},yt={dateTime:"%A, der %e. %B %Y, %X",date:"%d.%m.%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"]},Mt={dateTime:"%A, %e de %B de %Y, %X",date:"%d/%m/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],shortDays:["dg.","dl.","dt.","dc.","dj.","dv.","ds."],months:["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],shortMonths:["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."]},bt=new Date,xt=new Date,wt=e(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),_t=n(0),Dt=n(1),Tt=e(function(t){t.setHours(0,0,0,0),t.setMonth(0,1)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()}),St=e(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/864e5}),Ct=r(0),jt=r(1),At=e(function(t){t.setUTCHours(0,0,0,0),t.setUTCMonth(0,1)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),Ut={"-":"",_:" ",0:"0"},kt=/^\s*\d+/,Ft=/^%/,$t=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Lt="%Y-%m-%dT%H:%M:%S.%LZ";et.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},et.toString=function(){return Lt};var Yt=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?et:gt.utcFormat(Lt),qt=Yt,Ht=(new Map).set("ca-ES",Mt).set("de-DE",yt).set("en-CA",vt).set("en-GB",pt).set("en-US",gt).set("es-ES",ht).set("fi-FI",mt).set("fr-CA",dt).set("fr-FR",ft).set("he-IL",lt).set("it-IT",ct).set("mk-MK",st).set("nl-NL",ot).set("pl-PL",at).set("pt-BR",ut).set("ru-RU",it).set("zh-CN",rt),zt=o(gt);t.format=zt.format,t.utcFormat=zt.utcFormat,t.localeFormat=nt,t.isoFormat=qt})},{}],5:[function(e,n,r){!function(e,i){"object"==typeof r&&"undefined"!=typeof n?i(r):"function"==typeof t&&t.amd?t(["exports"],i):i(e.time={})}(this,function(t){"use strict";function e(t,n,r){function a(e){return t(e=new Date(+e)),e}return a.floor=a,a.round=function(e){var r=new Date(+e),i=new Date(e-1);return t(r),t(i),n(i,1),i-e>e-r?r:i},a.ceil=function(e){return t(e=new Date(e-1)),n(e,1),e},a.offset=function(t,e){return n(t=new Date(+t),null==e?1:Math.floor(e)),t},a.range=function(e,r,i){var u=[];if(e=new Date(e-1),r=new Date(+r),i=null==i?1:Math.floor(i),!(r>e&&i>0))return u;for(n(e,1),t(e),r>e&&u.push(new Date(+e));n(e,i),t(e),r>e;)u.push(new Date(+e));return u},a.filter=function(r){return e(function(e){for(;t(e),!r(e);)e.setTime(e-1)},function(t,e){for(;--e>=0;)for(;n(t,1),!r(t););})},r&&(a.count=function(e,n){return u.setTime(+e),i.setTime(+n),t(u),t(i),Math.floor(r(u,i))}),a}function n(t){return e(function(e){e.setHours(0,0,0,0),e.setDate(e.getDate()-(e.getDay()+7-t)%7)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5})}function r(t){return e(function(e){e.setUTCHours(0,0,0,0),e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/6048e5})}var i=new Date,u=new Date,a=e(function(t){t.setMilliseconds(0)},function(t,e){t.setTime(+t+1e3*e)},function(t,e){return(e-t)/1e3});t.seconds=a.range;var o=e(function(t){t.setSeconds(0,0)},function(t,e){t.setTime(+t+6e4*e)},function(t,e){return(e-t)/6e4});t.minutes=o.range;var s=e(function(t){t.setMinutes(0,0,0)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5});t.hours=s.range;var c=e(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5});t.days=c.range,t.sunday=n(0),t.sundays=t.sunday.range,t.monday=n(1),t.mondays=t.monday.range,t.tuesday=n(2),t.tuesdays=t.tuesday.range,t.wednesday=n(3),t.wednesdays=t.wednesday.range,t.thursday=n(4),t.thursdays=t.thursday.range,t.friday=n(5),t.fridays=t.friday.range,t.saturday=n(6),t.saturdays=t.saturday.range;var l=t.sunday;t.weeks=l.range;var f=e(function(t){t.setHours(0,0,0,0),t.setDate(1)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())});t.months=f.range;var d=e(function(t){t.setHours(0,0,0,0),t.setMonth(0,1)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()});t.years=d.range;var m=e(function(t){t.setUTCMilliseconds(0)},function(t,e){t.setTime(+t+1e3*e)},function(t,e){return(e-t)/1e3});t.utcSeconds=m.range;var h=e(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+6e4*e)},function(t,e){return(e-t)/6e4});t.utcMinutes=h.range;var g=e(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5});t.utcHours=g.range;var p=e(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/864e5});t.utcDays=p.range,t.utcSunday=r(0),t.utcSundays=t.utcSunday.range,t.utcMonday=r(1),t.utcMondays=t.utcMonday.range,t.utcTuesday=r(2),t.utcTuesdays=t.utcTuesday.range,t.utcWednesday=r(3),t.utcWednesdays=t.utcWednesday.range,t.utcThursday=r(4),t.utcThursdays=t.utcThursday.range,t.utcFriday=r(5),t.utcFridays=t.utcFriday.range,t.utcSaturday=r(6),t.utcSaturdays=t.utcSaturday.range;var v=t.utcSunday;t.utcWeeks=v.range;var y=e(function(t){t.setUTCHours(0,0,0,0),t.setUTCDate(1)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())});t.utcMonths=y.range;var M=e(function(t){t.setUTCHours(0,0,0,0),t.setUTCMonth(0,1)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()});t.utcYears=M.range,t.interval=e,t.second=a,t.minute=o,t.hour=s,t.day=c,t.week=l,t.month=f,t.year=d,t.utcSecond=m,t.utcMinute=h,t.utcHour=g,t.utcDay=p,t.utcWeek=v,t.utcMonth=y,t.utcYear=M})},{}],6:[function(t,e,n){function r(){this._cells={},this._aggr=[],this._stream=!1}function i(t){if(u.isArray(t))return t;if(null==t)return[];var e,n,r=[];for(e in t)n=u.array(t[e]),r.push({name:e,ops:n});return r}var u=t("../util"),a=t("./measures"),o=t("./collector"),s=r.Flags={ADD_CELL:1,MOD_CELL:2},c=r.prototype;c.stream=function(t){return null==t?this._stream:(this._stream=!!t,this._aggr=[],this)},c.key=function(t){return null==t?this._key:(this._key=u.$(t),this)},c.groupby=function(t){return this._dims=u.array(t).map(function(t,e){if(t=u.isString(t)?{name:t,get:u.$(t)}:u.isFunction(t)?{name:u.name(t)||t.name||"_"+e,get:t}:t.name&&u.isFunction(t.get)?t:null,null==t)throw"Invalid groupby argument: "+t;return t}),this.clear()},c.summarize=function(t){t=i(t),this._count=!0;var e,n,r,o,s,c,l,f=this._aggr=[];for(r=0;re;++e)i+="|"+n[e].get(t);return i},c._cell=function(t){var e=this._dims.length?this._cellkey(t):"";return this._cells[e]||(this._cells[e]=this._newcell(t,e))},c._newcell=function(t,e){var n,r={num:0,tuple:this._newtuple(t,e),flag:s.ADD_CELL,aggs:{}},i=this._aggr;for(n=0;ne;++e)i[r[e].name]=r[e].get(t);return this._ingest(i)},c._ingest=u.identity,c._add=function(t){var e,n=this._cell(t),r=this._aggr;if(n.num+=1,!this._count)for(n.collect&&n.data.add(t),e=0;e0){for(t.collect&&t.data.values(),e=0;et;++t)r.hasOwnProperty(c(o[t]))||(l[e++]=o[t]);else{for(t=0,n=s.length;n>t;++t)s[t][a]=1;for(t=0,e=0,n=o.length;n>t;++t)o[t][a]||(l[e++]=o[t]);for(t=0,n=s.length;n>t;++t)delete s[t][a]}else for(r=u.count.map(s),t=0,e=0,n=o.length;n>t;++t)r[o[t]]>0?r[o[t]]-=1:l[e++]=o[t];return this._rem=[],this._add=l},o.extent=function(t){if(this._get!==t||!this._ext){var e=this.values(),n=u.extent.index(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},o.argmin=function(t){return this.extent(t)[0]},o.argmax=function(t){return this.extent(t)[1]},o.min=function(t){var e=this.extent(t)[0];return e?t(e):+(1/0)},o.max=function(t){var e=this.extent(t)[1];return e?t(e):-(1/0)},o.quartile=function(t){return this._get===t&&this._q||(this._q=u.quartile(this.values(),t),this._get=t),this._q},o.q1=function(t){return this.quartile(t)[0]},o.q2=function(t){return this.quartile(t)[1]},o.q3=function(t){return this.quartile(t)[2]},e.exports=r},{"../stats":25,"../util":28}],8:[function(t,e,n){var r=t("../util"),i=t("./aggregator");e.exports=function(){var t=[].reduce.call(arguments,function(t,e){return t.concat(r.array(e))},[]);return(new i).groupby(t).summarize({"*":"values"})}},{"../util":28,"./aggregator":6}],9:[function(t,e,n){function r(t){return function(e){var n=a.extend({init:"",add:"",rem:"",idx:0},t);return n.out=e||t.name,n}}function i(t,e){function n(t,r){function i(e){t[e]||n(t,t[e]=o[e]())}return r.req&&r.req.forEach(i),e&&r.str&&r.str.forEach(i),t}var r=t.reduce(n,t.reduce(function(t,e){return t[e.name]=e,t},{}));return a.vals(r).sort(function(t,e){return t.idx-e.idx})}function u(e,n,r,u){var o=i(e,n),s="this.cell = cell; this.tuple = t; this.valid = 0; this.missing = 0;",c="if (v==null) this.missing++; if (!this.isValid(v)) return; ++this.valid;",l="if (v==null) this.missing--; if (!this.isValid(v)) return; --this.valid;",f="var t = this.tuple; var cell = this.cell;";return o.forEach(function(t){t.idx<0?(s=t.init+s,c=t.add+c,l=t.rem+l):(s+=t.init,c+=t.add,l+=t.rem)}),e.slice().sort(function(t,e){return t.idx-e.idx}).forEach(function(t){f+="this.assign(t,'"+t.out+"',"+t.set+");"}),f+="return t;",s=Function("cell","t",s),s.prototype.assign=u,s.prototype.add=Function("t","var v = this.get(t);"+c),s.prototype.rem=Function("t","var v = this.get(t);"+l),s.prototype.set=Function(f),s.prototype.get=r,s.prototype.distinct=t("../stats").count.distinct,s.prototype.isValid=a.isValid,s.fields=e.map(a.$("out")),s}var a=t("../util"),o={values:r({name:"values",init:"cell.collect = true;",set:"cell.data.values()",idx:-1}),count:r({name:"count",set:"cell.num"}),missing:r({name:"missing",set:"this.missing"}),valid:r({name:"valid",set:"this.valid"}),sum:r({name:"sum",init:"this.sum = 0;",add:"this.sum += v;",rem:"this.sum -= v;",set:"this.sum"}),mean:r({name:"mean",init:"this.mean = 0;",add:"var d = v - this.mean; this.mean += d / this.valid;",rem:"var d = v - this.mean; this.mean -= this.valid ? d / this.valid : this.mean;",set:"this.mean"}),average:r({name:"average",set:"this.mean",req:["mean"],idx:1}),variance:r({name:"variance",init:"this.dev = 0;",add:"this.dev += d * (v - this.mean);",rem:"this.dev -= d * (v - this.mean);",set:"this.valid > 1 ? this.dev / (this.valid-1) : 0",req:["mean"],idx:1}),variancep:r({name:"variancep",set:"this.valid > 1 ? this.dev / this.valid : 0",req:["variance"],idx:2}),stdev:r({name:"stdev",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid-1)) : 0",req:["variance"],idx:2}),stdevp:r({name:"stdevp",set:"this.valid > 1 ? Math.sqrt(this.dev / this.valid) : 0",req:["variance"],idx:2}),median:r({name:"median",set:"cell.data.q2(this.get)",req:["values"],idx:3}),q1:r({name:"q1",set:"cell.data.q1(this.get)",req:["values"],idx:3}),q3:r({name:"q3",set:"cell.data.q3(this.get)",req:["values"],idx:3}),distinct:r({name:"distinct",set:"this.distinct(cell.data.values(), this.get)",req:["values"],idx:3}),argmin:r({name:"argmin",add:"if (v < this.min) this.argmin = t;",rem:"if (v <= this.min) this.argmin = null;",set:"this.argmin = this.argmin || cell.data.argmin(this.get)",req:["min"],str:["values"],idx:3}),argmax:r({name:"argmax",add:"if (v > this.max) this.argmax = t;",rem:"if (v >= this.max) this.argmax = null;",set:"this.argmax = this.argmax || cell.data.argmax(this.get)",req:["max"],str:["values"],idx:3}),min:r({name:"min",init:"this.min = +Infinity;",add:"if (v < this.min) this.min = v;",rem:"if (v <= this.min) this.min = NaN;",set:"this.min = (isNaN(this.min) ? cell.data.min(this.get) : this.min)",str:["values"],idx:4}),max:r({name:"max",init:"this.max = -Infinity;",add:"if (v > this.max) this.max = v;",rem:"if (v >= this.max) this.max = NaN;",set:"this.max = (isNaN(this.max) ? cell.data.max(this.get) : this.max)",str:["values"],idx:4}),modeskew:r({name:"modeskew",set:"this.dev===0 ? 0 : (this.mean - cell.data.q2(this.get)) / Math.sqrt(this.dev/(this.valid-1))",req:["mean","stdev","median"],idx:5})};o.create=u,e.exports=o},{"../stats":25,"../util":28}],10:[function(t,e,n){function r(t){if(!t)throw Error("Missing binning options.");var e,n,r,o,s,c,l,f=t.maxbins||15,d=t.base||10,m=Math.log(d),h=t.div||[5,2],g=t.min,p=t.max,v=p-g;if(t.step)e=t.step;else if(t.steps)e=t.steps[Math.min(t.steps.length-1,i(t.steps,v/f,0,t.steps.length))];else{n=Math.ceil(Math.log(f)/m),r=t.minstep||0,e=Math.max(r,Math.pow(d,Math.round(Math.log(v)/m)-n));do e*=d;while(Math.ceil(v/e)>f);for(c=0;c=r&&f>=v/s&&(e=s)}return s=Math.log(e),o=s>=0?0:~~(-s/m)+1,l=Math.pow(d,-o-1),g=Math.min(g,Math.floor(g/e+l)*e),p=Math.ceil(p/e)*e,{start:g,stop:p,step:e,unit:{precision:o},value:u,index:a}}function i(t,e,n,r){for(;r>n;){var i=n+r>>>1;c.cmp(t[i],e)<0?n=i+1:r=i}return n}function u(t){return this.step*Math.floor(t/this.step+f)}function a(t){return Math.floor((t-this.start)/this.step+f)}function o(t){return this.unit.date(u.call(this,t))}function s(t){return a.call(this,this.unit.unit(t))}var c=t("../util"),l=t("../time"),f=1e-15;r.date=function(t){if(!t)throw Error("Missing date binning options.");var e=t.utc?l.utc:l,n=t.min,i=t.max,u=t.maxbins||20,a=t.minbins||4,c=+i-+n,f=t.unit?e[t.unit]:e.find(c,a,u),d=r({min:null!=f.min?f.min:f.unit(n),max:null!=f.max?f.max:f.unit(i),maxbins:u,minstep:f.minstep,steps:f.step});return d.unit=f,d.index=s,t.raw||(d.value=o),d},e.exports=r},{"../time":27,"../util":28}],11:[function(t,e,n){function r(t,e,n){n=a(t,e,n);var r=u(n);return r?d.$func("bin",r.unit.unit?function(t){return r.value(r.unit.unit(t))}:function(t){return r.value(t)})(n.accessor):n.accessor||d.identity}function i(t,e,n){n=a(t,e,n);var r=u(n);return r?o(t,n.accessor,r):s(t,n.accessor,n&&n.sort)}function u(t){var e=t.type,n=null;return(null==e||h[e])&&("integer"===e&&null==t.minstep&&(t.minstep=1),n="date"===e?c.date(t):c(t)),n}function a(){var t=arguments,e=0,n=d.isArray(t[e])?t[e++]:null,r=d.isFunction(t[e])||d.isString(t[e])?d.$(t[e++]):null,i=d.extend({},t[e]);if(n&&(i.type=i.type||f(n,r),h[i.type])){var u=m.extent(n,r);i=d.extend({min:u[0],max:u[1]},i)}return r&&(i.accessor=r),i}function o(t,e,n){for(var r,i,u=l.range(n.start,n.stop+n.step/2,n.step).map(function(t){return{value:n.value(t),count:0}}),a=0;ai||i>=u.length||!isFinite(i))continue;u[i].count+=1}return u.bins=n,u}function s(t,e,n){var r=m.unique(t,e),i=m.count.map(t,e);return r.map(function(t){return{value:t,count:i[t]}}).sort(d.comparator(n?"-count":"+value"))}var c=t("./bins"),l=t("../generate"),f=t("../import/type"),d=t("../util"),m=t("../stats"),h={integer:1,number:1,date:1};e.exports={$bin:r,histogram:i}},{"../generate":13,"../import/type":22,"../stats":25,"../util":28,"./bins":10}],12:[function(t,e,n){function r(t){var e=f.localeFormat(t);if(null==e)throw Error("Unrecognized locale: "+t);d=e}function i(t){var e=l.localeFormat(t);if(null==e)throw Error("Unrecognized locale: "+t);m=e}function u(t,e){null==e&&(e=10);var n=t[0],r=t[t.length-1];n>r&&(a=r,r=n,n=a);var i=r-n,u=Math.pow(10,Math.floor(Math.log(i/e)/Math.LN10)),a=i/e/u;return a>=h?u*=10:a>=g?u*=5:a>=p&&(u*=2),[Math.ceil(n/u)*u,Math.floor(r/u)*u+u/2,u]}function a(t,e,n){var r=u(t,e);if(null==n)n=",."+f.precisionFixed(r[2])+"f";else switch(n=f.formatSpecifier(n),n.type){case"s":var i=Math.max(Math.abs(r[0]),Math.abs(r[1]));return null==n.precision&&(n.precision=f.precisionPrefix(r[2],i)),d.formatPrefix(n,i);case"":case"e":case"g":case"p":case"r":null==n.precision&&(n.precision=f.precisionRound(r[2],Math.max(Math.abs(r[0]),Math.abs(r[1])))-("e"===n.type));break;case"f":case"%":null==n.precision&&(n.precision=f.precisionFixed(r[2])-2*("%"===n.type))}return d.format(n)}function o(){var t=m.format,e=t(".%L"),n=t(":%S"),r=t("%I:%M"),i=t("%I %p"),u=t("%a %d"),a=t("%b %d"),o=t("%B"),s=t("%Y");return function(t){var l=+t;return(c.second(t)n;++n)r[n]=t;return r},r.zeros=function(t){return r.repeat(0,t)},r.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n==1/0)throw new Error("Infinite range");var r,i=[],u=-1;if(0>n)for(;(r=t+n*++u)>e;)i.push(r);else for(;(r=t+n*++u)1);return i=Math.sqrt(-2*Math.log(r)/r),n=t+a*i*e,t+u*i*e};return i.samples=function(t){return r.zeros(t).map(i)},i}},{}],14:[function(t,e,n){function r(t,e){if(t){var n=e.header;t=(n?n.join(e.delimiter)+"\n":"")+t}return u.dsv(e.delimiter).parse(t)}var i=t("../../util"),u=t("d3-dsv");r.delimiter=function(t){var e={delimiter:t};return function(t,n){return r(t,n?i.extend(n,e):e)}},e.exports=r},{"../../util":28,"d3-dsv":2}],15:[function(t,e,n){var r=t("./dsv");e.exports={json:t("./json"),topojson:t("./topojson"),treejson:t("./treejson"),dsv:r,csv:r.delimiter(","),tsv:r.delimiter(" ")}},{"./dsv":14,"./json":16,"./topojson":17,"./treejson":18}],16:[function(t,e,n){var r=t("../../util");e.exports=function(t,e){var n=r.isObject(t)&&!r.isBuffer(t)?t:JSON.parse(t);return e&&e.property&&(n=r.accessor(e.property)(n)),n}},{"../../util":28}],17:[function(t,e,n){(function(n){var r=t("./json"),i=function(t,e){var n=i.topojson;if(null==n)throw Error("TopoJSON library not loaded.");var u,a=r(t,e);if(e&&e.feature){if(u=a.objects[e.feature])return n.feature(a,u).features;throw Error("Invalid TopoJSON object: "+e.feature)}if(e&&e.mesh){if(u=a.objects[e.mesh])return[n.mesh(a,a.objects[e.mesh])];throw Error("Invalid TopoJSON object: "+e.mesh)}throw Error("Missing TopoJSON feature or mesh parameter.")};i.topojson="undefined"!=typeof window?window.topojson:"undefined"!=typeof n?n.topojson:null,e.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./json":16}],18:[function(t,e,n){function r(t,e){function n(t){r.push(t);var i=t[e];if(i)for(var u=0;u1&&"."===r[e-1]&&r.lastIndexOf(t)===e});if(!s)throw"URL is not whitelisted: "+n}}return n}function i(t,e){var n,r=e||function(t){throw t};try{n=i.sanitizeUrl(t)}catch(u){return void r(u)}return n?i.useXHR?a(n,e):c(n,f)?o(n.slice(f.length),e):n.indexOf("://")<0?o(n,e):s(n,e):void r("Invalid URL: "+t.url)}function u(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function a(t,e){function n(){var t=i.status;!t&&u(i)||t>=200&&300>t||304===t?e(null,i.responseText):e(i,null)}var r=!!e,i=new XMLHttpRequest;return!this.XDomainRequest||"withCredentials"in i||!/^(http(s)?:)?\/\//.test(t)||(i=new XDomainRequest),r&&("onload"in i?i.onload=i.onerror=n:i.onreadystatechange=function(){i.readyState>3&&n()}),i.open("GET",t,r),i.send(),!r&&u(i)?i.responseText:void 0}function o(e,n){var r=t("fs");return n?void r.readFile(e,n):r.readFileSync(e,"utf8")}function s(e,n){if(!n)return t("sync-request")("GET",e).getBody();var r={url:e,encoding:null,gzip:!0};t("request")(r,function(t,e,r){t||200!==e.statusCode?(t=t||"Load failed with response code "+e.statusCode+".",n(t,null)):n(null,r)})}function c(t,e){return null==t?!1:0===t.lastIndexOf(e,0)}var l=/^([A-Za-z]+:)?\/\//,f="file://";i.sanitizeUrl=r,i.useXHR="undefined"!=typeof XMLHttpRequest,e.exports=i},{fs:1,request:1,"sync-request":1,url:1}],20:[function(t,e,n){function r(t,e){var n=e&&e.type||"json";return t=o[n](t,e),e&&e.parse&&i(t,e.parse),t}function i(t,e){var n,r,i,o,s,c,l=t.length;for(e="auto"===e?a.inferAll(t):u.duplicate(e),n=u.keys(e),r=n.map(function(t){return a.parsers[e[t]]}),o=0,c=n.length;l>o;++o)for(i=t[o],s=0;c>s;++s)i[n[s]]=r[s](i[n[s]]);a.annotation(t,e)}var u=t("../util"),a=t("./type"),o=t("./formats");r.formats=o,e.exports=r},{"../util":28,"./formats":15,"./type":22}],21:[function(t,e,n){var r=t("../util"),i=t("./load"),u=t("./read");e.exports=r.keys(u.formats).reduce(function(t,e){return t[e]=function(t,n,a){r.isString(t)&&(t={url:t}),2===arguments.length&&r.isFunction(n)&&(a=n,n=void 0),n=r.extend({parse:"auto"},n),n.type=e;var o=i(t,a?function(t,e){if(t)return void a(t,null);try{e=u(e,n),a(null,e)}catch(r){a(r,null)}}:void 0);return a?void 0:u(o,n)},t},{})},{"../util":28,"./load":19,"./read":20}],22:[function(t,e,n){function r(t,e){return e?void(t[c]=e):t&&t[c]||null}function i(t,e){e=s.$(e);var n,r,i;if(t[c]&&(n=e(t[c]),s.isString(n)))return n;for(r=0,i=t.length;!s.isValid(n)&&i>r;++r)n=e?e(t[r]):t[r];return s.isDate(n)?"date":s.isNumber(n)?"number":s.isBoolean(n)?"boolean":s.isString(n)?"string":null}function u(t,e){return t.length?(e=e||s.keys(t[0]),e.reduce(function(e,n){return e[n]=i(t,n),e},{})):void 0}function a(t,e){e=s.$(e);var n,r,i,u=["boolean","integer","number","date"];for(n=0;n0?Math.min(a,e.maxwidth):a}),m=n.map(function(t,e){return u.truncate(u.pad(t,d[e],"center"),d[e])}).join(e.separator),h=s(n.map(function(t,e){return"{{"+t+(c[r[t]]||"")+("|pad:"+d[e]+","+(l[r[t]]||"right"))+("|truncate:"+d[e])+"}}"}).join(e.separator));return m+"\n"+t.map(h).join("\n")},e.exports.summary=function(t){t=t?t.__summary__?t:o.summary(t):this;var e,n,u=[];for(e=0,n=t.length;n>e;++e)u.push("-- "+t[e].field+" --"),"string"===t[e].type||t[e].distinct<10?u.push(i(t[e])):u.push(r(t[e])),u.push("");return u.join("\n")}},{"./import/type":22,"./stats":25,"./template":26,"./util":28}],25:[function(t,e,n){var r=t("./util"),i=t("./import/type"),u=t("./generate"),a={};a.unique=function(t,e,n){e=r.$(e),n=n||[];var i,u,a,o={};for(u=0,a=t.length;a>u;++u)i=e?e(t[u]):t[u],i in o||(o[i]=1,n.push(i));return n},a.count=function(t){return t&&t.length||0},a.count.valid=function(t,e){e=r.$(e);var n,i,u,a=0;for(i=0,u=t.length;u>i;++i)n=e?e(t[i]):t[i],r.isValid(n)&&(a+=1);return a},a.count.missing=function(t,e){e=r.$(e);var n,i,u,a=0;for(i=0,u=t.length;u>i;++i)n=e?e(t[i]):t[i],null==n&&(a+=1);return a},a.count.distinct=function(t,e){e=r.$(e);var n,i,u,a={},o=0;for(i=0,u=t.length;u>i;++i)n=e?e(t[i]):t[i],n in a||(a[n]=1,o+=1);return o},a.count.map=function(t,e){e=r.$(e);var n,i,u,a={};for(i=0,u=t.length;u>i;++i)n=e?e(t[i]):t[i],a[n]=n in a?a[n]+1:1;return a},a.median=function(t,e){return e&&(t=t.map(r.$(e))),t=t.filter(r.isValid).sort(r.cmp),a.quantile(t,.5)},a.quartile=function(t,e){e&&(t=t.map(r.$(e))),t=t.filter(r.isValid).sort(r.cmp);var n=a.quantile;return[n(t,.25),n(t,.5),n(t,.75)]},a.quantile=function(t,e,n){void 0===n&&(n=e,e=r.identity),e=r.$(e);var i=(t.length-1)*n+1,u=Math.floor(i),a=+e(t[u-1]),o=i-u;return o?a+o*(e(t[u])-a):a},a.sum=function(t,e){e=r.$(e);for(var n,i=0,u=0,a=t.length;a>u;++u)n=e?e(t[u]):t[u],r.isValid(n)&&(i+=n);return i},a.mean=function(t,e){e=r.$(e);var n,i,u,a,o,s=0;for(i=0,a=0,u=t.length;u>i;++i)o=e?e(t[i]):t[i],r.isValid(o)&&(n=o-s,s+=n/++a);return s},a.variance=function(t,e){if(e=r.$(e),!r.isArray(t)||t.length<2)return 0;var n,i,u,a,o=0,s=0;for(i=0,u=0;ia;++a)if(u=e?e(t[a]):t[a],r.isValid(u)){n=i=u;break}for(;o>a;++a)u=e?e(t[a]):t[a],r.isValid(u)&&(n>u&&(n=u),u>i&&(i=u));return[n,i]},a.extent.index=function(t,e){e=r.$(e);var n,i,u,a,o=-1,s=-1,c=t.length;for(a=0;c>a;++a)if(u=e?e(t[a]):t[a],r.isValid(u)){n=i=u,o=s=a;break}for(;c>a;++a)u=e?e(t[a]):t[a],r.isValid(u)&&(n>u&&(n=u,o=a),u>i&&(i=u,s=a));return[o,s]},a.dot=function(t,e,n){var i,u,a=0;if(n)for(e=r.$(e),n=r.$(n),i=0;in;++n){if(i=a[n].val,0>c&&l===i)c=n-1;else if(c>-1&&l!==i){for(u=1+(n-1+c)/2;n>c;++c)s[a[c].idx]=u;c=-1}s[a[n].idx]=n+1,l=i}if(c>-1)for(u=1+(o-1+c)/2;o>c;++c)s[a[c].idx]=u;return s},a.cor=function(t,e,n){var i=n;n=i?t.map(r.$(n)):e,e=i?t.map(r.$(e)):t;var u=a.dot(e,n),o=a.mean(e),s=a.mean(n),c=a.stdev(e),l=a.stdev(n),f=t.length;return(u-f*o*s)/((f-1)*c*l)},a.cor.rank=function(t,e,n){var i,u,o,s=n?a.rank(t,r.$(e)):a.rank(t),c=n?a.rank(t,r.$(n)):a.rank(e),l=t.length;for(i=0,u=0;l>i;++i)o=s[i]-c[i],u+=o*o;return 1-6*u/(l*(l*l-1))},a.cor.dist=function(t,e,n){var i,u,o,s,c=n?t.map(r.$(e)):t,l=n?t.map(r.$(n)):e,f=a.dist.mat(c),d=a.dist.mat(l),m=f.length;for(i=0,u=0,o=0,s=0;m>i;++i)u+=f[i]*f[i],o+=d[i]*d[i],s+=f[i]*d[i];return Math.sqrt(s/Math.sqrt(u*o))},a.dist=function(t,e,n,i){var u,a,o=r.isFunction(n)||r.isString(n),s=t,c=o?t:e,l=o?i:n,f=2===l||null==l,d=t.length,m=0;for(o&&(e=r.$(e),n=r.$(n)),a=0;d>a;++a)u=o?e(s[a])-n(c[a]):s[a]-c[a],m+=f?u*u:Math.pow(Math.abs(u),l);return f?Math.sqrt(m):Math.pow(m,1/l)},a.dist.mat=function(t){var e,n,r,i=t.length,a=i*i,o=Array(a),s=u.zeros(i),c=0;for(n=0;i>n;++n)for(o[n*i+n]=0,r=n+1;i>r;++r)o[n*i+r]=e=Math.abs(t[n]-t[r]),o[r*i+n]=e,s[n]+=e,s[r]+=e;for(n=0;i>n;++n)c+=s[n],s[n]/=i;for(c/=a,n=0;i>n;++n)for(r=n;i>r;++r)o[n*i+r]+=c-s[n]-s[r],o[r*i+n]=o[n*i+r];return o},a.entropy=function(t,e){e=r.$(e);var n,i,u=0,a=0,o=t.length;for(n=0;o>n;++n)u+=e?e(t[n]):t[n];if(0===u)return 0;for(n=0;o>n;++n)i=(e?e(t[n]):t[n])/u,i&&(a+=i*Math.log(i));return-a/Math.LN2},a.mutual=function(t,e,n,i){var u,a,o,s=i?t.map(r.$(e)):t,c=i?t.map(r.$(n)):e,l=i?t.map(r.$(i)):n,f={},d={},m=l.length,h=0,g=0,p=0;for(o=0;m>o;++o)f[s[o]]=0,d[c[o]]=0;for(o=0;m>o;++o)f[s[o]]+=l[o],d[c[o]]+=l[o],h+=l[o];for(a=1/(h*Math.LN2),o=0;m>o;++o)0!==l[o]&&(u=h*l[o]/(f[s[o]]*d[c[o]]),g+=l[o]*a*Math.log(u),p+=l[o]*a*Math.log(l[o]/h));return[g,1+g/p]},a.mutual.info=function(t,e,n,r){return a.mutual(t,e,n,r)[0]},a.mutual.dist=function(t,e,n,r){return a.mutual(t,e,n,r)[1]},a.profile=function(t,e){var n,u,o,s,c,l=0,f=0,d=0,m=0,h=null,g=null,p=0,v=[],y={};for(o=0;oc)&&(h=c),(null===g||c>g)&&(g=c),n=c-l,l+=n/++f,p+=n*(c-l),v.push(c));return p/=f-1,u=Math.sqrt(p),v.sort(r.cmp),{type:i(t,e),unique:y,count:t.length,valid:f,missing:d,distinct:m,min:h,max:g,mean:l,stdev:u,median:s=a.quantile(v,.5),q1:a.quantile(v,.25),q3:a.quantile(v,.75),modeskew:0===u?0:(l-s)/u}},a.summary=function(t,e){e=e||r.keys(t[0]);var n=e.map(function(e){var n=a.profile(t,r.$(e));return n.field=e,n});return n.__summary__=!0,n},e.exports=a},{"./generate":13,"./import/type":22,"./util":28}],26:[function(t,e,n){function r(t){var e=i(t,"d");return e="var __t; return "+e+";",new Function("d",e).bind(l)}function i(t,e,n){e=e||"obj";var r=0,i="'",o=f;return t.replace(o,function(o,s,c){return i+=t.slice(r,c).replace(g,a),r=c+o.length,s&&(i+="'\n+((__t=("+u(s,e,n)+"))==null?'':__t)+\n'"),o}),i+"'"}function u(t,e,n){function i(t){return t=t||"",g?(g=!1,p="String("+p+")"+t):p+=t,p}function u(){return"(typeof "+p+'==="number"?new Date('+p+"):"+p+")"}function a(t,e){M=o(w[0],e,t),g=!1,p="this.formats["+M+"]("+p+")"}function l(t,e){M=o(w[0],e,t),g=!1,p="this.formats["+M+"]("+u()+")"}var f=t.match(d),h=f.shift().trim(),g=!0;n&&(n[h]=1);for(var p=r.property(e,h),v=0;v0&&(x=x.slice(0,y),w=f[v].slice(y+1).match(m).map(function(t){return t.trim()})),x=x.trim()){case"length":i(".length");break;case"lower":i(".toLowerCase()");break;case"upper":i(".toUpperCase()");break;case"lower-locale":i(".toLocaleLowerCase()");break;case"upper-locale":i(".toLocaleUpperCase()");break;case"trim":i(".trim()");break;case"left":M=s.number(w[0]),i(".slice(0,"+M+")");break;case"right":M=s.number(w[0]),i(".slice(-"+M+")");break;case"mid":M=s.number(w[0]),b=M+s.number(w[1]),i(".slice(+"+M+","+b+")");break;case"slice":M=s.number(w[0]),i(".slice("+M+(w.length>1?","+s.number(w[1]):"")+")");break;case"truncate":M=s.number(w[0]),b=w[1],b="left"!==b&&"middle"!==b&&"center"!==b?"right":b,p="this.truncate("+i()+","+M+",'"+b+"')";break;case"pad":M=s.number(w[0]),b=w[1],b="left"!==b&&"middle"!==b&&"center"!==b?"right":b,p="this.pad("+i()+","+M+",'"+b+"')";break;case"number":a(c.number,"number");break;case"time":l(c.time,"time");break;case"time-utc":l(c.utc,"time-utc");break;default:throw Error("Unrecognized template filter: "+x)}}return p}function a(t){return"\\"+h[t]}function o(t,e,n){if(!("'"===t[0]&&"'"===t[t.length-1]||'"'===t[0]&&'"'===t[t.length-1]))throw Error("Format pattern must be quoted: "+t);if(t=t.slice(1,-1),e=e+":"+t,!l.format_map[e]){var r=n(t),i=l.formats.length;l.formats.push(r),l.format_map[e]=i}return l.format_map[e]}var s=t("./util"),c=t("./format"),l={formats:[],format_map:{},truncate:s.truncate,pad:s.pad};r.source=i,r.context=l,e.exports=r,r.clearFormatCache=function(){l.formats=[],l.format_map={}},r.property=function(t,e){var n=s.field(e).map(s.str).join("][");return t+"["+n+"]"};var f=/\{\{(.+?)\}\}|$/g,d=/(?:"[^"]*"|\'[^\']*\'|[^\|"]+|[^\|\']+)+/g,m=/(?:"[^"]*"|\'[^\']*\'|[^,"]+|[^,\']+)+/g,h={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},g=/\\|'|\r|\n|\u2028|\u2029/g},{"./format":12,"./util":28}],27:[function(t,e,n){function r(t){return c.setTime(+t),c}function i(t,e,n,r,i,u){var a={type:t,date:e,unit:n};return r?a.step=r:a.minstep=1,null!=i&&(a.min=i),null!=u&&(a.max=u),a}function u(t,e,n,r,u,a){return i(t,function(t){return e.offset(n,t)},function(t){return e.count(n,t)},r,u,a)}function a(t,e,n,r){var i,u,a,o=h[0];for(i=1,u=h.length;u>i;++i)if(o=h[i],e>o[0]){if(a=e/o[0],a>r)return t[h[i-1][1]];if(a>=n)return t[o[1]]}return t[h[u-1][1]]}function o(t){var e,n,r={};for(e=0,n=t.length;n>e;++e)r[t[e].type]=t[e];return r.find=function(e,n,r){return a(t,e,n,r)},r}var s=t("d3-time"),c=new Date,l=new Date(0,0,1).setFullYear(0),f=new Date(Date.UTC(0,0,1)).setUTCFullYear(0),d=[u("second",s.second,l),u("minute",s.minute,l),u("hour",s.hour,l),u("day",s.day,l,[1,7]),u("month",s.month,l,[1,3,6]),u("year",s.year,l),i("seconds",function(t){return new Date(1970,0,1,0,0,t)},function(t){return r(t).getSeconds()},null,0,59),i("minutes",function(t){return new Date(1970,0,1,0,t)},function(t){return r(t).getMinutes()},null,0,59),i("hours",function(t){return new Date(1970,0,1,t)},function(t){return r(t).getHours()},null,0,23),i("weekdays",function(t){return new Date(1970,0,4+t)},function(t){return r(t).getDay()},[1],0,6),i("dates",function(t){return new Date(1970,0,t)},function(t){return r(t).getDate()},[1],1,31),i("months",function(t){return new Date(1970,t%12,1)},function(t){return r(t).getMonth()},[1],0,11)],m=[u("second",s.utcSecond,f),u("minute",s.utcMinute,f),u("hour",s.utcHour,f),u("day",s.utcDay,f,[1,7]),u("month",s.utcMonth,f,[1,3,6]),u("year",s.utcYear,f),i("seconds",function(t){return new Date(Date.UTC(1970,0,1,0,0,t))},function(t){return r(t).getUTCSeconds()},null,0,59),i("minutes",function(t){return new Date(Date.UTC(1970,0,1,0,t))},function(t){return r(t).getUTCMinutes()},null,0,59),i("hours",function(t){return new Date(Date.UTC(1970,0,1,t))},function(t){return r(t).getUTCHours()},null,0,23),i("weekdays",function(t){return new Date(Date.UTC(1970,0,4+t))},function(t){return r(t).getUTCDay()},[1],0,6),i("dates",function(t){return new Date(Date.UTC(1970,0,t))},function(t){return r(t).getUTCDate()},[1],1,31),i("months",function(t){return new Date(Date.UTC(1970,t%12,1))},function(t){return r(t).getUTCMonth()},[1],0,11)],h=[[31536e6,5],[7776e6,4],[2592e6,4],[12096e5,3],[6048e5,3],[1728e5,3],[864e5,3],[432e5,2],[216e5,2],[108e5,2],[36e5,2],[18e5,1],[9e5,1],[3e5,1],[6e4,1],[3e4,0],[15e3,0],[5e3,0],[1e3,0]];e.exports=o(d),e.exports.utc=o(m)},{"d3-time":5}],28:[function(t,e,n){function r(t){return t.replace(d,"$1\\'")}function i(t,e){var n,r="";for(n=0;t>n;++n)r+=e;return r}function u(t,e,n){var r=0,i=t.split(h);return t=n?(i=i.reverse()).filter(function(t){return r+=t.length,e>=r}).reverse():i.filter(function(t){return r+=t.length,e>=r}),t.length?t.join("").trim():i[0].slice(0,e)}var a=t("buffer"),o=t("./time"),s=o.utc,c=e.exports={},l="__name__";c.namedfunc=function(t,e){return e[l]=t,e},c.name=function(t){return null==t?null:t[l]},c.identity=function(t){return t},c["true"]=c.namedfunc("true",function(){return!0}),c["false"]=c.namedfunc("false",function(){return!1}),c.duplicate=function(t){return JSON.parse(JSON.stringify(t))},c.equal=function(t,e){return JSON.stringify(t)===JSON.stringify(e)},c.extend=function(t){for(var e,n,r=1,i=arguments.length;i>r;++r){e=arguments[r];for(n in e)t[n]=e[n]}return t},c.length=function(t){return null!=t&&null!=t.length?t.length:null},c.keys=function(t){var e,n=[];for(e in t)n.push(e);return n},c.vals=function(t){var e,n=[];for(e in t)n.push(t[e]);return n},c.toMap=function(t,e){return(e=c.$(e))?t.reduce(function(t,n){return t[e(n)]=1,t},{}):t.reduce(function(t,e){return t[e]=1,t},{})},c.keystr=function(t){var e=t.length;if(!e)return"";for(var n=String(t[0]),r=1;e>r;++r)n+="|"+String(t[r]);return n};var f=Object.prototype.toString;c.isObject=function(t){return t===Object(t)},c.isFunction=function(t){
-return"[object Function]"===f.call(t)},c.isString=function(t){return"string"==typeof value||"[object String]"===f.call(t)},c.isArray=Array.isArray||function(t){return"[object Array]"===f.call(t)},c.isNumber=function(t){return"number"==typeof t||"[object Number]"===f.call(t)},c.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==f.call(t)},c.isDate=function(t){return"[object Date]"===f.call(t)},c.isValid=function(t){return null!=t&&t===t},c.isBuffer=a.Buffer&&a.Buffer.isBuffer||c["false"],c.number=function(t){return null==t||""===t?null:+t},c["boolean"]=function(t){return null==t||""===t?null:"false"===t?!1:!!t},c.date=function(t){return null==t||""===t?null:Date.parse(t)},c.array=function(t){return null!=t?c.isArray(t)?t:[t]:[]},c.str=function(t){return c.isArray(t)?"["+t.map(c.str)+"]":c.isObject(t)?JSON.stringify(t):c.isString(t)?"'"+r(t)+"'":t};var d=/(^|[^\\])'/g,m=/\[(.*?)\]|[^.\[]+/g;c.field=function(t){return String(t).match(m).map(function(t){return"["!==t[0]?t:"'"!==t[1]&&'"'!==t[1]?t.slice(1,-1):t.slice(2,-2).replace(/\\(["'])/g,"$1")})},c.accessor=function(t){var e;return null==t||c.isFunction(t)?t:c.namedfunc(t,(e=c.field(t)).length>1?function(t){return e.reduce(function(t,e){return t[e]},t)}:function(e){return e[t]})},c.$=c.accessor,c.mutator=function(t){var e;return c.isString(t)&&(e=c.field(t)).length>1?function(t,n){for(var r=0;ri;++i){if(a=t[i],o=a(n),s=a(r),s>o)return-1*e[i];if(o>s)return e[i]}return 0}},c.cmp=function(t,e){return e>t?-1:t>e?1:t>=e?0:null===t?-1:null===e?1:NaN},c.numcmp=function(t,e){return t-e},c.stablesort=function(t,e,n){var r=t.reduce(function(t,e,r){return t[n(e)]=r,t},{});return t.sort(function(t,i){var u=e(t),a=e(i);return a>u?-1:u>a?1:r[n(t)]-r[n(i)]}),t},c.pad=function(t,e,n,r){r=r||" ";var u=e-t.length;if(0>=u)return t;switch(n){case"left":return i(u,r)+t;case"middle":case"center":return i(Math.floor(u/2),r)+t+i(Math.ceil(u/2),r);default:return t+i(u,r)}},c.truncate=function(t,e,n,r,i){var a=t.length;if(e>=a)return t;i=void 0!==i?String(i):"…";var o=Math.max(0,e-i.length);switch(n){case"left":return i+(r?u(t,o,1):t.slice(a-o));case"middle":case"center":var s=Math.ceil(o/2),c=Math.floor(o/2);return(r?u(t,s):t.slice(0,s))+i+(r?u(t,c,1):t.slice(a-c));default:return(r?u(t,o):t.slice(0,o))+i}};var h=/([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/},{"./time":27,buffer:1}]},{},[23])(23)});
\ No newline at end of file
diff --git a/public/js/explore-sql.min.js b/public/js/explore-sql.min.js
deleted file mode 100644
index ddbed69..0000000
--- a/public/js/explore-sql.min.js
+++ /dev/null
@@ -1,44 +0,0 @@
-!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}r(1);var i=r(5),a=o(i),s=r(6),u=o(s),l=r(7),c=(o(l),r(8)),f=(o(c),r(9)),d=o(f),p=r(10),h=r(29),g=o(h),m=r(289),y=o(m),v=r(138),b=r(197),w=n(b);r(312).polyfill();var _={datasources:{IDS:[0,1,7,2],BY_ID:{7:{id:7,name:"Iris",type:"dataframe",url:"http://vega.github.io/polestar/data/iris.json",settings:{format:"json"}},0:{id:0,name:"Birdstrikes",type:"dataframe",url:"http://vega.github.io/polestar/data/birdstrikes.json",settings:{format:"json"}},1:{id:1,name:"Cars",type:"dataframe",url:"http://vega.github.io/polestar/data/cars.json",settings:{format:"json"}},2:{id:2,name:"NBA League Totals per year",type:"dataframe",url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/f6d6496474af6dfba0b73f36dbd0e00ce0fc2f42/leagues_NBA_player_totals.csv",settings:{format:"csv",delimiter:","}}}}};d["default"].each(_.datasources.BY_ID,function(e){(0,d["default"])(e.tables).each(function(e){return(0,d["default"])(e.schema).each(function(e,t){return e.__id__=t}).value()}).value(),(0,d["default"])(e.schema).each(function(e,t){return e.__id__=t}).value()});var x=(0,y["default"])(_);u["default"].render(a["default"].createElement(p.Provider,{store:x},a["default"].createElement(g["default"],null)),document.getElementById("demo")),x.dispatch((0,v.connectTableIfNecessary)({datasource_id:0})).then(function(){x.dispatch((0,v.selectTable)({datasource_id:0})),x.dispatch(w.addField("row",{id:"agg_count",name:"COUNT",type:"aggregate",op:"count"})),x.dispatch(w.addField("col",{tableId:{id:0,name:"Birdstrikes"},fieldId:3,func:"year"})),x.dispatch(w.addField("color",{tableId:{id:0,name:"Birdstrikes"},fieldId:7}))})},function(e,t,r){var n=r(2);"string"==typeof n&&(n=[[e.id,n,""]]);r(4)(n,{});n.locals&&(e.exports=n.locals)},function(e,t,r){t=e.exports=r(3)(),t.push([e.id,'body,html{font-size:16px;background-color:#f4f8fb;height:100%;min-width:1024px;margin:0;display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:column;-ms-flex-flow:column;flex-flow:column}label{font-weight:400;font-size:.85rem}.demo.explorer .demo-title{padding:.5rem;border-bottom:1px solid #dfdfdf;background-color:#fff;overflow:auto;-webkit-box-flex:0;-webkit-flex:0 0 auto;-moz-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.demo.explorer .demo-title h1.post-title{font-weight:400;font-size:1.25rem;margin:0;float:left}.demo.explorer .demo-title a{float:right;font-size:1rem;margin:0;padding-left:1rem}#demo{font-size:14px;-webkit-flex:1 1 auto;-moz-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}#demo,.pane-container{display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1}.pane-container{-webkit-flex:1 0 auto;-moz-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;-webkit-flex-flow:row;-ms-flex-flow:row;flex-flow:row}.container-flex-fill-wrap{position:relative;-webkit-box-flex:1;-webkit-flex:1 1 auto;-moz-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}.container-flex-fill-wrap .container-flex-fill{position:absolute;top:0;bottom:0;left:0;right:0;display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex}.container-flex-fill-wrap .container-flex-fill pre{overflow:auto;white-space:pre;word-wrap:normal;margin-right:10px}.pane-container .pane{background-color:#fff;border:1px solid #dfdfdf;border-radius:1px;margin:10px;margin-left:0;display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1 1 auto;-moz-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;-moz-justify-content:space-between;justify-content:space-between}.pane-container .pane.data-pane{-webkit-flex-flow:column;-ms-flex-flow:column;flex-flow:column;-webkit-box-flex:0;-webkit-flex:0 1 253px;-moz-flex:0 1 253px;-ms-flex:0 1 253px;flex:0 1 253px;border-left:0}.pane-container .pane.graphic-pane{-webkit-box-flex:1;-webkit-flex:1 1 auto;-moz-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;flex-flow:column}.pane-container .pane.graphic-pane,.pane-container .pane.shelf-pane{background-color:transparent;border:none;-webkit-flex-flow:column;-ms-flex-flow:column}.pane-container .pane.shelf-pane{-webkit-box-flex:0;-webkit-flex:0 1 243px;-moz-flex:0 1 243px;-ms-flex:0 1 243px;flex:0 1 243px;flex-flow:column;position:relative}.func-wrap{padding-left:6px;text-transform:uppercase;text-shadow:#fff 0 1px 0;color:#222;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-box-flex:1;-webkit-flex:1 0 auto;-moz-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto}.func-wrap:empty{display:none}.icon-wrap{text-align:center;padding-left:3px;padding-right:3px;border-right:1px solid #dfdfdf}.name-wrap{position:relative;padding-left:6px;padding-right:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.name-wrap.has-func{padding-left:5px;padding-right:5px}.name-wrap.has-func:after,.name-wrap.has-func:before{position:absolute;top:-1px}.name-wrap.has-func:before{content:"(";left:0}.name-wrap.has-func:after{content:")";right:0}.option-wrap i.fa.fa-trash-o{padding:0 4px 0 3px}.field-wrap{position:relative;border:1px solid #dfdfdf;border-radius:1px;background-color:#f0f0f0;overflow:hidden;-webkit-box-flex:0;-webkit-flex:0 0 auto;-moz-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row;-ms-flex-flow:row;flex-flow:row;cursor:pointer;cursor:-webkit-grab;cursor:-moz-grab}.field-wrap:focus,.field-wrap:hover{box-shadow:0 1px 3px #dfdfdf}.field-wrap:active{box-shadow:0 2px 3px rgba(0,0,0,.8);cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing}.field-wrap.querybuilder-field{margin-right:6px;-webkit-box-flex:0;-webkit-flex:0 0 auto;-moz-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.field-wrap.querybuilder-field .icon-wrap{-webkit-box-flex:1;-webkit-flex:1 0 auto;-moz-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;max-width:60px}.field-wrap.querybuilder-field .icon-wrap i.fa.fa-long-arrow-right{padding:0 5px}.field-wrap.querybuilder-field .name-wrap{max-width:125px;-webkit-box-flex:0;-webkit-flex:0 1 auto;-moz-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto}.field-wrap.querybuilder-field .option-wrap{padding:0 3px;cursor:pointer}.field-wrap.querybuilder-field .option-wrap i.fa.fa-caret-down{padding:0 4px 0 3px;color:#aaa;text-shadow:#fff 0 1px 0;border-radius:2px}.field-wrap.querybuilder-field .option-wrap i.fa.fa-times.remove-link{text-shadow:#fff 0 1px 0;display:none}.field-wrap.querybuilder-field .option-wrap:active i.fa.fa-caret-down,.field-wrap.querybuilder-field .option-wrap:hover i.fa.fa-caret-down{text-shadow:none;color:#ddd;background-color:#bbb}.field-wrap.querybuilder-field .option-wrap:active i.fa.fa-caret-down{background-color:#aaa}.field-wrap.querybuilder-field:hover .option-wrap i.fa.fa-times.remove-link{display:initial}.field-drag-layer{position:fixed;pointer-events:none;left:0;top:0;width:100%;height:100%;z-index:100}.field-drag-layer .field-drag-wrap{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-flex;display:-ms-inline-flexbox;display:inline-flex}.field-drag-layer .field-drag-wrap .field-wrap{opacity:.92;box-shadow:0 2px 3px rgba(0,0,0,.8);cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing}.field-drag-layer .field-drag-wrap .field-wrap.remove{background-color:#f49ea8;border:1px solid #f18794;opacity:.5}.field-drag-layer .field-drag-wrap .field-wrap.remove .icon-wrap{border-right:1px solid #f18794}.field-contained:before{display:none}.field-empty:before{display:block}.field-drop-target{background-color:#eaf7e9}.field-drop-target:before{border-color:#999;font-weight:600}.field-drop-over{background-color:#c5eac3}.field-drop-over:before{border-color:#999;font-weight:600;background-color:#a1dc9e}.shelf-pane .container-flex-fill-wrap{background-color:#fff;border:1px solid #dfdfdf}.shelf-pane .container-flex-fill{-webkit-flex-flow:column;-ms-flex-flow:column;flex-flow:column;padding:5px 6px}.querybuilder-shelf,.shelf-pane .container-flex-fill{display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex}.querybuilder-shelf{position:relative;-webkit-box-flex:1;-webkit-flex:1 1 0px;-moz-flex:1 1 0px;-ms-flex:1 1 0px;flex:1 1 0px}.querybuilder-shelf label{position:relative;text-shadow:#fff 0 1px 0}.querybuilder-shelf label i.fa.fa-times.remove-link{position:absolute;top:0;right:0;padding:6px 5px 9px;display:none;cursor:pointer}.querybuilder-shelf label:hover i.fa.fa-times.remove-link{display:block}.querybuilder-shelf .querybuilder-field-container-wrap{-webkit-box-flex:1;-webkit-flex:1 0 auto;-moz-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;position:relative;overflow:hidden}.querybuilder-shelf .querybuilder-field-container-wrap:hover{overflow:auto}.querybuilder-shelf .querybuilder-field-container-wrap:before{content:"Drop Fields Here";position:absolute;margin:3px 6px;padding:0 6px;border:1px dotted #dfdfdf;border-radius:2px}.querybuilder-shelf .querybuilder-field-container{display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row;-ms-flex-flow:row;flex-flow:row;position:absolute;padding:3px 6px}.querybuilder-shelf .querybuilder-field-container .field-position-marker{position:absolute;background-color:#58c153;top:0;bottom:0;margin-left:-4px;width:2px}.querybuilder-shelf .querybuilder-field-container .field-position-marker:after,.querybuilder-shelf .querybuilder-field-container .field-position-marker:before{content:" ";position:absolute;left:-2px}.querybuilder-shelf .querybuilder-field-container .field-position-marker:before{top:0;border-top:3px solid #58c153;border-left:3px solid transparent;border-right:3px solid transparent}.querybuilder-shelf .querybuilder-field-container .field-position-marker:after{bottom:0;border-bottom:3px solid #58c153;border-left:3px solid transparent;border-right:3px solid transparent}.shelf-pane .querybuilder-shelf{margin-bottom:15px;-webkit-flex-flow:column;-ms-flex-flow:column;flex-flow:column;-webkit-box-flex:0;-webkit-flex:0 1 auto;-moz-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto}.shelf-pane .querybuilder-shelf .querybuilder-shelf-legend{overflow:auto;max-height:200px;padding:8px 6px 0}.shelf-pane .querybuilder-shelf label{display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-webkit-flex:0 1 auto;-moz-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}.shelf-pane .querybuilder-shelf label i.fa.fa-caret-down{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;position:relative;top:-3px;padding:3px;margin-left:auto;visibility:hidden;cursor:pointer}.shelf-pane .querybuilder-shelf label:focus i.fa.fa-caret-down,.shelf-pane .querybuilder-shelf label:hover i.fa.fa-caret-down{visibility:visible}.shelf-pane .querybuilder-shelf .querybuilder-field-container-wrap{height:23px;overflow:visible}.shelf-pane .querybuilder-shelf .querybuilder-field-container-wrap:before{content:"Drop Field Here";top:0;bottom:0;left:0;right:0;margin:0}.shelf-pane .querybuilder-shelf .querybuilder-field-container{top:0;bottom:0;left:0;right:0;padding:0}.shelf-pane .querybuilder-shelf .querybuilder-field.field-wrap{-webkit-box-flex:0;-webkit-flex:0 1 auto;-moz-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;margin-right:0}.shelf-pane .querybuilder-shelf .querybuilder-field.field-wrap .name-wrap{max-width:none}.shelf-pane label.tablebuilder-encoding-title{font-size:1rem;margin-bottom:10px}.tablebuilder-type-select{display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row;-ms-flex-flow:row;flex-flow:row}.tablebuilder-type-select .tablebuilder-type-choice{-webkit-box-flex:1;-webkit-flex:1 1 27px;-moz-flex:1 1 27px;-ms-flex:1 1 27px;flex:1 1 27px;position:relative;height:29px;line-height:29px;text-align:center;background-color:hsla(0,0%,88%,.5);border:1px solid transparent;top:-1px;margin-top:1px;cursor:pointer}.tablebuilder-type-select .tablebuilder-type-choice:not(:last-of-type){margin-right:1px}.tablebuilder-type-select .tablebuilder-type-choice.active,.tablebuilder-type-select .tablebuilder-type-choice:not(.active):focus,.tablebuilder-type-select .tablebuilder-type-choice:not(.active):hover{background-color:#fff;border:1px solid #dfdfdf;border-bottom:0;margin-top:0;top:0}.tablebuilder-type-select .tablebuilder-type-choice.active:after,.tablebuilder-type-select .tablebuilder-type-choice:not(.active):focus:after,.tablebuilder-type-select .tablebuilder-type-choice:not(.active):hover:after{content:" ";position:absolute;left:-1px;right:-1px;bottom:-2px;height:5px;background-color:#fff;border-left:1px solid #dfdfdf;border-right:1px solid #dfdfdf;z-index:1}.tablebuilder-type-select .tablebuilder-type-choice i.fa.fa-bar-chart.fa-flip-vertical-rotate-90{-webkit-transform:rotate(90deg) scale(-.8,1.2);-ms-transform:rotate(90deg) scale(-.8,1.2);transform:rotate(90deg) scale(-.8,1.2)}@-webkit-keyframes field-fade-in{0%{top:-20px}to{top:0}}@keyframes field-fade-in{0%{top:-20px}to{top:0}}.datasource-select{position:relative;border-bottom:1px solid #dfdfdf;cursor:pointer}.datasource-select .datasource-title{position:relative;padding:5px 5px 3px;padding-right:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.datasource-select .datasource-title i.fa{padding-right:5px;color:#649af3}.datasource-select .datasource-title i.fa.fa-caret-down,.datasource-select .datasource-title i.fa.fa-caret-up{position:absolute;top:8px;right:0;color:#bbb}.datasource-select .datasource-dropdown{position:absolute;top:100%;left:0;right:-1px;z-index:10;cursor:default;background-color:#fff;border-top:1px solid #dfdfdf;border-right:1px solid #dfdfdf;box-shadow:0 3px 5px #c3c3c3}.datasource-select .datasource-dropdown .datasource-list{max-height:310px;overflow:auto}.datasource-select .datasource-dropdown .datasource-add{position:relative;padding:5px;text-align:center;border-top:1px solid #dfdfdf;color:#649af3;cursor:pointer}.datasource-select .datasource-dropdown .datasource-add:focus,.datasource-select .datasource-dropdown .datasource-add:hover{background-color:#649af3;color:#fff}.datasource-select .datasource-dropdown .datasource-add i.fa.fa-plus{position:absolute;top:8px;left:30px}.datasource-select .datasource-dropdown .datasource-db-name,.datasource-select .datasource-dropdown .datasource-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.datasource-select .datasource-dropdown .datasource-db-name,.datasource-select .datasource-dropdown .datasource-db .datasource-db-tables,.datasource-select .datasource-dropdown .datasource-name{padding:5px}.datasource-select .datasource-dropdown .datasource-db-name i.fa,.datasource-select .datasource-dropdown .datasource-db .datasource-db-tables i.fa,.datasource-select .datasource-dropdown .datasource-name i.fa{padding-right:5px}.datasource-select .datasource-dropdown .datasource-name{cursor:pointer}.datasource-select .datasource-dropdown .datasource-name:focus,.datasource-select .datasource-dropdown .datasource-name:hover{background-color:#3875d7;color:#fff}.datasource-select .datasource-dropdown .datasource-db .datasource-db-tables{padding-left:15px}.datasource-table-container{-webkit-box-flex:1;-webkit-flex:1 0 auto;-moz-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto;position:relative}.datasource-table-fields{position:absolute;top:0;bottom:0;left:0;right:0;padding:5px 8px;overflow:auto}.datasource-table-fields .datasource-table-field.field-wrap{margin-bottom:5px;-webkit-animation:field-fade-in .3s ease;animation:field-fade-in .3s ease}.datasource-table-fields .datasource-table-field.field-wrap .icon-wrap{width:23px}.datasource-table-fields .datasource-table-field.field-wrap .name-wrap{-webkit-box-flex:1;-webkit-flex:1 1 auto;-moz-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}.datasource-table-fields .datasource-table-field.field-wrap span{padding:3px 0}.querybuilder{-webkit-box-flex:0;-webkit-flex:0 0 60px;-moz-flex:0 0 60px;-ms-flex:0 0 60px;flex:0 0 60px;-webkit-flex-flow:row;-ms-flex-flow:row;flex-flow:row;border:1px solid #dfdfdf;background-color:#fff;margin-bottom:10px}.querybuilder,.querybuilder .querybuilder-type-spec{display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex}.querybuilder .querybuilder-type-spec{-webkit-box-flex:1;-webkit-flex:1 1 auto;-moz-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;position:relative}.querybuilder .querybuilder-type-spec.row{-webkit-flex-flow:row;-ms-flex-flow:row;flex-flow:row}.querybuilder .querybuilder-type-spec.col,.querybuilder .querybuilder-type-spec.row .querybuilder-shelf{-webkit-flex-flow:column;-ms-flex-flow:column;flex-flow:column}.querybuilder .querybuilder-type-spec.row .querybuilder-shelf:not(:last-of-type){border-right:1px solid #dfdfdf}.querybuilder .querybuilder-type-spec.row .querybuilder-shelf label{display:block;padding:1px 3px 0}.querybuilder .querybuilder-type-spec.row.key .querybuilder-shelf:first-of-type{-webkit-box-flex:0;-webkit-flex:0 0 auto;-moz-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.querybuilder .querybuilder-type-spec.row.key .querybuilder-shelf label{width:150px}.querybuilder .querybuilder-type-spec.col .querybuilder-shelf{-webkit-flex-flow:row;-ms-flex-flow:row;flex-flow:row}.querybuilder .querybuilder-type-spec.col .querybuilder-shelf:not(:last-of-type){border-bottom:1px solid #dfdfdf}.querybuilder .querybuilder-type-spec.col .querybuilder-shelf label{padding:1px 3px 0;border-right:1px solid #dfdfdf;background-color:#efefef;display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-webkit-flex:0 0 80px;-moz-flex:0 0 80px;-ms-flex:0 0 80px;flex:0 0 80px;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}.querybuilder-field-settings{position:absolute;top:25px;left:88px;top:55px;background-color:#fff;border:1px solid #dfdfdf;border-radius:2px;border-top-left-radius:0;box-shadow:0 3px 5px #ccc;padding:5px;z-index:10;width:200px}.querybuilder-field-settings.querybuilder-property-settings{top:20px;left:0;right:0;width:auto;border-top-left-radius:2px}.querybuilder-field-settings .querybuilder-field-options>label{font-weight:600}.querybuilder-field-settings .querybuilder-field-options>label a{padding-left:8px;font-weight:400;cursor:pointer}.querybuilder-field-settings i.fa.fa-times.remove-link{position:absolute;right:5px;top:5px;z-index:1}.querybuilder-field-settings .querybuilder-field-remove{color:#f18794;border-top:1px solid #dfdfdf;margin:0 -5px -5px;padding:5px;cursor:pointer}.querybuilder-field-settings .querybuilder-field-remove:focus,.querybuilder-field-settings .querybuilder-field-remove:hover{background-color:#f18794;color:#fff}.querybuilder-field-settings .querybuilder-func .querybuilder-field-settings-option-value{width:50%}.querybuilder-field-settings .querybuilder-field-settings-options{display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-bottom:.5rem}.querybuilder-field-settings .querybuilder-field-settings-options .querybuilder-field-settings-option-value{-webkit-box-flex:1;-webkit-flex:1 0 auto;-moz-flex:1 0 auto;-ms-flex:1 0 auto;flex:1 0 auto}.querybuilder-property-settings .querybuilder-color-static span{padding-right:10px}.querybuilder-property-settings .querybuilder-color-settings,.querybuilder-property-settings .querybuilder-color-sub-settings{display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;-moz-justify-content:flex-start;justify-content:flex-start}.querybuilder-property-settings .querybuilder-color-settings input[type=checkbox],.querybuilder-property-settings .querybuilder-color-sub-settings input[type=checkbox]{margin-bottom:6px;margin-right:6px}.querybuilder-property-settings .querybuilder-color-sub-settings{padding-left:20px}.querybuilder-property-settings .querybuilder-color-sub-settings.querybuilder-color-sub-settings-input span{-webkit-box-flex:0;-webkit-flex:0 0 35px;-moz-flex:0 0 35px;-ms-flex:0 0 35px;flex:0 0 35px}.querybuilder-property-settings .querybuilder-color-settings label{-webkit-box-flex:1;-webkit-flex:1 0 60px;-moz-flex:1 0 60px;-ms-flex:1 0 60px;flex:1 0 60px}.querybuilder-property-settings .querybuilder-color-settings label div{margin:5px 0;height:24px}.querybuilder-property-settings .querybuilder-color-settings label div svg{width:40px;height:24px}.remove-link{color:#999}.remove-link:hover{color:#f18794;text-decoration:none}.graphic-container{background-color:#fff;border:1px solid #dfdfdf;border-radius:1px}.loading-overlay{position:absolute;top:0;bottom:0;left:0;right:0;z-index:2}.loading-overlay .loading-overlay-background{position:absolute;top:0;bottom:0;left:0;right:0;background-color:#fff;opacity:.5}.loading-overlay i.fa.fa-spinner.fa-pulse{position:absolute;font-size:4rem;top:30%;left:50%;margin-left:-2rem}.axis text{font-size:10px;fill:#666}.axis line,.axis path{fill:none;stroke:#dfdfdf;shape-rendering:crispEdges}.axis-label{position:absolute;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.axis-label.left{top:0;left:0;right:40px;padding:0 4px}.axis-label.bottom{bottom:10px;left:0;right:0;text-align:center}',""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t child into a function."))}function r(){!h&&p&&(h=!0,console.error("With React 0.13, you need to wrap child into a function. This restriction will be removed with React 0.14."))}function n(){g||(g=!0,console.error(" does not support changing `store` on the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/rackt/react-redux/releases/tag/v2.0.0 for the migration instructions."))}var s=e.Component,l=e.PropTypes,f=e.Children,d=c["default"](l),p=a(e),h=!1,g=!1;return function(e){function a(t,r){o(this,a),e.call(this,t,r),this.store=t.store}return i(a,e),a.prototype.getChildContext=function(){return{store:this.store}},u(a,null,[{key:"childContextTypes",value:{store:d.isRequired},enumerable:!0},{key:"propTypes",value:{store:d.isRequired,children:(p?l.func:l.element).isRequired},enumerable:!0}]),a.prototype.componentWillReceiveProps=function(e){var t=this.store,r=e.store;t!==r&&n()},a.prototype.render=function(){var e=this.props.children;return"function"==typeof e?(t(),e=e()):r(),f.only(e)},a}(s)}t.__esModule=!0;var u=function(){function e(e,t){for(var r=0;r1,S=k.length>1,R=y.pure,M=void 0===R?!0:R,A=T++;return function(r){var u=function(t){function n(e,r){i(this,n),t.call(this,e,r),this.version=A,this.store=e.store||r.store,w["default"](this.store,'Could not find "store" in either the context or '+('props of "'+this.constructor.displayName+'". ')+"Either wrap the root component in a , "+('or explicitly pass "store" as a prop to "'+this.constructor.displayName+'".')),this.stateProps=d(this.store,e),this.dispatchProps=p(this.store,e),this.state={props:this.computeNextState()}}return a(n,t),n.prototype.shouldComponentUpdate=function(e,t){return!M||!h["default"](this.state.props,t.props)},l(n,null,[{key:"displayName",value:"Connect("+s(r)+")",enumerable:!0},{key:"WrappedComponent",value:r,enumerable:!0},{key:"contextTypes",value:{store:o},enumerable:!0},{key:"propTypes",value:{store:o},enumerable:!0}]),n.prototype.computeNextState=function(){var e=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0];return g(this.stateProps,this.dispatchProps,e)},n.prototype.updateStateProps=function(){var e=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0],t=d(this.store,e);return h["default"](t,this.stateProps)?!1:(this.stateProps=t,!0)},n.prototype.updateDispatchProps=function(){var e=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0],t=p(this.store,e);return h["default"](t,this.dispatchProps)?!1:(this.dispatchProps=t,!0)},n.prototype.updateState=function(){var e=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0],t=this.computeNextState(e);h["default"](t,this.state.props)||this.setState({props:t})},n.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},n.prototype.trySubscribe=function(){b&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},n.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},n.prototype.componentDidMount=function(){this.trySubscribe()},n.prototype.componentWillReceiveProps=function(e){h["default"](e,this.props)||(E&&this.updateStateProps(e),S&&this.updateDispatchProps(e),this.updateState(e))},n.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},n.prototype.handleChange=function(){this.unsubscribe&&this.updateStateProps()&&this.updateState()},n.prototype.getWrappedInstance=function(){return this.refs.wrappedInstance},n.prototype.render=function(){return e.createElement(r,c({
-ref:"wrappedInstance"},this.state.props))},n}(t);return"production"!==n.env.NODE_ENV&&(u.prototype.componentWillUpdate=function(){this.version!==A&&(this.version=A,this.trySubscribe(),this.updateStateProps(),this.updateDispatchProps(),this.updateState())}),u}}}t.__esModule=!0;var l=function(){function e(e,t){for(var r=0;r1)for(var r=1;r0?"Unexpected "+(i.length>1?"keys":"key")+" "+('"'+i.join('", "')+'" found in '+o+". ")+"Expected to find one of the known reducer keys instead: "+('"'+n.join('", "')+'". Unexpected keys will be ignored.'):void 0}function s(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:l.ActionTypes.INIT});if("undefined"==typeof n)throw new Error('Reducer "'+t+'" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined.');var o="@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".");if("undefined"==typeof r(void 0,{type:o}))throw new Error('Reducer "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle "+l.ActionTypes.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined.")})}function u(e){var t,r=g["default"](e,function(e){return"function"==typeof e});try{s(r)}catch(o){t=o}var u=p["default"](r,function(){});return function(e,o){if(void 0===e&&(e=u),t)throw t;var s=!1,l=p["default"](r,function(t,r){var n=e[r],a=t(n,o);if("undefined"==typeof a){var u=i(r,o);throw new Error(u)}return s=s||a!==n,a});if("production"!==n.env.NODE_ENV){var c=a(e,l,o);c&&console.error(c)}return s?l:e}}t.__esModule=!0,t["default"]=u;var l=r(20),c=r(21),f=o(c),d=r(23),p=o(d),h=r(24),g=o(h);e.exports=t["default"]}).call(t,r(15))},function(e,t){"use strict";function r(e,t){return Object.keys(e).reduce(function(r,n){return r[n]=t(e[n],n),r},{})}t.__esModule=!0,t["default"]=r,e.exports=t["default"]},function(e,t){"use strict";function r(e,t){return Object.keys(e).reduce(function(r,n){return t(e[n])&&(r[n]=e[n]),r},{})}t.__esModule=!0,t["default"]=r,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return function(){return t(e.apply(void 0,arguments))}}function i(e,t){if("function"==typeof e)return o(e,t);if("object"!=typeof e||null===e||void 0===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');return s["default"](e,function(e){return o(e,t)})}t.__esModule=!0,t["default"]=i;var a=r(23),s=n(a);e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return function(e){return function(r,n){var o=e(r,n),a=o.dispatch,u=[],l={getState:o.getState,dispatch:function(e){return a(e)}};return u=t.map(function(e){return e(l)}),a=s["default"].apply(void 0,u)(o.dispatch),i({},o,{dispatch:a})}}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;tr;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}t.__esModule=!0,t["default"]=r,e.exports=t["default"]},function(e,t,r){(function(t){"use strict";var r=function(e,r,n,o,i,a,s,u){if("production"!==t.env.NODE_ENV&&void 0===r)throw new Error("invariant requires an error message argument");if(!e){var l;if(void 0===r)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,o,i,a,s,u],f=0;l=new Error("Invariant Violation: "+r.replace(/%s/g,function(){return c[f++]}))}throw l.framesToPop=1,l}};e.exports=r}).call(t,r(15))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){return{sourceIds:e.datasources.IDS,sources:e.datasources.BY_ID,tableId:e.datasources.selectedTable,queryspec:e.queryspec,visualspec:e.visualspec,result:e.result,chartspec:e.chartspec}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t-1&&e%1==0&&n>=e}var n=9007199254740991;e.exports=r},function(e,t,r){function n(e){for(var t=u(e),r=t.length,n=r&&e.length,l=!!n&&s(n)&&(i(e)||o(e)),f=-1,d=[];++f-1&&e%1==0&&t>e}var n=/^\d+$/,o=9007199254740991;e.exports=r},function(e,t,r){function n(e){if(null==e)return[];u(e)||(e=Object(e));var t=e.length;t=t&&s(t)&&(i(e)||o(e))&&t||0;for(var r=e.constructor,n=-1,l="function"==typeof r&&r.prototype===e,f=Array(t),d=t>0;++n2?r[a-2]:void 0,u=a>2?r[2]:void 0,l=a>1?r[a-1]:void 0;for("function"==typeof s?(s=o(s,l,5),a-=2):(s="function"==typeof l?l:void 0,a-=s?1:0),u&&i(r[0],r[1],u)&&(s=3>a?void 0:s,a=1);++n0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=u["default"](this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length},e.prototype.reset=function(){this.entered=[]},e}();t["default"]=l,e.exports=t["default"]},function(e,t,r){var n=r(63),o=r(65),i=r(57),a=i(function(e){return o(n(e,!1,!0))});e.exports=a},function(e,t,r){function n(e,t,r,l){l||(l=[]);for(var c=-1,f=e.length;++c=s,f=c?a():null,d=[];f?(n=i,l=!1):(c=!1,f=t?[]:d);e:for(;++r=s?a(t):null,d=t.length;f&&(l=i,c=!1,t=f);e:for(;++ua;a++)i.push(a);i.sort(function(e,r){return t[e]a;a++)c=t[a+1]-t[a],f=n[a+1]-n[a],u.push(c),s.push(f),l.push(f/c);for(var d=[l[0]],a=0;a=p*h)d.push(0);else{c=u[a];var g=u[a+1],m=c+g;d.push(3*m/((m+g)/p+(m+c)/h))}}d.push(l[l.length-1]);for(var y=[],v=[],b=void 0,a=0;a=s;){l=Math.floor(.5*(s+u));var c=t[l];if(e>c)s=l+1;else{if(!(c>e))return r[l];u=l-1}}a=Math.max(0,u);var f=e-t[a],d=f*f;return r[a]+n[a]*f+o[a]*d+i[a]*f*d},e}();t["default"]=n,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t,r){var n=t.reduce(function(t,r){return t||e.getData(r)},null);return null!=n?n:r}function s(e){var t=d[e],r=t.exposeProperty,n=t.matchesTypes,a=t.getData;return function(){function e(){o(this,e),this.item=Object.defineProperties({},i({},r,{get:function(){return console.warn("Browser doesn't allow reading \""+r+'" until the drop event.'),null},configurable:!0,enumerable:!0}))}return e.prototype.mutateItemByReadingDataTransfer=function(e){delete this.item[r],this.item[r]=a(e,n)},e.prototype.canDrag=function(){return!0},e.prototype.beginDrag=function(){return this.item},e.prototype.isDragging=function(e,t){return t===e.getSourceId()},e.prototype.endDrag=function(){},e}()}function u(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(d).filter(function(e){var r=d[e].matchesTypes;return r.some(function(e){return t.indexOf(e)>-1})})[0]||null}t.__esModule=!0;var l;t.createNativeDragSource=s,t.matchNativeItemType=u;var c=r(84),f=n(c),d=(l={},i(l,f.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),i(l,f.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return a(e,t,"").split("\n")}}),i(l,f.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return a(e,t,"")}}),l)},function(e,t){"use strict";t.__esModule=!0;var r="__NATIVE_FILE__";t.FILE=r;var n="__NATIVE_URL__";t.URL=n;var o="__NATIVE_TEXT__";t.TEXT=o},function(e,t){"use strict";function r(){return n||(n=new Image,n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),n}t.__esModule=!0,t["default"]=r;var n=void 0;e.exports=t["default"]},function(e,t,r){(function(e){"use strict";function n(e){return e&&e.__esModule?e["default"]:e}t.__esModule=!0;var o=r(87);t.DragDropContext=n(o);var i=r(110);t.DragLayer=n(i);var a=r(118);t.DragSource=n(a);var s=r(133);t.DropTarget=n(s),"production"!==e.env.NODE_ENV&&Object.defineProperty(t,"default",{get:function(){console.error("React DnD does not provide a default export. You are probably missing the curly braces in the import statement. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#react-dnd-does-not-provide-a-default-export")}})}).call(t,r(15))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){m["default"].apply(void 0,["DragDropContext","backend"].concat(u.call(arguments)));var t=void 0;t="object"==typeof e&&"function"==typeof e["default"]?e["default"]:e,h["default"]("function"==typeof t,"Expected the backend to be a function or an ES6 module exporting a default function. Read more: http://gaearon.github.io/react-dnd/docs-drag-drop-context.html");var r={dragDropManager:new d.DragDropManager(t)};return function(e){var t=e.displayName||e.name||"Component";return function(n){function a(){o(this,a),n.apply(this,arguments)}return i(a,n),a.prototype.getDecoratedComponentInstance=function(){return this.refs.child},a.prototype.getManager=function(){return r.dragDropManager},a.prototype.getChildContext=function(){return r},a.prototype.render=function(){return f["default"].createElement(e,s({},this.props,{ref:"child"}))},l(a,null,[{key:"DecoratedComponent",value:e,enumerable:!0},{key:"displayName",value:"DragDropContext("+t+")",enumerable:!0},{key:"childContextTypes",value:{dragDropManager:c.PropTypes.object.isRequired},enumerable:!0}]),a}(c.Component)}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t0;e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1)},e.prototype.getMonitor=function(){return this.monitor},e.prototype.getBackend=function(){return this.backend},e.prototype.getRegistry=function(){return this.registry},e.prototype.getActions=function(){function e(e){return function(){var n=e.apply(t,arguments);"undefined"!=typeof n&&r(n)}}var t=this,r=this.store.dispatch;return Object.keys(f).filter(function(e){return"function"==typeof f[e]}).reduce(function(t,r){return t[r]=e(f[r]),t},{})},e}());t["default"]=g,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=r(91),i=n(o),a=r(95),s=n(a),u=r(97),l=n(u),c=r(98),f=n(c);t["default"]=function(e,t){return void 0===e&&(e={}),{dirtyHandlerIds:f["default"](e.dirtyHandlerIds,t,e.dragOperation),dragOffset:i["default"](e.dragOffset,t),refCount:l["default"](e.refCount,t),dragOperation:s["default"](e.dragOperation,t)}},e.exports=t["default"]},function(e,t,r){"use strict";function n(e,t){return e===t?!0:e&&t&&e.x===t.x&&e.y===t.y}function o(e,t){switch(void 0===e&&(e=l),t.type){case u.BEGIN_DRAG:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case u.HOVER:return n(e.clientOffset,t.clientOffset)?e:s({},e,{clientOffset:t.clientOffset});case u.END_DRAG:case u.DROP:return l;default:return e}}function i(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return t&&r&&n?{x:t.x+n.x-r.x,y:t.y+n.y-r.y}:null}function a(e){var t=e.clientOffset,r=e.initialClientOffset;return t&&r?{x:t.x-r.x,y:t.y-r.y}:null}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t=0;l--)if(s.canDragSource(e[l])){c=e[l];break}if(null!==c){var f=null;i&&(d["default"]("function"==typeof a,"When clientOffset is provided, getSourceClientOffset must be a function."),f=a(c));var p=u.getSource(c),g=p.beginDrag(s,c);d["default"](m["default"](g),"Item must be an object."),u.pinSource(c);var v=u.getSourceType(c);return{type:y,itemType:v,item:g,sourceId:c,clientOffset:i,sourceClientOffset:f,isSourcePublic:n}}}function i(e){var t=this.getMonitor();if(t.isDragging())return{type:v}}function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=t.clientOffset,n=void 0===r?null:r;d["default"](h["default"](e),"Expected targetIds to be an array."),e=e.slice(0);var o=this.getMonitor(),i=this.getRegistry();d["default"](o.isDragging(),"Cannot call hover while not dragging."),d["default"](!o.didDrop(),"Cannot call hover after drop.");for(var a=o.getItemType(),s=0;s0}t.__esModule=!0,t["default"]=o,t.areDirty=i;var a=r(99),s=n(a),u=r(100),l=n(u),c=r(92),f=r(96),d=[],p=[]},function(e,t,r){function n(){for(var e=-1,t=arguments.length;++e=120?i(r&&f):null}var d=e[0],p=-1,h=d?d.length:0,g=s[0];e:for(;++p-1},e.prototype.getItemType=function(){return this.store.getState().dragOperation.itemType},e.prototype.getItem=function(){return this.store.getState().dragOperation.item},e.prototype.getSourceId=function(){return this.store.getState().dragOperation.sourceId},e.prototype.getTargetIds=function(){return this.store.getState().dragOperation.targetIds},e.prototype.getDropResult=function(){return this.store.getState().dragOperation.dropResult},e.prototype.didDrop=function(){return this.store.getState().dragOperation.didDrop},e.prototype.isSourcePublic=function(){return this.store.getState().dragOperation.isSourcePublic},e.prototype.getInitialClientOffset=function(){return this.store.getState().dragOffset.initialClientOffset},e.prototype.getInitialSourceClientOffset=function(){return this.store.getState().dragOffset.initialSourceClientOffset},e.prototype.getClientOffset=function(){return this.store.getState().dragOffset.clientOffset},e.prototype.getSourceClientOffset=function(){return p.getSourceClientOffset(this.store.getState().dragOffset)},e.prototype.getDifferenceFromInitialOffset=function(){return p.getDifferenceFromInitialOffset(this.store.getState().dragOffset)},e}();t["default"]=g,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return e&&e.constructor===Symbol?"symbol":typeof e}function a(e){d["default"]("function"==typeof e.canDrag,"Expected canDrag to be a function."),d["default"]("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),d["default"]("function"==typeof e.endDrag,"Expected endDrag to be a function.")}function s(e){d["default"]("function"==typeof e.canDrop,"Expected canDrop to be a function."),d["default"]("function"==typeof e.hover,"Expected hover to be a function."),d["default"]("function"==typeof e.drop,"Expected beginDrag to be a function.")}function u(e,t){return t&&h["default"](e)?void e.forEach(function(e){return u(e,!1)}):void d["default"]("string"==typeof e||"symbol"===("undefined"==typeof e?"undefined":i(e)),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}function l(e){var t=m["default"]().toString();switch(e){case v.SOURCE:return"S"+t;case v.TARGET:return"T"+t;default:d["default"](!1,"Unknown role: "+e)}}function c(e){switch(e[0]){case"S":return v.SOURCE;case"T":return v.TARGET;default:d["default"](!1,"Cannot parse handler ID: "+e)}}t.__esModule=!0;var f=r(94),d=n(f),p=r(48),h=n(p),g=r(103),m=n(g),y=r(96),v={SOURCE:"SOURCE",TARGET:"TARGET"},b=function(){function e(t){o(this,e),this.store=t,this.types={},this.handlers={},this.pinnedSourceId=null,this.pinnedSource=null}return e.prototype.addSource=function(e,t){u(e),a(t);var r=this.addHandler(v.SOURCE,e,t);return this.store.dispatch(y.addSource(r)),r},e.prototype.addTarget=function(e,t){u(e,!0),s(t);var r=this.addHandler(v.TARGET,e,t);return this.store.dispatch(y.addTarget(r)),r},e.prototype.addHandler=function(e,t,r){var n=l(e);return this.types[n]=t,this.handlers[n]=r,n},e.prototype.containsHandler=function(e){var t=this;return Object.keys(this.handlers).some(function(r){return t.handlers[r]===e})},e.prototype.getSource=function(e,t){d["default"](this.isSourceId(e),"Expected a valid source ID.");var r=t&&e===this.pinnedSourceId,n=r?this.pinnedSource:this.handlers[e];return n},e.prototype.getTarget=function(e){return d["default"](this.isTargetId(e),"Expected a valid target ID."),this.handlers[e]},e.prototype.getSourceType=function(e){return d["default"](this.isSourceId(e),"Expected a valid source ID."),this.types[e]},e.prototype.getTargetType=function(e){return d["default"](this.isTargetId(e),"Expected a valid target ID."),this.types[e]},e.prototype.isSourceId=function(e){var t=c(e);return t===v.SOURCE},e.prototype.isTargetId=function(e){var t=c(e);return t===v.TARGET},e.prototype.removeSource=function(e){d["default"](this.getSource(e),"Expected an existing source."),this.store.dispatch(y.removeSource(e)),delete this.handlers[e],delete this.types[e]},e.prototype.removeTarget=function(e){d["default"](this.getTarget(e),"Expected an existing target."),this.store.dispatch(y.removeTarget(e)),delete this.handlers[e],delete this.types[e]},e.prototype.pinSource=function(e){var t=this.getSource(e);d["default"](t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t},e.prototype.unpinSource=function(){d["default"](this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null},e}();t["default"]=b,e.exports=t["default"]},function(e,t){"use strict";function r(){return n++}t.__esModule=!0,t["default"]=r;var n=0;e.exports=t["default"]},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var n=function(){function e(){r(this,e)}return e.prototype.canDrag=function(){return!0},e.prototype.isDragging=function(e,t){return t===e.getSourceId()},e.prototype.endDrag=function(){},e}();t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var n=function(){function e(){r(this,e)}return e.prototype.canDrop=function(){return!0},e.prototype.hover=function(){},e.prototype.drop=function(){},e}();t["default"]=n,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return new u(e)}t.__esModule=!0,t["default"]=i;var a=r(107),s=n(a),u=function(){function e(t){o(this,e),this.actions=t.getActions()}return e.prototype.setup=function(){this.didCallSetup=!0},e.prototype.teardown=function(){this.didCallTeardown=!0},e.prototype.connectDragSource=function(){return s["default"]},e.prototype.connectDragPreview=function(){return s["default"]},e.prototype.connectDropTarget=function(){return s["default"]},e.prototype.simulateBeginDrag=function(e,t){this.actions.beginDrag(e,t)},e.prototype.simulatePublishDragSource=function(){this.actions.publishDragSource()},e.prototype.simulateHover=function(e,t){this.actions.hover(e,t)},e.prototype.simulateDrop=function(){this.actions.drop()},e.prototype.simulateEndDrag=function(){this.actions.endDrag()},e}();e.exports=t["default"]},function(e,t){function r(){}e.exports=r},function(e,t,r){(function(t){"use strict";var r=function(e,r,n,o,i,a,s,u){if("production"!==t.env.NODE_ENV&&void 0===r)throw new Error("invariant requires an error message argument");if(!e){var l;if(void 0===r)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,o,i,a,s,u],f=0;l=new Error("Invariant Violation: "+r.replace(/%s/g,function(){return c[f++]}))}throw l.framesToPop=1,l}};e.exports=r}).call(t,r(15))},function(e,t,r){(function(r){"use strict";function n(e,t){if("production"!==r.env.NODE_ENV){for(var n=arguments.length,o=Array(n>2?n-2:0),i=2;n>i;i++)o[i-2]=arguments[i];for(var a=0;an;n++)r[n]=arguments[n];o(this,e),Array.isArray(r[0])&&1===r.length&&(r=r[0]);for(var i=0;ir;r++)t[r]=this.disposables[r];this.isDisposed=!0,this.disposables=[],this.length=0;for(var r=0;e>r;r++)t[r].dispose()}},e}();t["default"]=s,e.exports=t["default"]},function(e,t,r){"use strict";var n=function(e){return e&&e.__esModule?e:{"default":e}},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};t.__esModule=!0;var i=r(121),a=n(i),s=function(){function e(){o(this,e),this.isDisposed=!1,this.current=null}return e.prototype.getDisposable=function(){return this.current},e.prototype.setDisposable=function(){var e=void 0===arguments[0]?null:arguments[0];if(null!=e&&!a["default"](e))throw new Error("Expected either an empty value or a valid disposable");var t=this.isDisposed,r=void 0;t||(r=this.current,this.current=e),r&&r.dispose(),t&&e&&e.dispose()},e.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=null,e&&e.dispose()}},e}();t["default"]=s,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=new s.CompositeDisposable,n={};return Object.keys(e).forEach(function(o){var i=a["default"](t,e[o]),s=i.disposable,u=i.ref;r.add(s),n[o]=function(){return u}}),{disposable:r,handlerConnector:n}}t.__esModule=!0,t["default"]=o;var i=r(126),a=n(i),s=r(120);e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return e===t?!0:null!==e&&null!==t&&s["default"](e,t)}function i(e,t){function r(){var s=arguments.length<=0||void 0===arguments[0]?null:arguments[0],u=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(f.isValidElement(s)){if("string"!=typeof s.type){var d=s.type.displayName||s.type.name||"the component";throw new Error("Only native element nodes can now be passed to "+t.name+"(). "+("You can either wrap "+d+" into a , or turn it into a ")+"drag source or a drop target itself.")}var p=s;return l["default"](p,function(e){return r(e,u)})}var h=s;if(h!==i||!o(a,u)){if(i=h,a=u,!h)return void n.setDisposable(null);var g=t(e,h,u);n.setDisposable(new c.Disposable(g))}}var n=new c.SerialDisposable,i=null,a=null;return{ref:r,disposable:n}}t.__esModule=!0,t["default"]=i;var a=r(111),s=n(a),u=r(127),l=n(u),c=r(120),f=r(5);e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=e.ref;return a["default"]("string"!=typeof r,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a
or . Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),s.cloneElement(e,{ref:function(e){t(e),r&&r(e)}})}t.__esModule=!0,t["default"]=o;var i=r(108),a=n(i),s=r(5);e.exports=t["default"]},function(e,t){"use strict";function r(e,t,r){function n(){o.removeSource(i)}var o=r.getRegistry(),i=o.addSource(e,t);return{handlerId:i,unregister:n}}t.__esModule=!0,t["default"]=r,e.exports=t["default"]},function(e,t,r){(function(n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){u["default"](f.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',f.join(", "),t),u["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])}),d.forEach(function(t){u["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])});var t=function(){function t(e){i(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrag=function(){return e.canDrag?e.canDrag(this.props,this.monitor):!0},t.prototype.isDragging=function(t,r){return e.isDragging?e.isDragging(this.props,this.monitor):r===t.getSourceId()},t.prototype.beginDrag=function(){var t=e.beginDrag(this.props,this.monitor,this.component);return"production"!==n.env.NODE_ENV&&u["default"](c["default"](t),"beginDrag() must return a plain object that represents the dragged item. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t),t},t.prototype.endDrag=function(){e.endDrag&&e.endDrag(this.props,this.monitor,this.component);
-},t}();return function(e){return new t(e)}}t.__esModule=!0,t["default"]=a;var s=r(108),u=o(s),l=r(113),c=o(l),f=["canDrag","beginDrag","canDrag","isDragging","endDrag"],d=["beginDrag"];e.exports=t["default"]}).call(t,r(15))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return new c(e)}t.__esModule=!0,t["default"]=i;var a=r(108),s=n(a),u=!1,l=!1,c=function(){function e(t){o(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.sourceId=e},e.prototype.canDrag=function(){s["default"](!u,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return u=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{u=!1}},e.prototype.isDragging=function(){s["default"](!l,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return l=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{l=!1}},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();e.exports=t["default"]},function(e,t){"use strict";function r(e){return{dragSource:function(){return e.connectDragSource.apply(e,arguments)},dragPreview:function(){return e.connectDragPreview.apply(e,arguments)}}}t.__esModule=!0,t["default"]=r,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return"string"==typeof e||"symbol"==typeof e||t&&a["default"](e)&&e.every(function(e){return o(e,!1)})}t.__esModule=!0,t["default"]=o;var i=r(48),a=n(i);e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){var n=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];f["default"].apply(void 0,["DropTarget","type, spec, collect[, options]"].concat(i.call(arguments)));var o=e;"function"!=typeof e&&(s["default"](D["default"](e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',e),o=function(){return e}),s["default"](l["default"](t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',t);var a=y["default"](t);return s["default"]("function"==typeof r,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',r),s["default"](l["default"](n),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',r),function(e){return p["default"]({connectBackend:function(e,t){return e.connectDropTarget(t)},containerDisplayName:"DropTarget",createHandler:a,registerHandler:g["default"],createMonitor:b["default"],createConnector:_["default"],DecoratedComponent:e,getType:o,collect:r,options:n})}}t.__esModule=!0;var i=Array.prototype.slice;t["default"]=o;var a=r(108),s=n(a),u=r(113),l=n(u),c=r(109),f=n(c),d=r(119),p=n(d),h=r(134),g=n(h),m=r(135),y=n(m),v=r(136),b=n(v),w=r(137),_=n(w),x=r(132),D=n(x);e.exports=t["default"]},function(e,t){"use strict";function r(e,t,r){function n(){o.removeTarget(i)}var o=r.getRegistry(),i=o.addTarget(e,t);return{handlerId:i,unregister:n}}t.__esModule=!0,t["default"]=r,e.exports=t["default"]},function(e,t,r){(function(n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){Object.keys(e).forEach(function(t){u["default"](f.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',f.join(", "),t),u["default"]("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t,t,e[t])});var t=function(){function t(e){i(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveMonitor=function(e){this.monitor=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrop=function(){return e.canDrop?e.canDrop(this.props,this.monitor):!0},t.prototype.hover=function(){e.hover&&e.hover(this.props,this.monitor,this.component)},t.prototype.drop=function(){if(e.drop){var t=e.drop(this.props,this.monitor,this.component);return"production"!==n.env.NODE_ENV&&u["default"]("undefined"==typeof t||c["default"](t),"drop() must either return undefined, or an object that represents the drop result. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t),t}},t}();return function(e){return new t(e)}}t.__esModule=!0,t["default"]=a;var s=r(108),u=o(s),l=r(113),c=o(l),f=["canDrop","hover","drop"];e.exports=t["default"]}).call(t,r(15))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return new l(e)}t.__esModule=!0,t["default"]=i;var a=r(108),s=n(a),u=!1,l=function(){function e(t){o(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.targetId=e},e.prototype.canDrop=function(){s["default"](!u,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drop-target-monitor.html");try{return u=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{u=!1}},e.prototype.isOver=function(e){return this.internalMonitor.isOverTarget(this.targetId,e)},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();e.exports=t["default"]},function(e,t){"use strict";function r(e){return{dropTarget:function(){return e.connectDropTarget.apply(e,arguments)}}}t.__esModule=!0,t["default"]=r,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){return null==t?null:e[t.id]||e[t.datasource_id]}function a(e,t){var r=i(e,t);return null==r?null:null!=r.tables?g["default"].find(r.tables,function(e){return e.name===t.name}):r}function s(e,t,r){if(null==r)return null;var n=a(e,t);return null==n?null:n.schema[r]}function u(e){return{type:T,tableId:e}}function l(e){return{type:x,tableId:e}}function c(e,t){return{type:D,tableId:e,data:t}}function f(e){return function(t,r){var n=a(r().datasources.BY_ID,e);return t(l(e)),(0,b["default"])(n.url).then(function(e){switch(n.settings.format){case"csv":return e.text();default:return e.json()}}).then(function(r){r=_["default"].read(r,{type:n.settings.format,parse:"auto"}),t(c(e,r))})}}function d(e){return function(t,r){var n=a(r().datasources.BY_ID,e);return null==n.url||n.isLoading||null!=n.schema?void 0:t(f(e))}}function p(e,t){void 0===e&&(e=O);var r=void 0,n=void 0;switch(t.type){case x:return r=a(e.BY_ID,t.tableId),(0,y["default"])({BY_ID:o({},r.id,{isLoading:!0})},e);case D:return r=a(e.BY_ID,t.tableId),n=(0,g["default"])(t.data.__types__).map(function(e,t){return{name:t,type:e}}).each(function(e,t){return e.__id__=t}).value(),(0,y["default"])({BY_ID:o({},r.id,{isLoading:!1,data:function(){return t.data},schema:function(){return n}})},e);case T:return(0,y["default"])({selectedTable:function(){return t.tableId}},e);default:return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getDatasource=i,t.getTable=a,t.getField=s,t.selectTable=u,t.requestTableData=l,t.receiveTableData=c,t.connectTable=f,t.connectTableIfNecessary=d,t["default"]=p;var h=r(9),g=n(h),m=r(139),y=n(m),v=r(195),b=n(v),w=r(8),_=n(w),x="explorer/datasources/REQUEST_TABLE_DATA";t.REQUEST_TABLE_DATA=x;var D="explorer/datasources/RECEIVE_TABLE_DATA";t.RECEIVE_TABLE_DATA=D;var T="explorer/datasources/SELECT_TABLE";t.SELECT_TABLE=T;var O={IDS:[],BY_ID:{}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=r(140),i=n(o),a=r(141),s=n(a),u=r(142),l=n(u),c=r(173),f=n(c),d=r(174),p=n(d),h=r(179),g=n(h),m=r(188),y=n(m),v=r(192),b=n(v),w=r(175),_=n(w),x=r(193),D=n(x),T=r(194),O=n(T),k=r(172),C=_["default"];C._=k._,C.constant=i["default"],C["if"]=f["default"],C.ifElse=p["default"],C.is=l["default"],C.freeze=s["default"],C.map=g["default"],C.omit=y["default"],C.reject=b["default"],C.update=_["default"],C.updateIn=D["default"],C.withDefault=O["default"],t["default"]=C,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=a["default"](e);return function(){return t}}t.__esModule=!0;var i=r(141),a=n(i);t["default"]=o,e.exports=t["default"]},function(e,t,r){(function(r){"use strict";function n(e){return null===e?!1:Array.isArray(e)||"object"==typeof e}function o(e){return n(e)&&!Object.isFrozen(e)}function i(e){return Object.freeze(e),Object.keys(e).forEach(function(t){var r=e[t];o(r)&&i(r)}),e}function a(e){return"production"===r.env.NODE_ENV?e:(o(e)&&i(e),e)}t.__esModule=!0,t["default"]=a,e.exports=t["default"]}).call(t,r(15))},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){for(var n=a["default"](e),o=r,i=void 0,s=n,u=Array.isArray(s),l=0,s=u?s:s[Symbol.iterator]();;){if(u){if(l>=s.length)break;i=s[l++]}else{if(l=s.next(),l.done)break;i=l.value}if("undefined"==typeof o)return!1;o=o[i]}return"function"==typeof t?t(o):t===o}t.__esModule=!0;var i=r(143),a=n(i),s=r(172),u=n(s);t["default"]=u["default"](o),e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Array.isArray(e)?e:a["default"](e.split("."),function(e){return!e})}t.__esModule=!0,t["default"]=o;var i=r(144),a=n(i);e.exports=t["default"]},function(e,t,r){function n(e,t,r){var n=s(e)?o:a;return t=i(t,r,3),n(e,function(e,r,n){return!t(e,r,n)})}var o=r(145),i=r(146),a=r(168),s=r(48);e.exports=n},function(e,t){function r(e,t){for(var r=-1,n=e.length,o=-1,i=[];++r
l))return!1;for(;++un;)e=e[t[n++]];return n&&n==i?e:void 0}}var o=r(117);e.exports=n},function(e,t){function r(e,t,r){var n=-1,o=e.length;t=null==t?0:+t||0,0>t&&(t=-t>o?0:o+t),r=void 0===r||r>o?o:+r||0,0>r&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++nt&&(r=t);e[r-1]===u;)r--;return r}function n(e){return function t(n){for(var o=arguments.length,i=Array(o>1?o-1:0),a=1;o>a;a++)i[a-1]=arguments[a];var s=i[0],u=i[1],l=r(arguments);return l>=1?e(n,s,u):t}}function o(e){return function t(o,i){for(var a=arguments.length,s=Array(a>2?a-2:0),l=2;a>l;l++)s[l-2]=arguments[l];var c=s[0],f=s[1],d=r(arguments,2);if(i===u||c===u||f===u)throw new Error("Can only use placeholder on first argument of this function.");return d>=2?o===u?n(function(t,r,n){return e(t,i,r,n)}):e(o,i,c,f):1===d?n(function(t,r,n){return e(o,t,r,n)}):t}}function i(e){return function t(i,a,s){for(var l=arguments.length,c=Array(l>3?l-3:0),f=3;l>f;f++)c[f-3]=arguments[f];var d=c[0],p=c[1],h=r(arguments,3);if(s===u||d===u||p===u)throw new Error("Can only use placeholder on first or second argument of this function.");return h>=3?i===u?a===u?o(function(t,r,n,o){return e(t,r,s,n,o)}):n(function(t,r,n){return e(t,a,s,r,n)}):a===u?n(function(t,r,n){return e(i,t,s,r,n)}):e(i,a,s,d,p):2===h?i===u?o(function(t,r,n,o){return e(t,a,r,n,o)}):n(function(t,r,n){return e(i,a,t,r,n)}):1===h?o(function(t,r,n,o){return e(i,t,r,n,o)}):t}}function a(e){return function t(a,s,l,c){for(var f=arguments.length,d=Array(f>4?f-4:0),p=4;f>p;p++)d[p-4]=arguments[p];var h=d[0],g=d[1],m=r(arguments,4);if(c===u||h===u||g===u)throw new Error("Can only use placeholder on first, second or third argument of this function.");return m>=4?a===u?s===u?l===u?i(function(t,r,n,o,i){return e(t,r,n,c,o,i)}):o(function(t,r,n,o){return e(t,r,l,c,n,o)}):l===u?o(function(t,r,n,o){return e(t,s,r,c,n,o)}):n(function(t,r,n){return e(t,s,l,c,r,n)}):s===u?l===u?o(function(t,r,n,o){return e(a,t,r,c,n,o)}):n(function(t,r,n){return e(a,t,l,c,r,n)}):l===u?n(function(t,r,n){return e(a,s,t,c,r,n)}):e(a,s,l,c,h,g):3===m?a===u?s===u?i(function(t,r,n,o,i){return e(t,r,l,n,o,i)}):o(function(t,r,n,o){return e(t,s,l,r,n,o)}):s===u?o(function(t,r,n,o){return e(a,t,l,r,n,o)}):n(function(t,r,n){return e(a,s,l,t,r,n)}):2===m?a===u?i(function(t,r,n,o,i){return e(t,s,r,n,o,i)}):o(function(t,r,n,o){return e(a,s,t,r,n,o)}):1===m?i(function(t,r,n,o,i){return e(a,t,r,n,o,i)}):t}}function s(e){var t=arguments.length<=1||void 0===arguments[1]?e.length:arguments[1];return function(){return[e,n,o,i,a][t](e)}()}t.__esModule=!0,t.curry1=n,t.curry2=o,t.curry3=i,t.curry4=a,t["default"]=s;var u="@@updeep/placeholder";t._=u},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=r(174),i=n(o),a=r(172),s=n(a);t["default"]=s["default"](function(e,t,r){return i["default"](e,t,function(e){return e},r)}),e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r,n){var o="function"==typeof e?e(n):e,i=o?t:r;return a["default"](i,n)}t.__esModule=!0;var i=r(175),a=n(i),s=r(176),u=n(s);t["default"]=u["default"](o),e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return Object.keys(e).reduce(function(r,n){return t(r,e[n],n)},r)}function i(e,t){return o(e,function(e,r,n){var o=r;return Array.isArray(r)||null===r||"object"!=typeof r?"function"==typeof r&&(o=r(t[n])):o=s(r,t[n]),t[n]!==o&&(e[n]=o),e},{})}function a(e,t){var r=[].concat(t);return Object.keys(e).forEach(function(t){r[t]=e[t]}),r}function s(e,t){if("function"==typeof e){for(var r=arguments.length,n=Array(r>2?r-2:0),o=2;r>o;o++)n[o-2]=arguments[o];return e.apply(void 0,[t].concat(n))}if(!m["default"](e))return e;var s=h["default"](t,e),l=i(e,s);return d["default"](l)?s:Array.isArray(s)?a(l,s):u({},s,l)}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t=t.length)break;i=t[n++]}else{if(n=t.next(),n.done)break;i=n.value}var a=i;if(!o(a))return!1}return!0}function a(e){return!l["default"](e)&&i(e)?[]:{}}function s(e,t){return"undefined"==typeof e||null===e?a(t):e}t.__esModule=!0;var u=r(177),l=n(u);t["default"]=s,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=!0;return f["default"](t,function(t,n){return t!==e[n]?(r=!1,!1):void 0}),r}function i(e,t){var r="function"==typeof e?e:s["default"](e),n=Array.isArray(t)?p["default"]:g["default"],i=n(t,r),a=o(t,i);return a?t:i}t.__esModule=!0;var a=r(175),s=n(a),u=r(176),l=n(u),c=r(180),f=n(c),d=r(183),p=n(d),h=r(186),g=n(h);t["default"]=l["default"](i),e.exports=t["default"]},function(e,t,r){var n=r(181),o=r(169),i=r(182),a=i(n,o);e.exports=a},function(e,t){function r(e,t){for(var r=-1,n=e.length;++r-1?t:e}function l(e,t){if(t=t||{},this.url=e,this.credentials=t.credentials||"omit",this.headers=new r(t.headers),this.method=u(t.method||"GET"),this.mode=t.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&t.body)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(t.body)}function c(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function f(e){var t=new r,n=e.getAllResponseHeaders().trim().split("\n");return n.forEach(function(e){var r=e.trim().split(":"),n=r.shift().trim(),o=r.join(":").trim();t.append(n,o)}),t}function d(e,t){t||(t={}),this._initBody(e),this.type="default",this.url=null,this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof r?t.headers:new r(t.headers),this.url=t.url||""}if(!self.fetch){r.prototype.append=function(r,n){r=e(r),n=t(n);var o=this.map[r];o||(o=[],this.map[r]=o),o.push(n)},r.prototype["delete"]=function(t){delete this.map[e(t)]},r.prototype.get=function(t){var r=this.map[e(t)];return r?r[0]:null},r.prototype.getAll=function(t){return this.map[e(t)]||[]},r.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},r.prototype.set=function(r,n){this.map[e(r)]=[t(n)]},r.prototype.forEach=function(e){var t=this;Object.getOwnPropertyNames(this.map).forEach(function(r){e(r,t.map[r])})};var p={blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self},h=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];s.call(l.prototype),s.call(d.prototype),self.Headers=r,self.Request=l,self.Response=d,self.fetch=function(e,t){var r;return r=l.prototype.isPrototypeOf(e)&&!t?e:new l(e,t),new Promise(function(e,t){function n(){return"responseURL"in o?o.responseURL:/^X-Request-URL:/m.test(o.getAllResponseHeaders())?o.getResponseHeader("X-Request-URL"):void 0}var o=new XMLHttpRequest;o.onload=function(){var r=1223===o.status?204:o.status;if(100>r||r>599)return void t(new TypeError("Network request failed"));var i={status:r,statusText:o.statusText,headers:f(o),url:n()},a="response"in o?o.response:o.responseText;e(new d(a,i))},o.onerror=function(){t(new TypeError("Network request failed"))},o.open(r.method,r.url,!0),"include"===r.credentials&&(o.withCredentials=!0),"responseType"in o&&p.blob&&(o.responseType="blob"),r.headers.forEach(function(e,t){t.forEach(function(t){o.setRequestHeader(e,t)})}),o.send("undefined"==typeof r._bodyInit?null:r._bodyInit)})},self.fetch.polyfill=!0}}()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t=o.length?g["default"].last(o).left+g["default"].last(o).width+6:o[s].left)-n.left;return u}function u(e,t){var r=a(e),n=r.shelfBounds,o=r.fieldBounds,i=t.x-n.left,s=(0,g["default"])(o).map(function(e){return e.left-n.left}).sortedIndex(i);return s}function l(e,t){return{connectDropTarget:e.dropTarget(),isOver:t.isOver({shallow:!0}),canDrop:t.canDrop(),dropOffset:t.getSourceClientOffset()}}function c(e,t){return{connectDragSource:e.dragSource(),connectDragPreview:e.dragPreview(),isDragging:t.isDragging()}}Object.defineProperty(t,"__esModule",{value:!0});var f=function(){function e(e,t){for(var r=0;r=0)o="clock-o";else{if(!(["string","text"].indexOf(r)>=0))return["integer","number"].indexOf(r)>=0?m({},"#"):m({},r);o="font"}return g({className:(0,f["default"])("fa","fa-"+o)})}}]),t}(l["default"].Component);t.FieldIcon=y},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t=0?c["default"].createElement(D,a({},s,{typeOptions:["time","number","text"]})):["string","text"].indexOf(i)>=0?c["default"].createElement(D,a({},s,{typeOptions:["text","number"]})):["integer","number"].indexOf(i)>=0?c["default"].createElement(D,a({},s,{typeOptions:["number","text"]})):m({className:"querybuilder-field-options"},v({},"No Settings"))}}]),t}(c["default"].Component),O=function(e){function t(){o(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),s(t,[{key:"render",value:function(){var e=this,t=this.props,r=t.isOpen,n=t.shelf,o=t.field,i=t.position,a=t.top,s=t.left,u=t.removeField,l=t.updateFieldTypecast,f=t.updateFieldFunction;if(!r)return null;var d=this.props.getField(o.tableId,o.fieldId);return m({className:"querybuilder-field-settings",style:{top:a,left:s}},y({className:"fa fa-times remove-link",onClick:this.props.close}),c["default"].createElement(T,{position:i,field:o,fieldSettings:d,updateFieldFunction:p["default"].curry(f,3)(n,i),updateFieldTypecast:p["default"].curry(l,3)(n,i)}),m({className:"querybuilder-field-remove",onClick:function(){e.props.close(),u(n,i)}},"Remove"))}}]),t}(c["default"].Component);t.FieldOptionsDropdown=O},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t0&&this.props.isOver&&this.props.dropOffset}},{key:"render",value:function(){var e=this.props,t=e.shelf,r=e.fields,n=e.getField,o=e.removeField,i=e.dropdownProps,s=this.props,u=s.isOver,l=s.canDrop,c=s.connectDropTarget,f=this.hasDropMarker(),p=f?O({ref:"dropMarker",className:"field-position-marker"}):null,g=r.map(function(e,r){var s="aggregate"==e.type?e:n(e.tableId,e.fieldId);return h["default"].createElement(x.ShelfField,a({ref:"field:"+r,key:r+":"+("aggregate"==e.type?e.id:e.fieldId),shelf:t,field:e,position:r},s,{remove:function(){return o(t,r)}},i))});return c(O({className:(0,d["default"])("querybuilder-field-container-wrap",{"field-drop-target":l,"field-drop-over":u,"field-contained":!b["default"].isEmpty(r),"field-empty":b["default"].isEmpty(r),"field-drop-marker":f}),onScroll:i.closeDropdown},O({className:"querybuilder-field-container"},p,g)))}}]),t}(h["default"].Component);S=(0,y.DropTarget)(["TableField","ShelfField"],x.FieldDropHandler,x.fieldDropCollector)(S);var R={color:"color",opacity:"color",shape:"symbol",size:"size"},M=function(e){function t(){o(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),s(t,[{key:"_d3Remove",value:function(){c["default"].select(this.refs.d3LegendContainer).selectAll("*").remove()}},{key:"_d3Render",value:function(){this._d3Remove();var e=this.props,t=e.fields,r=e.legend,n=e.shelf;if(!b["default"].isEmpty(t)){var o=r[(0,D.getAccessorName)(t[0])];if(null!=o){var i=o.type,a=o.domain,s=o.range,u=c["default"].scale[i]().domain(a).range(s);switch(n){case"shape":u.range(b["default"].map(u.range(),function(e){return c["default"].svg.symbol().type(e)()}));break;case"size":u.range(b["default"].map(u.range(),function(e){return Math.sqrt(e/Math.PI)}));break;case"opacity":u.range(b["default"].map(s,function(e){return c["default"].rgb(255*(1-e),255*(1-e),255*(1-e))}))}var l=c["default"].legend[R[n]]().scale(u);switch(n){case"size":l.shape("circle").shapePadding(5)}switch(i){case"linear":case"log":case"pow":case"sqrt":var f=u.ticks(5);"linear"==i&&(0,D.isAggregateType)(t[0])&&(f=b["default"].unique(b["default"].sortBy(f.concat([0])))),"log"==i&&(f=b["default"].at(f,b["default"].range(0,f.length,Math.floor(f.length/5)))),l.cells(f).labelFormat(c["default"].format(",f"));break;case"quantile":l.cells(u.quantiles()).labelFormat(c["default"].format(",f"))}var d=c["default"].select(this.refs.d3LegendContainer),p=(E(this),d.append("g").attr("transform",b["default"].contains(["shape","size"],n)?"translate(15, 5)":null).call(l)),h=p[0][0].getBoundingClientRect();d.attr("width",h.width+5).attr("height",h.height+5)}}}},{key:"componentDidMount",value:function(){this._d3Render()}},{key:"componentDidUpdate",value:function(){this._d3Render()}},{key:"componentWillUnmount",value:function(){this._d3Remove()}},{key:"render",value:function(){return b["default"].isEmpty(this.props.fields)?null:O({className:"querybuilder-shelf-legend"},C({ref:"d3LegendContainer"}))}}]),t}(h["default"].Component),A=function(e){function t(){o(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return i(t,e),s(t,[{key:"render",value:function(){var e=this,t=this.props,r=t.name,n=t.shelf,o=t.fields,i=t.legend,s=t.getField,u=t.removeField,l=t.clearFields,c=t.insertFieldAtPosition,f=t.moveFieldTo,d=t.replaceFieldOnShelf,p=t.moveAndReplaceField,g=t.dropdownProps,m=t.vizActionCreators,y={shelf:n,fields:o,getField:s,removeField:u,clearFields:l,insertFieldAtPosition:c,moveFieldTo:f,replaceFieldOnShelf:d,moveAndReplaceField:p,dropdownProps:g},v=a({property:n,fields:o,getField:s,settings:this.props.properties,isOpen:this.props.isDropdownOpen&&!g.isDropdownOpen,close:this.props.closeDropdown},m),_=b["default"].contains(["row","col"],this.props.shelf),x=b["default"].contains(["color","background"],this.props.shelf),D=_?k({className:"fa fa-times remove-link",onClick:function(){g.closeDropdown(),l(n)}}):x?k({className:"fa fa-caret-down"}):null;return O({className:"querybuilder-shelf"},h["default"].createElement("label",{onClick:x?function(){g.isDropdownOpen?e.props.openDropdown():e.props.toggleDropdown(),g.closeDropdown()}:null,style:{cursor:x?"pointer":null}},r,D),h["default"].createElement(w.VisualPropertiesDropdown,v),h["default"].createElement(S,y),!_&&i?h["default"].createElement(M,{shelf:n,legend:i,fields:b["default"].map(o,function(e){return b["default"].extend({},e,s(e.tableId,e.fieldId))})}):null)}}]),t}(h["default"].Component);t.Shelf=A=(0,_.createDropdownComponent)(A),t.Shelf=A},function(e,t,r){var n=r(7);n.legend={color:r(209),size:r(211),symbol:r(212)},e.exports=n},function(e,t,r){var n=r(210);e.exports=function(){function e(e){var b=n.d3_calcType(r,y,l,c,d,g),w=e.selectAll(".cell").data(b.data),_=w.enter().append("g",".cell").attr("class","cell").style("opacity",1e-6);shapeEnter=_.append(o).attr("class","swatch"),shapes=w.select("g.cell "+o),n.d3_addEvents(_,v),w.exit().transition().style("opacity",0).remove(),n.d3_drawShapes(o,shapes,a,i,s,t),n.d3_addText(e,_,b.labels);var x=w.select("text"),D=shapes[0].map(function(e){return e.getBBox()});f?shapes.attr("class",function(e){return"swatch "+b.feature(e)}):"line"==o?shapes.style("stroke",b.feature):shapes.style("fill",b.feature);var T,O,k="start"==h?0:"middle"==h?.5:1;"vertical"===m?(T=function(e,t){return"translate(0, "+t*(D[t].height+u)+")"},O=function(e,t){return"translate("+(D[t].width+D[t].x+p)+","+(D[t].y+D[t].height/2+5)+")"}):"horizontal"===m&&(T=function(e,t){return"translate("+t*(D[t].width+u)+",0)"},O=function(e,t){return"translate("+(D[t].width*k+D[t].x)+","+(D[t].height+D[t].y+p+8)+")"}),n.d3_placement(m,w,T,x,O,h),w.transition().style("opacity",1)}var t,r=d3.scale.linear(),o="rect",i=15,a=15,s=10,u=2,l=[5],c=[],f=!1,d=d3.format(".01f"),p=10,h="middle",g="to",m="vertical",y=!1,v=d3.dispatch("cellover","cellout","cellclick");return e.scale=function(t){return arguments.length?(r=t,e):e},e.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(l=t),e):e},e.shape=function(r,n){return arguments.length?(("rect"==r||"circle"==r||"line"==r||"path"==r&&"string"==typeof n)&&(o=r,t=n),e):e},e.shapeWidth=function(t){return arguments.length?(i=+t,e):e},e.shapeHeight=function(t){return arguments.length?(a=+t,e):e},e.shapeRadius=function(t){return arguments.length?(s=+t,e):e},e.shapePadding=function(t){return arguments.length?(u=+t,e):e},e.labels=function(t){return arguments.length?(c=t,e):e},e.labelAlign=function(t){return arguments.length?(("start"==t||"end"==t||"middle"==t)&&(h=t),e):e},e.labelFormat=function(t){return arguments.length?(d=t,e):e},e.labelOffset=function(t){return arguments.length?(p=+t,e):e},e.labelDelimiter=function(t){return arguments.length?(g=t,e):e},e.useClass=function(t){return arguments.length?((t===!0||t===!1)&&(f=t),e):e},e.orient=function(t){return arguments.length?(t=t.toLowerCase(),("horizontal"==t||"vertical"==t)&&(m=t),e):e},e.ascending=function(t){return arguments.length?(y=!!t,e):e},d3.rebind(e,v,"on"),e}},function(e,t){e.exports={d3_identity:function(e){return e},d3_mergeLabels:function(e,t){if(0===t.length)return e;e=e?e:[];for(var r=t.length;r1)n=t;else for(var o=e.domain(),i=(o[o.length-1]-o[0])/(t-1),a=0;t>a;a++)n.push(o[0]+a*i);var s=n.map(r);return{data:n,labels:s,feature:function(t){return e(t)}}},d3_quantLegend:function(e,t,r){var n=e.range().map(function(n){var o=e.invertExtent(n);t(o[0]),t(o[1]);return t(o[0])+" "+r+" "+t(o[1])});return{data:e.range(),labels:n,feature:this.d3_identity}},d3_ordinalLegend:function(e){return{data:e.domain(),labels:e.domain(),feature:function(t){return e(t)}}},d3_drawShapes:function(e,t,r,n,o,i){"rect"===e?t.attr("height",r).attr("width",n):"circle"===e?t.attr("r",o):"line"===e?t.attr("x1",0).attr("x2",n).attr("y1",0).attr("y2",0):"path"===e&&t.attr("d",i)},d3_addText:function(e,t,r){t.append("text").attr("class","label"),e.selectAll("g.cell text").data(r).text(this.d3_identity)},d3_calcType:function(e,t,r,n,o,i){var a=e.ticks?this.d3_linearLegend(e,r,o):e.invertExtent?this.d3_quantLegend(e,o,i):this.d3_ordinalLegend(e);return a.labels=this.d3_mergeLabels(a.labels,n),t&&(a.labels=this.d3_reverse(a.labels),a.data=this.d3_reverse(a.data)),a},d3_reverse:function(e){for(var t=[],r=0,n=e.length;n>r;r++)t[r]=e[n-r-1];return t},d3_placement:function(e,t,r,n,o,i){t.attr("transform",r),n.attr("transform",o),"horizontal"===e&&n.style("text-anchor",i)},d3_addEvents:function(e,t){var r=this;e.on("mouseover.legend",function(e){r.d3_cellOver(t,e,this)}).on("mouseout.legend",function(e){r.d3_cellOut(t,e,this)}).on("click.legend",function(e){r.d3_cellClick(t,e,this)})},d3_cellOver:function(e,t,r){e.cellover.call(r,t)},d3_cellOut:function(e,t,r){e.cellout.call(r,t)},d3_cellClick:function(e,t,r){e.cellclick.call(r,t)}}},function(e,t,r){var n=r(210);e.exports=function(){function e(e){var m=n.d3_calcType(r,h,s,u,l,d),y=e.selectAll(".cell").data(m.data),v=y.enter().append("g",".cell").attr("class","cell").style("opacity",1e-6);shapeEnter=v.append(o).attr("class","swatch"),shapes=y.select("g.cell "+o),n.d3_addEvents(v,g),y.exit().transition().style("opacity",0).remove(),"line"===o?(n.d3_drawShapes(o,shapes,0,i),shapes.attr("stroke-width",m.feature)):n.d3_drawShapes(o,shapes,m.feature,m.feature,m.feature,t),n.d3_addText(e,v,m.labels);var b,w,_=y.select("text"),x=shapes[0].map(function(e,t){var n=e.getBBox(),i=r(m.data[t]);return"line"===o&&"horizontal"===p?n.height=n.height+i:"line"===o&&"vertical"===p&&(n.width=n.width),n}),D=d3.max(x,function(e){return e.height+e.y}),T=d3.max(x,function(e){return e.width+e.x}),O="start"==f?0:"middle"==f?.5:1;"vertical"===p?(b=function(e,t){var r=d3.sum(x.slice(0,t+1),function(e){return e.height});return"translate(0, "+(r+t*a)+")"},w=function(e,t){return"translate("+(T+c)+","+(x[t].y+x[t].height/2+5)+")"}):"horizontal"===p&&(b=function(e,t){var r=d3.sum(x.slice(0,t+1),function(e){return e.width});return"translate("+(r+t*a)+",0)"},w=function(e,t){return"translate("+(x[t].width*O+x[t].x)+","+(D+c)+")"}),n.d3_placement(p,y,b,_,w,f),y.transition().style("opacity",1)}var t,r=d3.scale.linear(),o="rect",i=15,a=2,s=[5],u=[],l=d3.format(".01f"),c=10,f="middle",d="to",p="vertical",h=!1,g=d3.dispatch("cellover","cellout","cellclick");return e.scale=function(t){return arguments.length?(r=t,e):e},e.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(s=t),e):e},e.shape=function(r,n){return arguments.length?(("rect"==r||"circle"==r||"line"==r)&&(o=r,t=n),e):e},e.shapeWidth=function(t){return arguments.length?(i=+t,e):e},e.shapePadding=function(t){return arguments.length?(a=+t,e):e},e.labels=function(t){return arguments.length?(u=t,e):e},e.labelAlign=function(t){return arguments.length?(("start"==t||"end"==t||"middle"==t)&&(f=t),e):e},e.labelFormat=function(t){return arguments.length?(l=t,e):e},e.labelOffset=function(t){return arguments.length?(c=+t,e):e},e.labelDelimiter=function(t){return arguments.length?(d=t,e):e},e.orient=function(t){return arguments.length?(t=t.toLowerCase(),("horizontal"==t||"vertical"==t)&&(p=t),e):e},e.ascending=function(t){return arguments.length?(h=!!t,e):e},d3.rebind(e,g,"on"),e}},function(e,t,r){var n=r(210);e.exports=function(){function e(e){var y=n.d3_calcType(t,g,u,l,c,p),v=e.selectAll(".cell").data(y.data),b=v.enter().append("g",".cell").attr("class","cell").style("opacity",1e-6);shapeEnter=b.append(r).attr("class","swatch"),shapes=v.select("g.cell "+r),n.d3_addEvents(b,m),v.exit().transition().style("opacity",0).remove(),n.d3_drawShapes(r,shapes,i,o,a,y.feature),n.d3_addText(e,b,y.labels);var w,_,x=v.select("text"),D=shapes[0].map(function(e){return e.getBBox()}),T=d3.max(D,function(e){return e.height}),O=d3.max(D,function(e){return e.width}),k="start"==f?0:"middle"==f?.5:1;"vertical"===h?(w=function(e,t){return"translate(0, "+t*(T+s)+")"},_=function(e,t){return"translate("+(O+d)+","+(D[t].y+D[t].height/2+5)+")"}):"horizontal"===h&&(w=function(e,t){return"translate("+t*(O+s)+",0)"},_=function(e,t){return"translate("+(D[t].width*k+D[t].x)+","+(T+d)+")"}),n.d3_placement(h,v,w,x,_,f),v.transition().style("opacity",1)}var t=d3.scale.linear(),r="path",o=15,i=15,a=10,s=5,u=[5],l=[],c=d3.format(".01f"),f="middle",d=10,p="to",h="vertical",g=!1,m=d3.dispatch("cellover","cellout","cellclick");return e.scale=function(r){return arguments.length?(t=r,e):e},e.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(u=t),e):e},e.shapePadding=function(t){return arguments.length?(s=+t,e):e},e.labels=function(t){return arguments.length?(l=t,e):e},e.labelAlign=function(t){return arguments.length?(("start"==t||"end"==t||"middle"==t)&&(f=t),e):e},e.labelFormat=function(t){return arguments.length?(c=t,e):e},e.labelOffset=function(t){return arguments.length?(d=+t,e):e},e.labelDelimiter=function(t){return arguments.length?(p=t,e):e},e.orient=function(t){return arguments.length?(t=t.toLowerCase(),("horizontal"==t||"vertical"==t)&&(h=t),e):e},e.ascending=function(t){return arguments.length?(g=!!t,e):e},d3.rebind(e,m,"on"),e}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r\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 \n \n \n \n'},function(e,t){e.exports='\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 \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 \n \n'},function(e,t){e.exports='\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';
-},function(e,t){e.exports='\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'},function(e,t){e.exports='\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n'},function(e,t){e.exports='\n\n\n \n \n \n \n \n \n \n \n \n \n \n'},function(e,t){e.exports='\n\n\n\n \n \n \n \n \n \n \n \n \n \n'},function(e,t){e.exports='\n\n\n \n \n \n \n \n \n \n \n \n \n \n'},function(e,t){e.exports='\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t0?30:0,30*e.col[0].key.length),footerHeight:e.col[0].field?60:0,fixedQuantAxisWidth:120,fixedOrdinalAxisWidth:200};return _.extend(t,{bodyHeight:t.rowsCount*t.rowHeight,bodyWidth:e.col.length*t.colWidth,fixedWidth:e.row[0].key.length*t.fixedOrdinalAxisWidth+(e.row[0].field?t.fixedQuantAxisWidth:0)})}},{key:"render",value:function(){var e=this.props.axes,t=this.getTableSettings(e);return d["default"].createElement(T,a({},t,this.props))}}]),t}(d["default"].Component);t.TableContainer=D;var T=function(e){function t(e){var r=this;o(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.state={renderTable:!1,width:500,height:500},_.extend(this,_(this).pick("_update","_onResize").mapValues(function(e){return e.bind(r)}).value())}return i(t,e),s(t,[{key:"componentDidMount",value:function(){this._update(),window.addEventListener("resize",this._onResize,!1)}},{key:"componentWillUnmount",value:function(){clearTimeout(this._updateTimer),window.removeEventListener("resize",this._onResize)}},{key:"_onResize",value:function(){clearTimeout(this._updateTimer),this._updateTimer=setTimeout(this._update,16)}},{key:"_update",value:function(){var e=v(this),t=e.offsetWidth,r=e.offsetHeight;this.setState({renderTable:!0,width:t,height:this.getTableHeight(t,r)})}},{key:"getTableHeight",value:function(e,t){var r=this.props,n=r.headerHeight,o=r.footerHeight,i=r.bodyHeight,a=r.fixedWidth,s=r.bodyWidth;if(null==i)return t;var u=n+i+o+2*x,l=a+s;return l>e&&(u+=y["default"].SIZE),u>t&&(u=t),u}},{key:"getScaleFunction",value:function(e,t,r){if("__default__"==r)return function(e){return t["default"]};var n="time"==t.type?d3.time.scale().domain(_.map(t.domain,function(e){return new Date(e)})):d3.scale[t.type]().domain(t.domain);switch(e){case"row":return n.range([this.props.rowHeight,0]);case"col":return n.range([0,this.props.colWidth]);default:return n.range(t.range)}}},{key:"render",value:function(){var e=this,t=_.mapValues(this.props.scales,function(t,r){return _.mapValues(t,function(t,n){return e.getScaleFunction(r,t,n)})}),r=t?_(this.props.queryspec).map(function(e,r){return _.map(e,function(e){return{field:e,shelf:r,scale:t[r][e.accessor]}})}).flatten().value():null;return w({className:(0,c["default"])("container-flex-fill",{"table-no-header":0==this.props.headerHeight,"table-no-footer":0==this.props.footerHeight,"table-row-bottom-border":this.props.hasRowNumericAxes})},d["default"].createElement(g.TableLayout,a({},this.state,this.props,{fieldScales:r,visScales:t})))}}]),t}(d["default"].Component);t.TableResizeWrapper=T},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r.public_fixedDataTableCell_main{display:inline-block;vertical-align:top;white-space:normal}.fixedDataTableCellGroupLayout_cellGroupWrapper{position:absolute;top:0}.fixedDataTableCellLayout_main{border-right-style:solid;border-right-width:1px;border-width:0 1px 0 0;box-sizing:border-box;display:block;overflow:hidden;position:absolute;white-space:normal}.fixedDataTableCellLayout_lastChild{border-width:0 1px 1px 0}.fixedDataTableCellLayout_alignRight{text-align:right}.fixedDataTableCellLayout_alignCenter{text-align:center}.fixedDataTableCellLayout_wrap1{display:table}.fixedDataTableCellLayout_wrap2{display:table-row}.fixedDataTableCellLayout_wrap3{display:table-cell;vertical-align:middle}.fixedDataTableCellLayout_columnResizerContainer{position:absolute;right:0;width:6px;z-index:1}.fixedDataTableCellLayout_columnResizerContainer:hover{cursor:ew-resize}.fixedDataTableCellLayout_columnResizerContainer:hover .fixedDataTableCellLayout_columnResizerKnob{visibility:visible}.fixedDataTableCellLayout_columnResizerKnob{position:absolute;right:0;visibility:hidden;width:4px}.fixedDataTableColumnResizerLineLayout_mouseArea{cursor:ew-resize;position:absolute;right:-5px;width:12px}.fixedDataTableColumnResizerLineLayout_main{border-right-style:solid;border-right-width:1px;box-sizing:border-box;position:absolute;z-index:10}.fixedDataTableColumnResizerLineLayout_hiddenElem,body[dir=rtl] .fixedDataTableColumnResizerLineLayout_main{display:none!important}.fixedDataTableLayout_main{border-style:solid;border-width:1px;box-sizing:border-box;overflow:hidden;position:relative}.fixedDataTableLayout_hasBottomBorder,.fixedDataTableLayout_header{border-bottom-style:solid;border-bottom-width:1px}.fixedDataTableLayout_footer .public_fixedDataTableCell_main{border-top-style:solid;border-top-width:1px}.fixedDataTableLayout_bottomShadow,.fixedDataTableLayout_topShadow{height:4px;left:0;position:absolute;right:0;z-index:1}.fixedDataTableLayout_bottomShadow{margin-top:-4px}.fixedDataTableLayout_rowsContainer{overflow:hidden;position:relative}.fixedDataTableLayout_horizontalScrollbar{bottom:0;position:absolute}.fixedDataTableRowLayout_main{box-sizing:border-box;overflow:hidden;position:absolute;top:0}.fixedDataTableRowLayout_body{left:0;position:absolute;top:0}.fixedDataTableRowLayout_fixedColumnsDivider{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-left-style:solid;border-left-width:1px;left:0;position:absolute;top:0;width:0}.fixedDataTableRowLayout_columnsShadow{width:4px}.fixedDataTableRowLayout_rowWrapper{position:absolute;top:0}",""])},function(e,t,r){var n=r(230);"string"==typeof n&&(n=[[e.id,n,""]]);r(4)(n,{});n.locals&&(e.exports=n.locals)},function(e,t,r){t=e.exports=r(3)(),t.push([e.id,".remove-link{color:#999}.remove-link:hover{color:#f18794;text-decoration:none}.public_fixedDataTable_header,.public_fixedDataTable_header .public_fixedDataTableCell_main{background-color:#fff;background-image:none}.public_fixedDataTable_footer .public_fixedDataTableCell_main,.public_fixedDataTableRow_highlighted,.public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main{background-color:#fff}.public_fixedDataTable_footer .public_fixedDataTableCell_main,.public_fixedDataTableCell_main,.public_fixedDataTableRow_fixedColumnsDivider{border-color:#dfdfdf}.public_fixedDataTable_header .public_fixedDataTableCell_main{font-weight:initial}.public_fixedDataTableRow_main.public_fixedDataTable_hasBottomBorder [data-reactid$=fixed_cells] .public_fixedDataTableCell_main,.public_fixedDataTableRow_main .public_fixedDataTableCell_axis.public_fixedDataTableCell_main,.table-no-footer .public_fixedDataTableRow_main .public_fixedDataTableCell_main,.table-row-bottom-border .public_fixedDataTableRow_main .public_fixedDataTableCell_main{border-bottom-style:solid;border-bottom-width:1px}.public_fixedDataTable_header .fixedDataTableCellLayout_wrap3{vertical-align:bottom}.public_fixedDataTable_footer .fixedDataTableCellLayout_wrap3,.public_fixedDataTableCell_axis .fixedDataTableCellLayout_wrap3{vertical-align:top}.public_fixedDataTableCell_cellContent{padding:0 4px}.public_fixedDataTable_hasBottomBorder,.public_fixedDataTable_main,.public_fixedDataTableRow_fixedColumnsDivider,.table-no-header .public_fixedDataTable_header{border:none}.public_fixedDataTable_footer .fixedDataTableCellLayout_main.public_fixedDataTableCell_main,.public_fixedDataTable_footer .public_fixedDataTableRow_fixedColumnsDivider,.public_fixedDataTable_header .public_fixedDataTableCell_main,.public_fixedDataTable_header .public_fixedDataTableRow_fixedColumnsDivider{border-left:none;border-right:none;border-top:none}.public_fixedDataTable_footer .fixedDataTableCellLayout_main.public_fixedDataTableCell_main,.public_fixedDataTable_footer .public_fixedDataTableRow_fixedColumnsDivider{border-bottom:none}.public_fixedDataTable_header .public_fixedDataTableCell_main{text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.public_fixedDataTable_header [data-reactid$=fixed_cells] .public_fixedDataTableCell_main{text-align:left}.public_fixedDataTableCell_main:not(.public_fixedDataTableCell_axis) .table-row-label.public_fixedDataTableCell_cellContent{text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",""])},function(e,t,r){e.exports=r(232)},function(e,t,r){"use strict";var n=r(233),o=r(270),i=r(268),a=r(267),s={Cell:o,Column:i,ColumnGroup:a,Table:n};s.version="0.6.0",e.exports=s},function(e,t,r){(function(t){"use strict";function n(e,r){"production"!==t.env.NODE_ENV&&(g[e]||(console.warn("`"+e+"` will be DEPRECATED in version "+d+" of FixedDataTable and beyond. \n"+r+"\nRead the docs at: "+p),g[e]=!0))}var o=Object.assign||function(e){for(var t=1;te&&this.state.scrollX>0||e>=0&&this.state.scrollXe&&this.state.scrollY>0||e>=0&&this.state.scrollYn?n:this.state.height>n&&this.props.ownerHeight?Math.max(n,this.props.ownerHeight):this.state.height+this.state.maxScrollY,e!==this._contentHeight&&this.props.onContentHeightChange&&this.props.onContentHeightChange(e),this._contentHeight=e},componentDidMount:function(){this._reportContentHeight()},componentWillReceiveProps:function(e){var t=e.scrollToRow;void 0!==t&&null!==t&&(this._rowToScrollTo=t);var r=e.scrollToColumn;void 0!==r&&null!==r&&(this._columnToScrollTo=r);var n=e.overflowX,o=e.overflowY;(n!==this.props.overflowX||o!==this.props.overflowY)&&(this._wheelHandler=new a(this._onWheel,"hidden"!==n,"hidden"!==o)),(this.props.ownerHeight!==e.ownerHeight||this.props.scrollTop!==e.scrollTop)&&this._didScrollStart(),this._didScrollStop(),this.setState(this._calculateState(e,this.state))},componentDidUpdate:function(){this._reportContentHeight()},render:function(){var e,t=this.state,r=this.props;t.useGroupHeader&&(e=o.createElement(c,{key:"group_header",isScrolling:this._isScrolling,className:y(p("fixedDataTableLayout/header"),p("public/fixedDataTable/header")),width:t.width,height:t.groupHeaderHeight,index:0,zIndex:1,offsetTop:0,scrollLeft:t.scrollX,fixedColumns:t.groupHeaderFixedColumns,scrollableColumns:t.groupHeaderScrollableColumns,onColumnResize:this._onColumnResize}));var n=this.state.maxScrollY,i=t.maxScrollX>0&&"hidden"!==t.overflowX,a=n>0&&"hidden"!==t.overflowY,u=i?s.SIZE:0,f=t.height-u-2*D-t.footerHeight,d=t.useGroupHeader?t.groupHeaderHeight:0,h=d+t.headerHeight;f-=h;var g=0,m=null!=r.maxHeight?h+t.bodyHeight:h+f,v=m+t.footerHeight;void 0!==r.ownerHeight&&r.ownerHeightt.ownerHeight||t.scrollY or "),r.push(e))});var o=!1;r.length&&r[0].type.__TableColumnGroup__&&(o=!0);var i,a,u=t&&t.firstRowIndex||0,l=t&&t.firstRowOffset||0;i=t&&"hidden"!==e.overflowX?t.scrollX:e.scrollLeft,t&&"hidden"!==e.overflowY?a=t.scrollY:(h=this._scrollHelper.scrollTo(e.scrollTop),u=h.index,l=h.offset,a=h.position),void 0!==this._rowToScrollTo&&(h=this._scrollHelper.scrollRowIntoView(this._rowToScrollTo),u=h.index,l=h.offset,a=h.position,delete this._rowToScrollTo);var c=o?e.groupHeaderHeight:0;if(t&&e.rowsCount!==t.rowsCount){var p=(void 0===e.height?e.maxHeight:e.height)-(e.headerHeight||0)-(e.footerHeight||0)-(e.groupHeaderHeight||0);this._scrollHelper=new f(e.rowsCount,e.rowHeight,p,e.rowHeightGetter);var h=this._scrollHelper.scrollToRow(u,l);u=h.index,l=h.offset,a=h.position}else t&&e.rowHeightGetter!==t.rowHeightGetter&&this._scrollHelper.setRowHeightGetter(e.rowHeightGetter);var g;g=e.isColumnResizing?t&&t.columnResizingData:x;var y,v;if(o){var b=d.adjustColumnGroupWidths(r,e.width);y=b.columns,v=b.columnGroups}else y=d.adjustColumnWidths(r,e.width);var w=this._populateColumnsAndColumnData(y,v,t);if(void 0!==this._columnToScrollTo){var T=w.bodyFixedColumns.length;if(this._columnToScrollTo>=T){var O,k,C=0;for(O=0;OO;++O)k=w.bodyScrollableColumns[O],S+=k.props.width;var R=e.width-C,M=w.bodyScrollableColumns[E].props.width,A=S+M-R;A>i&&(i=A),i>S&&(i=S)}delete this._columnToScrollTo}var P=void 0===e.height,I=Math.round(P?e.maxHeight:e.height),N=e.footerHeight+e.headerHeight+c+2*D,j=I-N,F=this._scrollHelper.getContentHeight(),L=F+N,H=d.getTotalWidth(y),q=H>e.width&&"hidden"!==e.overflowX;q&&(j-=s.SIZE,L+=s.SIZE,N+=s.SIZE);var z=Math.max(0,H-e.width),B=Math.max(0,F-j);i=Math.min(i,z),a=Math.min(a,B),B||(P&&(I=L),j=L-N),this._scrollHelper.setViewportHeight(j);var U=n({isColumnResizing:t&&t.isColumnResizing},w,e,{columns:y,columnGroups:v,columnResizingData:g,firstRowIndex:u,firstRowOffset:l,horizontalScrollbarVisible:q,maxScrollX:z,maxScrollY:B,reservedHeight:N,scrollContentHeight:F,scrollX:i,scrollY:a,bodyHeight:j,height:I,groupHeaderHeight:c,useGroupHeader:o});return U},_selectColumnElement:function(e,t){for(var r=[],n=0;nMath.abs(e)&&"hidden"!==this.props.overflowY){var n=this._scrollHelper.scrollBy(Math.round(t)),o=Math.max(0,n.contentHeight-this.state.bodyHeight);this.setState({firstRowIndex:n.index,firstRowOffset:n.offset,scrollY:n.position,scrollContentHeight:n.contentHeight,maxScrollY:o})}else e&&"hidden"!==this.props.overflowX&&(r+=e,r=0>r?0:r,r=r>this.state.maxScrollX?this.state.maxScrollX:r,this.setState({scrollX:r}));this._didScrollStop()}},_onHorizontalScroll:function(e){this.isMounted()&&e!==this.state.scrollX&&(this._isScrolling||this._didScrollStart(),this.setState({scrollX:e}),this._didScrollStop())},_onVerticalScroll:function(e){if(this.isMounted()&&e!==this.state.scrollY){this._isScrolling||this._didScrollStart();var t=this._scrollHelper.scrollTo(Math.round(e));this.setState({firstRowIndex:t.index,firstRowOffset:t.offset,scrollY:t.position,scrollContentHeight:t.contentHeight}),this._didScrollStop()}},_didScrollStart:function(){this.isMounted()&&!this._isScrolling&&(this._isScrolling=!0,this.props.onScrollStart&&this.props.onScrollStart(this.state.scrollX,this.state.scrollY))},_didScrollStop:function(){this.isMounted()&&this._isScrolling&&(this._isScrolling=!1,this.setState({redraw:!0}),this.props.onScrollEnd&&this.props.onScrollEnd(this.state.scrollX,this.state.scrollY))}}),E=o.createClass({displayName:"HorizontalScrollbar",mixins:[i],propTypes:{contentSize:w.number.isRequired,offset:w.number.isRequired,onScroll:w.func.isRequired,position:w.number.isRequired,size:w.number.isRequired},render:function(){var e={height:s.SIZE,width:this.props.size},t={height:s.SIZE,position:"absolute",overflow:"hidden",width:this.props.size};return b(t,0,this.props.offset),o.createElement("div",{className:y(p("fixedDataTableLayout/horizontalScrollbar"),p("public/fixedDataTable/horizontalScrollbar")),style:e},o.createElement("div",{style:t},o.createElement(s,n({},this.props,{isOpaque:!0,orientation:"horizontal",offset:void 0}))))}});e.exports=C},function(e,t){"use strict";function r(e,t){if(e===t)return!0;var r;for(r in e)if(e.hasOwnProperty(r)&&(!t.hasOwnProperty(r)||e[r]!==t[r]))return!1;for(r in t)if(t.hasOwnProperty(r)&&!e.hasOwnProperty(r))return!1;return!0}var n={shouldComponentUpdate:function(e,t){return!r(this.props,e)||!r(this.state,t)}};e.exports=n},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;rn?-1:1),o&&!r&&(r=1>o?-1:1),{spinX:t,spinY:r,pixelX:n,pixelY:o}}var o=r(240),i=r(241),a=10,s=40,u=800;n.getEventType=function(){return o.firefox()?"DOMMouseScroll":i("wheel")?"wheel":"mousewheel"},e.exports=n},function(e,t){"use strict";function r(){if(!v){v=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),r=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(h=/\b(iPhone|iP[ao]d)/.exec(e),g=/\b(iP[ao]d)/.exec(e),d=/Android/i.exec(e),m=/FBAN\/\w+;/i.exec(e),y=/Mobile/i.exec(e),p=!!/Win64/.exec(e),t){n=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,n&&document&&document.documentMode&&(n=document.documentMode);var b=/(?:Trident\/(\d+.\d+))/.exec(e);u=b?parseFloat(b[1])+4:n,o=t[2]?parseFloat(t[2]):NaN,i=t[3]?parseFloat(t[3]):NaN,a=t[4]?parseFloat(t[4]):NaN,a?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),s=t&&t[1]?parseFloat(t[1]):NaN):s=NaN}else n=o=i=s=a=NaN;if(r){if(r[1]){var w=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);l=w?parseFloat(w[1].replace("_",".")):!0}else l=!1;c=!!r[2],f=!!r[3]}else l=c=f=!1}}var n,o,i,a,s,u,l,c,f,d,p,h,g,m,y,v=!1,b={ie:function(){return r()||n},ieCompatibilityMode:function(){return r()||u>n},ie64:function(){return b.ie()&&p},firefox:function(){return r()||o},opera:function(){return r()||i},webkit:function(){return r()||a},safari:function(){return b.webkit()},chrome:function(){return r()||s},windows:function(){return r()||c},osx:function(){return r()||l},linux:function(){return r()||f},iphone:function(){return r()||h},mobile:function(){return r()||h||g||d||y},nativeApp:function(){return r()||m},android:function(){return r()||d},ipad:function(){return r()||g}};e.exports=b},function(e,t,r){"use strict";/**
- * Checks if an event is supported in the current execution environment.
- *
- * NOTE: This will not work correctly for non-generic events such as `change`,
- * `reset`, `load`, `error`, and `select`.
- *
- * Borrows from Modernizr.
- *
- * @param {string} eventNameSuffix Event name, e.g. "click".
- * @param {?boolean} capture Check if the capture phase is supported.
- * @return {boolean} True if the event is supported.
- * @internal
- * @license Modernizr 3.0.0pre (Custom Build) | MIT
- */
-function n(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var r="on"+e,n=r in document;if(!n){var a=document.createElement("div");a.setAttribute(r,"return;"),n="function"==typeof a[r]}return!n&&o&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}var o,i=r(242);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=n},function(e,t){"use strict";var r=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:r,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};e.exports=n},function(e,t,r){(function(t){"use strict";var n=r(238),o=r(244),i=0,a=o||function(e){var r=Date.now(),n=Math.max(0,16-(r-i));return i=r+n,t.setTimeout(function(){e(Date.now())},n)};a(n),e.exports=a}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";var r=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame;e.exports=r}).call(t,function(){return this}())},function(e,t,r){"use strict";var n=r(246),o=r(249),i=r(234),a=r(250),s=r(236),u=r(237),l=r(251),c=r(252),f=r(238),d=r(253),p=i.PropTypes,h={position:0,scrollable:!1},g=parseInt(l("scrollbar-face-margin"),10),m=2*g,y=30,v=40,b=null,w=i.createClass({displayName:"Scrollbar",mixins:[s],propTypes:{contentSize:p.number.isRequired,defaultPosition:p.number,isOpaque:p.bool,orientation:p.oneOf(["vertical","horizontal"]),onScroll:p.func,position:p.number,size:p.number.isRequired,trackColor:p.oneOf(["gray"]),zIndex:p.number,verticalTop:p.number},getInitialState:function(){var e=this.props;return this._calculateState(e.position||e.defaultPosition||0,e.size,e.contentSize,e.orientation)},componentWillReceiveProps:function(e){var t=e.position;void 0===t?this._setNextState(this._calculateState(this.state.position,e.size,e.contentSize,e.orientation)):this._setNextState(this._calculateState(t,e.size,e.contentSize,e.orientation),e)},getDefaultProps:function(){return{defaultPosition:0,isOpaque:!1,onScroll:f,orientation:"vertical",zIndex:99}},render:function(){if(!this.state.scrollable)return null;var e,t,r=this.props.size,n=this.state.isHorizontal,o=!n,a=this.state.focused||this.state.isDragging,s=this.state.faceSize,u=this.props.isOpaque,f=this.props.verticalTop||0,p=c({"ScrollbarLayout/main":!0,"ScrollbarLayout/mainVertical":o,"ScrollbarLayout/mainHorizontal":n,"public/Scrollbar/main":!0,"public/Scrollbar/mainOpaque":u,"public/Scrollbar/mainActive":a}),h=c({"ScrollbarLayout/face":!0,"ScrollbarLayout/faceHorizontal":n,"ScrollbarLayout/faceVertical":o,"public/Scrollbar/faceActive":a,"public/Scrollbar/face":!0}),y=this.state.position*this.state.scale+g;return n?(e={width:r},t={width:s-m},d(t,y,0)):(e={top:f,height:r},t={height:s-m},d(t,0,y)),e.zIndex=this.props.zIndex,"gray"===this.props.trackColor&&(e.backgroundColor=l("fbui-desktop-background-light")),i.createElement("div",{onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this._onKeyDown,onMouseDown:this._onMouseDown,onWheel:this._wheelHandler.onWheel,className:p,style:e,tabIndex:0},i.createElement("div",{ref:"face",className:h,style:t}))},componentWillMount:function(){var e="horizontal"===this.props.orientation,t=e?this._onWheelX:this._onWheelY;this._wheelHandler=new u(t,this._shouldHandleX,this._shouldHandleY)},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMouseMove,this._onMouseMoveEnd,document.documentElement),void 0!==this.props.position&&this.state.position!==this.props.position&&this._didScroll()},componentWillUnmount:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),b===this&&(b=null),delete this._mouseMoveTracker},scrollBy:function(e){this._onWheel(e)},_shouldHandleX:function(e){return"horizontal"===this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleY:function(e){return"horizontal"!==this.props.orientation?this._shouldHandleChange(e):!1},_shouldHandleChange:function(e){var t=this._calculateState(this.state.position+e,this.props.size,this.props.contentSize,this.props.orientation);return t.position!==this.state.position},_calculateState:function(e,t,r,n){if(1>t||t>=r)return h;var o=""+e+"_"+t+"_"+r+"_"+n;if(this._stateKey===o)return this._stateForKey;var i="horizontal"===n,a=t/r,s=t*a;y>s&&(a=(t-y)/(r-t),s=y);var u=!0,l=r-t;0>e?e=0:e>l&&(e=l);var c=this._mouseMoveTracker?this._mouseMoveTracker.isDragging():!1,f={faceSize:s,isDragging:c,isHorizontal:i,position:e,scale:a,scrollable:u};return this._stateKey=o,this._stateForKey=f,f},_onWheelY:function(e,t){this._onWheel(t)},_onWheelX:function(e,t){this._onWheel(e)},_onWheel:function(e){var t=this.props;this._setNextState(this._calculateState(this.state.position+e,t.size,t.contentSize,t.orientation))},_onMouseDown:function(e){var t;if(e.target!==a.findDOMNode(this.refs.face)){var r=e.nativeEvent,n=this.state.isHorizontal?r.offsetX||r.layerX:r.offsetY||r.layerY,o=this.props;n/=this.state.scale,t=this._calculateState(n-.5*this.state.faceSize/this.state.scale,o.size,o.contentSize,o.orientation)}else t={};t.focused=!0,this._setNextState(t),this._mouseMoveTracker.captureMouseMoves(e),a.findDOMNode(this).focus()},_onMouseMove:function(e,t){var r=this.props,n=this.state.isHorizontal?e:t;n/=this.state.scale,this._setNextState(this._calculateState(this.state.position+n,r.size,r.contentSize,r.orientation))},_onMouseMoveEnd:function(){this._nextState=null,this._mouseMoveTracker.releaseMouseMoves(),this.setState({isDragging:!1})},_onKeyDown:function(e){var t=e.keyCode;if(t!==o.TAB){var r=v,n=0;if(this.state.isHorizontal)switch(t){case o.HOME:n=-1,r=this.props.contentSize;break;case o.LEFT:n=-1;break;case o.RIGHT:n=1;break;default:return}if(!this.state.isHorizontal)switch(t){case o.SPACE:n=e.shiftKey?-1:1;break;case o.HOME:n=-1,r=this.props.contentSize;break;case o.UP:n=-1;break;case o.DOWN:n=1;break;case o.PAGE_UP:n=-1,r=this.props.size;break;case o.PAGE_DOWN:n=1,r=this.props.size;break;default:return}e.preventDefault();var i=this.props;this._setNextState(this._calculateState(this.state.position+r*n,i.size,i.contentSize,i.orientation))}},_onFocus:function(){this.setState({focused:!0})},_onBlur:function(){this.setState({focused:!1})},_blur:function(){if(this.isMounted())try{this._onBlur(),a.findDOMNode(this).blur()}catch(e){}},_setNextState:function(e,t){t=t||this.props;var r=t.position,n=this.state.position!==e.position;if(void 0===r){var o=n?this._didScroll:void 0;this.setState(e,o)}else{if(r!==e.position)return void(void 0!==e.position&&e.position!==this.state.position&&this.props.onScroll(e.position));this.setState(e)}n&&b!==this&&(b&&b._blur(),b=this)},_didScroll:function(){this.props.onScroll(this.state.position)}});w.KEYBOARD_SCROLL_AMOUNT=v,w.SIZE=parseInt(l("scrollbar-size"),10),e.exports=w},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r0;)this._addRowToBuffer(t,this._viewportRowsBegin,this._viewportRowsEnd-1),t++,e--;return this._rows}},{key:"getRows",value:function(e,t){var r=t,n=r,o=e,i=Math.min(e+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=e;i>o||n=i&&(n=this._bufferSet.replaceFurthestValuePosition(t,r,e)),null===n?(n=this._bufferSet.getNewPositionForValue(e),this._rows[n]=e):this._rows[n]=e}}]),e}();e.exports=c},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r=e&&t>=o)return null;var i;e-n>o-t?(i=n,this._smallValues.pop()):(i=o,this._largeValues.pop());var s=this._valueToPositionMap[i];return delete this._valueToPositionMap[i],this._valueToPositionMap[r]=s,this._pushToHeaps(s,r),s}},{key:"_pushToHeaps",value:function(e,t){var r={position:e,value:t};this._smallValues.push(r),this._largeValues.push(r)}},{key:"_cleanHeaps",value:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var e=Math.min(this._smallValues.size(),this._largeValues.size()),t=Math.max(this._smallValues.size(),this._largeValues.size());t>10*e&&this._recreateHeaps()}},{key:"_recreateHeaps",value:function(){for(var e=this._smallValues.size()t.value}}]),e}();e.exports=s},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){return t>e}var o=function(){function e(e,t){for(var r=0;r0&&(this._items[0]=t,this._sinkDown(0)),e}}},{key:"push",value:function(e){this._items[this._size++]=e,this._bubbleUp(this._size-1)}},{key:"size",value:function(){return this._size}},{key:"peek",value:function(){return 0!==this._size?this._items[0]:void 0}},{key:"_heapify",value:function(){for(var e=Math.floor((this._size+1)/2);e>=0;e--)this._sinkDown(e)}},{key:"_bubbleUp",value:function(e){for(var t=this._items[e];e>0;){var r=Math.floor((e+1)/2)-1,n=this._items[r];if(this._comparator(n,t))return;this._items[r]=t,this._items[e]=n,e=r}}},{key:"_sinkDown",value:function(e){for(var t=this._items[e];;){var r=2*(e+1)-1,n=2*(e+1),o=-1;if(re?t:e>r?r:e}e.exports=r},function(e,t,r){"use strict";var n=Object.assign||function(e){for(var t=1;t0){var t=a({"fixedDataTableRowLayout/fixedColumnsDivider":!0,"fixedDataTableRowLayout/columnsShadow":this.props.scrollLeft>0,"public/fixedDataTableRow/fixedColumnsDivider":!0,"public/fixedDataTableRow/columnsShadow":this.props.scrollLeft>0}),r={left:e,height:this.props.height};return o.createElement("div",{className:t,style:r})}},_onClick:function(e){this.props.onClick(e,this.props.index)},_onDoubleClick:function(e){this.props.onDoubleClick(e,this.props.index)},_onMouseDown:function(e){this.props.onMouseDown(e,this.props.index)},_onMouseEnter:function(e){this.props.onMouseEnter(e,this.props.index)},_onMouseLeave:function(e){this.props.onMouseLeave(e,this.props.index)}}),f=o.createClass({displayName:"FixedDataTableRow",propTypes:{isScrolling:l.bool,height:l.number.isRequired,zIndex:l.number,offsetTop:l.number.isRequired,width:l.number.isRequired},render:function(){var e={width:this.props.width,height:this.props.height,zIndex:this.props.zIndex?this.props.zIndex:0};return u(e,0,this.props.offsetTop),o.createElement("div",{style:e,className:a("fixedDataTableRowLayout/rowWrapper")},o.createElement(c,n({},this.props,{offsetTop:void 0,zIndex:void 0})))}});e.exports=f},function(e,t,r){"use strict";function n(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var o=Object.assign||function(e){for(var t=1;to;o++){var s=t[o].props;if(!s.allowCellsRecycling||n-e.left<=e.width&&n-e.left+s.width>=0){var c="cell_"+o;r[o]=this._renderCell(e.rowIndex,e.rowHeight,s,n,c)}n+=s.width}var d=this._getColumnsWidth(t),p={height:e.height,position:"absolute",width:d,zIndex:e.zIndex};return l(p,-1*f*e.left,0),a.createElement("div",{className:u("fixedDataTableCellGroupLayout/cellGroup"),style:p},r)},_renderCell:function(e,t,r,n,o){var i=r.isResizable&&this.props.onColumnResize,u=i?this.props.onColumnResize:null,l=r.cellClassName;return a.createElement(s,{isScrolling:this.props.isScrolling,align:r.align,className:l,height:t,key:o,maxWidth:r.maxWidth,minWidth:r.minWidth,onColumnResize:u,rowIndex:e,columnKey:r.columnKey,width:r.width,left:n,cell:r.cell})},_getColumnsWidth:function(e){for(var t=0,r=0;r should never render");return null}});e.exports=o}).call(t,r(15))},function(e,t,r){(function(t){"use strict";var n=r(234),o=n.createClass({displayName:"TransitionColumn",statics:{__TableColumn__:!0},render:function(){if("production"!==t.env.NODE_ENV)throw new Error("Component should never render");return null}});e.exports=o}).call(t,r(15))},function(e,t,r){"use strict";function n(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var o=r(270),i=r(265),a=r(234),s=r(252),u=r(271),l=i.DIR_SIGN,c=a.PropTypes,f={align:"left",highlighted:!1},d=a.createClass({displayName:"FixedDataTableCell",propTypes_DISABLED_FOR_PERFORMANCE:{isScrolling:c.bool,align:c.oneOf(["left","center","right"]),className:c.string,highlighted:c.bool,width:c.number.isRequired,minWidth:c.number,maxWidth:c.number,height:c.number.isRequired,cell:c.oneOfType([c.string,c.element,c.func]),columnKey:c.oneOfType([c.string,c.number]),rowIndex:c.number.isRequired,onColumnResize:c.func,left:c.number},shouldComponentUpdate:function(e){return!e.isScrolling||this.props.rowIndex!==e.rowIndex},getDefaultProps:function(){return f},render:function(){var e=this.props,t=e.height,r=e.width,i=e.columnKey,c=n(e,["height","width","columnKey"]),f={height:t,width:r};1===l?f.left=c.left:f.right=c.left;var d,p=u(s({"fixedDataTableCellLayout/main":!0,"fixedDataTableCellLayout/lastChild":c.lastChild,"fixedDataTableCellLayout/alignRight":"right"===c.align,"fixedDataTableCellLayout/alignCenter":"center"===c.align,"public/fixedDataTableCell/alignRight":"right"===c.align,"public/fixedDataTableCell/highlighted":c.highlighted,"public/fixedDataTableCell/main":!0}),c.className);if(c.onColumnResize){var h={height:t};d=a.createElement("div",{className:s("fixedDataTableCellLayout/columnResizerContainer"),style:h,onMouseDown:this._onColumnResizerMouseDown},a.createElement("div",{className:u(s("fixedDataTableCellLayout/columnResizerKnob"),s("public/fixedDataTableCell/columnResizerKnob")),style:h}))}var g={columnKey:i,height:t,width:r};c.rowIndex>=0&&(g.rowIndex=c.rowIndex);var m;return m=a.isValidElement(c.cell)?a.cloneElement(c.cell,g):"function"==typeof c.cell?c.cell(g):a.createElement(o,g,c.cell),a.createElement("div",{className:p,style:f},d,m)},_onColumnResizerMouseDown:function(e){this.props.onColumnResize(this.props.left,this.props.width,this.props.minWidth,this.props.maxWidth,this.props.columnKey,e)}});e.exports=d},function(e,t,r){"use strict";function n(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var o=Object.assign||function(e){for(var t=1;t1)for(var n=1;r>n;n++)t=arguments[n],t&&(e=(e?e+" ":"")+t);return e}e.exports=r},function(e,t,r){"use strict";var n=r(246),o=r(266),i=r(234),a=r(236),s=r(262),u=r(252),l=i.PropTypes,c=i.createClass({displayName:"FixedDataTableColumnResizeHandle",mixins:[a],propTypes:{visible:l.bool.isRequired,height:l.number.isRequired,leftOffset:l.number.isRequired,knobHeight:l.number.isRequired,initialWidth:l.number,minWidth:l.number,maxWidth:l.number,initialEvent:l.object,onColumnResizeEnd:l.func,columnKey:l.oneOfType([l.string,l.number])},getInitialState:function(){return{width:0,cursorDelta:0}},componentWillReceiveProps:function(e){e.initialEvent&&!this._mouseMoveTracker.isDragging()&&(this._mouseMoveTracker.captureMouseMoves(e.initialEvent),this.setState({width:e.initialWidth,cursorDelta:e.initialWidth}))},componentDidMount:function(){this._mouseMoveTracker=new n(this._onMove,this._onColumnResizeEnd,document.body)},componentWillUnmount:function(){this._mouseMoveTracker.releaseMouseMoves(),this._mouseMoveTracker=null},render:function(){var e={width:this.state.width,height:this.props.height};return o.isRTL()?e.right=this.props.leftOffset:e.left=this.props.leftOffset,i.createElement("div",{className:u({"fixedDataTableColumnResizerLineLayout/main":!0,"fixedDataTableColumnResizerLineLayout/hiddenElem":!this.props.visible,"public/fixedDataTableColumnResizerLine/main":!0}),style:e},i.createElement("div",{className:u("fixedDataTableColumnResizerLineLayout/mouseArea"),style:{height:this.props.height}}))},_onMove:function(e){o.isRTL()&&(e=-e);var t=this.state.cursorDelta+e,r=s(t,this.props.minWidth,this.props.maxWidth);this.setState({width:r,cursorDelta:t})},_onColumnResizeEnd:function(){this._mouseMoveTracker.releaseMouseMoves(),this.props.onColumnResizeEnd(this.state.width,this.props.columnKey)}});e.exports=c},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;rs;++s)this._storedHeights[s]=r;this._rowCount=t,this._position=0,this._contentHeight=t*r,this._defaultRowHeight=r,this._rowHeightGetter=a?a:function(){return r},this._viewportHeight=o,this.scrollRowIntoView=this.scrollRowIntoView.bind(this),this.setViewportHeight=this.setViewportHeight.bind(this),this.scrollBy=this.scrollBy.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollToRow=this.scrollToRow.bind(this),this.setRowHeightGetter=this.setRowHeightGetter.bind(this),this.getContentHeight=this.getContentHeight.bind(this),this.getRowPosition=this.getRowPosition.bind(this),this._updateHeightsInViewport(0,0)}return o(e,[{key:"setRowHeightGetter",value:function(e){this._rowHeightGetter=e}},{key:"setViewportHeight",value:function(e){this._viewportHeight=e}},{key:"getContentHeight",value:function(){return this._contentHeight}},{key:"_updateHeightsInViewport",value:function(e,t){for(var r=t,n=e;r<=this._viewportHeight&&n=0&&t>=e-s;){var r=this._updateRowHeight(t);this._position+=r,t--}}},{key:"_updateRowHeight",value:function(e){if(0>e||e>=this._rowCount)return 0;var t=this._rowHeightGetter(e);if(t!==this._storedHeights[e]){var r=t-this._storedHeights[e];return this._rowOffsets.set(e,t),this._storedHeights[e]=t,this._contentHeight+=r,r}return 0}},{key:"getRowPosition",value:function(e){return this._updateRowHeight(e),this._rowOffsets.sumUntil(e)}},{key:"scrollBy",value:function(e){if(0===this._rowCount)return u;var t=this._rowOffsets.greatestLowerBound(this._position);t=a(t,0,Math.max(this._rowCount-1,0));var r=this._rowOffsets.sumUntil(t),n=t,o=this._position,i=this._updateRowHeight(n);0!==r&&(o+=i);var s=this._storedHeights[n]-(o-r);if(e>=0)for(;e>0&&ne?(o+=e,e=0):(e-=s,o+=s,n++),ne){e=-e;for(var l=this._storedHeights[n]-s;e>0&&n>=0;)if(l>e?(o-=e,e=0):(o-=l,e-=l,n--),n>=0){var c=this._updateRowHeight(n);l=this._storedHeights[n],o+=c}}var f=this._contentHeight-this._viewportHeight;o=a(o,0,f),this._position=o;var d=this._rowOffsets.greatestLowerBound(o);d=a(d,0,Math.max(this._rowCount-1,0)),r=this._rowOffsets.sumUntil(d);var p=r-o;return this._updateHeightsInViewport(d,p),this._updateHeightsAboveViewport(d),{index:d,offset:p,position:this._position,contentHeight:this._contentHeight}}},{key:"_getRowAtEndPosition",value:function(e){this._updateRowHeight(e);for(var t=e,r=this._storedHeights[t];r=0;)t--,t>=0&&(this._updateRowHeight(t),r+=this._storedHeights[t]);var n=this._rowOffsets.sumTo(e)-this._viewportHeight;return 0>n&&(n=0),n}},{key:"scrollTo",value:function(e){if(0===this._rowCount)return u;if(0>=e)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(e>=this._contentHeight-this._viewportHeight){var t=this._rowCount-1;e=this._getRowAtEndPosition(t)}this._position=e;var r=this._rowOffsets.greatestLowerBound(e);r=a(r,0,Math.max(this._rowCount-1,0));var n=this._rowOffsets.sumUntil(r),o=n-e;return this._updateHeightsInViewport(r,o),this._updateHeightsAboveViewport(r),{index:r,offset:o,position:this._position,contentHeight:this._contentHeight}}},{key:"scrollToRow",value:function(e,t){e=a(e,0,Math.max(this._rowCount-1,0)),t=a(t,-this._storedHeights[e],0);var r=this._rowOffsets.sumUntil(e);return this.scrollTo(r-t)}},{key:"scrollRowIntoView",value:function(e){e=a(e,0,Math.max(this._rowCount-1,0));var t=this._rowOffsets.sumUntil(e),r=t+this._storedHeights[e];if(tt;)t*=2;return t}var i=function(){function e(e,t){for(var r=0;r=0;--r)t[r]=0;return t},l=function(){function e(t){n(this,e),this._size=t.length,this._half=o(this._size),this._heap=new u(2*this._half);var r;for(r=0;r0;--r)this._heap[r]=this._heap[2*r]+this._heap[2*r+1]}return i(e,[{key:"set",value:function(e,t){a(e>=0&&e=0&&e=0&&e=0&&e=e,"Begin must precede end"),this.sumUntil(t)-this.sumUntil(e)}},{key:"greatestLowerBound",value:function(e){if(0>e)return-1;var t=1;if(this._heap[t]<=e)return this._size;for(;te?t=2*t:(t=2*t+1,e-=r)}return t-this._half}},{key:"greatestStrictLowerBound",value:function(e){if(0>=e)return-1;var t=1;if(this._heap[t]=e?t=2*t:(t=2*t+1,e-=r)}return t-this._half}},{key:"leastUpperBound",value:function(e){return this.greatestStrictLowerBound(e)+1}},{key:"leastStrictUpperBound",value:function(e){return this.greatestLowerBound(e)+1}}],[{key:"uniform",value:function(t,r){for(var n=[],o=t-1;o>=0;--o)n[o]=r;return new e(n)}},{key:"empty",value:function(t){return e.uniform(t,0)}}]),e}();e.exports=l}).call(t,function(){return this}())},function(e,t,r){"use strict";function n(e){for(var t=0,r=0;r=t)return{columns:e,width:n(e)};for(var r=o(e),i=t,a=[],s=0,l=0;lr?i(e,t-r).columns:e}var u=r(234),l={getTotalWidth:n,getTotalFlexGrow:o,distributeFlexWidth:i,adjustColumnWidths:s,adjustColumnGroupWidths:a};e.exports=l},function(e,t){"use strict";function r(e,t,r,n,o){function i(){for(var o=arguments.length,s=Array(o),u=0;o>u;u++)s[u]=arguments[u];i.reset();var l=function(){e.apply(r,s)};l.__SMmeta=e.__SMmeta,a=n(l,t)}n=n||setTimeout,o=o||clearTimeout;var a;return i.reset=function(){o(a)},i}e.exports=r},function(e,t){"use strict";function r(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(var i=n.bind(t),a=0;a should never render");return null}});e.exports=i}).call(t,r(15))},function(e,t,r){(function(t){"use strict";var n=r(234),o=n.PropTypes,i=n.createClass({displayName:"FixedDataTableColumnGroup",statics:{__TableColumnGroup__:!0},propTypes:{align:o.oneOf(["left","center","right"]),fixed:o.bool,header:o.oneOfType([o.node,o.func])},getDefaultProps:function(){return{fixed:!1}},render:function(){if("production"!==t.env.NODE_ENV)throw new Error("Component should never render");return null}});e.exports=i}).call(t,r(15))},function(e,t,r){"use strict";var n=Object.assign||function(e){for(var t=1;tg["default"].last(n.domain())&&o.pop(),e.tickValues(o).tickSubdivide(o[1]-o[0]-1).tickFormat(function(e){return t(Math.floor(e))})}function u(e){var t=this.getBBox(),r=this.parentElement.transform.baseVal,n=(r[0]||r.getItem(0)).matrix.e+t.x;if(0>n)return 1-n;var o=this.parentElement.parentElement.parentElement.width.baseVal.value,i=n+t.width;if(i>o)return o-i-2;var a=y["default"].select(this).attr("x");return a?a:0}function l(e){var t=this.getBBox(),r=this.parentElement.transform.baseVal,n=(r[0]||r.getItem(0)).matrix.f+t.y;if(0>n)return 1-n;var o=this.parentElement.parentElement.parentElement.height.baseVal.value,i=n+t.height;if(i>o)return o-i-1;var a=y["default"].select(this).attr("y");return a?a:0}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var r=0;r1?r-1:r}}:m?{y:function(e){return a(e[u]+1)},height:function(e){return a(e[u])-a(e[u]+1)-1}}:{y:function(e){return a(e[u]+i.binSettings.step)},height:function(e){return a(e[u])-a(e[u]+i.binSettings.step)-1}}:{y:function(e){return a(e[u])},height:function(e){return o-a(e[u])-1}};var y=function(){var e=(0,g.stackLayout)(n,u,t);return{v:{y:function(t,r){return a(t[u])+a(e(t,r))-o},height:function(e){return o-a(e[u])}}}}();if("object"==typeof y)return y.v;case"col":if(!c)return d?{width:function(e){return a(e[u])}}:p?m&&f["default"].contains(i.func,"bin")?{x:function(e){return a(e[u])},width:function(e){var t=l["default"].time[i.binSettings.unit.type].offset(e[u],i.binSettings.step),r=a(t)-a(e[u]);return r>1?r-1:r}}:m?{x:function(e){return a(e[u])},width:function(e){return a(e[u]+1)-a(e[u])-1}}:{x:function(e){return a(e[u])},width:function(e){return a(e[u]+i.binSettings.step)-a(e[u])-1}}:{width:function(e){return a(e[u])-1}};var v=function(){var e=(0,g.stackLayout)(n,u,t);return{v:{x:function(t,r){return a(e(t,r))},width:function(e){return a(e[u])}}}}();if("object"==typeof v)return v.v;case"color":return{fill:function(e){return a(e[u])}};case"opacity":return{opacity:function(e){return a(e[u])}};default:return{}}}},{key:"getAttributeTransforms",value:function(){var e=this,t=this.props.transformFields,r=f["default"].find(t,function(e){return(0,h.isBinField)(e.field)}),n=f["default"].merge(this.getDefaultScales(),f["default"].reduce(f["default"].map(t,function(t){return e.getBarScales(t,r)}),f["default"].merge,{}));return n.transform=function(e,t){return"translate("+n.x(e,t)+", "+n.y(e,t)+")"},n}},{key:"_d3Render",value:function(){var e=this.getAttributeTransforms(),t=l["default"].select(this.refs.d3container).selectAll("rect").data(this.props.markData);t.enter().append("rect"),t.attr("fill",e.fill).attr("fill-opacity",e.opacity).attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height),t.exit().remove()}},{key:"componentDidMount",value:function(){this._d3Render()}},{key:"componentDidUpdate",value:function(){this._d3Render()}},{key:"render",value:function(){var e=this.props,t=e.width,r=e.height;return y({ref:"d3container",width:t,height:r})}}]),t}(p["default"].Component);t["default"]=b,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=arguments.length<=1||void 0===arguments[1]?l["default"].identity:arguments[1],r=0,n=void 0,o=l["default"].map(e,function(e){return n=r,r+=t(e),n});return o.push(r),o}function i(e,t,r){var n=l["default"].property(t);if(r){var i=function(){var n={},o=(0,s.getAccessorName)(r.field),i=l["default"].map(e,function(e){null==n[e[o]]&&(n[e[o]]=0);var r=n[e[o]];return n[e[o]]+=e[t],r});return{v:function(e,t){return i[t]}}}();if("object"==typeof i)return i.v}else{var a=function(){var t=o(e,n);return{v:function(e,r){return t[r]}}}();if("object"==typeof a)return a.v}}function a(e,t,r){var n=void 0;return r?!function(){var o={},i=(0,s.getAccessorName)(r.field);n=l["default"].map(e,function(e){return l["default"].map(e.values,function(e){null==o[e[i]]&&(o[e[i]]=0);var r=o[e[i]];return o[e[i]]+=e[t],r})})}():!function(){var r=0;n=l["default"].map(e,function(e){return l["default"].map(e.values,function(e){var n=r;return r+=e[t],n})})}(),function(e,t,r){return n[t][r]}}Object.defineProperty(t,"__esModule",{value:!0}),t.stackLayout=i,t.stackGroupedLayout=a;var s=r(198),u=r(9),l=n(u)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r1);var w=(0,d.calculateDomains)(u,(0,s["default"])(a).values().flatten().value(),y);return l["default"].updateIn([t.key,n],{axes:y,panes:b,domains:w,scales:(0,p.calculateScales)(w,a,r)},e);default:return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.updateChartData=o,t["default"]=i;var a=r(9),s=n(a),u=r(139),l=n(u),c=r(294),f=r(297),d=r(296),p=r(310),h="explorer/chartspec/UPDATE_CHART_DATA";t.UPDATE_CHART_DATA=h;var g={}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){for(var t=0,r=e.length;r>t;t++)e[t].index=t}function a(e,t){var r=(0,f["default"])(e).mapValues(function(e){return f["default"].groupBy(e,"algebraType")}).value(),n=(0,f["default"])(r).pick("row","col").map(function(e){return f["default"].map(e.O,"name")}).flatten().map(l["default"].$).value(),o=f["default"].isEmpty(n)?{}:(0,d.calculateNest)(t,function(e){return f["default"].map(n,function(t){return t(e)})}),a=r.row&&r.row.O?r.row.O:[],s=r.col&&r.col.O?r.col.O:[],u=f["default"].mapValues((0,d.partitionNestKey)(o,a,s),function(e,t){return e=f["default"].sortByAll(e,f["default"].times("row"==t?a.length:s.length,function(e){return e+".key"})),f["default"].isEmpty(e)?[new g]:f["default"].map(e,function(e){return new g(e)})}),c=f["default"].mapValues(u,function(e,t){var n=r[t]&&r[t].Q;return f["default"].isEmpty(n)?e:(0,f["default"])(e).map(function(e){return f["default"].map(n,function(t){return e.cross(t)})}).flatten().value()});return i(c.row),i(c.col),{axes:c,nest:o}}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;rr;r++)t.push(e(this.ordinals[r].field,r));return null!=this.field&&t.push(e(this.field,"Q")),t}},{key:"label",value:function(){return""+this.key.join(" ")+(this.field?" "+this.field.name:"")}},{key:"fieldAccessor",value:function(){return this.field?(0,h.getAccessorName)(this.field):null}},{key:"addDomainValue",value:function(e){return this.field&&null==this.domain&&(this.domain=new p.QuantitativeAggregator),null!=this.domain&&this.domain.add(e),this}},{key:"getDomain",value:function(){return null==this.domain?{}:this.domain.result()}}]),e}()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){if(0!=t.length){for(var n=0,o=t.length-1;o>n;n++)null==e[t[n]]&&(e[t[n]]={}),e=e[t[n]];e[t[n]]=r}}function i(e,t,r){if(0!=t.length){for(var n=0,o=t.length-1;o>n;n++)null==e[t[n]]&&(e[t[n]]={}),e=e[t[n]];null==e[t[n]]&&(e[t[n]]=[]),e[t[n]].push(r)}}function a(e,t){for(var r=0;rd;d++){var g=p[d];s(e[g],t,r,n+1,n=t.length?u.concat([{key:g,field:r[n-t.length]}]):u,l,c)}}function u(e,t,r){var n={row:[],col:[]},o={row:{},col:{}};return s(e,t,r,0,[],[],o,n),n}function l(e,t){for(var r=arguments.length<=2||void 0===arguments[2]?i:arguments[2],n={},o=0,a=e.length;a>o;o++)r(n,t(e[o]),o);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.partitionNestKey=u,t.calculateNest=l;var c=r(9),f=n(c)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,r,n){if(null!=t[r])e.add(t[r]),n&&e.add(n(t[r]));else{if(null==t.values)throw Error("Domain construction: Not supposed to get here: Missing key "+r+" and no values");for(var o=0,i=t.values.length;i>o;o++)e.add(t.values[o][r]),n&&e.add(n(t.values[o][r]))}}function a(e,t){for(var r=0,n=t.length;n>r;r++){var o=t[r];if(null!=o.domain){var i=o.getDomain();e[o.field.accessor].add(i.min).add(i.max)}}}function s(e){return function(t){return t+e}}function u(e,t){return function(r){return d3.time[e].offset(r,t)}}function l(e,t,r){var n={};if(null==e)return n;for(var o={},l=0,c=t.length;c>l;l++){var f=t[l];n[f.accessor]||(n[f.accessor]=new m[f.algebraType],o[f.accessor]=(0,p.isBinField)(f)?"time"!=(0,p.getFieldType)(f)||d["default"].contains(f.func,"bin")?"time"==(0,p.getFieldType)(f)?u(f.binSettings.unit.type,f.binSettings.step):s(f.binSettings.step):s(1):null)}a(n,r.row),a(n,r.col);for(var l=0,h=Object.keys(n),c=e.length,g=h.length;c>l;l++)for(var y=e[l],v=0;g>v;v++){var b=h[v];i(n[b],y,b,o[b])}return d["default"].mapValues(n,function(e){return e.result()})}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var r=0;rthis._result.max&&(this._result.max=e),this}},{key:"result",value:function(){return this._result}},{key:"flush",value:function(){return this}}]),e}();t.QuantitativeAggregator=h;var g=function(){function e(){o(this,e),this._result={}}return c(e,[{key:"add",value:function(e){return this._result[e]=!0,this}},{key:"result",value:function t(){for(var t=[],e=0,r=Object.keys(this._result),n=r.length;n>e;e++)t.push(r[e]);return t.sort()}},{key:"flush",value:function(){return this}}]),e}();t.OrdinalAggregator=g;var m={Q:h,O:g}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,r){for(var n=e,o=0,i=t.length;i>o;o++)if(n=n[t[o]],null==n)return null;for(var o=0,i=r.length;i>o;o++)if(n=n[r[o]],null==n)return null;return n}function a(e){for(var t=[],r=0,n=e.length;n>r;r++)for(var o=e[r],i=f["default"].omit(o,"values"),a=0,s=o.values.length;s>a;a++)t.push(f["default"].extend({},i,o.values[a]));return t}function s(e,t,r){for(var n={},o=0,a=e.row.length,s=e.col.length;a>o;o++)for(var u=0;s>u;u++){var l=e.row[o],c=e.col[u];if(l.acceptsValues&&c.acceptsValues)n[o]||(n[o]={}),n[o][u]=new y(l,c,r);else{var d=i(t,l.key,c.key);null!=d&&(n[o]||(n[o]={}),n[o][u]=new y(l,c,f["default"].at(r,d)))}}return n}function u(e,t,r,n){for(var o=0,i=Object.keys(e),a=i.length;a>o;o++)for(var s=i[o],u=0,l=Object.keys(e[s]),c=l.length;c>u;u++){var d=l[u];e[s][d].aggregate(t,r,n).addDomainToAxis(t,n).sort(f["default"].map(r,"accessor"))}}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var r=0;r0?(n?m["default"].groupby([n.field.accessor]):m["default"].groupby()).summarize(f["default"].map(o,function(e){return{name:e.field.accessor,ops:["sum"]}})).execute(this.markData):null;if(i)for(var a=0,s=i.length;s>a;a++)for(var u=0,l=o.length;l>u;u++){var c=o[u];c.addDomainValue(i[a]["sum_"+c.field.accessor])}if(t)for(var a=0,s=this.markData.length;s>a;a++)for(var u=0,l=o.length;l>u;u++){var c=o[u];c.addDomainValue(this.markData[a][c.field.accessor])}return this}},{key:"sort",value:function(e){return this.markData=f["default"].sortByAll(this.markData,e),this}}]),e}()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(l["default"].isEmpty(e))return null;var r=(0,l["default"])(e).values().flatten().groupBy(d.getFieldQueryType).value(),n=r.groupby,o=r.operator,a=r.aggregate,s=r.value,u=i(o,a,s);return{groupby:l["default"].map(n,l["default"].curry(d.getFieldGroupByName)(t)),summarize:u,where:[],having:[],order:[]}}function i(e,t,r){return l["default"].merge((0,l["default"])(t).groupBy("name").mapValues(function(e){return l["default"].map(e,"func")}).value(),e?{"*":l["default"].map(e,"op")}:{},{"*":["values"]},function(e,t){return l["default"].isArray(e)?e.concat(t):void 0})}function a(e,t){return null==e?null:f["default"].groupby(e.groupby).summarize(e.summarize).execute(t)}function s(e,t){var r=o(e,t),n=a(r,t);return{query:r,queryspec:e,result:n}}Object.defineProperty(t,"__esModule",{value:!0}),t.translateTableQuery=o,t.translateSummary=i,t.performQuery=a,t.requestQuery=s;var u=r(9),l=n(u),c=r(8),f=n(c),d=r(198)},function(e,t,r){function n(){this._cells={},this._aggr=[],this._stream=!1}function o(e){if(i.isArray(e))return e;if(null==e)return[];var t,r,n=[];for(t in e)r=i.array(e[t]),n.push({name:t,ops:r});return n}var i=r(300),a=r(305),s=r(309),u=n.Flags={ADD_CELL:1,MOD_CELL:2},l=n.prototype;l.stream=function(e){return null==e?this._stream:(this._stream=!!e,this._aggr=[],this)},l.key=function(e){return null==e?this._key:(this._key=i.$(e),this)},l.groupby=function(e){return this._dims=i.array(e).map(function(e,t){if(e=i.isString(e)?{name:e,get:i.$(e)}:i.isFunction(e)?{name:i.name(e)||e.name||"_"+t,get:e}:e.name&&i.isFunction(e.get)?e:null,null==e)throw"Invalid groupby argument: "+e;return e}),this.clear()},l.summarize=function(e){e=o(e),this._count=!0;var t,r,n,s,u,l,c,f=this._aggr=[];for(n=0;nt;++t)o+="|"+r[t].get(e);return o},l._cell=function(e){var t=this._dims.length?this._cellkey(e):"";return this._cells[t]||(this._cells[t]=this._newcell(e,t))},l._newcell=function(e,t){var r,n={num:0,tuple:this._newtuple(e,t),flag:u.ADD_CELL,aggs:{}},o=this._aggr;for(r=0;rt;++t)o[n[t].name]=n[t].get(e);return this._ingest(o)},l._ingest=i.identity,l._add=function(e){var t,r=this._cell(e),n=this._aggr;if(r.num+=1,!this._count)for(r.collect&&r.data.add(e),t=0;t0){for(e.collect&&e.data.values(),t=0;tr;++r)n+=t;return n}function o(e,t,r){var n=0,o=e.split(c);return e=r?(o=o.reverse()).filter(function(e){return n+=e.length,t>=n}).reverse():o.filter(function(e){return n+=e.length,t>=n}),e.length?e.join("").trim():o[0].slice(0,t)}var i=e.exports,a="__name__";i.namedfunc=function(e,t){return t[a]=e,t},i.name=function(e){return null==e?null:e[a]},i.identity=function(e){return e},i["true"]=i.namedfunc("true",function(){return!0}),i["false"]=i.namedfunc("false",function(){return!1}),i.duplicate=function(e){return JSON.parse(JSON.stringify(e))},i.equal=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},i.extend=function(e){for(var t,r,n=1,o=arguments.length;o>n;++n){t=arguments[n];for(r in t)e[r]=t[r]}return e},i.length=function(e){return null!=e&&null!=e.length?e.length:null},i.keys=function(e){var t,r=[];for(t in e)r.push(t);return r},i.vals=function(e){var t,r=[];for(t in e)r.push(e[t]);return r},i.toMap=function(e,t){return(t=i.$(t))?e.reduce(function(e,r){return e[t(r)]=1,e},{}):e.reduce(function(e,t){return e[t]=1,e},{})},i.keystr=function(e){var t=e.length;if(!t)return"";for(var r=String(e[0]),n=1;t>n;++n)r+="|"+String(e[n]);return r};var s=Object.prototype.toString;i.isObject=function(e){return e===Object(e)},i.isFunction=function(e){return"[object Function]"===s.call(e)},i.isString=function(e){return"string"==typeof value||"[object String]"===s.call(e)},i.isArray=Array.isArray||function(e){return"[object Array]"===s.call(e)},i.isNumber=function(e){return"number"==typeof e||"[object Number]"===s.call(e)},i.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"==s.call(e)},i.isDate=function(e){return"[object Date]"===s.call(e)},i.isValid=function(e){return null!=e&&e===e},i.isBuffer="function"==typeof t&&t.isBuffer||i["false"],i.number=function(e){return null==e||""===e?null:+e},i["boolean"]=function(e){return null==e||""===e?null:"false"===e?!1:!!e},i.date=function(e,t){var r=t?t:Date;return null==e||""===e?null:r.parse(e)},i.array=function(e){return null!=e?i.isArray(e)?e:[e]:[]},i.str=function(e){return i.isArray(e)?"["+e.map(i.str)+"]":i.isObject(e)?JSON.stringify(e):i.isString(e)?"'"+r(e)+"'":e};var u=/(^|[^\\])'/g,l=/\[(.*?)\]|[^.\[]+/g;i.field=function(e){return String(e).match(l).map(function(e){return"["!==e[0]?e:"'"!==e[1]&&'"'!==e[1]?e.slice(1,-1):e.slice(2,-2).replace(/\\(["'])/g,"$1")})},i.accessor=function(e){var t;return null==e||i.isFunction(e)?e:i.namedfunc(e,(t=i.field(e)).length>1?function(e){return t.reduce(function(e,t){return e[t]},e)}:function(t){return t[e]})},i.$=i.accessor,i.mutator=function(e){var t;return i.isString(e)&&(t=i.field(e)).length>1?function(e,r){for(var n=0;no;++o){if(a=e[o],s=a(r),u=a(n),u>s)return-1*t[o];if(s>u)return t[o]}return 0}},i.cmp=function(e,t){return t>e?-1:e>t?1:e>=t?0:null===e?-1:null===t?1:NaN},i.numcmp=function(e,t){return e-t},i.stablesort=function(e,t,r){var n=e.reduce(function(e,t,n){return e[r(t)]=n,e},{});return e.sort(function(e,o){var i=t(e),a=t(o);return a>i?-1:i>a?1:n[r(e)]-n[r(o)]}),e},i.pad=function(e,t,r,o){o=o||" ";var i=t-e.length;if(0>=i)return e;switch(r){case"left":return n(i,o)+e;case"middle":case"center":return n(Math.floor(i/2),o)+e+n(Math.ceil(i/2),o);default:return e+n(i,o)}},i.truncate=function(e,t,r,n,i){var a=e.length;if(t>=a)return e;i=void 0!==i?String(i):"…";var s=Math.max(0,t-i.length);switch(r){case"left":return i+(n?o(e,s,1):e.slice(a-s));case"middle":case"center":var u=Math.ceil(s/2),l=Math.floor(s/2);return(n?o(e,u):e.slice(0,u))+i+(n?o(e,l,1):e.slice(a-l));default:return(n?o(e,s):e.slice(0,s))+i}};var c=/([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/}).call(t,r(301).Buffer)},function(e,t,r){(function(e,n){function o(){function e(){}try{var t=new Uint8Array(1);return t.foo=function(){return 42},t.constructor=e,42===t.foo()&&t.constructor===e&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function i(){return e.TYPED_ARRAY_SUPPORT?2147483647:1073741823;
-}function e(t){return this instanceof e?(this.length=0,this.parent=void 0,"number"==typeof t?a(this,t):"string"==typeof t?s(this,t,arguments.length>1?arguments[1]:"utf8"):u(this,t)):arguments.length>1?new e(t,arguments[1]):new e(t)}function a(t,r){if(t=g(t,0>r?0:0|m(r)),!e.TYPED_ARRAY_SUPPORT)for(var n=0;r>n;n++)t[n]=0;return t}function s(e,t,r){("string"!=typeof r||""===r)&&(r="utf8");var n=0|v(t,r);return e=g(e,n),e.write(t,r),e}function u(t,r){if(e.isBuffer(r))return l(t,r);if(K(r))return c(t,r);if(null==r)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(r.buffer instanceof ArrayBuffer)return f(t,r);if(r instanceof ArrayBuffer)return d(t,r)}return r.length?p(t,r):h(t,r)}function l(e,t){var r=0|m(t.length);return e=g(e,r),t.copy(e,0,0,r),e}function c(e,t){var r=0|m(t.length);e=g(e,r);for(var n=0;r>n;n+=1)e[n]=255&t[n];return e}function f(e,t){var r=0|m(t.length);e=g(e,r);for(var n=0;r>n;n+=1)e[n]=255&t[n];return e}function d(t,r){return e.TYPED_ARRAY_SUPPORT?(r.byteLength,t=e._augment(new Uint8Array(r))):t=f(t,new Uint8Array(r)),t}function p(e,t){var r=0|m(t.length);e=g(e,r);for(var n=0;r>n;n+=1)e[n]=255&t[n];return e}function h(e,t){var r,n=0;"Buffer"===t.type&&K(t.data)&&(r=t.data,n=0|m(r.length)),e=g(e,n);for(var o=0;n>o;o+=1)e[o]=255&r[o];return e}function g(t,r){e.TYPED_ARRAY_SUPPORT?(t=e._augment(new Uint8Array(r)),t.__proto__=e.prototype):(t.length=r,t._isBuffer=!0);var n=0!==r&&r<=e.poolSize>>>1;return n&&(t.parent=Q),t}function m(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function y(t,r){if(!(this instanceof y))return new y(t,r);var n=new e(t,r);return delete n.parent,n}function v(e,t){"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return r;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(e).length;default:if(n)return U(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=!1;if(t=0|t,r=void 0===r||r===1/0?this.length:0|r,e||(e="utf8"),0>t&&(t=0),r>this.length&&(r=this.length),t>=r)return"";for(;;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return S(this,t,r);case"binary":return R(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function w(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;var i=t.length;if(i%2!==0)throw new Error("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;n>a;a++){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");e[r+a]=s}return a}function _(e,t,r,n){return W(U(t,e.length-r),e,r,n)}function x(e,t,r,n){return W(G(t),e,r,n)}function D(e,t,r,n){return x(e,t,r,n)}function T(e,t,r,n){return W(Y(t),e,r,n)}function O(e,t,r,n){return W(V(t,e.length-r),e,r,n)}function k(e,t,r){return 0===t&&r===e.length?X.fromByteArray(e):X.fromByteArray(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;r>o;){var i=e[o],a=null,s=i>239?4:i>223?3:i>191?2:1;if(r>=o+s){var u,l,c,f;switch(s){case 1:128>i&&(a=i);break;case 2:u=e[o+1],128===(192&u)&&(f=(31&i)<<6|63&u,f>127&&(a=f));break;case 3:u=e[o+1],l=e[o+2],128===(192&u)&&128===(192&l)&&(f=(15&i)<<12|(63&u)<<6|63&l,f>2047&&(55296>f||f>57343)&&(a=f));break;case 4:u=e[o+1],l=e[o+2],c=e[o+3],128===(192&u)&&128===(192&l)&&128===(192&c)&&(f=(15&i)<<18|(63&u)<<12|(63&l)<<6|63&c,f>65535&&1114112>f&&(a=f))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),o+=s}return E(n)}function E(e){var t=e.length;if(J>=t)return String.fromCharCode.apply(String,e);for(var r="",n=0;t>n;)r+=String.fromCharCode.apply(String,e.slice(n,n+=J));return r}function S(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;r>o;o++)n+=String.fromCharCode(127&e[o]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;r>o;o++)n+=String.fromCharCode(e[o]);return n}function M(e,t,r){var n=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>n)&&(r=n);for(var o="",i=t;r>i;i++)o+=B(e[i]);return o}function A(e,t,r){for(var n=e.slice(t,r),o="",i=0;ie)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function I(t,r,n,o,i,a){if(!e.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(r>i||a>r)throw new RangeError("value is out of bounds");if(n+o>t.length)throw new RangeError("index out of range")}function N(e,t,r,n){0>t&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-r,2);i>o;o++)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function j(e,t,r,n){0>t&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-r,4);i>o;o++)e[r+o]=t>>>8*(n?o:3-o)&255}function F(e,t,r,n,o,i){if(t>o||i>t)throw new RangeError("value is out of bounds");if(r+n>e.length)throw new RangeError("index out of range");if(0>r)throw new RangeError("index out of range")}function L(e,t,r,n,o){return o||F(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,r,n,23,4),r+4}function H(e,t,r,n,o){return o||F(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,r,n,52,8),r+8}function q(e){if(e=z(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function z(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function B(e){return 16>e?"0"+e.toString(16):e.toString(16)}function U(e,t){t=t||1/0;for(var r,n=e.length,o=null,i=[],a=0;n>a;a++){if(r=e.charCodeAt(a),r>55295&&57344>r){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(56320>r){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,128>r){if((t-=1)<0)break;i.push(r)}else if(2048>r){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(65536>r){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){for(var t=[],r=0;r>8,o=r%256,i.push(o),i.push(n);return i}function Y(e){return X.toByteArray(q(e))}function W(e,t,r,n){for(var o=0;n>o&&!(o+r>=t.length||o>=e.length);o++)t[o+r]=e[o];return o}/*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh
- * @license MIT
- */
-var X=r(302),$=r(303),K=r(304);t.Buffer=e,t.SlowBuffer=y,t.INSPECT_MAX_BYTES=50,e.poolSize=8192;var Q={};e.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:o(),e.TYPED_ARRAY_SUPPORT&&(e.prototype.__proto__=Uint8Array.prototype,e.__proto__=Uint8Array),e.isBuffer=function(e){return!(null==e||!e._isBuffer)},e.compare=function(t,r){if(!e.isBuffer(t)||!e.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,o=r.length,i=0,a=Math.min(n,o);a>i&&t[i]===r[i];)++i;return i!==a&&(n=t[i],o=r[i]),o>n?-1:n>o?1:0},e.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},e.concat=function(t,r){if(!K(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new e(0);var n;if(void 0===r)for(r=0,n=0;n0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},e.prototype.compare=function(t){if(!e.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:e.compare(this,t)},e.prototype.indexOf=function(t,r){function n(e,t,r){for(var n=-1,o=0;r+o2147483647?r=2147483647:-2147483648>r&&(r=-2147483648),r>>=0,0===this.length)return-1;if(r>=this.length)return-1;if(0>r&&(r=Math.max(this.length+r,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,r);if(e.isBuffer(t))return n(this,t,r);if("number"==typeof t)return e.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,r):n(this,[t],r);throw new TypeError("val must be string, number or Buffer")},e.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},e.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},e.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t=0|t,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0);else{var o=n;n=t,t=0|r,r=o}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(0>r||0>t)||t>this.length)throw new RangeError("attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return x(this,e,t,r);case"binary":return D(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var J=4096;e.prototype.slice=function(t,r){var n=this.length;t=~~t,r=void 0===r?n:~~r,0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),0>r?(r+=n,0>r&&(r=0)):r>n&&(r=n),t>r&&(r=t);var o;if(e.TYPED_ARRAY_SUPPORT)o=e._augment(this.subarray(t,r));else{var i=r-t;o=new e(i,void 0);for(var a=0;i>a;a++)o[a]=this[a+t]}return o.length&&(o.parent=this.parent||this),o},e.prototype.readUIntLE=function(e,t,r){e=0|e,t=0|t,r||P(e,t,this.length);for(var n=this[e],o=1,i=0;++i0&&(o*=256);)n+=this[e+--t]*o;return n},e.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},e.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},e.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},e.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},e.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},e.prototype.readIntLE=function(e,t,r){e=0|e,t=0|t,r||P(e,t,this.length);for(var n=this[e],o=1,i=0;++i=o&&(n-=Math.pow(2,8*t)),n},e.prototype.readIntBE=function(e,t,r){e=0|e,t=0|t,r||P(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},e.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},e.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},e.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},e.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},e.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),$.read(this,e,!0,23,4)},e.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),$.read(this,e,!1,23,4)},e.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),$.read(this,e,!0,52,8)},e.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),$.read(this,e,!1,52,8)},e.prototype.writeUIntLE=function(e,t,r,n){e=+e,t=0|t,r=0|r,n||I(this,e,t,r,Math.pow(2,8*r),0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+r},e.prototype.writeUInt8=function(t,r,n){return t=+t,r=0|r,n||I(this,t,r,1,255,0),e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},e.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=0|r,n||I(this,t,r,2,65535,0),e.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},e.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=0|r,n||I(this,t,r,2,65535,0),e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},e.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=0|r,n||I(this,t,r,4,4294967295,0),e.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):j(this,t,r,!0),r+4},e.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=0|r,n||I(this,t,r,4,4294967295,0),e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):j(this,t,r,!1),r+4},e.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=0|t,!n){var o=Math.pow(2,8*r-1);I(this,e,t,r,o-1,-o)}var i=0,a=1,s=0>e?1:0;for(this[t]=255&e;++i>0)-s&255;return t+r},e.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=0|t,!n){var o=Math.pow(2,8*r-1);I(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0>e?1:0;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=(e/a>>0)-s&255;return t+r},e.prototype.writeInt8=function(t,r,n){return t=+t,r=0|r,n||I(this,t,r,1,127,-128),e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[r]=255&t,r+1},e.prototype.writeInt16LE=function(t,r,n){return t=+t,r=0|r,n||I(this,t,r,2,32767,-32768),e.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},e.prototype.writeInt16BE=function(t,r,n){return t=+t,r=0|r,n||I(this,t,r,2,32767,-32768),e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},e.prototype.writeInt32LE=function(t,r,n){return t=+t,r=0|r,n||I(this,t,r,4,2147483647,-2147483648),e.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):j(this,t,r,!0),r+4},e.prototype.writeInt32BE=function(t,r,n){return t=+t,r=0|r,n||I(this,t,r,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),e.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):j(this,t,r,!1),r+4},e.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},e.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},e.prototype.writeDoubleLE=function(e,t,r){return H(this,e,t,!0,r)},e.prototype.writeDoubleBE=function(e,t,r){return H(this,e,t,!1,r)},e.prototype.copy=function(t,r,n,o){if(n||(n=0),o||0===o||(o=this.length),r>=t.length&&(r=t.length),r||(r=0),o>0&&n>o&&(o=n),o===n)return 0;if(0===t.length||0===this.length)return 0;if(0>r)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>o)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-rn&&o>r)for(i=a-1;i>=0;i--)t[i+r]=this[i+n];else if(1e3>a||!e.TYPED_ARRAY_SUPPORT)for(i=0;a>i;i++)t[i+r]=this[i+n];else t._set(this.subarray(n,n+a),r);return a},e.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),t>r)throw new RangeError("end < start");if(r!==t&&0!==this.length){if(0>t||t>=this.length)throw new RangeError("start out of bounds");if(0>r||r>this.length)throw new RangeError("end out of bounds");var n;if("number"==typeof e)for(n=t;r>n;n++)this[n]=e;else{var o=U(e.toString()),i=o.length;for(n=t;r>n;n++)this[n]=o[n%i]}return this}},e.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(e.TYPED_ARRAY_SUPPORT)return new e(this).buffer;for(var t=new Uint8Array(this.length),r=0,n=t.length;n>r;r+=1)t[r]=this[r];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var Z=e.prototype;e._augment=function(t){return t.constructor=e,t._isBuffer=!0,t._set=t.set,t.get=Z.get,t.set=Z.set,t.write=Z.write,t.toString=Z.toString,t.toLocaleString=Z.toString,t.toJSON=Z.toJSON,t.equals=Z.equals,t.compare=Z.compare,t.indexOf=Z.indexOf,t.copy=Z.copy,t.slice=Z.slice,t.readUIntLE=Z.readUIntLE,t.readUIntBE=Z.readUIntBE,t.readUInt8=Z.readUInt8,t.readUInt16LE=Z.readUInt16LE,t.readUInt16BE=Z.readUInt16BE,t.readUInt32LE=Z.readUInt32LE,t.readUInt32BE=Z.readUInt32BE,t.readIntLE=Z.readIntLE,t.readIntBE=Z.readIntBE,t.readInt8=Z.readInt8,t.readInt16LE=Z.readInt16LE,t.readInt16BE=Z.readInt16BE,t.readInt32LE=Z.readInt32LE,t.readInt32BE=Z.readInt32BE,t.readFloatLE=Z.readFloatLE,t.readFloatBE=Z.readFloatBE,t.readDoubleLE=Z.readDoubleLE,t.readDoubleBE=Z.readDoubleBE,t.writeUInt8=Z.writeUInt8,t.writeUIntLE=Z.writeUIntLE,t.writeUIntBE=Z.writeUIntBE,t.writeUInt16LE=Z.writeUInt16LE,t.writeUInt16BE=Z.writeUInt16BE,t.writeUInt32LE=Z.writeUInt32LE,t.writeUInt32BE=Z.writeUInt32BE,t.writeIntLE=Z.writeIntLE,t.writeIntBE=Z.writeIntBE,t.writeInt8=Z.writeInt8,t.writeInt16LE=Z.writeInt16LE,t.writeInt16BE=Z.writeInt16BE,t.writeInt32LE=Z.writeInt32LE,t.writeInt32BE=Z.writeInt32BE,t.writeFloatLE=Z.writeFloatLE,t.writeFloatBE=Z.writeFloatBE,t.writeDoubleLE=Z.writeDoubleLE,t.writeDoubleBE=Z.writeDoubleBE,t.fill=Z.fill,t.inspect=Z.inspect,t.toArrayBuffer=Z.toArrayBuffer,t};var ee=/[^+\/0-9A-Za-z-_]/g}).call(t,r(301).Buffer,function(){return this}())},function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===a||t===f?62:t===s||t===d?63:u>t?-1:u+10>t?t-u+26+26:c+26>t?t-c:l+26>t?t-l+26:void 0}function r(e){function r(e){l[f++]=e}var n,o,a,s,u,l;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var c=e.length;u="="===e.charAt(c-2)?2:"="===e.charAt(c-1)?1:0,l=new i(3*e.length/4-u),a=u>0?e.length-4:e.length;var f=0;for(n=0,o=0;a>n;n+=4,o+=3)s=t(e.charAt(n))<<18|t(e.charAt(n+1))<<12|t(e.charAt(n+2))<<6|t(e.charAt(n+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===u?(s=t(e.charAt(n))<<2|t(e.charAt(n+1))>>4,r(255&s)):1===u&&(s=t(e.charAt(n))<<10|t(e.charAt(n+1))<<4|t(e.charAt(n+2))>>2,r(s>>8&255),r(255&s)),l}function o(e){function t(e){return n.charAt(e)}function r(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var o,i,a,s=e.length%3,u="";for(o=0,a=e.length-s;a>o;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],u+=r(i);switch(s){case 1:i=e[e.length-1],u+=t(i>>2),u+=t(i<<4&63),u+="==";break;case 2:i=(e[e.length-2]<<8)+e[e.length-1],u+=t(i>>10),u+=t(i>>4&63),u+=t(i<<2&63),u+="="}return u}var i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),l="a".charCodeAt(0),c="A".charCodeAt(0),f="-".charCodeAt(0),d="_".charCodeAt(0);e.toByteArray=r,e.fromByteArray=o}(t)},function(e,t){t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<>1,c=-7,f=r?o-1:0,d=r?-1:1,p=e[t+f];for(f+=d,i=p&(1<<-c)-1,p>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=d,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===i)i=1-l;else{if(i===u)return a?NaN:(p?-1:1)*(1/0);a+=Math.pow(2,n),i-=l}return(p?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,l=8*i-o-1,c=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,h=n?1:-1,g=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+f>=1?d/u:d*Math.pow(2,1-f),t*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+p]=255&s,p+=h,s/=256,o-=8);for(a=a<0;e[r+p]=255&a,p+=h,a/=256,l-=8);e[r+p-h]|=128*g}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){function n(e){return function(t){var r=a.extend({init:"",add:"",rem:"",idx:0},e);return r.out=t||e.name,r}}function o(e,t){function r(e,n){function o(t){e[t]||r(e,e[t]=s[t]())}return n.req&&n.req.forEach(o),t&&n.str&&n.str.forEach(o),e}var n=e.reduce(r,e.reduce(function(e,t){return e[t.name]=t,e},{}));return a.vals(n).sort(function(e,t){return e.idx-t.idx})}function i(e,t,n,i){var s=o(e,t),u="this.cell = cell; this.tuple = t; this.valid = 0; this.missing = 0;",l="if (v==null) this.missing++; if (!this.isValid(v)) return; ++this.valid;",c="if (v==null) this.missing--; if (!this.isValid(v)) return; --this.valid;",f="var t = this.tuple; var cell = this.cell;";return s.forEach(function(e){e.idx<0?(u=e.init+u,l=e.add+l,c=e.rem+c):(u+=e.init,l+=e.add,c+=e.rem)}),e.slice().sort(function(e,t){return e.idx-t.idx}).forEach(function(e){f+="this.assign(t,'"+e.out+"',"+e.set+");"}),f+="return t;",u=Function("cell","t",u),u.prototype.assign=i,u.prototype.add=Function("t","var v = this.get(t);"+l),u.prototype.rem=Function("t","var v = this.get(t);"+c),u.prototype.set=Function(f),u.prototype.get=n,u.prototype.distinct=r(306).count.distinct,u.prototype.isValid=a.isValid,u.fields=e.map(a.$("out")),u}var a=r(300),s={values:n({name:"values",init:"cell.collect = true;",set:"cell.data.values()",idx:-1}),count:n({name:"count",set:"cell.num"}),missing:n({name:"missing",set:"this.missing"}),valid:n({name:"valid",set:"this.valid"}),sum:n({name:"sum",init:"this.sum = 0;",add:"this.sum += v;",rem:"this.sum -= v;",set:"this.sum"}),mean:n({name:"mean",init:"this.mean = 0;",add:"var d = v - this.mean; this.mean += d / this.valid;",rem:"var d = v - this.mean; this.mean -= this.valid ? d / this.valid : this.mean;",set:"this.mean"}),average:n({name:"average",set:"this.mean",req:["mean"],idx:1}),variance:n({name:"variance",init:"this.dev = 0;",add:"this.dev += d * (v - this.mean);",rem:"this.dev -= d * (v - this.mean);",set:"this.valid > 1 ? this.dev / (this.valid-1) : 0",req:["mean"],idx:1}),variancep:n({name:"variancep",set:"this.valid > 1 ? this.dev / this.valid : 0",req:["variance"],idx:2}),stdev:n({name:"stdev",set:"this.valid > 1 ? Math.sqrt(this.dev / (this.valid-1)) : 0",req:["variance"],idx:2}),stdevp:n({name:"stdevp",set:"this.valid > 1 ? Math.sqrt(this.dev / this.valid) : 0",req:["variance"],idx:2}),median:n({name:"median",set:"cell.data.q2(this.get)",req:["values"],idx:3}),q1:n({name:"q1",set:"cell.data.q1(this.get)",req:["values"],idx:3}),q3:n({name:"q3",set:"cell.data.q3(this.get)",req:["values"],idx:3}),distinct:n({name:"distinct",set:"this.distinct(cell.data.values(), this.get)",req:["values"],idx:3}),argmin:n({name:"argmin",add:"if (v < this.min) this.argmin = t;",rem:"if (v <= this.min) this.argmin = null;",set:"this.argmin = this.argmin || cell.data.argmin(this.get)",req:["min"],str:["values"],idx:3}),argmax:n({name:"argmax",add:"if (v > this.max) this.argmax = t;",rem:"if (v >= this.max) this.argmax = null;",set:"this.argmax = this.argmax || cell.data.argmax(this.get)",req:["max"],str:["values"],idx:3}),min:n({name:"min",init:"this.min = +Infinity;",add:"if (v < this.min) this.min = v;",rem:"if (v <= this.min) this.min = NaN;",set:"this.min = (isNaN(this.min) ? cell.data.min(this.get) : this.min)",str:["values"],idx:4}),max:n({name:"max",init:"this.max = -Infinity;",add:"if (v > this.max) this.max = v;",rem:"if (v >= this.max) this.max = NaN;",set:"this.max = (isNaN(this.max) ? cell.data.max(this.get) : this.max)",str:["values"],idx:4}),modeskew:n({name:"modeskew",set:"this.dev===0 ? 0 : (this.mean - cell.data.q2(this.get)) / Math.sqrt(this.dev/(this.valid-1))",req:["mean","stdev","median"],idx:5})};s.create=i,e.exports=s},function(e,t,r){function n(e,t,r){var n=e&&e.nullh||0,o=u.random.normal(0,1),i=l.mean(t,r),a=l.stdev(t,r)/Math.sqrt(l.count.valid(t,r));if(0===a)return i-n===0?1:0;var s=(i-n)/a;return 2*o.cdf(-Math.abs(s))}function o(e,t,r,n){var o,i=n?t.map(a.$(r)):t,s=n?t.map(a.$(n)):r,u=l.count(i),c=l.count(s),f=Array();if(u!==c)throw Error("Array lengths must match.");for(o=0;u>o;++o)a.isValid(i[o])&&a.isValid(s[o])&&f.push(i[o]-s[o]);return l.z.test(f,e&&e.nullh||0)}function i(e,t,r,n){var o=n?t.map(a.$(r)):t,i=n?t.map(a.$(n)):r,s=l.count.valid(o),c=l.count.valid(i),f=u.random.normal(0,1),d=l.mean(o)-l.mean(i)-(e&&e.nullh||0),p=Math.sqrt(l.variance(o)/s+l.variance(i)/c);if(0===p)return 0===d?1:0;var h=d/p;return 2*f.cdf(-Math.abs(h))}var a=r(300),s=r(307),u=r(308),l=e.exports;l.unique=function(e,t,r){t=a.$(t),r=r||[];var n,o,i,s={};for(o=0,i=e.length;i>o;++o)n=t?t(e[o]):e[o],n in s||(s[n]=1,r.push(n));return r},l.count=function(e){return e&&e.length||0},l.count.valid=function(e,t){t=a.$(t);var r,n,o,i=0;for(n=0,o=e.length;o>n;++n)r=t?t(e[n]):e[n],a.isValid(r)&&(i+=1);return i},l.count.missing=function(e,t){t=a.$(t);var r,n,o,i=0;for(n=0,o=e.length;o>n;++n)r=t?t(e[n]):e[n],null==r&&(i+=1);return i},l.count.distinct=function(e,t){t=a.$(t);var r,n,o,i={},s=0;for(n=0,o=e.length;o>n;++n)r=t?t(e[n]):e[n],r in i||(i[r]=1,s+=1);return s},l.count.map=function(e,t){t=a.$(t);var r,n,o,i={};for(n=0,o=e.length;o>n;++n)r=t?t(e[n]):e[n],i[r]=r in i?i[r]+1:1;return i},l.median=function(e,t){return t&&(e=e.map(a.$(t))),e=e.filter(a.isValid).sort(a.cmp),l.quantile(e,.5)},l.quartile=function(e,t){t&&(e=e.map(a.$(t))),e=e.filter(a.isValid).sort(a.cmp);var r=l.quantile;return[r(e,.25),r(e,.5),r(e,.75)]},l.quantile=function(e,t,r){void 0===r&&(r=t,t=a.identity),t=a.$(t);var n=(e.length-1)*r+1,o=Math.floor(n),i=+t(e[o-1]),s=n-o;return s?i+s*(t(e[o])-i):i},l.sum=function(e,t){t=a.$(t);for(var r,n=0,o=0,i=e.length;i>o;++o)r=t?t(e[o]):e[o],a.isValid(r)&&(n+=r);return n},l.mean=function(e,t){t=a.$(t);var r,n,o,i,s,u=0;for(n=0,i=0,o=e.length;o>n;++n)s=t?t(e[n]):e[n],a.isValid(s)&&(r=s-u,u+=r/++i);return u},l.variance=function(e,t){if(t=a.$(t),!a.isArray(e)||e.length<2)return 0;var r,n,o,i,s=0,u=0;for(n=0,o=0;ni;++i)if(o=t?t(e[i]):e[i],a.isValid(o)){r=n=o;break}for(;s>i;++i)o=t?t(e[i]):e[i],a.isValid(o)&&(r>o&&(r=o),o>n&&(n=o));return[r,n]},l.extent.index=function(e,t){t=a.$(t);var r,n,o,i,s=-1,u=-1,l=e.length;for(i=0;l>i;++i)if(o=t?t(e[i]):e[i],a.isValid(o)){r=n=o,s=u=i;break}for(;l>i;++i)o=t?t(e[i]):e[i],a.isValid(o)&&(r>o&&(r=o,s=i),o>n&&(n=o,u=i));return[s,u]},l.dot=function(e,t,r){var n,o,i=0;if(r)for(t=a.$(t),r=a.$(r),n=0;ni;++i)o=s?t(u[i])-r(l[i]):u[i]-l[i],p+=f?o*o:Math.pow(Math.abs(o),c);return f?Math.sqrt(p):Math.pow(p,1/c)},l.cohensd=function(e,t,r){var n=r?e.map(a.$(t)):e,o=r?e.map(a.$(r)):t,i=l.mean(n),s=l.mean(o),u=l.count.valid(n),c=l.count.valid(o);if(0>=u+c-2)return 0;var f=l.variance(n),d=l.variance(o),p=Math.sqrt(((u-1)*f+(c-1)*d)/(u+c-2));return 0===p?0:(i-s)/p},l.covariance=function(e,t,r){var n,o,i,s,u,c=r?e.map(a.$(t)):e,f=r?e.map(a.$(r)):t,d=c.length,p=l.mean(c),h=l.mean(f),g=0,m=0;if(d!==f.length)throw Error("Input lengths must match.");for(n=0;d>n;++n)if(o=c[n],s=a.isValid(o),i=f[n],u=a.isValid(i),s&&u)g+=(o-p)*(i-h),++m;else if(s||u)throw Error("Valid values must align.");return g/(m-1)},l.rank=function(e,t){t=a.$(t)||a.identity;var r,n,o,i=e.map(function(e,r){return{idx:r,val:t(e)}}).sort(a.comparator("val")),s=e.length,u=Array(s),l=-1,c={};for(r=0;s>r;++r){if(n=i[r].val,0>l&&c===n)l=r-1;else if(l>-1&&c!==n){for(o=1+(r-1+l)/2;r>l;++l)u[i[l].idx]=o;l=-1}u[i[r].idx]=r+1,c=n}if(l>-1)for(o=1+(s-1+l)/2;s>l;++l)u[i[l].idx]=o;return u},l.cor=function(e,t,r){var n=r;r=n?e.map(a.$(r)):t,t=n?e.map(a.$(t)):e;var o=l.dot(t,r),i=l.mean(t),s=l.mean(r),u=l.stdev(t),c=l.stdev(r),f=e.length;return(o-f*i*s)/((f-1)*u*c)},l.cor.rank=function(e,t,r){var n,o,i,a=r?l.rank(e,t):l.rank(e),s=r?l.rank(e,r):l.rank(t),u=e.length;for(n=0,o=0;u>n;++n)i=a[n]-s[n],o+=i*i;return 1-6*o/(u*(u*u-1))},l.cor.dist=function(e,t,r){var n,o,i,s,u=r?e.map(a.$(t)):e,c=r?e.map(a.$(r)):t,f=l.dist.mat(u),d=l.dist.mat(c),p=f.length;for(n=0,o=0,i=0,s=0;p>n;++n)o+=f[n]*f[n],i+=d[n]*d[n],s+=f[n]*d[n];return Math.sqrt(s/Math.sqrt(o*i))},l.linearRegression=function(e,t,r){var n,o,i=r?e.map(a.$(t)):e,s=r?e.map(a.$(r)):t,u=i.length,c=l.covariance(i,s),f=l.stdev(i),d=l.stdev(s),p=c/(f*f),h=l.mean(s)-p*l.mean(i),g={slope:p,intercept:h,R:c/(f*d),rss:0};for(o=0;u>o;++o)a.isValid(i[o])&&a.isValid(s[o])&&(n=p*i[o]+h-s[o],g.rss+=n*n);return g},l.bootstrap={},l.bootstrap.ci=function(e,t,r,n,o){var i,s,c,f,d,p,h;for(a.isFunction(t)||a.isString(t)?(i=e.map(a.$(t)),s=r,c=n,f=o):(i=e,s=t,c=r,f=n),s=s?+s:1e3,c=c||.05,d=u.random.bootstrap(i,f),h=0,p=Array(s);s>h;++h)p[h]=l.mean(d.samples(i.length));return p.sort(a.numcmp),[l.quantile(p,c/2),l.quantile(p,1-c/2)]},l.z={},l.z.ci=function(e,t,r){var n=e,o=t;(a.isFunction(t)||a.isString(t))&&(n=e.map(a.$(t)),o=r),o=o||.05;var i=.05===o?1.96:u.random.normal(0,1).icdf(1-o/2),s=l.mean(n),c=l.stdev(n)/Math.sqrt(l.count.valid(n));return[s-i*c,s+i*c]},l.z.test=function(e,t,r,s){return a.isFunction(r)||a.isString(r)?(s&&s.paired?o:i)(s,e,t,r):a.isArray(t)?(r&&r.paired?o:i)(r,e,t):a.isFunction(t)||a.isString(t)?n(r,e,t):n(t,e)},l.dist.mat=function(e){var t,r,n,o=e.length,i=o*o,a=Array(i),s=u.zeros(o),l=0;for(r=0;o>r;++r)for(a[r*o+r]=0,n=r+1;o>n;++n)a[r*o+n]=t=Math.abs(e[r]-e[n]),a[n*o+r]=t,s[r]+=t,s[n]+=t;for(r=0;o>r;++r)l+=s[r],s[r]/=o;for(l/=i,r=0;o>r;++r)for(n=r;o>n;++n)a[r*o+n]+=l-s[r]-s[n],a[n*o+r]=a[r*o+n];return a},l.entropy=function(e,t){t=a.$(t);var r,n,o=0,i=0,s=e.length;for(r=0;s>r;++r)o+=t?t(e[r]):e[r];if(0===o)return 0;for(r=0;s>r;++r)n=(t?t(e[r]):e[r])/o,n&&(i+=n*Math.log(n));return-i/Math.LN2},l.mutual=function(e,t,r,n){var o,i,s,u=n?e.map(a.$(t)):e,l=n?e.map(a.$(r)):t,c=n?e.map(a.$(n)):r,f={},d={},p=c.length,h=0,g=0,m=0;for(s=0;p>s;++s)f[u[s]]=0,d[l[s]]=0;for(s=0;p>s;++s)f[u[s]]+=c[s],d[l[s]]+=c[s],h+=c[s];for(i=1/(h*Math.LN2),s=0;p>s;++s)0!==c[s]&&(o=h*c[s]/(f[u[s]]*d[l[s]]),g+=c[s]*i*Math.log(o),m+=c[s]*i*Math.log(c[s]/h));return[g,1+g/m]},l.mutual.info=function(e,t,r,n){return l.mutual(e,t,r,n)[0]},l.mutual.dist=function(e,t,r,n){return l.mutual(e,t,r,n)[1]},l.profile=function(e,t){var r,n,o,i,u,c=0,f=0,d=0,p=0,h=null,g=null,m=0,y=[],v={};for(o=0;ou)&&(h=u),(null===g||u>g)&&(g=u),r=u-c,c+=r/++f,m+=r*(u-c),y.push(u));return m/=f-1,n=Math.sqrt(m),y.sort(a.cmp),{type:s(e,t),unique:v,count:e.length,valid:f,missing:d,distinct:p,min:h,max:g,mean:c,stdev:n,median:i=l.quantile(y,.5),q1:l.quantile(y,.25),q3:l.quantile(y,.75),modeskew:0===n?0:(c-i)/n}},l.summary=function(e,t){t=t||a.keys(e[0]);var r=t.map(function(t){var r=l.profile(e,a.$(t));return r.field=t,r});return r.__summary__=!0,r}},function(e,t,r){function n(e,t){return t?void(e[l]=t):e&&e[l]||null}function o(e,t){e=u.array(e),t=u.$(t);var r,n,o;if(e[l]&&(r=t(e[l]),u.isString(r)))return r;for(n=0,o=e.length;!u.isValid(r)&&o>n;++n)r=t?t(e[n]):e[n];return u.isDate(r)?"date":u.isNumber(r)?"number":u.isBoolean(r)?"boolean":u.isString(r)?"string":null}function i(e,t){return e.length?(t=t||u.keys(e[0]),t.reduce(function(t,r){return t[r]=o(e,r),t},{})):void 0}function a(e,t){e=u.array(e),t=u.$(t);var r,n,o,i=["boolean","integer","number","date"];for(r=0;rr;++r)n[r]=e;return n},o.zeros=function(e){return o.repeat(0,e)},o.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r==1/0)throw new Error("Infinite range");var n,o=[],i=-1;if(0>r)for(;(n=e+r*++i)>t;)o.push(n);else for(;(n=e+r*++i)=e&&t>=n?1/r:0},n.cdf=function(n){return e>n?0:n>t?1:(n-e)/r},n.icdf=function(t){return t>=0&&1>=t?e+t*r:NaN},n},o.random.integer=function(e,t){void 0===t&&(t=e,e=0);var r=t-e,n=function(){return e+Math.floor(r*Math.random())};return n.samples=function(e){return o.zeros(e).map(n)},n.pdf=function(n){return n===Math.floor(n)&&n>=e&&t>n?1/r:0},n.cdf=function(n){var o=Math.floor(n);return e>o?0:o>=t?1:(o-e+1)/r},n.icdf=function(t){return t>=0&&1>=t?e-1+Math.floor(t*r):NaN},n},o.random.normal=function(e,t){e=e||0,t=t||1;var r,n=function(){var n,o,i=0,a=0;if(void 0!==r)return i=r,r=void 0,i;do i=2*Math.random()-1,a=2*Math.random()-1,n=i*i+a*a;while(0===n||n>1);return o=Math.sqrt(-2*Math.log(n)/n),r=e+a*o*t,e+i*o*t};return n.samples=function(e){return o.zeros(e).map(n)},n.pdf=function(r){var n=Math.exp(Math.pow(r-e,2)/(-2*Math.pow(t,2)));return 1/(t*Math.sqrt(2*Math.PI))*n},n.cdf=function(r){var n,o=(r-e)/t,i=Math.abs(o);if(i>37)n=0;else{var a,s=Math.exp(-i*i/2);7.07106781186547>i?(a=.0352624965998911*i+.700383064443688,a=a*i+6.37396220353165,a=a*i+33.912866078383,a=a*i+112.079291497871,a=a*i+221.213596169931,a=a*i+220.206867912376,n=s*a,a=.0883883476483184*i+1.75566716318264,a=a*i+16.064177579207,a=a*i+86.7807322029461,a=a*i+296.564248779674,a=a*i+637.333633378831,a=a*i+793.826512519948,a=a*i+440.413735824752,n/=a):(a=i+.65,a=i+4/a,a=i+3/a,a=i+2/a,a=i+1/a,n=s/a/2.506628274631)}return o>0?1-n:n},n.icdf=function(r){if(0>=r||r>=1)return NaN;var n=2*r-1,o=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),i=2/(Math.PI*o)+Math.log(1-Math.pow(n,2))/2,a=Math.log(1-n*n)/o,s=(n>0?1:-1)*Math.sqrt(Math.sqrt(i*i-a)-i);return e+t*Math.SQRT2*s},n},o.random.bootstrap=function(e,t){var r=e.filter(n.isValid),i=r.length,a=t?o.random.normal(0,t):null,s=function(){return r[~~(Math.random()*i)]+(a?a():0)};return s.samples=function(e){return o.zeros(e).map(s)},s}},function(e,t,r){function n(e){this._add=[],this._rem=[],this._key=e||null,this._last=null}var o=r(300),i=r(306),a="__dl_rem__",s=n.prototype;s.add=function(e){this._add.push(e)},s.rem=function(e){this._rem.push(e)},s.values=function(){if(this._get=null,0===this._rem.length)return this._add;var e,t,r,n,s=this._add,u=this._rem,l=this._key,c=Array(s.length-u.length);if(o.isObject(u[0]))if(l)for(n=o.toMap(u,l),e=0,t=0,r=s.length;r>e;++e)n.hasOwnProperty(l(s[e]))||(c[t++]=s[e]);else{for(e=0,r=u.length;r>e;++e)u[e][a]=1;for(e=0,t=0,r=s.length;r>e;++e)s[e][a]||(c[t++]=s[e]);for(e=0,r=u.length;r>e;++e)delete u[e][a]}else for(n=i.count.map(u),e=0,t=0,r=s.length;r>e;++e)n[s[e]]>0?n[s[e]]-=1:c[t++]=s[e];return this._rem=[],this._add=c},s.extent=function(e){if(this._get!==e||!this._ext){var t=this.values(),r=i.extent.index(t,e);this._ext=[t[r[0]],t[r[1]]],this._get=e}return this._ext},s.argmin=function(e){return this.extent(e)[0]},s.argmax=function(e){return this.extent(e)[1]},s.min=function(e){var t=this.extent(e)[0];return null!=t?e(t):+(1/0)},s.max=function(e){var t=this.extent(e)[1];return null!=t?e(t):-(1/0)},s.quartile=function(e){return this._get===e&&this._q||(this._q=i.quartile(this.values(),e),this._get=e),this._q},s.q1=function(e){return this.quartile(e)[0]},s.q2=function(e){return this.quartile(e)[1]},s.q3=function(e){return this.quartile(e)[2]},e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){switch(e){case"color":return h.COLOR_PALETTES[t.palette];case"shape":case"size":case"opacity":return t.ordinalRange;default:return[]}}function i(e,t){return[t.scaleRangeMin,t.scaleRangeMax]}function a(e,t){var r=t?Math.min(0,e.min):e.min,n=t?Math.max(0,e.max):e.max,o=(n-r)/25;return t||(r=+r-o),n=+n+o,{type:"linear",domain:[r,n]}}function s(e,t,r,n){var a="O"==e?"ordinal":n.scale?n.scale:"linear",s="O"==e?o:i,u="O"==e?f["default"].identity:function(e){return[e.min,e.max]};return{type:a,domain:u(r),range:s(t,n)}}function u(e,t,r){var n=p.TABLE_ENCODINGS[r.table.type].properties,o=(0,f["default"])(t).pick(["row","col"]).mapValues(function(t,r){return f["default"].reduce(t,function(t,r){if("Q"==r.algebraType){var n=(0,d.getAccessorName)(r),o=(0,d.isAggregateType)(r);t[n]=a(e[n],o),"time"==(0,d.getFieldType)(r)&&f["default"].contains(r.func,"bin")&&(t[n].type="time")}return t},{})}).value();return f["default"].extend(o,(0,f["default"])(t).pick(n).mapValues(function(t,n){return f["default"].reduce(t,function(t,o){var i=(0,d.getAccessorName)(o);return t[i]=s(o.algebraType,n,e[i],r.properties[n]),t},{})}).value()),f["default"].extend({},f["default"].mapValues(f["default"].pick(r.properties,n),function(e){return{__default__:e}}),o)}Object.defineProperty(t,"__esModule",{value:!0}),t.calculateScales=u;var l=r(7),c=(n(l),r(9)),f=n(c),d=r(198),p=r(199),h=r(214)},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{
-value:!0});var i=r(9),a=o(i),s=r(197),u=n(s),l=r(200),c=n(l),f=(r(138),r(292)),d=a["default"].values(u),p=function(e){var t=(e.dispatch,e.getState);return function(e){return function(r){console.group(r.type);var n=e(r),o=a["default"].contains(d,r.type)||c.SET_TABLE_ENCODING==r.type||c.SET_PROPERTY_SETTING==r.type;return o&&(n=e((0,f.runCurrentQueryIfNecessary)())),console.log("next state",t()),console.groupEnd(r.type),n}}};t["default"]=p,e.exports=t["default"]},function(e,t,r){var n;(function(e,o,i){/*!
- * @overview es6-promise - a tiny implementation of Promises/A+.
- * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
- * @license Licensed under MIT license
- * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
- * @version 3.0.2
- */
-(function(){"use strict";function a(e){return"function"==typeof e||"object"==typeof e&&null!==e}function s(e){return"function"==typeof e}function u(e){return"object"==typeof e&&null!==e}function l(e){W=e}function c(e){Q=e}function f(){return function(){e.nextTick(m)}}function d(){return function(){Y(m)}}function p(){var e=0,t=new ee(m),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function h(){var e=new MessageChannel;return e.port1.onmessage=m,function(){e.port2.postMessage(0)}}function g(){return function(){setTimeout(m,1)}}function m(){for(var e=0;K>e;e+=2){var t=ne[e],r=ne[e+1];t(r),ne[e]=void 0,ne[e+1]=void 0}K=0}function y(){try{var e=r(314);return Y=e.runOnLoop||e.runOnContext,d()}catch(t){return g()}}function v(){}function b(){return new TypeError("You cannot resolve a promise with itself")}function w(){return new TypeError("A promises callback cannot return that same promise.")}function _(e){try{return e.then}catch(t){return se.error=t,se}}function x(e,t,r,n){try{e.call(t,r,n)}catch(o){return o}}function D(e,t,r){Q(function(e){var n=!1,o=x(r,t,function(r){n||(n=!0,t!==r?k(e,r):E(e,r))},function(t){n||(n=!0,S(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,S(e,o))},e)}function T(e,t){t._state===ie?E(e,t._result):t._state===ae?S(e,t._result):R(t,void 0,function(t){k(e,t)},function(t){S(e,t)})}function O(e,t){if(t.constructor===e.constructor)T(e,t);else{var r=_(t);r===se?S(e,se.error):void 0===r?E(e,t):s(r)?D(e,t,r):E(e,t)}}function k(e,t){e===t?S(e,b()):a(t)?O(e,t):E(e,t)}function C(e){e._onerror&&e._onerror(e._result),M(e)}function E(e,t){e._state===oe&&(e._result=t,e._state=ie,0!==e._subscribers.length&&Q(M,e))}function S(e,t){e._state===oe&&(e._state=ae,e._result=t,Q(C,e))}function R(e,t,r,n){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ie]=r,o[i+ae]=n,0===i&&e._state&&Q(M,e)}function M(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n,o,i=e._result,a=0;aa;a++)R(n.resolve(e[a]),void 0,t,r);return o}function H(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(v);return k(r,e),r}function q(e){var t=this,r=new t(v);return S(r,e),r}function z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function B(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(e){this._id=he++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==e&&(s(e)||z(),this instanceof U||B(),N(this,e))}function G(){var e;if("undefined"!=typeof o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=e.Promise;(!r||"[object Promise]"!==Object.prototype.toString.call(r.resolve())||r.cast)&&(e.Promise=ge)}var V;V=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var Y,W,X,$=V,K=0,Q=({}.toString,function(e,t){ne[K]=e,ne[K+1]=t,K+=2,2===K&&(W?W(m):X())}),J="undefined"!=typeof window?window:void 0,Z=J||{},ee=Z.MutationObserver||Z.WebKitMutationObserver,te="undefined"!=typeof e&&"[object process]"==={}.toString.call(e),re="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ne=new Array(1e3);X=te?f():ee?p():re?h():void 0===J?y():g();var oe=void 0,ie=1,ae=2,se=new A,ue=new A;j.prototype._validateInput=function(e){return $(e)},j.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},j.prototype._init=function(){this._result=new Array(this.length)};var le=j;j.prototype._enumerate=function(){for(var e=this,t=e.length,r=e.promise,n=e._input,o=0;r._state===oe&&t>o;o++)e._eachEntry(n[o],o)},j.prototype._eachEntry=function(e,t){var r=this,n=r._instanceConstructor;u(e)?e.constructor===n&&e._state!==oe?(e._onerror=null,r._settledAt(e._state,t,e._result)):r._willSettleAt(n.resolve(e),t):(r._remaining--,r._result[t]=e)},j.prototype._settledAt=function(e,t,r){var n=this,o=n.promise;o._state===oe&&(n._remaining--,e===ae?S(o,r):n._result[t]=r),0===n._remaining&&E(o,n._result)},j.prototype._willSettleAt=function(e,t){var r=this;R(e,void 0,function(e){r._settledAt(ie,t,e)},function(e){r._settledAt(ae,t,e)})};var ce=F,fe=L,de=H,pe=q,he=0,ge=U;U.all=ce,U.race=fe,U.resolve=de,U.reject=pe,U._setScheduler=l,U._setAsap=c,U._asap=Q,U.prototype={constructor:U,then:function(e,t){var r=this,n=r._state;if(n===ie&&!e||n===ae&&!t)return this;var o=new this.constructor(v),i=r._result;if(n){var a=arguments[n-1];Q(function(){I(n,o,a,i)})}else R(r,o,e,t);return o},"catch":function(e){return this.then(null,e)}};var me=G,ye={Promise:ge,polyfill:me};r(315).amd?(n=function(){return ye}.call(t,r,t,i),!(void 0!==n&&(i.exports=n))):"undefined"!=typeof i&&i.exports?i.exports=ye:"undefined"!=typeof this&&(this.ES6Promise=ye),me()}).call(this)}).call(t,r(15),function(){return this}(),r(313)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}}]);
\ No newline at end of file
diff --git a/public/js/nba-shot-chart-vega.min.js b/public/js/nba-shot-chart-vega.min.js
deleted file mode 100644
index 52da17a..0000000
--- a/public/js/nba-shot-chart-vega.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){function t(r){if(a[r])return a[r].exports;var n=a[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var a={};return t.m=e,t.c=a,t.p="",t(0)}({0:function(e,t,a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e){l.data("table").remove(function(){return!0}).insert(e),l.update({duration:300,ease:"quad-in-out"}),console.log(l.toImageURL("png"))}function s(e){var t=e.target.value;y[t]?n(y[t]):d["default"].json(t,function(e,a){if(e)return console.warn(e);var r=a.resultSets[0].headers,s=a.resultSets[0].rowSet.map(function(e){var t=r.reduce(function(t,a,r){return t[a]=e[r],t},{});return t.shot_id=t.GAME_ID+"_"+t.GAME_EVENT_ID,t});y[t]=s,n(y[t])})}var l,i=a(5),o=r(i),c=a(6),u=r(c),p=a(7),d=r(p),f=a(326),h=r(f),m=a(320),y={},x=[{name:"James Harden (2014-2015)",url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/5c74a5dcd7b257faa985f28c932a684ed4cea065/james-harden-shotchartdetail.json",dash_url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/f6d6496474af6dfba0b73f36dbd0e00ce0fc2f42/james-harden-2014-2015-player-dash.json"},{name:"Stephen Curry (2014-2015)",url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/d159840109c00928f515bf0ed496f4f487b326ba/stephen-curry-shotchartdetail.json"},{name:"Kobe Bryant (2007-2008)",url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/0fbd65f9f795a5fba8c8ccefce060fd3082264fb/kobe-2007-2008-shot-chart.json"},{name:"Kobe Bryant (2009-2010)",url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/a19ec840d7d67c388fc3f2eea3d51c9b7cdcf4b0/kobe-2009-2010-shot-chart.json"},{name:"Lebron James (2009-2010)",url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/0fbd65f9f795a5fba8c8ccefce060fd3082264fb/lebron-james-2009-2010-shot-chart.json"},{name:"Lebron James (2010-2011)",url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/0fbd65f9f795a5fba8c8ccefce060fd3082264fb/lebron-james-2010-2011-shot-chart.json"},{name:"Lebron James (2011-2012)",url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/d53dbb96502622b9509880fb671cf50846130636/lebron-james-2011-2012-shot-chart.json"},{name:"Lebron James (2012-2013)",url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/d53dbb96502622b9509880fb671cf50846130636/lebron-james-2012-2013-shot-chart.json"},{name:"Kevin Durant (2013-2014)",url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/d53dbb96502622b9509880fb671cf50846130636/kevin-durant-2013-2014-shot-chart.json"}];h["default"].parse.spec(m.ShotChartSpec,function(e){l=e({el:"#shot-chart"}),l.onSignal("minchartX",function(e,t){return console.log(e,t)}),l.onSignal("maxchartX",function(e,t){return console.log(e,t)}),s({target:{value:x[0].url}})}),u["default"].render(o["default"].createElement("select",{onChange:s},x.map(function(e){return o["default"].createElement("option",{key:e.url,value:e.url},e.name)})),document.getElementById("shot-chart-player-select"))},5:function(e,t){e.exports=React},6:function(e,t){e.exports=ReactDOM},7:function(e,t){e.exports=d3},320:function(e,t,a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){return{name:e,source:"table",transform:[{type:"aggregate",groupby:{field:"bin_"+t},summarize:n({},t,["count"])}]}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var a=0;a=l-s?"0":"1";return["M",i.x,i.y,"A",r,n,0,c,0,o.x,o.y].join(" ")}Object.defineProperty(t,"__esModule",{value:!0}),t.describeArc=r},322:function(e,t){"use strict";function a(e,t,a,r,n,s,l){return[{name:t+"Start",init:-1,streams:[{type:"@"+e+":mousedown, @"+e+":touchstart",expr:a+"(scope)",scale:{scope:"scope",name:n,invert:!0}}]},{name:t+"End",init:-1,streams:[{type:"@"+e+":mousedown, @"+e+":touchstart, [@"+e+":mousedown, window:mouseup] > window:mousemove, [@"+e+":touchstart, window:touchend] > window:touchmove",expr:"clamp("+a+"(scope), 0, scope."+r+")",scale:{scope:"scope",name:n,invert:!0}}]},{name:"min"+t,expr:"max(min("+t+"Start, "+t+"End), "+s+")"},{name:"max"+t,expr:"min(max("+t+"Start, "+t+"End), "+l+")"}]}function r(e,t){return[{name:e+"Equal",type:"==",operands:[{signal:e+"Start"},{signal:e+"End"}]},{name:e+"Range",type:"in",item:{arg:t},range:[{signal:e+"Start"},{signal:e+"End"}]},{name:e+"Brush",type:"or",operands:[{predicate:e+"Equal"},{predicate:e+"Range"}]}]}function n(){for(var e=arguments.length,t=Array(e),a=0;e>a;a++)t[a]=arguments[a];return t.map(function(e){var t=l(e,2),a=t[0],r=t[1];return"(min"+r+" == max"+r+" || (datum."+a+" >= min"+r+" && datum."+a+" <= max"+r+"))"}).join(" && ")}function s(e){return function(t){return n.apply(null,e.filter(function(e){return e[0]!==t}))}}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){var a=[],r=!0,n=!1,s=void 0;try{for(var l,i=e[Symbol.iterator]();!(r=(l=i.next()).done)&&(a.push(l.value),!t||a.length!==t);r=!0);}catch(o){n=!0,s=o}finally{try{!r&&i["return"]&&i["return"]()}finally{if(n)throw s}}return a}return function(t,a){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=[{name:"scope",init:{width:0},streams:[{type:"mousedown, touchstart",expr:"eventGroup()"}]}].concat(a("distGroup","dist","eventX","width","x",0,50)).concat(a("timepassedGroup","timepassed","eventX","width","x",0,64)).concat(a("xLocGroup","xLoc","eventX","width","x",-250,250)).concat(a("yLocGroup","yLoc","eventY","height","y",-47.5,500)).concat(a("shotChart","chartX","eventX","width","x",-250,250)).concat(a("shotChart","chartY","eventY","height","y",-47.5,500)),o=r("dist","x").concat(r("timepassed","x")).concat(r("xLoc","x")).concat(r("yLoc","y")).concat(r("chartX","x")).concat(r("chartY","y")).concat([{name:"chartEqual",type:"&&",operands:[{predicate:"chartXEqual"},{predicate:"chartYEqual"}]},{name:"chartInRange",type:"&&",operands:[{predicate:"chartXRange"},{predicate:"chartYRange"}]},{name:"chartBrush",type:"or",operands:[{predicate:"chartEqual"},{predicate:"chartInRange"}]}]),c={brush:"(minchartX == maxchartX || (datum.LOC_X >= minchartX && datum.LOC_X <= maxchartX)) && (minchartY == maxchartY || (datum.LOC_Y >= minchartY && datum.LOC_Y <= maxchartY))"},u=s([["LOC_X","xLoc"],["LOC_Y","yLoc"],["hoopdistance","dist"],["timepassed","timepassed"]]);t.ShotChartInteractionSignals=i,t.ShotChartInteractionPredicates=o,t.ShotChartInteractionFilters=c,t.filterExclude=u},323:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={type:"group",properties:{update:{x:{value:0},y:{value:2.5},width:{value:500},height:{value:50}}},scales:[{name:"xfgp",type:"linear",range:[250,350],domain:[0,1]},{name:"xppa",type:"linear",range:[375,475],domain:[0,3]}],marks:[{type:"rect",from:{data:"rects"},properties:{update:{width:{field:"width"},height:{field:"height"},x:{field:"x"},fill:{value:{id:"rgb",x1:0,y1:0,x2:1,y2:0,stops:[{color:"#e6550d",offset:0},{color:"#31a354",offset:.5},{color:"#31a354",offset:1}]}}}}},{from:{data:"rects"},type:"text",properties:{enter:{x:{field:"x"},y:{value:-5},text:{field:"text"},fill:{value:"black"},fontSize:{value:14},fontWeight:{value:"bold"}}}},{from:{data:"percentages"},type:"text",properties:{update:{x:{value:0},dx:{value:0},y:{value:25},text:{template:"{{datum.count | number:','}}"},fill:{value:"black"},fontSize:{value:30}}}},{from:{data:"percentages"},type:"text",properties:{update:{x:{value:125},dx:{value:0},y:{value:25},text:{template:"{{datum.sum_MADE_POINTS | number:','}}"},fill:{value:"black"},fontSize:{value:30}}}},{from:{data:"percentages"},type:"text",properties:{update:{x:{value:250},dx:{value:10},y:{value:45},text:{template:"{{datum.FGP | number:'.1%'}}"},fill:{value:"black"},fontSize:{value:30}}}},{from:{data:"percentages"},type:"text",properties:{update:{x:{value:375},dx:{value:10},y:{value:45},text:{template:"{{datum.PPA | number:'.2f'}}"},fill:{value:"black"},fontSize:{value:30}}}},{from:{data:"percentages"},type:"symbol",properties:{update:{shape:{value:"triangle-up"},x:{scale:"xfgp",field:"FGP"},y:{value:15},size:{value:40},fill:{value:"black"}}}},{from:{data:"percentages"},type:"symbol",properties:{update:{shape:{value:"triangle-up"},x:{scale:"xppa",field:"PPA"},y:{value:15},size:{value:40},fill:{value:"black"}}}}]};t.ShotAggregates=a},324:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(322),n={name:"shotChart",type:"group",properties:{update:{x:{value:0},y:{value:150},width:{value:450},height:{value:1.1*450}}},scales:[{name:"width",type:"linear",range:"width",domain:[0,500]},{name:"height",type:"linear",range:"height",domain:[0,550]},{name:"x",type:"linear",range:"width",domain:[-250,250]},{name:"y",type:"linear",range:"height",reverse:!0,domain:[-50,500]}],marks:[{type:"symbol",from:{data:"table",transform:[{type:"filter",test:""+(0,r.filterExclude)()}]},key:"shot_id",properties:{enter:{shape:{scale:"playerSymbol",field:"PLAYER_NAME"},x:{scale:"x",value:0},y:{scale:"y",value:0},fill:{scale:"makeColor",field:"EVENT_TYPE"},size:{scale:"width",value:70}},update:{x:{scale:"x",field:"LOC_X"},y:{scale:"y",field:"LOC_Y"},fillOpacity:{rule:[{predicate:{name:"chartBrush",x:{field:"LOC_X"},y:{field:"LOC_Y"}},value:.8},{value:.2}]}},exit:{x:{scale:"x",value:0},y:{scale:"y",value:0}}}},{type:"arc",from:{data:"arcs"},properties:{enter:{stroke:{value:"#000000"},strokeDash:{field:"strokeDash"},x:{scale:"x",field:"x"},y:{scale:"y",field:"y"},outerRadius:{scale:"width",field:"radius"},innerRadius:{scale:"width",field:"radius"},startAngle:{scale:"degreeRadians",field:"startAngle"},endAngle:{scale:"degreeRadians",field:"endAngle"}}}},{type:"rect",from:{data:"courtLines"},properties:{enter:{fill:{value:null},stroke:{value:"#000000"},strokeWidth:{value:1},x:{scale:"x",field:"x"},y:{scale:"y",field:"y"},x2:{scale:"x",field:"x2"},y2:{scale:"y",field:"y2"}}}},{type:"rect",properties:{enter:{fill:{value:"grey"},fillOpacity:{value:.2}},update:{x:{scale:"x",signal:"minchartX"},x2:{scale:"x",signal:"maxchartX"},y:{scale:"y",signal:"minchartY"},y2:{scale:"y",signal:"maxchartY"}}}}]};t.ShotChart=n},325:function(e,t,a){"use strict";function r(e,t,a,r,n,s,l){return{name:a+"Group",type:"group",properties:{update:{x:{value:620},y:{value:s},width:{value:200},height:{value:100},fill:{value:"#fff"}}},scales:[{name:"x",type:"linear",range:"width",domain:n},{name:"y",type:"linear",range:"height",domain:{data:e,field:"count_"+r},domainMin:0}],axes:[{type:"x",scale:"x",tickFormat:"0d",ticks:5}],marks:[{type:"rect",from:{data:"table",transform:[{type:"filter",test:t},{type:"aggregate",groupby:["bin_"+r,"EVENT_TYPE"],summarize:{"*":["count"]}},{type:"stack",groupby:["bin_"+r],field:"count",sortby:"EVENT_TYPE"}]},properties:{update:{stroke:{scale:"makeColor",field:"EVENT_TYPE"},fillOpacity:{rule:[{predicate:{name:a+"Brush",x:{field:"bin_"+r}},value:.8},{value:.2}]},x:{scale:"x",field:"bin_"+r},width:{scale:"x",value:1},y:{scale:"y",field:"layout_start"},y2:{scale:"y",field:"layout_end"},fill:{scale:"makeColor",field:"EVENT_TYPE"}},exit:{y:{scale:"y",value:0},y2:{scale:"y",value:0}}}},{type:"text",properties:{enter:{x:{value:-5},y:{value:-10},text:{value:l},fill:{value:"black"},fontSize:{value:14},fontWeight:{value:"bold"}}}},{type:"rect",properties:{enter:{fill:{value:"grey"},fillOpacity:{value:.2}},update:{x:{scale:"x",signal:a+"Start"},x2:{scale:"x",signal:a+"End"},y:{value:0},y2:{field:{group:"height"}}}}}]}}Object.defineProperty(t,"__esModule",{value:!0});var n=a(322),s={name:"xLocGroup",type:"group",properties:{update:{x:{value:0},y:{value:52.5},width:{value:450},height:{value:100},fill:{value:"#fff"}}},scales:[{name:"x",type:"linear",range:"width",domain:[-250,250]},{name:"thickness",type:"linear",range:"width",domain:[0,500]},{name:"y",type:"linear",range:"height",domain:{data:"xdistance",field:"count_LOC_X"}}],marks:[{type:"rect",from:{data:"table",transform:[{type:"filter",test:(0,n.filterExclude)("LOC_X")+" && "+n.ShotChartInteractionFilters.brush},{type:"aggregate",groupby:["bin_LOC_X","EVENT_TYPE"],summarize:{"*":["count"]}},{type:"stack",groupby:["bin_LOC_X"],field:"count",sortby:"EVENT_TYPE"}]},properties:{update:{stroke:{scale:"makeColor",field:"EVENT_TYPE"},fillOpacity:{rule:[{predicate:{name:"xLocBrush",x:{field:"bin_LOC_X"}},value:.8},{value:.2}]},x:{scale:"x",field:"bin_LOC_X"},width:{scale:"thickness",value:5},y:{scale:"y",field:"layout_start"},y2:{scale:"y",field:"layout_end"},fill:{scale:"makeColor",field:"EVENT_TYPE"}},exit:{y:{scale:"y",value:0},y2:{scale:"y",value:0}}}},{type:"rect",properties:{enter:{fill:{value:"grey"},fillOpacity:{value:.2}},update:{x:{scale:"x",signal:"xLocStart"},x2:{scale:"x",signal:"xLocEnd"},y:{value:0},y2:{field:{group:"height"}}}}}]},l={name:"yLocGroup",type:"group",properties:{update:{x:{value:450},y:{value:150},width:{value:100},height:{value:660},fill:{value:"#fff"}}},scales:[{name:"thickness",type:"linear",range:"height",reverse:!0,domain:[0,550]},{name:"x",type:"linear",range:"width",domain:{data:"ydistance",field:"count_LOC_Y"}},{name:"y",type:"linear",range:"height",reverse:!0,domain:[-50,500]}],marks:[{type:"rect",from:{data:"table",transform:[{type:"filter",test:(0,n.filterExclude)("LOC_Y")+" && "+n.ShotChartInteractionFilters.brush},{type:"aggregate",groupby:["bin_LOC_Y","EVENT_TYPE"],summarize:{"*":["count"]}},{type:"stack",groupby:["bin_LOC_Y"],field:"count",sortby:"EVENT_TYPE"}]},properties:{update:{stroke:{scale:"makeColor",field:"EVENT_TYPE"},fillOpacity:{rule:[{predicate:{name:"yLocBrush",y:{field:"bin_LOC_Y"}},value:.8},{value:.2}]},y:{scale:"y",field:"bin_LOC_Y"},x:{scale:"x",field:"layout_start"},x2:{scale:"x",field:"layout_end"},height:{scale:"thickness",value:5},fill:{scale:"makeColor",field:"EVENT_TYPE"}},exit:{x:{scale:"x",value:0},x2:{scale:"x",value:0}}}},{type:"rect",properties:{enter:{fill:{value:"grey"},fillOpacity:{value:.2}},update:{y:{scale:"y",signal:"yLocStart"},y2:{scale:"y",signal:"yLocEnd"},x:{value:0},x2:{field:{group:"width"}}}}}]};t.CourtYHistogram=l,t.CourtXHistogram=s,t.fieldHistogram=r},326:function(e,t){e.exports=vg}});
\ No newline at end of file
diff --git a/public/js/nba-shot-chart.min.js b/public/js/nba-shot-chart.min.js
deleted file mode 100644
index 3e7c85c..0000000
--- a/public/js/nba-shot-chart.min.js
+++ /dev/null
@@ -1,15 +0,0 @@
-!function(e){function t(r){if(a[r])return a[r].exports;var n=a[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var a={};return t.m=e,t.c=a,t.p="",t(0)}({0:function(e,t,a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e){console.log("yes",e)}function i(e,t){var a=document.getElementById("shot-chart"),r={top:30,right:179,bottom:30,left:179},i=600,o=660,l=(e.map(function(e){return[e[17],e[18]]}),p["default"].scale.linear().domain([250,-250]).range([0,i])),c=p["default"].scale.linear().domain([-47.5,500]).range([o,0]),d=Math.abs(l(3.85)-l(0)),h=Math.abs(c(0)-c(3.85)),m=(0,y["default"])(v.BasketBall,[{prop:"cx",duration:1e3,easing:x.easingTypes.linear,start:l(0)},{prop:"cy",duration:1e3,easing:x.easingTypes.linear,start:c(0)}]),g=e.map(function(e,t){var a=e[17],r=e[18];return s["default"].createElement(m,{key:e[1]+"_"+e[2],className:(0,f["default"])("dot",{made:"Made Shot"===e[10]}),cx:l(a),cy:c(r),rx:d,ry:h,onMouseOver:n.bind(null,e)})});u["default"].render(s["default"].createElement("svg",{width:i+r.left+r.right,height:o+r.top+r.bottom},s["default"].createElement("g",{transform:"translate("+r.left+", "+r.top+")"},g,s["default"].createElement(v.CourtBounds,{xscale:l,yscale:c,width:i,height:o}))),a)}var o=a(5),s=r(o),l=a(6),u=r(l),c=a(7),p=r(c),d=a(30),f=r(d),h=a(316),y=r(h),m=a(318),x=(r(m),a(317)),v=a(320);p["default"].json("https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/5c74a5dcd7b257faa985f28c932a684ed4cea065/james-harden-shotchartdetail.json",function(e,t){return e?console.warn(e):void i(t.resultSets[0].rowSet,t.resultSets[0].headers)})},5:function(e,t){e.exports=React},6:function(e,t){e.exports=ReactDOM},7:function(e,t){e.exports=d3},30:function(e,t,a){var r;/*!
- Copyright (c) 2015 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
- */
-!function(){"use strict";function n(){for(var e="",t=0;to.config.duration?o.config.duration:Math.max(0,i-o.initTime),l=-o.config.endValue+o.config.easing(s,o.config.beginValue,o.config.endValue,o.config.duration);a+=l}}return a},_rafCb:function(){var e=this.state;if(0!==e.tweenQueue.length){for(var t=Date.now(),a=[],r=0;re?-.5*(n*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/i))+t:n*Math.pow(2,-10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/i)*.5+s+t},easeInBack:function(e,t,a,r,n){var i=a-t;return void 0===n&&(n=1.70158),i*(e/=r)*e*((n+1)*e-n)+t},easeOutBack:function(e,t,a,r,n){var i=a-t;return void 0===n&&(n=1.70158),i*((e=e/r-1)*e*((n+1)*e+n)+1)+t},easeInOutBack:function(e,t,a,r,n){var i=a-t;return void 0===n&&(n=1.70158),(e/=r/2)<1?i/2*(e*e*(((n*=1.525)+1)*e-n))+t:i/2*((e-=2)*e*(((n*=1.525)+1)*e+n)+2)+t},easeInBounce:function(e,t,r,n){var i,o=r-t;return i=a.easeOutBounce(n-e,0,o,n),o-i+t},easeOutBounce:function(e,t,a,r){var n=a-t;return(e/=r)<1/2.75?n*(7.5625*e*e)+t:2/2.75>e?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:2.5/2.75>e?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easeInOutBounce:function(e,t,r,n){var i,o=r-t;return n/2>e?(i=a.easeInBounce(2*e,0,o,n),.5*i+t):(i=a.easeOutBounce(2*e-n,0,o,n),.5*i+.5*o+t)}};e.exports=a}})})},318:function(e,t,a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;tu?"0em":".71em",textAnchor:"middle"}:{x:u*s,y:0,dy:".32em",textAnchor:0>u?"end":"start"},y={axis:!0,x:"top"===e||"bottom"===e,y:"left"===e||"right"===e},m="bottom"===e||"top"===e?c["default"].createElement("path",{className:"domain",d:"M"+l[0]+","+u*r+"V0H"+l[1]+"V"+u*r}):c["default"].createElement("path",{className:"domain",d:"M"+u*r+","+l[0]+"H0V"+l[1]+"H"+u*r}),x=i.map(function(a,r){return c["default"].createElement("g",{key:r,className:"tick",transform:"top"===e||"bottom"===e?"translate("+t(a)+",0)":"translate(0, "+t(a)+")"},c["default"].createElement("line",p),c["default"].createElement("text",o({y:"9"},h),a))});return c["default"].createElement("g",{className:(0,d["default"])(y),transform:"translate("+this.props.x+","+this.props.y+")"},x,m)}}]),t}(c["default"].Component);h.defaultProps={orient:"bottom",innerTickSize:6,outerTickSize:6,tickPadding:3,tickArguments:[10],tickValues:null,tickFormat:null},t["default"]=h,e.exports=t["default"]},319:function(e,t){"use strict";function a(e){var t=e[0],a=e[e.length-1];return a>t?[t,a]:[a,t]}function r(e){return e.rangeExtent?e.rangeExtent():a(e.range())}Object.defineProperty(t,"__esModule",{value:!0}),t.d3_scaleExtent=a,t.d3_scaleRange=r},320:function(e,t,a){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){return{name:e,source:"table",transform:[{type:"aggregate",groupby:{field:"bin_"+t},summarize:n({},t,["count"])}]}}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var a=0;a=o-i?"0":"1";return["M",s.x,s.y,"A",r,n,0,u,0,l.x,l.y].join(" ")}Object.defineProperty(t,"__esModule",{value:!0}),t.describeArc=r},322:function(e,t){"use strict";function a(e,t,a,r,n,i,o){return[{name:t+"Start",init:-1,streams:[{type:"@"+e+":mousedown, @"+e+":touchstart",expr:a+"(scope)",scale:{scope:"scope",name:n,invert:!0}}]},{name:t+"End",init:-1,streams:[{type:"@"+e+":mousedown, @"+e+":touchstart, [@"+e+":mousedown, window:mouseup] > window:mousemove, [@"+e+":touchstart, window:touchend] > window:touchmove",expr:"clamp("+a+"(scope), 0, scope."+r+")",scale:{scope:"scope",name:n,invert:!0}}]},{name:"min"+t,expr:"max(min("+t+"Start, "+t+"End), "+i+")"},{name:"max"+t,expr:"min(max("+t+"Start, "+t+"End), "+o+")"}]}function r(e,t){return[{name:e+"Equal",type:"==",operands:[{signal:e+"Start"},{signal:e+"End"}]},{name:e+"Range",type:"in",item:{arg:t},range:[{signal:e+"Start"},{signal:e+"End"}]},{name:e+"Brush",type:"or",operands:[{predicate:e+"Equal"},{predicate:e+"Range"}]}]}function n(){for(var e=arguments.length,t=Array(e),a=0;e>a;a++)t[a]=arguments[a];return t.map(function(e){var t=o(e,2),a=t[0],r=t[1];return"(min"+r+" == max"+r+" || (datum."+a+" >= min"+r+" && datum."+a+" <= max"+r+"))"}).join(" && ")}function i(e){return function(t){return n.apply(null,e.filter(function(e){return e[0]!==t}))}}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){var a=[],r=!0,n=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(a.push(o.value),!t||a.length!==t);r=!0);}catch(l){n=!0,i=l}finally{try{!r&&s["return"]&&s["return"]()}finally{if(n)throw i}}return a}return function(t,a){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=[{name:"scope",init:{width:0},streams:[{type:"mousedown, touchstart",expr:"eventGroup()"}]}].concat(a("distGroup","dist","eventX","width","x",0,50)).concat(a("timepassedGroup","timepassed","eventX","width","x",0,64)).concat(a("xLocGroup","xLoc","eventX","width","x",-250,250)).concat(a("yLocGroup","yLoc","eventY","height","y",-47.5,500)).concat(a("shotChart","chartX","eventX","width","x",-250,250)).concat(a("shotChart","chartY","eventY","height","y",-47.5,500)),l=r("dist","x").concat(r("timepassed","x")).concat(r("xLoc","x")).concat(r("yLoc","y")).concat(r("chartX","x")).concat(r("chartY","y")).concat([{name:"chartEqual",type:"&&",operands:[{predicate:"chartXEqual"},{predicate:"chartYEqual"}]},{name:"chartInRange",type:"&&",operands:[{predicate:"chartXRange"},{predicate:"chartYRange"}]},{name:"chartBrush",type:"or",operands:[{predicate:"chartEqual"},{predicate:"chartInRange"}]}]),u={brush:"(minchartX == maxchartX || (datum.LOC_X >= minchartX && datum.LOC_X <= maxchartX)) && (minchartY == maxchartY || (datum.LOC_Y >= minchartY && datum.LOC_Y <= maxchartY))"},c=i([["LOC_X","xLoc"],["LOC_Y","yLoc"],["hoopdistance","dist"],["timepassed","timepassed"]]);t.ShotChartInteractionSignals=s,t.ShotChartInteractionPredicates=l,t.ShotChartInteractionFilters=u,t.filterExclude=c},323:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={type:"group",properties:{update:{x:{value:0},y:{value:2.5},width:{value:500},height:{value:50}}},scales:[{name:"xfgp",type:"linear",range:[250,350],domain:[0,1]},{name:"xppa",type:"linear",range:[375,475],domain:[0,3]}],marks:[{type:"rect",from:{data:"rects"},properties:{update:{width:{field:"width"},height:{field:"height"},x:{field:"x"},fill:{value:{id:"rgb",x1:0,y1:0,x2:1,y2:0,stops:[{color:"#e6550d",offset:0},{color:"#31a354",offset:.5},{color:"#31a354",offset:1}]}}}}},{from:{data:"rects"},type:"text",properties:{enter:{x:{field:"x"},y:{value:-5},text:{field:"text"},fill:{value:"black"},fontSize:{value:14},fontWeight:{value:"bold"}}}},{from:{data:"percentages"},type:"text",properties:{update:{x:{value:0},dx:{value:0},y:{value:25},text:{template:"{{datum.count | number:','}}"},fill:{value:"black"},fontSize:{value:30}}}},{from:{data:"percentages"},type:"text",properties:{update:{x:{value:125},dx:{value:0},y:{value:25},text:{template:"{{datum.sum_MADE_POINTS | number:','}}"},fill:{value:"black"},fontSize:{value:30}}}},{from:{data:"percentages"},type:"text",properties:{update:{x:{value:250},dx:{value:10},y:{value:45},text:{template:"{{datum.FGP | number:'.1%'}}"},fill:{value:"black"},fontSize:{value:30}}}},{from:{data:"percentages"},type:"text",properties:{update:{x:{value:375},dx:{value:10},y:{value:45},text:{template:"{{datum.PPA | number:'.2f'}}"},fill:{value:"black"},fontSize:{value:30}}}},{from:{data:"percentages"},type:"symbol",properties:{update:{shape:{value:"triangle-up"},x:{scale:"xfgp",field:"FGP"},y:{value:15},size:{value:40},fill:{value:"black"}}}},{from:{data:"percentages"},type:"symbol",properties:{update:{shape:{value:"triangle-up"},x:{scale:"xppa",field:"PPA"},y:{value:15},size:{value:40},fill:{value:"black"}}}}]};t.ShotAggregates=a},324:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(322),n={name:"shotChart",type:"group",properties:{update:{x:{value:0},y:{value:150},width:{value:450},height:{value:1.1*450}}},scales:[{name:"width",type:"linear",range:"width",domain:[0,500]},{name:"height",type:"linear",range:"height",domain:[0,550]},{name:"x",type:"linear",range:"width",domain:[-250,250]},{name:"y",type:"linear",range:"height",reverse:!0,domain:[-50,500]}],marks:[{type:"symbol",from:{data:"table",transform:[{type:"filter",test:""+(0,r.filterExclude)()}]},key:"shot_id",properties:{enter:{shape:{scale:"playerSymbol",field:"PLAYER_NAME"},x:{scale:"x",value:0},y:{scale:"y",value:0},fill:{scale:"makeColor",field:"EVENT_TYPE"},size:{scale:"width",value:70}},update:{x:{scale:"x",field:"LOC_X"},y:{scale:"y",field:"LOC_Y"},fillOpacity:{rule:[{predicate:{name:"chartBrush",x:{field:"LOC_X"},y:{field:"LOC_Y"}},value:.8},{value:.2}]}},exit:{x:{scale:"x",value:0},y:{scale:"y",value:0}}}},{type:"arc",from:{data:"arcs"},properties:{enter:{stroke:{value:"#000000"},strokeDash:{field:"strokeDash"},x:{scale:"x",field:"x"},y:{scale:"y",field:"y"},outerRadius:{scale:"width",field:"radius"},innerRadius:{scale:"width",field:"radius"},startAngle:{scale:"degreeRadians",field:"startAngle"},endAngle:{scale:"degreeRadians",field:"endAngle"}}}},{type:"rect",from:{data:"courtLines"},properties:{enter:{fill:{value:null},stroke:{value:"#000000"},strokeWidth:{value:1},x:{scale:"x",field:"x"},y:{scale:"y",field:"y"},x2:{scale:"x",field:"x2"},y2:{scale:"y",field:"y2"}}}},{type:"rect",properties:{enter:{fill:{value:"grey"},fillOpacity:{value:.2}},update:{x:{scale:"x",signal:"minchartX"},x2:{scale:"x",signal:"maxchartX"},y:{scale:"y",signal:"minchartY"},y2:{scale:"y",signal:"maxchartY"}}}}]};t.ShotChart=n},325:function(e,t,a){"use strict";function r(e,t,a,r,n,i,o){return{name:a+"Group",type:"group",properties:{update:{x:{value:620},y:{value:i},width:{value:200},height:{value:100},fill:{value:"#fff"}}},scales:[{name:"x",type:"linear",range:"width",domain:n},{name:"y",type:"linear",range:"height",domain:{data:e,field:"count_"+r},domainMin:0}],axes:[{type:"x",scale:"x",tickFormat:"0d",ticks:5}],marks:[{type:"rect",from:{data:"table",transform:[{type:"filter",test:t},{type:"aggregate",groupby:["bin_"+r,"EVENT_TYPE"],summarize:{"*":["count"]}},{type:"stack",groupby:["bin_"+r],field:"count",sortby:"EVENT_TYPE"}]},properties:{update:{stroke:{scale:"makeColor",field:"EVENT_TYPE"},fillOpacity:{rule:[{predicate:{name:a+"Brush",x:{field:"bin_"+r}},value:.8},{value:.2}]},x:{scale:"x",field:"bin_"+r},width:{scale:"x",value:1},y:{scale:"y",field:"layout_start"},y2:{scale:"y",field:"layout_end"},fill:{scale:"makeColor",field:"EVENT_TYPE"}},exit:{y:{scale:"y",value:0},y2:{scale:"y",value:0}}}},{type:"text",properties:{enter:{x:{value:-5},y:{value:-10},text:{value:o},fill:{value:"black"},fontSize:{value:14},fontWeight:{value:"bold"}}}},{type:"rect",properties:{enter:{fill:{value:"grey"},fillOpacity:{value:.2}},update:{x:{scale:"x",signal:a+"Start"},x2:{scale:"x",signal:a+"End"},y:{value:0},y2:{field:{group:"height"}}}}}]}}Object.defineProperty(t,"__esModule",{value:!0});var n=a(322),i={name:"xLocGroup",type:"group",properties:{update:{x:{value:0},y:{value:52.5},width:{value:450},height:{value:100},fill:{value:"#fff"}}},scales:[{name:"x",type:"linear",range:"width",domain:[-250,250]},{name:"thickness",type:"linear",range:"width",domain:[0,500]},{name:"y",type:"linear",range:"height",domain:{data:"xdistance",field:"count_LOC_X"}}],marks:[{type:"rect",from:{data:"table",transform:[{type:"filter",test:(0,n.filterExclude)("LOC_X")+" && "+n.ShotChartInteractionFilters.brush},{type:"aggregate",groupby:["bin_LOC_X","EVENT_TYPE"],summarize:{"*":["count"]}},{type:"stack",groupby:["bin_LOC_X"],field:"count",sortby:"EVENT_TYPE"}]},properties:{update:{stroke:{scale:"makeColor",field:"EVENT_TYPE"},fillOpacity:{rule:[{predicate:{name:"xLocBrush",x:{field:"bin_LOC_X"}},value:.8},{value:.2}]},x:{scale:"x",field:"bin_LOC_X"},width:{scale:"thickness",value:5},y:{scale:"y",field:"layout_start"},y2:{scale:"y",field:"layout_end"},fill:{scale:"makeColor",field:"EVENT_TYPE"}},exit:{y:{scale:"y",value:0},y2:{scale:"y",value:0}}}},{type:"rect",properties:{enter:{fill:{value:"grey"},fillOpacity:{value:.2}},update:{x:{scale:"x",signal:"xLocStart"},x2:{scale:"x",signal:"xLocEnd"},y:{value:0},y2:{field:{group:"height"}}}}}]},o={name:"yLocGroup",type:"group",properties:{update:{x:{value:450},y:{value:150},width:{value:100},height:{value:660},fill:{value:"#fff"}}},scales:[{name:"thickness",type:"linear",range:"height",reverse:!0,domain:[0,550]},{name:"x",type:"linear",range:"width",domain:{data:"ydistance",field:"count_LOC_Y"}},{name:"y",type:"linear",range:"height",reverse:!0,domain:[-50,500]}],marks:[{type:"rect",from:{data:"table",transform:[{type:"filter",test:(0,n.filterExclude)("LOC_Y")+" && "+n.ShotChartInteractionFilters.brush},{type:"aggregate",groupby:["bin_LOC_Y","EVENT_TYPE"],summarize:{"*":["count"]}},{type:"stack",groupby:["bin_LOC_Y"],field:"count",sortby:"EVENT_TYPE"}]},properties:{update:{stroke:{scale:"makeColor",field:"EVENT_TYPE"},fillOpacity:{rule:[{predicate:{name:"yLocBrush",y:{field:"bin_LOC_Y"}},value:.8},{value:.2}]},y:{scale:"y",field:"bin_LOC_Y"},x:{scale:"x",field:"layout_start"},x2:{scale:"x",field:"layout_end"},height:{scale:"thickness",value:5},fill:{scale:"makeColor",field:"EVENT_TYPE"}},exit:{x:{scale:"x",value:0},x2:{scale:"x",value:0}}}},{type:"rect",properties:{enter:{fill:{value:"grey"},fillOpacity:{value:.2}},update:{y:{scale:"y",signal:"yLocStart"},y2:{scale:"y",signal:"yLocEnd"},x:{value:0},x2:{field:{group:"width"}}}}}]};t.CourtYHistogram=o,t.CourtXHistogram=i,t.fieldHistogram=r}});
\ No newline at end of file
diff --git a/public/js/react-histogram-transition.min.js b/public/js/react-histogram-transition.min.js
deleted file mode 100644
index 83b517f..0000000
--- a/public/js/react-histogram-transition.min.js
+++ /dev/null
@@ -1,15 +0,0 @@
-!function(t){function e(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return t[r].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=Object.assign||function(t){for(var e=1;eu.config.duration?u.config.duration:Math.max(0,o-u.initTime),s=-u.config.endValue+u.config.easing(i,u.config.beginValue,u.config.endValue,u.config.duration);n+=s}}return n},_rafCb:function(){var t=this.state;if(0!==t.tweenQueue.length){for(var e=Date.now(),n=[],r=0;rt?-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*r-u)*(2*Math.PI)/o))+e:a*Math.pow(2,-10*(t-=1))*Math.sin((t*r-u)*(2*Math.PI)/o)*.5+i+e},easeInBack:function(t,e,n,r,a){var o=n-e;return void 0===a&&(a=1.70158),o*(t/=r)*t*((a+1)*t-a)+e},easeOutBack:function(t,e,n,r,a){var o=n-e;return void 0===a&&(a=1.70158),o*((t=t/r-1)*t*((a+1)*t+a)+1)+e},easeInOutBack:function(t,e,n,r,a){var o=n-e;return void 0===a&&(a=1.70158),(t/=r/2)<1?o/2*(t*t*(((a*=1.525)+1)*t-a))+e:o/2*((t-=2)*t*(((a*=1.525)+1)*t+a)+2)+e},easeInBounce:function(t,e,r,a){var o,u=r-e;return o=n.easeOutBounce(a-t,0,u,a),u-o+e},easeOutBounce:function(t,e,n,r){var a=n-e;return(t/=r)<1/2.75?a*(7.5625*t*t)+e:2/2.75>t?a*(7.5625*(t-=1.5/2.75)*t+.75)+e:2.5/2.75>t?a*(7.5625*(t-=2.25/2.75)*t+.9375)+e:a*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInOutBounce:function(t,e,r,a){var o,u=r-e;return a/2>t?(o=n.easeInBounce(2*t,0,u,a),.5*o+e):(o=n.easeOutBounce(2*t-a,0,u,a),.5*o+.5*u+e)}};t.exports=n}})})},318:function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=Object.assign||function(t){for(var e=1;ec?"0em":".71em",textAnchor:"middle"}:{x:c*i,y:0,dy:".32em",textAnchor:0>c?"end":"start"},v={axis:!0,x:"top"===t||"bottom"===t,y:"left"===t||"right"===t},y="bottom"===t||"top"===t?f["default"].createElement("path",{className:"domain",d:"M"+s[0]+","+c*r+"V0H"+s[1]+"V"+c*r}):f["default"].createElement("path",{className:"domain",d:"M"+c*r+","+s[0]+"H0V"+s[1]+"H"+c*r}),g=o.map(function(n,r){return f["default"].createElement("g",{key:r,className:"tick",transform:"top"===t||"bottom"===t?"translate("+e(n)+",0)":"translate(0, "+e(n)+")"},f["default"].createElement("line",l),f["default"].createElement("text",u({y:"9"},h),n))});return f["default"].createElement("g",{className:(0,p["default"])(v),transform:"translate("+this.props.x+","+this.props.y+")"},g,y)}}]),e}(f["default"].Component);h.defaultProps={orient:"bottom",innerTickSize:6,outerTickSize:6,tickPadding:3,tickArguments:[10],tickValues:null,tickFormat:null},e["default"]=h,t.exports=e["default"]},319:function(t,e){"use strict";function n(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function r(t){return t.rangeExtent?t.rangeExtent():n(t.range())}Object.defineProperty(e,"__esModule",{value:!0}),e.d3_scaleExtent=n,e.d3_scaleRange=r},327:function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;ns?"0em":".71em",textAnchor:"middle"}:{x:s*l,y:0,dy:".32em",textAnchor:0>s?"end":"start"},y={axis:!0,x:"top"===t||"bottom"===t,y:"left"===t||"right"===t},h="bottom"===t||"top"===t?c["default"].createElement("path",{className:"domain",d:"M"+u[0]+","+s*n+"V0H"+u[1]+"V"+s*n}):c["default"].createElement("path",{className:"domain",d:"M"+s*n+","+u[0]+"H0V"+u[1]+"H"+s*n}),g=a.map(function(r,n){return c["default"].createElement("g",{key:n,className:"tick",transform:"top"===t||"bottom"===t?"translate("+e(r)+",0)":"translate(0, "+e(r)+")"},c["default"].createElement("line",f),c["default"].createElement("text",i({y:"9"},m),r))});return c["default"].createElement("g",{className:(0,p["default"])(y),transform:"translate("+this.props.x+","+this.props.y+")"},g,h)}}]),e}(c["default"].Component);m.defaultProps={orient:"bottom",innerTickSize:6,outerTickSize:6,tickPadding:3,tickArguments:[10],tickValues:null,tickFormat:null},e["default"]=m,t.exports=e["default"]},319:function(t,e){"use strict";function r(t){var e=t[0],r=t[t.length-1];return r>e?[e,r]:[r,e]}function n(t){return t.rangeExtent?t.rangeExtent():r(t.range())}Object.defineProperty(e,"__esModule",{value:!0}),e.d3_scaleExtent=r,e.d3_scaleRange=n}});
\ No newline at end of file
diff --git a/public/js/react-in-jekyll.min.js b/public/js/react-in-jekyll.min.js
deleted file mode 100644
index c0fb25a..0000000
--- a/public/js/react-in-jekyll.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){function t(n){if(l[n])return l[n].exports;var r=l[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var l={};return t.m=e,t.c=l,t.p="",t(0)}({0:function(e,t,l){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var r=l(5),a=n(r),o=l(6),u=n(o),c=l(328),d=n(c);u["default"].render(a["default"].createElement(d["default"],null),document.getElementById("react-body"))},5:function(e,t){e.exports=React},6:function(e,t){e.exports=ReactDOM},328:function(e,t,l){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var l=0;lu.config.duration?u.config.duration:Math.max(0,o-u.initTime),s=-u.config.endValue+u.config.easing(i,u.config.beginValue,u.config.endValue,u.config.duration);n+=s}}return n},_rafCb:function(){var t=this.state;if(0!==t.tweenQueue.length){for(var e=Date.now(),n=[],r=0;rt?-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*r-u)*(2*Math.PI)/o))+e:a*Math.pow(2,-10*(t-=1))*Math.sin((t*r-u)*(2*Math.PI)/o)*.5+i+e},easeInBack:function(t,e,n,r,a){var o=n-e;return void 0===a&&(a=1.70158),o*(t/=r)*t*((a+1)*t-a)+e},easeOutBack:function(t,e,n,r,a){var o=n-e;return void 0===a&&(a=1.70158),o*((t=t/r-1)*t*((a+1)*t+a)+1)+e},easeInOutBack:function(t,e,n,r,a){var o=n-e;return void 0===a&&(a=1.70158),(t/=r/2)<1?o/2*(t*t*(((a*=1.525)+1)*t-a))+e:o/2*((t-=2)*t*(((a*=1.525)+1)*t+a)+2)+e},easeInBounce:function(t,e,r,a){var o,u=r-e;return o=n.easeOutBounce(a-t,0,u,a),u-o+e},easeOutBounce:function(t,e,n,r){var a=n-e;return(t/=r)<1/2.75?a*(7.5625*t*t)+e:2/2.75>t?a*(7.5625*(t-=1.5/2.75)*t+.75)+e:2.5/2.75>t?a*(7.5625*(t-=2.25/2.75)*t+.9375)+e:a*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInOutBounce:function(t,e,r,a){var o,u=r-e;return a/2>t?(o=n.easeInBounce(2*t,0,u,a),.5*o+e):(o=n.easeOutBounce(2*t-a,0,u,a),.5*o+.5*u+e)}};t.exports=n}})})},318:function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=Object.assign||function(t){for(var e=1;ec?"0em":".71em",textAnchor:"middle"}:{x:c*i,y:0,dy:".32em",textAnchor:0>c?"end":"start"},v={axis:!0,x:"top"===t||"bottom"===t,y:"left"===t||"right"===t},m="bottom"===t||"top"===t?f["default"].createElement("path",{className:"domain",d:"M"+s[0]+","+c*r+"V0H"+s[1]+"V"+c*r}):f["default"].createElement("path",{className:"domain",d:"M"+c*r+","+s[0]+"H0V"+s[1]+"H"+c*r}),g=o.map(function(n,r){return f["default"].createElement("g",{key:r,className:"tick",transform:"top"===t||"bottom"===t?"translate("+e(n)+",0)":"translate(0, "+e(n)+")"},f["default"].createElement("line",l),f["default"].createElement("text",u({y:"9"},h),n))});return f["default"].createElement("g",{className:(0,p["default"])(v),transform:"translate("+this.props.x+","+this.props.y+")"},g,m)}}]),e}(f["default"].Component);h.defaultProps={orient:"bottom",innerTickSize:6,outerTickSize:6,tickPadding:3,tickArguments:[10],tickValues:null,tickFormat:null},e["default"]=h,t.exports=e["default"]},319:function(t,e){"use strict";function n(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function r(t){return t.rangeExtent?t.rangeExtent():n(t.range())}Object.defineProperty(e,"__esModule",{value:!0}),e.d3_scaleExtent=n,e.d3_scaleRange=r}});
\ No newline at end of file
diff --git a/public/js/react-scatterplot.min.js b/public/js/react-scatterplot.min.js
deleted file mode 100644
index 6cbcc49..0000000
--- a/public/js/react-scatterplot.min.js
+++ /dev/null
@@ -1,15 +0,0 @@
-!function(t){function e(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return t[r].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}({0:function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=function(){function t(t,e){var n=[],r=!0,a=!1,o=void 0;try{for(var u,i=t[Symbol.iterator]();!(r=(u=i.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(s){a=!0,o=s}finally{try{!r&&i["return"]&&i["return"]()}finally{if(a)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function t(t,e){for(var n=0;nu.config.duration?u.config.duration:Math.max(0,o-u.initTime),s=-u.config.endValue+u.config.easing(i,u.config.beginValue,u.config.endValue,u.config.duration);n+=s}}return n},_rafCb:function(){var t=this.state;if(0!==t.tweenQueue.length){for(var e=Date.now(),n=[],r=0;rt?-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*r-u)*(2*Math.PI)/o))+e:a*Math.pow(2,-10*(t-=1))*Math.sin((t*r-u)*(2*Math.PI)/o)*.5+i+e},easeInBack:function(t,e,n,r,a){var o=n-e;return void 0===a&&(a=1.70158),o*(t/=r)*t*((a+1)*t-a)+e},easeOutBack:function(t,e,n,r,a){var o=n-e;return void 0===a&&(a=1.70158),o*((t=t/r-1)*t*((a+1)*t+a)+1)+e},easeInOutBack:function(t,e,n,r,a){var o=n-e;return void 0===a&&(a=1.70158),(t/=r/2)<1?o/2*(t*t*(((a*=1.525)+1)*t-a))+e:o/2*((t-=2)*t*(((a*=1.525)+1)*t+a)+2)+e},easeInBounce:function(t,e,r,a){var o,u=r-e;return o=n.easeOutBounce(a-t,0,u,a),u-o+e},easeOutBounce:function(t,e,n,r){var a=n-e;return(t/=r)<1/2.75?a*(7.5625*t*t)+e:2/2.75>t?a*(7.5625*(t-=1.5/2.75)*t+.75)+e:2.5/2.75>t?a*(7.5625*(t-=2.25/2.75)*t+.9375)+e:a*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInOutBounce:function(t,e,r,a){var o,u=r-e;return a/2>t?(o=n.easeInBounce(2*t,0,u,a),.5*o+e):(o=n.easeOutBounce(2*t-a,0,u,a),.5*o+.5*u+e)}};t.exports=n}})})},318:function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=Object.assign||function(t){for(var e=1;ec?"0em":".71em",textAnchor:"middle"}:{x:c*i,y:0,dy:".32em",textAnchor:0>c?"end":"start"},v={axis:!0,x:"top"===t||"bottom"===t,y:"left"===t||"right"===t},m="bottom"===t||"top"===t?f["default"].createElement("path",{className:"domain",d:"M"+s[0]+","+c*r+"V0H"+s[1]+"V"+c*r}):f["default"].createElement("path",{className:"domain",d:"M"+c*r+","+s[0]+"H0V"+s[1]+"H"+c*r}),g=o.map(function(n,r){return f["default"].createElement("g",{key:r,className:"tick",transform:"top"===t||"bottom"===t?"translate("+e(n)+",0)":"translate(0, "+e(n)+")"},f["default"].createElement("line",l),f["default"].createElement("text",u({y:"9"},h),n))});return f["default"].createElement("g",{className:(0,p["default"])(v),transform:"translate("+this.props.x+","+this.props.y+")"},g,m)}}]),e}(f["default"].Component);h.defaultProps={orient:"bottom",innerTickSize:6,outerTickSize:6,tickPadding:3,tickArguments:[10],tickValues:null,tickFormat:null},e["default"]=h,t.exports=e["default"]},319:function(t,e){"use strict";function n(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function r(t){return t.rangeExtent?t.rangeExtent():n(t.range())}Object.defineProperty(e,"__esModule",{value:!0}),e.d3_scaleExtent=n,e.d3_scaleRange=r}});
\ No newline at end of file
diff --git a/public/js/table-to-sql.min.js b/public/js/table-to-sql.min.js
deleted file mode 100644
index f0f0c67..0000000
--- a/public/js/table-to-sql.min.js
+++ /dev/null
@@ -1,14 +0,0 @@
-!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var o=n(1),u=r(o),a=n(2),i=(r(a),n(17)),s=(r(i),n(18)),c=n(149),f=r(c),l=n(145),p=r(l),d=n(147);n(49).polyfill();var y=p["default"]({datasources:{IDS:[0,1,2,3,4,5,6],BY_ID:{0:{id:0,name:"Birdstrikes",type:"dataframe",url:"http://vega.github.io/polestar/data/birdstrikes.json",settings:{format:"json"}},1:{id:1,name:"Cars",type:"dataframe",url:"http://vega.github.io/polestar/data/cars.json",settings:{format:"json"}},2:{id:2,name:"NBA League Totals per year",type:"dataframe",url:"https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/f6d6496474af6dfba0b73f36dbd0e00ce0fc2f42/leagues_NBA_player_totals.csv",settings:{format:"csv",delimiter:","}},3:{id:3,name:"Dataset NBA",type:"dataframe",schema:[{name:"Season",type:"string"},{name:"Year",type:"integer"},{name:"Rk",type:"integer"},{name:"Player",type:"string"},{name:"Pos",type:"string"},{name:"Age",type:"integer"},{name:"Tm",type:"string"},{name:"G",type:"integer"},{name:"GS",type:"integer"},{name:"MP",type:"integer"},{name:"FG",type:"integer"},{name:"FGA",type:"integer"},{name:"FG%",type:"number"},{name:"3P",type:"integer"},{name:"3PA",type:"integer"},{name:"3P%",type:"number"},{name:"2P",type:"integer"},{name:"2PA",type:"integer"},{name:"2P%",type:"number"},{name:"eFG%",type:"number"},{name:"FT",type:"integer"},{name:"FTA",type:"integer"},{name:"FT%",type:"number"},{name:"ORB",type:"integer"},{name:"DRB",type:"integer"},{name:"TRB",type:"integer"},{name:"AST",type:"integer"},{name:"STL",type:"integer"},{name:"BLK",type:"integer"},{name:"TOV",type:"integer"},{name:"PF",type:"integer"},{name:"PTS",type:"integer"},{name:"Season with a really long name that hsould try to voerflow the thing",type:"string"},{name:"Year",type:"integer"},{name:"Rk",type:"integer"},{name:"Player",type:"string"},{name:"Pos",type:"string"},{name:"Age",type:"integer"},{name:"Tm",type:"string"},{name:"G",type:"integer"},{name:"GS",type:"integer"},{name:"MP",type:"integer"},{name:"FG",type:"integer"},{name:"FGA",type:"integer"},{name:"FG%",type:"number"},{name:"3P",type:"integer"},{name:"3PA",type:"integer"},{name:"3P%",type:"number"},{name:"2P",type:"integer"},{name:"2PA",type:"integer"},{name:"2P%",type:"number"},{name:"eFG%",type:"number"},{name:"FT",type:"integer"},{name:"FTA",type:"integer"},{name:"FT%",type:"number"},{name:"ORB",type:"integer"},{name:"DRB",type:"integer"},{name:"TRB",type:"integer"},{name:"AST",type:"integer"},{name:"STL",type:"integer"},{name:"BLK",type:"integer"},{name:"TOV",type:"integer"},{name:"PF",type:"integer"},{name:"PTS",type:"integer"},{name:"Season",type:"string"},{name:"Year",type:"integer"},{name:"Rk",type:"integer"},{name:"Player",type:"string"},{name:"Pos",type:"string"},{name:"Age",type:"integer"},{name:"Tm",type:"string"},{name:"G",type:"integer"},{name:"GS",type:"integer"},{name:"MP",type:"integer"},{name:"FG",type:"integer"},{name:"FGA",type:"integer"},{name:"FG%",type:"number"},{name:"3P",type:"integer"},{name:"3PA",type:"integer"},{name:"3P%",type:"number"},{name:"2P",type:"integer"},{name:"2PA",type:"integer"},{name:"2P%",type:"number"},{name:"eFG%",type:"number"},{name:"FT",type:"integer"},{name:"FTA",type:"integer"},{name:"FT%",type:"number"},{name:"ORB",type:"integer"},{name:"DRB",type:"integer"},{name:"TRB",type:"integer"},{name:"AST",type:"integer"},{name:"STL",type:"integer"},{name:"BLK",type:"integer"},{name:"TOV",type:"integer"},{name:"PF",type:"integer"},{name:"PTS",type:"integer"},{name:"Season with a really long name that hsould try to voerflow the thing",type:"string"},{name:"Year",type:"integer"},{name:"Rk",type:"integer"},{name:"Player",type:"string"},{name:"Pos",type:"string"},{name:"Age",type:"integer"},{name:"Tm",type:"string"},{name:"G",type:"integer"},{name:"GS",type:"integer"},{name:"MP",type:"integer"},{name:"FG",type:"integer"},{name:"FGA",type:"integer"},{name:"FG%",type:"number"},{name:"3P",type:"integer"},{name:"3PA",type:"integer"},{name:"3P%",type:"number"},{name:"2P",type:"integer"},{name:"2PA",type:"integer"},{name:"2P%",type:"number"},{name:"eFG%",type:"number"},{name:"FT",type:"integer"},{name:"FTA",type:"integer"},{name:"FT%",type:"number"},{name:"ORB",type:"integer"},{name:"DRB",type:"integer"},{name:"TRB",type:"integer"},{name:"AST",type:"integer"},{name:"STL",type:"integer"},{name:"BLK",type:"integer"},{name:"TOV",type:"integer"},{name:"PF",type:"integer"},{name:"PTS",type:"integer"},{name:"Season",type:"string"},{name:"Year",type:"integer"},{name:"Rk",type:"integer"},{name:"Player",type:"string"},{name:"Pos",type:"string"},{name:"Age",type:"integer"},{name:"Tm",type:"string"},{name:"G",type:"integer"},{name:"GS",type:"integer"},{name:"MP",type:"integer"},{name:"FG",type:"integer"},{name:"FGA",type:"integer"},{name:"FG%",type:"number"},{name:"3P",type:"integer"},{name:"3PA",type:"integer"},{name:"3P%",type:"number"},{name:"2P",type:"integer"},{name:"2PA",type:"integer"},{name:"2P%",type:"number"},{name:"eFG%",type:"number"},{name:"FT",type:"integer"},{name:"FTA",type:"integer"},{name:"FT%",type:"number"},{name:"ORB",type:"integer"},{name:"DRB",type:"integer"},{name:"TRB",type:"integer"},{name:"AST",type:"integer"},{name:"STL",type:"integer"},{name:"BLK",type:"integer"},{name:"TOV",type:"integer"},{name:"PF",type:"integer"},{name:"PTS",type:"integer"},{name:"Season with a really long name that hsould try to voerflow the thing",type:"string"},{name:"Year",type:"integer"},{name:"Rk",type:"integer"},{name:"Player",type:"string"},{name:"Pos",type:"string"},{name:"Age",type:"integer"},{name:"Tm",type:"string"},{name:"G",type:"integer"},{name:"GS",type:"integer"},{name:"MP",type:"integer"},{name:"FG",type:"integer"},{name:"FGA",type:"integer"},{name:"FG%",type:"number"},{name:"3P",type:"integer"},{name:"3PA",type:"integer"},{name:"3P%",type:"number"},{name:"2P",type:"integer"},{name:"2PA",type:"integer"},{name:"2P%",type:"number"},{name:"eFG%",type:"number"},{name:"FT",type:"integer"},{name:"FTA",type:"integer"},{name:"FT%",type:"number"},{name:"ORB",type:"integer"},{name:"DRB",type:"integer"},{name:"TRB",type:"integer"},{name:"AST",type:"integer"},{name:"STL",type:"integer"},{name:"BLK",type:"integer"},{name:"TOV",type:"integer"},{name:"PF",type:"integer"},{name:"PTS",type:"integer"}]},4:{id:4,name:"Coffee Chain",type:"db",protocol:"psql",tables:[{name:"Products",type:"table",schema:[{name:"Profit",type:"number"},{name:"Sales",type:"number"},{name:"Year",type:"number"},{name:"Quarter",type:"string"},{name:"Month",type:"string"},{name:"Region",type:"string"},{name:"State",type:"string"},{name:"Product",type:"string"}],datasource_id:4},{name:"Customers",type:"table",schema:[{name:"Purchases",type:"number"},{name:"Money Spent",type:"number"},{name:"Year",type:"number"},{name:"Created At",type:"timestamp"},{name:"Quarter",type:"string"},{name:"Month",type:"string"},{name:"State",type:"string"}],datasource_id:4}]},5:{id:5,name:"Second Coffee Chain",type:"db",protocol:"psql",tables:[{name:"Products",type:"table",schema:[{name:"Profit",type:"number"},{name:"Sales",type:"number"},{name:"Year",type:"number"},{name:"Quarter",type:"string"},{name:"Month",type:"string"},{name:"Region",type:"string"},{name:"State",type:"string"},{name:"Product",type:"string"}],datasource_id:5},{name:"Customers",type:"table",schema:[{name:"Purchases",type:"number"},{name:"Money Spent",type:"number"},{name:"Year",type:"number"},{name:"Created At",type:"timestamp"},{name:"Quarter",type:"string"},{name:"Month",type:"string"},{name:"State",type:"string"}],datasource_id:5}]},6:{id:6,name:"Third Coffee Chain",type:"db",protocol:"psql",tables:[{name:"Products",type:"table",schema:[{name:"Profit",type:"number"},{name:"Sales",type:"number"},{name:"Year",type:"number"},{name:"Quarter",type:"string"},{name:"Month",type:"string"},{name:"Region",type:"string"},{name:"State",type:"string"},{name:"Product",type:"string"}],datasource_id:6},{name:"Customers",type:"table",schema:[{name:"Purchases",type:"number"},{name:"Money Spent",type:"number"},{name:"Year",type:"number"},{name:"Created At",type:"timestamp"},{name:"Quarter",type:"string"},{name:"Month",type:"string"},{name:"State",type:"string"}],datasource_id:6}]}}}});u["default"].render(u["default"].createElement(s.Provider,{store:y},function(){return u["default"].createElement(f["default"],null)}),document.getElementById("demo")),y.dispatch(d.selectTable({id:3}))},function(e,t){e.exports=React},function(e,t){e.exports=d3},function(e,t,n){var r;/*!
- Copyright (c) 2015 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
- */
-!function(){"use strict";function o(){for(var e="",t=0;t child into a function."))}function n(){!y&&d&&(y=!0,console.error("With React 0.13, you need to wrap child into a function. This restriction will be removed with React 0.14."))}function r(){m||(m=!0,console.error(" does not support changing `store` on the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/rackt/react-redux/releases/tag/v2.0.0 for the migration instructions."))}var i=e.Component,c=e.PropTypes,l=e.Children,p=f["default"](c),d=a(e),y=!1,m=!1;return function(e){function a(t,n){o(this,a),e.call(this,t,n),this.store=t.store}return u(a,e),a.prototype.getChildContext=function(){return{store:this.store}},s(a,null,[{key:"childContextTypes",value:{store:p.isRequired},enumerable:!0},{key:"propTypes",value:{store:p.isRequired,children:(d?c.func:c.element).isRequired},enumerable:!0}]),a.prototype.componentWillReceiveProps=function(e){var t=this.store,n=e.store;t!==n&&r()},a.prototype.render=function(){var e=this.props.children;return"function"==typeof e?(t(),e=e()):n(),l.only(e)},a}(i)}t.__esModule=!0;var s=function(){function e(e,t){for(var n=0;n1,S=j.length>1,M=v.pure,k=void 0===M?!0:M,D=P++;return function(n){var s=function(t){function r(e,n){u(this,r),t.call(this,e,n),this.version=D,this.store=e.store||n.store,_["default"](this.store,'Could not find "store" in either the context or '+('props of "'+this.constructor.displayName+'". ')+"Either wrap the root component in a , "+('or explicitly pass "store" as a prop to "'+this.constructor.displayName+'".')),this.stateProps=p(this.store,e),this.dispatchProps=d(this.store,e),this.state={props:this.computeNextState()}}return a(r,t),r.prototype.shouldComponentUpdate=function(e,t){return!k||!y["default"](this.state.props,t.props)},c(r,null,[{key:"displayName",value:"Connect("+i(n)+")",enumerable:!0},{key:"WrappedComponent",value:n,enumerable:!0},{key:"contextTypes",value:{store:o},enumerable:!0},{key:"propTypes",value:{store:o},enumerable:!0}]),r.prototype.computeNextState=function(){var e=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0];return m(this.stateProps,this.dispatchProps,e)},r.prototype.updateStateProps=function(){var e=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0],t=p(this.store,e);return y["default"](t,this.stateProps)?!1:(this.stateProps=t,!0)},r.prototype.updateDispatchProps=function(){var e=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0],t=d(this.store,e);return y["default"](t,this.dispatchProps)?!1:(this.dispatchProps=t,!0)},r.prototype.updateState=function(){var e=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0],t=this.computeNextState(e);y["default"](t,this.state.props)||this.setState({props:t})},r.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},r.prototype.trySubscribe=function(){b&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},r.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},r.prototype.componentDidMount=function(){this.trySubscribe()},r.prototype.componentWillReceiveProps=function(e){y["default"](e,this.props)||(E&&this.updateStateProps(e),S&&this.updateDispatchProps(e),this.updateState(e))},r.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},r.prototype.handleChange=function(){this.unsubscribe&&this.updateStateProps()&&this.updateState()},r.prototype.getWrappedInstance=function(){return this.refs.wrappedInstance},r.prototype.render=function(){return e.createElement(n,f({ref:"wrappedInstance"},this.state.props))},r}(t);return"production"!==r.env.NODE_ENV&&(s.prototype.componentWillUpdate=function(){this.version!==D&&(this.version=D,this.trySubscribe(),this.updateStateProps(),this.updateDispatchProps(),this.updateState())}),s}}}t.__esModule=!0;var c=function(){function e(e,t){for(var n=0;n1)for(var n=1;n0&&console.error("Unexpected "+(r.length>1?"keys":"key")+" "+('"'+r.join('", "')+'" in initialState will be ignored. ')+('Expected to find one of the known reducer keys instead: "'+n.join('", "')+'"'))}function i(e){var t=y["default"](e,function(e){return"function"==typeof e});Object.keys(t).forEach(function(e){var n=t[e];if("undefined"==typeof n(void 0,{type:s.ActionTypes.INIT}))throw new Error('Reducer "'+e+'" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined.');var r=Math.random().toString(36).substring(7).split("").join(".");if("undefined"==typeof n(void 0,{type:r}))throw new Error('Reducer "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle "+s.ActionTypes.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined.")});var n,o=p["default"](t,function(){return void 0});return function(e,i){void 0===e&&(e=o);var s=p["default"](t,function(t,n){var r=t(e[n],i);if("undefined"==typeof r)throw new Error(u(n,i));return r});return"production"!==r.env.NODE_ENV&&(n||(a(e,s),n=!0)),s}}t.__esModule=!0,t["default"]=i;var s=n(28),c=n(29),f=o(c),l=n(31),p=o(l),d=n(32),y=o(d);e.exports=t["default"]}).call(t,n(23))},function(e,t){"use strict";function n(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){return Object.keys(e).reduce(function(n,r){return t(e[r])&&(n[r]=e[r]),n},{})}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return function(){return t(e.apply(void 0,arguments))}}function u(e,t){if("function"==typeof e)return o(e,t);if("object"!=typeof e||null===e||void 0===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');return i["default"](e,function(e){return o(e,t)})}t.__esModule=!0,t["default"]=u;var a=n(31),i=r(a);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return function(e){return function(n,r){var o=e(n,r),a=o.dispatch,s=[],c={getState:o.getState,dispatch:function(e){return a(e)}};return s=t.map(function(e){return e(c)}),a=i["default"].apply(void 0,s)(o.dispatch),u({},o,{dispatch:a})}}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;tn;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t,n){(function(t){"use strict";var n=function(e,n,r,o,u,a,i,s){if("production"!==t.env.NODE_ENV&&void 0===n)throw new Error("invariant requires an error message argument");if(!e){var c;if(void 0===n)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[r,o,u,a,i,s],l=0;c=new Error("Invariant Violation: "+n.replace(/%s/g,function(){return f[l++]}))}throw c.framesToPop=1,c}};e.exports=n}).call(t,n(23))},,function(e,t){"use strict";function n(e){var t=e.dispatch,n=e.getState;return function(e){return function(r){return"function"==typeof r?r(t,n):e(r)}}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},,,,,,function(e,t,n){n(45),e.exports=self.fetch.bind(self)},function(e,t){!function(){"use strict";function e(e){if("string"!=typeof e&&(e=e.toString()),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function t(e){return"string"!=typeof e&&(e=e.toString()),e}function n(e){this.map={};var t=this;e instanceof n?e.forEach(function(e,n){n.forEach(function(n){t.append(e,n)})}):e&&Object.getOwnPropertyNames(e).forEach(function(n){t.append(n,e[n])})}function r(e){return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function o(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function u(e){var t=new FileReader;return t.readAsArrayBuffer(e),o(t)}function a(e){var t=new FileReader;return t.readAsText(e),o(t)}function i(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(d.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(d.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else{if(e)throw new Error("unsupported BodyInit type");this._bodyText=""}},d.blob?(this.blob=function(){var e=r(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(u)},this.text=function(){var e=r(this);if(e)return e;if(this._bodyBlob)return a(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var e=r(this);return e?e:Promise.resolve(this._bodyText)},d.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}function s(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}function c(e,t){if(t=t||{},this.url=e,this.credentials=t.credentials||"omit",this.headers=new n(t.headers),this.method=s(t.method||"GET"),this.mode=t.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&t.body)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(t.body)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function l(e){var t=new n,r=e.getAllResponseHeaders().trim().split("\n");return r.forEach(function(e){var n=e.trim().split(":"),r=n.shift().trim(),o=n.join(":").trim();t.append(r,o)}),t}function p(e,t){t||(t={}),this._initBody(e),this.type="default",this.url=null,this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof n?t.headers:new n(t.headers),this.url=t.url||""}if(!self.fetch){n.prototype.append=function(n,r){n=e(n),r=t(r);var o=this.map[n];o||(o=[],this.map[n]=o),o.push(r)},n.prototype["delete"]=function(t){delete this.map[e(t)]},n.prototype.get=function(t){var n=this.map[e(t)];return n?n[0]:null},n.prototype.getAll=function(t){return this.map[e(t)]||[]},n.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},n.prototype.set=function(n,r){this.map[e(n)]=[t(r)]},n.prototype.forEach=function(e){var t=this;Object.getOwnPropertyNames(this.map).forEach(function(n){e(n,t.map[n])})};var d={blob:"FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in self},y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];i.call(c.prototype),i.call(p.prototype),self.Headers=n,self.Request=c,self.Response=p,self.fetch=function(e,t){var n;return n=c.prototype.isPrototypeOf(e)&&!t?e:new c(e,t),new Promise(function(e,t){function r(){return"responseURL"in o?o.responseURL:/^X-Request-URL:/m.test(o.getAllResponseHeaders())?o.getResponseHeader("X-Request-URL"):void 0}var o=new XMLHttpRequest;o.onload=function(){var n=1223===o.status?204:o.status;if(100>n||n>599)return void t(new TypeError("Network request failed"));var u={status:n,statusText:o.statusText,headers:l(o),url:r()},a="response"in o?o.response:o.responseText;e(new p(a,u))},o.onerror=function(){t(new TypeError("Network request failed"))},o.open(n.method,n.url,!0),"include"===n.credentials&&(o.withCredentials=!0),"responseType"in o&&d.blob&&(o.responseType="blob"),n.headers.forEach(function(e,t){t.forEach(function(t){o.setRequestHeader(e,t)})}),o.send("undefined"==typeof n._bodyInit?null:n._bodyInit)})},self.fetch.polyfill=!0}}()},,function(e,t){e.exports=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){for(var n=t.parentNode;null!=n;){if(n==e)return!0;n=n.parentNode}return!1}function i(e){var t=function(t){function n(){o(this,n),l(Object.getPrototypeOf(n.prototype),"constructor",this).apply(this,arguments)}return u(n,t),f(n,[{key:"handleDocumentClick",value:function(e,t){var n=t.target||t.srcElement;a(d["default"].findDOMNode(this),n)||e()}},{key:"bindOuterClickHandler",value:function(e){window.addEventListener("click",this.handleDocumentClick.bind(this,e))}},{key:"unbindOuterClickHandler",value:function(e){window.removeEventListener("click",this.handleDocumentClick.bind(this,e))}},{key:"render",value:function(){return d["default"].createElement(e,c({},this.props,{bindOuterClickHandler:this.bindOuterClickHandler.bind(this),unbindOuterClickHandler:this.unbindOuterClickHandler.bind(this)}))}}]),n}(d["default"].Component);return t}function s(e){var t=function(t){function n(){o(this,n),l(Object.getPrototypeOf(n.prototype),"constructor",this).call(this),this.state={open:!1}}return u(n,t),f(n,[{key:"componentDidUpdate",value:function(e,t){this.state.open?this.props.bindOuterClickHandler(this.closeDropdown.bind(this)):this.props.unbindOuterClickHandler(this.closeDropdown.bind(this))}},{key:"componentWillUnmount",value:function(){this.props.unbindOuterClickHandler(this.closeDropdown.bind(this))}},{key:"getDropdownStatus",value:function(){return this.state.open}},{key:"openDropdown",value:function(){this.setState({open:!0})}},{key:"closeDropdown",value:function(){this.setState({open:!1})}},{key:"toggleDropdown",value:function(){this.setState({open:!this.state.open})}},{key:"render",value:function(){return d["default"].createElement(e,c({},this.props,{getDropdownStatus:this.getDropdownStatus.bind(this),toggleDropdown:this.toggleDropdown.bind(this),openDropdown:this.openDropdown.bind(this),closeDropdown:this.closeDropdown.bind(this)}))}}]),n}(d["default"].Component);return i(t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;te;e+=2){var t=re[e],n=re[e+1];t(n),re[e]=void 0,re[e+1]=void 0}K=0}function v(){try{var e=n(51);return Q=e.runOnLoop||e.runOnContext,p()}catch(t){return m()}}function g(){}function b(){return new TypeError("You cannot resolve a promise with itself")}function _(){return new TypeError("A promises callback cannot return that same promise.")}function w(e){try{return e.then}catch(t){return ie.error=t,ie}}function x(e,t,n,r){try{e.call(t,n,r)}catch(o){return o}}function O(e,t,n){X(function(e){var r=!1,o=x(n,t,function(n){r||(r=!0,t!==n?j(e,n):E(e,n))},function(t){r||(r=!0,S(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,S(e,o))},e)}function P(e,t){t._state===ue?E(e,t._result):t._state===ae?S(e,t._result):M(t,void 0,function(t){j(e,t)},function(t){S(e,t)})}function T(e,t){if(t.constructor===e.constructor)P(e,t);else{var n=w(t);n===ie?S(e,ie.error):void 0===n?E(e,t):i(n)?O(e,t,n):E(e,t)}}function j(e,t){e===t?S(e,b()):a(t)?T(e,t):E(e,t)}function A(e){e._onerror&&e._onerror(e._result),k(e)}function E(e,t){e._state===oe&&(e._result=t,e._state=ue,0!==e._subscribers.length&&X(k,e))}function S(e,t){e._state===oe&&(e._state=ae,e._result=t,X(A,e))}function M(e,t,n,r){var o=e._subscribers,u=o.length;e._onerror=null,o[u]=t,o[u+ue]=n,o[u+ae]=r,0===u&&e._state&&X(k,e)}function k(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r,o,u=e._result,a=0;aa;a++)M(r.resolve(e[a]),void 0,t,n);return o}function L(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(g);return j(n,e),n}function G(e){var t=this,n=new t(g);return S(n,e),n}function U(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Y(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function q(e){this._id=ye++,this._state=void 0,this._result=void 0,this._subscribers=[],g!==e&&(i(e)||U(),this instanceof q||Y(),I(this,e))}function H(){var e;if("undefined"!=typeof o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=e.Promise;(!n||"[object Promise]"!==Object.prototype.toString.call(n.resolve())||n.cast)&&(e.Promise=me)}var V;V=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var Q,W,$,z=V,K=0,X=({}.toString,function(e,t){re[K]=e,re[K+1]=t,K+=2,2===K&&(W?W(h):$())}),J="undefined"!=typeof window?window:void 0,Z=J||{},ee=Z.MutationObserver||Z.WebKitMutationObserver,te="undefined"!=typeof e&&"[object process]"==={}.toString.call(e),ne="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,re=new Array(1e3);$=te?l():ee?d():ne?y():void 0===J?v():m();var oe=void 0,ue=1,ae=2,ie=new D,se=new D;F.prototype._validateInput=function(e){return z(e)},F.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},F.prototype._init=function(){this._result=new Array(this.length)};var ce=F;F.prototype._enumerate=function(){for(var e=this,t=e.length,n=e.promise,r=e._input,o=0;n._state===oe&&t>o;o++)e._eachEntry(r[o],o)},F.prototype._eachEntry=function(e,t){var n=this,r=n._instanceConstructor;s(e)?e.constructor===r&&e._state!==oe?(e._onerror=null,n._settledAt(e._state,t,e._result)):n._willSettleAt(r.resolve(e),t):(n._remaining--,n._result[t]=e)},F.prototype._settledAt=function(e,t,n){var r=this,o=r.promise;o._state===oe&&(r._remaining--,e===ae?S(o,n):r._result[t]=n),0===r._remaining&&E(o,r._result)},F.prototype._willSettleAt=function(e,t){var n=this;M(e,void 0,function(e){n._settledAt(ue,t,e)},function(e){n._settledAt(ae,t,e)})};var fe=B,le=N,pe=L,de=G,ye=0,me=q;q.all=fe,q.race=le,q.resolve=pe,q.reject=de,q._setScheduler=c,q._setAsap=f,q._asap=X,q.prototype={constructor:q,then:function(e,t){var n=this,r=n._state;if(r===ue&&!e||r===ae&&!t)return this;var o=new this.constructor(g),u=n._result;if(r){var a=arguments[r-1];X(function(){R(r,o,a,u)})}else M(n,o,e,t);return o},"catch":function(e){return this.then(null,e)}};var he=H,ve={Promise:me,polyfill:he};n(52).amd?(r=function(){return ve}.call(t,n,t,u),!(void 0!==r&&(u.exports=r))):"undefined"!=typeof u&&u.exports?u.exports=ve:"undefined"!=typeof this&&(this.ES6Promise=ve),he()}).call(this)}).call(t,n(23),function(){return this}(),n(50)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(54),u=r(o),a=n(55),i=r(a),s=n(56),c=r(s),f=n(107),l=r(f),p=n(108),d=r(p),y=n(115),m=r(y),h=n(124),v=r(h),g=n(138),b=r(g),_=n(109),w=r(_),x=n(139),O=r(x),P=n(140),T=r(P),j=n(106),A=w["default"];A._=j._,A.constant=u["default"],A["if"]=l["default"],A.ifElse=d["default"],A.is=c["default"],A.freeze=i["default"],A.map=m["default"],A.omit=v["default"],A.reject=b["default"],A.update=w["default"],A.updateIn=O["default"],A.withDefault=T["default"],t["default"]=A,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=a["default"](e);return function(){return t}}t.__esModule=!0;var u=n(55),a=r(u);t["default"]=o,e.exports=t["default"]},function(e,t,n){(function(n){"use strict";function r(e){return null===e?!1:Array.isArray(e)||"object"==typeof e}function o(e){return r(e)&&!Object.isFrozen(e)}function u(e){return Object.freeze(e),Object.keys(e).forEach(function(t){var n=e[t];o(n)&&u(n)}),e}function a(e){return"production"===n.env.NODE_ENV?e:(o(e)&&u(e),e)}t.__esModule=!0,t["default"]=a,e.exports=t["default"]}).call(t,n(23))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){for(var r=a["default"](e),o=n,u=void 0,i=r,s=Array.isArray(i),c=0,i=s?i:i[Symbol.iterator]();;){if(s){if(c>=i.length)break;u=i[c++]}else{if(c=i.next(),c.done)break;u=c.value}if("undefined"==typeof o)return!1;o=o[u]}return"function"==typeof t?t(o):t===o}t.__esModule=!0;var u=n(57),a=r(u),i=n(106),s=r(i);t["default"]=s["default"](o),e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Array.isArray(e)?e:a["default"](e.split("."),function(e){return!e})}t.__esModule=!0,t["default"]=o;var u=n(58),a=r(u);e.exports=t["default"]},function(e,t,n){function r(e,t,n){var r=i(e)?o:a;return t=u(t,n,3),r(e,function(e,n,r){return!t(e,n,r)})}var o=n(59),u=n(60),a=n(100),i=n(81);e.exports=r},function(e,t){function n(e,t){for(var n=-1,r=e.length,o=-1,u=[];++nc))return!1;for(;++s-1&&e%1==0&&r>=e}var r=9007199254740991;e.exports=n},function(e,t,n){function r(e){for(var t=s(e),n=t.length,r=n&&e.length,c=!!r&&i(r)&&(u(e)||o(e)),l=-1,p=[];++l-1&&e%1==0&&t>e}var r=/^\d+$/,o=9007199254740991;e.exports=n},function(e,t,n){function r(e){if(null==e)return[];s(e)||(e=Object(e));var t=e.length;t=t&&i(t)&&(u(e)||o(e))&&t||0;for(var n=e.constructor,r=-1,c="function"==typeof n&&n.prototype===e,l=Array(t),p=t>0;++rr;)e=e[t[r++]];return r&&r==u?e:void 0}}var o=n(85);e.exports=r},function(e,t){function n(e,t,n){var r=-1,o=e.length;t=null==t?0:+t||0,0>t&&(t=-t>o?0:o+t),n=void 0===n||n>o?o:+n||0,0>n&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var u=Array(o);++rt&&(n=t);e[n-1]===s;)n--;return n}function r(e){return function t(r){for(var o=arguments.length,u=Array(o>1?o-1:0),a=1;o>a;a++)u[a-1]=arguments[a];var i=u[0],s=u[1],c=n(arguments);return c>=1?e(r,i,s):t}}function o(e){return function t(o,u){for(var a=arguments.length,i=Array(a>2?a-2:0),c=2;a>c;c++)i[c-2]=arguments[c];var f=i[0],l=i[1],p=n(arguments,2);if(u===s||f===s||l===s)throw new Error("Can only use placeholder on first argument of this function.");return p>=2?o===s?r(function(t,n,r){return e(t,u,n,r)}):e(o,u,f,l):1===p?r(function(t,n,r){return e(o,t,n,r)}):t}}function u(e){return function t(u,a,i){for(var c=arguments.length,f=Array(c>3?c-3:0),l=3;c>l;l++)f[l-3]=arguments[l];var p=f[0],d=f[1],y=n(arguments,3);if(i===s||p===s||d===s)throw new Error("Can only use placeholder on first or second argument of this function.");return y>=3?u===s?a===s?o(function(t,n,r,o){return e(t,n,i,r,o)}):r(function(t,n,r){return e(t,a,i,n,r)}):a===s?r(function(t,n,r){return e(u,t,i,n,r)}):e(u,a,i,p,d):2===y?u===s?o(function(t,n,r,o){return e(t,a,n,r,o)}):r(function(t,n,r){return e(u,a,t,n,r)}):1===y?o(function(t,n,r,o){return e(u,t,n,r,o)}):t}}function a(e){return function t(a,i,c,f){for(var l=arguments.length,p=Array(l>4?l-4:0),d=4;l>d;d++)p[d-4]=arguments[d];var y=p[0],m=p[1],h=n(arguments,4);if(f===s||y===s||m===s)throw new Error("Can only use placeholder on first, second or third argument of this function.");return h>=4?a===s?i===s?c===s?u(function(t,n,r,o,u){return e(t,n,r,f,o,u)}):o(function(t,n,r,o){return e(t,n,c,f,r,o)}):c===s?o(function(t,n,r,o){return e(t,i,n,f,r,o)}):r(function(t,n,r){return e(t,i,c,f,n,r)}):i===s?c===s?o(function(t,n,r,o){return e(a,t,n,f,r,o)}):r(function(t,n,r){return e(a,t,c,f,n,r)}):c===s?r(function(t,n,r){return e(a,i,t,f,n,r)}):e(a,i,c,f,y,m):3===h?a===s?i===s?u(function(t,n,r,o,u){return e(t,n,c,r,o,u)}):o(function(t,n,r,o){return e(t,i,c,n,r,o)}):i===s?o(function(t,n,r,o){return e(a,t,c,n,r,o)}):r(function(t,n,r){return e(a,i,c,t,n,r)}):2===h?a===s?u(function(t,n,r,o,u){return e(t,i,n,r,o,u)}):o(function(t,n,r,o){return e(a,i,t,n,r,o)}):1===h?u(function(t,n,r,o,u){return e(a,t,n,r,o,u)}):t}}function i(e){var t=arguments.length<=1||void 0===arguments[1]?e.length:arguments[1];return function(){return[e,r,o,u,a][t](e)}()}t.__esModule=!0,t.curry1=r,t.curry2=o,t.curry3=u,t.curry4=a,t["default"]=i;var s="@@updeep/placeholder";t._=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(108),u=r(o),a=n(106),i=r(a);t["default"]=i["default"](function(e,t,n){return u["default"](e,t,function(e){return e},n)}),e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n,r){var o="function"==typeof e?e(r):e,u=o?t:n;return a["default"](u,r)}t.__esModule=!0;var u=n(109),a=r(u),i=n(110),s=r(i);t["default"]=s["default"](o),e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return Object.keys(e).reduce(function(n,r){return t(n,e[r],r)},n)}function u(e,t){return o(e,function(e,n,r){var o=n;return Array.isArray(n)||null===n||"object"!=typeof n?"function"==typeof n&&(o=n(t[r])):o=i(n,t[r]),t[r]!==o&&(e[r]=o),e},{})}function a(e,t){var n=[].concat(t);return Object.keys(e).forEach(function(t){n[t]=e[t]}),n}function i(e,t){if("function"==typeof e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;n>o;o++)r[o-2]=arguments[o];return e.apply(void 0,[t].concat(r))}if(!h["default"](e))return e;var i=y["default"](t,e),c=u(e,i);return p["default"](c)?i:Array.isArray(i)?a(c,i):s({},i,c)}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t=t.length)break;u=t[r++]}else{if(r=t.next(),r.done)break;u=r.value}var a=u;if(!o(a))return!1}return!0}function a(e){return!c["default"](e)&&u(e)?[]:{}}function i(e,t){return"undefined"==typeof e||null===e?a(t):e}t.__esModule=!0;var s=n(111),c=r(s);t["default"]=i,e.exports=t["default"]},function(e,t,n){function r(e){var t;if(!a(e)||f.call(e)!=i||u(e)||!c.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return o(e,function(e,t){n=t}),void 0===n||c.call(e,n)}var o=n(114),u=n(80),a=n(74),i="[object Object]",s=Object.prototype,c=s.hasOwnProperty,f=s.toString;e.exports=r},function(e,t,n){function r(e,t){return o(e,t,u)}var o=n(103),u=n(83);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=!0;return l["default"](t,function(t,r){return t!==e[r]?(n=!1,!1):void 0}),n}function u(e,t){var n="function"==typeof e?e:i["default"](e),r=Array.isArray(t)?d["default"]:m["default"],u=r(t,n),a=o(t,u);return a?t:u}t.__esModule=!0;var a=n(109),i=r(a),s=n(110),c=r(s),f=n(116),l=r(f),p=n(119),d=r(p),y=n(122),m=r(y);t["default"]=c["default"](u),e.exports=t["default"]},function(e,t,n){var r=n(117),o=n(101),u=n(118),a=u(r,o);e.exports=a},function(e,t){function n(e,t){for(var n=-1,r=e.length;++n=i?a(t):null,p=t.length;l&&(c=u,f=!1,t=l);e:for(;++s=0)e="clock-o";else{if(!(["string"].indexOf(this.props.type)>=0))return["integer","number"].indexOf(this.props.type)>=0?_({},"#"):_({},this.props.type);e="font"}return b({className:p["default"]("fa","fa-"+e)})}}]),t}(f["default"].Component),P=function(e){function t(){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return u(t,e),i(t,[{key:"render",value:function(){return g({className:"datasource-table-field"},g({className:"icon-wrap"},f["default"].createElement(O,{type:this.props.type})),g({className:"name-wrap"},this.props.name))}}]),t}(f["default"].Component),T=[{id:"agg_count",name:"COUNT",type:"operator",op:"count"}],j=function(e){function t(){o(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return u(t,e),i(t,[{key:"render",value:function(){if(null==this.props.tableId)return null;var e=h.getTable(this.props.sources,this.props.tableId);return e.isLoading?g({className:"datasource-table-fields"},"Loading..."):g({className:"datasource-table-fields"},T.map(function(e){return f["default"].createElement(P,a({key:e.id},e))}),e.schema.map(function(e,t){return f["default"].createElement(P,a({key:e.__id__||t},e))}))}}]),t}(f["default"].Component);t.DataSourceSelect=x,t.TableSchema=j}]);
\ No newline at end of file
diff --git a/src/components/Dropdown.js b/src/components/Dropdown.js
deleted file mode 100644
index 6389731..0000000
--- a/src/components/Dropdown.js
+++ /dev/null
@@ -1,98 +0,0 @@
-import React from 'react'
-import ReactDOM from 'react-dom'
-const { findDOMNode } = ReactDOM
-
-function contains(parent, child) {
- var node = child.parentNode
- while (node != null) {
- if (node == parent) {
- return true
- }
- node = node.parentNode
- }
- return false
-}
-
-export function handleOuterClick(Component) {
- class ClickHandler extends React.Component {
- constructor(props) {
- super(props)
- this.bindOuterClickHandler = this.bindOuterClickHandler.bind(this)
- this.unbindOuterClickHandler = this.unbindOuterClickHandler.bind(this)
- this.handleDocumentClick = this.handleDocumentClick.bind(this)
- }
-
- handleDocumentClick(onOuterClick) {
- return (evt) => {
- let target = evt.target || evt.srcElement
- if (target.parentNode != null && !contains(findDOMNode(this), target)) {
- onOuterClick()
- }
- }
- }
-
- bindOuterClickHandler(onOuterClick) {
- window.addEventListener('click', onOuterClick)
- }
-
- unbindOuterClickHandler(onOuterClick) {
- window.removeEventListener('click', onOuterClick)
- }
-
- render() {
- return
- }
- }
-
- return ClickHandler
-}
-
-export function createDropdownComponent(Component) {
- class Dropdown extends React.Component {
- constructor(props) {
- super(props)
- this.state = { open: false }
- this.openDropdown = this.openDropdown.bind(this)
- this.closeDropdown = this.closeDropdown.bind(this)
- this.toggleDropdown = this.toggleDropdown.bind(this)
- this.onOuterClick = this.props.handleDocumentClick(this.closeDropdown)
- }
-
- componentDidUpdate(prevProps, prevState) {
- if (this.state.open)
- this.props.bindOuterClickHandler(this.onOuterClick)
- else
- this.props.unbindOuterClickHandler(this.onOuterClick)
- }
-
- componentWillUnmount() {
- this.props.unbindOuterClickHandler(this.onOuterClick)
- }
-
- openDropdown() {
- this.setState({open: true})
- }
-
- closeDropdown() {
- this.setState({open: false})
- }
-
- toggleDropdown() {
- this.setState({open: !this.state.open})
- }
-
- render() {
- return
- }
- }
-
- return handleOuterClick(Dropdown)
-}
diff --git a/src/components/arc.js b/src/components/arc.js
deleted file mode 100644
index 9600e19..0000000
--- a/src/components/arc.js
+++ /dev/null
@@ -1,20 +0,0 @@
-function polarToCartesian(centerX, centerY, radiusX, radiusY, angleInDegrees) {
- var angleInRadians = angleInDegrees * Math.PI / 180.0
-
- return {
- x: centerX + (radiusX * Math.cos(angleInRadians)),
- y: centerY + (radiusY * Math.sin(angleInRadians))
- }
-}
-
-function describeArc(x, y, radiusX, radiusY, startAngle, endAngle){
- var start = polarToCartesian(x, y, radiusX, radiusY, endAngle)
- var end = polarToCartesian(x, y, radiusX, radiusY, startAngle)
- var arcSweep = endAngle - startAngle <= 180 ? "0" : "1"
- return [
- "M", start.x, start.y,
- "A", radiusX, radiusY, 0, arcSweep, 0, end.x, end.y
- ].join(" ")
-}
-
-export { describeArc }
diff --git a/src/components/axis.js b/src/components/axis.js
deleted file mode 100644
index 7d8616c..0000000
--- a/src/components/axis.js
+++ /dev/null
@@ -1,64 +0,0 @@
-import React from 'react'
-import classNames from 'classnames'
-import { d3_scaleRange } from './d3_scale'
-
-class Axis extends React.Component {
- render() {
- let orient = this.props.orient, scale = this.props.scale, innerTickSize = this.props.innerTickSize, outerTickSize = this.props.outerTickSize,
- tickArguments = this.props.tickArguments,
- tickValues = this.props.tickValues != null ? this.props.tickValues : (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()),
- tickFormat = this.props.tickFormat != null ? this.props.tickFormat : (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : (x => x)),
- tickSpacing = Math.max(this.props.innerTickSize, 0) + this.props.tickPadding,
- range = d3_scaleRange(scale),
- sign = orient === "top" || orient === "left" ? -1 : 1
-
- let tickDirection = orient === 'bottom' || orient === 'top' ? {
- x: 0, x2: 0, y: sign * tickSpacing, y2: sign * innerTickSize
- } : {
- x: sign * tickSpacing, x2: sign * innerTickSize, y: 0, y: 0
- }
-
- let tickTextProps = orient === 'bottom' || orient === 'top' ? {
- x: 0,
- y: sign * tickSpacing,
- dy: sign < 0 ? "0em" : ".71em",
- textAnchor: "middle"
- } : {
- x: sign * tickSpacing,
- y: 0,
- dy: ".32em",
- textAnchor: sign < 0 ? "end" : "start"
- }
-
- let axisClass = {
- axis: true,
- x: orient === 'top' || orient === 'bottom',
- y: orient === 'left' || orient === 'right'
- }
-
- let guide = orient === 'bottom' || orient === 'top' ?
- ( ) :
- ( )
-
- let tickMarks = tickValues.map(
- (tick, i) =>
-
-
- {tick}
- )
-
- return {tickMarks}{guide}
- }
-}
-
-Axis.defaultProps = {
- orient: "bottom",
- innerTickSize: 6,
- outerTickSize: 6,
- tickPadding: 3,
- tickArguments: [10],
- tickValues: null,
- tickFormat: null
-}
-
-export default Axis
diff --git a/src/components/basketball.js b/src/components/basketball.js
deleted file mode 100644
index c5e2baa..0000000
--- a/src/components/basketball.js
+++ /dev/null
@@ -1,200 +0,0 @@
-import React from 'react'
-import { describeArc } from './arc'
-import { ShotChartInteractionSignals, ShotChartInteractionPredicates, ShotChartInteractionFilters, filterExclude } from './basketball/interactions'
-import { ShotAggregates } from './basketball/aggregates'
-import { ShotChart } from './basketball/court'
-import { fieldHistogram, CourtXHistogram, CourtYHistogram } from './basketball/histograms'
-
-class CourtBounds extends React.Component {
- render() {
- let [hoopcenterx, hoopcentery] = [this.props.xscale(0), this.props.yscale(0)]
- let xstart = this.props.xscale(250)
- let xend = this.props.xscale(-250)
- let ystart = this.props.yscale(422.5)
- let yend = this.props.yscale(-47.5)
- let courtheight = yend - ystart
- let courtwidth = Math.abs(xend - xstart)
- let threeradiusx = Math.abs(this.props.xscale(237.5) - hoopcenterx)
- let threeradiusy = hoopcentery - this.props.yscale(237.5)
- let threearc = describeArc(hoopcenterx, hoopcentery, threeradiusx, threeradiusy, -158, -22)
- let centerarc = describeArc(hoopcenterx, ystart, Math.abs(this.props.xscale(60) - hoopcenterx), hoopcentery - this.props.yscale(60), 0, 180)
- let innercenterarc = describeArc(hoopcenterx, ystart, Math.abs(this.props.xscale(20) - hoopcenterx), hoopcentery - this.props.yscale(20), 0, 180)
- let freethrowwidth = Math.abs(this.props.xscale(160) - this.props.xscale(0))
- let freethrowheight = Math.abs(this.props.yscale(-47.5 + 190) - yend)
- let freethrowarcR = Math.abs(this.props.xscale(60) - hoopcenterx)
- let freethrowinnerarc = describeArc(hoopcenterx, this.props.yscale(-47.5 + 190), freethrowarcR, hoopcentery - this.props.yscale(60), 0, 180)
- let freethrowouterarc = describeArc(hoopcenterx, this.props.yscale(-47.5 + 190), freethrowarcR, hoopcentery - this.props.yscale(60), -180, 0)
- let restrictedArc = describeArc(hoopcenterx, hoopcentery, Math.abs(this.props.xscale(40) - hoopcenterx), hoopcentery - this.props.yscale(40), -180, 0)
-
- return
- {/* hoop */}
-
-
- {/* court boundary */}
-
- {/* center arc */}
-
-
- {/* free throw area */}
-
-
-
-
- {/* restricted area arc */}
-
-
-
-
-
- }
-}
-
-class BasketBall extends React.Component {
- render() {
- return
- }
-}
-
-function aggregateCountData(name, field) {
- return {
- "name": name,
- "source": "table",
- "transform": [
- {
- "type": "aggregate",
- "groupby" : { "field": `bin_${field}` },
- "summarize": {[field]: ["count"]}
- }
- ]
- }
-}
-
-var ShotChartSpec = {
- "width": 960,
- "height": 800,
- "data": [
- {
- "name": "table",
- "transform": [
- {"type": "formula", "field": "POINTS", "expr": "parseInt(datum.SHOT_TYPE)"},
- {"type": "formula", "field": "MADE_POINTS", "expr": "datum.POINTS * datum.SHOT_MADE_FLAG"},
- {"type": "formula", "field": "hoopdistance", "expr": "datum.SHOT_DISTANCE"},
- {"type": "formula", "field": "timepassed", "expr": "(datum.PERIOD * 12 * 60 - (datum.MINUTES_REMAINING * 60 + datum.SECONDS_REMAINING))/60"},
- {"type": "bin", "field": "hoopdistance", "min": 0, "max": 90, "step": 1, "output": { "bin": "bin_hoopdistance" }},
- {"type": "bin", "field": "timepassed", "min": 0, "max": 64, "step": 1, "output": { "bin": "bin_timepassed" }},
- {"type": "bin", "field": "LOC_X", "min": -260, "max": 260, "step": 5, "output": { "bin": "bin_LOC_X" }},
- {"type": "bin", "field": "LOC_Y", "min": -50, "max": 470, "step": 5, "output": { "bin": "bin_LOC_Y" }}
- ]
- },
- aggregateCountData('distance', 'hoopdistance'),
- aggregateCountData('time', 'timepassed'),
- aggregateCountData('xdistance', 'LOC_X'),
- aggregateCountData('ydistance', 'LOC_Y'),
- {
- "name": "percentages",
- "source": "table",
- "transform": [
- {
- "type": "filter",
- "test": `${filterExclude()} && ${ShotChartInteractionFilters.brush}`
- },
- {
- "type": "aggregate",
- "summarize": {"*": ["count"], "MADE_POINTS": ["sum"], "SHOT_MADE_FLAG": ["sum"]}
- },
- {
- "type": "formula",
- "field": "FGP",
- "expr": "datum.sum_SHOT_MADE_FLAG / datum.count"
- },
- {
- "type": "formula",
- "field": "PPA",
- "expr": "datum.sum_MADE_POINTS / datum.count"
- }
- ]
- },
- {
- "name": "rects",
- "values": [
- {"index": 0, "text": "Shot Attempts", "x": 0, "width": 0, "height": 0, "average": 0.5},
- {"index": 0, "text": "Points Scored", "x": 125, "width": 0, "height": 0, "average": 0.5},
- {"index": 0, "text": "FG%", "x": 250, "width": 100, "height": 10, "average": 92279 / 205550},
- {"index": 0, "text": "Points per Attempt", "x": 375, "width": 100, "height": 10, "average": 203841 / 205550 / 3}
- ]
- },
- { "name": "arcs",
- "values": [
- // center court arc
- { "x": 0 , "y": -47.5 + 470 , "radius": 60 , "startAngle": 90 , "endAngle": 270 } ,
- { "x": 0 , "y": -47.5 + 470 , "radius": 20 , "startAngle": 90 , "endAngle": 270 } ,
- // restricted area
- { "x": 0 , "y": 0 , "radius": 40 , "startAngle": -90 , "endAngle": 90 } ,
- // three point
- { "x": 0 , "y": 0 , "radius": 237.5 , "startAngle": -68 , "endAngle": 68 } ,
- { "x": 0 , "y": 0 , "radius": 7.5 , "startAngle": 0 , "endAngle": 360 } ,
- // free throw arc
- { "x": 0 , "y": 142.5 , "radius": 60 , "startAngle": -90 , "endAngle": 90 } ,
- { "x": 0 , "y": 142.5 , "radius": 60 , "startAngle": -90 , "endAngle": -270, "strokeDash": [5 , 14] }
- ]},
- { "name": "courtLines",
- "values": [
- { "x": -250, "x2": -250 + 500, "y": -47.5, "y2": -47.5 + 470},
- { "x": 30, "y": -7.5, "x2": -30, "y2": -8.5 },
- { "x": 60, "y": 150-7.5, "x2": -60, "y2": -47.5 },
- { "x": 80, "y": 150-7.5, "x2": -80, "y2": -47.5 },
- { "x": -220, "y": 90, "x2": -220.2, "y2": -47.5 },
- { "x": 220.2, "y": 90, "x2": 220, "y2": -47.5 }
- ]},
- ],
- "signals": ShotChartInteractionSignals,
- "predicates": ShotChartInteractionPredicates,
-
- "scales": [
- {
- "name": "degreeRadians",
- "type": "linear",
- "domain": [0, 360],
- // "range" : [0, 2 * Math.PI]
- "range" : [Math.PI , 3 * Math.PI]
- },
- {
- "name": "makeOpacity",
- "type": "linear",
- "domain": [0, 1],
- "range": [0.4, 0.8]
- },
- {
- "name": "makeColor",
- "type": "ordinal",
- "domain": { "data": "table", "field": "EVENT_TYPE" },
- "range": ["#EA4929", "#31a354"]
- },
- {
- "name": "playerSymbol",
- "type": "ordinal",
- "domain": { "data": "table", "field": "PLAYER_NAME" },
- "range": ["circle", "square", "cross", "diamond", "triangle-up", "triangle-down"]
- }
- ],
- "legends": [
- {
- "orient": "left",
- "fill": "makeColor"
- }
- ],
- "marks": [
- ShotAggregates,
- fieldHistogram('distance',
- `${filterExclude('hoopdistance')} && ${ShotChartInteractionFilters.brush}`,
- 'dist', 'hoopdistance', [0, 50], 2.5, "Shot Distance from Hoop (in feet)"),
- fieldHistogram('time',
- `${filterExclude('timepassed')} && ${ShotChartInteractionFilters.brush}`,
- 'timepassed', 'timepassed', [0, 64], 162.5, "Game Time (in minutes from start)"),
- CourtXHistogram,
- CourtYHistogram,
- ShotChart
- ]
-}
-
-export {CourtBounds, BasketBall, ShotChartSpec}
diff --git a/src/components/basketball/aggregates.js b/src/components/basketball/aggregates.js
deleted file mode 100644
index 8005af1..0000000
--- a/src/components/basketball/aggregates.js
+++ /dev/null
@@ -1,160 +0,0 @@
-var ShotAggregates = {
- "type": "group",
- "properties": {
- "update": {
- "x": { "value": 0 },
- "y": { "value": 2.5 },
- "width": { "value": 500 },
- "height": { "value": 50 }
- }
- },
- "scales": [
- {
- "name": "xfgp",
- "type": "linear",
- "range": [250, 350],
- // "reverse" : true, // hoop on bottom view
- "domain": [0, 1]
- },
- {
- "name": "xppa",
- "type": "linear",
- "range": [375, 475],
- // "reverse" : true, // hoop on bottom view
- "domain": [0, 3]
- }
- ],
- "marks": [
- {
- "type": "rect",
- "from": {"data": "rects"},
- "properties": {
- "update": {
- "width": { "field": "width" },
- "height": { "field": "height" },
- "x": { "field": "x"},
- "fill": {
- "value": {
- "id": "rgb",
- "x1": 0.0,
- "y1": 0.0,
- "x2": 1.0,
- "y2": 0.0,
- "stops": [
- {"color": "#e6550d", "offset": 0.0},
- {"color": "#31a354", "offset": 0.5},
- {"color": "#31a354", "offset": 1},
- ]
- }
- }
- }
- }
- },
- {
- "from": {"data": "rects"},
- "type": "text",
- "properties": {
- "enter": {
- "x": {"field": "x"},
- "y": {"value": -5},
- "text": {"field": "text"},
- "fill": {"value": "black"},
- "fontSize": {"value": 14},
- "fontWeight": {"value": "bold"}
- }
- }
- },
- {
- "from": {"data": "percentages"},
- "type": "text",
- "properties": {
- "update": {
- "x": {"value": 0},
- "dx": {"value": 0},
- "y": {"value": 25},
- "text": {
- "template": "{{datum.count | number:','}}"
- },
- "fill": {"value": "black"},
- "fontSize": {"value": 30}
- }
- }
- },
- {
- "from": {"data": "percentages"},
- "type": "text",
- "properties": {
- "update": {
- "x": {"value": 125},
- "dx": {"value": 0},
- "y": {"value": 25},
- "text": {
- "template": "{{datum.sum_MADE_POINTS | number:','}}"
- },
- "fill": {"value": "black"},
- "fontSize": {"value": 30}
- }
- }
- },
- {
- "from": {"data": "percentages"},
- "type": "text",
- "properties": {
- "update": {
- "x": {"value": 250},
- "dx": {"value": 10},
- "y": {"value": 45},
- "text": {
- "template": "{{datum.FGP | number:'.1%'}}"
- },
- "fill": {"value": "black"},
- "fontSize": {"value": 30}
- }
- }
- },
- {
- "from": {"data": "percentages"},
- "type": "text",
- "properties": {
- "update": {
- "x": {"value": 375},
- "dx": {"value": 10},
- "y": {"value": 45},
- "text": {
- "template": "{{datum.PPA | number:'.2f'}}"
- },
- "fill": {"value": "black"},
- "fontSize": {"value": 30}
- }
- }
- },
- {
- "from": {"data": "percentages"},
- "type": "symbol",
- "properties": {
- "update": {
- "shape": { "value": "triangle-up" },
- "x": {"scale": "xfgp", "field": "FGP"},
- "y": {"value": 15},
- "size": {"value": 40},
- "fill": {"value": "black"}
- }
- }
- },
- {
- "from": {"data": "percentages"},
- "type": "symbol",
- "properties": {
- "update": {
- "shape": { "value": "triangle-up" },
- "x": {"scale": "xppa", "field": "PPA"},
- "y": {"value": 15},
- "size": {"value": 40},
- "fill": {"value": "black"}
- }
- }
- }
- ]
-}
-
-export { ShotAggregates }
diff --git a/src/components/basketball/court.js b/src/components/basketball/court.js
deleted file mode 100644
index 95c98d4..0000000
--- a/src/components/basketball/court.js
+++ /dev/null
@@ -1,131 +0,0 @@
-import { ShotChartInteractionSignals, ShotChartInteractionPredicates, filterExclude } from './interactions'
-
-var ShotChart = {
- "name": "shotChart",
- "type": "group",
- "properties": {
- "update": {
- "x": { "value": 0 },
- "y": { "value": 150 },
- "width": {"value": 450 },
- "height": {"value": 1.1 * 450 }
- }
- },
- "scales": [
- {
- "name": "width",
- "type": "linear",
- "range": "width",
- "domain": [0, 500]
- },
- {
- "name": "height",
- "type": "linear",
- "range": "height",
- "domain": [0, 550]
- },
- {
- "name": "x",
- "type": "linear",
- "range": "width",
- // "reverse" : true, // hoop on bottom view
- "domain": [-250, 250]
- },
- {
- "name": "y",
- "type": "linear",
- "range": "height",
- "reverse": true, // hoop on top view
- "domain": [-50, 500]
- },
- ],
- "marks": [
- {
- "type": "symbol",
- "from": {
- "data": "table",
- "transform": [
- {
- "type": "filter",
- "test": `${filterExclude()}`
- }
- ]
- },
- "key": "shot_id",
- "properties": {
- "enter": {
- "shape": { "scale": "playerSymbol", "field": "PLAYER_NAME" },
- "x": {"scale": "x", "value": 0},
- "y": {"scale": "y", "value": 0},
- "fill": { "scale": "makeColor", "field": "EVENT_TYPE" },
- "size": { "scale": "width", "value": 70 }
- },
- "update": {
- "x": {"scale": "x", "field": "LOC_X"},
- "y": {"scale": "y", "field": "LOC_Y"},
- "fillOpacity" : {
- "rule": [
- {
- "predicate": {"name": "chartBrush", "x": {"field": "LOC_X"}, "y": {"field": "LOC_Y"}},
- "value": 0.8
- },
- { "value": 0.2 }
- ]
- }
- },
- "exit": {
- "x": {"scale": "x", "value": 0},
- "y": {"scale": "y", "value": 0}
- }
- }
- },
- {
- "type": "arc",
- "from": {"data": "arcs"},
- "properties": {
- "enter": {
- "stroke": {"value": "#000000"},
- "strokeDash": {"field": "strokeDash"},
- "x": {"scale": "x", "field": "x"},
- "y": {"scale": "y", "field": "y"},
- "outerRadius": {"scale": "width", "field": "radius"},
- "innerRadius": {"scale": "width", "field": "radius"},
- "startAngle": {"scale": "degreeRadians", "field": "startAngle"},
- "endAngle": {"scale": "degreeRadians", "field": "endAngle"}
- }
- }
- },
- {
- "type": "rect",
- "from": {"data": "courtLines"},
- "properties": {
- "enter": {
- "fill": {"value": null},
- "stroke": {"value": "#000000"},
- "strokeWidth": {"value": 1},
- "x": {"scale": "x", "field": "x"},
- "y": {"scale": "y", "field": "y"},
- "x2": {"scale": "x", "field": "x2"},
- "y2": {"scale": "y", "field": "y2"}
- }
- }
- },
- {
- "type": "rect",
- "properties": {
- "enter": {
- "fill": {"value": "grey"},
- "fillOpacity": {"value": 0.2}
- },
- "update": {
- "x": {"scale": "x", "signal": "minchartX"},
- "x2": {"scale": "x", "signal": "maxchartX"},
- "y": {"scale": "y", "signal": "minchartY"},
- "y2": {"scale": "y", "signal": "maxchartY"}
- }
- }
- }
- ]
-}
-
-export { ShotChart }
diff --git a/src/components/basketball/histograms.js b/src/components/basketball/histograms.js
deleted file mode 100644
index 791b273..0000000
--- a/src/components/basketball/histograms.js
+++ /dev/null
@@ -1,296 +0,0 @@
-import { ShotChartInteractionSignals, ShotChartInteractionPredicates, ShotChartInteractionFilters, filterExclude } from './interactions'
-
-function fieldHistogram(data, filter, name, field, xdomain, y, title) {
- return {
- "name": `${name}Group`,
- "type": "group",
- "properties": {
- "update": {
- "x": { "value": 620 },
- "y": { "value": y },
- "width": {"value": 200 },
- "height": {"value": 100 },
- "fill": {"value": "#fff"}
- }
- },
- "scales": [
- {
- "name": "x",
- "type": "linear",
- "range": "width",
- "domain": xdomain
- },
- {
- "name": "y",
- "type": "linear",
- "range": "height",
- "domain": { "data": data, "field": `count_${field}` },
- "domainMin": 0
- },
- ],
- "axes": [{
- "type": "x", "scale": "x", "tickFormat": "0d", "ticks": 5
- }],
- "marks": [
- {
- "type": "rect",
- "from": {
- "data": "table",
- "transform": [
- {
- "type": "filter",
- "test": filter
- },
- {
- "type": "aggregate",
- "groupby" : [ `bin_${field}`, "EVENT_TYPE" ],
- "summarize": {"*": ["count"]}
- },
- { "type": "stack", "groupby": [`bin_${field}`], "field": "count", "sortby": "EVENT_TYPE" }
- ]
- },
- "properties": {
- "update": {
- "stroke": {"scale": "makeColor", "field": "EVENT_TYPE"},
- "fillOpacity": {
- "rule": [
- {
- "predicate": {"name": `${name}Brush`, "x": {"field": `bin_${field}`}},
- "value": 0.8
- },
- {"value": 0.2}
- ]
- },
- "x": {"scale": "x", "field": `bin_${field}`},
- "width": {"scale": "x", "value": 1},
- "y": {"scale": "y", "field": "layout_start"},
- "y2": {"scale": "y", "field": "layout_end"},
- "fill": {"scale": "makeColor", "field": "EVENT_TYPE"}
- },
- "exit": {
- "y": {"scale": "y", "value": 0},
- "y2": {"scale": "y", "value": 0}
- }
- }
- },
- {
- "type": "text",
- "properties": {
- "enter": {
- "x": {"value": -5},
- "y": {"value": -10},
- "text": {"value": title},
- "fill": {"value": "black"},
- "fontSize": {"value": 14},
- "fontWeight": {"value": "bold"}
- }
- }
- },
- {
- "type": "rect",
- "properties": {
- "enter": {
- "fill": {"value": "grey"},
- "fillOpacity": {"value": 0.2}
- },
- "update": {
- "x": {"scale": "x", "signal": `${name}Start`},
- "x2": {"scale": "x", "signal": `${name}End`},
- "y": {"value": 0},
- "y2": {"field": {"group": "height"}}
- }
- }
- }
- ]
- }
-}
-
-var CourtXHistogram = {
- "name": "xLocGroup",
- "type": "group",
- "properties": {
- "update": {
- "x": { "value": 0 },
- "y": { "value": 52.5 },
- "width": {"value": 450 },
- "height": {"value": 100 },
- "fill" : {"value": "#fff"}
- }
- },
- "scales": [
- {
- "name": "x",
- "type": "linear",
- "range": "width",
- // "reverse" : true, // hoop on bottom view
- "domain": [-250, 250]
- },
- {
- "name": "thickness",
- "type": "linear",
- "range": "width",
- "domain": [0, 500]
- },
- {
- "name": "y",
- "type": "linear",
- "range": "height",
- "domain": { "data": "xdistance", "field": "count_LOC_X" }
- },
- ],
- "marks": [
- {
- "type": "rect",
- "from": {
- "data": "table",
- "transform": [
- {
- "type": "filter",
- "test": `${filterExclude('LOC_X')} && ${ShotChartInteractionFilters.brush}`
- },
- {
- "type": "aggregate",
- "groupby" : ["bin_LOC_X", "EVENT_TYPE"],
- "summarize": {"*": ["count"]}
- },
- { "type": "stack", "groupby": ["bin_LOC_X"], "field": "count", "sortby": "EVENT_TYPE"}
- ]
- },
- "properties": {
- "update": {
- "stroke": {"scale": "makeColor", "field": "EVENT_TYPE"},
- "fillOpacity": {
- "rule": [
- {
- "predicate": {"name": "xLocBrush", "x": {"field": "bin_LOC_X"}},
- "value": 0.8
- },
- {"value": 0.2}
- ]
- },
- "x": {"scale": "x", "field": "bin_LOC_X"},
- "width": {"scale": "thickness", "value": 5},
- "y": {"scale": "y", "field": "layout_start"},
- "y2": {"scale": "y", "field": "layout_end"},
- "fill": {"scale": "makeColor", "field": "EVENT_TYPE"}
- },
- "exit": {
- "y": {"scale": "y", "value": 0},
- "y2": {"scale": "y", "value": 0}
- }
- }
- },
- {
- "type": "rect",
- "properties": {
- "enter": {
- "fill": {"value": "grey"},
- "fillOpacity": {"value": 0.2}
- },
- "update": {
- "x": {"scale": "x", "signal": "xLocStart"},
- "x2": {"scale": "x", "signal": "xLocEnd"},
- "y": {"value": 0},
- "y2": {"field": {"group": "height"}}
- }
- }
- }
- ]
-}
-
-var CourtYHistogram = {
- "name": "yLocGroup",
- "type": "group",
- "properties": {
- "update": {
- "x": { "value": 450 },
- "y": { "value": 150 },
- "width": {"value": 100 },
- "height": {"value": 660 },
- "fill": {"value": "#fff"}
- }
- },
- "scales": [
- {
- "name": "thickness",
- "type": "linear",
- "range": "height",
- "reverse": true,
- "domain": [0, 550]
- },
- {
- "name": "x",
- "type": "linear",
- "range": "width",
- "domain": { "data": "ydistance", "field": "count_LOC_Y" }
- },
- {
- "name": "y",
- "type": "linear",
- "range": "height",
- "reverse": true,
- "domain": [-50, 500]
- },
- ],
- "marks": [
- {
- "type": "rect",
- "from": {
- "data": "table",
- "transform": [
- {
- "type": "filter",
- "test": `${filterExclude('LOC_Y')} && ${ShotChartInteractionFilters.brush}`
- },
- {
- "type": "aggregate",
- "groupby" : ["bin_LOC_Y", "EVENT_TYPE"],
- "summarize": {"*": ["count"]}
- },
- { "type": "stack", "groupby": ["bin_LOC_Y"], "field": "count", "sortby": "EVENT_TYPE"}
- ]
- },
- "properties": {
- "update": {
- "stroke": {"scale": "makeColor", "field": "EVENT_TYPE"},
- "fillOpacity": {
- "rule": [
- {
- "predicate": {"name": "yLocBrush", "y": {"field": "bin_LOC_Y"}},
- "value": 0.8
- },
- {"value": 0.2}
- ]
- },
- "y": {"scale": "y", "field": "bin_LOC_Y"},
- "x": {"scale": "x", "field": "layout_start"},
- "x2": {"scale": "x", "field": "layout_end"},
- "height": {"scale": "thickness", "value": 5},
- "fill": {"scale": "makeColor", "field": "EVENT_TYPE"}
- },
- "exit": {
- "x": {"scale": "x", "value": 0},
- "x2": {"scale": "x", "value": 0}
- }
- }
- },
- {
- "type": "rect",
- "properties": {
- "enter": {
- "fill": {"value": "grey"},
- "fillOpacity": {"value": 0.2}
- },
- "update": {
- "y": {"scale": "y", "signal": "yLocStart"},
- "y2": {"scale": "y", "signal": "yLocEnd"},
- "x": {"value": 0},
- "x2": {"field": {"group": "width"}}
- }
- }
- }
- ]
-}
-
-
-export {CourtYHistogram, CourtXHistogram, fieldHistogram}
diff --git a/src/components/basketball/interactions.js b/src/components/basketball/interactions.js
deleted file mode 100644
index 3e25e02..0000000
--- a/src/components/basketball/interactions.js
+++ /dev/null
@@ -1,120 +0,0 @@
-function brushSignal(group, name, event, direction, scale, min, max) {
- return [
- {
- "name": `${name}Start`,
- "init": -1,
- "streams": [{
- "type": `@${group}:mousedown, @${group}:touchstart`,
- "expr": `${event}(scope)`,
- "scale": {"scope": "scope", "name": scale, "invert": true}
- }]
- },
- {
- "name": `${name}End`,
- "init": -1,
- "streams": [{
- "type": `@${group}:mousedown, @${group}:touchstart, [@${group}:mousedown, window:mouseup] > window:mousemove, [@${group}:touchstart, window:touchend] > window:touchmove`,
- "expr": `clamp(${event}(scope), 0, scope.${direction})`,
- "scale": {"scope": "scope", "name": scale, "invert": true}
- }]
- },
- {"name": `min${name}`, "expr": `max(min(${name}Start, ${name}End), ${min})`},
- {"name": `max${name}`, "expr": `min(max(${name}Start, ${name}End), ${max})`}
- ]
-}
-
-function brushPredicate(name, arg) {
- return [
- {
- "name": `${name}Equal`,
- "type": "==",
- "operands": [{"signal": `${name}Start`}, {"signal": `${name}End`}]
- },
- {
- "name": `${name}Range`,
- "type": "in",
- "item": {"arg": arg},
- "range": [{"signal": `${name}Start`}, {"signal": `${name}End`}]
- },
- {
- "name": `${name}Brush`,
- "type": "or",
- "operands": [{"predicate": `${name}Equal`}, {"predicate": `${name}Range`}]
- }
- ]
-}
-
-var ShotChartInteractionSignals = [
- {
- "name": "scope",
- "init": {"width": 0},
- "streams": [
- {"type": "mousedown, touchstart", "expr": "eventGroup()"}
- ]
- }].concat(
- brushSignal('distGroup', 'dist', 'eventX', 'width', 'x', 0, 50)
- ).concat(
- brushSignal('timepassedGroup', 'timepassed', 'eventX', 'width', 'x', 0, 64)
- ).concat(
- brushSignal('xLocGroup', 'xLoc', 'eventX', 'width', 'x', -250, 250)
- ).concat(
- brushSignal('yLocGroup', 'yLoc', 'eventY', 'height', 'y', -47.5, 500)
- ).concat(
- brushSignal('shotChart', 'chartX', 'eventX', 'width', 'x', -250, 250)
- ).concat(
- brushSignal('shotChart', 'chartY', 'eventY', 'height', 'y', -47.5, 500))
-
-var ShotChartInteractionPredicates = brushPredicate('dist', 'x').concat(
- brushPredicate('timepassed', 'x')
-).concat(
- brushPredicate('xLoc', 'x')
-).concat(
- brushPredicate('yLoc', 'y')
-).concat(
- brushPredicate('chartX', 'x')
-).concat(
- brushPredicate('chartY', 'y')
-).concat(
- [
- {
- "name": "chartEqual",
- "type": "&&",
- "operands": [{"predicate": "chartXEqual"}, {"predicate": "chartYEqual"}]
- },
- {
- "name": "chartInRange",
- "type": "&&",
- "operands": [
- {"predicate": "chartXRange"},
- {"predicate": "chartYRange"}
- ]
- },
- {
- "name": "chartBrush",
- "type": "or",
- "operands": [{"predicate": "chartEqual"}, {"predicate": "chartInRange"}]
- }
- ])
-
-var ShotChartInteractionFilters = {
- "brush": "(minchartX == maxchartX || (datum.LOC_X >= minchartX && datum.LOC_X <= maxchartX)) && (minchartY == maxchartY || (datum.LOC_Y >= minchartY && datum.LOC_Y <= maxchartY))"
-}
-
-function shotFilter(...variable_signals) {
- return variable_signals.map((variable_signal) => {
- var [variable, signal] = variable_signal
- return `(min${signal} == max${signal} || (datum.${variable} >= min${signal} && datum.${variable} <= max${signal}))`
- }).join(" && ")
-}
-
-function crossFilter(crosses) {
- return function(currentFilter) {
- return shotFilter.apply(null, crosses.filter((value) => value[0] !== currentFilter))
- }
-}
-
-var filterExclude = crossFilter([
- ['LOC_X', 'xLoc'], ['LOC_Y', 'yLoc'], ['hoopdistance', 'dist'], ['timepassed', 'timepassed']
-])
-
-export {ShotChartInteractionSignals, ShotChartInteractionPredicates, ShotChartInteractionFilters, filterExclude}
diff --git a/src/components/d3_scale.js b/src/components/d3_scale.js
deleted file mode 100644
index 6f16c2d..0000000
--- a/src/components/d3_scale.js
+++ /dev/null
@@ -1,10 +0,0 @@
-function d3_scaleExtent(domain) {
- var start = domain[0], stop = domain[domain.length - 1]
- return start < stop ? [start, stop] : [stop, start]
-}
-
-function d3_scaleRange(scale) {
- return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range())
-}
-
-export { d3_scaleExtent, d3_scaleRange }
diff --git a/src/components/hello.js b/src/components/hello.js
deleted file mode 100644
index 80b3aa0..0000000
--- a/src/components/hello.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import React from 'react'
-
-export default class HelloWorld extends React.Component {
- render() {
- return
-
This is a post mostly generated using react and ES6.
-
Webpack builds the source automatically on file changes and then jekyll serves it.
- I start these processes using: foreman start --formation="webpack_watch=1,webpack_server=1,jekyll=1"
.
- For convenience, I bound this to npm start
in the package.json
.
-
-
To speed up testing while updating react classes, I set up react-hot-reload.
-
This allows real-time updates to the react classes, without a reload!
-
Things I had to do to get this work:
-
- Added react-hot
to the js loaders:
- Change output.publicPath
to my webpack-dev-server host and port:
- Add plugins: webpack.HotModuleReplacementPlugin
and webpack.NoErrorsPlugin
- Set up webpack config devServer
for serving, particularly adding headers for 'Access-Control-Allow-Origin': '*'
- Remove react from webpack externals and load it as a node module
- Add flag to javascript include to switch between serving from webpack-dev-server
during development to the final build location
- Serve the javascript files from the webpack-dev-server publicPath
- Then run webpack-dev-server --config webpack.hot.config.js
-
-
- }
-}
diff --git a/src/components/mark.js b/src/components/mark.js
deleted file mode 100644
index 4adfd3c..0000000
--- a/src/components/mark.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import React from 'react'
-import {Mixin as tweenMixin} from 'react-tween-state'
-
-function animateMark(Component, transitionAttributes) {
- const VisualMark = React.createClass({
- mixins: [tweenMixin],
- getInitialState() {
- let state = {}
- transitionAttributes.forEach(
- transition =>
- state[transition.prop] = transition.start == null ? 0 : transition.start)
- return state
- },
- componentDidMount() {
- transitionAttributes.forEach(
- transition =>
- this.tweenState(transition.prop, {
- easing: transition.ease,
- duration: transition.duration,
- endValue: this.props[transition.prop]
- }))
- },
- render() {
- let props = {}
- transitionAttributes.forEach(
- transition => props[transition.prop] = this.getTweeningValue(transition.prop))
- return
- }
- })
-
- return VisualMark
-}
-
-export default animateMark
diff --git a/src/components/rect.js b/src/components/rect.js
deleted file mode 100644
index 66324f3..0000000
--- a/src/components/rect.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import React from 'react'
-
-class Rect extends React.Component {
- render() {
- return
- }
-}
-
-export default Rect
diff --git a/src/css/flexbox.scss b/src/css/flexbox.scss
deleted file mode 100644
index ad6b1ab..0000000
--- a/src/css/flexbox.scss
+++ /dev/null
@@ -1,394 +0,0 @@
-// Flexbox Mixins
-// http://philipwalton.github.io/solved-by-flexbox/
-// https://github.com/philipwalton/solved-by-flexbox
-//
-// Copyright (c) 2013 Brian Franco
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// This is a set of mixins for those who want to mess around with flexbox
-// using the native support of current browsers. For full support table
-// check: http://caniuse.com/flexbox
-//
-// Basically this will use:
-//
-// * Fallback, old syntax (IE10, mobile webkit browsers - no wrapping)
-// * Final standards syntax (FF, Safari, Chrome, IE11, Opera)
-//
-// This was inspired by:
-//
-// * http://dev.opera.com/articles/view/advanced-cross-browser-flexbox/
-//
-// With help from:
-//
-// * http://w3.org/tr/css3-flexbox/
-// * http://the-echoplex.net/flexyboxes/
-// * http://msdn.microsoft.com/en-us/library/ie/hh772069(v=vs.85).aspx
-// * http://css-tricks.com/using-flexbox/
-// * http://dev.opera.com/articles/view/advanced-cross-browser-flexbox/
-// * https://developer.mozilla.org/en-us/docs/web/guide/css/flexible_boxes
-
-//----------------------------------------------------------------------
-
-// Flexbox Containers
-//
-// The 'flex' value causes an element to generate a block-level flex
-// container box.
-//
-// The 'inline-flex' value causes an element to generate a inline-level
-// flex container box.
-//
-// display: flex | inline-flex
-//
-// http://w3.org/tr/css3-flexbox/#flex-containers
-//
-// (Placeholder selectors for each type, for those who rather @extend)
-
-@mixin flexbox {
- display: -webkit-box;
- display: -webkit-flex;
- display: -moz-flex;
- display: -ms-flexbox;
- display: flex;
-}
-
-%flexbox { @include flexbox; }
-
-//----------------------------------
-
-@mixin inline-flex {
- display: -webkit-inline-box;
- display: -webkit-inline-flex;
- display: -moz-inline-flex;
- display: -ms-inline-flexbox;
- display: inline-flex;
-}
-
-%inline-flex { @include inline-flex; }
-
-//----------------------------------------------------------------------
-
-// Flexbox Direction
-//
-// The 'flex-direction' property specifies how flex items are placed in
-// the flex container, by setting the direction of the flex container's
-// main axis. This determines the direction that flex items are laid out in.
-//
-// Values: row | row-reverse | column | column-reverse
-// Default: row
-//
-// http://w3.org/tr/css3-flexbox/#flex-direction-property
-
-@mixin flex-direction($value: row) {
- @if $value == row-reverse {
- -webkit-box-direction: reverse;
- -webkit-box-orient: horizontal;
- } @else if $value == column {
- -webkit-box-direction: normal;
- -webkit-box-orient: vertical;
- } @else if $value == column-reverse {
- -webkit-box-direction: reverse;
- -webkit-box-orient: vertical;
- } @else {
- -webkit-box-direction: normal;
- -webkit-box-orient: horizontal;
- }
- -webkit-flex-direction: $value;
- -moz-flex-direction: $value;
- -ms-flex-direction: $value;
- flex-direction: $value;
-}
- // Shorter version:
- @mixin flex-dir($args...) { @include flex-direction($args...); }
-
-//----------------------------------------------------------------------
-
-// Flexbox Wrap
-//
-// The 'flex-wrap' property controls whether the flex container is single-line
-// or multi-line, and the direction of the cross-axis, which determines
-// the direction new lines are stacked in.
-//
-// Values: nowrap | wrap | wrap-reverse
-// Default: nowrap
-//
-// http://w3.org/tr/css3-flexbox/#flex-wrap-property
-
-@mixin flex-wrap($value: nowrap) {
- // No Webkit Box fallback.
- -webkit-flex-wrap: $value;
- -moz-flex-wrap: $value;
- @if $value == nowrap {
- -ms-flex-wrap: none;
- } @else {
- -ms-flex-wrap: $value;
- }
- flex-wrap: $value;
-}
-
-//----------------------------------------------------------------------
-
-// Flexbox Flow (shorthand)
-//
-// The 'flex-flow' property is a shorthand for setting the 'flex-direction'
-// and 'flex-wrap' properties, which together define the flex container's
-// main and cross axes.
-//
-// Values: |
-// Default: row nowrap
-//
-// http://w3.org/tr/css3-flexbox/#flex-flow-property
-
-@mixin flex-flow($values: (row nowrap)) {
- // No Webkit Box fallback.
- -webkit-flex-flow: $values;
- -moz-flex-flow: $values;
- -ms-flex-flow: $values;
- flex-flow: $values;
-}
-
-//----------------------------------------------------------------------
-
-// Flexbox Order
-//
-// The 'order' property controls the order in which flex items appear within
-// their flex container, by assigning them to ordinal groups.
-//
-// Default: 0
-//
-// http://w3.org/tr/css3-flexbox/#order-property
-
-@mixin order($int: 0) {
- -webkit-box-ordinal-group: $int + 1;
- -webkit-order: $int;
- -moz-order: $int;
- -ms-flex-order: $int;
- order: $int;
-}
-
-//----------------------------------------------------------------------
-
-// Flexbox Grow
-//
-// The 'flex-grow' property sets the flex grow factor. Negative numbers
-// are invalid.
-//
-// Default: 0
-//
-// http://w3.org/tr/css3-flexbox/#flex-grow-property
-
-@mixin flex-grow($int: 0) {
- -webkit-box-flex: $int;
- -webkit-flex-grow: $int;
- -moz-flex-grow: $int;
- -ms-flex-positive: $int;
- flex-grow: $int;
-}
-
-//----------------------------------------------------------------------
-
-// Flexbox Shrink
-//
-// The 'flex-shrink' property sets the flex shrink factor. Negative numbers
-// are invalid.
-//
-// Default: 1
-//
-// http://w3.org/tr/css3-flexbox/#flex-shrink-property
-
-@mixin flex-shrink($int: 1) {
- -webkit-flex-shrink: $int;
- -moz-flex-shrink: $int;
- -ms-flex-negative: $int;
- flex-shrink: $int;
-}
-
-//----------------------------------------------------------------------
-
-// Flexbox Basis
-//
-// The 'flex-basis' property sets the flex basis. Negative lengths are invalid.
-//
-// Values: Like "width"
-// Default: auto
-//
-// http://www.w3.org/TR/css3-flexbox/#flex-basis-property
-
-@mixin flex-basis($value: auto) {
- -webkit-flex-basis: $value;
- -moz-flex-basis: $value;
- -ms-flex-preferred-size: $value;
- flex-basis: $value;
-}
-
-//----------------------------------------------------------------------
-
-// Flexbox "Flex" (shorthand)
-//
-// The 'flex' property specifies the components of a flexible length: the
-// flex grow factor and flex shrink factor, and the flex basis. When an
-// element is a flex item, 'flex' is consulted instead of the main size
-// property to determine the main size of the element. If an element is
-// not a flex item, 'flex' has no effect.
-//
-// Values: none | ||
-// Default: See individual properties (1 1 0).
-//
-// http://w3.org/tr/css3-flexbox/#flex-property
-
-@mixin flex($fg: 1, $fs: null, $fb: null) {
-
- // Set a variable to be used by box-flex properties
- $fg-boxflex: $fg;
-
- // Box-Flex only supports a flex-grow value so let's grab the
- // first item in the list and just return that.
- @if type-of($fg) == 'list' {
- $fg-boxflex: nth($fg, 1);
- }
-
- -webkit-box-flex: $fg-boxflex;
- -webkit-flex: $fg $fs $fb;
- -moz-box-flex: $fg-boxflex;
- -moz-flex: $fg $fs $fb;
- -ms-flex: $fg $fs $fb;
- flex: $fg $fs $fb;
-}
-
-//----------------------------------------------------------------------
-
-// Flexbox Justify Content
-//
-// The 'justify-content' property aligns flex items along the main axis
-// of the current line of the flex container. This is done after any flexible
-// lengths and any auto margins have been resolved. Typically it helps distribute
-// extra free space leftover when either all the flex items on a line are
-// inflexible, or are flexible but have reached their maximum size. It also
-// exerts some control over the alignment of items when they overflow the line.
-//
-// Note: 'space-*' values not supported in older syntaxes.
-//
-// Values: flex-start | flex-end | center | space-between | space-around
-// Default: flex-start
-//
-// http://w3.org/tr/css3-flexbox/#justify-content-property
-
-@mixin justify-content($value: flex-start) {
- @if $value == flex-start {
- -webkit-box-pack: start;
- -ms-flex-pack: start;
- } @else if $value == flex-end {
- -webkit-box-pack: end;
- -ms-flex-pack: end;
- } @else if $value == space-between {
- -webkit-box-pack: justify;
- -ms-flex-pack: justify;
- } @else if $value == space-around {
- -ms-flex-pack: distribute;
- } @else {
- -webkit-box-pack: $value;
- -ms-flex-pack: $value;
- }
- -webkit-justify-content: $value;
- -moz-justify-content: $value;
- justify-content: $value;
-}
- // Shorter version:
- @mixin flex-just($args...) { @include justify-content($args...); }
-
-//----------------------------------------------------------------------
-
-// Flexbox Align Items
-//
-// Flex items can be aligned in the cross axis of the current line of the
-// flex container, similar to 'justify-content' but in the perpendicular
-// direction. 'align-items' sets the default alignment for all of the flex
-// container's items, including anonymous flex items. 'align-self' allows
-// this default alignment to be overridden for individual flex items. (For
-// anonymous flex items, 'align-self' always matches the value of 'align-items'
-// on their associated flex container.)
-//
-// Values: flex-start | flex-end | center | baseline | stretch
-// Default: stretch
-//
-// http://w3.org/tr/css3-flexbox/#align-items-property
-
-@mixin align-items($value: stretch) {
- @if $value == flex-start {
- -webkit-box-align: start;
- -ms-flex-align: start;
- } @else if $value == flex-end {
- -webkit-box-align: end;
- -ms-flex-align: end;
- } @else {
- -webkit-box-align: $value;
- -ms-flex-align: $value;
- }
- -webkit-align-items: $value;
- -moz-align-items: $value;
- align-items: $value;
-}
-
-//----------------------------------
-
-// Flexbox Align Self
-//
-// Values: auto | flex-start | flex-end | center | baseline | stretch
-// Default: auto
-
-@mixin align-self($value: auto) {
- // No Webkit Box Fallback.
- -webkit-align-self: $value;
- -moz-align-self: $value;
- @if $value == flex-start {
- -ms-flex-item-align: start;
- } @else if $value == flex-end {
- -ms-flex-item-align: end;
- } @else {
- -ms-flex-item-align: $value;
- }
- align-self: $value;
-}
-
-//----------------------------------------------------------------------
-
-// Flexbox Align Content
-//
-// The 'align-content' property aligns a flex container's lines within the
-// flex container when there is extra space in the cross-axis, similar to
-// how 'justify-content' aligns individual items within the main-axis. Note,
-// this property has no effect when the flexbox has only a single line.
-//
-// Values: flex-start | flex-end | center | space-between | space-around | stretch
-// Default: stretch
-//
-// http://w3.org/tr/css3-flexbox/#align-content-property
-
-@mixin align-content($value: stretch) {
- // No Webkit Box Fallback.
- -webkit-align-content: $value;
- -moz-align-content: $value;
- @if $value == flex-start {
- -ms-flex-line-pack: start;
- } @else if $value == flex-end {
- -ms-flex-line-pack: end;
- } @else {
- -ms-flex-line-pack: $value;
- }
- align-content: $value;
-}
\ No newline at end of file
diff --git a/src/css/utilities.scss b/src/css/utilities.scss
deleted file mode 100644
index 4a9933f..0000000
--- a/src/css/utilities.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-@mixin overflow-ellipsis {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-@mixin keyframes($animation-name) {
- @-webkit-keyframes #{$animation-name} { @content; }
- @-moz-keyframes #{$animation-name} { @content; }
- @-o-keyframes #{$animation-name} { @content; }
- @keyframes #{$animation-name} { @content; }
-}
-
-@mixin transition($transition) {
- -webkit-transition: $transition;
- -moz-transition: $transition;
- -o-transition: $transition;
- transition: $transition;
-}
-
-@mixin animation($animation) {
- -webkit-animation: $animation;
- -moz-animation: $animation;
- -o-animation: $animation;
- animation: $animation;
-}
-
-@mixin transform($transform) {
- -webkit-transform: $transform;
- -moz-transform: $transform;
- -ms-transform: $transform;
- -o-transform: $transform;
- transform: $transform;
-}
-
-.remove-link {
- color: #999;
-
- &:hover {
- color: #f18794;
- text-decoration: none;
- }
-}
diff --git a/src/explore-sql.js b/src/explore-sql.js
deleted file mode 100644
index 1b4a749..0000000
--- a/src/explore-sql.js
+++ /dev/null
@@ -1,77 +0,0 @@
-require('es6-promise').polyfill()
-import './explorer/css/main.scss'
-
-import React from 'react'
-import ReactDOM from 'react-dom'
-import d3 from 'd3'
-import dl from 'datalib'
-
-import _ from 'lodash'
-import { Provider } from 'react-redux'
-
-import Explorer from './explorer'
-import configureStore from './explorer/stores'
-import { selectTable, connectTableIfNecessary } from './explorer/ducks/datasources'
-import * as queryspec from './explorer/ducks/queryspec'
-
-let MockDataSources = {
- datasources: {
- IDS: [0, 1, 7, 2],
- BY_ID: {
- 7: { id: 7, name: "Iris",
- type: "dataframe",
- url: "http://vega.github.io/polestar/data/iris.json",
- settings: { format: "json" }
- },
- 0: { id: 0, name: "Birdstrikes",
- type: "dataframe",
- url: "http://vega.github.io/polestar/data/birdstrikes.json",
- settings: { format: "json" }
- },
- 1: { id: 1, name: "Cars",
- type: "dataframe",
- url: "http://vega.github.io/polestar/data/cars.json",
- settings: { format: "json" }
- },
- 2: { id: 2, name: "NBA League Totals per year",
- type: "dataframe",
- url: "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/f6d6496474af6dfba0b73f36dbd0e00ce0fc2f42/leagues_NBA_player_totals.csv",
- settings: { format: "csv", delimiter: "," }
- }
- }}}
-
-_.each(MockDataSources.datasources.BY_ID,
- datasource => {
- _(datasource.tables).each(
- (table) =>
- _(table.schema).each((field, i) => field.__id__ = i).value()).value()
- _(datasource.schema).each((field, i) => field.__id__ = i).value()
- })
-
-let store = configureStore(MockDataSources)
-
-ReactDOM.render( , document.getElementById("demo"))
-
-store.dispatch(connectTableIfNecessary({datasource_id: 0})).then(
- () => {
- store.dispatch(selectTable({datasource_id: 0}))
-
- store.dispatch(queryspec.addField('row', {
- id: "agg_count", name: "COUNT" , type: "aggregate" , op: "count"
- }))
-
- store.dispatch(queryspec.addField('col', {
- "tableId": {
- id: 0, name: "Birdstrikes"
- },
- "fieldId": 3,
- "func": "year"
- }))
-
- store.dispatch(queryspec.addField('color', {
- "tableId": {
- id: 0, name: "Birdstrikes"
- },
- "fieldId": 7
- }))
- })
diff --git a/src/explorer/components/DataSource.js b/src/explorer/components/DataSource.js
deleted file mode 100644
index 586e8fc..0000000
--- a/src/explorer/components/DataSource.js
+++ /dev/null
@@ -1,79 +0,0 @@
-import React from 'react'
-import className from 'classnames'
-import _ from 'lodash'
-import { createDropdownComponent } from '../../components/Dropdown'
-import { AGGREGATES } from '../helpers/field'
-import { getTable } from '../ducks/datasources'
-import { TableField } from './Field'
-
-const {div, i: icon, span} = React.DOM
-
-class DataSource extends React.Component {
- render() {
- switch(this.props.type) {
- case 'table':
- case 'dataframe':
- return div({className: "datasource-name", onClick: (() => this.props.onSelect(_.pick(this.props, ['id', 'datasource_id', 'name'])))},
- icon({className: "fa fa-table"}), this.props.name)
- case 'db':
- return div({className: "datasource-db"},
- div({className: "datasource-db-name"},
- icon({className: "fa fa-database"}), this.props.name),
- div({className: "datasource-db-tables"},
- this.props.tables.map(
- (table, i) => )))
- }
- }
-}
-
-class DataSourceSelect extends React.Component {
- onSelect(table) {
- this.props.onSelectTable(table)
- this.props.closeDropdown()
- }
-
- render() {
- let is_open = this.props.isDropdownOpen
- let dropdown = !is_open ? null : div(
- {className: "datasource-dropdown"},
- div({className: "datasource-list"},
- this.props.sourceIds.map(
- datasource_id =>
- )),
- div({className: "datasource-add"}, icon({className: "fa fa-plus"}), "Add data source"))
-
- let table = getTable(this.props.sources, this.props.tableId)
-
- return div({className: "datasource-select"},
- div({className: "datasource-title", onClick: this.props.toggleDropdown},
- icon({className: "fa fa-table"}),
- table ? table.name : "Connect data source...",
- icon({className: className("fa", {"fa-caret-down": !is_open, "fa-caret-up": is_open})})),
- dropdown)
- }
-}
-DataSourceSelect = createDropdownComponent(DataSourceSelect)
-
-class TableSchema extends React.Component {
- render() {
- const { tableId, onSelectField } = this.props
-
- if (tableId == null)
- return null
-
- const table = getTable(this.props.sources, tableId)
-
- if (table.isLoading)
- return div({className: "datasource-table-fields"}, "Loading...")
-
- return div({className: "datasource-table-fields"},
- AGGREGATES.map(
- (agg) =>
- onSelectField(agg)} />),
- table.schema.map(
- (field, i) =>
- onSelectField({tableId, fieldId: field.__id__})} />))
- }
-}
-
-export { DataSourceSelect, TableSchema }
diff --git a/src/explorer/components/Field.js b/src/explorer/components/Field.js
deleted file mode 100644
index 6f90336..0000000
--- a/src/explorer/components/Field.js
+++ /dev/null
@@ -1,171 +0,0 @@
-import _ from 'lodash'
-import className from 'classnames'
-import React from 'react'
-import ReactDOM from 'react-dom'
-import { DragSource, DropTarget } from 'react-dnd'
-import { getEmptyImage } from 'react-dnd-html5-backend'
-import { getFieldFunctionDisplayName, getFieldFunctionSelectDisplayName } from '../helpers/field'
-import { FieldIcon } from './FieldIcon'
-
-const {div, i: icon, span} = React.DOM
-const { findDOMNode } = ReactDOM
-
-/* Drop Handlers */
-
-function calculateContainerBounds(shelf) {
- const shelfBounds = findDOMNode(shelf).getBoundingClientRect()
- const fieldBounds = shelf.props.fields.map((field, i) => findDOMNode(shelf.refs[`field:${i}`]).getBoundingClientRect())
- return { shelfBounds, fieldBounds }
-}
-
-export function calculateDropMarkPosition(shelf, dropOffset) {
- const { shelfBounds, fieldBounds } = calculateContainerBounds(shelf)
- const rawLeftEdge = dropOffset.x - shelfBounds.left
- const indexOfFieldAfterMark = _(fieldBounds).map((bounds) => bounds.left - shelfBounds.left).sortedIndex(rawLeftEdge)
- const markPosition = (indexOfFieldAfterMark >= fieldBounds.length ? _.last(fieldBounds).left + _.last(fieldBounds).width + 6 : fieldBounds[indexOfFieldAfterMark].left) - shelfBounds.left
- return markPosition
-}
-
-export function calculateDropPosition(shelf, dropOffset) {
- const { shelfBounds, fieldBounds } = calculateContainerBounds(shelf)
- const rawLeftEdge = dropOffset.x - shelfBounds.left
- const indexOfFieldAfterMark = _(fieldBounds).map((bounds) => bounds.left - shelfBounds.left).sortedIndex(rawLeftEdge)
- return indexOfFieldAfterMark
-}
-
-export const FieldDropHandler = {
- canDrop: props => true,
-
- hover(props, monitor, component) {
- component.setState({hoverDropOffset: monitor.getSourceClientOffset()})
- },
-
- drop(props, monitor, component) {
- const { shelf, position, dropField } = monitor.getItem()
- const actions = _.pick(props, 'insertFieldAtPosition', 'moveFieldTo', 'removeField', 'replaceFieldOnShelf', 'moveAndReplaceField')
- const newshelf = props.shelf
- let newposition = calculateDropPosition(component, monitor.getSourceClientOffset())
- if (shelf == newshelf && position != null && (position == newposition || position + 1 == newposition)) {
- newposition = position
- }
-
- return _.extend(actions, {shelf, position, newshelf, newposition, dropField})
- }
-}
-
-export function fieldDropCollector(connect, monitor) {
- return {
- connectDropTarget: connect.dropTarget(),
- isOver: monitor.isOver({shallow: true}),
- canDrop: monitor.canDrop(),
- dropOffset: monitor.getSourceClientOffset()
- }
-}
-
-/* Drag Handlers */
-
-function fieldDragCollector(connect, monitor) {
- return {
- connectDragSource: connect.dragSource(),
- connectDragPreview: connect.dragPreview(),
- isDragging: monitor.isDragging()
- }
-}
-
-const FieldDragHandler = {
- beginDrag: function(props, monitor, component) {
- let dropField
- if (props.tableId != null) {
- dropField = { tableId: props.tableId, fieldId: props.__id__ }
- }
- else if (props.field) {
- dropField = props.field
- }
- else {
- dropField = _.pick(props, 'id', 'name', 'type', 'op')
- }
- return { ...props, dropField }
- },
-
- endDrag: function(props, monitor, component) {
- if (!monitor.didDrop()) return
- const dragSourceName = component.constructor.displayName
- const [isTableField, isShelfField] = [dragSourceName == 'TableField', dragSourceName == 'ShelfField']
- const { removeField, replaceFieldOnShelf, insertFieldAtPosition,
- moveFieldTo, moveAndReplaceField,
- shelf, position, dropField,
- newshelf, newposition,
- droppedOnBody
- } = monitor.getDropResult()
- const isMovedToRowOrColShelf = _.contains(['row','col'], newshelf)
- if (isTableField) {
- if(isMovedToRowOrColShelf) {
- insertFieldAtPosition(newshelf, newposition, dropField)
- } else {
- replaceFieldOnShelf(newshelf, dropField)
- }
- }
- else if (isShelfField) {
- if (droppedOnBody) {
- removeField(shelf, position)
- }
- else if (isMovedToRowOrColShelf)
- {
- moveFieldTo(shelf, position, newshelf, newposition)
- }
- else {
- moveAndReplaceField(shelf, position, newshelf)
- }
- }
- }
-}
-
-/* Field Components */
-
-class TableField extends React.Component {
- componentDidMount() {
- this.props.connectDragPreview(getEmptyImage(), {
- captureDraggingState: true
- })
- }
-
- render() {
- const { connectDragSource } = this.props
- return connectDragSource(
- div({className: "field-wrap datasource-table-field", onClick: this.props.onClick},
- div({className: "icon-wrap"}, ),
- div({className: "name-wrap"}, this.props.name)))
- }
-}
-TableField.displayName = 'TableField'
-TableField = DragSource("TableField", FieldDragHandler, fieldDragCollector)(TableField)
-
-class ShelfField extends React.Component {
- componentDidMount() {
- this.props.connectDragPreview(getEmptyImage(), {
- captureDraggingState: true
- })
- }
-
- handleOptionClick(evt) {
- evt.stopPropagation()
- const node = findDOMNode(this)
- this.props.setOptionField(this.props.shelf, this.props.position, node.getBoundingClientRect())
- }
-
- render() {
- const { name, type, remove, isDragging, connectDragSource } = this.props
- const { typecast, func } = this.props.field
- return connectDragSource(
- div({className: "field-wrap querybuilder-field", style: { opacity: isDragging ? 0.3 : 1 } },
- div({className: "icon-wrap"}, ),
- div({className: "func-wrap"}, getFieldFunctionDisplayName(func)),
- div({className: className("name-wrap", {"has-func": func != null})}, name),
- div({className: "option-wrap", onClick: type == 'aggregate' ? (() => remove()) : this.handleOptionClick.bind(this) },
- type == 'aggregate' ? icon({className: "fa fa-times remove-link"}) : icon({className: "fa fa-caret-down"}))))
- }
-}
-ShelfField.displayName = 'ShelfField'
-ShelfField = DragSource("ShelfField", FieldDragHandler, fieldDragCollector)(ShelfField)
-
-export { TableField, ShelfField }
diff --git a/src/explorer/components/FieldDragLayer.js b/src/explorer/components/FieldDragLayer.js
deleted file mode 100644
index e99d38b..0000000
--- a/src/explorer/components/FieldDragLayer.js
+++ /dev/null
@@ -1,89 +0,0 @@
-import className from 'classnames'
-import React, { PropTypes } from 'react'
-import { DragLayer } from 'react-dnd'
-const { div, i: icon } = React.DOM
-import { getFieldFunctionDisplayName } from '../helpers/field'
-import { FieldIcon } from './FieldIcon'
-
-function getItemStyles(props) {
- const { initialOffset, currentOffset } = props
- if (!initialOffset || !currentOffset) {
- return {
- display: 'none'
- }
- }
-
- let { x, y } = currentOffset
-
- const transform = `translate(${x}px, ${y}px)`
- return {
- transform: transform,
- WebkitTransform: transform,
- MozTransform: transform,
- msTransform: transform
- }
-}
-
-class ShelfFieldDragPreview extends React.Component {
- render() {
- const { name, type } = this.props
- const { typecast, func } = this.props.field
- return div({className: className("field-wrap", {"remove": this.props.showTrashCan})},
- div({className: "icon-wrap"}, ),
- div({className: "func-wrap"}, getFieldFunctionDisplayName(func)),
- div({className: className("name-wrap", {"has-func": func != null})}, name),
- this.props.showTrashCan ? div({className: "option-wrap"} , icon({className: "fa fa-trash-o"})) : null)
- }
-}
-
-class TableFieldDragPreview extends React.Component {
- render() {
- return div({className: "field-wrap"},
- div({className: "icon-wrap"}, ),
- div({className: "name-wrap", style: {width: 210}}, this.props.name))
- }
-}
-
-class FieldDragLayer extends React.Component {
- renderItem(type, item) {
- switch (type) {
- case 'ShelfField':
- return
- case 'TableField':
- return
- default:
- return null
- }
- }
-
- render() {
- const { item, itemType, isDragging, showTrashCan } = this.props
- // if (!isDragging) return null
- return div({className: className("field-drag-layer")},
- div({className: "field-drag-wrap", style: getItemStyles(this.props)},
- this.renderItem(itemType, _.extend({showTrashCan}, item))))
- }
-}
-
-FieldDragLayer.propTypes = {
- item: PropTypes.object,
- itemType: PropTypes.string,
- initialOffset: PropTypes.shape({
- x: PropTypes.number.isRequired,
- y: PropTypes.number.isRequired
- }),
- currentOffset: PropTypes.shape({
- x: PropTypes.number.isRequired,
- y: PropTypes.number.isRequired
- }),
- isDragging: PropTypes.bool.isRequired,
- showTrashCan: PropTypes.bool.isRequired
-}
-
-export default DragLayer((monitor) => ({
- item: monitor.getItem(),
- itemType: monitor.getItemType(),
- initialOffset: monitor.getInitialSourceClientOffset(),
- currentOffset: monitor.getSourceClientOffset(),
- isDragging: monitor.isDragging()
-}))(FieldDragLayer)
diff --git a/src/explorer/components/FieldDropdown.js b/src/explorer/components/FieldDropdown.js
deleted file mode 100644
index 55e120c..0000000
--- a/src/explorer/components/FieldDropdown.js
+++ /dev/null
@@ -1,118 +0,0 @@
-import React from 'react'
-import className from 'classnames'
-import _ from 'lodash'
-const {div, i: icon, label, pre, a: link, input} = React.DOM
-import { getFieldFunctionSelectDisplayName, getExternalType } from '../helpers/field'
-import { FieldIcon } from './FieldIcon'
-
-class FieldRadioGroupOptions extends React.Component {
- render() {
- const { choice, options, onChoiceChange } = this.props
- return div({className: "querybuilder-field-settings-options"},
- options.map((value) => {
- return div({key: value,
- className: "querybuilder-field-settings-option-value",
- style: { width: value == "bin" ? "100%" : null }},
- label({},
- input({
- key: value,
- type: 'radio',
- value: value,
- checked: value === choice,
- onChange: () => { if (value !== choice) onChoiceChange(value) }
- }),
- getFieldFunctionSelectDisplayName(value)))
- }))
- }
-}
-
-class TypeFunctions extends React.Component {
- render() {
- const { func, type, updateFieldFunction } = this.props
- if (type == 'number') {
- return div({className: "querybuilder-field-options querybuilder-func"},
- label({},
- "Functions",
- func ? link({onClick: () => updateFieldFunction(null)}, "Reset") : null),
- )
- }
- else if (type == 'time') {
- return div({className: "querybuilder-field-options querybuilder-func"},
- label({}, "Function",
- func && !_.contains(func, "bin") ? link({onClick: () => updateFieldFunction(null)}, "Reset") : null),
- ,
- label({}, "BIN",
- func && _.contains(func, 'bin') ? link({onClick: () => updateFieldFunction(null)}, "Reset") : null),
- )
- }
- else {
- return null
- }
- }
-}
-
-class GenericFieldOptions extends React.Component {
- render() {
- const { func, type, typecast, typeOptions, updateFieldTypecast, updateFieldFunction } = this.props
- const internalExternalType = getExternalType(type)
- const finalType = typecast || internalExternalType
- return div({className: "querybuilder-field-options"},
- label({}, "Type"),
- updateFieldTypecast(value === internalExternalType ? null : value)} />,
- )
- }
-}
-
-class FieldOptions extends React.Component {
- render() {
- const { field, fieldSettings, updateFieldTypecast, updateFieldFunction } = this.props
- const { type: fieldType } = fieldSettings
- const typecastOptions = {
- type: fieldType,
- typecast: field.typecast,
- func: field.func,
- updateFieldTypecast: updateFieldTypecast,
- updateFieldFunction: updateFieldFunction
- }
-
- if (['date', 'timestamp', 'time'].indexOf(fieldType) >= 0) {
- return
- } else if (["string", 'text'].indexOf(fieldType) >= 0) {
- return
- } else if (['integer', 'number'].indexOf(fieldType) >= 0) {
- return
- } else {
- return div({className: "querybuilder-field-options"}, label({}, "No Settings"))
- }
- }
-}
-
-export class FieldOptionsDropdown extends React.Component {
- render() {
- const { isOpen, shelf, field, position, top, left, removeField, updateFieldTypecast, updateFieldFunction } = this.props
- if (!isOpen) return null
- const fieldSettings = this.props.getField(field.tableId, field.fieldId)
- return div({className: "querybuilder-field-settings", style: {top, left}},
- icon({className: "fa fa-times remove-link", onClick: this.props.close}),
- ,
- div({className: "querybuilder-field-remove", onClick: () => {
- this.props.close()
- removeField(shelf, position)
- }}, "Remove"))
- }
-}
diff --git a/src/explorer/components/FieldIcon.js b/src/explorer/components/FieldIcon.js
deleted file mode 100644
index 3b898e1..0000000
--- a/src/explorer/components/FieldIcon.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import React from 'react'
-import className from 'classnames'
-import { getExternalType } from '../helpers/field'
-const {div, i: icon, span} = React.DOM
-
-export class FieldIcon extends React.Component {
- render() {
- const { type, typecast } = this.props
- if (typecast != null && getExternalType(typecast) != getExternalType(type)) {
- return div({},
- ,
- icon({className: "fa fa-long-arrow-right"}),
- )
- }
-
- let iconClass
- if (type == 'aggregate') {
- iconClass = "bar-chart"
- } else if (['date', 'timestamp', 'time'].indexOf(type) >= 0) {
- iconClass = "clock-o"
- } else if (["string", "text"].indexOf(type) >= 0) {
- iconClass = "font"
- } else if (['integer', 'number'].indexOf(type) >= 0) {
- return span({}, "#")
- } else {
- return span({}, type)
- }
- return icon({className: className("fa", `fa-${iconClass}`)})
- }
-}
diff --git a/src/explorer/components/Shelf.js b/src/explorer/components/Shelf.js
deleted file mode 100644
index 37699a3..0000000
--- a/src/explorer/components/Shelf.js
+++ /dev/null
@@ -1,174 +0,0 @@
-import d3 from 'd3-svg-legend'
-import className from 'classnames'
-import React from 'react'
-import ReactDOM from 'react-dom'
-import { DropTarget } from 'react-dnd'
-import _ from 'lodash'
-import { VisualPropertiesDropdown } from './VisualPropertiesDropdown'
-import { FieldOptionsDropdown } from './FieldDropdown'
-import { createDropdownComponent } from '../../components/Dropdown'
-import { ShelfField, calculateDropMarkPosition, calculateDropPosition, FieldDropHandler, fieldDropCollector } from './Field'
-import { getAccessorName, isAggregateType } from '../helpers/field'
-
-const { div, i: icon, a: link, pre, svg } = React.DOM
-const { findDOMNode } = ReactDOM
-
-class FieldContainer extends React.Component {
- componentDidUpdate(prevProps, prevState) {
- if (this.hasDropMarker()) {
- findDOMNode(this.refs.dropMarker).style.left = `${calculateDropMarkPosition(this, this.state.hoverDropOffset)}px`
- }
- }
-
- hasDropMarker() {
- return _.contains(['row', 'col'], this.props.shelf) && this.props.fields.length > 0 && this.props.isOver && this.props.dropOffset
- }
-
- render() {
- const { shelf, fields, getField, removeField, dropdownProps } = this.props
- const { isOver, canDrop, connectDropTarget } = this.props
- const hasDropMarker = this.hasDropMarker()
-
- const dropPosition = hasDropMarker ? div({
- ref: "dropMarker",
- className: "field-position-marker"
- }) : null
-
- const shelfFields = fields.map(
- function(field, i) {
- const fieldSettings = field.type == 'aggregate' ? field : getField(field.tableId, field.fieldId)
- return removeField(shelf, i)} {...dropdownProps} />
- })
- return connectDropTarget(
- div(
- {
- className: className("querybuilder-field-container-wrap",
- {
- "field-drop-target": canDrop,
- "field-drop-over": isOver,
- "field-contained": !_.isEmpty(fields),
- "field-empty": _.isEmpty(fields),
- "field-drop-marker": hasDropMarker
- }),
- onScroll: dropdownProps.closeDropdown
- },
- div({className: "querybuilder-field-container"},
- dropPosition,
- shelfFields)))
- }
-}
-FieldContainer = DropTarget(["TableField", "ShelfField"], FieldDropHandler, fieldDropCollector)(FieldContainer)
-
-const LEGEND_TYPE = {
- color: 'color',
- opacity: 'color',
- shape: 'symbol',
- size: 'size'
-}
-
-class ShelfLegend extends React.Component {
- _d3Remove() {
- d3.select(this.refs.d3LegendContainer).selectAll('*').remove()
- }
-
- _d3Render() {
- this._d3Remove()
- let { fields, legend, shelf } = this.props
- if (_.isEmpty(fields)) return
- let scaleObject = legend[getAccessorName(fields[0])]
- if (null == scaleObject) return
- let { type, domain, range } = scaleObject
- let scale = d3.scale[type]().domain(domain).range(range)
- switch(shelf) {
- case 'shape':
- scale.range(_.map(scale.range(), shape => d3.svg.symbol().type(shape)()))
- break
- case 'size':
- scale.range(_.map(scale.range(), v => Math.sqrt(v / Math.PI)))
- break
- case 'opacity':
- scale.range(_.map(range, o => d3.rgb(255 * (1 - o), 255 * (1 - o), 255 * (1 - o))))
- }
- let svgLegend = d3.legend[LEGEND_TYPE[shelf]]().scale(scale)
- switch(shelf) {
- case 'size':
- svgLegend.shape('circle').shapePadding(5)
- }
- switch(type) {
- case 'linear': case 'log': case 'pow': case 'sqrt':
- let ticks = scale.ticks(5)
- if ('linear' == type && isAggregateType(fields[0])) ticks = _.unique(_.sortBy(ticks.concat([0])))
- if ('log' == type) ticks = _.at(ticks, _.range(0, ticks.length, Math.floor(ticks.length / 5)))
- svgLegend.cells(ticks).labelFormat(d3.format(",f"))
- break
- case 'quantile':
- svgLegend.cells(scale.quantiles()).labelFormat(d3.format(",f"))
- }
- let node = d3.select(this.refs.d3LegendContainer)
- let elem = findDOMNode(this)
- let legendElem = node.append('g').attr("transform", _.contains(['shape', 'size'], shelf) ? "translate(15, 5)" : null).call(svgLegend)
- let legendBounds = legendElem[0][0].getBoundingClientRect()
- node.attr("width", legendBounds.width + 5).attr("height", legendBounds.height + 5)
- }
-
- componentDidMount() {
- this._d3Render()
- }
-
- componentDidUpdate() {
- this._d3Render()
- }
-
- componentWillUnmount() {
- this._d3Remove()
- }
-
- render() {
- if (_.isEmpty(this.props.fields)) return null
- return div({className: "querybuilder-shelf-legend"},
- svg({ref: 'd3LegendContainer'}))
- }
-}
-
-class Shelf extends React.Component {
- render() {
- const { name, shelf, fields, legend, getField,
- removeField, clearFields,
- insertFieldAtPosition, moveFieldTo,
- replaceFieldOnShelf, moveAndReplaceField,
- dropdownProps, vizActionCreators } = this.props
- const containerProps = { shelf, fields, getField,
- removeField, clearFields, insertFieldAtPosition, moveFieldTo, replaceFieldOnShelf, moveAndReplaceField,
- dropdownProps }
- const visualSettingsProps = {
- property: shelf, fields, getField,
- settings: this.props.properties,
- isOpen: this.props.isDropdownOpen && !dropdownProps.isDropdownOpen,
- close: this.props.closeDropdown,
- ...vizActionCreators
- }
- const isRowColShelf = _.contains(['row', 'col'], this.props.shelf)
- const hasDropdownSettings = _.contains(['color', 'background'], this.props.shelf)
- const optionComponent =
- isRowColShelf ? icon({className: 'fa fa-times remove-link', onClick: () => {
- dropdownProps.closeDropdown()
- clearFields(shelf)}}) : hasDropdownSettings ? icon({className: 'fa fa-caret-down'}) : null
- return div({className: "querybuilder-shelf"},
- {
- if (dropdownProps.isDropdownOpen) {
- this.props.openDropdown()
- } else {
- this.props.toggleDropdown()
- }
- dropdownProps.closeDropdown()
- } : null} style={{cursor: hasDropdownSettings ? 'pointer' : null}}>{name}{optionComponent} ,
- ,
- ,
- !isRowColShelf && legend ? _.extend({}, field, getField(field.tableId, field.fieldId)))} /> : null)
- }
-}
-Shelf = createDropdownComponent(Shelf)
-
-export { Shelf }
diff --git a/src/explorer/components/TableContainer.js b/src/explorer/components/TableContainer.js
deleted file mode 100644
index 9ed1174..0000000
--- a/src/explorer/components/TableContainer.js
+++ /dev/null
@@ -1,112 +0,0 @@
-import className from 'classnames'
-import React from 'react'
-import ReactDOM from 'react-dom'
-import { TableLayout } from './TableLayout'
-import Scrollbar from 'fixed-data-table/internal/Scrollbar.react'
-
-const { findDOMNode } = ReactDOM
-const { div, pre } = React.DOM
-const BORDER_HEIGHT = 1
-
-export class TableContainer extends React.Component {
- getTableSettings(axes) {
- if (null == axes) return {}
- let result = {
- rowsCount: axes.row.length,
- hasRowNumericAxes: !!axes.row[0].field,
- rowHeight: axes.row[0].field ? 300 : 30,
- colWidth: axes.col[0].field ? 300 : axes.row[0].field ? 60 : 100,
- headerHeight: Math.max(axes.row[0].key.length > 0 ? 30 : 0, axes.col[0].key.length * 30),
- footerHeight: axes.col[0].field ? 60 : 0,
- fixedQuantAxisWidth: 120,
- fixedOrdinalAxisWidth: 200
- }
- return _.extend(result, {
- bodyHeight: result.rowsCount * result.rowHeight,
- bodyWidth: axes.col.length * result.colWidth,
- fixedWidth: axes.row[0].key.length * result.fixedOrdinalAxisWidth + (axes.row[0].field ? result.fixedQuantAxisWidth : 0)
- })
- }
-
- render() {
- let { axes } = this.props
- let tableSettings = this.getTableSettings(axes)
- return
- }
-}
-
-export class TableResizeWrapper extends React.Component {
- constructor(props) {
- super(props)
- this.state = { renderTable: false, width: 500, height: 500 }
- _.extend(this, _(this).pick('_update', '_onResize').mapValues(f => f.bind(this)).value())
- }
-
- componentDidMount() {
- this._update()
- window.addEventListener('resize', this._onResize, false)
- }
-
- componentWillUnmount() {
- clearTimeout(this._updateTimer)
- window.removeEventListener('resize', this._onResize)
- }
-
- _onResize() {
- clearTimeout(this._updateTimer)
- this._updateTimer = setTimeout(this._update, 16)
- }
-
- _update() {
- let elem = findDOMNode(this)
- let { offsetWidth: width, offsetHeight: height } = elem
- this.setState({
- renderTable: true,
- width: width,
- height: this.getTableHeight(width, height)
- })
- }
-
- getTableHeight(containerWidth, containerHeight) {
- let { headerHeight, footerHeight, bodyHeight, fixedWidth, bodyWidth } = this.props
- if (bodyHeight == null) return containerHeight
- let height = headerHeight + bodyHeight + footerHeight + 2 * BORDER_HEIGHT
- let width = fixedWidth + bodyWidth
- if (containerWidth < width) height += Scrollbar.SIZE
- if (height > containerHeight) height = containerHeight
- return height
- }
-
- getScaleFunction(shelf, scale, key) {
- if ('__default__' == key) return (d) => scale['default']
- let d3Scale = 'time' == scale.type ? d3.time.scale().domain(
- _.map(scale.domain, d => new Date(d))) : d3.scale[scale.type]().domain(scale.domain)
- switch(shelf) {
- case 'row':
- return d3Scale.range([this.props.rowHeight, 0])
- case 'col':
- return d3Scale.range([0, this.props.colWidth])
- default:
- return d3Scale.range(scale.range)
- }
- }
-
- render() {
- let visScales = _.mapValues(
- this.props.scales, (scales, shelf) =>
- _.mapValues(scales, (scale, key) =>
- this.getScaleFunction(shelf, scale, key)))
- let fieldScales = visScales ? _(this.props.queryspec).map(
- (fields, shelf) => {
- return _.map(fields, (field) => {
- return { field, shelf, scale: visScales[shelf][field.accessor] }
- })
- }).flatten().value() : null
-
- return div({className: className("container-flex-fill", {
- 'table-no-header': 0 == this.props.headerHeight,
- 'table-no-footer': 0 == this.props.footerHeight,
- 'table-row-bottom-border': this.props.hasRowNumericAxes
- })}, )
- }
-}
diff --git a/src/explorer/components/TableLayout.js b/src/explorer/components/TableLayout.js
deleted file mode 100644
index 4dc8281..0000000
--- a/src/explorer/components/TableLayout.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import 'fixed-data-table/dist/fixed-data-table.css'
-import '../css/components/table.scss'
-
-import React from 'react'
-import _ from 'lodash'
-import FixedDataTable from 'fixed-data-table'
-import { getAccessorName } from '../helpers/field'
-const Axis = React.createFactory(require('./vis/Axis').Axis)
-const Pane = React.createFactory(require('./vis/Pane').Pane)
-
-const { Table: TableWrapper, Column: ColumnWrapper, Cell: CellWrapper } = FixedDataTable
-const [Table, Column, Cell] = [React.createFactory(TableWrapper), React.createFactory(ColumnWrapper), React.createFactory(CellWrapper)]
-const { div } = React.DOM
-const EMPTY_RENDER = () => ''
-const EMPTY_DATA = () => {}
-
-const RowAxisCell = ({axisIndex, rowAxis, scaleLookup, markType, ...props}) => {
- return ({rowIndex, height, width, ...cellProps}) => {
- if ('Q' == axisIndex) {
- let field = rowAxis[rowIndex].field
- let name = field.accessor
- return Axis({orient: 'left', scale: scaleLookup[name], name, field, height, width, markType})
- }
- return Cell({}, div({className: "table-row-label"}, rowAxis[rowIndex].key[axisIndex]))
- }
-}
-
-const PaneCell = ({paneData, colAxis, colIndex, rowAxisLookup, scales, fieldScales, markType, ...props}) => {
- return ({rowIndex, height, width, ...cellProps}) => {
- const cellData = paneData[rowIndex][colIndex]
- if(null == cellData) return div({})
- return Pane({
- paneData: cellData,
- rowAxis: rowAxisLookup[rowIndex],
- colAxis,
- width,
- height,
- markType: markType,
- fieldScales: fieldScales,
- scales: scales
- })
- }
-}
-
-const FooterCell = ({height, colAxis, colScaleLookup, markType, ...props}) => {
- return ({rowIndex, width, ...cellProps}) => {
- let field = colAxis.field
- let name = field.accessor
- return Axis({scale: colScaleLookup[name], name, field, height, width, markType})
- }
-}
-
-export class TableLayout extends React.Component {
- getFixedColumns(axis, props) {
- return axis.map((field, r) => {
- let isOrdinal = 'O' == field.algebraType
- return Column({
- fixed: true,
- key: getAccessorName(field),
- width: isOrdinal ? props.fixedOrdinalAxisWidth : props.fixedQuantAxisWidth,
- header: Cell({}, div({}, isOrdinal ? field.name : '')),
- cell: RowAxisCell({
- markType: props.visualspec.table.type,
- axisIndex: r,
- rowAxis: props.axes.row,
- scaleLookup: props.visScales.row
- }),
- footer: EMPTY_RENDER
- })
- })
- }
-
- getScrollableColumns(cols, props) {
- return _.map(cols, (axis, c) => {
- return Column({
- fixed: false, key: c,
- width: props.colWidth,
- height: props.rowHeight,
- header: Cell({}, div({}, _.map(axis.key, name => div({key: name}, name)))),
- cell: PaneCell({
- paneData: props.panes,
- colIndex: c,
- colAxis: axis,
- rowAxisLookup: props.axes.row,
- markType: props.visualspec.table.type,
- scales: props.visScales,
- fieldScales: props.fieldScales
- }),
- footer: FooterCell({
- colAxis: axis,
- colScaleLookup: props.visScales.col,
- height: props.footerHeight,
- markType: props.visualspec.table.type
- }),
- allowCellsRecycling: true
- })
- })
- }
-
- render() {
- const { renderTable, width, height,
- rowHeight, rowsCount, headerHeight, footerHeight,
- error, result, queryspec, axes } = this.props
- if (!renderTable || error || queryspec == null || result == null) {
- return div({}, `${error ? "Error: " : ""}No Chart`)
- }
- else {
- return Table(
- {
- width: width,
- maxHeight: height,
- height: height,
- rowHeight: rowHeight,
- rowsCount: rowsCount,
- headerHeight: headerHeight,
- footerHeight: footerHeight
- },
- this.getFixedColumns(axes.row[0], this.props),
- this.getScrollableColumns(axes.col, this.props)
- )
- }
- }
-}
diff --git a/src/explorer/components/TableSpecBuilder.js b/src/explorer/components/TableSpecBuilder.js
deleted file mode 100644
index 98fb625..0000000
--- a/src/explorer/components/TableSpecBuilder.js
+++ /dev/null
@@ -1,161 +0,0 @@
-import className from 'classnames'
-import React from 'react'
-import ReactDOM from 'react-dom'
-import _ from 'lodash'
-import { DropTarget } from 'react-dnd'
-import { FieldOptionsDropdown } from './FieldDropdown'
-import { createDropdownComponent } from '../../components/Dropdown'
-import { Shelf as ShelfComponent } from './Shelf'
-const Shelf = React.createFactory(ShelfComponent)
-
-import { TABLE_ENCODINGS } from '../helpers/table'
-
-const { div, i: icon, label, pre, a: link, input } = React.DOM
-const { findDOMNode } = ReactDOM
-
-function createFieldDropdownComponent(Component) {
- class FieldDropdownContainer extends React.Component {
- constructor(props) {
- super(props)
- this.state = { optionField: null }
- this.setOptionField = this.setOptionField.bind(this)
- this.clearOptionField = this.clearOptionField.bind(this)
- }
-
- componentWillReceiveProps(nextProps) {
- if (!nextProps.isDropdownOpen) {
- this.setState({ optionField: null })
- } else if (nextProps.isDragging) {
- this.props.closeDropdown()
- this.setState({ optionField: null })
- }
- }
-
- setOptionField(shelf, position, bounds) {
- if (this.state.optionField == null || (!_.eq(_.pick(this.state.optionField, 'shelf', 'position'), {shelf, position}))) {
- const container = findDOMNode(this).getBoundingClientRect()
- this.props.openDropdown()
- this.setState({ optionField: {
- shelf, position,
- top: bounds.bottom - container.top - 1,
- left: bounds.left - container.left
- }})
- } else {
- this.props.closeDropdown()
- this.setState({ optionField: null })
- }
- }
-
- clearOptionField() {
- this.props.closeDropdown()
- this.setState({ optionField: null })
- }
-
- render() {
- return
- }
- }
-
- return createDropdownComponent(FieldDropdownContainer)
-}
-
-class TableLayoutSpecBuilder extends React.Component {
- render() {
- const { queryspec, fieldActionCreators,
- isDropdownOpen, closeDropdown, isDragging,
- optionField, setOptionField, getField } = this.props
- const { row, col } = queryspec
- const dropdownProps = { closeDropdown, setOptionField }
- const fieldProps = _.extend({ getField }, fieldActionCreators )
- return div({className: "querybuilder-type-spec col"},
- ,
- Shelf({name: "Rows", shelf: "row", fields: row, ...fieldProps, dropdownProps: dropdownProps}),
- Shelf({name: "Columns", shelf: "col", fields: col, ...fieldProps, dropdownProps: dropdownProps}))
- }
-}
-TableLayoutSpecBuilder = createFieldDropdownComponent(TableLayoutSpecBuilder)
-
-const MARK_PROPERTY_NAME = {
- size: "Size",
- shape: "Shape",
- color: "Color",
- background: "Background",
- opacity: "Opacity",
- orientation: "Orientation",
- x: "X Start",
- x2: "X End",
- y: "Y Start",
- y2: "Y End",
- text: "Text"
-}
-
-class TableSelect extends React.Component {
- render() {
- const { active, setPreview, setTableEncoding } = this.props
- const shelfActions = { setPreview, setTableEncoding }
- return div({className: "tablebuilder-type-select"},
- _.map(
- TABLE_ENCODINGS,
- (encoding, name) =>
- div(
- {
- key: name,
- onMouseEnter: (evt) => setPreview(name),
- onMouseLeave: (evt) => setPreview(null),
- onClick: (evt) => setTableEncoding(name),
- className: className("tablebuilder-type-choice", {active: active == name})
- },
- link({}, icon(...encoding.icon)))))
- }
-}
-
-class TableVisualSpecBuilder extends React.Component {
- constructor() {
- super(...arguments)
- this.state = { previewTableType: null, visualOptionDropdown: null }
- this.setPreview = this.setPreview.bind(this)
- }
-
- setPreview(value) {
- this.setState({ previewTableType: value })
- this.props.clearOptionField()
- }
-
- render() {
- const {
- queryspec, fieldActionCreators, vizActionCreators, scales,
- isDropdownOpen, closeDropdown, isDragging,
- optionField, setOptionField, getField
- } = this.props
- const dropdownProps = { isDropdownOpen, closeDropdown, setOptionField }
- const fieldProps = _.extend({ getField }, fieldActionCreators )
- const { previewTableType } = this.state
- const markProperties = TABLE_ENCODINGS[previewTableType || this.props.table.type].properties
- return div({className: "pane shelf-pane"},
- ,
- ,
- div({className: "container-flex-fill-wrap"},
- div({className: "container-flex-fill"},
- {TABLE_ENCODINGS[previewTableType || this.props.table.type].name} ,
- markProperties.map((attr) => {
- return Shelf({
- key: attr,
- name: MARK_PROPERTY_NAME[attr],
- shelf: attr,
- properties: this.props.properties[attr],
- fields: queryspec[attr],
- dropdownProps: dropdownProps,
- vizActionCreators: vizActionCreators,
- legend: scales && scales[attr],
- ...fieldProps
- })
- }))))
- }
-}
-TableVisualSpecBuilder = createFieldDropdownComponent(TableVisualSpecBuilder)
-
-export { TableLayoutSpecBuilder, TableVisualSpecBuilder }
diff --git a/src/explorer/components/VisualPropertiesDropdown.js b/src/explorer/components/VisualPropertiesDropdown.js
deleted file mode 100644
index 7e80205..0000000
--- a/src/explorer/components/VisualPropertiesDropdown.js
+++ /dev/null
@@ -1,140 +0,0 @@
-import React from 'react'
-import _ from 'lodash'
-import { getExternalType } from '../helpers/field'
-const { div, i: icon, a: link, label, pre, input, select, option, img, span } = React.DOM
-import { COLOR_PALETTES } from '../helpers/color'
-
-class ColorRangeSettings extends React.Component {
- render() {
- const { property, settings, setPropertySetting } = this.props
- if (settings.scaleManualRange) {
- return div({},
- label({className: 'querybuilder-color-sub-settings querybuilder-color-sub-settings-input'},
- "Min:",
- input({type: 'color', value: settings.scaleRangeMin, onChange: (evt) => {
- setPropertySetting(property, 'scaleRangeMin', evt.target.value)
- }})),
- label({className: 'querybuilder-color-sub-settings querybuilder-color-sub-settings-input'},
- "Max:",
- input({type: 'color', value: settings.scaleRangeMax, onChange: (evt) => {
- setPropertySetting(property, 'scaleRangeMax', evt.target.value)
- }})))
- }
- else {
- return null
- }
- }
-}
-
-class ColorDomainSettings extends React.Component {
- render() {
- const { property, settings, setPropertySetting } = this.props
- if (settings.scaleManualDomain) {
- return div({},
- label({className: 'querybuilder-color-sub-settings querybuilder-color-sub-settings-input'},
- "Min:",
- input({type: 'number', value: settings.scaleDomainMin, onChange: (evt) => {
- setPropertySetting(property, 'scaleDomainMin', evt.target.value)
- }})),
- label({className: 'querybuilder-color-sub-settings querybuilder-color-sub-settings-input'},
- "Max:",
- input({type: 'number', value: settings.scaleDomainMax, onChange: (evt) => {
- setPropertySetting(property, 'scaleDomainMax', evt.target.value)
- }})))
- }
- else {
- return label({className: 'querybuilder-color-sub-settings'},
- input({type: 'checkbox', checked: settings.scaleZero, onChange: (evt) => {
- setPropertySetting(property, 'scaleZero', evt.target.checked)
- }}),
- "Zero?")
- }
- }
-}
-
-class ColorProperties extends React.Component {
- render() {
- const { property, fields, fieldTypes, settings, setPropertySetting } = this.props
- const hasField = !_.isEmpty(fields)
- const fieldType = hasField ? (fields[0].op != null ? "number" : getExternalType(fields[0].typecast || fieldTypes[0].type)) : null
- if (hasField) {
- switch (fieldType) {
- case 'text':
- return div({},
- label({}, "Palette"),
- div({className: 'querybuilder-color-settings'},
- _.map(COLOR_PALETTES, (colors, value) => {
- return label({key: value},
- input({
- type: 'radio',
- value: value,
- checked: value === settings.palette,
- onChange: () => { if (value !== settings.palette) setPropertySetting(property, 'palette', value) }
- }),
- div({ dangerouslySetInnerHTML: { __html: require(`../images/color/${value}.svg`) } }))
- })))
- default:
- return div({},
- label(
- {className: 'querybuilder-color-static', style: {marginBottom: 5}},
- span({style: {marginTop: 4}}, "Scale"),
- select(
- {
- value: settings.scale,
- onChange: (evt) => { setPropertySetting(property, 'scale', evt.target.value) }
- },
- option({value: "linear"}, "linear"),
- option({value: "log"}, "log"),
- option({value: "pow"}, "pow"),
- option({value: "sqrt"}, "sqrt"),
- option({value: "quantile"}, "quantile"))),
- label({className: 'querybuilder-color-settings'},
- input({type: 'checkbox', checked: !settings.scaleManualDomain, onChange: (evt) => {
- setPropertySetting(property, 'scaleManualDomain', !evt.target.checked)
- }}),
- "Auto Domain"),
- ,
- label({className: 'querybuilder-color-settings'},
- input({type: 'checkbox', checked: !settings.scaleManualRange, onChange: (evt) => {
- setPropertySetting(property, 'scaleManualRange', !evt.target.checked)
- }}),
- "Auto Range"),
- )
- }
- }
- else {
- return label({className: 'querybuilder-color-static'},
- "Default",
- input({type: "color", value: settings['default'],
- onChange: (evt) => { setPropertySetting(property, 'default', evt.target.value) }}))
- }
- }
-}
-
-class VisualPropertiesSettings extends React.Component {
- render() {
- const { property, fields, settings, getField, setPropertySetting } = this.props
- const fieldTypes = fields.map((field) => getField(field.tableId, field.fieldId))
-
- switch(property) {
- case 'color': case 'background':
- return
- default:
- return div(
- {},
- pre({}, JSON.stringify(fields, null, 2)),
- pre({}, JSON.stringify(fieldTypes, null, 2)),
- pre({}, JSON.stringify(settings, null, 2)))
- }
- }
-}
-
-export class VisualPropertiesDropdown extends React.Component {
- render() {
- const { isOpen, property, fields, settings, getField, close, setPropertySetting } = this.props
- if (!isOpen) return null
- return div({className: "querybuilder-field-settings querybuilder-property-settings"},
- icon({className: "fa fa-times remove-link", onClick: close}),
- )
- }
-}
diff --git a/src/explorer/components/vis/Axis.js b/src/explorer/components/vis/Axis.js
deleted file mode 100644
index 959de41..0000000
--- a/src/explorer/components/vis/Axis.js
+++ /dev/null
@@ -1,117 +0,0 @@
-import className from 'classnames'
-import _ from 'lodash'
-import d3 from 'd3'
-import React from 'react'
-import { getFieldType, isGroupByField } from '../../helpers/field'
-const { div, svg } = React.DOM
-
-function axisDiscretizeTicks(axis, format) {
- let numTicks = axis.ticks()[0]
- let axisScale = axis.scale()
- let tickValues = _(axisScale.ticks(numTicks)).map(Math.floor).uniq().map((tick) => tick + 0.5).value()
- if (_.last(tickValues) > _.last(axisScale.domain())) tickValues.pop()
- axis
- .tickValues(tickValues)
- .tickSubdivide(tickValues[1] - tickValues[0] - 1)
- .tickFormat((s) => format(Math.floor(s)))
-}
-
-function axisTickHorizontalLabelShift(d) {
- let bounds = this.getBBox()
- const baseVal = this.parentElement.transform.baseVal
- let left = (baseVal[0] || baseVal.getItem(0)).matrix.e + bounds.x
- if (left < 0) {
- return 1 - left
- }
- else {
- let parentWidth = this.parentElement.parentElement.parentElement.width.baseVal.value
- let right = left + bounds.width
- if (right > parentWidth) {
- return parentWidth - right - 2
- }
- else {
- let current = d3.select(this).attr('x')
- return current ? current : 0
- }
- }
-}
-
-function axisTickVerticalLabelShift(d) {
- let bounds = this.getBBox()
- const baseVal = this.parentElement.transform.baseVal
- let top = (baseVal[0] || baseVal.getItem(0)).matrix.f + bounds.y
- if (top < 0) {
- return 1 - top
- }
- else {
- let parentHeight = this.parentElement.parentElement.parentElement.height.baseVal.value
- let bottom = top + bounds.height
- if (bottom > parentHeight) {
- return parentHeight - bottom - 1
- }
- else {
- let current = d3.select(this).attr('y')
- return current ? current : 0
- }
- }
-}
-
-export class Axis extends React.Component {
- _d3Axis() {
- let { orient, scale, field, markType } = this.props
- let axis = d3.svg.axis().scale(scale).orient(orient).ticks(5)
- if ('bar' == markType) {
- if ('integer' == field.type && 'bin' == field.func && field.binSettings.step == 1) {
- axisDiscretizeTicks(axis, d3.format(",d"))
- }
- else if ('time' == getFieldType(field) && !_.contains(field.func, 'bin')) {
- axisDiscretizeTicks(axis, d3.format("d"))
- }
- }
- else if ('time' == getFieldType(field) && !_.contains(field.func, 'bin')) {
- axis.tickFormat(d3.format("d"))
- }
- return axis
- }
-
- _d3Render() {
- let tickText = d3.select(this.refs.axisContainer)
- .call(this._d3Axis())
- .selectAll("text")
- if (this.isHorizontalAxis()) {
- tickText.attr("x", axisTickHorizontalLabelShift)
- }
- else {
- tickText.attr("y", axisTickVerticalLabelShift)
- }
- }
-
- _orientTransform() {
- let { orient, width, height } = this.props
- let x = 'left' == orient ? width - 1: 0
- let y = 'top' == orient ? height : 0
- return `translate(${x}, ${y})`
- }
-
- isHorizontalAxis() {
- return 'top' == this.props.orient || 'bottom' == this.props.orient
- }
-
- componentDidMount() {
- this._d3Render()
- }
-
- componentDidUpdate() {
- this._d3Render()
- }
-
- render() {
- let { domain, name, orient, width, height } = this.props
- return div({},
- svg({className: 'axis', width, height}, ),
- div({className: className('axis-label', {[orient]: true})}, name))
- }
-}
-Axis.defaultProps = {
- orient: 'bottom'
-}
diff --git a/src/explorer/components/vis/Pane.js b/src/explorer/components/vis/Pane.js
deleted file mode 100644
index a7366e2..0000000
--- a/src/explorer/components/vis/Pane.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react'
-import { getFieldQueryType, getAccessorName } from '../../helpers/field'
-
-const MARKS = {
- 'bar': React.createFactory(require('./marks/Bar')),
- 'line': React.createFactory(require('./marks/Line')),
- 'area': React.createFactory(require('./marks/Area')),
- 'point': React.createFactory(require('./marks/Point'))
-}
-
-export class Pane extends React.Component {
- render() {
- const { fieldScales, paneData, rowAxis, colAxis } = this.props
- const { markData } = paneData
- let transformFields = _.filter(
- fieldScales,
- (fs) => {
- return fs.scale && (
- (fs.shelf != 'col' && fs.shelf != 'row')
- || ((fs.shelf == 'row' && rowAxis.hasField(fs.field))
- ||
- (fs.shelf == 'col' && colAxis.hasField(fs.field))))
- })
-
- let markComponent = MARKS[this.props.markType]
- if (markComponent) {
- return markComponent(_.extend({markData, transformFields}, this.props))
- }
- else {
- return null
- }
- }
-}
diff --git a/src/explorer/components/vis/marks/Area.js b/src/explorer/components/vis/marks/Area.js
deleted file mode 100644
index fe7f320..0000000
--- a/src/explorer/components/vis/marks/Area.js
+++ /dev/null
@@ -1,132 +0,0 @@
-import _ from 'lodash'
-import dl from 'datalib'
-import d3 from 'd3'
-import React from 'react'
-import { getFieldType, getAccessorName, isStackableField, isAggregateType, isBinField, isGroupByField } from '../../../helpers/field'
-import { stackGroupedLayout } from './layout'
-const { div, svg } = React.DOM
-
-export default class Area extends React.Component {
- getDefaultScales() {
- const { scales } = this.props
- return {
- stroke: scales.color.__default__,
- "stroke-width": 2,
- x: 0,
- y0: 0,
- y1: 0
- }
- }
-
- getAreaScales(props, sortedMarkData, binField) {
- const { width, height } = this.props
- const { field, scale, shelf } = props
- const name = getAccessorName(field)
- const isStackable = isStackableField(field)
- const isAggregate = isAggregateType(field)
- const isBin = isBinField(field)
- const isTime = 'time' == getFieldType(field)
- switch(shelf) {
- case 'row':
- if (isStackable) {
- let stacked = stackGroupedLayout(sortedMarkData, name, binField)
- return {
- y0: ([d, level], i) => scale(stacked(d, level, i)),
- y1: ([d, level], i) => scale(d[name]) + scale(stacked(d, level, i)) - height
- }
- }
- else if (isBin) {
- return {
- x: ([d, level]) => scale(d[name])
- }
- }
- else {
- return {
- y0: ([d, level]) => height,
- y1: ([d, level]) => scale(d[name])
- }
- }
- case 'col':
- if (isStackable) {
- let stacked = stackGroupedLayout(sortedMarkData, name, binField)
- return {
- y0: ([d, level], i) => width - scale(d[name]) - scale(stacked(d, level, i)),
- y1: ([d, level], i) => width - scale(stacked(d, level, i)),
- transform: `translate(${width}) rotate(90)`
- }
- } else {
- return {
- x: ([d, level]) => scale(d[name])
- }
- }
- case 'color':
- return {
- stroke: (d) => scale(d[name])
- }
- case 'size':
- return {
- // 'stroke-width':
- }
- default:
- return {
- }
- }
- }
-
- getAttributeTransforms(sortedMarkData) {
- const { transformFields } = this.props
- const binField = _.find(transformFields, fs => isBinField(fs.field))
- let transforms = _.merge(
- this.getDefaultScales(),
- _.reduce(_.map(transformFields, (fs) => this.getAreaScales(fs, sortedMarkData, binField)), _.merge, {}))
- return transforms
- }
-
- _d3Render() {
- d3.select(this.refs.d3container).selectAll("*").remove()
- const sortAccessors = _.filter([
- isBinField(this.props.rowAxis.field) ? this.props.rowAxis.field.accessor : null,
- isBinField(this.props.colAxis.field) ? this.props.colAxis.field.accessor : null])
- const markSort = values =>
- _.isEmpty(sortAccessors) ? values : _.sortByAll(values, sortAccessors)
- const areaGroups = _.map(
- dl.groupby(
- _.map(_.filter(this.props.transformFields, fs => !_.contains(['row', 'col'], fs.shelf)), 'field.accessor')
- ).execute(this.props.markData),
- areaGroup => _.extend({}, areaGroup, {values: markSort(areaGroup.values)}))
-
- const transforms = this.getAttributeTransforms(areaGroups)
- const area = d3.svg.area()
- .x(transforms.x)
- .y0(transforms.y0)
- .y1(transforms.y1)
- .interpolate('linear')
-
- let areas = d3.select(this.refs.d3container).selectAll("g.area")
- .data(areaGroups) // each area group
-
- areas.enter().append("g").attr("class", "area").append("path")
- .attr('d', (areaGroup, level) =>
- area(_.zip(areaGroup.values,_.times(areaGroup.values.length, x => level))))
-
- areas.selectAll("g.area path")
- .attr('transform', transforms.transform)
- .attr('stroke', transforms.stroke)
- .attr('stroke-width', transforms['stroke-width'])
- .attr('fill', transforms.stroke)
- areas.exit().remove()
- }
-
- componentDidMount() {
- this._d3Render()
- }
-
- componentDidUpdate() {
- this._d3Render()
- }
-
- render() {
- const { width, height } = this.props
- return svg({ref: 'd3container', width, height})
- }
-}
diff --git a/src/explorer/components/vis/marks/Bar.js b/src/explorer/components/vis/marks/Bar.js
deleted file mode 100644
index 2f94a61..0000000
--- a/src/explorer/components/vis/marks/Bar.js
+++ /dev/null
@@ -1,170 +0,0 @@
-import d3 from 'd3'
-import _ from 'lodash'
-import React from 'react'
-import { getFieldType, getAccessorName, isStackableField, isAggregateType, isBinField, isGroupByField } from '../../../helpers/field'
-import { stackLayout } from './layout'
-const { div, svg } = React.DOM
-const ZERO = d => 0
-
-export default class Bar extends React.Component {
- getDefaultScales() {
- const { scales, width, height } = this.props
- return {
- opacity: scales.opacity.__default__,
- fill: scales.color.__default__,
- x: ZERO,
- y: ZERO,
- height: (d) => height - 1,
- width: (d) => width - 1
- }
- }
-
- getBarScales(props, binField) {
- const { markData, width, height } = this.props
- const { field, scale, shelf } = props
- const name = getAccessorName(field)
- const isStackable = isStackableField(field)
- const isAggregate = isAggregateType(field)
- const isBin = isBinField(field)
- const isTime = 'time' == getFieldType(field)
-
- switch(shelf) {
- case 'row':
- if (isStackable) {
- let stacked = stackLayout(markData, name, binField)
- return {
- y: (d, i) => scale(d[name]) + scale(stacked(d, i)) - height,
- height: (d) => height - scale(d[name])
- }
- }
- else if (isAggregate) {
- return {
- y: (d, i) => scale(d[name]),
- height: (d) => height - scale(d[name])
- }
- }
- else if (isBin) {
- if (isTime && _.contains(field.func, 'bin')) {
- return {
- y: (d) => scale(d3.time[field.binSettings.unit.type].offset(d[name], field.binSettings.step)),
- height: (d) => {
- let nextTime = d3.time[field.binSettings.unit.type].offset(d[name], field.binSettings.step)
- let barHeight = scale(d[name]) - scale(nextTime)
- return barHeight > 1 ? barHeight - 1 : barHeight
- }
- }
- }
- else if (isTime) {
- return {
- y: (d) => scale(d[name] + 1),
- height: (d) => scale(d[name]) - scale(d[name] + 1) - 1
- }
- }
- else {
- return {
- y: (d) => scale(d[name] + field.binSettings.step),
- height: (d) => scale(d[name]) - scale(d[name] + field.binSettings.step) - 1
- }
- }
- }
- else {
- return {
- y: (d) => scale(d[name]),
- height: (d) => height - scale(d[name]) - 1
- }
- }
- case 'col':
- if (isStackable) {
- let stacked = stackLayout(markData, name, binField)
- return {
- x: (d, i) => scale(stacked(d, i)),
- width: (d) => scale(d[name])
- }
- }
- else if (isAggregate) {
- return {
- width: (d) => scale(d[name])
- }
- }
- else if (isBin) {
- if (isTime && _.contains(field.func, 'bin')) {
- return {
- x: (d) => scale(d[name]),
- width: (d) => {
- let nextTime = d3.time[field.binSettings.unit.type].offset(d[name], field.binSettings.step)
- let barWidth = scale(nextTime) - scale(d[name])
- return barWidth > 1 ? barWidth - 1 : barWidth
- }
- }
- }
- else if (isTime) {
- return {
- x: (d) => scale(d[name]),
- width: (d) => scale(d[name] + 1) - scale(d[name]) - 1
- }
- }
- else {
- return {
- x: (d) => scale(d[name]),
- width: (d) => scale(d[name] + field.binSettings.step) - scale(d[name]) - 1
- }
- }
- }
- else {
- return {
- width: (d) => scale(d[name]) - 1
- }
- }
- case 'color':
- return {
- fill: (d) => scale(d[name])
- }
- case 'opacity':
- return {
- opacity: (d) => scale(d[name])
- }
- default:
- return {
- }
- }
- }
-
- getAttributeTransforms() {
- const { transformFields } = this.props
- const binField = _.find(transformFields, fs => isBinField(fs.field))
- let transforms = _.merge(
- this.getDefaultScales(),
- _.reduce(_.map(
- transformFields,
- (fs) => this.getBarScales(fs, binField)), _.merge, {}))
- transforms.transform = (d, i) => `translate(${transforms.x(d, i)}, ${transforms.y(d, i)})`
- return transforms
- }
-
- _d3Render() {
- let transforms = this.getAttributeTransforms()
- let bars = d3.select(this.refs.d3container).selectAll("rect")
- .data(this.props.markData)
- bars.enter().append('rect')
- bars.attr('fill', transforms.fill)
- .attr('fill-opacity', transforms.opacity)
- .attr('x', transforms.x)
- .attr('y', transforms.y)
- .attr('width', transforms.width)
- .attr('height', transforms.height)
- bars.exit().remove()
- }
-
- componentDidMount() {
- this._d3Render()
- }
-
- componentDidUpdate() {
- this._d3Render()
- }
-
- render() {
- const { width, height } = this.props
- return svg({ref: 'd3container', width, height})
- }
-}
diff --git a/src/explorer/components/vis/marks/Line.js b/src/explorer/components/vis/marks/Line.js
deleted file mode 100644
index bc91439..0000000
--- a/src/explorer/components/vis/marks/Line.js
+++ /dev/null
@@ -1,96 +0,0 @@
-import _ from 'lodash'
-import dl from 'datalib'
-import d3 from 'd3'
-import React from 'react'
-import { getAccessorName, isBinField } from '../../../helpers/field'
-const { div, svg } = React.DOM
-
-export default class Line extends React.Component {
- getDefaultScales() {
- const { scales } = this.props
- return {
- stroke: scales.color.__default__,
- "stroke-width": 2,
- x: 0,
- y: 0
- }
- }
-
- getLineScales(props) {
- const { markData, width, height } = this.props
- const { field, scale, shelf } = props
- const name = getAccessorName(field)
- switch(shelf) {
- case 'row':
- return {
- y: (d) => scale(d[name])
- }
- case 'col':
- return {
- x: (d) => scale(d[name])
- }
- case 'color':
- return {
- stroke: (d) => scale(d[name])
- }
- case 'size':
- return {
- // 'stroke-width':
- }
- default:
- return {
- }
- }
- }
-
- getAttributeTransforms() {
- const { transformFields } = this.props
- let transforms = _.merge(
- this.getDefaultScales(),
- _.reduce(_.map(transformFields, (fs) => this.getLineScales(fs)), _.merge, {}))
- return transforms
- }
-
- _d3Render() {
- d3.select(this.refs.d3container).selectAll("*").remove()
- const transforms = this.getAttributeTransforms()
- const line = d3.svg.line()
- .x(transforms.x)
- .y(transforms.y)
- .interpolate('linear')
-
- const lineGroups = dl.groupby(
- _.map(_.filter(this.props.transformFields, fs => !_.contains(['row', 'col'], fs.shelf)), 'field.accessor')
- ).execute(this.props.markData)
-
- const sortAccessors = _.filter([
- isBinField(this.props.rowAxis.field) ? this.props.rowAxis.field.accessor : null,
- isBinField(this.props.colAxis.field) ? this.props.colAxis.field.accessor : null])
- const markSort = values =>
- _.isEmpty(sortAccessors) ? values : _.sortByAll(values, sortAccessors)
-
- let lines = d3.select(this.refs.d3container).selectAll("g.line")
- .data(lineGroups) // each line group
-
- lines.enter().append("g").attr("class", "line").append("path")
- lines.selectAll("g.line path")
- .attr('d', lineGroup => line(markSort(lineGroup.values)))
- .attr('stroke', transforms.stroke)
- .attr('stroke-width', transforms['stroke-width'])
- .attr('fill', 'none')
- lines.exit().remove()
- }
-
- componentDidMount() {
- this._d3Render()
- }
-
- componentDidUpdate() {
- this._d3Render()
- }
-
- render() {
- const { width, height } = this.props
- return svg({ref: 'd3container', width, height})
- }
-}
diff --git a/src/explorer/components/vis/marks/Point.js b/src/explorer/components/vis/marks/Point.js
deleted file mode 100644
index 2c873aa..0000000
--- a/src/explorer/components/vis/marks/Point.js
+++ /dev/null
@@ -1,102 +0,0 @@
-import _ from 'lodash'
-import dl from 'datalib'
-import d3 from 'd3'
-import React from 'react'
-import { getAccessorName, isBinField } from '../../../helpers/field'
-const { svg } = React.DOM
-const XDEFAULT = d => 30
-const YDEFAULT = d => 15
-const FILL_OPACITY_DEFAULT = d => 0.4
-
-export default class Point extends React.Component {
- getDefaultScales() {
- const { scales } = this.props
- let symbol = d3.svg.symbol()
- return {
- opacity: FILL_OPACITY_DEFAULT,
- size: scales.size.__default__,
- symbol: symbol,
- shape: scales.shape.__default__,
- color: scales.color.__default__,
- x: XDEFAULT,
- y: YDEFAULT
- }
- }
-
- getSymbolScales(props) {
- const { markData, width, height } = this.props
- const { field, scale, shelf } = props
- const name = getAccessorName(field)
- switch(shelf) {
- case 'row':
- return {
- y: (d) => scale(d[name])
- }
- case 'col':
- return {
- x: (d) => scale(d[name])
- }
- case 'color':
- let color = (d) => scale(d[name])
- return {
- color
- }
- case 'size':
- return {
- size: d => scale(d[name])
- }
- case 'shape':
- return {
- shape: d => scale(d[name])
- }
- case 'opacity':
- return {
- opacity: d => scale(d[name])
- }
- default:
- return {
- }
- }
- }
-
- getAttributeTransforms() {
- const { transformFields } = this.props
- let transforms = _.merge(
- this.getDefaultScales(),
- _.reduce(_.map(transformFields, (fs) => this.getSymbolScales(fs)), _.merge, {}))
- transforms.transform = (d, i) => `translate(${transforms.x(d, i)}, ${transforms.y(d, i)})`
- transforms.d = d => {
- return transforms.symbol.size(transforms.size(d)).type(transforms.shape(d))()
- }
- return transforms
- }
-
- _d3Render() {
- const transforms = this.getAttributeTransforms()
- let symbols = d3.select(this.refs.d3container).selectAll("g.symbol")
- .data(this.props.markData)
- symbols.enter().append("g").attr("class", "symbol").append('path')
- symbols.selectAll('g.symbol path')
- .attr('stroke-width', 1)
- .attr('d', transforms.d)
- .attr('fill', transforms.color)
- .attr('fill-opacity', transforms.opacity)
- .attr('stroke-opacity', transforms.opacity)
- .attr('stroke', transforms.color)
- .attr('transform', transforms.transform)
- symbols.exit().remove()
- }
-
- componentDidMount() {
- this._d3Render()
- }
-
- componentDidUpdate() {
- this._d3Render()
- }
-
- render() {
- const { width, height } = this.props
- return svg({ref: 'd3container', width, height})
- }
-}
diff --git a/src/explorer/components/vis/marks/layout.js b/src/explorer/components/vis/marks/layout.js
deleted file mode 100644
index ca312f2..0000000
--- a/src/explorer/components/vis/marks/layout.js
+++ /dev/null
@@ -1,69 +0,0 @@
-import { getAccessorName } from '../../../helpers/field'
-import _ from 'lodash'
-
-function cumsum(array, sum_fn = _.identity) {
- let sum = 0
- let current_sum
- let result = _.map(array, a => {
- current_sum = sum
- sum += sum_fn(a)
- return current_sum
- })
- result.push(sum)
- return result
-}
-
-export function stackLayout(markData, name, binField) {
- let accessor = _.property(name)
- if (!binField) {
- let stacked = cumsum(markData, accessor)
- return (d, i) => stacked[i]
- }
- else {
- let sums = {}
- let binName = getAccessorName(binField.field)
- let stacked = _.map(
- markData,
- a => {
- if(null == sums[a[binName]]) sums[a[binName]] = 0
- let current_sum = sums[a[binName]]
- sums[a[binName]] += a[name]
- return current_sum
- })
- return (d, i) => stacked[i]
- }
-}
-
-export function stackGroupedLayout(groupMarkData, name, binField) {
- let stacked
- if (!binField) {
- let sum = 0
- stacked = _.map(
- groupMarkData,
- a => {
- return _.map(
- a.values,
- b => {
- let current_sum = sum
- sum += b[name]
- return current_sum
- })})
- }
- else {
- let sums = {}
- let binName = getAccessorName(binField.field)
- stacked = _.map(
- groupMarkData,
- a => {
- return _.map(
- a.values,
- b => {
- if(null == sums[b[binName]]) sums[b[binName]] = 0
- let current_sum = sums[b[binName]]
- sums[b[binName]] += b[name]
- return current_sum
- })})
- }
-
- return (d, level, i) => stacked[level][i]
-}
diff --git a/src/explorer/css/components/datasource.scss b/src/explorer/css/components/datasource.scss
deleted file mode 100644
index 7dde305..0000000
--- a/src/explorer/css/components/datasource.scss
+++ /dev/null
@@ -1,135 +0,0 @@
-@import '../../../css/flexbox.scss';
-@import '../../../css/utilities.scss';
-
-@include keyframes(field-fade-in) {
- 0% {
- top: -20px;
- }
-
- 100% {
- top: 0px;
- }
-}
-
-.datasource-select {
- position: relative;
- border-bottom: 1px solid #dfdfdf;
- cursor: pointer;
-
- .datasource-title {
- position: relative;
- padding: 5px 5px 3px;
- padding-right: 15px;
- @include overflow-ellipsis;
-
- i.fa {
- padding-right: 5px;
- color: $link-blue;
- }
-
- i.fa.fa-caret-down,
- i.fa.fa-caret-up {
- position: absolute;
- top: 8px;
- right: 0px;
- color: #bbb;
- }
- }
-
- .datasource-dropdown {
- position: absolute;
- top: 100%;
- left: 0;
- right: -1px;
- z-index: 10;
-
- cursor: default;
-
- background-color: #fff;
- border-top: 1px solid #dfdfdf;
- border-right: 1px solid #dfdfdf;
- box-shadow: 0 3px 5px #c3c3c3;
-
- .datasource-list {
- max-height: 310px;
- overflow: auto;
- }
-
- .datasource-add {
- position: relative;
- padding: 5px;
- text-align: center;
- border-top: 1px solid #dfdfdf;
- color: $link-blue;
- cursor: pointer;
-
- &:hover,
- &:focus {
- background-color: $link-blue;
- color: white;
- }
-
- i.fa.fa-plus {
- position: absolute;
- top: 8px;
- left: 30px;
- }
- }
-
- .datasource-db-name, .datasource-name {
- @include overflow-ellipsis;
- }
-
- .datasource-db-name, .datasource-name, .datasource-db .datasource-db-tables {
- padding: 5px;
-
- i.fa {
- padding-right: 5px;
- }
- }
-
- .datasource-name {
- cursor: pointer;
-
- &:hover,
- &:focus {
- background-color: #3875d7;
- color: white;
- }
- }
-
- .datasource-db .datasource-db-tables {
- padding-left: 15px;
- }
- }
-}
-
-.datasource-table-container {
- @include flex(1 0 auto);
- position: relative;
-}
-
-.datasource-table-fields {
- position: absolute;
- top: 0; bottom: 0; left: 0; right: 0;
- padding: 5px 8px;
- overflow: auto;
-
- .datasource-table-field.field-wrap {
- margin-bottom: 5px;
-
- @include animation(field-fade-in .3s ease);
-
- .icon-wrap {
- width: 23px;
- }
-
- .name-wrap {
- @include flex(1 1 auto);
- }
-
- span {
- padding: 3px 0px;
- }
- }
-}
diff --git a/src/explorer/css/components/field.scss b/src/explorer/css/components/field.scss
deleted file mode 100644
index 72799dc..0000000
--- a/src/explorer/css/components/field.scss
+++ /dev/null
@@ -1,198 +0,0 @@
-@import '../../../css/flexbox.scss';
-@import '../../../css/utilities.scss';
-
-@mixin draggable-field {
- cursor: pointer;
- cursor: -webkit-grab;
- cursor: -moz-grab;
-
- &:hover,
- &:focus {
- box-shadow: 0 1px 3px #dfdfdf;
- }
- &:active {
- box-shadow: 0 2px 3px rgba(0,0,0,.8);
- cursor: move;
- cursor: -webkit-grabbing;
- cursor: -moz-grabbing;
- }
-}
-
-.func-wrap {
- padding-left: 6px;
- text-transform: uppercase;
- text-shadow: rgb(255, 255, 255) 0px 1px 0px;
- color: #222;
- font-weight: 600;
- @include overflow-ellipsis;
- @include flex(1 0 auto);
-
- &:empty {
- display: none;
- }
-}
-
-.icon-wrap {
- text-align: center;
- padding-left: 3px;
- padding-right: 3px;
- border-right: 1px solid #dfdfdf;
-}
-
-.name-wrap {
- position: relative;
- padding-left: 6px;
- padding-right: 6px;
- @include overflow-ellipsis;
-
- &.has-func {
- padding-left: 5px;
- padding-right: 5px;
-
- &:before,
- &:after {
- position: absolute;
- top: -1px;
- }
-
- &:before {
- content: "(";
- left: 0px;
- }
-
- &:after {
- content: ")";
- right: 0px;
- }
- }
-}
-
-.option-wrap i.fa.fa-trash-o {
- padding: 0px 4px 0 3px;
-}
-
-.field-wrap {
- position: relative;
- border: 1px solid #dfdfdf;
- border-radius: 1px;
- background-color: #f0f0f0;
- overflow: hidden;
-
- @include flex(0 0 auto);
- @include flexbox;
- @include flex-flow(row);
- @include draggable-field;
-
- &.querybuilder-field {
- margin-right: 6px;
- @include flex(0 0 auto);
-
- .icon-wrap {
- @include flex(1 0 auto);
- max-width: 60px;
-
- i.fa.fa-long-arrow-right {
- padding: 0 5px;
- }
- }
-
- .name-wrap {
- max-width: 125px;
- @include flex(0 1 auto);
- }
-
- .option-wrap {
- padding: 0px 3px;
- cursor: pointer;
-
- i.fa.fa-caret-down {
- padding: 0px 4px 0 3px;
- color: #aaa;
- text-shadow: rgb(255, 255, 255) 0px 1px 0px;
- border-radius: 2px;
- }
-
- i.fa.fa-times.remove-link {
- text-shadow: rgb(255, 255, 255) 0px 1px 0px;
- display: none;
- }
-
- &:hover,
- &:active {
- i.fa.fa-caret-down {
- text-shadow: none;
- color: #ddd;
- background-color: #bbb;
- }
- }
-
- &:active {
- i.fa.fa-caret-down {
- background-color: #aaa;
- }
- }
- }
-
- &:hover .option-wrap i.fa.fa-times.remove-link {
- display: initial;
- }
- }
-}
-
-.field-drag-layer {
- position: fixed;
- pointer-events: none;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- z-index: 100;
-}
-
-.field-drag-layer .field-drag-wrap {
- @include inline-flex;
-
- .field-wrap {
- opacity: 0.92;
- box-shadow: 0 2px 3px rgba(0,0,0,.8);
- cursor: move;
- cursor: -webkit-grabbing;
- cursor: -moz-grabbing;
-
- &.remove {
- background-color: lighten(#f18794, 5%);
- border: 1px solid #f18794;
- opacity: 0.5;
- .icon-wrap {
- border-right: 1px solid #f18794;
- }
- }
- }
-}
-
-.field-contained:before {
- display: none;
-}
-
-.field-empty:before {
- display: block;
-}
-
-.field-drop-target {
- background-color: lighten(#58C153, 40%);
-
- &:before {
- border-color: #999;
- font-weight: 600;
- }
-}
-
-.field-drop-over {
- background-color: lighten(#58C153, 30%);
-
- &:before {
- border-color: #999;
- font-weight: 600;
- background-color: lighten(#58C153, 20%);
- }
-}
diff --git a/src/explorer/css/components/graphic.scss b/src/explorer/css/components/graphic.scss
deleted file mode 100644
index 73b99e5..0000000
--- a/src/explorer/css/components/graphic.scss
+++ /dev/null
@@ -1,59 +0,0 @@
-@import '../../../css/utilities.scss';
-.graphic-container {
- background-color: white;
- border-width: 1px;
- border-style: solid;
- border-color: #dfdfdf;
- border-radius: 1px;
-}
-
-.loading-overlay {
- position: absolute;
- top: 0; bottom: 0; left: 0; right: 0;
- z-index: 2;
-
- .loading-overlay-background {
- position: absolute;
- top: 0; bottom: 0; left: 0; right: 0;
- background-color: #fff;
- opacity: 0.5;
- }
-
- i.fa.fa-spinner.fa-pulse {
- position: absolute;
- font-size: 4rem;
- top: 30%; left: 50%;
- margin-left: -2rem;
- }
-}
-
-.axis text {
- font-size: 10px;
- fill: #666;
-}
-
-.axis path,
-.axis line {
- fill: none;
- stroke: #dfdfdf;
- shape-rendering: crispEdges;
-}
-
-.axis-label {
- position: absolute;
- @include overflow-ellipsis;
-
- &.left {
- top: 0;
- left: 0;
- right: 40px;
- padding: 0 4px;
- }
-
- &.bottom {
- bottom: 10px;
- left: 0;
- right: 0;
- text-align: center;
- }
-}
diff --git a/src/explorer/css/components/querybuilder.scss b/src/explorer/css/components/querybuilder.scss
deleted file mode 100644
index f7a03e7..0000000
--- a/src/explorer/css/components/querybuilder.scss
+++ /dev/null
@@ -1,171 +0,0 @@
-@import '../../../css/flexbox.scss';
-
-.querybuilder {
- @include flexbox;
- @include flex(0 0 60px);
- @include flex-flow(row);
-
- border: 1px solid #dfdfdf;
- background-color: white;
- margin-bottom: 10px;
-
- .querybuilder-type-spec {
- @include flexbox;
- @include flex(1 1 auto);
- position: relative;
-
- &.row {
- @include flex-flow(row);
- }
-
- &.col {
- @include flex-flow(column);
- }
- }
-
- .querybuilder-type-spec.row .querybuilder-shelf {
- @include flex-flow(column);
-
- &:not(:last-of-type) {
- border-right: 1px solid #dfdfdf;
- }
-
- label {
- display: block;
- padding: 1px 3px 0px;
- }
- }
-
- .querybuilder-type-spec.row.key .querybuilder-shelf {
- &:first-of-type {
- @include flex(0 0 auto);
- }
-
- label {
- width: 150px;
- }
- }
-
- .querybuilder-type-spec.col .querybuilder-shelf {
- @include flex-flow(row);
- &:not(:last-of-type) {
- border-bottom: 1px solid #dfdfdf;
- }
-
- label {
- padding: 1px 3px 0px;
- border-right: 1px solid #dfdfdf;
- background-color: #efefef;
-
- @include flexbox;
- @include flex(0 0 80px);
- @include align-items(center);
- }
- }
-}
-
-.querybuilder-field-settings {
- position: absolute;
- top: 25px; left: 88px;
- top: 55px;
- background-color: white;
- border: 1px solid #dfdfdf;
- border-radius: 2px;
- border-top-left-radius: 0px;
- box-shadow: 0 3px 5px #ccc;
- padding: 5px;
- z-index: 10;
- width: 200px;
-
- &.querybuilder-property-settings {
- top: 20px;
- left: 0px;
- right: 0px;
- width: auto;
- border-top-left-radius: 2px;
- }
-
- .querybuilder-field-options > label {
- font-weight: 600;
-
- a {
- padding-left: 8px;
- font-weight: 400;
- cursor: pointer;
- }
- }
-
- i.fa.fa-times.remove-link {
- position: absolute;
- right: 5px;
- top: 5px;
- z-index: 1;
- }
-
- .querybuilder-field-remove {
- color: #f18794;
- border-top: 1px solid #dfdfdf;
- margin: 0 -5px -5px;
- padding: 5px;
- cursor: pointer;
-
- &:hover,
- &:focus {
- background-color: #f18794;
- color: white;
- }
- }
-
- .querybuilder-func .querybuilder-field-settings-option-value {
- width: 50%;
- }
-
- .querybuilder-field-settings-options {
- @include flexbox;
- @include flex-flow(row wrap);
- margin-bottom: 0.5rem;
-
- .querybuilder-field-settings-option-value {
- @include flex(1 0 auto);
- }
- }
-}
-
-.querybuilder-property-settings {
- .querybuilder-color-static span {
- padding-right: 10px;
- }
-
- .querybuilder-color-settings, .querybuilder-color-sub-settings {
- @include flexbox;
- @include flex-flow(row wrap);
- @include flex-just(flex-start);
-
- input[type=checkbox] {
- margin-bottom: 6px;
- margin-right: 6px;
- }
- }
-
- .querybuilder-color-sub-settings {
- padding-left: 20px;
-
- &.querybuilder-color-sub-settings-input span {
- @include flex(0 0 35px);
- }
- }
-
- .querybuilder-color-settings label {
- @include flex(1 0 60px);
- }
-
- .querybuilder-color-settings label div {
- margin: 5px 0;
- height: 24px;
-
- svg {
- width: 40px;
- height: 24px;
- }
- }
-}
\ No newline at end of file
diff --git a/src/explorer/css/components/shelf.scss b/src/explorer/css/components/shelf.scss
deleted file mode 100644
index fa40141..0000000
--- a/src/explorer/css/components/shelf.scss
+++ /dev/null
@@ -1,210 +0,0 @@
-@import '../../../css/flexbox.scss';
-
-@mixin border-shim($color, $border-color: #dfdfdf) {
- &:after {
- content: " ";
- position: absolute;
- left: -1px; right: -1px;
- bottom: -2px;
- height: 5px;
- background-color: $color;
- border-left: 1px solid $border-color;
- border-right: 1px solid $border-color;
- z-index: 1;
- }
-}
-
-.shelf-pane .container-flex-fill-wrap {
- background-color: white;
- border: 1px solid #dfdfdf;
-}
-
-.shelf-pane .container-flex-fill {
- @include flexbox;
- @include flex-flow(column);
- padding: 5px 6px;
-}
-
-.querybuilder-shelf {
- position: relative;
- @include flexbox;
- @include flex(1 1 0px);
-
- label {
- position: relative;
- text-shadow: rgb(255, 255, 255) 0px 1px 0px;
-
- i.fa.fa-times.remove-link {
- position: absolute;
- top: 0;
- right: 0;
- padding: 6px 5px 9px;
- display: none;
- cursor: pointer;
- }
-
- &:hover i.fa.fa-times.remove-link {
- display: block;
- }
- }
-
- .querybuilder-field-container-wrap {
- @include flex(1 0 auto);
- position: relative;
- overflow: hidden;
-
- &:hover {
- overflow: auto;
- }
-
- &:before {
- content: "Drop Fields Here";
- position: absolute;
- margin: 3px 6px;
- padding: 0px 6px;
- border: 1px dotted #dfdfdf;
- border-radius: 2px;
- }
- }
-
- .querybuilder-field-container {
- @include flexbox;
- @include flex-flow(row);
-
- position: absolute;
- padding: 3px 6px 3px;
-
- .field-position-marker {
- position: absolute;
- background-color: #58C153;
- top: 0px; bottom: 0px;
- margin-left: -4px;
- width: 2px;
-
- &:before,
- &:after {
- content: " ";
- position: absolute;
- left: -2px;
- }
-
- &:before {
- top: 0px;
- border-top: 3px solid #58C153;
- border-left: 3px solid transparent;
- border-right: 3px solid transparent;
- }
-
- &:after {
- bottom: 0px;
- border-bottom: 3px solid #58C153;
- border-left: 3px solid transparent;
- border-right: 3px solid transparent;
- }
- }
- }
-}
-
-.shelf-pane .querybuilder-shelf {
- margin-bottom: 15px;
-
- .querybuilder-shelf-legend {
- overflow: auto;
- max-height: 200px;
- padding: 8px 6px 0px;
- }
-
- @include flex-flow(column);
- @include flex(0 1 auto);
-
- label {
- @include flexbox;
- @include flex(0 1 auto);
- @include align-items(center);
-
- i.fa.fa-caret-down {
- @include align-self(center);
- position: relative;
- top: -3px;
- padding: 3px;
- margin-left: auto;
- visibility: hidden;
- cursor: pointer;
- }
-
- &:hover,
- &:focus {
- i.fa.fa-caret-down {
- visibility: visible;
- }
- }
- }
-
- .querybuilder-field-container-wrap {
- height: 23px;
- overflow: visible;
-
- &:before {
- content: "Drop Field Here";
- top: 0; bottom: 0; left: 0; right: 0;
- margin: 0;
-
- }
- }
-
- .querybuilder-field-container {
- top: 0; bottom: 0; left: 0; right: 0;
- padding: 0px;
- }
-
- .querybuilder-field.field-wrap {
- @include flex(0 1 auto);
- margin-right: 0;
-
- .name-wrap {
- max-width: none;
- }
- }
-}
-
-.shelf-pane label.tablebuilder-encoding-title {
- font-size: 1rem;
- margin-bottom: 10px;
-}
-
-.tablebuilder-type-select {
- @include flexbox;
- @include flex-flow(row);
-
- .tablebuilder-type-choice {
- @include flex(1 1 27px);
- position: relative;
- height: 29px;
- line-height: 29px;
- text-align: center;
- background-color: rgba(224, 224, 224, 0.5);
- border: 1px solid transparent;
- top: -1px;
- margin-top: 1px;
- cursor: pointer;
-
- &:not(:last-of-type) {
- margin-right: 1px;
- }
-
- &.active,
- &:not(.active):hover,
- &:not(.active):focus {
- background-color: white;
- border: 1px solid #dfdfdf;
- border-bottom: 0;
- margin-top: 0px;
- top: 0px;
- @include border-shim(white);
- }
-
- i.fa.fa-bar-chart.fa-flip-vertical-rotate-90 {
- @include transform(rotate(90deg) scale(-0.8, 1.2));
- }
- }
-}
diff --git a/src/explorer/css/components/table.scss b/src/explorer/css/components/table.scss
deleted file mode 100644
index 74d1493..0000000
--- a/src/explorer/css/components/table.scss
+++ /dev/null
@@ -1,78 +0,0 @@
-@import '../../../css/utilities.scss';
-
-.public_fixedDataTable_header, .public_fixedDataTable_header .public_fixedDataTableCell_main {
- background-color: white;
- background-image: none;
-}
-
-.public_fixedDataTable_footer .public_fixedDataTableCell_main,
-.public_fixedDataTableRow_highlighted, .public_fixedDataTableRow_highlighted .public_fixedDataTableCell_main {
- background-color: white;
-}
-
-.public_fixedDataTable_footer .public_fixedDataTableCell_main,
-.public_fixedDataTableRow_fixedColumnsDivider,
-.public_fixedDataTableCell_main {
- border-color: #dfdfdf;
-}
-
-.public_fixedDataTable_header .public_fixedDataTableCell_main {
- font-weight: initial;
-}
-
-.public_fixedDataTableRow_main.public_fixedDataTable_hasBottomBorder [data-reactid$=fixed_cells] .public_fixedDataTableCell_main,
-.public_fixedDataTableRow_main .public_fixedDataTableCell_axis.public_fixedDataTableCell_main,
-.table-no-footer .public_fixedDataTableRow_main .public_fixedDataTableCell_main,
-.table-row-bottom-border .public_fixedDataTableRow_main .public_fixedDataTableCell_main
-{
- border-bottom-style: solid;
- border-bottom-width: 1px;
-}
-
-.public_fixedDataTable_header .fixedDataTableCellLayout_wrap3 {
- vertical-align: bottom;
-}
-
-.public_fixedDataTableCell_axis .fixedDataTableCellLayout_wrap3,
-.public_fixedDataTable_footer .fixedDataTableCellLayout_wrap3 {
- vertical-align: top;
-}
-
-.public_fixedDataTableCell_cellContent {
- padding: 0px 4px;
-}
-
-.public_fixedDataTable_main,
-.table-no-header .public_fixedDataTable_header,
-.public_fixedDataTable_hasBottomBorder,
-.public_fixedDataTableRow_fixedColumnsDivider {
- border: none;
-}
-
-.public_fixedDataTable_header .public_fixedDataTableCell_main,
-.public_fixedDataTable_header .public_fixedDataTableRow_fixedColumnsDivider,
-.public_fixedDataTable_footer .public_fixedDataTableRow_fixedColumnsDivider,
-.public_fixedDataTable_footer .fixedDataTableCellLayout_main.public_fixedDataTableCell_main {
- border-left: none;
- border-right: none;
- border-top: none;
-}
-
-.public_fixedDataTable_footer .public_fixedDataTableRow_fixedColumnsDivider,
-.public_fixedDataTable_footer .fixedDataTableCellLayout_main.public_fixedDataTableCell_main {
- border-bottom: none;
-}
-
-.public_fixedDataTable_header .public_fixedDataTableCell_main {
- text-align: left;
- @include overflow-ellipsis;
-}
-
-.public_fixedDataTable_header [data-reactid$=fixed_cells] .public_fixedDataTableCell_main {
- text-align: left;
-}
-
-.public_fixedDataTableCell_main:not(.public_fixedDataTableCell_axis) .table-row-label.public_fixedDataTableCell_cellContent {
- text-align: right;
- @include overflow-ellipsis;
-}
\ No newline at end of file
diff --git a/src/explorer/css/main.scss b/src/explorer/css/main.scss
deleted file mode 100644
index d8bd9cc..0000000
--- a/src/explorer/css/main.scss
+++ /dev/null
@@ -1,114 +0,0 @@
-@import '../../css/flexbox.scss';
-
-$link-blue: #649AF3;
-
-html,
-body {
- font-size: 16px;
- background-color: #F4F8FB;
-
- height: 100%;
- min-width: 1024px;
- margin: 0;
-
- @include flexbox;
- @include flex-flow(column);
-}
-
-label {
- font-weight: 400;
- font-size: 0.85rem;
-}
-
-.demo.explorer .demo-title {
- padding: 0.5rem;
- border-bottom: 1px solid #dfdfdf;
- background-color: white;
- overflow: auto;
- @include flex(0 0 auto);
-
- h1.post-title {
- font-weight: 400;
- font-size: 1.25rem;
- margin: 0;
- float: left;
- }
-
- a {
- float: right;
- font-size: 1rem;
- margin: 0;
- padding-left: 1rem;
- }
-}
-
-#demo {
- font-size: 14px;
- @include flexbox;
- @include flex(1 1 auto);
-}
-
-.pane-container {
- @include flex(1 0 auto);
- @include flexbox;
- @include flex-flow(row);
-}
-
-.container-flex-fill-wrap {
- position: relative;
- @include flex(1 1 auto);
-
- .container-flex-fill {
- position: absolute;
- top: 0; bottom: 0; left: 0; right: 0;
- @include flexbox;
-
- pre {
- overflow: auto;
- white-space: pre;
- word-wrap: normal;
- margin-right: 10px;
- }
- }
-}
-
-.pane-container .pane {
- background-color: white;
- border-width: 1px;
- border-style: solid;
- border-color: #dfdfdf;
- border-radius: 1px;
- margin: 10px 10px;
- margin-left: 0;
- @include flexbox;
- @include flex(1 1 auto);
- @include flex-just(space-between);
-
- &.data-pane {
- @include flex-flow(column);
- @include flex(0 1 253px);
- border-left: 0;
- }
-
- &.graphic-pane {
- background-color: transparent;
- border: none;
-
- @include flex(1 1 auto);
- @include flex-flow(column);
- }
-
- &.shelf-pane {
- @include flex(0 1 243px);
- @include flex-flow(column);
- background-color: transparent;
- border: none;
- position: relative;
- }
-}
-
-@import './components/field';
-@import './components/shelf';
-@import './components/datasource';
-@import './components/querybuilder';
-@import './components/graphic';
diff --git a/src/explorer/data/axis.js b/src/explorer/data/axis.js
deleted file mode 100644
index 39ed3df..0000000
--- a/src/explorer/data/axis.js
+++ /dev/null
@@ -1,82 +0,0 @@
-import dl from 'datalib'
-import _ from 'lodash'
-import { calculateNest, partitionNestKey } from './nest'
-import { QuantitativeAggregator } from './domain'
-import { getAccessorName } from '../helpers/field'
-
-class Axis {
- constructor(ordinals = [], field = null) {
- this.ordinals = ordinals
- this.key = _.map(ordinals, 'key')
- this.acceptsValues = _.isEmpty(this.key)
- this.field = field
- }
- cross(field) {
- return _.extend(new Axis(), this, {field})
- }
- hasQuantitativeField() {
- return null != this.field
- }
- hasField(field) {
- let name = getAccessorName(field)
- return _.contains(this.key, name) || this.fieldAccessor() == name
- }
- map(f) {
- let result = []
- for(let i=0, len=this.ordinals.length; i < len; i++) {
- result.push(f(this.ordinals[i].field, i))
- }
- if (null != this.field) result.push(f(this.field, 'Q'))
- return result
- }
- label() {
- return `${this.key.join(' ')}${this.field ? ` ${this.field.name}` : ''}`
- }
- fieldAccessor() {
- return this.field ? getAccessorName(this.field) : null
- }
- addDomainValue(value) {
- if (this.field && null == this.domain) {
- this.domain = new QuantitativeAggregator()
- }
- if (null != this.domain) {
- this.domain.add(value)
- }
- return this
- }
- getDomain() {
- if (null == this.domain) return {}
- return this.domain.result()
- }
-}
-
-function setAxisIndex(axis) {
- for(let i = 0, len = axis.length; i < len; i++) {
- axis[i].index = i
- }
-}
-
-// nest ordinal fields then cross with concat-quantitative fields to build the axis
-export function prepareAxes(queryspec, data) {
- let shelves = _(queryspec).mapValues(fields => _.groupBy(fields, 'algebraType')).value()
- let accessors = _(shelves).pick('row', 'col').map((shelf) => _.map(shelf.O, 'name')).flatten().map(dl.$).value()
- let nest = _.isEmpty(accessors) ? {} : calculateNest(data, (datum) => _.map(accessors, f => f(datum)))
- let rowLevels = shelves.row && shelves.row.O ? shelves.row.O : []
- let colLevels = shelves.col && shelves.col.O ? shelves.col.O : []
- let ordinalAxesKeys = _.mapValues(
- partitionNestKey(nest, rowLevels, colLevels),
- (axis, shelf) => {
- axis = _.sortByAll(axis, _.times('row' == shelf ? rowLevels.length : colLevels.length, i => `${i}.key`))
- return _.isEmpty(axis) ? [ new Axis() ] : _.map(axis, ordinals => new Axis(ordinals))
- })
-
- let axes = _.mapValues(ordinalAxesKeys, (axis, shelf) => {
- let qfields = shelves[shelf] && shelves[shelf].Q
- if (_.isEmpty(qfields)) return axis
- return _(axis).map(ordinalAxis => _.map(qfields, field => ordinalAxis.cross(field))).flatten().value()
- })
-
- setAxisIndex(axes.row)
- setAxisIndex(axes.col)
- return { axes, nest }
-}
diff --git a/src/explorer/data/domain.js b/src/explorer/data/domain.js
deleted file mode 100644
index 14cb066..0000000
--- a/src/explorer/data/domain.js
+++ /dev/null
@@ -1,111 +0,0 @@
-import _ from 'lodash'
-import { getFieldType, getAccessorName, isAggregateType, isBinField, isGroupByField } from '../helpers/field'
-
-export class QuantitativeAggregator {
- constructor() {
- this._result = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY}
- }
- add(value) {
- if(value < this._result.min) {
- this._result.min = value
- }
- if(value > this._result.max) {
- this._result.max = value
- }
- return this
- }
- result() {
- return this._result
- }
- flush() {
- return this
- }
-}
-
-export class OrdinalAggregator {
- constructor() {
- this._result = {}
- }
- add(value) {
- this._result[value] = true
- return this
- }
- result() {
- let result = []
- for (let i = 0, keys = Object.keys(this._result), len = keys.length; i < len; i++) {
- result.push(keys[i])
- }
- return result.sort()
- }
- flush() {
- return this
- }
-}
-
-function aggregateDatum(aggregator, datum, key, binWidth) {
- if (null != datum[key]) {
- aggregator.add(datum[key])
- if(binWidth) aggregator.add(binWidth(datum[key]))
- }
- else if (null != datum.values) {
- for(let i = 0, len = datum.values.length; i < len; i++) {
- aggregator.add(datum.values[i][key])
- if(binWidth) aggregator.add(binWidth(datum.values[i][key]))
- }
- }
- else {
- throw Error(`Domain construction: Not supposed to get here: Missing key ${key} and no values`)
- }
-}
-
-function aggregateAxes(domains, axes) {
- for (let i = 0, len = axes.length; i < len; i++) {
- let axis = axes[i]
- if (null == axis.domain) continue
- let domain = axis.getDomain()
- domains[axis.field.accessor].add(domain.min).add(domain.max)
- }
-}
-
-const AGGREGATOR = {
- 'Q' : QuantitativeAggregator,
- 'O' : OrdinalAggregator
-}
-
-function nextStep(step) {
- return (d) => d + step
-}
-
-function nextTime(timeUnit, step) {
- return (d) => d3.time[timeUnit].offset(d, step)
-}
-
-export function calculateDomains(data, fields, axes) {
- let domains = {}
- if (data == null) return domains
-
- let isBin = {}
- for (let i = 0, len = fields.length; i < len; i++) {
- let field = fields[i]
- if (domains[field.accessor]) continue
- domains[field.accessor] = new AGGREGATOR[field.algebraType]()
- isBin[field.accessor] = isBinField(field) ?
- ('time' == getFieldType(field) && !_.contains(field.func, 'bin')
- ? nextStep(1)
- : 'time' == getFieldType(field)
- ? nextTime(field.binSettings.unit.type, field.binSettings.step)
- : nextStep(field.binSettings.step)) : null
- }
-
- aggregateAxes(domains, axes.row)
- aggregateAxes(domains, axes.col)
- for (let i = 0, keys = Object.keys(domains), len = data.length, klen = keys.length; i < len; i++) {
- let datum = data[i]
- for (let k = 0; k < klen; k++) {
- let key = keys[k]
- aggregateDatum(domains[key], datum, key, isBin[key])
- }
- }
-
- return _.mapValues(domains, (agg) => agg.result())
-}
diff --git a/src/explorer/data/local.js b/src/explorer/data/local.js
deleted file mode 100644
index a92cb54..0000000
--- a/src/explorer/data/local.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import _ from 'lodash'
-import dl from 'datalib'
-import { getFieldQueryType, getFieldGroupByName, isGroupByField } from '../helpers/field'
-
-export function translateTableQuery(queryspec, data) {
- if (_.isEmpty(queryspec)) return null
- const {groupby, operator, aggregate, value} = _(queryspec).values().flatten().groupBy(getFieldQueryType).value()
-
- let summarize = translateSummary(operator, aggregate, value)
- return {
- groupby: _.map(groupby, _.curry(getFieldGroupByName)(data)),
- summarize,
- where: [],
- having: [],
- order: []
- }
-}
-
-export function translateSummary(operator, aggregate, value) {
- return _.merge(
- _(aggregate).groupBy('name').mapValues(fields => _.map(fields, 'func')).value(),
- operator ? { '*': _.map(operator, 'op') } : {},
- { '*': ['values'] },
- (a, b) => { if (_.isArray(a)) { return a.concat(b) } })
-}
-export function performQuery(query, data) {
- if (query == null) return null
- return dl.groupby(query.groupby).summarize(query.summarize).execute(data)
-}
-
-export function requestQuery(queryspec, datasource) {
- let query = translateTableQuery(queryspec, datasource)
- let result = performQuery(query, datasource)
- return { query, queryspec, result }
-}
diff --git a/src/explorer/data/nest.js b/src/explorer/data/nest.js
deleted file mode 100644
index 7739b83..0000000
--- a/src/explorer/data/nest.js
+++ /dev/null
@@ -1,75 +0,0 @@
-import _ from 'lodash'
-
-function setProperty(obj, key, value) {
- if (key.length == 0) return
- let i = 0
- let len = key.length - 1
- for(; i < len; i++) {
- if (null == obj[key[i]]) {
- obj[key[i]] = {}
- }
- obj = obj[key[i]]
- }
- obj[key[i]] = value
-}
-
-function pushProperty(obj, key, value) {
- if (key.length == 0) return
- let i = 0
- let len = key.length - 1
- for(; i < len; i++) {
- if (null == obj[key[i]]) {
- obj[key[i]] = {}
- }
- obj = obj[key[i]]
- }
- if(null == obj[key[i]]) obj[key[i]] = []
- obj[key[i]].push(value)
-}
-
-function nestHasSeen(seen, sofar) {
- for(let i = 0; i < sofar.length; i++) {
- if (!seen[sofar[i].key])
- return false
- seen = seen[sofar[i].key]
- }
- return seen
-}
-
-function traverseNestTree(nest, rowLevels, colLevels, level, rowSoFar, colSoFar, seen, result) {
- if (level == rowLevels.length + colLevels.length) {
- if (!nestHasSeen(seen.row, rowSoFar)) {
- setProperty(seen.row, _.map(rowSoFar, 'key'), true)
- result.row.push(rowSoFar)
- }
- if (!nestHasSeen(seen.col, colSoFar)) {
- setProperty(seen.col, _.map(colSoFar, 'key'), true)
- result.col.push(colSoFar)
- }
- }
- else {
- for (let i = 0, keys = Object.keys(nest), l = keys.length; i < l; i++) {
- let k = keys[i]
- traverseNestTree(
- nest[k], rowLevels, colLevels, level + 1,
- level < rowLevels.length ? rowSoFar.concat([{ key: k, field: rowLevels[level] }]) : rowSoFar,
- level >= rowLevels.length ? colSoFar.concat([{ key: k, field: colLevels[level - rowLevels.length] }]) : colSoFar,
- seen, result)
- }
- }
-}
-
-export function partitionNestKey(nest, rowLevels, colLevels) {
- let result = { row: [], col: [] }
- let seen = { row: {}, col: {} }
- traverseNestTree(nest, rowLevels, colLevels, 0, [], [], seen, result)
- return result
-}
-
-export function calculateNest(data, key, f = pushProperty) {
- let nest = {}
- for (let i = 0, len = data.length; i < len; i++) {
- f(nest, key(data[i]), i)
- }
- return nest
-}
diff --git a/src/explorer/data/pane.js b/src/explorer/data/pane.js
deleted file mode 100644
index 269d0c5..0000000
--- a/src/explorer/data/pane.js
+++ /dev/null
@@ -1,126 +0,0 @@
-import _ from 'lodash'
-import { getFieldQueryType, isStackableField, isBinField } from '../helpers/field'
-import { translateSummary } from './local'
-import Aggregator from 'datalib/src/aggregate/aggregator'
-import dl from 'datalib'
-
-function getPaneIndices(nest, rkey, ckey) {
- let node = nest
- for(let i = 0, len = rkey.length; i < len; i++) {
- node = node[rkey[i]]
- if (node == null) return null
- }
- for(let i = 0, len = ckey.length; i < len; i++) {
- node = node[ckey[i]]
- if (node == null) return null
- }
- return node
-}
-
-function flattenGroupedData(data) {
- let result = []
- for(let i = 0, len = data.length; i < len; i++) {
- let datum = data[i]
- let grouped = _.omit(datum, 'values')
- for (let j = 0, vlen = datum.values.length; j < vlen; j++) {
- result.push(_.extend({}, grouped, datum.values[j]))
- }
- }
- return result
-}
-
-class PaneData {
- constructor(row, col, data) {
- this.axis = { row, col }
- this.data = data
- this.markData = null
- }
- aggregate(tableType, visualFields, mustCondense) {
- let axisFields = _.filter([this.axis.row.field, this.axis.col.field])
- let fields = axisFields.concat(visualFields)
- let noHasRawValue = _.all(fields, field => 'value' != getFieldQueryType(field))
-
- let markData = this.data
-
- // condense data to pane summarized data
- if (mustCondense) {
- let { groupby, operator, aggregate, value } = _.groupBy(fields, getFieldQueryType)
- let condensedData = dl.groupby(_.map(groupby, 'accessor'))
- .summarize(translateSummary(operator, aggregate, value))
- .execute(flattenGroupedData(this.data))
- this.markData = noHasRawValue ? condensedData : flattenGroupedData(condensedData)
- }
- else {
- this.markData = noHasRawValue ? this.data : flattenGroupedData(this.data)
- }
- return this
- }
- addDomainToAxis(tableType, didCondense) {
- // calculate domain for pane data, taking note of bin and stacks
- let isStackable = 'bar' == tableType || 'area' == tableType
- let groupAxis = isBinField(this.axis.row.field) ? this.axis.row :
- isBinField(this.axis.col.field) ? this.axis.col : null
- let stackAxes = _.filter([
- isStackableField(this.axis.row.field) ? this.axis.row : null,
- isStackableField(this.axis.col.field) ? this.axis.col : null])
- let domainData = isStackable && stackAxes.length > 0 ?
- (groupAxis ? dl.groupby([groupAxis.field.accessor]) : dl.groupby()).summarize(
- _.map(stackAxes, axis => { return { name: axis.field.accessor, ops: ['sum'] } })
- ).execute(this.markData) : null
- if (domainData) {
- for (let i = 0, len = domainData.length; i < len; i++) {
- for (let s = 0, slen = stackAxes.length; s < slen; s++) {
- let stackAxis = stackAxes[s]
- stackAxis.addDomainValue(domainData[i][`sum_${stackAxis.field.accessor}`])
- }
- }
- }
- if (didCondense) {
- for (let i = 0, len = this.markData.length; i < len; i++) {
- for (let s = 0, slen = stackAxes.length; s < slen; s++) {
- let stackAxis = stackAxes[s]
- stackAxis.addDomainValue(this.markData[i][stackAxis.field.accessor])
- }
- }
- }
- return this
- }
- sort(sorts) {
- this.markData = _.sortByAll(this.markData, sorts)
- return this
- }
-}
-
-export function partitionPaneData(axes, nest, data) {
- let panes = {}
- for(let r = 0, rlen = axes.row.length, clen = axes.col.length; r < rlen; r++) {
- for(let c = 0; c < clen; c++) {
- let raxis = axes.row[r]
- let caxis = axes.col[c]
- if (raxis.acceptsValues && caxis.acceptsValues) {
- if (!panes[r]) panes[r] = {}
- panes[r][c] = new PaneData(raxis, caxis, data)
- }
- else {
- let paneDataIndices = getPaneIndices(nest, raxis.key, caxis.key)
- if (paneDataIndices != null) {
- if (!panes[r]) panes[r] = {}
- panes[r][c] = new PaneData(raxis, caxis, _.at(data, paneDataIndices))
- }
- }
- }
- }
- return panes
-}
-
-export function aggregatePanes(panes, tableType, spec, mustCondense) {
- for (let r = 0, rkeys = Object.keys(panes), rlen = rkeys.length; r < rlen; r++) {
- let rkey = rkeys[r]
- for (let c = 0, ckeys = Object.keys(panes[rkey]), clen = ckeys.length; c < clen; c++) {
- let ckey = ckeys[c]
- panes[rkey][ckey].aggregate(tableType, spec, mustCondense)
- .addDomainToAxis(tableType, mustCondense)
- .sort(_.map(spec, 'accessor'))
- }
- }
-}
diff --git a/src/explorer/data/scale.js b/src/explorer/data/scale.js
deleted file mode 100644
index d44e7dd..0000000
--- a/src/explorer/data/scale.js
+++ /dev/null
@@ -1,77 +0,0 @@
-import d3 from 'd3'
-import _ from 'lodash'
-import { getFieldType, getAccessorName, isAggregateType } from '../helpers/field'
-import { TABLE_ENCODINGS } from '../helpers/table'
-import { COLOR_PALETTES } from '../helpers/color'
-
-function getOrdinalVisualRange(shelf, spec) {
- switch (shelf) {
- case 'color':
- return COLOR_PALETTES[spec.palette]
- case 'shape':
- case 'size':
- case 'opacity':
- return spec.ordinalRange
- default:
- return []
- }
-}
-
-function getQuantitativeVisualRange(shelf, spec) {
- return [spec.scaleRangeMin, spec.scaleRangeMax]
-}
-
-function getQuantitativeScale(domain, zero) {
- let min = zero ? Math.min(0, domain.min) : domain.min
- let max = zero ? Math.max(0, domain.max) : domain.max
- let space = (max - min) / 25
- if (!zero) min = +min - space
- max = +max + space
- return {
- type: 'linear',
- domain: [min, max]
- }
-}
-
-function getVisualScale(algebraType, shelf, domain, spec) {
- let scaleType = 'O' == algebraType ? 'ordinal' : (spec.scale ? spec.scale : 'linear')
- let rangeFn = 'O' == algebraType ? getOrdinalVisualRange : getQuantitativeVisualRange
- let domainFn = 'O' == algebraType ? _.identity : (x => [x.min, x.max])
- return {
- type: scaleType,
- domain: domainFn(domain),
- range: rangeFn(shelf, spec)
- }
-}
-
-export function calculateScales(domains, queryspec, visualspec) {
- let validProperties = TABLE_ENCODINGS[visualspec.table.type].properties
-
- let scales = _(queryspec).pick(['row', 'col']).mapValues(
- (fields, shelf) => {
- return _.reduce(fields, (acc, field) => {
- if ('Q' == field.algebraType) {
- let name = getAccessorName(field)
- let zero = isAggregateType(field)
- acc[name] = getQuantitativeScale(domains[name], zero)
- if ('time' == getFieldType(field) && _.contains(field.func, 'bin')) acc[name].type = 'time'
- }
- return acc
- }, {})
- }).value()
-
- _.extend(scales, _(queryspec).pick(validProperties).mapValues(
- (fields, shelf) => {
- return _.reduce(fields, (acc, field) => {
- let name = getAccessorName(field)
- acc[name] = getVisualScale(field.algebraType, shelf, domains[name], visualspec.properties[shelf])
- return acc
- }, {})
- }).value())
-
- return _.extend(
- {},
- _.mapValues(_.pick(visualspec.properties, validProperties), (v) => {
- return { '__default__' : v }
- }), scales)
-}
diff --git a/src/explorer/ducks/chartspec.js b/src/explorer/ducks/chartspec.js
deleted file mode 100644
index 278546c..0000000
--- a/src/explorer/ducks/chartspec.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import _ from 'lodash'
-import u from 'updeep'
-import { prepareAxes } from '../data/axis'
-import { partitionPaneData, aggregatePanes } from '../data/pane'
-import { calculateDomains } from '../data/domain'
-import { calculateScales } from '../data/scale'
-
-export const UPDATE_CHART_DATA = 'explorer/chartspec/UPDATE_CHART_DATA'
-
-export function updateChartData(key, visualspec, queryResponse) {
- return {
- type: UPDATE_CHART_DATA,
- key,
- queryResponse,
- visualspec
- }
-}
-
-const chartState = {
-}
-
-export default function reducer(state = chartState, action) {
- switch(action.type) {
- case UPDATE_CHART_DATA:
- const { visualspec } = action
- const tableType = visualspec.table.type
- if (_.get([action.key, tableType], state)) return state
-
- const { query, queryspec, result } = action.queryResponse
- const { axes, nest } = query ? prepareAxes(queryspec, result) : {}
- const panes = query ? partitionPaneData(axes, nest, result) : {}
- aggregatePanes(
- panes, tableType,
- _(queryspec).omit('row', 'col').omit(_.isEmpty).values().flatten().value(),
- _(queryspec).pick('row', 'col').omit(_.isEmpty).mapValues(
- fields => _(fields).where({algebraType: 'Q'}).size()
- ).values().flatten().max() > 1)
- const domains = calculateDomains(result, _(queryspec).values().flatten().value(), axes)
-
- return u.updateIn(
- [action.key, tableType],
- {
- axes,
- panes,
- domains,
- scales: calculateScales(domains, queryspec, visualspec)
- },
- state)
- default:
- return state
- }
-}
diff --git a/src/explorer/ducks/datasources.js b/src/explorer/ducks/datasources.js
deleted file mode 100644
index f751296..0000000
--- a/src/explorer/ducks/datasources.js
+++ /dev/null
@@ -1,115 +0,0 @@
-import _ from 'lodash'
-import u from 'updeep'
-import fetch from 'isomorphic-fetch'
-import dl from 'datalib'
-
-export function getDatasource(sources, tableId) {
- if (tableId == null) return null
- return sources[tableId.id] || sources[tableId.datasource_id]
-}
-
-export function getTable(sources, tableId) {
- const datasource = getDatasource(sources, tableId)
- if (datasource == null) return null
- if (datasource.tables != null) {
- return _.find(datasource.tables, (datasource_table) => datasource_table.name === tableId.name)
- } else {
- return datasource
- }
-}
-
-export function getField(sources, tableId, fieldId) {
- if (fieldId == null) return null
- const table = getTable(sources, tableId)
- if (table == null) return null
- return table.schema[fieldId]
-}
-
-/* ACTION TYPES */
-
-export const REQUEST_TABLE_DATA = 'explorer/datasources/REQUEST_TABLE_DATA'
-export const RECEIVE_TABLE_DATA = 'explorer/datasources/RECEIVE_TABLE_DATA'
-export const SELECT_TABLE = 'explorer/datasources/SELECT_TABLE'
-
-/* ACTIONS */
-
-export function selectTable(tableId) {
- return {
- type: SELECT_TABLE,
- tableId
- }
-}
-
-export function requestTableData(tableId) {
- return {
- type: REQUEST_TABLE_DATA,
- tableId
- }
-}
-
-export function receiveTableData(tableId, data) {
- return {
- type: RECEIVE_TABLE_DATA,
- tableId,
- data
- }
-}
-
-export function connectTable(tableId) {
- return (dispatch, getState) => {
- const table = getTable(getState().datasources.BY_ID, tableId)
- dispatch(requestTableData(tableId))
-
- return fetch(table.url).then(
- response => {
- switch(table.settings.format) {
- case 'csv':
- return response.text()
- default:
- return response.json()
- }
- }
- ).then(
- data => {
- data = dl.read(data, {type: table.settings.format, parse: 'auto'})
- dispatch(receiveTableData(tableId, data))
- }
- )
- }
-}
-
-export function connectTableIfNecessary(tableId) {
- return (dispatch, getState) => {
- const table = getTable(getState().datasources.BY_ID, tableId)
- if (table.url != null && !table.isLoading && table.schema == null) {
- return dispatch(connectTable(tableId))
- }
- }
-}
-
-/* REDUCER */
-
-const initialState = {
- IDS: [],
- BY_ID: {}
-}
-
-export default function reducer(state = initialState, action) {
- let datasource, schema
-
- switch (action.type) {
- case REQUEST_TABLE_DATA:
- datasource = getTable(state.BY_ID, action.tableId)
- return u({BY_ID: { [datasource.id]: {isLoading: true}}}, state)
- case RECEIVE_TABLE_DATA:
- datasource = getTable(state.BY_ID, action.tableId)
- schema = _(action.data.__types__)
- .map((v, k) => { return {name: k, type: v} })
- .each((field, i) => field.__id__ = i).value()
- return u({BY_ID: {[datasource.id]: {isLoading: false, data: () => action.data, schema: () => schema}}}, state)
- case SELECT_TABLE:
- return u({selectedTable: () => action.tableId}, state)
- default:
- return state
- }
-}
diff --git a/src/explorer/ducks/queryspec.js b/src/explorer/ducks/queryspec.js
deleted file mode 100644
index 4e2d681..0000000
--- a/src/explorer/ducks/queryspec.js
+++ /dev/null
@@ -1,186 +0,0 @@
-import _ from 'lodash'
-import u from 'updeep'
-import { getAlgebraType, getAccessorName } from '../helpers/field'
-import { TABLE_ENCODINGS } from '../helpers/table'
-
-function getValidShelves(tableType) {
- return ['row', 'col'].concat(TABLE_ENCODINGS[tableType].properties || [])
-}
-
-export function getFullQueryspec(getField, queryspec, tableType) {
- return _(queryspec)
- .mapValues((fields) => {
- return _.map(fields,
- (field) => {
- return _({}).merge(
- field,
- field.fieldId != null ? getField(field.fieldId) : null
- ).tap(o => _.merge(o, {
- algebraType: getAlgebraType(o),
- accessor: getAccessorName(o)
- })).value()
- })
- }).pick(getValidShelves(tableType)).omit(_.isEmpty).value()
-}
-
-/* ACTION TYPES */
-export const INSERT_FIELD_AT_POSITION = 'explorer/queryspec/INSERT_FIELD_AT_POSITION'
-export const REPLACE_FIELD_ON_SHELF = 'explorer/queryspec/REPLACE_FIELD_ON_SHELF'
-export const MOVE_FIELD_TO = 'explorer/queryspec/MOVE_FIELD_TO'
-export const MOVE_AND_REPLACE_FIELD = 'explorer/queryspec/MOVE_AND_REPLACE_FIELD'
-export const ADD_FIELD = 'explorer/queryspec/ADD_FIELD'
-export const REMOVE_FIELD = 'explorer/queryspec/REMOVE_FIELD'
-export const CLEAR_FIELDS = 'explorer/queryspec/CLEAR_FIELDS'
-export const CLEAR_QUERY = 'explorer/queryspec/CLEAR_QUERY'
-export const UPDATE_FIELD_FUNCTION = 'explorer/queryspec/UPDATE_FIELD_FUNCTION'
-export const UPDATE_FIELD_TYPECAST = 'explorer/queryspec/UPDATE_FIELD_TYPECAST'
-
-/* ACTIONS */
-export function insertFieldAtPosition(shelf, position, field) {
- return {
- type: INSERT_FIELD_AT_POSITION,
- shelf,
- position,
- field
- }
-}
-
-export function replaceFieldOnShelf(shelf, field) {
- return {
- type: REPLACE_FIELD_ON_SHELF,
- shelf,
- field
- }
-}
-
-export function moveFieldTo(shelf, position, newshelf, newposition) {
- return {
- type: MOVE_FIELD_TO,
- shelf,
- position,
- newshelf,
- newposition
- }
-}
-
-export function moveAndReplaceField(shelf, position, newshelf) {
- return {
- type: MOVE_AND_REPLACE_FIELD,
- shelf,
- position,
- newshelf
- }
-}
-
-export function updateFieldPosition(shelf, position, newposition) {
- return {
- type: MOVE_FIELD_TO,
- shelf,
- position,
- newshelf: shelf,
- newposition
- }
-}
-
-export function addField(shelf, field) {
- return {
- type: ADD_FIELD,
- shelf,
- field
- }
-}
-
-export function removeField(shelf, position) {
- return {
- type: REMOVE_FIELD,
- shelf,
- position
- }
-}
-
-export function clearFields(shelf) {
- return {
- type: CLEAR_FIELDS,
- shelf
- }
-}
-
-export function clearQuery() {
- return {
- type: CLEAR_QUERY
- }
-}
-
-export function updateFieldTypecast(shelf, position, typecast) {
- return {
- type: UPDATE_FIELD_TYPECAST,
- shelf,
- position,
- typecast
- }
-}
-
-export function updateFieldFunction(shelf, position, func) {
- return {
- type: UPDATE_FIELD_FUNCTION,
- shelf,
- position,
- func
- }
-}
-
-/* REDUCER */
-const initialState = {
- filter: [],
- /* shelves */
- row: [],
- col: [],
- size: [],
- x: [], y: [], x2: [], y2: [],
- color: [],
- shape: [],
- background: [],
- opacity: [],
- orientation: [],
- schema: [],
- text: []
-}
-
-export default function reducer(state = initialState, action) {
- switch (action.type) {
- case INSERT_FIELD_AT_POSITION:
- return u({[action.shelf]: [...state[action.shelf].slice(0, action.position), action.field, ...state[action.shelf].slice(action.position)]}, state)
- case REPLACE_FIELD_ON_SHELF:
- return u({[action.shelf]: [action.field]}, state)
- case MOVE_FIELD_TO:
- return reducer(reducer(state, removeField(action.shelf, action.position)),
- insertFieldAtPosition(action.newshelf, action.newposition, state[action.shelf][action.position]))
- case MOVE_AND_REPLACE_FIELD:
- return reducer(reducer(state, removeField(action.shelf, action.position)),
- replaceFieldOnShelf(action.newshelf, state[action.shelf][action.position]))
- case ADD_FIELD:
- return u({[action.shelf]: (current) => current.concat([action.field])}, state)
- case REMOVE_FIELD:
- return u({
- [action.shelf]: u.reject((value, i) => i === action.position)
- }, state)
- case CLEAR_FIELDS:
- return u({[action.shelf]: () => []}, state)
- case CLEAR_QUERY:
- return initialState
- case UPDATE_FIELD_TYPECAST:
- return u(
- {[action.shelf]: {[action.position]: u.omit('func')}},
- u.updateIn(
- [action.shelf],
- { [action.position]: action.typecast != null ? {typecast: action.typecast} : u.omit('typecast') },
- state))
- case UPDATE_FIELD_FUNCTION:
- return u.updateIn(
- [action.shelf],
- {[action.position]: action.func != null ? { func: action.func } : u.omit('func')},
- state)
- default:
- return state
- }
-}
diff --git a/src/explorer/ducks/result.js b/src/explorer/ducks/result.js
deleted file mode 100644
index facfbc2..0000000
--- a/src/explorer/ducks/result.js
+++ /dev/null
@@ -1,119 +0,0 @@
-import u from 'updeep'
-import _ from 'lodash'
-import { combineReducers } from 'redux'
-import { getField, getTable, getDatasource } from './datasources'
-import { getFullQueryspec } from './queryspec'
-import { updateChartData } from './chartspec'
-import * as local from '../data/local'
-
-export const CHANGE_REQUEST_DATA = 'explorer/result/CHANGE_REQUEST_DATA'
-export const REQUEST_RESULT_DATA = 'explorer/result/REQUEST_RESULT_DATA'
-export const RECEIVE_RESULT_DATA = 'explorer/result/RECEIVE_RESULT_DATA'
-
-function makeQueryKey(query) {
- return JSON.stringify(query)
-}
-
-export function changeRequestData(key, tableType) {
- return {
- type: CHANGE_REQUEST_DATA,
- key,
- tableType
- }
-}
-
-export function requestResultData(key) {
- return {
- type: REQUEST_RESULT_DATA,
- key
- }
-}
-
-export function receiveResultData(key, response, error=false) {
- return _.extend({
- type: RECEIVE_RESULT_DATA,
- key,
- error
- }, response)
-}
-
-export function fetchQueryData(datasources, queryspec) {
- return new Promise((resolve, reject) => {
- let datasource = getDatasource(datasources.BY_ID, datasources.selectedTable)
- if (datasource.data) {
- setTimeout(() => resolve(local.requestQuery(queryspec, datasource.data)), 0)
- }
- else {
- reject(Error(`Querying adapter not defined for protocol: ${datasource.protocol}`))
- }
- })
-}
-
-export function runQuery(datasources, key, queryspec, visualspec) {
- return (dispatch, getState) => {
- dispatch(requestResultData(key))
- return fetchQueryData(datasources, queryspec).then(
- response => {
- dispatch(updateChartData(key, visualspec, response))
- dispatch(receiveResultData(key, response))
- }).catch(error => {
- console.error('Error: query error', error)
- dispatch(receiveResultData(key, null, true))
- })}
-}
-
-export function runCurrentQueryIfNecessary() {
- return (dispatch, getState) => {
- let { datasources, queryspec, visualspec, result } = getState()
- let getTableField = _.curry(getField)(datasources.BY_ID, datasources.selectedTable)
- let usableQueryspec = getFullQueryspec(getTableField, queryspec, visualspec.table.type)
- let key = makeQueryKey(usableQueryspec)
- let queryResponse = result.cache[key]
- if (queryResponse == null || (!queryResponse.isLoading && !queryResponse.error && queryResponse.result == null)) {
- dispatch(runQuery(datasources, key, usableQueryspec, visualspec))
- }
- else if (queryResponse && !queryResponse.isLoading && queryResponse.result) {
- dispatch(updateChartData(key, visualspec, queryResponse))
- }
- dispatch(changeRequestData(key, visualspec.table.type))
- }
-}
-
-const cacheState = {
-}
-
-function cache(state = cacheState, action) {
- switch(action.type) {
- case REQUEST_RESULT_DATA:
- return _.extend({}, state, { [action.key] : { isLoading: true } })
- case RECEIVE_RESULT_DATA:
- return _.extend({}, state, {
- [action.key]: {
- isLoading: false,
- error: action.error,
- key: action.key,
- queryspec: action.queryspec,
- query: action.query,
- result: action.result
- }})
- default:
- return state
- }
-}
-
-const initialState = {
- last: null,
- current: null
-}
-
-function render(state=initialState, action) {
- switch(action.type) {
- case CHANGE_REQUEST_DATA:
- return { last: state.current, current: [action.key, action.tableType] }
- default:
- return state
- }
-}
-
-const reducer = combineReducers({render, cache})
-export default reducer
diff --git a/src/explorer/ducks/visualspec.js b/src/explorer/ducks/visualspec.js
deleted file mode 100644
index 6c3c47b..0000000
--- a/src/explorer/ducks/visualspec.js
+++ /dev/null
@@ -1,95 +0,0 @@
-import _ from 'lodash'
-import u from 'updeep'
-import { combineReducers } from 'redux'
-
-/* ACTION TYPES */
-export const SET_TABLE_ENCODING = 'explorer/visualspec/SET_TABLE_ENCODING'
-export const SET_PROPERTY_SETTING = 'explorer/visualspec/SET_PROPERTY_SETTING'
-
-/* ACTIONS */
-export function setTableEncoding(encoding) {
- return {
- type: SET_TABLE_ENCODING,
- encoding
- }
-}
-
-export function setPropertySetting(property, setting, value) {
- return {
- type: SET_PROPERTY_SETTING,
- property,
- setting,
- value
- }
-}
-
-/* REDUCER */
-const tableState = {
- type: 'bar'
-}
-
-function table(state = tableState, action) {
- switch(action.type) {
- case SET_TABLE_ENCODING:
- return u({type: action.encoding}, state)
- default:
- return state
- }
-}
-
-const propertiesState = {
- size: {
- ordinalRange: [30, 50, 80, 120, 170, 230, 300],
- 'default': 30,
- scaleRangeMin: 25,
- scaleRangeMax: 625
- },
- shape: {
- ordinalRange: ["circle", "cross", "diamond", "square", "triangle-down", "triangle-up"],
- 'default': 'circle'
- },
- color: {
- palette: "category10",
- 'default': "#356CA7",
- scale: "linear",
- scaleZero: true,
- scaleManualDomain: false,
- scaleManualRange: false,
- scaleRangeMin: "#d6ead1",
- scaleRangeMax: "#0c541f"
- },
- background: {
- palette: "category10",
- 'default': "#356CA7",
- scale: "linear",
- scaleZero: true,
- scaleManualDomain: false,
- scaleManualRange: false,
- scaleRangeMin: "#d6ead1",
- scaleRangeMax: "#0c541f"
- },
- opacity: {
- 'default': 1,
- ordinalRange: [0.2, 0.4, 0.6, 0.8, 1],
- scaleRangeMin: 0.1,
- scaleRangeMax: 1
- },
- orientation: {},
- x: {},
- x2: {},
- y: {},
- y2: {},
- text: {}
-}
-
-function properties(state = propertiesState, action) {
- switch(action.type) {
- case SET_PROPERTY_SETTING:
- return u({[action.property]: { [action.setting]: action.value }}, state)
- default:
- return state
- }
-}
-
-const reducer = combineReducers({ table, properties })
-export default reducer
diff --git a/src/explorer/helpers/color.js b/src/explorer/helpers/color.js
deleted file mode 100644
index a212bc8..0000000
--- a/src/explorer/helpers/color.js
+++ /dev/null
@@ -1,34 +0,0 @@
-const COLOR_PALETTES = {
- 'category10': [
- '#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'
- ],
- 'category20': [
- '#1f77b4', '#aec7e8', '#ff7f0e', '#ffbb78', '#2ca02c', '#98df8a', '#d62728', '#ff9896', '#9467bd', '#c5b0d5',
- '#8c564b', '#c49c94', '#e377c2', '#f7b6d2', '#7f7f7f', '#c7c7c7', '#bcbd22', '#dbdb8d', '#17becf', '#9edae5'
- ],
- 'category20b': [
- '#393b79', '#5254a3', '#6b6ecf', '#9c9ede', '#637939', '#8ca252', '#b5cf6b', '#cedb9c', '#8c6d31', '#bd9e39',
- '#e7ba52', '#e7cb94', '#843c39', '#ad494a', '#d6616b', '#e7969c', '#7b4173', '#a55194', '#ce6dbd', '#de9ed6'
- ],
- 'category20c': [
- '#3182bd', '#6baed6', '#9ecae1', '#c6dbef', '#e6550d', '#fd8d3c', '#fdae6b', '#fdd0a2', '#31a354', '#74c476',
- '#a1d99b', '#c7e9c0', '#756bb1', '#9e9ac8', '#bcbddc', '#dadaeb', '#636363', '#969696', '#bdbdbd', '#d9d9d9'
- ],
- 'pastel1': [
- "#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6", "#ffffcc", "#e5d8bd", "#fddaec", "#f2f2f2"
- ],
- 'pastel2': [
- "#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4", "#e6f5c9", "#fff2ae", "#f1e2cc", "#cccccc"
- ],
- 'set1': [
- "#377eb8", "#4daf4a", "#984ea3", "#ff7f0", "#ffff33", "#a65628", "#f781bf", "#999999"
- ],
- 'set2': [
- "#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854", "#ffd92f", "#e5c494", "#b3b3b3"
- ],
- 'set3': [
- "#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#d9d9d9", "#bc80bd", "#ccebc5", "#ffed6f"
- ]
-}
-
-export { COLOR_PALETTES }
diff --git a/src/explorer/helpers/field.js b/src/explorer/helpers/field.js
deleted file mode 100644
index bd4b4aa..0000000
--- a/src/explorer/helpers/field.js
+++ /dev/null
@@ -1,171 +0,0 @@
-import _ from 'lodash'
-import dl from 'datalib'
-
-export const AGGREGATES = [
- { id: "agg_count", name: "COUNT" , type: "aggregate" , op: "count" }
-]
-
-export function getAccessorName(field) {
- return field.func ? `${_.contains(field.func, 'bin') ? 'bin' : field.func}_${field.name}` : field.op ? field.op : field.name
-}
-
-export function getFieldType(field) {
- let type = field.typecast != null ? field.typecast : field.type
- return getExternalType(type)
-}
-
-export function getAlgebraType(field) {
- switch(getFieldType(field)) {
- case 'text':
- return 'O'
- default:
- return 'Q'
- }
-}
-
-export function getFieldQueryType(field) {
- if ('text' == getFieldType(field)
- || _.contains(field.func, "bin")
- || _.contains(['year', 'month', 'day', 'date', 'hour', 'minute', 'second'], field.func)) {
- return 'groupby'
- }
- else if ('aggregate' == field.type) {
- return 'operator'
- }
- else if (field.func && _.contains(['count', 'sum', 'min', 'max', 'mean', 'median'], field.func.toLowerCase())) {
- return 'aggregate'
- }
- else {
- return 'value'
- }
-}
-
-export function isAggregateType(field) {
- return _.contains(['operator', 'aggregate'], getFieldQueryType(field))
-}
-
-export function isGroupByField(field) {
- return 'groupby' == getFieldQueryType(field)
-}
-
-export function isStackableField(field) {
- return field && ('aggregate' == field.type || field.func && _.contains(['sum', 'count'], field.func.toLowerCase()))
-}
-
-export function isBinField(field) {
- return field && field.func && (_.contains(field.func, "bin") || _.contains(['year', 'month', 'day', 'date', 'hour', 'minute', 'second'], field.func))
-}
-
-export function getExternalType(type) {
- switch(type) {
- case 'date':
- case 'timestamp':
- return 'time'
- case 'string':
- return 'text'
- case 'integer':
- return 'number'
- default:
- return type
- }
-}
-
-export function getFieldFunctionSelectDisplayName(func) {
- switch(func) {
- case "bin[ms]": return "Millisecond"
- case "bin[s]": return "Second"
- case "bin[m]": return "Minute"
- case "bin[h]": return "Hour"
- case "bin[d]": return "Day"
- case "bin[w]": return "Week"
- case "bin[M]": return "Month"
- case "bin[Q]": return "Quarter"
- case "bin[6M]": return "6 Month"
- case "bin[Y]": return "Year"
- case "bin[5Y]": return "5 Year"
- case "bin[10Y]": return "10 Year"
- case 'text': case 'time': case 'number':
- return _.capitalize(func)
- default:
- return func && func.toUpperCase()
- }
-}
-
-export function getFieldFunctionDisplayName(func) {
- switch(func) {
- case "bin[ms]": return "by Millisecond"
- case "bin[s]": return "by Second"
- case "bin[m]": return "by Minute"
- case "bin[h]": return "by Hour"
- case "bin[d]": return "by Day"
- case "bin[w]": return "by Week"
- case "bin[M]": return "by Month"
- case "bin[Q]": return "by Quarter"
- case "bin[6M]": return "by 6 Month"
- case "bin[Y]": return "by Year"
- case "bin[5Y]": return "by 5 Year"
- case "bin[10Y]": return "by 10 Year"
- default:
- return getFieldFunctionSelectDisplayName(func)
- }
-}
-
-export function getBinStepUnit(func) {
- switch(func) {
- case "bin[ms]": case "bin[s]": return "second"
- case "bin[m]": return "minute"
- case "bin[h]": return "hour"
- case "bin[d]": case "bin[w]": return "day"
- case "bin[M]": case "bin[Q]": case "bin[6M]": return "month"
- default:
- return 'year'
- }
-}
-
-export function getBinStep(func) {
- switch(func) {
- case "bin[ms]": case "bin[s]": case "bin[m]": case "bin[h]": case "bin[d]":
- return 1
- case "bin[w]": return 7
- case "bin[M]": return 1
- case "bin[Q]": return 3
- case "bin[6M]": return 6
- case "bin[Y]": return 1
- case "bin[5Y]": return 5
- case "bin[10Y]": return 10
- default:
- return 1
- }
-}
-
-export function getFieldGroupByName(data, field) {
- if (_.contains(field.func, 'bin')) {
- if ('time' == getFieldType(field)) {
- let b = dl.bins.date({
- type: 'date',
- maxbins: 50,
- unit: getBinStepUnit(field.func)
- })
- b.step = getBinStep(field.func)
- let func = dl.$func('bin', x => b.value(b.unit.unit(x)))(dl.$(field.name))
- field.binner = func
- field.binSettings = b
- return func
- }
- else {
- let accessor = dl.$(field.name)
- let [min, max] = dl.extent(data, accessor)
- let b = dl.bins({maxbins: 50, min, max, minstep: 'integer' == field.type ? 1 : 0})
- let func = dl.$func('bin', x => b.value(x))(accessor)
- field.binSettings = b
- field.binner = func
- return func
- }
- }
- else if (_.contains(['year', 'month', 'day', 'date', 'hour', 'minute', 'second'], field.func)) {
- return dl[`$${field.func}`](field.name)
- }
- else {
- return field.name
- }
-}
diff --git a/src/explorer/helpers/table.js b/src/explorer/helpers/table.js
deleted file mode 100644
index aedb755..0000000
--- a/src/explorer/helpers/table.js
+++ /dev/null
@@ -1,73 +0,0 @@
-export const TABLE_ENCODINGS = {
- bar: {
- name: "Bar",
- icon: [{
- className: "fa fa-bar-chart"}],
- properties: ['color', 'opacity'] },
- point: {
- name: "Symbol",
- icon: [{
- className: "material-icons",
- style: {
- position: 'relative',
- top: 4,
- fontSize: 22}},
- "grain"],
- properties: ['size',
- 'color',
- 'opacity',
- 'shape'] },
- line: {
- name: "Line",
- icon: [{
- className: "fa fa-line-chart"}],
- properties: ['color'] },
- area: {
- name: "Area",
- icon: [{
- className: "fa fa-area-chart"}],
- properties: ['color'] },
- rect: {
- name: "Gantt Bar",
- icon: [{
- className: "material-icons",
- style: {
- position: 'relative',
- top: 4,
- fontSize: 22}},
- "clear_all"],
- properties: ['x',
- 'x2',
- 'y',
- 'y2',
- 'size',
- 'color'] },
- box: {
- name: "Box Plot",
- icon: [{
- className: "material-icons",
- style: {
- position: 'relative',
- top: 4,
- fontSize: 18}},
- "tune"],
- properties: ['color'] },
- pie: {
- name: "Pie",
- icon: [{
- className: "fa fa-pie-chart"}],
- properties: ['color'] },
- donut: {
- name: "Donut",
- icon: [
- {
- className: "material-icons",
- style: {
- position: 'relative',
- top: 4,
- fontSize: 18
- }},
- "data_usage"],
- properties: ['color']
- }
-}
diff --git a/src/explorer/images/color/category10.svg b/src/explorer/images/color/category10.svg
deleted file mode 100644
index 9cf4adf..0000000
--- a/src/explorer/images/color/category10.svg
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/explorer/images/color/category20.svg b/src/explorer/images/color/category20.svg
deleted file mode 100644
index 9d125ee..0000000
--- a/src/explorer/images/color/category20.svg
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/explorer/images/color/category20b.svg b/src/explorer/images/color/category20b.svg
deleted file mode 100644
index f1c31cc..0000000
--- a/src/explorer/images/color/category20b.svg
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/explorer/images/color/category20c.svg b/src/explorer/images/color/category20c.svg
deleted file mode 100644
index 03ee7c1..0000000
--- a/src/explorer/images/color/category20c.svg
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/explorer/images/color/pastel1.svg b/src/explorer/images/color/pastel1.svg
deleted file mode 100644
index c32d51b..0000000
--- a/src/explorer/images/color/pastel1.svg
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/explorer/images/color/pastel2.svg b/src/explorer/images/color/pastel2.svg
deleted file mode 100644
index a484cb7..0000000
--- a/src/explorer/images/color/pastel2.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/explorer/images/color/set1.svg b/src/explorer/images/color/set1.svg
deleted file mode 100644
index d776c4d..0000000
--- a/src/explorer/images/color/set1.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/explorer/images/color/set2.svg b/src/explorer/images/color/set2.svg
deleted file mode 100644
index fc57fce..0000000
--- a/src/explorer/images/color/set2.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/explorer/images/color/set3.svg b/src/explorer/images/color/set3.svg
deleted file mode 100644
index 17643cf..0000000
--- a/src/explorer/images/color/set3.svg
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/explorer/index.js b/src/explorer/index.js
deleted file mode 100644
index 4288078..0000000
--- a/src/explorer/index.js
+++ /dev/null
@@ -1,96 +0,0 @@
-import className from 'classnames'
-import _ from 'lodash'
-import React from 'react'
-import { bindActionCreators } from 'redux'
-import { connect } from 'react-redux'
-import HTML5Backend from 'react-dnd-html5-backend'
-import { DropTarget, DragDropContext } from 'react-dnd'
-const { div, i: icon } = React.DOM
-import { getField, selectTable, connectTableIfNecessary } from './ducks/datasources'
-import { getFullQueryspec, clearQuery, addField, removeField, clearFields, insertFieldAtPosition, replaceFieldOnShelf, moveFieldTo, moveAndReplaceField, updateFieldTypecast, updateFieldFunction } from './ducks/queryspec'
-import { setTableEncoding, setPropertySetting } from './ducks/visualspec'
-import { DataSourceSelect, TableSchema } from './components/DataSource'
-import { TableLayoutSpecBuilder, TableVisualSpecBuilder } from './components/TableSpecBuilder'
-import { TableContainer } from './components/TableContainer'
-import FieldDragLayer from './components/FieldDragLayer'
-
-class Explorer extends React.Component {
- render() {
- const { dispatch, result, queryspec, visualspec, sourceIds, sources, tableId, chartspec } = this.props
- const { connectDropTarget, isOver, isDragging } = this.props
- const fieldActionCreators = bindActionCreators({
- removeField, clearFields,
- insertFieldAtPosition, moveFieldTo,
- replaceFieldOnShelf, moveAndReplaceField,
- updateFieldTypecast, updateFieldFunction
- }, dispatch)
- const getSourceField = _.curry(getField)(sources)
- const getTableField = _.curry(getField)(sources, tableId)
- const vizActionCreators = bindActionCreators({ setTableEncoding, setPropertySetting }, dispatch)
- const currentData = result.cache[_.first(result.render.current)]
- const lastData = result.cache[_.first(result.render.last)]
- const isLoading = currentData && currentData.isLoading
- const graphicData = isLoading ? lastData : currentData
- const graphicChart = isLoading ? _.get(chartspec, result.render.last) : _.get(chartspec, result.render.current)
- return connectDropTarget(
- div({className: className("pane-container")},
- ,
- div({className: "pane data-pane"},
- {
- dispatch(clearQuery())
- dispatch(selectTable(tableId))
- dispatch(connectTableIfNecessary(tableId))
- }}/>,
- div({className: "datasource-table-container"},
- {
- dispatch(addField(queryspec.row.length < queryspec.col.length ? 'row' : 'col', field))
- }}/>)),
- div({className: "pane graphic-pane"},
- div({className: "querybuilder"},
- ),
- div({className: "container-flex-fill-wrap graphic-container"},
- div({className: "loading-overlay", style: {display: isLoading ? "" : "none"}},
- div({className: "loading-overlay-background"}),
- icon({className: "fa fa-spinner fa-pulse"})),
- )),
-
- ))
- }
-}
-
-function select(state) {
- return {
- sourceIds: state.datasources.IDS,
- sources: state.datasources.BY_ID,
- tableId: state.datasources.selectedTable,
- queryspec: state.queryspec,
- visualspec: state.visualspec,
- result: state.result,
- chartspec: state.chartspec
- }
-}
-
-export default (connect(select))(DragDropContext(HTML5Backend)(DropTarget(
- 'ShelfField',
- {
- canDrop: (props) => true,
- drop(props, monitor, component) {
- if (monitor.didDrop()) return
- return { ..._.pick(monitor.getItem(), 'shelf', 'position'),
- droppedOnBody: true,
- removeField: (shelf, position) => props.dispatch(removeField(shelf, position))
- }
- }
- },
- function (connect, monitor) {
- return {
- connectDropTarget: connect.dropTarget(),
- isOver: monitor.isOver({shallow: true}),
- isDragging: monitor.canDrop()
- }
- })(Explorer)))
diff --git a/src/explorer/middleware/index.js b/src/explorer/middleware/index.js
deleted file mode 100644
index e040f35..0000000
--- a/src/explorer/middleware/index.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import _ from 'lodash'
-import * as queryspec from '../ducks/queryspec'
-import * as visualspec from '../ducks/visualspec'
-import { getField } from '../ducks/datasources'
-import { runCurrentQueryIfNecessary } from '../ducks/result'
-
-const QUERYSPEC_ACTIONS = _.values(queryspec)
-
-const queryRunner = ({dispatch, getState}) => next => action => {
- console.group(action.type)
- let result = next(action)
- let isQueryChange = (
- _.contains(QUERYSPEC_ACTIONS, action.type)
- || visualspec.SET_TABLE_ENCODING == action.type
- || visualspec.SET_PROPERTY_SETTING == action.type
- )
- if (isQueryChange) {
- result = next(runCurrentQueryIfNecessary())
- }
- console.log('next state', getState())
- console.groupEnd(action.type)
- return result
-}
-
-export default queryRunner
diff --git a/src/explorer/reducers/index.js b/src/explorer/reducers/index.js
deleted file mode 100644
index 44817b8..0000000
--- a/src/explorer/reducers/index.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import { combineReducers } from 'redux'
-import datasources from '../ducks/datasources'
-import queryspec from '../ducks/queryspec'
-import visualspec from '../ducks/visualspec'
-import result from '../ducks/result'
-import chartspec from '../ducks/chartspec'
-
-const rootReducer = combineReducers({datasources, queryspec, visualspec, result, chartspec})
-export default rootReducer
diff --git a/src/explorer/stores/index.js b/src/explorer/stores/index.js
deleted file mode 100644
index 784f1ec..0000000
--- a/src/explorer/stores/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
-import { createStore, applyMiddleware } from 'redux'
-import thunkMiddleware from 'redux-thunk'
-import rootReducer from '../reducers'
-import queryRunner from '../middleware'
-
-const createWithMiddleware = applyMiddleware(queryRunner, thunkMiddleware)(createStore)
-
-export default function configureStore(initialState) {
- const store = createWithMiddleware(rootReducer, initialState)
-
- if (module.hot) {
- module.hot.accept('../reducers', () => {
- const nextReducer = require('../reducers')
- store.replaceReducer(nextReducer)
- })
- }
-
- return store
-}
diff --git a/src/nba-shot-chart-vega.js b/src/nba-shot-chart-vega.js
deleted file mode 100644
index 3429990..0000000
--- a/src/nba-shot-chart-vega.js
+++ /dev/null
@@ -1,75 +0,0 @@
-import React from 'react'
-import ReactDOM from 'react-dom'
-import d3 from 'd3'
-import vg from 'vega'
-import { ShotChartSpec } from './components/basketball'
-
-// harden 201935
-// curry 201939
-// kobe 977
-// lebron 2544
-// korver 2594
-// klay 202691
-// westbrook 201566
-// durant 201142
-// dirk 1717
-// rose 201565
-// anthony davis 203076
-
-// http://stats.nba.com/stats/playerdashptshotlog?DateFrom=&DateTo=&GameSegment=&LastNGames=0&LeagueID=00&Location=&Month=0&OpponentTeamID=0&Outcome=&Period=0&PlayerID=&Season=2014-15&SeasonSegment=&SeasonType=Regular+Season&TeamID=0&VsConference=&VsDivision=
-
-var ShotChartView
-var Cache = {}
-var shotChartUrls = [
- {"name": "James Harden (2014-2015)", "url": "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/5c74a5dcd7b257faa985f28c932a684ed4cea065/james-harden-shotchartdetail.json", "dash_url": "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/f6d6496474af6dfba0b73f36dbd0e00ce0fc2f42/james-harden-2014-2015-player-dash.json"},
- {"name": "Stephen Curry (2014-2015)", "url": "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/d159840109c00928f515bf0ed496f4f487b326ba/stephen-curry-shotchartdetail.json" },
- {"name": "Kobe Bryant (2007-2008)", "url": "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/0fbd65f9f795a5fba8c8ccefce060fd3082264fb/kobe-2007-2008-shot-chart.json" },
- {"name": "Kobe Bryant (2009-2010)", "url": "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/a19ec840d7d67c388fc3f2eea3d51c9b7cdcf4b0/kobe-2009-2010-shot-chart.json" },
- {"name": "Lebron James (2009-2010)", "url": "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/0fbd65f9f795a5fba8c8ccefce060fd3082264fb/lebron-james-2009-2010-shot-chart.json" },
- {"name": "Lebron James (2010-2011)", "url": "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/0fbd65f9f795a5fba8c8ccefce060fd3082264fb/lebron-james-2010-2011-shot-chart.json" },
- {"name": "Lebron James (2011-2012)", "url": "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/d53dbb96502622b9509880fb671cf50846130636/lebron-james-2011-2012-shot-chart.json" },
- {"name": "Lebron James (2012-2013)", "url": "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/d53dbb96502622b9509880fb671cf50846130636/lebron-james-2012-2013-shot-chart.json" },
- {"name": "Kevin Durant (2013-2014)", "url": "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/d53dbb96502622b9509880fb671cf50846130636/kevin-durant-2013-2014-shot-chart.json" }
-]
-
-vg.parse.spec(ShotChartSpec, function(chart) {
- ShotChartView = chart({el: "#shot-chart"})
- ShotChartView.onSignal('minchartX', (signal, value) => console.log(signal, value))
- ShotChartView.onSignal('maxchartX', (signal, value) => console.log(signal, value))
- renderShotChart({ target: { value: shotChartUrls[0].url }})
-})
-
-function setChartData(data) {
- ShotChartView.data('table').remove(() => true).insert(data)
- ShotChartView.update({duration: 300, ease: "quad-in-out"})
- console.log(ShotChartView.toImageURL('png'))
-}
-
-function renderShotChart(evt) {
- let url = evt.target.value
- if (Cache[url]) {
- setChartData(Cache[url])
- } else {
- d3.json(
- url,
- function(error, json) {
- if (error) return console.warn(error)
- let headers = json.resultSets[0].headers
- let data = json.resultSets[0].rowSet.map(function(d) {
- let row = headers.reduce(function(memo, header, i) {
- memo[header] = d[i]
- return memo
- }, {})
- row.shot_id = `${row.GAME_ID}_${row.GAME_EVENT_ID}`
- return row})
- Cache[url] = data
- setChartData(Cache[url])
- })
- }
-}
-
-ReactDOM.render(
- {shotChartUrls.map(function(player) {
- return {player.name}
- })}
- , document.getElementById("shot-chart-player-select"))
diff --git a/src/nba-shot-chart.js b/src/nba-shot-chart.js
deleted file mode 100644
index 35bd4b0..0000000
--- a/src/nba-shot-chart.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import React from 'react'
-import ReactDOM from 'react-dom'
-import d3 from 'd3'
-import classNames from 'classnames'
-import animateMark from './components/mark'
-import Axis from './components/axis'
-import {easingTypes} from 'react-tween-state'
-import {CourtBounds, BasketBall} from './components/basketball'
-
-function logData(d) {
- console.log('yes', d)
-}
-
-function renderShotChart(rows, header) {
- var element = document.getElementById("shot-chart")
- var margin = {top: 30, right: 179, bottom: 30, left: 179}
-
- var width = 600
- var height = 660
-
- var values = rows.map((row) => [row[17], row[18]])
- var xscale = d3.scale.linear().domain([250, -250]).range([0, width])
- var yscale = d3.scale.linear().domain([-47.5, 500]).range([height, 0])
-
- var xballr = Math.abs(xscale(3.85) - xscale(0))
- var yballr = Math.abs(yscale(0) - yscale(3.85))
-
- let TransitionBall = animateMark(BasketBall, [
- { prop: 'cx', duration: 1000, easing: easingTypes.linear, start: xscale(0)},
- { prop: 'cy', duration: 1000, easing: easingTypes.linear, start: yscale(0)}
- ])
-
- var points = rows.map(function (d, i) {
- var [x, y] = [d[17], d[18]]
- return
- })
-
- ReactDOM.render(
-
-
- {points}
-
-
- , element)
-}
-
-d3.json(
- "https://gist.githubusercontent.com/sandbox/7f6065c867a5f355207e/raw/5c74a5dcd7b257faa985f28c932a684ed4cea065/james-harden-shotchartdetail.json",
- function(error, json) {
- if (error) return console.warn(error)
- renderShotChart(json.resultSets[0].rowSet, json.resultSets[0].headers)
- })
diff --git a/src/react-histogram-transition.js b/src/react-histogram-transition.js
deleted file mode 100644
index c3d446d..0000000
--- a/src/react-histogram-transition.js
+++ /dev/null
@@ -1,47 +0,0 @@
-import React from 'react'
-import ReactDOM from 'react-dom'
-import d3 from 'd3'
-import animateMark from './components/mark'
-import Rect from './components/rect'
-import Axis from './components/axis'
-import {easingTypes} from 'react-tween-state'
-
-var element = document.getElementById("react-transition")
-var margin = {top: 10, right: 30, bottom: 30, left: 30}
-var width = element.offsetWidth - margin.left - margin.right
-var height = 550 - margin.top - margin.bottom
-var values = d3.range(1000).map(d3.random.bates(10))
-var formatCount = d3.format(",.0f")
-var xscale = d3.scale.linear().domain([0, 1]).range([0, width])
-var data = d3.layout.histogram().bins(xscale.ticks(20))(values)
-var yscale = d3.scale.linear().domain([0, d3.max(data, (d) => d.y)]).range([height, 0])
-
-let TransitionRect = animateMark(Rect, [
- {prop: 'width', duration: 300, easing: easingTypes.easeInOutQuad},
- {prop: 'height', duration: 600, easing: easingTypes.linear}
-])
-
-class RectGroup extends React.Component {
- render() {
- return
- }
-}
-let TransitionGroup = animateMark(RectGroup, [
- { prop: 'y', duration: 900, easing: easingTypes.linear, start: height }
-])
-
-var bars = data.map(
- (d, i) =>
-
-
- {formatCount(d.y)}
- )
-
-ReactDOM.render(
-
-
- {bars}
-
-
-
- , element)
diff --git a/src/react-histogram.js b/src/react-histogram.js
deleted file mode 100644
index 38cfc57..0000000
--- a/src/react-histogram.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import React from 'react'
-import ReactDOM from 'react-dom'
-import d3 from 'd3'
-import Axis from './components/axis'
-
-var element = document.getElementById("react-histogram")
-var margin = {top: 10, right: 30, bottom: 30, left: 30}
-var width = element.offsetWidth - margin.left - margin.right
-var height = 550 - margin.top - margin.bottom
-var values = d3.range(1000).map(d3.random.bates(10))
-var formatCount = d3.format(",.0f")
-var xscale = d3.scale.linear().domain([0, 1]).range([0, width])
-var data = d3.layout.histogram().bins(xscale.ticks(20))(values)
-var yscale = d3.scale.linear().domain([0, d3.max(data, (d) => d.y)]).range([height, 0])
-
-var bars = data.map(
- (d, i) =>
-
-
- {formatCount(d.y)}
- )
-
-ReactDOM.render(
-
-
- {bars}
-
-
-
- , element)
diff --git a/src/react-in-jekyll.js b/src/react-in-jekyll.js
deleted file mode 100644
index fca84a5..0000000
--- a/src/react-in-jekyll.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import React from 'react'
-import ReactDOM from 'react-dom'
-import HelloWorld from './components/hello'
-
-ReactDOM.render( , document.getElementById("react-body"));
diff --git a/src/react-scatterplot-2.js b/src/react-scatterplot-2.js
deleted file mode 100644
index 94302e5..0000000
--- a/src/react-scatterplot-2.js
+++ /dev/null
@@ -1,74 +0,0 @@
-import React from 'react'
-import ReactDOM from 'react-dom'
-import d3 from 'd3'
-import Axis from './components/axis'
-import {Mixin as tweenMixin, easingTypes} from 'react-tween-state'
-
-var element = document.getElementById("scatterplot")
-var margin = {top: 30, right: 100, bottom: 30, left: 100}
-var width = element.offsetWidth - margin.left - margin.right
-var height = 550 - margin.top - margin.bottom
-
-let normalDistribution = d3.random.normal(0, 1)
-var values = d3.range(1000).map(() => [normalDistribution(), normalDistribution()])
-var xscale = d3.scale.linear().domain([-3, 3]).range([0, width])
-var yscale = d3.scale.linear().domain([-3, 3]).range([height, 0])
-
-function animateGroup(Component, transitionAttributes) {
- const VisualGroup = React.createClass({
- mixins: [tweenMixin],
- getInitialState() {
- let state = this.props.data.reduce(
- function (memo, d, i) {
- transitionAttributes.forEach(
- transition =>
- memo[`__data:${i}:${transition.key}`] = (typeof transition.start === "function") ? transition.start(d) : (transition.start == null ? 0 : transition.start))
- return memo
- }, {})
- return state
- },
- componentDidMount() {
- this.props.data.forEach(
- (d, i) =>
- transitionAttributes.forEach(
- transition =>
- this.tweenState(`__data:${i}:${transition.key}`, {
- easing: transition.ease,
- duration: transition.duration,
- endValue: d[transition.key]
- })))
- },
- render() {
- let marks = this.props.data.map(
- (d, i) => {
- var props = {}
- transitionAttributes.forEach(
- transition => props[transition.prop] = transition.scale(this.getTweeningValue(`__data:${i}:${transition.key}`)))
- return
- })
- return {marks}
- }
- })
-
- return VisualGroup
-}
-
-class Circle extends React.Component {
- render() {
- return
- }
-}
-
-let TransitionGroup = animateGroup(Circle, [
- { key: 0, prop: 'cx', scale: xscale, duration: 2000, easing: easingTypes.linear, start: 0},
- { key: 1, prop: 'cy', scale: yscale, duration: 2000, easing: easingTypes.linear, start: 0}
-])
-
-ReactDOM.render(
-
-
-
-
-
-
- , element)
diff --git a/src/react-scatterplot.js b/src/react-scatterplot.js
deleted file mode 100644
index d836f56..0000000
--- a/src/react-scatterplot.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from 'react'
-import ReactDOM from 'react-dom'
-import d3 from 'd3'
-import animateMark from './components/mark'
-import Axis from './components/axis'
-import {easingTypes} from 'react-tween-state'
-
-var element = document.getElementById("scatterplot")
-var margin = {top: 30, right: 100, bottom: 30, left: 100}
-var width = element.offsetWidth - margin.left - margin.right
-var height = 550 - margin.top - margin.bottom
-
-let normalDistribution = d3.random.normal(0, 1)
-var values = d3.range(1000).map(() => [normalDistribution(), normalDistribution()])
-var xscale = d3.scale.linear().domain([-3, 3]).range([0, width])
-var yscale = d3.scale.linear().domain([-3, 3]).range([height, 0])
-
-class Circle extends React.Component {
- render() {
- return
- }
-}
-
-let TransitionCircle = animateMark(Circle, [
- { prop: 'cx', duration: 2000, easing: easingTypes.linear, start: xscale(0)},
- { prop: 'cy', duration: 2000, easing: easingTypes.linear, start: yscale(0)}
-])
-
-var points = values.map(function (d, i) {
- var [x, y] = d
- return
-})
-
-ReactDOM.render(
-
-
- {points}
-
-
-
- , element)
diff --git a/webpack.config.js b/webpack.config.js
deleted file mode 100644
index e02030e..0000000
--- a/webpack.config.js
+++ /dev/null
@@ -1,57 +0,0 @@
-var path = require('path');
-var grunt = require('grunt');
-var webpack = require('webpack');
-
-var entries = grunt.file.expand({cwd: path.resolve('src')}, "*").reduce(
- function(map, page) {
- if (page.match(/.js$/)) {
- map[page.slice(0, page.length - 3)] = "./" + page;
- }
- return map;
- }, {});
-
-module.exports = {
- context: __dirname + "/src",
- entry: entries,
- output: {
- path: path.join(__dirname, "public", "js"),
- filename: '[name].min.js'
- },
- module: {
- loaders: [
- {
- test: /\.coffee$/,
- loaders: [ 'coffee-loader', 'cjsx-loader' ],
- include: path.join(__dirname, 'src')
- },
- {
- test: /\.js$/,
- loaders: ['babel-loader?stage=1'],
- include: path.join(__dirname, 'src'),
- exclude: /node_modules/
- },
- { test: /\.css$/, loader: "style-loader!css-loader" },
- { test: /\.scss$/, loader: "style!css!sass" },
- { test: /\.svg$/, loader: "raw-loader" }
- ]
- },
- externals: {
- "vega": "vg",
- "d3": "d3",
- "datalib": "dl",
- "react": "React",
- "react-dom": "ReactDOM",
- "lodash": "_"
- },
- plugins: [
- new webpack.optimize.UglifyJsPlugin({minimize: true})
- ],
- resolve: {
- extensions: ['', '.js', '.json', '.coffee']
- },
- resolveLoader: {
- modulesDirectories: [
- 'node_modules'
- ]
- }
-}
diff --git a/webpack.hot.config.js b/webpack.hot.config.js
deleted file mode 100644
index 9ea6b35..0000000
--- a/webpack.hot.config.js
+++ /dev/null
@@ -1,63 +0,0 @@
-var path = require('path');
-var grunt = require('grunt');
-var webpack = require('webpack');
-
-var entries = grunt.file.expand({cwd: path.resolve('src')}, "*").reduce(
- function(map, page) {
- if (page.match(/.js$/)) {
- map[page.slice(0, page.length - 3)] = "./" + page;
- }
- return map;
- }, {});
-
-module.exports = {
- context: __dirname + "/src",
- entry: entries,
- output: {
- path: path.join(__dirname, "public", "js"),
- filename: '[name].hot.js',
- publicPath: 'http://localhost:8080/'
- },
- module: {
- loaders: [
- { test: /\.coffee$/,
- loaders: ['react-hot', 'coffee-loader', 'cjsx-loader'],
- include: path.join(__dirname, 'src')
- },
- {
- test: /\.js$/,
- loaders: ['react-hot', 'babel-loader?stage=1'],
- include: path.join(__dirname, 'src')
- },
- { test: /\.css$/, loader: "style-loader!css-loader" },
- { test: /\.scss$/, loader: "style!css!sass" },
- { test: /\.svg$/, loader: "raw-loader" }
- ]
- },
- externals: {
- "vega": "vg",
- "d3": "d3",
- "datalib": "dl",
- "lodash": "_"
- },
- devServer: {
- publicPath: 'http://localhost:8080/',
- contentBase: "./src",
- hot: true,
- inline: true,
- devtool: 'eval',
- headers: { 'Access-Control-Allow-Origin': '*' }
- },
- plugins: [
- new webpack.HotModuleReplacementPlugin(),
- new webpack.NoErrorsPlugin()
- ],
- resolve: {
- extensions: ['', '.js', '.json', '.coffee']
- },
- resolveLoader: {
- modulesDirectories: [
- 'node_modules'
- ]
- }
-}