hyhyhy 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +184 -0
- data/Rakefile +2 -0
- data/bin/hyhyhy +59 -0
- data/hyhyhy.gemspec +29 -0
- data/lib/hyhyhy.rb +101 -0
- data/lib/hyhyhy/config.rb +29 -0
- data/lib/hyhyhy/frames.rb +108 -0
- data/lib/hyhyhy/logger.rb +40 -0
- data/lib/hyhyhy/parser.rb +9 -0
- data/lib/hyhyhy/structure/.bowerrc +5 -0
- data/lib/hyhyhy/structure/.hyhyhy +5 -0
- data/lib/hyhyhy/structure/README.md +0 -0
- data/lib/hyhyhy/structure/_assets/javascripts/main.js +395 -0
- data/lib/hyhyhy/structure/_assets/stylesheets/main.css +520 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/.bower.json +47 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/Gruntfile.js +472 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/LICENSE +21 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/README.md +129 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/bower.json +38 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap-theme.css +470 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap-theme.css.map +1 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap-theme.min.css +5 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap.css +6332 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap.css.map +1 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap.min.css +5 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +229 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/js/bootstrap.js +2320 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/js/bootstrap.min.js +7 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/js/npm.js +13 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/fonts/glyphicons-halflings-regular.svg +229 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/.jshintrc +7 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-commonjs-generator.js +23 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-lessdoc-parser.js +238 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-raw-files-generator.js +46 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/configBridge.json +44 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/sauce_browsers.yml +82 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/.jscsrc +34 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/.jshintrc +15 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/affix.js +162 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/alert.js +94 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/button.js +116 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/carousel.js +240 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/collapse.js +211 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/dropdown.js +161 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/modal.js +324 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/popover.js +119 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/scrollspy.js +175 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/tab.js +153 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/tooltip.js +478 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/transition.js +59 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/.csscomb.json +304 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/.csslintrc +19 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/alerts.less +68 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/badges.less +61 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/bootstrap.less +50 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/breadcrumbs.less +26 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/button-groups.less +243 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/buttons.less +160 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/carousel.less +267 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/close.less +33 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/code.less +69 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/component-animations.less +34 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/dropdowns.less +213 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/forms.less +546 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/glyphicons.less +234 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/grid.less +84 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/input-groups.less +166 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/jumbotron.less +49 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/labels.less +64 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/list-group.less +124 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/media.less +47 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins.less +39 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/alerts.less +14 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/background-variant.less +8 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/border-radius.less +18 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/buttons.less +52 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/center-block.less +7 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/clearfix.less +22 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/forms.less +85 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/gradients.less +59 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/grid-framework.less +91 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/grid.less +122 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/hide-text.less +21 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/image.less +33 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/labels.less +12 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/list-group.less +29 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/nav-divider.less +10 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/nav-vertical-align.less +9 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/opacity.less +8 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/pagination.less +23 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/panels.less +24 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/progress-bar.less +10 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/reset-filter.less +8 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/resize.less +6 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/responsive-visibility.less +15 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/size.less +10 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/tab-focus.less +9 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/table-row.less +28 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/text-emphasis.less +8 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/text-overflow.less +8 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/vendor-prefixes.less +227 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/modals.less +148 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/navbar.less +660 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/navs.less +244 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/normalize.less +427 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/pager.less +54 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/pagination.less +88 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/panels.less +261 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/popovers.less +135 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/print.less +107 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/progress-bars.less +87 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/responsive-embed.less +35 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/responsive-utilities.less +194 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/scaffolding.less +150 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/tables.less +234 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/theme.less +272 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/thumbnails.less +36 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/tooltip.less +103 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/type.less +302 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/utilities.less +56 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/variables.less +856 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/wells.less +29 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/package.json +82 -0
- data/lib/hyhyhy/structure/_includes/bower.json +9 -0
- data/lib/hyhyhy/structure/_includes/d3/.bower.json +37 -0
- data/lib/hyhyhy/structure/_includes/d3/CONTRIBUTING.md +25 -0
- data/lib/hyhyhy/structure/_includes/d3/LICENSE +26 -0
- data/lib/hyhyhy/structure/_includes/d3/README.md +9 -0
- data/lib/hyhyhy/structure/_includes/d3/bower.json +26 -0
- data/lib/hyhyhy/structure/_includes/d3/d3.js +9470 -0
- data/lib/hyhyhy/structure/_includes/d3/d3.min.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/.bower.json +38 -0
- data/lib/hyhyhy/structure/_includes/jquery/MIT-LICENSE.txt +21 -0
- data/lib/hyhyhy/structure/_includes/jquery/bower.json +27 -0
- data/lib/hyhyhy/structure/_includes/jquery/dist/jquery.js +9190 -0
- data/lib/hyhyhy/structure/_includes/jquery/dist/jquery.min.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/dist/jquery.min.map +1 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax.js +806 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/jsonp.js +89 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/load.js +75 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/parseJSON.js +13 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/parseXML.js +28 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/script.js +64 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/var/nonce.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/var/rquery.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/xhr.js +135 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes.js +11 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes/attr.js +143 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes/classes.js +158 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes/prop.js +96 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes/support.js +35 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes/val.js +163 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/callbacks.js +205 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core.js +498 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core/access.js +60 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core/init.js +123 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core/parseHTML.js +39 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core/ready.js +97 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core/var/rsingleTag.js +4 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css.js +451 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/addGetHookIf.js +24 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/curCSS.js +57 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/defaultDisplay.js +70 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/support.js +91 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/swap.js +28 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/var/cssExpand.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/var/getStyles.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/var/isHidden.js +13 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/var/rmargin.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/var/rnumnonpx.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/data.js +179 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/data/Data.js +181 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/data/accepts.js +20 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/data/var/data_priv.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/data/var/data_user.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/deferred.js +149 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/deprecated.js +13 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/dimensions.js +50 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/effects.js +649 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/effects/Tween.js +114 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/effects/animatedSelector.js +13 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/event.js +868 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/event/alias.js +39 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/event/support.js +9 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/exports/amd.js +24 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/exports/global.js +32 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/intro.js +44 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/jquery.js +36 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/manipulation.js +582 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/manipulation/_evalUrl.js +18 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/manipulation/support.js +31 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/offset.js +204 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/outro.js +1 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/queue.js +142 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/queue/delay.js +22 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/selector-native.js +172 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/selector-sizzle.js +14 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/selector.js +1 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/serialize.js +111 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/sizzle/dist/sizzle.js +2044 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/sizzle/dist/sizzle.min.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/sizzle/dist/sizzle.min.map +1 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/traversing.js +200 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/traversing/findFilter.js +100 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/arr.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/class2type.js +4 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/concat.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/hasOwn.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/indexOf.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/pnum.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/push.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/rnotwhite.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/slice.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/strundefined.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/support.js +4 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/toString.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/wrap.js +78 -0
- data/lib/hyhyhy/structure/_includes/katex/.arcconfig +4 -0
- data/lib/hyhyhy/structure/_includes/katex/.bower.json +14 -0
- data/lib/hyhyhy/structure/_includes/katex/.gitignore +5 -0
- data/lib/hyhyhy/structure/_includes/katex/.hyhyhy +10 -0
- data/lib/hyhyhy/structure/_includes/katex/.jshintrc +67 -0
- data/lib/hyhyhy/structure/_includes/katex/.travis.yml +4 -0
- data/lib/hyhyhy/structure/_includes/katex/CONTRIBUTING.md +112 -0
- data/lib/hyhyhy/structure/_includes/katex/LICENSE.txt +21 -0
- data/lib/hyhyhy/structure/_includes/katex/Makefile +61 -0
- data/lib/hyhyhy/structure/_includes/katex/README.md +50 -0
- data/lib/hyhyhy/structure/_includes/katex/cli.js +15 -0
- data/lib/hyhyhy/structure/_includes/katex/dockers/HuxleyTests/Dockerfile +13 -0
- data/lib/hyhyhy/structure/_includes/katex/dockers/HuxleyTests/README.md +29 -0
- data/lib/hyhyhy/structure/_includes/katex/dockers/MathJaxFonts/Dockerfile +34 -0
- data/lib/hyhyhy/structure/_includes/katex/dockers/MathJaxFonts/README.md +55 -0
- data/lib/hyhyhy/structure/_includes/katex/dockers/MathJaxFonts/copy_fonts.sh +47 -0
- data/lib/hyhyhy/structure/_includes/katex/katex.js +54 -0
- data/lib/hyhyhy/structure/_includes/katex/lint_blacklist.txt +8 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/README.md +21 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/extract_tfms.py +94 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/extract_ttfs.py +75 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/mapping.pl +997 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/parse_tfm.py +201 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/replace_line.py +17 -0
- data/lib/hyhyhy/structure/_includes/katex/package.json +30 -0
- data/lib/hyhyhy/structure/_includes/katex/server.js +77 -0
- data/lib/hyhyhy/structure/_includes/katex/src/Lexer.js +190 -0
- data/lib/hyhyhy/structure/_includes/katex/src/Options.js +85 -0
- data/lib/hyhyhy/structure/_includes/katex/src/ParseError.js +40 -0
- data/lib/hyhyhy/structure/_includes/katex/src/Parser.js +639 -0
- data/lib/hyhyhy/structure/_includes/katex/src/Style.js +126 -0
- data/lib/hyhyhy/structure/_includes/katex/src/buildCommon.js +271 -0
- data/lib/hyhyhy/structure/_includes/katex/src/buildTree.js +1167 -0
- data/lib/hyhyhy/structure/_includes/katex/src/delimiter.js +541 -0
- data/lib/hyhyhy/structure/_includes/katex/src/domTree.js +241 -0
- data/lib/hyhyhy/structure/_includes/katex/src/fontMetrics.js +129 -0
- data/lib/hyhyhy/structure/_includes/katex/src/functions.js +539 -0
- data/lib/hyhyhy/structure/_includes/katex/src/parseTree.js +17 -0
- data/lib/hyhyhy/structure/_includes/katex/src/symbols.js +1006 -0
- data/lib/hyhyhy/structure/_includes/katex/src/utils.js +97 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts.less +73 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_AMS-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_AMS-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_AMS-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Bold.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Bold.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Greek-Bold.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Greek-BoldItalic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Greek-Italic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Greek-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Bold.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Bold.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Bold.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Bold.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Italic.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Italic.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Italic.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Italic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-BoldItalic.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Italic.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Italic.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Italic.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Italic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Bold.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Italic.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Script-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Script-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Script-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Script-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size1-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size1-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size1-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size2-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size2-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size2-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size3-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size3-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size3-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size4-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size4-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size4-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Typewriter-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/index.html +17 -0
- data/lib/hyhyhy/structure/_includes/katex/static/katex.less +430 -0
- data/lib/hyhyhy/structure/_includes/katex/static/main.css +12 -0
- data/lib/hyhyhy/structure/_includes/katex/static/main.js +42 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfile.json +199 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Accents.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Accents.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Baseline.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Baseline.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/BasicTest.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/BasicTest.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/BinomTest.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/BinomTest.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Colors.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Colors.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DeepFontSizing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DeepFontSizing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DelimiterSizing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DelimiterSizing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DisplayStyle.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DisplayStyle.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Exponents.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Exponents.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/FractionTest.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/FractionTest.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Functions.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Functions.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/GreekLetters.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/GreekLetters.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/KaTeX.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/KaTeX.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Lap.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Lap.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRight.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRight.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRightListStyling.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRightListStyling.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRightStyleSizing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRightStyleSizing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/NestedFractions.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/NestedFractions.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/NullDelimiterInteraction.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/NullDelimiterInteraction.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/OpLimits.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/OpLimits.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Overline.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Overline.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/PrimeSpacing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/PrimeSpacing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/RlapBug.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/RlapBug.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Rule.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Rule.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Sizing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Sizing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SizingBaseline.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SizingBaseline.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Spacing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Spacing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Sqrt.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Sqrt.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubCharacterBox.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubCharacterBox.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubHorizSpacing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubHorizSpacing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubOffsets.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubOffsets.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Text.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Text.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/VerticalSpacing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/VerticalSpacing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/test.html +30 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/MIT.LICENSE +20 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/boot.js +120 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/console.js +166 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/jasmine-html.js +390 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/jasmine.css +61 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/jasmine.js +2593 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/jasmine_favicon.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/katex-spec.js +1179 -0
- data/lib/hyhyhy/structure/_includes/katex/test/test.html +12 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/.bower.json +61 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/.hyhyhy +17 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/LICENSE +362 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/README.md +70 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/bower.json +50 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/css/metricsgraphics-demo-dark.css +640 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/css/metricsgraphics-demo.css +176 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/css/metricsgraphics.css +344 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/images/missing-data-dark.png +0 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/images/missing-data.png +0 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/js/metricsgraphics.min.js +590 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/package.json +35 -0
- data/lib/hyhyhy/structure/_includes/prism/.bower.json +34 -0
- data/lib/hyhyhy/structure/_includes/prism/.hyhyhy +33 -0
- data/lib/hyhyhy/structure/_includes/prism/LICENSE +21 -0
- data/lib/hyhyhy/structure/_includes/prism/README.md +22 -0
- data/lib/hyhyhy/structure/_includes/prism/bower.json +26 -0
- data/lib/hyhyhy/structure/_includes/prism/components.js +233 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-apacheconf.js +46 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-apacheconf.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-aspnet.js +49 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-aspnet.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-autohotkey.js +27 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-autohotkey.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-bash.js +24 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-bash.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-c.js +26 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-c.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-clike.js +32 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-clike.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-coffeescript.js +18 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-coffeescript.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-core.js +424 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-core.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-cpp.js +12 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-cpp.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-csharp.js +6 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-csharp.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-css-extras.js +15 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-css-extras.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-css.js +50 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-css.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-gherkin.js +13 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-gherkin.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-git.js +68 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-git.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-go.js +9 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-go.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-groovy.js +43 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-groovy.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-handlebars.js +92 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-handlebars.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-haskell.js +32 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-haskell.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-http.js +44 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-http.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-ini.js +11 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-ini.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-java.js +8 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-java.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-javascript.js +27 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-javascript.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-latex.js +6 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-latex.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-markup.js +41 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-markup.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-nasm.js +20 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-nasm.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-nsis.js +19 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-nsis.min.js +5 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-objectivec.js +5 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-objectivec.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-perl.js +112 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-perl.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-php-extras.js +11 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-php-extras.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-php.js +99 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-php.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-python.js +14 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-python.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-rip.js +29 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-rip.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-ruby.js +21 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-ruby.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scala.js +8 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scala.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scheme-min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scheme.js +24 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scss.js +36 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scss.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-sql.js +17 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-sql.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-swift.js +8 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-swift.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-twig.js +46 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-twig.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/gulpfile.js +48 -0
- data/lib/hyhyhy/structure/_includes/prism/package.json +27 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/autolinker/prism-autolinker.css +3 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/autolinker/prism-autolinker.js +66 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/autolinker/prism-autolinker.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/file-highlight/prism-file-highlight.js +54 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/file-highlight/prism-file-highlight.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/ie8/prism-ie8.css +3 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/ie8/prism-ie8.js +42 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/ie8/prism-ie8.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-highlight/prism-line-highlight.css +47 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-highlight/prism-line-highlight.js +109 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-highlight/prism-line-highlight.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-numbers/prism-line-numbers.css +40 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-numbers/prism-line-numbers.js +24 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-numbers/prism-line-numbers.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-invisibles/prism-show-invisibles.css +17 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-invisibles/prism-show-invisibles.js +15 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-invisibles/prism-show-invisibles.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-language/prism-show-language.css +21 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-language/prism-show-language.js +16 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-language/prism-show-language.min.css +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-language/prism-show-language.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/wpd/prism-wpd.css +11 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/wpd/prism-wpd.js +163 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/wpd/prism-wpd.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/prism.js +662 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-coy.css +210 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-dark.css +122 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-funky.css +111 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-okaidia.css +114 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-tomorrow.css +115 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-twilight.css +195 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism.css +131 -0
- data/lib/hyhyhy/structure/_includes/prism/vendor/promise.js +5 -0
- data/lib/hyhyhy/structure/_layouts/default.erb +41 -0
- data/lib/hyhyhy/structure/_slides/1.introduction.md +36 -0
- data/lib/hyhyhy/structure/_slides/2.packages.md +52 -0
- data/lib/hyhyhy/structure/_slides/3.usage.md +146 -0
- data/lib/hyhyhy/version.rb +5 -0
- metadata +747 -0
@@ -0,0 +1,590 @@
|
|
1
|
+
|
2
|
+
var charts={};var globals={};globals.link=false;globals.version="1.1";function data_graphic(){'use strict';var moz={};moz.defaults={};moz.defaults.all={missing_is_zero:false,legend:'',legend_target:'',error:'',animate_on_load:false,top:40,bottom:30,right:10,left:50,buffer:8,width:350,height:220,small_height_threshold:120,small_width_threshold:160,small_text:false,xax_count:6,xax_tick_length:5,yax_count:5,yax_tick_length:5,x_extended_ticks:false,y_extended_ticks:false,y_scale_type:'linear',max_x:null,max_y:null,min_x:null,min_y:null,min_y_from_data:false,point_size:2.5,x_accessor:'date',xax_units:'',x_label:'',x_axis:true,y_axis:true,y_accessor:'value',y_label:'',yax_units:'',x_rug:false,y_rug:false,transition_on_update:true,rollover_callback:null,show_rollover_text:true,show_confidence_band:null,xax_format:function(d){var df=d3.time.format('%b %d');var pf=d3.formatPrefix(d);switch($.type(args.data[0][0][args.x_accessor])){case'date':return df(d);break;case'number':return pf.scale(d)+pf.symbol;break;default:return d;}},area:true,chart_type:'line',data:[],decimals:2,format:'count',inflator:10/9,linked:false,list:false,baselines:null,markers:null,scalefns:{},scales:{},show_years:true,target:'#viz',interpolate:'cardinal',custom_line_color_map:[],max_data_size:null}
|
3
|
+
moz.defaults.point={buffer:16,ls:false,lowess:false,point_size:2.5,size_accessor:null,color_accessor:null,size_range:null,color_range:null,size_domain:null,color_domain:null,color_type:'number'}
|
4
|
+
moz.defaults.histogram={rollover_callback:function(d,i){$('#histogram svg .active_datapoint').html('Frequency Count: '+d.y);},binned:false,bins:null,processed_x_accessor:'x',processed_y_accessor:'y',processed_dx_accessor:'dx',bar_margin:1}
|
5
|
+
moz.defaults.bar={y_accessor:'factor',x_accessor:'value',baseline_accessor:null,predictor_accessor:null,predictor_proportion:5,dodge_accessor:null,binned:true,padding_percentage:0,outer_padding_percentage:.1,height:500,top:20,bar_height:20,left:70}
|
6
|
+
moz.defaults.missing={top:0,bottom:0,right:0,left:0,legend_target:'',width:350,height:220,missing_text:'Data currently missing or unavailable'}
|
7
|
+
var args=arguments[0];if(!args){args={};}
|
8
|
+
var g='';if(args.list){args.x_accessor=0;args.y_accessor=1;}
|
9
|
+
if(args.chart_type=='missing-data'){args=merge_with_defaults(args,moz.defaults.missing);charts.missing(args);}
|
10
|
+
else if(args.chart_type=='point'){var a=merge_with_defaults(moz.defaults.point,moz.defaults.all);args=merge_with_defaults(args,a);charts.point(args).mainPlot().markers().rollover();}
|
11
|
+
else if(args.chart_type=='histogram'){var a=merge_with_defaults(moz.defaults.histogram,moz.defaults.all);args=merge_with_defaults(args,a);charts.histogram(args).mainPlot().markers().rollover();}
|
12
|
+
else if(args.chart_type=='bar'){var a=merge_with_defaults(moz.defaults.bar,moz.defaults.all);args=merge_with_defaults(args,a);charts.bar(args).mainPlot().markers().rollover();}
|
13
|
+
else{args=merge_with_defaults(args,moz.defaults.all);charts.line(args).markers().mainPlot().rollover();}
|
14
|
+
return args.data;}
|
15
|
+
if(typeof jQuery==='undefined'){throw new Error('Bootstrap\'s JavaScript requires jQuery')}
|
16
|
+
+function($){var version=$.fn.jquery.split(' ')[0].split('.')
|
17
|
+
if((version[0]<2&&version[1]<9)||(version[0]==1&&version[1]==9&&version[2]<1)){throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')}}(jQuery);+function($){'use strict';if(typeof $().tooltip=='function')
|
18
|
+
return true;var Tooltip=function(element,options){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null
|
19
|
+
this.init('tooltip',element,options)}
|
20
|
+
Tooltip.VERSION='3.3.1'
|
21
|
+
Tooltip.TRANSITION_DURATION=150
|
22
|
+
Tooltip.DEFAULTS={animation:true,placement:'top',selector:false,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:'hover focus',title:'',delay:0,html:false,container:false,viewport:{selector:'body',padding:0}}
|
23
|
+
Tooltip.prototype.init=function(type,element,options){this.enabled=true
|
24
|
+
this.type=type
|
25
|
+
this.$element=$(element)
|
26
|
+
this.options=this.getOptions(options)
|
27
|
+
this.$viewport=this.options.viewport&&$(this.options.viewport.selector||this.options.viewport)
|
28
|
+
var triggers=this.options.trigger.split(' ')
|
29
|
+
for(var i=triggers.length;i--;){var trigger=triggers[i]
|
30
|
+
if(trigger=='click'){this.$element.on('click.'+this.type,this.options.selector,$.proxy(this.toggle,this))}else if(trigger!='manual'){var eventIn=trigger=='hover'?'mouseenter':'focusin'
|
31
|
+
var eventOut=trigger=='hover'?'mouseleave':'focusout'
|
32
|
+
this.$element.on(eventIn+'.'+this.type,this.options.selector,$.proxy(this.enter,this))
|
33
|
+
this.$element.on(eventOut+'.'+this.type,this.options.selector,$.proxy(this.leave,this))}}
|
34
|
+
this.options.selector?(this._options=$.extend({},this.options,{trigger:'manual',selector:''})):this.fixTitle()}
|
35
|
+
Tooltip.prototype.getDefaults=function(){return Tooltip.DEFAULTS}
|
36
|
+
Tooltip.prototype.getOptions=function(options){options=$.extend({},this.getDefaults(),this.$element.data(),options)
|
37
|
+
if(options.delay&&typeof options.delay=='number'){options.delay={show:options.delay,hide:options.delay}}
|
38
|
+
return options}
|
39
|
+
Tooltip.prototype.getDelegateOptions=function(){var options={}
|
40
|
+
var defaults=this.getDefaults()
|
41
|
+
this._options&&$.each(this._options,function(key,value){if(defaults[key]!=value)options[key]=value})
|
42
|
+
return options}
|
43
|
+
Tooltip.prototype.enter=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
|
44
|
+
if(self&&self.$tip&&self.$tip.is(':visible')){self.hoverState='in'
|
45
|
+
return}
|
46
|
+
if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
|
47
|
+
$(obj.currentTarget).data('bs.'+this.type,self)}
|
48
|
+
clearTimeout(self.timeout)
|
49
|
+
self.hoverState='in'
|
50
|
+
if(!self.options.delay||!self.options.delay.show)return self.show()
|
51
|
+
self.timeout=setTimeout(function(){if(self.hoverState=='in')self.show()},self.options.delay.show)}
|
52
|
+
Tooltip.prototype.leave=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type)
|
53
|
+
if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions())
|
54
|
+
$(obj.currentTarget).data('bs.'+this.type,self)}
|
55
|
+
clearTimeout(self.timeout)
|
56
|
+
self.hoverState='out'
|
57
|
+
if(!self.options.delay||!self.options.delay.hide)return self.hide()
|
58
|
+
self.timeout=setTimeout(function(){if(self.hoverState=='out')self.hide()},self.options.delay.hide)}
|
59
|
+
Tooltip.prototype.show=function(){var e=$.Event('show.bs.'+this.type)
|
60
|
+
if(this.hasContent()&&this.enabled){this.$element.trigger(e)
|
61
|
+
var inDom=$.contains(this.$element[0].ownerDocument.documentElement,this.$element[0])
|
62
|
+
if(e.isDefaultPrevented()||!inDom)return
|
63
|
+
var that=this
|
64
|
+
var $tip=this.tip()
|
65
|
+
var tipId=this.getUID(this.type)
|
66
|
+
this.setContent()
|
67
|
+
$tip.attr('id',tipId)
|
68
|
+
this.$element.attr('aria-describedby',tipId)
|
69
|
+
if(this.options.animation)$tip.addClass('fade')
|
70
|
+
var placement=typeof this.options.placement=='function'?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement
|
71
|
+
var autoToken=/\s?auto?\s?/i
|
72
|
+
var autoPlace=autoToken.test(placement)
|
73
|
+
if(autoPlace)placement=placement.replace(autoToken,'')||'top'
|
74
|
+
$tip.detach().css({top:0,left:0,display:'block'}).addClass(placement).data('bs.'+this.type,this)
|
75
|
+
this.options.container?$tip.appendTo(this.options.container):$tip.insertAfter(this.$element)
|
76
|
+
var pos=this.getPosition()
|
77
|
+
var actualWidth=$tip[0].offsetWidth
|
78
|
+
var actualHeight=$tip[0].offsetHeight
|
79
|
+
if(autoPlace){var orgPlacement=placement
|
80
|
+
var $container=this.options.container?$(this.options.container):this.$element.parent()
|
81
|
+
var containerDim=this.getPosition($container)
|
82
|
+
placement=placement=='bottom'&&pos.bottom+actualHeight>containerDim.bottom?'top':placement=='top'&&pos.top-actualHeight<containerDim.top?'bottom':placement=='right'&&pos.right+actualWidth>containerDim.width?'left':placement=='left'&&pos.left-actualWidth<containerDim.left?'right':placement
|
83
|
+
$tip.removeClass(orgPlacement).addClass(placement)}
|
84
|
+
var calculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight)
|
85
|
+
this.applyPlacement(calculatedOffset,placement)
|
86
|
+
var complete=function(){var prevHoverState=that.hoverState
|
87
|
+
that.$element.trigger('shown.bs.'+that.type)
|
88
|
+
that.hoverState=null
|
89
|
+
if(prevHoverState=='out')that.leave(that)}
|
90
|
+
$.support.transition&&this.$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()}}
|
91
|
+
Tooltip.prototype.applyPlacement=function(offset,placement){var $tip=this.tip()
|
92
|
+
var width=$tip[0].offsetWidth
|
93
|
+
var height=$tip[0].offsetHeight
|
94
|
+
var marginTop=parseInt($tip.css('margin-top'),10)
|
95
|
+
var marginLeft=parseInt($tip.css('margin-left'),10)
|
96
|
+
if(isNaN(marginTop))marginTop=0
|
97
|
+
if(isNaN(marginLeft))marginLeft=0
|
98
|
+
offset.top=offset.top+marginTop
|
99
|
+
offset.left=offset.left+marginLeft
|
100
|
+
$.offset.setOffset($tip[0],$.extend({using:function(props){$tip.css({top:Math.round(props.top),left:Math.round(props.left)})}},offset),0)
|
101
|
+
$tip.addClass('in')
|
102
|
+
var actualWidth=$tip[0].offsetWidth
|
103
|
+
var actualHeight=$tip[0].offsetHeight
|
104
|
+
if(placement=='top'&&actualHeight!=height){offset.top=offset.top+height-actualHeight}
|
105
|
+
var delta=this.getViewportAdjustedDelta(placement,offset,actualWidth,actualHeight)
|
106
|
+
if(delta.left)offset.left+=delta.left
|
107
|
+
else offset.top+=delta.top
|
108
|
+
var isVertical=/top|bottom/.test(placement)
|
109
|
+
var arrowDelta=isVertical?delta.left*2-width+actualWidth:delta.top*2-height+actualHeight
|
110
|
+
var arrowOffsetPosition=isVertical?'offsetWidth':'offsetHeight'
|
111
|
+
$tip.offset(offset)
|
112
|
+
this.replaceArrow(arrowDelta,$tip[0][arrowOffsetPosition],isVertical)}
|
113
|
+
Tooltip.prototype.replaceArrow=function(delta,dimension,isHorizontal){this.arrow().css(isHorizontal?'left':'top',50*(1-delta/dimension)+'%').css(isHorizontal?'top':'left','')}
|
114
|
+
Tooltip.prototype.setContent=function(){var $tip=this.tip()
|
115
|
+
var title=this.getTitle()
|
116
|
+
$tip.find('.tooltip-inner')[this.options.html?'html':'text'](title)
|
117
|
+
$tip.removeClass('fade in top bottom left right')}
|
118
|
+
Tooltip.prototype.hide=function(callback){var that=this
|
119
|
+
var $tip=this.tip()
|
120
|
+
var e=$.Event('hide.bs.'+this.type)
|
121
|
+
function complete(){if(that.hoverState!='in')$tip.detach()
|
122
|
+
that.$element.removeAttr('aria-describedby').trigger('hidden.bs.'+that.type)
|
123
|
+
callback&&callback()}
|
124
|
+
this.$element.trigger(e)
|
125
|
+
if(e.isDefaultPrevented())return
|
126
|
+
$tip.removeClass('in')
|
127
|
+
$.support.transition&&this.$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()
|
128
|
+
this.hoverState=null
|
129
|
+
return this}
|
130
|
+
Tooltip.prototype.fixTitle=function(){var $e=this.$element
|
131
|
+
if($e.attr('title')||typeof($e.attr('data-original-title'))!='string'){$e.attr('data-original-title',$e.attr('title')||'').attr('title','')}}
|
132
|
+
Tooltip.prototype.hasContent=function(){return this.getTitle()}
|
133
|
+
Tooltip.prototype.getPosition=function($element){$element=$element||this.$element
|
134
|
+
var el=$element[0]
|
135
|
+
var isBody=el.tagName=='BODY'
|
136
|
+
var elRect=el.getBoundingClientRect()
|
137
|
+
if(elRect.width==null){elRect=$.extend({},elRect,{width:elRect.right-elRect.left,height:elRect.bottom-elRect.top})}
|
138
|
+
var elOffset=isBody?{top:0,left:0}:$element.offset()
|
139
|
+
var scroll={scroll:isBody?document.documentElement.scrollTop||document.body.scrollTop:$element.scrollTop()}
|
140
|
+
var outerDims=isBody?{width:$(window).width(),height:$(window).height()}:null
|
141
|
+
return $.extend({},elRect,scroll,outerDims,elOffset)}
|
142
|
+
Tooltip.prototype.getCalculatedOffset=function(placement,pos,actualWidth,actualHeight){return placement=='bottom'?{top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}:placement=='top'?{top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}:placement=='left'?{top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth}:{top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}}
|
143
|
+
Tooltip.prototype.getViewportAdjustedDelta=function(placement,pos,actualWidth,actualHeight){var delta={top:0,left:0}
|
144
|
+
if(!this.$viewport)return delta
|
145
|
+
var viewportPadding=this.options.viewport&&this.options.viewport.padding||0
|
146
|
+
var viewportDimensions=this.getPosition(this.$viewport)
|
147
|
+
if(/right|left/.test(placement)){var topEdgeOffset=pos.top-viewportPadding-viewportDimensions.scroll
|
148
|
+
var bottomEdgeOffset=pos.top+viewportPadding-viewportDimensions.scroll+actualHeight
|
149
|
+
if(topEdgeOffset<viewportDimensions.top){delta.top=viewportDimensions.top-topEdgeOffset}else if(bottomEdgeOffset>viewportDimensions.top+viewportDimensions.height){delta.top=viewportDimensions.top+viewportDimensions.height-bottomEdgeOffset}}else{var leftEdgeOffset=pos.left-viewportPadding
|
150
|
+
var rightEdgeOffset=pos.left+viewportPadding+actualWidth
|
151
|
+
if(leftEdgeOffset<viewportDimensions.left){delta.left=viewportDimensions.left-leftEdgeOffset}else if(rightEdgeOffset>viewportDimensions.width){delta.left=viewportDimensions.left+viewportDimensions.width-rightEdgeOffset}}
|
152
|
+
return delta}
|
153
|
+
Tooltip.prototype.getTitle=function(){var title
|
154
|
+
var $e=this.$element
|
155
|
+
var o=this.options
|
156
|
+
title=$e.attr('data-original-title')||(typeof o.title=='function'?o.title.call($e[0]):o.title)
|
157
|
+
return title}
|
158
|
+
Tooltip.prototype.getUID=function(prefix){do prefix+=~~(Math.random()*1000000)
|
159
|
+
while(document.getElementById(prefix))
|
160
|
+
return prefix}
|
161
|
+
Tooltip.prototype.tip=function(){return(this.$tip=this.$tip||$(this.options.template))}
|
162
|
+
Tooltip.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.tooltip-arrow'))}
|
163
|
+
Tooltip.prototype.enable=function(){this.enabled=true}
|
164
|
+
Tooltip.prototype.disable=function(){this.enabled=false}
|
165
|
+
Tooltip.prototype.toggleEnabled=function(){this.enabled=!this.enabled}
|
166
|
+
Tooltip.prototype.toggle=function(e){var self=this
|
167
|
+
if(e){self=$(e.currentTarget).data('bs.'+this.type)
|
168
|
+
if(!self){self=new this.constructor(e.currentTarget,this.getDelegateOptions())
|
169
|
+
$(e.currentTarget).data('bs.'+this.type,self)}}
|
170
|
+
self.tip().hasClass('in')?self.leave(self):self.enter(self)}
|
171
|
+
Tooltip.prototype.destroy=function(){var that=this
|
172
|
+
clearTimeout(this.timeout)
|
173
|
+
this.hide(function(){that.$element.off('.'+that.type).removeData('bs.'+that.type)})}
|
174
|
+
function Plugin(option){return this.each(function(){var $this=$(this)
|
175
|
+
var data=$this.data('bs.tooltip')
|
176
|
+
var options=typeof option=='object'&&option
|
177
|
+
var selector=options&&options.selector
|
178
|
+
if(!data&&option=='destroy')return
|
179
|
+
if(selector){if(!data)$this.data('bs.tooltip',(data={}))
|
180
|
+
if(!data[selector])data[selector]=new Tooltip(this,options)}else{if(!data)$this.data('bs.tooltip',(data=new Tooltip(this,options)))}
|
181
|
+
if(typeof option=='string')data[option]()})}
|
182
|
+
var old=$.fn.tooltip
|
183
|
+
$.fn.tooltip=Plugin
|
184
|
+
$.fn.tooltip.Constructor=Tooltip
|
185
|
+
$.fn.tooltip.noConflict=function(){$.fn.tooltip=old
|
186
|
+
return this}}(jQuery);+function($){'use strict';if(typeof $().popover=='function')
|
187
|
+
return true;var Popover=function(element,options){this.init('popover',element,options)}
|
188
|
+
if(!$.fn.tooltip)throw new Error('Popover requires tooltip.js')
|
189
|
+
Popover.VERSION='3.3.1'
|
190
|
+
Popover.DEFAULTS=$.extend({},$.fn.tooltip.Constructor.DEFAULTS,{placement:'right',trigger:'click',content:'',template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'})
|
191
|
+
Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype)
|
192
|
+
Popover.prototype.constructor=Popover
|
193
|
+
Popover.prototype.getDefaults=function(){return Popover.DEFAULTS}
|
194
|
+
Popover.prototype.setContent=function(){var $tip=this.tip()
|
195
|
+
var title=this.getTitle()
|
196
|
+
var content=this.getContent()
|
197
|
+
$tip.find('.popover-title')[this.options.html?'html':'text'](title)
|
198
|
+
$tip.find('.popover-content').children().detach().end()[this.options.html?(typeof content=='string'?'html':'append'):'text'](content)
|
199
|
+
$tip.removeClass('fade top bottom left right in')
|
200
|
+
if(!$tip.find('.popover-title').html())$tip.find('.popover-title').hide()}
|
201
|
+
Popover.prototype.hasContent=function(){return this.getTitle()||this.getContent()}
|
202
|
+
Popover.prototype.getContent=function(){var $e=this.$element
|
203
|
+
var o=this.options
|
204
|
+
return $e.attr('data-content')||(typeof o.content=='function'?o.content.call($e[0]):o.content)}
|
205
|
+
Popover.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.arrow'))}
|
206
|
+
Popover.prototype.tip=function(){if(!this.$tip)this.$tip=$(this.options.template)
|
207
|
+
return this.$tip}
|
208
|
+
function Plugin(option){return this.each(function(){var $this=$(this)
|
209
|
+
var data=$this.data('bs.popover')
|
210
|
+
var options=typeof option=='object'&&option
|
211
|
+
var selector=options&&options.selector
|
212
|
+
if(!data&&option=='destroy')return
|
213
|
+
if(selector){if(!data)$this.data('bs.popover',(data={}))
|
214
|
+
if(!data[selector])data[selector]=new Popover(this,options)}else{if(!data)$this.data('bs.popover',(data=new Popover(this,options)))}
|
215
|
+
if(typeof option=='string')data[option]()})}
|
216
|
+
var old=$.fn.popover
|
217
|
+
$.fn.popover=Plugin
|
218
|
+
$.fn.popover.Constructor=Popover
|
219
|
+
$.fn.popover.noConflict=function(){$.fn.popover=old
|
220
|
+
return this}}(jQuery);function chart_title(args){'use strict';var currentTitle=$(args.target).find('h2.chart_title');if(args.title&&args.title!==currentTitle.text())
|
221
|
+
currentTitle.remove();else
|
222
|
+
return;if(args.target&&args.title){var newTitle;var optional_question_mark=(args.description)?'<i class="fa fa-question-circle fa-inverse"></i>':'';$(args.target).prepend('<h2 class="chart_title">'
|
223
|
+
+args.title+optional_question_mark+'</h2>');if(args.description){newTitle=$(args.target).find('h2.chart_title');newTitle.popover({html:true,animation:false,content:args.description,trigger:'hover',placement:'top',container:newTitle});}}
|
224
|
+
if(args.error){error(args);}}
|
225
|
+
function y_rug(args){'use strict';var svg=d3.select($(args.target).find('svg').get(0));var buffer_size=args.chart_type=='point'?args.buffer/2:args.buffer*2/3;var all_data=[];for(var i=0;i<args.data.length;i++){for(var j=0;j<args.data[i].length;j++){all_data.push(args.data[i][j]);}}
|
226
|
+
var rug=svg.selectAll('line.y_rug').data(all_data).enter().append('svg:line').attr('x1',args.left+1).attr('x2',args.left+buffer_size).attr('y1',args.scalefns.yf).attr('y2',args.scalefns.yf).attr('class','y-rug').attr('opacity',0.3);if(args.color_accessor){rug.attr('stroke',args.scalefns.color);}
|
227
|
+
else{rug.classed('y-rug-mono',true);}}
|
228
|
+
function y_axis(args){var svg=d3.select($(args.target).find('svg').get(0));var $svg=$($(args.target).find('svg').get(0));var g;var min_y,max_y;args.scalefns.yf=function(di){return args.scales.Y(di[args.y_accessor]);}
|
229
|
+
var min_y,max_y;var _set=false;for(var i=0;i<args.data.length;i++){var a=args.data[i];if(args.y_scale_type=='log'){a=a.filter(function(d){return d[args.y_accessor]>0;});}
|
230
|
+
if(a.length>0){var extent=d3.extent(a,function(d){return d[args.y_accessor];});if(!_set){min_y=extent[0];max_y=extent[1];_set=true;}else{min_y=Math.min(extent[0],min_y);max_y=Math.max(extent[1],max_y);}}}
|
231
|
+
if(min_y>=0&&!args.min_y&&!args.min_y_from_data){min_y=0;}
|
232
|
+
min_y=args.min_y?args.min_y:min_y;max_y=args.max_y?args.max_y:max_y;if(args.y_scale_type!='log'){if(min_y>=0){args.y_axis_negative=false;}else{min_y=min_y-(max_y*(args.inflator-1));args.y_axis_negative=true;}}
|
233
|
+
max_y=max_y*args.inflator;if(!args.min_y&&args.min_y_from_data){min_y=min_y/args.inflator;}
|
234
|
+
if(args.y_scale_type=='log'){if(args.chart_type=='histogram'){min_y=0.2;}else{if(min_y<=0){min_y=1;}}
|
235
|
+
args.scales.Y=d3.scale.log().domain([min_y,max_y]).range([args.height-args.bottom-args.buffer,args.top]).clamp(true);}else{args.scales.Y=d3.scale.linear().domain([min_y,max_y]).range([args.height-args.bottom-args.buffer,args.top]);}
|
236
|
+
args.scales.Y_axis=d3.scale.linear().domain([min_y,max_y]).range([args.height-args.bottom-args.buffer,args.top]);var yax_format;if(args.format=='count'){yax_format=function(f){if(f<1.0){return args.yax_units+d3.round(f,args.decimals);}else{var pf=d3.formatPrefix(f);return args.yax_units+pf.scale(f)+pf.symbol;}};}
|
237
|
+
else{yax_format=function(d_){var n=d3.format('%p');return n(d_);}}
|
238
|
+
$svg.find('.y-axis').remove();if(!args.y_axis)return this;g=svg.append('g').classed('y-axis',true).classed('y-axis-small',args.use_small_class);if(args.y_label){g.append('text').attr('class','label').attr('x',function(){return-1*(args.top+args.buffer+
|
239
|
+
((args.height-args.bottom-args.buffer)
|
240
|
+
-(args.top+args.buffer))/2);}).attr('y',function(){return args.left/2;}).attr("dy","0.4em").attr('text-anchor','middle').text(function(d){return args.y_label;}).attr("transform",function(d){return"rotate(-90)";});}
|
241
|
+
var scale_ticks=args.scales.Y.ticks(args.yax_count);function log10(val){if(val==1000){return 3;}
|
242
|
+
if(val==1000000){return 7;}
|
243
|
+
return Math.log(val)/Math.LN10;}
|
244
|
+
if(args.y_scale_type=='log'){scale_ticks=scale_ticks.filter(function(d){return Math.abs(log10(d))%1<1e-6||Math.abs(log10(d))%1>1-1e-6;});}
|
245
|
+
var number_of_ticks=args.scales.Y.ticks(args.yax_count).length;var data_is_int=true;$.each(args.data,function(i,d){$.each(d,function(i,d){if(d[args.y_accessor]%1!==0){data_is_int=false;return false;}});});if(data_is_int&&number_of_ticks>max_y&&args.format=='count'){scale_ticks=scale_ticks.filter(function(d){return d%1===0;});}
|
246
|
+
var last_i=scale_ticks.length-1;if(!args.x_extended_ticks&&!args.y_extended_ticks){g.append('line').attr('x1',args.left).attr('x2',args.left).attr('y1',args.scales.Y(scale_ticks[0]).toFixed(2)).attr('y2',args.scales.Y(scale_ticks[last_i]).toFixed(2));}
|
247
|
+
g.selectAll('.yax-ticks').data(scale_ticks).enter().append('line').classed('extended-y-ticks',args.y_extended_ticks).attr('x1',args.left).attr('x2',function(){return(args.y_extended_ticks)?args.width-args.right:args.left-args.yax_tick_length;}).attr('y1',function(d){return args.scales.Y(d).toFixed(2);}).attr('y2',function(d){return args.scales.Y(d).toFixed(2);});g.selectAll('.yax-labels').data(scale_ticks).enter().append('text').attr('x',args.left-args.yax_tick_length*3/2).attr('dx',-3).attr('y',function(d){return args.scales.Y(d).toFixed(2);}).attr('dy','.35em').attr('text-anchor','end').text(function(d,i){var o=yax_format(d);return o;})
|
248
|
+
if(args.y_rug){y_rug(args);}
|
249
|
+
return this;}
|
250
|
+
function y_axis_categorical(args){var svg_height=args.height;if(args.chart_type=='bar'&&svg_height==null){}
|
251
|
+
args.scales.Y=d3.scale.ordinal().domain(args.categorical_variables).rangeRoundBands([args.height-args.bottom-args.buffer,args.top],args.padding_percentage,args.outer_padding_percentage);args.scalefns.yf=function(di){return args.scales.Y(di[args.y_accessor]);}
|
252
|
+
var svg=d3.select($(args.target).find('svg').get(0));var $svg=$($(args.target).find('svg').get(0));$svg.find('.y-axis').remove();var g=svg.append('g').classed('y-axis',true).classed('y-axis-small',args.use_small_class);if(!args.y_axis)return this;g.selectAll('text').data(args.categorical_variables).enter().append('svg:text').attr('x',args.left).attr('y',function(d){return args.scales.Y(d)+args.scales.Y.rangeBand()/2
|
253
|
+
+(args.buffer)*args.outer_padding_percentage;}).attr('dy','.35em').attr('text-anchor','end').text(String)
|
254
|
+
return this;}
|
255
|
+
function x_rug(args){'use strict';var buffer_size=args.chart_type=='point'?args.buffer/2:args.buffer;var svg=d3.select($(args.target).find('svg').get(0));var all_data=[];for(var i=0;i<args.data.length;i++){for(var j=0;j<args.data[i].length;j++){all_data.push(args.data[i][j]);}}
|
256
|
+
var rug=svg.selectAll('line.x_rug').data(all_data).enter().append('svg:line').attr('x1',args.scalefns.xf).attr('x2',args.scalefns.xf).attr('y1',args.height-args.top+buffer_size).attr('y2',args.height-args.top).attr('class','x-rug').attr('opacity',0.3);if(args.color_accessor){rug.attr('stroke',args.scalefns.color);}
|
257
|
+
else{rug.classed('x-rug-mono',true);}}
|
258
|
+
function x_axis(args){'use strict';var svg=d3.select($(args.target).find('svg').get(0));var $svg=$($(args.target).find('svg').get(0));var g;var min_x;var max_x;args.scalefns.xf=function(di){return args.scales.X(di[args.x_accessor]);}
|
259
|
+
if(args.chart_type=='point'){var min_size,max_size,min_color,max_color,size_range,color_range,size_domain,color_domain;if(args.color_accessor!=null){if(args.color_domain==null){if(args.color_type=='number'){min_color=d3.min(args.data[0],function(d){return d[args.color_accessor]});max_color=d3.max(args.data[0],function(d){return d[args.color_accessor]});color_domain=[min_color,max_color];}
|
260
|
+
else if(args.color_type=='category'){color_domain=d3.set(args.data[0].map(function(d){return d[args.color_accessor];})).values();color_domain.sort();}}
|
261
|
+
else{color_domain=args.color_domain;}
|
262
|
+
if(args.color_range==null){if(args.color_type=='number'){color_range=['blue','red'];}else{color_range=null;}}else{color_range=args.color_range;}
|
263
|
+
if(args.color_type=='number'){args.scales.color=d3.scale.linear().domain(color_domain).range(color_range).clamp(true);}else{args.scales.color=args.color_range!=null?d3.scale.ordinal().range(color_range):(color_domain.length>10?d3.scale.category20():d3.scale.category10());args.scales.color.domain(color_domain);}
|
264
|
+
args.scalefns.color=function(di){return args.scales.color(di[args.color_accessor]);};}
|
265
|
+
if(args.size_accessor!=null){if(args.size_domain==null){min_size=d3.min(args.data[0],function(d){return d[args.size_accessor]});max_size=d3.max(args.data[0],function(d){return d[args.size_accessor];});size_domain=[min_size,max_size];}else{size_domain=args.size_domain;}
|
266
|
+
if(args.size_range==null){size_range=[1,5];}else{size_range=args.size_range;}
|
267
|
+
args.scales.size=d3.scale.linear().domain(size_domain).range(size_range).clamp(true);args.scalefns.size=function(di){return args.scales.size(di[args.size_accessor]);};}}
|
268
|
+
var last_i;if(args.chart_type=='line'){for(var i=0;i<args.data.length;i++){last_i=args.data[i].length-1;if(args.data[i][0][args.x_accessor]<min_x||!min_x)
|
269
|
+
min_x=args.data[i][0][args.x_accessor];if(args.data[i][last_i][args.x_accessor]>max_x||!max_x)
|
270
|
+
max_x=args.data[i][last_i][args.x_accessor];}}
|
271
|
+
else if(args.chart_type=='point'){max_x=d3.max(args.data[0],function(d){return d[args.x_accessor]});min_x=d3.min(args.data[0],function(d){return d[args.x_accessor]});}
|
272
|
+
else if(args.chart_type=='histogram'){min_x=d3.min(args.data[0],function(d){return d[args.x_accessor]});max_x=d3.max(args.data[0],function(d){return d[args.x_accessor]});args.xax_format=function(f){if(f<1.0){return args.yax_units+d3.round(f,args.decimals);}
|
273
|
+
else{var pf=d3.formatPrefix(f);return args.xax_units+pf.scale(f)+pf.symbol;}}}
|
274
|
+
else if(args.chart_type=='bar'){min_x=0;max_x=d3.max(args.data[0],function(d){var trio=[];trio.push(d[args.x_accessor]);if(args.baseline_accessor!=null){trio.push(d[args.baseline_accessor]);};if(args.predictor_accessor!=null){trio.push(d[args.predictor_accessor]);}
|
275
|
+
return Math.max.apply(null,trio);});args.xax_format=function(f){if(f<1.0){return args.yax_units+d3.round(f,args.decimals);}
|
276
|
+
else{var pf=d3.formatPrefix(f);return args.xax_units+pf.scale(f)+pf.symbol;}}}
|
277
|
+
min_x=args.min_x?args.min_x:min_x;max_x=args.max_x?args.max_x:max_x;args.x_axis_negative=false;if(!args.time_series){if(min_x<0){min_x=min_x-(max_x*(args.inflator-1));args.x_axis_negative=true;}}
|
278
|
+
var additional_buffer;if(args.chart_type=='bar'){additional_buffer=args.buffer*5;}else{additional_buffer=0;}
|
279
|
+
args.scales.X=(args.time_series)?d3.time.scale():d3.scale.linear();args.scales.X.domain([min_x,max_x]).range([args.left+args.buffer,args.width-args.right-args.buffer-additional_buffer]);$svg.find('.x-axis').remove();if(!args.x_axis)return this;g=svg.append('g').classed('x-axis',true).classed('x-axis-small',args.use_small_class);var last_i=args.scales.X.ticks(args.xax_count).length-1;if(args.x_label){g.append('text').attr('class','label').attr('x',function(){return args.left+args.buffer
|
280
|
+
+((args.width-args.right-args.buffer)
|
281
|
+
-(args.left+args.buffer))/2;}).attr('y',(args.height-args.bottom/2).toFixed(2)).attr('dy','.50em').attr('text-anchor','middle').text(function(d){return args.x_label;})}
|
282
|
+
if(args.chart_type!='bar'&&!args.x_extended_ticks&&!args.y_extended_ticks){g.append('line').attr('x1',(args.concise==false||args.xax_count==0)?args.left+args.buffer:(args.scales.X(args.scales.X.ticks(args.xax_count)[0])).toFixed(2)).attr('x2',(args.concise==false||args.xax_count==0)?args.width-args.right-args.buffer:(args.scales.X(args.scales.X.ticks(args.xax_count)[last_i])).toFixed(2)).attr('y1',args.height-args.bottom).attr('y2',args.height-args.bottom);}
|
283
|
+
g.selectAll('.xax-ticks').data(args.scales.X.ticks(args.xax_count)).enter().append('line').attr('x1',function(d){return args.scales.X(d).toFixed(2);}).attr('x2',function(d){return args.scales.X(d).toFixed(2);}).attr('y1',args.height-args.bottom).attr('y2',function(){return(args.x_extended_ticks)?args.top:args.height-args.bottom+args.xax_tick_length;}).attr('class',function(){if(args.x_extended_ticks)
|
284
|
+
return'extended-x-ticks';});g.selectAll('.xax-labels').data(args.scales.X.ticks(args.xax_count)).enter().append('text').attr('x',function(d){return args.scales.X(d).toFixed(2);}).attr('y',(args.height-args.bottom+args.xax_tick_length*7/3).toFixed(2)).attr('dy','.50em').attr('text-anchor','middle').text(function(d){return args.xax_units+args.xax_format(d);})
|
285
|
+
if(args.time_series&&args.show_years){var min_x;var max_x;for(var i=0;i<args.data.length;i++){last_i=args.data[i].length-1;if(args.data[i][0][args.x_accessor]<min_x||!min_x)
|
286
|
+
min_x=args.data[i][0][args.x_accessor];if(args.data[i][last_i][args.x_accessor]>max_x||!max_x)
|
287
|
+
max_x=args.data[i][last_i][args.x_accessor];}
|
288
|
+
var years=d3.time.years(min_x,max_x);if(years.length==0){var first_tick=args.scales.X.ticks(args.xax_count)[0];years=[first_tick];}
|
289
|
+
g=g.append('g').classed('year-marker',true).classed('year-marker-small',args.use_small_class);g.selectAll('.year_marker').data(years).enter().append('line').attr('x1',function(d){return args.scales.X(d).toFixed(2);}).attr('x2',function(d){return args.scales.X(d).toFixed(2);}).attr('y1',args.top).attr('y2',args.height-args.bottom);var yformat=d3.time.format('%Y');g.selectAll('.year_marker').data(years).enter().append('text').attr('x',function(d){return args.scales.X(d).toFixed(2);}).attr('y',(args.height-args.bottom+args.xax_tick_length*7/1.3).toFixed(2)).attr('dy',args.use_small_class?-3:0).attr('text-anchor','middle').text(function(d){return yformat(d);});};if(args.x_rug){x_rug(args);}
|
290
|
+
return this;}
|
291
|
+
function init(args){'use strict';var defaults={target:null,title:null,description:null};var args=arguments[0];if(!args){args={};}
|
292
|
+
args=merge_with_defaults(args,defaults);if($.type(args.data[0][0][args.x_accessor])=='date'){args.time_series=true;}
|
293
|
+
else{args.time_series=false;}
|
294
|
+
var linked;var svg_width=args.width;var svg_height=args.height;if(args.chart_type=='bar'&&svg_height==null){svg_height=args.height=args.data[0].length*args.bar_height+args.top+args.bottom;}
|
295
|
+
var svg=$(args.target).find('svg');if((svg.find('.main-line').length>0&&args.chart_type!='line')||(svg.find('.points').length>0&&args.chart_type!='point')||(svg.find('.histogram').length>0&&args.chart_type!='histogram')||(svg.find('.barplot').length>0&&args.chart_type!='bar')){$(args.target).empty();}
|
296
|
+
if($.trim($(args.target).html())==''){d3.select(args.target).append('svg').classed('linked',args.linked).attr('width',svg_width).attr('height',svg_height);}
|
297
|
+
var svg=d3.select(args.target).selectAll('svg');if(args.width!=Number(svg.attr('width')))
|
298
|
+
svg.attr('width',args.width)
|
299
|
+
if(args.height!=Number(svg.attr('height')))
|
300
|
+
svg.attr('height',args.height)
|
301
|
+
svg.classed('missing',false);svg.selectAll('.missing-text').remove();chart_title(args);args.use_small_class=args.height-args.top-args.bottom-args.buffer<=args.small_height_threshold&&args.width-args.left-args.right-args.buffer*2<=args.small_width_threshold||args.small_text;if(args.data.length<$(args.target).find('svg .main-line').length){if(args.custom_line_color_map.length>0){var array_full_series=function(len){var arr=new Array(len);for(var i=0;i<arr.length;i++){arr[i]=i+1;}
|
302
|
+
return arr;}
|
303
|
+
var lines_to_remove=arrDiff(array_full_series(args.max_data_size),args.custom_line_color_map);for(var i=0;i<lines_to_remove.length;i++){$(args.target).find('svg .main-line.line'+lines_to_remove[i]+'-color').remove();}}
|
304
|
+
else{var num_of_new=args.data.length;var num_of_existing=$(args.target).find('svg .main-line').length;for(var i=num_of_existing;i>num_of_new;i--){$(args.target).find('svg .main-line.line'+i+'-color').remove();}}}
|
305
|
+
return this;}
|
306
|
+
function markers(args){'use strict';var svg=d3.select($(args.target).find('svg').get(0));var gm;var gb;if(args.markers){$(args.target).find('svg .markers').remove();gm=svg.append('g').attr('class','markers');gm.selectAll('.markers').data(args.markers.filter(function(d){return(args.scales.X(d[args.x_accessor])>args.buffer+args.left)&&(args.scales.X(d[args.x_accessor])<args.width-args.buffer-args.right);})).enter().append('line').attr('x1',function(d){return args.scales.X(d[args.x_accessor]).toFixed(2);}).attr('x2',function(d){return args.scales.X(d[args.x_accessor]).toFixed(2);}).attr('y1',args.top).attr('y2',function(){return args.height-args.bottom-args.buffer;}).attr('stroke-dasharray','3,1');gm.selectAll('.markers').data(args.markers.filter(function(d){return(args.scales.X(d[args.x_accessor])>args.buffer+args.left)&&(args.scales.X(d[args.x_accessor])<args.width-args.buffer-args.right);})).enter().append('text').attr('x',function(d){return args.scales.X(d[args.x_accessor])}).attr('y',args.top-8).attr('text-anchor','middle').text(function(d){return d['label'];});}
|
307
|
+
if(args.baselines){svg.selectAll('.baselines').remove();gb=svg.append('g').attr('class','baselines');gb.selectAll('.baselines').data(args.baselines).enter().append('line').attr('x1',args.left+args.buffer).attr('x2',args.width-args.right-args.buffer).attr('y1',function(d){return args.scales.Y(d['value']).toFixed(2);}).attr('y2',function(d){return args.scales.Y(d['value']).toFixed(2);});gb.selectAll('.baselines').data(args.baselines).enter().append('text').attr('x',args.width-args.right-args.buffer).attr('y',function(d){return args.scales.Y(d['value']).toFixed(2);}).attr('dy',-3).attr('text-anchor','end').text(function(d){return d['label'];});}
|
308
|
+
return this;}
|
309
|
+
if(typeof jQuery==='undefined'){throw new Error('Bootstrap\'s JavaScript requires jQuery')}
|
310
|
+
+function($){var version=$.fn.jquery.split(' ')[0].split('.')
|
311
|
+
if((version[0]<2&&version[1]<9)||(version[0]==1&&version[1]==9&&version[2]<1)){throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')}}(jQuery);+function($){'use strict';if(typeof $().dropdown=='function')
|
312
|
+
return true;var backdrop='.dropdown-backdrop'
|
313
|
+
var toggle='[data-toggle="dropdown"]'
|
314
|
+
var Dropdown=function(element){$(element).on('click.bs.dropdown',this.toggle)}
|
315
|
+
Dropdown.VERSION='3.3.1'
|
316
|
+
Dropdown.prototype.toggle=function(e){var $this=$(this)
|
317
|
+
if($this.is('.disabled, :disabled'))return
|
318
|
+
var $parent=getParent($this)
|
319
|
+
var isActive=$parent.hasClass('open')
|
320
|
+
clearMenus()
|
321
|
+
if(!isActive){if('ontouchstart'in document.documentElement&&!$parent.closest('.navbar-nav').length){$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click',clearMenus)}
|
322
|
+
var relatedTarget={relatedTarget:this}
|
323
|
+
$parent.trigger(e=$.Event('show.bs.dropdown',relatedTarget))
|
324
|
+
if(e.isDefaultPrevented())return
|
325
|
+
$this.trigger('focus').attr('aria-expanded','true')
|
326
|
+
$parent.toggleClass('open').trigger('shown.bs.dropdown',relatedTarget)}
|
327
|
+
return false}
|
328
|
+
Dropdown.prototype.keydown=function(e){if(!/(38|40|27|32)/.test(e.which)||/input|textarea/i.test(e.target.tagName))return
|
329
|
+
var $this=$(this)
|
330
|
+
e.preventDefault()
|
331
|
+
e.stopPropagation()
|
332
|
+
if($this.is('.disabled, :disabled'))return
|
333
|
+
var $parent=getParent($this)
|
334
|
+
var isActive=$parent.hasClass('open')
|
335
|
+
if((!isActive&&e.which!=27)||(isActive&&e.which==27)){if(e.which==27)$parent.find(toggle).trigger('focus')
|
336
|
+
return $this.trigger('click')}
|
337
|
+
var desc=' li:not(.divider):visible a'
|
338
|
+
var $items=$parent.find('[role="menu"]'+desc+', [role="listbox"]'+desc)
|
339
|
+
if(!$items.length)return
|
340
|
+
var index=$items.index(e.target)
|
341
|
+
if(e.which==38&&index>0)index--
|
342
|
+
if(e.which==40&&index<$items.length-1)index++
|
343
|
+
if(!~index)index=0
|
344
|
+
$items.eq(index).trigger('focus')}
|
345
|
+
function clearMenus(e){if(e&&e.which===3)return
|
346
|
+
$(backdrop).remove()
|
347
|
+
$(toggle).each(function(){var $this=$(this)
|
348
|
+
var $parent=getParent($this)
|
349
|
+
var relatedTarget={relatedTarget:this}
|
350
|
+
if(!$parent.hasClass('open'))return
|
351
|
+
$parent.trigger(e=$.Event('hide.bs.dropdown',relatedTarget))
|
352
|
+
if(e.isDefaultPrevented())return
|
353
|
+
$this.attr('aria-expanded','false')
|
354
|
+
$parent.removeClass('open').trigger('hidden.bs.dropdown',relatedTarget)})}
|
355
|
+
function getParent($this){var selector=$this.attr('data-target')
|
356
|
+
if(!selector){selector=$this.attr('href')
|
357
|
+
selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,'')}
|
358
|
+
var $parent=selector&&$(selector)
|
359
|
+
return $parent&&$parent.length?$parent:$this.parent()}
|
360
|
+
function Plugin(option){return this.each(function(){var $this=$(this)
|
361
|
+
var data=$this.data('bs.dropdown')
|
362
|
+
if(!data)$this.data('bs.dropdown',(data=new Dropdown(this)))
|
363
|
+
if(typeof option=='string')data[option].call($this)})}
|
364
|
+
var old=$.fn.dropdown
|
365
|
+
$.fn.dropdown=Plugin
|
366
|
+
$.fn.dropdown.Constructor=Dropdown
|
367
|
+
$.fn.dropdown.noConflict=function(){$.fn.dropdown=old
|
368
|
+
return this}
|
369
|
+
$(document).on('click.bs.dropdown.data-api',clearMenus).on('click.bs.dropdown.data-api','.dropdown form',function(e){e.stopPropagation()}).on('click.bs.dropdown.data-api',toggle,Dropdown.prototype.toggle).on('keydown.bs.dropdown.data-api',toggle,Dropdown.prototype.keydown).on('keydown.bs.dropdown.data-api','[role="menu"]',Dropdown.prototype.keydown).on('keydown.bs.dropdown.data-api','[role="listbox"]',Dropdown.prototype.keydown)}(jQuery);var button_layout=function(target){'use strict';this.target=target;this.feature_set={};this.public_name={};this.sorters={};this.manual=[];this.manual_map={};this.manual_callback={};this._strip_punctuation=function(s){var punctuationless=s.replace(/[^a-zA-Z0-9 _]+/g,'');var finalString=punctuationless.replace(/ +?/g,"");return finalString;}
|
370
|
+
this.data=function(data){this._data=data;return this;}
|
371
|
+
this.manual_button=function(feature,feature_set,callback){this.feature_set[feature]=feature_set;this.manual_map[this._strip_punctuation(feature)]=feature;this.manual_callback[feature]=callback;return this;}
|
372
|
+
this.button=function(feature){var sorter,the_label;if(arguments.length>1){this.public_name[feature]=arguments[1];}
|
373
|
+
if(arguments.length>2){this.sorters[feature]=arguments[2];}
|
374
|
+
this.feature_set[feature]=[];return this;}
|
375
|
+
this.callback=function(callback){this._callback=callback;return this;}
|
376
|
+
this.display=function(){var callback=this._callback;var manual_callback=this.manual_callback;var manual_map=this.manual_map;var d,f,features,feat;features=Object.keys(this.feature_set);for(var i=0;i<this._data.length;i++){d=this._data[i];f=features.map(function(f){return d[f]});for(var j=0;j<features.length;j++){feat=features[j];if(this.feature_set[feat].indexOf(f[j])==-1)this.feature_set[feat].push(f[j]);}}
|
377
|
+
for(var feat in this.feature_set){if(this.sorters.hasOwnProperty(feat)){this.feature_set[feat].sort(this.sorters[feat]);}}
|
378
|
+
$(this.target).empty();$(this.target).append("<div class='col-lg-12 segments text-center'></div>");var the_string='';for(var feature in this.feature_set){features=this.feature_set[feature];$(this.target+' div.segments').append('<div class="btn-group '+this._strip_punctuation(feature)+'-btns text-left">'+'<button type="button" class="btn btn-default btn-lg dropdown-toggle" data-toggle="dropdown">'+"<span class='which-button'>"+(this.public_name.hasOwnProperty(feature)?this.public_name[feature]:feature)+"</span>"+"<span class='title'>"+(this.manual_callback.hasOwnProperty(feature)?this.feature_set[feature][0]:'all')+"</span>"+'<span class="caret"></span>'+'</button>'+'<ul class="dropdown-menu" role="menu">'+
|
379
|
+
(!this.manual_callback.hasOwnProperty(feature)?'<li><a href="#" data-feature="'+feature+'" data-key="all">All</a></li>':"")+
|
380
|
+
(!this.manual_callback.hasOwnProperty(feature)?'<li class="divider"></li>':"")+'</ul>'
|
381
|
+
+'</div>');for(var i=0;i<features.length;i++){if(features[i]!='all'&&features[i]!=undefined){$(this.target+' div.'+this._strip_punctuation(feature)+'-btns ul.dropdown-menu').append('<li><a href="#" data-feature="'+this._strip_punctuation(feature)+'" data-key="'+features[i]+'">'
|
382
|
+
+features[i]+'</a></li>');}}
|
383
|
+
$('.'+this._strip_punctuation(feature)+'-btns .dropdown-menu li a').on('click',function(){var k=$(this).data('key');var feature=$(this).data('feature');var manual_feature;$('.'+this._strip_punctuation(feature)+'-btns button.btn span.title').html(k);if(!manual_map.hasOwnProperty(feature)){callback(feature,k);}else{manual_feature=manual_map[feature];manual_callback[manual_feature](k);}
|
384
|
+
return false;})}
|
385
|
+
return this;}
|
386
|
+
return this}
|
387
|
+
charts.line=function(args){'use strict';this.args=args;this.init=function(args){raw_data_transformation(args);process_line(args);init(args);x_axis(args);y_axis(args);return this;}
|
388
|
+
this.mainPlot=function(){var svg=d3.select($(args.target).find('svg').get(0));var g;var data_median=0;var area=d3.svg.area().x(args.scalefns.xf).y0(args.scales.Y.range()[0]).y1(args.scalefns.yf).interpolate(args.interpolate);var confidence_area;if(args.show_confidence_band){var confidence_area=d3.svg.area().x(args.scalefns.xf).y0(function(d){var l=args.show_confidence_band[0];return args.scales.Y(d[l]);}).y1(function(d){var u=args.show_confidence_band[1];return args.scales.Y(d[u]);}).interpolate(args.interpolate);}
|
389
|
+
var line=d3.svg.line().x(args.scalefns.xf).y(args.scalefns.yf).interpolate(args.interpolate);var flat_line=d3.svg.line().x(args.scalefns.xf).y(function(){return args.scales.Y(data_median);}).interpolate(args.interpolate);var legend='';var this_data;for(var i=args.data.length-1;i>=0;i--){this_data=args.data[i];var line_id=i+1;if(args.custom_line_color_map.length>0){line_id=args.custom_line_color_map[i];}
|
390
|
+
if(args.show_confidence_band){svg.append('path').attr('class','confidence-band').attr('d',confidence_area(args.data[i]));}
|
391
|
+
var $area=$(args.target).find('svg path.area'+(line_id)+'-color');if(args.area&&!args.use_data_y_min&&!args.y_axis_negative&&args.data.length<=1){if($area.length>0){d3.selectAll($(args.target).find('svg path.area'+(line_id)+'-color')).transition().duration(function(){return(args.transition_on_update)?1000:0;}).attr('d',area(args.data[i]));}
|
392
|
+
else{svg.append('path').attr('class','main-area '+'area'+(line_id)+'-color').attr('d',area(args.data[i]));}}else if($area.length>0){$area.remove();}
|
393
|
+
if($(args.target).find('svg path.line'+(line_id)+'-color').length>0){d3.selectAll($(args.target).find('svg path.line'+(line_id)+'-color')).transition().duration(function(){return(args.transition_on_update)?1000:0;}).attr('d',line(args.data[i]));}
|
394
|
+
else{if(args.animate_on_load){data_median=d3.median(args.data[i],function(d){return d[args.y_accessor];})
|
395
|
+
svg.append('path').attr('class','main-line '+'line'+(line_id)+'-color').attr('d',flat_line(args.data[i])).transition().duration(1000).attr('d',line(args.data[i]));}
|
396
|
+
else{svg.append('path').attr('class','main-line '+'line'+(line_id)+'-color').attr('d',line(args.data[i]));}}
|
397
|
+
if(args.legend){legend="<span class='line"+line_id+"-legend-color'>— "
|
398
|
+
+args.legend[i]+" </span>"+legend;}}
|
399
|
+
if(args.legend){$(args.legend_target).html(legend);}
|
400
|
+
return this;}
|
401
|
+
this.markers=function(){markers(args);return this;};this.rollover=function(){var svg=d3.select($(args.target).find('svg').get(0));var $svg=$($(args.target).find('svg').get(0));var g;$svg.find('.transparent-rollover-rect').remove();$svg.find('.voronoi').remove();$svg.find('.active_datapoint').remove();$svg.find('.line_rollover_circle').remove();svg.append('text').attr('class','active_datapoint').classed('active-datapoint-small',args.use_small_class).attr('xml:space','preserve').attr('x',args.width-args.right).attr('y',args.top/2).attr('text-anchor','end');svg.append('circle').classed('line_rollover_circle',true).attr('cx',0).attr('cy',0).attr('r',0);var line_id=1;for(var i=0;i<args.data.length;i++){for(var j=0;j<args.data[i].length;j++){if(args.custom_line_color_map.length>0){args.data[i][j]['line_id']=args.custom_line_color_map[i];}
|
402
|
+
else{args.data[i][j]['line_id']=line_id;}}
|
403
|
+
line_id++;}
|
404
|
+
if(args.data.length>1){var voronoi=d3.geom.voronoi().x(function(d){return args.scales.X(d[args.x_accessor]).toFixed(2);}).y(function(d){return args.scales.Y(d[args.y_accessor]).toFixed(2);}).clipExtent([[args.buffer,args.buffer],[args.width-args.buffer,args.height-args.buffer]]);var g=svg.append('g').attr('class','voronoi')
|
405
|
+
var data_nested=d3.nest().key(function(d){return args.scales.X(d[args.x_accessor])+","
|
406
|
+
+args.scales.Y(d[args.y_accessor]);}).rollup(function(v){return v[0];}).entries(d3.merge(args.data.map(function(d){return d;}))).map(function(d){return d.values;});g.selectAll('path').data(voronoi(data_nested)).enter().append('path').attr("d",function(d){return"M"+d.join("L")+"Z";}).datum(function(d){return d.point;}).attr('class',function(d){if(args.linked){var v=d[args.x_accessor];var formatter=d3.time.format('%Y-%m-%d');var id=(typeof v==='number')?i:formatter(v);return'line'+d['line_id']+'-color '+'roll_'+id;}
|
407
|
+
else{return'line'+d['line_id']+'-color';}}).on('mouseover',this.rolloverOn(args)).on('mouseout',this.rolloverOff(args));}
|
408
|
+
else{var line_id=1;if(args.custom_line_color_map.length>0){line_id=args.custom_line_color_map[0];}
|
409
|
+
var g=svg.append('g').attr('class','transparent-rollover-rect')
|
410
|
+
var xf=args.data[0].map(args.scalefns.xf);g.selectAll('.rollover-rects').data(args.data[0]).enter().append('rect').attr('class',function(d,i){if(args.linked){var v=d[args.x_accessor];var formatter=d3.time.format('%Y-%m-%d');var id=(typeof v==='number')?i:formatter(v);return'line'+line_id+'-color '+'roll_'+id;}
|
411
|
+
else{return'line'+line_id+'-color';}}).attr('x',function(d,i){if(i==0){return xf[i].toFixed(2);}else{return((xf[i-1]+xf[i])/2).toFixed(2);}}).attr('y',function(d,i){return(args.data.length>1)?args.scalefns.yf(d)-6:args.top;}).attr('width',function(d,i){if(i==0){return((xf[i+1]-xf[i])/2).toFixed(2);}
|
412
|
+
else if(i==xf.length-1){return((xf[i]-xf[i-1])/2).toFixed(2);}
|
413
|
+
else{return((xf[i+1]-xf[i-1])/2).toFixed(2);}}).attr('height',function(d,i){return(args.data.length>1)?12:args.height-args.bottom-args.top-args.buffer;}).attr('opacity',0).on('mouseover',this.rolloverOn(args)).on('mouseout',this.rolloverOff(args));}
|
414
|
+
return this;}
|
415
|
+
this.rolloverOn=function(args){var svg=d3.select($(args.target).find('svg').get(0));var x_formatter=d3.time.format('%Y-%m-%d');return function(d,i){svg.selectAll('circle.line_rollover_circle').attr('class',"").attr('class','area'+d['line_id']+'-color').classed('line_rollover_circle',true).attr('cx',function(){return args.scales.X(d[args.x_accessor]).toFixed(2);}).attr('cy',function(){return args.scales.Y(d[args.y_accessor]).toFixed(2);}).attr('r',args.point_size).style('opacity',1);if(args.linked&&!globals.link){globals.link=true;var v=d[args.x_accessor];var formatter=d3.time.format('%Y-%m-%d');var id=(typeof v==='number')?i:formatter(v);d3.selectAll('.line'+d['line_id']+'-color.roll_'+id).each(function(d,i){d3.select(this).on('mouseover')(d,i);})}
|
416
|
+
svg.selectAll('text').filter(function(g,j){return d==g;}).attr('opacity',0.3);var fmt=d3.time.format('%b %e, %Y');if(args.format=='count'){var num=function(d_){var is_float=d_%1!=0;var n=d3.format("0,000");d_=is_float?d3.round(d_,args.decimals):d_;return n(d_);}}
|
417
|
+
else{var num=function(d_){var fmt_string=(args.decimals?'.'+args.decimals:'')+'%';var n=d3.format(fmt_string);return n(d_);}}
|
418
|
+
if(args.show_rollover_text){svg.select('.active_datapoint').text(function(){if(args.time_series){var dd=new Date(+d[args.x_accessor]);dd.setDate(dd.getDate());return fmt(dd)+' '+args.yax_units
|
419
|
+
+num(d[args.y_accessor]);}
|
420
|
+
else{return args.x_accessor+': '+d[args.x_accessor]
|
421
|
+
+', '+args.y_accessor+': '+args.yax_units
|
422
|
+
+num(d[args.y_accessor]);}});}
|
423
|
+
if(args.rollover_callback){args.rollover_callback(d,i);}}}
|
424
|
+
this.rolloverOff=function(args){var svg=d3.select($(args.target).find('svg').get(0));return function(d,i){if(args.linked&&globals.link){globals.link=false;var v=d[args.x_accessor];var formatter=d3.time.format('%Y-%m-%d');var id=(typeof v==='number')?i:formatter(v);d3.selectAll('.roll_'+id).each(function(d,i){d3.select(this).on('mouseout')(d);});}
|
425
|
+
svg.selectAll('circle.line_rollover_circle').style('opacity',0);svg.select('.active_datapoint').text('');}}
|
426
|
+
this.init(args);return this;}
|
427
|
+
charts.histogram=function(args){'use strict';this.args=args;this.init=function(args){raw_data_transformation(args);process_histogram(args);init(args);x_axis(args);y_axis(args);return this;}
|
428
|
+
this.mainPlot=function(){var svg=d3.select($(args.target).find('svg').get(0));var $svg=$($(args.target).find('svg').get(0));var g;$svg.find('.histogram').remove();var g=svg.append("g").attr("class","histogram");var bar=g.selectAll(".bar").data(args.data[0]).enter().append("g").attr("class","bar").attr("transform",function(d){return"translate("+args.scales.X(d[args.x_accessor]).toFixed(2)
|
429
|
+
+","+args.scales.Y(d[args.y_accessor]).toFixed(2)+")";});bar.append("rect").attr("x",1).attr("width",function(d,i){return(args.scalefns.xf(args.data[0][1])
|
430
|
+
-args.scalefns.xf(args.data[0][0])
|
431
|
+
-args.bar_margin).toFixed(2);}).attr("height",function(d){if(d[args.y_accessor]==0)
|
432
|
+
return 0;return(args.height-args.bottom-args.buffer
|
433
|
+
-args.scales.Y(d[args.y_accessor])).toFixed(2);});return this;}
|
434
|
+
this.markers=function(){markers(args);return this;};this.rollover=function(){var svg=d3.select($(args.target).find('svg').get(0));var $svg=$($(args.target).find('svg').get(0));var g;$svg.find('.transparent-rollover-rect').remove();$svg.find('.active_datapoint').remove();svg.append('text').attr('class','active_datapoint').attr('xml:space','preserve').attr('x',args.width-args.right).attr('y',args.top/2).attr('text-anchor','end');var g=svg.append('g').attr('class','transparent-rollover-rect')
|
435
|
+
var bar=g.selectAll(".bar").data(args.data[0]).enter().append("g").attr("class","rollover-rects").attr("transform",function(d){return"translate("+(args.scales.X(d[args.x_accessor]))+","+0+")";});bar.append("rect").attr("x",1).attr("y",0).attr("width",function(d,i){if(i!=args.data[0].length-1){return(args.scalefns.xf(args.data[0][i+1])
|
436
|
+
-args.scalefns.xf(d)).toFixed(2);}
|
437
|
+
else{return(args.scalefns.xf(args.data[0][1])
|
438
|
+
-args.scalefns.xf(args.data[0][0])).toFixed(2);}}).attr("height",function(d){return args.height;}).attr('opacity',0).on('mouseover',this.rolloverOn(args)).on('mouseout',this.rolloverOff(args));}
|
439
|
+
this.rolloverOn=function(args){var svg=d3.select($(args.target).find('svg').get(0));var x_formatter=d3.time.format('%Y-%m-%d');return function(d,i){svg.selectAll('text').filter(function(g,j){return d==g;}).attr('opacity',0.3);var fmt=d3.time.format('%b %e, %Y');if(args.format=='count'){var num=function(d_){var is_float=d_%1!=0;var n=d3.format("0,000");d_=is_float?d3.round(d_,args.decimals):d_;return n(d_);}}
|
440
|
+
else{var num=function(d_){var fmt_string=(args.decimals?'.'+args.decimals:'')+'%';var n=d3.format(fmt_string);return n(d_);}}
|
441
|
+
d3.selectAll($(args.target).find(' svg .bar :eq('+i+')')).classed('active',true);if(args.show_rollover_text){svg.select('.active_datapoint').text(function(){if(args.time_series){var dd=new Date(+d[args.x_accessor]);dd.setDate(dd.getDate());return fmt(dd)+' '+args.yax_units
|
442
|
+
+num(d[args.y_accessor]);}
|
443
|
+
else{return args.x_accessor+': '+num(d[args.x_accessor])
|
444
|
+
+', '+args.y_accessor+': '+args.yax_units
|
445
|
+
+num(d[args.y_accessor]);}});}
|
446
|
+
if(args.rollover_callback){args.rollover_callback(d,i);}}}
|
447
|
+
this.rolloverOff=function(args){var svg=d3.select($(args.target).find('svg').get(0));return function(d,i){d3.selectAll($(args.target).find('svg .bar :eq('+i+')')).classed('active',false);svg.select('.active_datapoint').text('');}}
|
448
|
+
this.init(args);return this;}
|
449
|
+
charts.point=function(args){'use strict';this.args=args;this.init=function(args){raw_data_transformation(args);process_point(args);init(args);x_axis(args);y_axis(args);return this;}
|
450
|
+
this.markers=function(){markers(args);if(args.least_squares){add_ls(args);}
|
451
|
+
return this}
|
452
|
+
this.mainPlot=function(){var svg=d3.select($(args.target).find('svg').get(0));var $svg=$($(args.target).find('svg').get(0));var g;$svg.find('.points').remove();g=svg.append('g').classed('points',true);var pts=g.selectAll('circle').data(args.data[0]).enter().append('svg:circle').attr('class',function(d,i){return'path-'+i;}).attr('cx',args.scalefns.xf).attr('cy',args.scalefns.yf);if(args.color_accessor!=null){pts.attr('fill',args.scalefns.color);pts.attr('stroke',args.scalefns.color);}
|
453
|
+
else{pts.classed('points-mono',true);}
|
454
|
+
if(args.size_accessor!=null){pts.attr('r',args.scalefns.size);}
|
455
|
+
else{pts.attr('r',args.point_size);}
|
456
|
+
return this;}
|
457
|
+
this.rollover=function(){var svg=d3.select($(args.target).find('svg').get(0));var $svg=$($(args.target).find('svg').get(0));$svg.find('.voronoi').remove();$svg.find('.active_datapoint').remove();svg.append('text').attr('class','active_datapoint').attr('xml:space','preserve').attr('x',args.width-args.right).attr('y',args.top/2).attr('text-anchor','end');var voronoi=d3.geom.voronoi().x(args.scalefns.xf).y(args.scalefns.yf).clipExtent([[args.buffer,args.buffer],[args.width-args.buffer,args.height-args.buffer]]);var paths=svg.append('g').attr('class','voronoi');paths.selectAll('path').data(voronoi(args.data[0])).enter().append('path').attr('d',function(d){if(d==undefined)return;return'M'+d.join(',')+'Z';}).attr('class',function(d,i){return'path-'+i;}).style('fill-opacity',0).on('mouseover',this.rolloverOn(args)).on('mouseout',this.rolloverOff(args));return this;}
|
458
|
+
this.rolloverOn=function(args){var svg=d3.select($(args.target).find('svg').get(0));return function(d,i){svg.selectAll('.points circle').classed('selected',false);var pts=svg.selectAll('.points circle.path-'+i).classed('selected',true);if(args.size_accessor){pts.attr('r',function(di){return args.scalefns.size(di)+1});}else{pts.attr('r',args.point_size);}
|
459
|
+
if(args.linked&&!globals.link){globals.link=true;d3.selectAll('.voronoi .path-'+i).each(function(){d3.select(this).on('mouseover')(d,i);})}
|
460
|
+
var fmt=d3.time.format('%b %e, %Y');if(args.format=='count'){var num=function(d_){var is_float=d_%1!=0;var n=d3.format("0,000");d_=is_float?d3.round(d_,args.decimals):d_;return n(d_);}}
|
461
|
+
else{var num=function(d_){var fmt_string=(args.decimals?'.'+args.decimals:'')+'%';var n=d3.format(fmt_string);return n(d_);}}
|
462
|
+
if(args.show_rollover_text){svg.select('.active_datapoint').text(function(){if(args.time_series){var dd=new Date(+d['point'][args.x_accessor]);dd.setDate(dd.getDate());return fmt(dd)+' '+args.yax_units
|
463
|
+
+num(d['point'][args.y_accessor]);}
|
464
|
+
else{return args.x_accessor+': '+num(d['point'][args.x_accessor])
|
465
|
+
+', '+args.y_accessor+': '+args.yax_units
|
466
|
+
+num(d['point'][args.y_accessor]);}});}
|
467
|
+
if(args.rollover_callback){args.rollover_callback(d,i);}}}
|
468
|
+
this.rolloverOff=function(args){var svg=d3.select($(args.target).find('svg').get(0));return function(d,i){if(args.linked&&globals.link){globals.link=false;d3.selectAll('.voronoi .path-'+i).each(function(){d3.select(this).on('mouseout')(d,i);})}
|
469
|
+
var pts=svg.selectAll('.points circle').classed('unselected',false).classed('selected',false);if(args.size_accessor){pts.attr('r',args.scalefns.size);}
|
470
|
+
else{pts.attr('r',args.point_size);}
|
471
|
+
svg.select('.active_datapoint').text('');}}
|
472
|
+
this.update=function(args){return this;}
|
473
|
+
this.init(args);return this;}
|
474
|
+
charts.bar=function(args){'use strict';this.args=args;this.init=function(args){raw_data_transformation(args);process_categorical_variables(args);init(args);x_axis(args);y_axis_categorical(args);return this;}
|
475
|
+
this.mainPlot=function(){var svg=d3.select($(args.target).find('svg').get(0));var $svg=$($(args.target).find('svg').get(0));var g;$svg.find('.barplot').remove();var data=args.data[0];var g=svg.append('g').classed('barplot',true);var appropriate_height=args.scales.Y.rangeBand()/1.5;g.selectAll('.bar').data(data).enter().append('rect').classed('bar',true).attr('x',args.scales.X(0)).attr('y',function(d){return args.scalefns.yf(d)+appropriate_height/2;}).attr('height',appropriate_height).attr('width',function(d){return args.scalefns.xf(d)-args.scales.X(0)});if(args.predictor_accessor){var pp=args.predictor_proportion;var pp0=pp-1;g.selectAll('.prediction').data(data).enter().append("rect").attr('class','bar-prediction').attr('x',args.scales.X(0)).attr('y',function(d){return args.scalefns.yf(d)+pp0*appropriate_height/(pp*2)+appropriate_height/2;}).attr('height',appropriate_height/pp).attr('width',function(d){return args.scales.X(d[args.predictor_accessor])-args.scales.X(0);});}
|
476
|
+
if(args.baseline_accessor){g.selectAll('.baseline').data(data).enter().append("line").attr('class','bar-baseline').attr('x1',function(d){return args.scales.X(d[args.baseline_accessor])}).attr('x2',function(d){return args.scales.X(d[args.baseline_accessor])}).attr('y1',function(d){return args.scalefns.yf(d)+appropriate_height/2-appropriate_height/pp+appropriate_height/2;}).attr('y2',function(d){return args.scalefns.yf(d)+appropriate_height/2+appropriate_height/pp+appropriate_height/2;});}
|
477
|
+
return this;}
|
478
|
+
this.markers=function(){markers(args);return this;};this.rollover=function(){var svg=d3.select($(args.target).find('svg').get(0));var $svg=$($(args.target).find('svg').get(0));var g;$svg.find('.transparent-rollover-rect').remove();$svg.find('.active_datapoint').remove();svg.append('text').attr('class','active_datapoint').attr('xml:space','preserve').attr('x',args.width-args.right).attr('y',args.top/2).attr('dy','.35em').attr('text-anchor','end');var g=svg.append('g').attr('class','transparent-rollover-rect')
|
479
|
+
var bar=g.selectAll(".bar").data(args.data[0]).enter().append("rect").attr("x",args.scales.X(0)).attr("y",args.scalefns.yf).attr('width',args.width).attr('height',args.scales.Y.rangeBand()+2).attr('opacity',0).on('mouseover',this.rolloverOn(args)).on('mouseout',this.rolloverOff(args));}
|
480
|
+
this.rolloverOn=function(args){var svg=d3.select($(args.target).find('svg').get(0));var x_formatter=d3.time.format('%Y-%m-%d');return function(d,i){svg.selectAll('text').filter(function(g,j){return d==g;}).attr('opacity',0.3);var fmt=d3.time.format('%b %e, %Y');if(args.format=='count'){var num=function(d_){var is_float=d_%1!=0;var n=d3.format("0,000");d_=is_float?d3.round(d_,args.decimals):d_;return n(d_);}}
|
481
|
+
else{var num=function(d_){var fmt_string=(args.decimals?'.'+args.decimals:'')+'%';var n=d3.format(fmt_string);return n(d_);}}
|
482
|
+
d3.selectAll($(args.target+' svg g.barplot .bar:eq('+i+')')).classed('active',true);if(args.show_rollover_text){svg.select('.active_datapoint').text(function(){if(args.time_series){var dd=new Date(+d[args.x_accessor]);dd.setDate(dd.getDate());return fmt(dd)+' '+args.yax_units
|
483
|
+
+num(d[args.y_accessor]);}
|
484
|
+
else{return d[args.y_accessor]+': '+num(d[args.x_accessor]);}});}
|
485
|
+
if(args.rollover_callback){args.rollover_callback(d,i);}}}
|
486
|
+
this.rolloverOff=function(args){var svg=d3.select($(args.target).find('svg').get(0));return function(d,i){d3.selectAll($(args.target).find('svg g.barplot .bar:eq('+i+')')).classed('active',false);svg.select('.active_datapoint').text('');}}
|
487
|
+
this.init(args);return this;}
|
488
|
+
function data_table(args){'use strict';this.args=args;this.args.standard_col={width:150,font_size:12,font_weight:'normal'};this.args.columns=[];this.formatting_options=[['color','color'],['font-weight','font_weight'],['font-style','font_style'],['font-size','font_size']];this._strip_punctuation=function(s){var punctuationless=s.replace(/[^a-zA-Z0-9 _]+/g,'');var finalString=punctuationless.replace(/ +?/g,"");return finalString;}
|
489
|
+
this._format_element=function(element,value,args){this.formatting_options.forEach(function(fo){var attr=fo[0];var key=fo[1];if(args[key])element.style(attr,typeof args[key]=='string'||typeof args[key]=='number'?args[key]:args[key](value));});}
|
490
|
+
this._add_column=function(_args,arg_type){var standard_column=this.args.standard_col;var args=merge_with_defaults(clone(_args),clone(standard_column));args.type=arg_type;this.args.columns.push(args);}
|
491
|
+
this.target=function(){var target=arguments[0];this.args.target=target;return this;}
|
492
|
+
this.title=function(){this._add_column(arguments[0],'title');return this;}
|
493
|
+
this.text=function(){this._add_column(arguments[0],'text');return this;}
|
494
|
+
this.bullet=function(){return this;}
|
495
|
+
this.sparkline=function(){return this;}
|
496
|
+
this.number=function(){this._add_column(arguments[0],'number');return this;}
|
497
|
+
this.display=function(){var this_column;var args=this.args;chart_title(args);var target=args.target;var table=d3.select(target).append('table').classed('data-table',true);var colgroup=table.append('colgroup');var thead=table.append('thead');var tbody=table.append('tbody');var this_column,this_title;var tr,th,td_accessor,td_type,td_value,th_text,td_text,td;var col;tr=thead.append('tr');for(var h=0;h<args.columns.length;h++){var this_col=args.columns[h];td_type=this_col.type;th_text=this_col.label;th_text=th_text==undefined?'':th_text;th=tr.append('th').style('width',this_col.width).style('text-align',td_type=='title'?'left':'right').text(th_text);if(this_col.description){th.append('i').classed('fa',true).classed('fa-question-circle',true).classed('fa-inverse',true);$(th[0]).popover({html:true,animation:false,content:this_col.description,trigger:'hover',placement:'top',container:$(th[0])})}}
|
498
|
+
for(var h=0;h<args.columns.length;h++){col=colgroup.append('col');if(args.columns[h].type=='number'){col.attr('align','char').attr('char','.');}}
|
499
|
+
for(var i=0;i<args.data.length;i++){tr=tbody.append('tr');for(var j=0;j<args.columns.length;j++){this_column=args.columns[j];td_accessor=this_column.accessor;td_value=td_text=args.data[i][td_accessor];td_type=this_column.type;if(td_type=='number'){if(this_column.hasOwnProperty('round')&&!this_column.hasOwnProperty('format')){td_text=d3.format('0,.'+this_column.round+'f')(td_text);}
|
500
|
+
if(this_column.hasOwnProperty('value_formatter')){td_text=this_column.value_formatter(td_text);}if(this_column.hasOwnProperty('format')){if(this_column.round)td_text=d3.round(td_text,this_column.round);var this_format=this_column.format;var formatter;if(this_format=='percentage')formatter=d3.format('%p');if(this_format=='count')formatter=d3.format("0,000");if(this_format=='temperature')formatter=function(t){return t+'º'};td_text=formatter(td_text);}if(this_column.hasOwnProperty('currency')){td_text=this_column.currency+td_text;}}
|
501
|
+
td=tr.append('td').classed('table-'+td_type,true).classed('table-'+td_type+'-'+this._strip_punctuation(td_accessor),true).attr('data-value',td_value).style('width',this_column.width).style('text-align',td_type=='title'||td_type=='text'?'left':'right');this._format_element(td,td_value,this_column);if(td_type=='title'){this_title=td.append('div').text(td_text);this._format_element(this_title,td_text,this_column);if(args.columns[j].hasOwnProperty('secondary_accessor')){td.append('div').text(args.data[i][args.columns[j].secondary_accessor]).classed("secondary-title",true)}}else{td.text(td_text);}}}
|
502
|
+
return this;}
|
503
|
+
return this;}
|
504
|
+
charts.missing=function(args){'use strict';this.args=args;this.init=function(args){chart_title(args);d3.select(args.target).selectAll('svg').data([args]).enter().append('svg').attr('width',args.width).attr('height',args.height);d3.select(args.target).selectAll('svg *').remove()
|
505
|
+
var svg=d3.select(args.target).select('svg')
|
506
|
+
svg.classed('missing',true);if(args.legend_target)
|
507
|
+
$(args.legend_target).html('');svg.append('rect').attr('class','missing-pane').attr('x',args.left).attr('y',args.top).attr('width',args.width-(args.left*2)).attr('height',args.height-(args.top*2));svg.selectAll('.missing_text').data([args.missing_text]).enter().append('text').attr('class','missing-text').attr('x',args.width/2).attr('y',args.height/2).attr('dy','.50em').attr('text-anchor','middle').text(args.missing_text)
|
508
|
+
return this;}
|
509
|
+
this.init(args);return this;}
|
510
|
+
function raw_data_transformation(args){'use strict';if(!$.isArray(args.data[0]))
|
511
|
+
args.data=[args.data];if($.isArray(args.y_accessor)){args.data=args.data.map(function(_d){return args.y_accessor.map(function(ya){return _d.map(function(di){di=clone(di);if(di[ya]==undefined){return undefined;}
|
512
|
+
di['multiline_y_accessor']=di[ya];return di;}).filter(function(di){return di!=undefined;})})})[0];args.y_accessor='multiline_y_accessor';}
|
513
|
+
if(args.chart_type=='line'){for(var i=0;i<args.data.length;i++){args.data[i].sort(function(a,b){return a[args.x_accessor]-b[args.x_accessor];});}}
|
514
|
+
return this}
|
515
|
+
function process_line(args){'use strict';var is_time_series=($.type(args.data[0][0][args.x_accessor])=='date')?true:false;if(args.missing_is_zero&&args.chart_type=='line'&&is_time_series){for(var i=0;i<args.data.length;i++){var first=args.data[i][0];var last=args.data[i][args.data[i].length-1];var processed_data=[];var start_date=clone(first[args.x_accessor]).setDate(first[args.x_accessor].getDate()+1);var from=(args.min_x)?args.min_x:start_date;var upto=(args.max_x)?args.max_x:last[args.x_accessor];for(var d=new Date(from);d<=upto;d.setDate(d.getDate()+1)){var o={};d.setHours(0,0,0,0);if(Date.parse(d)==Date.parse(new Date(start_date))){processed_data.push(clone(args.data[i][0]));}
|
516
|
+
var existing_o=null;$.each(args.data[i],function(i,val){if(Date.parse(val.date)==Date.parse(new Date(d))){existing_o=val;return false;}})
|
517
|
+
if(!existing_o){o[args.x_accessor]=new Date(d);o[args.y_accessor]=0;processed_data.push(o);}
|
518
|
+
else{processed_data.push(existing_o);}
|
519
|
+
if(Date.parse(d)==Date.parse(new Date(last[args.x_accessor]))){processed_data.push(last);}}
|
520
|
+
args.data[i]=processed_data;}}
|
521
|
+
return this;}
|
522
|
+
function process_histogram(args){'use strict';var our_data=args.data[0];var extracted_data;if(args.binned==false){if(typeof(our_data[0])=='object'){extracted_data=our_data.map(function(d){return d[args.x_accessor];});}else if(typeof(our_data[0])=='number'){extracted_data=our_data;}
|
523
|
+
else{console.log('TypeError: expected an array of numbers, found '+typeof(our_data[0]));return;}
|
524
|
+
var hist=d3.layout.histogram()
|
525
|
+
if(args.bins){hist=hist.bins(args.bins);}
|
526
|
+
args.processed_data=hist(extracted_data).map(function(d){return{'x':d['x'],'y':d['y'],'dx':d['dx']};})}else{args.processed_data=our_data.map(function(d){return{'x':d[args.x_accessor],'y':d[args.y_accessor]}});var this_pt;var next_pt;for(var i=0;i<args.processed_data.length;i++){this_pt=args.processed_data[i];if(i==args.processed_data.length-1){this_pt.dx=args.processed_data[i-1].dx;}else{next_pt=args.processed_data[i+1];this_pt.dx=next_pt.x-this_pt.x;}}}
|
527
|
+
args.data=[args.processed_data];args.x_accessor=args.processed_x_accessor;args.y_accessor=args.processed_y_accessor;return this;}
|
528
|
+
function process_categorical_variables(args){'use strict';var extracted_data,processed_data={},pd=[];var our_data=args.data[0];args.categorical_variables=[];if(args.binned==false){if(typeof(our_data[0])=='object'){extracted_data=our_data.map(function(d){return d[args.y_accessor];});}else{extracted_data=our_data;}
|
529
|
+
var this_dp;for(var i=0;i<extracted_data.length;i++){this_dp=extracted_data[i];if(args.categorical_variables.indexOf(this_dp)==-1)args.categorical_variables.push(this_dp)
|
530
|
+
if(!processed_data.hasOwnProperty(this_dp))processed_data[this_dp]=0;processed_data[this_dp]+=1;}
|
531
|
+
processed_data=Object.keys(processed_data).map(function(d){var obj={};obj[args.x_accessor]=processed_data[d];obj[args.y_accessor]=d;return obj;})}else{processed_data=our_data;args.categorical_variables=d3.set(processed_data.map(function(d){return d[args.y_accessor];})).values();args.categorical_variables.reverse();}
|
532
|
+
args.data=[processed_data];return this;}
|
533
|
+
function process_point(args){'use strict';var data=args.data[0];var x=data.map(function(d){return d[args.x_accessor]});var y=data.map(function(d){return d[args.y_accessor]});if(args.least_squares){args.ls_line=least_squares(x,y);};return this;}
|
534
|
+
function add_ls(args){var svg=d3.select($(args.target).find('svg').get(0));var data=args.data[0];var min_x=args.scales.X.ticks(args.xax_count)[0];var max_x=args.scales.X.ticks(args.xax_count)[args.scales.X.ticks(args.xax_count).length-1];svg.append('svg:line').attr('x1',args.scales.X(min_x)).attr('x2',args.scales.X(max_x)).attr('y1',args.scales.Y(args.ls_line.fit(min_x))).attr('y2',args.scales.Y(args.ls_line.fit(max_x))).attr('class','least-squares-line')}
|
535
|
+
function add_lowess(args){var svg=d3.select($(args.target).find('svg').get(0));var lowess=args.lowess_line;var line=d3.svg.line().x(function(d){return args.scales.X(d.x)}).y(function(d){return args.scales.Y(d.y)}).interpolate(args.interpolate);svg.append('path').attr('d',line(lowess)).attr('class','lowess-line')}
|
536
|
+
function lowess_robust(x,y,alpha,inc){var _l;var r=[];var yhat=d3.mean(y);for(var i=0;i<x.length;i+=1){r.push(1)};_l=_calculate_lowess_fit(x,y,alpha,inc,r);var x_proto=_l.x;var y_proto=_l.y;for(var i=0;i<100;i+=1){r=d3.zip(y_proto,y).map(function(yi){return Math.abs(yi[1]-yi[0])})
|
537
|
+
var q=d3.quantile(r.sort(),.5)
|
538
|
+
r=r.map(function(ri){return _bisquare_weight(ri/(6*q))})
|
539
|
+
_l=_calculate_lowess_fit(x,y,alpha,inc,r);x_proto=_l.x;y_proto=_l.y;}
|
540
|
+
return d3.zip(x_proto,y_proto).map(function(d){var p={};p.x=d[0];p.y=d[1];return p;});}
|
541
|
+
function lowess(x,y,alpha,inc){var r=[];for(var i=0;i<x.length;i+=1){r.push(1)}
|
542
|
+
var _l=_calculate_lowess_fit(x,y,alpha,inc,r);}
|
543
|
+
function least_squares(x_,y_){var x,y,xi,yi,_x=0,_y=0,_xy=0,_xx=0;var n=x_.length;if(x_[0]instanceof Date){x=x_.map(function(d){return d.getTime();});}else{x=x_;};if(y_[0]instanceof Date){y=y_.map(function(d){return d.getTime();});}else{y=y_;};var xhat=d3.mean(x);var yhat=d3.mean(y);var numerator=0,denominator=0;var xi,yi;for(var i=0;i<x.length;i++){xi=x[i];yi=y[i];numerator+=(xi-xhat)*(yi-yhat);denominator+=(xi-xhat)*(xi-xhat)}
|
544
|
+
var beta=numerator/denominator;var x0=yhat-beta*xhat;return{x0:x0,beta:beta,fit:function(x){return x0+x*beta;}}}
|
545
|
+
function _pow_weight(u,w){if(u>=0&&u<=1){return Math.pow(1-Math.pow(u,w),w)}else{return 0}}
|
546
|
+
function _bisquare_weight(u){return _pow_weight(u,2);}
|
547
|
+
function _tricube_weight(u){return _pow_weight(u,3);}
|
548
|
+
function _neighborhood_width(x0,xis){return Array.max(xis.map(function(xi){return Math.abs(x0-xi)}))}
|
549
|
+
function _manhattan(x1,x2){return Math.abs(x1-x2)}
|
550
|
+
function _weighted_means(wxy){var wsum=d3.sum(wxy.map(function(wxyi){return wxyi.w}));return{xbar:d3.sum(wxy.map(function(wxyi){return wxyi.w*wxyi.x}))/wsum,ybar:d3.sum(wxy.map(function(wxyi){return wxyi.w*wxyi.y}))/wsum}}
|
551
|
+
function _weighted_beta(wxy,xbar,ybar){var num=d3.sum(wxy.map(function(wxyi){return Math.pow(wxyi.w,2)*(wxyi.x-xbar)*(wxyi.y-ybar)}))
|
552
|
+
var denom=d3.sum(wxy.map(function(wxyi){return Math.pow(wxyi.w,2)*(Math.pow(wxyi.x-xbar),2)}))
|
553
|
+
return num/denom;}
|
554
|
+
function _weighted_least_squares(wxy){var ybar,xbar,beta_i,x0;var _wm=_weighted_means(wxy);xbar=_wm.xbar;ybar=_wm.ybar;var beta=_weighted_beta(wxy,xbar,ybar)
|
555
|
+
return{beta:beta,xbar:xbar,ybar:ybar,x0:ybar-beta*xbar}
|
556
|
+
return num/denom}
|
557
|
+
function _calculate_lowess_fit(x,y,alpha,inc,residuals){var k=Math.floor(x.length*alpha);var sorted_x=x.slice();sorted_x.sort(function(a,b){if(a<b){return-1}
|
558
|
+
else if(a>b){return 1}
|
559
|
+
return 0});var x_max=d3.quantile(sorted_x,.98);var x_min=d3.quantile(sorted_x,.02);var xy=d3.zip(x,y,residuals).sort();var size=Math.abs(x_max-x_min)/inc;var smallest=x_min
|
560
|
+
var largest=x_max
|
561
|
+
var x_proto=d3.range(smallest,largest,size);var xi_neighbors;var x_i,beta_i,x0_i,delta_i,xbar,ybar;var y_proto=[];for(var i=0;i<x_proto.length;i+=1){x_i=x_proto[i]
|
562
|
+
xi_neighbors=xy.map(function(xyi){return[Math.abs(xyi[0]-x_i),xyi[0],xyi[1],xyi[2]]}).sort().slice(0,k)
|
563
|
+
delta_i=d3.max(xi_neighbors)[0]
|
564
|
+
xi_neighbors=xi_neighbors.map(function(wxy){return{w:_tricube_weight(wxy[0]/delta_i)*wxy[3],x:wxy[1],y:wxy[2]}})
|
565
|
+
var _output=_weighted_least_squares(xi_neighbors)
|
566
|
+
x0_i=_output.x0;beta_i=_output.beta;y_proto.push(x0_i+beta_i*x_i)}
|
567
|
+
return{x:x_proto,y:y_proto};}
|
568
|
+
function modify_time_period(data,past_n_days){var data_spliced=clone(data);if(past_n_days!=''){for(var i=0;i<data_spliced.length;i++){var from=data_spliced[i].length-past_n_days;data_spliced[i].splice(0,from);}}
|
569
|
+
return data_spliced;}
|
570
|
+
function convert_dates(data,x_accessor,time_format){time_format=(typeof time_format==="undefined")?'%Y-%m-%d':time_format;data=data.map(function(d){var fff=d3.time.format(time_format);d[x_accessor]=fff.parse(d[x_accessor]);return d;});return data;}
|
571
|
+
var each=function(obj,iterator,context){if(obj==null)return obj;if(Array.prototype.forEach&&obj.forEach===Array.prototype.forEach){obj.forEach(iterator,context);}else if(obj.length===+obj.length){for(var i=0,length=obj.length;i<length;i++){if(iterator.call(context,obj[i],i,obj)===breaker)return;}}else{for(var k in obj){if(iterator.call(context,obj[k],k,obj)===breaker)return;}}
|
572
|
+
return obj;}
|
573
|
+
function merge_with_defaults(obj){each(Array.prototype.slice.call(arguments,1),function(source){if(source){for(var prop in source){if(obj[prop]===void 0)obj[prop]=source[prop];}}})
|
574
|
+
return obj;}
|
575
|
+
function number_of_values(data,accessor,value){var values=data.filter(function(d){return d[accessor]===value;})
|
576
|
+
return values.length;}
|
577
|
+
function has_values_below(data,accessor,value){var values=data.filter(function(d){return d[accessor]<=value;})
|
578
|
+
return values.length>0;}
|
579
|
+
function has_too_many_zeros(data,accessor,zero_count){return number_of_values(data,accessor,0)>=zero_count;}
|
580
|
+
function clone(obj){if(null==obj||"object"!=typeof obj)return obj;if(obj instanceof Date){var copy=new Date();copy.setTime(obj.getTime());return copy;}
|
581
|
+
if(obj instanceof Array){var copy=[];for(var i=0,len=obj.length;i<len;i++){copy[i]=clone(obj[i]);}
|
582
|
+
return copy;}
|
583
|
+
if(obj instanceof Object){var copy={};for(var attr in obj){if(obj.hasOwnProperty(attr))copy[attr]=clone(obj[attr]);}
|
584
|
+
return copy;}
|
585
|
+
throw new Error("Unable to copy obj! Its type isn't supported.");}
|
586
|
+
function arrDiff(a,b){var seen=[],diff=[];for(var i=0;i<b.length;i++)
|
587
|
+
seen[b[i]]=true;for(var i=0;i<a.length;i++)
|
588
|
+
if(!seen[a[i]])
|
589
|
+
diff.push(a[i]);return diff;}
|
590
|
+
function error(args){var error='<i class="fa fa-x fa-exclamation-circle warning"></i>';console.log('ERROR : ',args.target,' : ',args.error);$(args.target).find('.chart_title').append(error);}
|