sequenceserver 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sequenceserver might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/sequenceserver/api_errors.rb +24 -2
- data/lib/sequenceserver/blast/job.rb +41 -7
- data/lib/sequenceserver/blast/report.rb +36 -30
- data/lib/sequenceserver/config.rb +49 -27
- data/lib/sequenceserver/job.rb +13 -3
- data/lib/sequenceserver/job_remover.rb +25 -29
- data/lib/sequenceserver/refinements.rb +15 -0
- data/lib/sequenceserver/routes.rb +69 -7
- data/lib/sequenceserver/sequence.rb +8 -7
- data/lib/sequenceserver/sys.rb +2 -2
- data/lib/sequenceserver/version.rb +1 -1
- data/lib/sequenceserver/zip_file_generator.rb +56 -0
- data/lib/sequenceserver.rb +1 -0
- data/public/config.js +149 -143
- data/public/css/sequenceserver.css +44 -3
- data/public/css/sequenceserver.min.css +3 -3
- data/public/js/alignment_exporter.js +16 -8
- data/public/js/circos.js +370 -234
- data/public/js/cloud_share_modal.js +216 -0
- data/public/js/databases.js +144 -0
- data/public/js/databases_tree.js +42 -113
- data/public/js/dnd.js +164 -0
- data/public/js/error_modal.js +4 -11
- data/public/js/exporter.js +7 -3
- data/public/js/form.js +260 -0
- data/public/js/grapher.js +113 -106
- data/public/js/hit.js +80 -67
- data/public/js/hits_overview.js +2 -2
- data/public/js/hsp.js +343 -288
- data/public/js/jquery_world.js +4 -4
- data/public/js/mailto.js +36 -0
- data/public/js/options.js +84 -0
- data/public/js/query.js +319 -59
- data/public/js/report.js +315 -269
- data/public/js/report_root.js +75 -0
- data/public/js/search.js +28 -1011
- data/public/js/search_button.js +195 -0
- data/public/js/sequence.js +2409 -2411
- data/public/js/sequence_modal.js +152 -159
- data/public/js/share_url.js +23 -0
- data/public/js/sidebar.js +262 -83
- data/public/js/tests/database.spec.js +60 -0
- data/public/js/tests/mock_data/databases.json +91 -0
- data/public/js/tests/mock_data/long_response.json +269 -0
- data/public/js/tests/mock_data/short_response.json +2240 -0
- data/public/js/tests/report.spec.js +99 -0
- data/public/js/tests/search_button.spec.js +14 -0
- data/public/js/tests/search_query.spec.js +41 -0
- data/public/packages/circosJS@1.7.0.js +1640 -0
- data/public/packages/jquery-ui@1.11.4.js +16624 -0
- data/public/sequenceserver-report.min.js +2425 -19
- data/public/sequenceserver-search.min.js +2337 -15
- data/public/vendor/github/jspm/nodelibs-assert@0.1.0/index.js +2 -0
- data/public/vendor/github/jspm/{nodelibs-buffer@0.1.0 → nodelibs-assert@0.1.0}/package.json +1 -1
- data/public/vendor/github/jspm/nodelibs-assert@0.1.0.js +1 -0
- data/public/vendor/github/jspm/nodelibs-buffer@0.1.1/package.json +6 -0
- data/public/vendor/github/jspm/nodelibs-buffer@0.1.1.js +1 -0
- data/public/vendor/github/jspm/{nodelibs-process@0.1.1 → nodelibs-process@0.1.2}/package.json +2 -2
- data/public/vendor/github/jspm/nodelibs-process@0.1.2.js +1 -0
- data/public/vendor/github/jspm/nodelibs-vm@0.1.0/index.js +2 -0
- data/public/vendor/github/jspm/nodelibs-vm@0.1.0/package.json +6 -0
- data/public/vendor/github/jspm/nodelibs-vm@0.1.0.js +1 -0
- data/public/vendor/npm/assert@1.5.0/CHANGELOG.md +8 -0
- data/public/vendor/npm/assert@1.5.0/README.md +105 -0
- data/public/vendor/npm/assert@1.5.0/assert.js +327 -0
- data/public/vendor/npm/assert@1.5.0/package.json +32 -0
- data/public/vendor/npm/assert@1.5.0/test.js +288 -0
- data/public/vendor/npm/assert@1.5.0.js +1 -0
- data/public/vendor/npm/{base64-js@0.0.8/LICENSE.MIT → base64-js@1.5.1/LICENSE} +1 -1
- data/public/vendor/npm/{base64-js@0.0.8 → base64-js@1.5.1}/README.md +10 -7
- data/public/vendor/npm/base64-js@1.5.1/base64js.min.js +3 -0
- data/public/vendor/npm/base64-js@1.5.1/index.d.ts +3 -0
- data/public/vendor/npm/base64-js@1.5.1/index.js +151 -0
- data/public/vendor/npm/base64-js@1.5.1/package.json +47 -0
- data/public/vendor/npm/base64-js@1.5.1.js +1 -0
- data/public/vendor/npm/buffer@5.7.1/AUTHORS.md +70 -0
- data/public/vendor/npm/{buffer@3.4.3 → buffer@5.7.1}/README.md +111 -41
- data/public/vendor/npm/buffer@5.7.1/index.d.ts +186 -0
- data/public/vendor/npm/buffer@5.7.1/index.js +1817 -0
- data/public/vendor/npm/buffer@5.7.1/package.json +96 -0
- data/public/vendor/npm/buffer@5.7.1.js +1 -0
- data/public/vendor/npm/core-util-is@1.0.3/LICENSE +19 -0
- data/public/vendor/npm/core-util-is@1.0.3/lib/util.js +64 -0
- data/public/vendor/npm/{core-util-is@1.0.1 → core-util-is@1.0.3}/package.json +13 -1
- data/public/vendor/npm/core-util-is@1.0.3.js +1 -0
- data/public/vendor/npm/events@1.0.2/tests/add-listeners.js +2 -2
- data/public/vendor/npm/events@1.0.2/tests/check-listener-leaks.js +3 -3
- data/public/vendor/npm/events@1.0.2/tests/common.js +1 -1
- data/public/vendor/npm/events@1.0.2/tests/index.js +13 -13
- data/public/vendor/npm/events@1.0.2/tests/listeners-side-effects.js +2 -2
- data/public/vendor/npm/events@1.0.2/tests/listeners.js +2 -2
- data/public/vendor/npm/events@1.0.2/tests/max-listeners.js +2 -2
- data/public/vendor/npm/events@1.0.2/tests/modify-in-emit.js +2 -2
- data/public/vendor/npm/events@1.0.2/tests/num-args.js +2 -2
- data/public/vendor/npm/events@1.0.2/tests/once.js +2 -2
- data/public/vendor/npm/events@1.0.2/tests/remove-all-listeners.js +3 -3
- data/public/vendor/npm/events@1.0.2/tests/remove-listeners.js +3 -3
- data/public/vendor/npm/events@1.0.2/tests/set-max-listeners-side-effects.js +2 -2
- data/public/vendor/npm/events@1.0.2/tests/subclass.js +3 -3
- data/public/vendor/npm/events@1.0.2.js +1 -1
- data/public/vendor/npm/ieee754@1.2.1/LICENSE +11 -0
- data/public/vendor/npm/{ieee754@1.1.6 → ieee754@1.2.1}/README.md +12 -8
- data/public/vendor/npm/ieee754@1.2.1/index.d.ts +10 -0
- data/public/vendor/npm/{ieee754@1.1.6 → ieee754@1.2.1}/index.js +6 -6
- data/public/vendor/npm/ieee754@1.2.1/package.json +52 -0
- data/public/vendor/npm/ieee754@1.2.1.js +1 -0
- data/public/vendor/npm/{is-array@1.0.1 → indexof@0.0.1}/Makefile +3 -3
- data/public/vendor/npm/indexof@0.0.1/Readme.md +15 -0
- data/public/vendor/npm/indexof@0.0.1/component.json +10 -0
- data/public/vendor/npm/indexof@0.0.1/index.js +11 -0
- data/public/vendor/npm/indexof@0.0.1/package.json +12 -0
- data/public/vendor/npm/indexof@0.0.1.js +1 -0
- data/public/vendor/npm/inherits@2.0.1/inherits.js +1 -1
- data/public/vendor/npm/inherits@2.0.1.js +1 -1
- data/public/vendor/npm/isarray@0.0.1.js +1 -1
- data/public/vendor/npm/js-tokens@4.0.0/index.js +23 -0
- data/public/vendor/npm/js-tokens@4.0.0/package.json +30 -0
- data/public/vendor/npm/js-tokens@4.0.0.js +1 -0
- data/public/vendor/npm/loose-envify@1.4.0/LICENSE +21 -0
- data/public/vendor/npm/loose-envify@1.4.0/README.md +45 -0
- data/public/vendor/npm/loose-envify@1.4.0/cli.js +12 -0
- data/public/vendor/npm/loose-envify@1.4.0/custom.js +3 -0
- data/public/vendor/npm/loose-envify@1.4.0/index.js +5 -0
- data/public/vendor/npm/loose-envify@1.4.0/loose-envify.js +33 -0
- data/public/vendor/npm/loose-envify@1.4.0/package.json +36 -0
- data/public/vendor/npm/loose-envify@1.4.0/replace.js +52 -0
- data/public/vendor/npm/loose-envify@1.4.0.js +1 -0
- data/public/vendor/npm/object-assign@4.1.1/index.js +90 -0
- data/public/vendor/npm/object-assign@4.1.1/package.json +42 -0
- data/public/vendor/npm/object-assign@4.1.1.js +1 -0
- data/public/vendor/npm/path-browserify@0.0.0/index.js +1 -1
- data/public/vendor/npm/path-browserify@0.0.0.js +1 -1
- data/public/vendor/npm/{process@0.10.1 → process@0.11.10}/README.md +4 -1
- data/public/vendor/npm/process@0.11.10/browser.js +184 -0
- data/public/vendor/npm/{process@0.10.1 → process@0.11.10}/package.json +10 -1
- data/public/vendor/npm/process@0.11.10/test.js +185 -0
- data/public/vendor/npm/process@0.11.10.js +1 -0
- data/public/vendor/npm/react-dom@18.0.0/LICENSE +21 -0
- data/public/vendor/npm/react-dom@18.0.0/README.md +50 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom-server-legacy.browser.development.js +4771 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom-server-legacy.browser.production.min.js +85 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom-server-legacy.node.development.js +4813 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom-server-legacy.node.production.min.js +1705 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom-server.browser.development.js +4746 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom-server.browser.production.min.js +90 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom-server.node.development.js +4714 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom-server.node.production.min.js +1746 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom-test-utils.development.js +1017 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom-test-utils.production.min.js +617 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom.development.js +20092 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom.production.min.js +322 -0
- data/public/vendor/npm/react-dom@18.0.0/cjs/react-dom.profiling.min.js +364 -0
- data/public/vendor/npm/react-dom@18.0.0/client.js +27 -0
- data/public/vendor/npm/react-dom@18.0.0/index.js +23 -0
- data/public/vendor/npm/react-dom@18.0.0/package.json +62 -0
- data/public/vendor/npm/react-dom@18.0.0/profiling.js +23 -0
- data/public/vendor/npm/react-dom@18.0.0/server.browser.js +19 -0
- data/public/vendor/npm/react-dom@18.0.0/server.js +3 -0
- data/public/vendor/npm/react-dom@18.0.0/server.node.js +19 -0
- data/public/vendor/npm/react-dom@18.0.0/test-utils.js +9 -0
- data/public/vendor/npm/react-dom@18.0.0/umd/react-dom-server-legacy.browser.development.js +4770 -0
- data/public/vendor/npm/react-dom@18.0.0/umd/react-dom-server-legacy.browser.production.min.js +72 -0
- data/public/vendor/npm/react-dom@18.0.0/umd/react-dom-server.browser.development.js +4745 -0
- data/public/vendor/npm/react-dom@18.0.0/umd/react-dom-server.browser.production.min.js +74 -0
- data/public/vendor/npm/react-dom@18.0.0/umd/react-dom-test-utils.development.js +1013 -0
- data/public/vendor/npm/react-dom@18.0.0/umd/react-dom-test-utils.production.min.js +625 -0
- data/public/vendor/npm/react-dom@18.0.0/umd/react-dom.development.js +20106 -0
- data/public/vendor/npm/react-dom@18.0.0/umd/react-dom.production.min.js +269 -0
- data/public/vendor/npm/react-dom@18.0.0/umd/react-dom.profiling.min.js +285 -0
- data/public/vendor/npm/react-dom@18.0.0.js +1 -0
- data/public/vendor/npm/react@18.0.0/LICENSE +21 -0
- data/public/vendor/npm/react@18.0.0/README.md +13 -0
- data/public/vendor/npm/react@18.0.0/cjs/react-jsx-dev-runtime.development.js +837 -0
- data/public/vendor/npm/react@18.0.0/cjs/react-jsx-dev-runtime.production.min.js +10 -0
- data/public/vendor/npm/react@18.0.0/cjs/react-jsx-dev-runtime.profiling.min.js +10 -0
- data/public/vendor/npm/react@18.0.0/cjs/react-jsx-runtime.development.js +849 -0
- data/public/vendor/npm/react@18.0.0/cjs/react-jsx-runtime.production.min.js +38 -0
- data/public/vendor/npm/react@18.0.0/cjs/react-jsx-runtime.profiling.min.js +38 -0
- data/public/vendor/npm/react@18.0.0/cjs/react.development.js +1746 -0
- data/public/vendor/npm/react@18.0.0/cjs/react.production.min.js +26 -0
- data/public/vendor/npm/react@18.0.0/cjs/react.shared-subset.development.js +10 -0
- data/public/vendor/npm/react@18.0.0/cjs/react.shared-subset.production.min.js +12 -0
- data/public/vendor/npm/react@18.0.0/index.js +9 -0
- data/public/vendor/npm/react@18.0.0/jsx-dev-runtime.js +9 -0
- data/public/vendor/npm/react@18.0.0/jsx-runtime.js +9 -0
- data/public/vendor/npm/react@18.0.0/package.json +47 -0
- data/public/vendor/npm/react@18.0.0/react.shared-subset.js +9 -0
- data/public/vendor/npm/react@18.0.0/umd/react.development.js +2186 -0
- data/public/vendor/npm/react@18.0.0/umd/react.production.min.js +33 -0
- data/public/vendor/npm/react@18.0.0/umd/react.profiling.min.js +33 -0
- data/public/vendor/npm/react@18.0.0.js +1 -0
- data/public/vendor/npm/readable-stream@1.1.14/LICENSE +18 -0
- data/public/vendor/npm/readable-stream@1.1.14/duplex.js +2 -0
- data/public/vendor/npm/{readable-stream@1.1.13 → readable-stream@1.1.14}/lib/_stream_duplex.js +5 -5
- data/public/vendor/npm/{readable-stream@1.1.13 → readable-stream@1.1.14}/lib/_stream_passthrough.js +3 -3
- data/public/vendor/npm/{readable-stream@1.1.13 → readable-stream@1.1.14}/lib/_stream_readable.js +10 -10
- data/public/vendor/npm/{readable-stream@1.1.13 → readable-stream@1.1.14}/lib/_stream_transform.js +4 -4
- data/public/vendor/npm/{readable-stream@1.1.13 → readable-stream@1.1.14}/lib/_stream_writable.js +6 -6
- data/public/vendor/npm/{readable-stream@1.1.13 → readable-stream@1.1.14}/package.json +1 -1
- data/public/vendor/npm/readable-stream@1.1.14/passthrough.js +2 -0
- data/public/vendor/npm/readable-stream@1.1.14/readable.js +13 -0
- data/public/vendor/npm/readable-stream@1.1.14/transform.js +2 -0
- data/public/vendor/npm/readable-stream@1.1.14/writable.js +2 -0
- data/public/vendor/npm/readable-stream@1.1.14.js +1 -0
- data/public/vendor/npm/scheduler@0.21.0/LICENSE +21 -0
- data/public/vendor/npm/scheduler@0.21.0/README.md +9 -0
- data/public/vendor/npm/scheduler@0.21.0/cjs/scheduler-unstable_mock.development.js +530 -0
- data/public/vendor/npm/scheduler@0.21.0/cjs/scheduler-unstable_mock.production.min.js +20 -0
- data/public/vendor/npm/scheduler@0.21.0/cjs/scheduler-unstable_post_task.development.js +153 -0
- data/public/vendor/npm/scheduler@0.21.0/cjs/scheduler-unstable_post_task.production.min.js +14 -0
- data/public/vendor/npm/scheduler@0.21.0/cjs/scheduler.development.js +444 -0
- data/public/vendor/npm/scheduler@0.21.0/cjs/scheduler.production.min.js +19 -0
- data/public/vendor/npm/scheduler@0.21.0/index.js +9 -0
- data/public/vendor/npm/scheduler@0.21.0/package.json +36 -0
- data/public/vendor/npm/scheduler@0.21.0/umd/scheduler-unstable_mock.development.js +701 -0
- data/public/vendor/npm/scheduler@0.21.0/umd/scheduler-unstable_mock.production.min.js +21 -0
- data/public/vendor/npm/scheduler@0.21.0/umd/scheduler.development.js +154 -0
- data/public/vendor/npm/scheduler@0.21.0/umd/scheduler.production.min.js +148 -0
- data/public/vendor/npm/scheduler@0.21.0/umd/scheduler.profiling.min.js +148 -0
- data/public/vendor/npm/scheduler@0.21.0/unstable_mock.js +9 -0
- data/public/vendor/npm/scheduler@0.21.0/unstable_post_task.js +9 -0
- data/public/vendor/npm/scheduler@0.21.0.js +1 -0
- data/public/vendor/npm/stream-browserify@1.0.0/index.js +7 -7
- data/public/vendor/npm/stream-browserify@1.0.0/test/buf.js +5 -5
- data/public/vendor/npm/stream-browserify@1.0.0.js +1 -1
- data/public/vendor/npm/string_decoder@0.10.31/index.js +2 -2
- data/public/vendor/npm/string_decoder@0.10.31.js +1 -1
- data/public/vendor/npm/util@0.10.3/support/isBuffer.js +1 -1
- data/public/vendor/npm/util@0.10.3/test/browser/inspect.js +2 -2
- data/public/vendor/npm/util@0.10.3/test/browser/is.js +3 -3
- data/public/vendor/npm/util@0.10.3/test/node/debug.js +4 -4
- data/public/vendor/npm/util@0.10.3/test/node/format.js +2 -2
- data/public/vendor/npm/util@0.10.3/test/node/inspect.js +3 -3
- data/public/vendor/npm/util@0.10.3/test/node/log.js +3 -3
- data/public/vendor/npm/util@0.10.3/test/node/util.js +3 -3
- data/public/vendor/npm/util@0.10.3/util.js +3 -3
- data/public/vendor/npm/util@0.10.3.js +1 -1
- data/public/vendor/npm/vm-browserify@0.0.4/LICENSE +18 -0
- data/public/vendor/npm/vm-browserify@0.0.4/example/run/bundle.js +376 -0
- data/public/vendor/npm/vm-browserify@0.0.4/example/run/entry.js +6 -0
- data/public/vendor/npm/vm-browserify@0.0.4/example/run/index.html +9 -0
- data/public/vendor/npm/vm-browserify@0.0.4/example/run/server.js +6 -0
- data/public/vendor/npm/vm-browserify@0.0.4/index.js +139 -0
- data/public/vendor/npm/vm-browserify@0.0.4/package.json +46 -0
- data/public/vendor/npm/vm-browserify@0.0.4/readme.markdown +67 -0
- data/public/vendor/npm/vm-browserify@0.0.4/test/vm.js +34 -0
- data/public/vendor/npm/vm-browserify@0.0.4.js +1 -0
- data/public/vendor/npm/webshim@1.15.8/Gruntfile.js +4 -4
- data/public/vendor/npm/webshim@1.15.8/build/combobuild.js +2 -2
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/color-picker.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/combos/10.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/combos/11.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/combos/17.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/combos/5.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/combos/6.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/combos/9.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/es6.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/excanvas.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/form-number-date-ui.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/moxie/js/moxie-html4.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/moxie/js/moxie-swf.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/dev/shims/sizzle.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/js-webshim/minified/shims/es6.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/color-picker.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/combos/10.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/combos/11.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/combos/17.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/combos/5.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/combos/6.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/combos/9.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/es6.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/excanvas.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/form-number-date-ui.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/moxie/js/moxie-html4.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/moxie/js/moxie-swf.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/src/shims/sizzle.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/tests/dist/jquery.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/tests/jquery/unit/core.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/tests/jquery/unit/event.js +1388 -711
- data/public/vendor/npm/webshim@1.15.8/tests/qunit/qunit.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/tests/test-ext/jquery-1-custom.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/tests/test-ext/jquery-2-custom.js +1 -1
- data/public/vendor/npm/webshim@1.15.8/tests/test-ext/punycode.js +1 -1
- data/public/vendor/system-polyfills.js +865 -1
- data/views/blastn_options.erb +291 -0
- data/views/blastp_options.erb +288 -0
- data/views/blastx_options.erb +318 -0
- data/views/error.erb +12 -0
- data/views/layout.erb +2 -30
- data/views/report.erb +0 -8
- data/views/search.erb +16 -9
- data/views/tblastn_options.erb +266 -0
- data/views/tblastx_options.erb +291 -0
- metadata +318 -439
- data/public/vendor/github/jspm/nodelibs-buffer@0.1.0.js +0 -1
- data/public/vendor/github/jspm/nodelibs-module@0.1.0/index.js +0 -1
- data/public/vendor/github/jspm/nodelibs-module@0.1.0.js +0 -1
- data/public/vendor/github/jspm/nodelibs-process@0.1.1.js +0 -1
- data/public/vendor/npm/amdefine@1.0.0/LICENSE +0 -58
- data/public/vendor/npm/amdefine@1.0.0/README.md +0 -171
- data/public/vendor/npm/amdefine@1.0.0/amdefine.js +0 -200
- data/public/vendor/npm/amdefine@1.0.0/intercept.js +0 -24
- data/public/vendor/npm/amdefine@1.0.0/package.json +0 -16
- data/public/vendor/npm/amdefine@1.0.0.js +0 -1
- data/public/vendor/npm/base62@0.1.1/LICENSE +0 -20
- data/public/vendor/npm/base62@0.1.1/Readme.md +0 -30
- data/public/vendor/npm/base62@0.1.1/base62.js +0 -28
- data/public/vendor/npm/base62@0.1.1/package.json +0 -21
- data/public/vendor/npm/base62@0.1.1/test/test.js +0 -13
- data/public/vendor/npm/base62@0.1.1.js +0 -1
- data/public/vendor/npm/base64-js@0.0.8/lib/b64.js +0 -125
- data/public/vendor/npm/base64-js@0.0.8/package.json +0 -34
- data/public/vendor/npm/base64-js@0.0.8/test/convert.js +0 -39
- data/public/vendor/npm/base64-js@0.0.8/test/url-safe.js +0 -15
- data/public/vendor/npm/base64-js@0.0.8.js +0 -1
- data/public/vendor/npm/buffer@3.4.3/index.js +0 -1533
- data/public/vendor/npm/buffer@3.4.3/package.json +0 -67
- data/public/vendor/npm/buffer@3.4.3/test/_polyfill.js +0 -152
- data/public/vendor/npm/buffer@3.4.3/test/base64.js +0 -33
- data/public/vendor/npm/buffer@3.4.3/test/basic.js +0 -58
- data/public/vendor/npm/buffer@3.4.3/test/compare.js +0 -53
- data/public/vendor/npm/buffer@3.4.3/test/constructor.js +0 -132
- data/public/vendor/npm/buffer@3.4.3/test/deprecated.js +0 -21
- data/public/vendor/npm/buffer@3.4.3/test/from-string.js +0 -105
- data/public/vendor/npm/buffer@3.4.3/test/methods.js +0 -109
- data/public/vendor/npm/buffer@3.4.3/test/node/README.txt +0 -1
- data/public/vendor/npm/buffer@3.4.3/test/node/test-buffer-ascii.js +0 -20
- data/public/vendor/npm/buffer@3.4.3/test/node/test-buffer-bytelength.js +0 -38
- data/public/vendor/npm/buffer@3.4.3/test/node/test-buffer-concat.js +0 -26
- data/public/vendor/npm/buffer@3.4.3/test/node/test-buffer-indexof.js +0 -78
- data/public/vendor/npm/buffer@3.4.3/test/node/test-buffer-inspect.js +0 -31
- data/public/vendor/npm/buffer@3.4.3/test/node/test-buffer.js +0 -804
- data/public/vendor/npm/buffer@3.4.3/test/node-es6/README.txt +0 -1
- data/public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-arraybuffer.js +0 -37
- data/public/vendor/npm/buffer@3.4.3/test/node-es6/test-buffer-iterator.js +0 -32
- data/public/vendor/npm/buffer@3.4.3/test/slice.js +0 -33
- data/public/vendor/npm/buffer@3.4.3/test/static.js +0 -32
- data/public/vendor/npm/buffer@3.4.3/test/to-string.js +0 -106
- data/public/vendor/npm/buffer@3.4.3/test/write.js +0 -90
- data/public/vendor/npm/buffer@3.4.3.js +0 -1
- data/public/vendor/npm/core-util-is@1.0.1/float.patch +0 -604
- data/public/vendor/npm/core-util-is@1.0.1/lib/util.js +0 -66
- data/public/vendor/npm/core-util-is@1.0.1/util.js +0 -66
- data/public/vendor/npm/core-util-is@1.0.1.js +0 -1
- data/public/vendor/npm/envify@3.4.0/README.md +0 -145
- data/public/vendor/npm/envify@3.4.0/bin/envify +0 -17
- data/public/vendor/npm/envify@3.4.0/custom.js +0 -33
- data/public/vendor/npm/envify@3.4.0/index.js +0 -4
- data/public/vendor/npm/envify@3.4.0/package.json +0 -35
- data/public/vendor/npm/envify@3.4.0/visitors.js +0 -33
- data/public/vendor/npm/envify@3.4.0.js +0 -1
- data/public/vendor/npm/esprima-fb@13001.1001.0-dev-harmony-fb/bin/esparse.js +0 -90
- data/public/vendor/npm/esprima-fb@13001.1001.0-dev-harmony-fb/bin/esvalidate.js +0 -145
- data/public/vendor/npm/esprima-fb@13001.1001.0-dev-harmony-fb/esprima.js +0 -6191
- data/public/vendor/npm/esprima-fb@13001.1001.0-dev-harmony-fb/package.json +0 -72
- data/public/vendor/npm/esprima-fb@13001.1001.0-dev-harmony-fb/test/compat.js +0 -167
- data/public/vendor/npm/esprima-fb@13001.1001.0-dev-harmony-fb/test/reflect.js +0 -421
- data/public/vendor/npm/esprima-fb@13001.1001.0-dev-harmony-fb/test/run.js +0 -34
- data/public/vendor/npm/esprima-fb@13001.1001.0-dev-harmony-fb/test/runner.js +0 -418
- data/public/vendor/npm/esprima-fb@13001.1001.0-dev-harmony-fb/test/test.js +0 -34730
- data/public/vendor/npm/esprima-fb@13001.1001.0-dev-harmony-fb.js +0 -1
- data/public/vendor/npm/ieee754@1.1.6/LICENSE +0 -56
- data/public/vendor/npm/ieee754@1.1.6/package.json +0 -34
- data/public/vendor/npm/ieee754@1.1.6/test/basic.js +0 -20
- data/public/vendor/npm/ieee754@1.1.6.js +0 -1
- data/public/vendor/npm/is-array@1.0.1/History.md +0 -11
- data/public/vendor/npm/is-array@1.0.1/Readme.md +0 -27
- data/public/vendor/npm/is-array@1.0.1/component.json +0 -13
- data/public/vendor/npm/is-array@1.0.1/index.js +0 -33
- data/public/vendor/npm/is-array@1.0.1/package.json +0 -10
- data/public/vendor/npm/is-array@1.0.1/test/test.html +0 -46
- data/public/vendor/npm/is-array@1.0.1.js +0 -1
- data/public/vendor/npm/jstransform@10.1.0/LICENSE +0 -201
- data/public/vendor/npm/jstransform@10.1.0/README.md +0 -98
- data/public/vendor/npm/jstransform@10.1.0/jestEnvironment.js +0 -3
- data/public/vendor/npm/jstransform@10.1.0/jestPreprocessor.js +0 -8
- data/public/vendor/npm/jstransform@10.1.0/package.json +0 -52
- data/public/vendor/npm/jstransform@10.1.0/polyfill/Object.es6.js +0 -54
- data/public/vendor/npm/jstransform@10.1.0/src/__tests__/jstransform-test.js +0 -246
- data/public/vendor/npm/jstransform@10.1.0/src/__tests__/jstransform-utils-test.js +0 -31
- data/public/vendor/npm/jstransform@10.1.0/src/docblock.js +0 -86
- data/public/vendor/npm/jstransform@10.1.0/src/jstransform.js +0 -180
- data/public/vendor/npm/jstransform@10.1.0/src/utils.js +0 -386
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/es6-arrow-function-visitors-test.js +0 -57
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/es6-call-spread-visitors-test.js +0 -46
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/es6-class-visitors-test.js +0 -463
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/es6-destructuring-visitors-test.js +0 -144
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/es6-es7-object-integration-test.js +0 -40
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/es6-object-concise-method-visitors-test.js +0 -47
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/es6-object-short-notation-visitors-test.js +0 -33
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/es6-rest-param-visitors-test.js +0 -119
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/es6-template-visitors-test.js +0 -138
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/es7-rest-property-helpers-test.js +0 -47
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/es7-spread-property-visitors-test.js +0 -90
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/gen/generate-type-syntax-test.js +0 -40
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/gen/type-syntax-test.rec.js +0 -846
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/reserved-words-test.js +0 -40
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/type-alias-syntax-test.js +0 -34
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/type-class-syntax-test.js +0 -105
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/type-function-syntax-test.js +0 -126
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/type-interface-syntax-test.js +0 -29
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/type-object-method-syntax-test.js +0 -65
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/type-pattern-syntax-test.js +0 -45
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/type-syntax-test.js +0 -46
- data/public/vendor/npm/jstransform@10.1.0/visitors/__tests__/type-variable-declaration-syntax-test.js +0 -102
- data/public/vendor/npm/jstransform@10.1.0/visitors/es6-arrow-function-visitors.js +0 -66
- data/public/vendor/npm/jstransform@10.1.0/visitors/es6-call-spread-visitors.js +0 -72
- data/public/vendor/npm/jstransform@10.1.0/visitors/es6-class-visitors.js +0 -316
- data/public/vendor/npm/jstransform@10.1.0/visitors/es6-destructuring-visitors.js +0 -135
- data/public/vendor/npm/jstransform@10.1.0/visitors/es6-object-concise-method-visitors.js +0 -28
- data/public/vendor/npm/jstransform@10.1.0/visitors/es6-object-short-notation-visitors.js +0 -12
- data/public/vendor/npm/jstransform@10.1.0/visitors/es6-rest-param-visitors.js +0 -45
- data/public/vendor/npm/jstransform@10.1.0/visitors/es6-template-visitors.js +0 -90
- data/public/vendor/npm/jstransform@10.1.0/visitors/es7-rest-property-helpers.js +0 -80
- data/public/vendor/npm/jstransform@10.1.0/visitors/es7-spread-property-visitors.js +0 -56
- data/public/vendor/npm/jstransform@10.1.0/visitors/reserved-words-helper.js +0 -74
- data/public/vendor/npm/jstransform@10.1.0/visitors/reserved-words-visitors.js +0 -30
- data/public/vendor/npm/jstransform@10.1.0/visitors/type-syntax.js +0 -118
- data/public/vendor/npm/jstransform@10.1.0.js +0 -1
- data/public/vendor/npm/process@0.10.1/browser.js +0 -58
- data/public/vendor/npm/process@0.10.1.js +0 -1
- data/public/vendor/npm/qs@2.4.1/test/stringify.js +0 -162
- data/public/vendor/npm/react@0.13.3/README.md +0 -20
- data/public/vendor/npm/react@0.13.3/addons.js +0 -2
- data/public/vendor/npm/react@0.13.3/dist/JSXTransformer.js +0 -11346
- data/public/vendor/npm/react@0.13.3/dist/react-with-addons.js +0 -10483
- data/public/vendor/npm/react@0.13.3/dist/react-with-addons.min.js +0 -7297
- data/public/vendor/npm/react@0.13.3/dist/react.js +0 -9468
- data/public/vendor/npm/react@0.13.3/dist/react.min.js +0 -6764
- data/public/vendor/npm/react@0.13.3/lib/AutoFocusMixin.js +0 -9
- data/public/vendor/npm/react@0.13.3/lib/BeforeInputEventPlugin.js +0 -197
- data/public/vendor/npm/react@0.13.3/lib/CSSCore.js +0 -39
- data/public/vendor/npm/react@0.13.3/lib/CSSProperty.js +0 -123
- data/public/vendor/npm/react@0.13.3/lib/CSSPropertyOperations.js +0 -103
- data/public/vendor/npm/react@0.13.3/lib/CallbackQueue.js +0 -43
- data/public/vendor/npm/react@0.13.3/lib/ChangeEventPlugin.js +0 -174
- data/public/vendor/npm/react@0.13.3/lib/ClientReactRootIndex.js +0 -23
- data/public/vendor/npm/react@0.13.3/lib/DOMChildrenOperations.js +0 -57
- data/public/vendor/npm/react@0.13.3/lib/DOMProperty.js +0 -96
- data/public/vendor/npm/react@0.13.3/lib/DOMPropertyOperations.js +0 -99
- data/public/vendor/npm/react@0.13.3/lib/Danger.js +0 -67
- data/public/vendor/npm/react@0.13.3/lib/DefaultEventPluginOrder.js +0 -5
- data/public/vendor/npm/react@0.13.3/lib/EnterLeaveEventPlugin.js +0 -69
- data/public/vendor/npm/react@0.13.3/lib/EventConstants.js +0 -55
- data/public/vendor/npm/react@0.13.3/lib/EventListener.js +0 -34
- data/public/vendor/npm/react@0.13.3/lib/EventPluginHub.js +0 -103
- data/public/vendor/npm/react@0.13.3/lib/EventPluginRegistry.js +0 -115
- data/public/vendor/npm/react@0.13.3/lib/EventPluginUtils.js +0 -121
- data/public/vendor/npm/react@0.13.3/lib/EventPropagators.js +0 -62
- data/public/vendor/npm/react@0.13.3/lib/ExecutionEnvironment.js +0 -42
- data/public/vendor/npm/react@0.13.3/lib/FallbackCompositionState.js +0 -45
- data/public/vendor/npm/react@0.13.3/lib/HTMLDOMPropertyConfig.js +0 -155
- data/public/vendor/npm/react@0.13.3/lib/LinkedStateMixin.js +0 -8
- data/public/vendor/npm/react@0.13.3/lib/LinkedValueUtils.js +0 -74
- data/public/vendor/npm/react@0.13.3/lib/LocalEventTrapMixin.js +0 -26
- data/public/vendor/npm/react@0.13.3/lib/MobileSafariClickEventPlugin.js +0 -17
- data/public/vendor/npm/react@0.13.3/lib/Object.assign.js +0 -47
- data/public/vendor/npm/react@0.13.3/lib/PooledClass.js +0 -75
- data/public/vendor/npm/react@0.13.3/lib/React.js +0 -93
- data/public/vendor/npm/react@0.13.3/lib/ReactBrowserComponentMixin.js +0 -7
- data/public/vendor/npm/react@0.13.3/lib/ReactBrowserEventEmitter.js +0 -136
- data/public/vendor/npm/react@0.13.3/lib/ReactCSSTransitionGroup.js +0 -34
- data/public/vendor/npm/react@0.13.3/lib/ReactCSSTransitionGroupChild.js +0 -92
- data/public/vendor/npm/react@0.13.3/lib/ReactChildReconciler.js +0 -57
- data/public/vendor/npm/react@0.13.3/lib/ReactChildren.js +0 -67
- data/public/vendor/npm/react@0.13.3/lib/ReactClass.js +0 -338
- data/public/vendor/npm/react@0.13.3/lib/ReactComponent.js +0 -50
- data/public/vendor/npm/react@0.13.3/lib/ReactComponentBrowserEnvironment.js +0 -14
- data/public/vendor/npm/react@0.13.3/lib/ReactComponentEnvironment.js +0 -19
- data/public/vendor/npm/react@0.13.3/lib/ReactComponentWithPureRenderMixin.js +0 -7
- data/public/vendor/npm/react@0.13.3/lib/ReactCompositeComponent.js +0 -374
- data/public/vendor/npm/react@0.13.3/lib/ReactContext.js +0 -27
- data/public/vendor/npm/react@0.13.3/lib/ReactCurrentOwner.js +0 -32
- data/public/vendor/npm/react@0.13.3/lib/ReactDOM.js +0 -146
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMButton.js +0 -35
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMComponent.js +0 -267
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMForm.js +0 -21
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMIDOperations.js +0 -63
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMIframe.js +0 -20
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMImg.js +0 -21
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMInput.js +0 -94
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMOption.js +0 -23
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMSelect.js +0 -112
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMSelection.js +0 -103
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMTextComponent.js +0 -38
- data/public/vendor/npm/react@0.13.3/lib/ReactDOMTextarea.js +0 -70
- data/public/vendor/npm/react@0.13.3/lib/ReactDefaultBatchingStrategy.js +0 -37
- data/public/vendor/npm/react@0.13.3/lib/ReactDefaultInjection.js +0 -93
- data/public/vendor/npm/react@0.13.3/lib/ReactDefaultPerf.js +0 -183
- data/public/vendor/npm/react@0.13.3/lib/ReactDefaultPerfAnalysis.js +0 -145
- data/public/vendor/npm/react@0.13.3/lib/ReactElement.js +0 -151
- data/public/vendor/npm/react@0.13.3/lib/ReactElementValidator.js +0 -218
- data/public/vendor/npm/react@0.13.3/lib/ReactEmptyComponent.js +0 -47
- data/public/vendor/npm/react@0.13.3/lib/ReactErrorUtils.js +0 -30
- data/public/vendor/npm/react@0.13.3/lib/ReactEventEmitterMixin.js +0 -12
- data/public/vendor/npm/react@0.13.3/lib/ReactEventListener.js +0 -93
- data/public/vendor/npm/react@0.13.3/lib/ReactFragment.js +0 -110
- data/public/vendor/npm/react@0.13.3/lib/ReactInjection.js +0 -27
- data/public/vendor/npm/react@0.13.3/lib/ReactInputSelection.js +0 -75
- data/public/vendor/npm/react@0.13.3/lib/ReactInstanceHandles.js +0 -113
- data/public/vendor/npm/react@0.13.3/lib/ReactInstanceMap.js +0 -47
- data/public/vendor/npm/react@0.13.3/lib/ReactLifeCycle.js +0 -9
- data/public/vendor/npm/react@0.13.3/lib/ReactLink.js +0 -16
- data/public/vendor/npm/react@0.13.3/lib/ReactMarkupChecksum.js +0 -17
- data/public/vendor/npm/react@0.13.3/lib/ReactMount.js +0 -347
- data/public/vendor/npm/react@0.13.3/lib/ReactMultiChild.js +0 -190
- data/public/vendor/npm/react@0.13.3/lib/ReactMultiChildUpdateTypes.js +0 -10
- data/public/vendor/npm/react@0.13.3/lib/ReactNativeComponent.js +0 -53
- data/public/vendor/npm/react@0.13.3/lib/ReactOwner.js +0 -21
- data/public/vendor/npm/react@0.13.3/lib/ReactPerf.js +0 -42
- data/public/vendor/npm/react@0.13.3/lib/ReactPropTransferer.js +0 -40
- data/public/vendor/npm/react@0.13.3/lib/ReactPropTypeLocationNames.js +0 -13
- data/public/vendor/npm/react@0.13.3/lib/ReactPropTypeLocations.js +0 -9
- data/public/vendor/npm/react@0.13.3/lib/ReactPropTypes.js +0 -225
- data/public/vendor/npm/react@0.13.3/lib/ReactPutListenerQueue.js +0 -31
- data/public/vendor/npm/react@0.13.3/lib/ReactReconcileTransaction.js +0 -66
- data/public/vendor/npm/react@0.13.3/lib/ReactReconciler.js +0 -44
- data/public/vendor/npm/react@0.13.3/lib/ReactRef.js +0 -36
- data/public/vendor/npm/react@0.13.3/lib/ReactRootIndex.js +0 -29
- data/public/vendor/npm/react@0.13.3/lib/ReactServerRendering.js +0 -44
- data/public/vendor/npm/react@0.13.3/lib/ReactServerRenderingTransaction.js +0 -47
- data/public/vendor/npm/react@0.13.3/lib/ReactStateSetters.js +0 -104
- data/public/vendor/npm/react@0.13.3/lib/ReactTestUtils.js +0 -249
- data/public/vendor/npm/react@0.13.3/lib/ReactTransitionChildMapping.js +0 -53
- data/public/vendor/npm/react@0.13.3/lib/ReactTransitionEvents.js +0 -68
- data/public/vendor/npm/react@0.13.3/lib/ReactTransitionGroup.js +0 -140
- data/public/vendor/npm/react@0.13.3/lib/ReactUpdateQueue.js +0 -107
- data/public/vendor/npm/react@0.13.3/lib/ReactUpdates.js +0 -139
- data/public/vendor/npm/react@0.13.3/lib/ReactWithAddons.js +0 -30
- data/public/vendor/npm/react@0.13.3/lib/SVGDOMPropertyConfig.js +0 -76
- data/public/vendor/npm/react@0.13.3/lib/SelectEventPlugin.js +0 -91
- data/public/vendor/npm/react@0.13.3/lib/ServerReactRootIndex.js +0 -29
- data/public/vendor/npm/react@0.13.3/lib/SimpleEventPlugin.js +0 -287
- data/public/vendor/npm/react@0.13.3/lib/SyntheticClipboardEvent.js +0 -11
- data/public/vendor/npm/react@0.13.3/lib/SyntheticCompositionEvent.js +0 -9
- data/public/vendor/npm/react@0.13.3/lib/SyntheticDragEvent.js +0 -9
- data/public/vendor/npm/react@0.13.3/lib/SyntheticEvent.js +0 -90
- data/public/vendor/npm/react@0.13.3/lib/SyntheticFocusEvent.js +0 -9
- data/public/vendor/npm/react@0.13.3/lib/SyntheticInputEvent.js +0 -9
- data/public/vendor/npm/react@0.13.3/lib/SyntheticKeyboardEvent.js +0 -43
- data/public/vendor/npm/react@0.13.3/lib/SyntheticMouseEvent.js +0 -38
- data/public/vendor/npm/react@0.13.3/lib/SyntheticTouchEvent.js +0 -19
- data/public/vendor/npm/react@0.13.3/lib/SyntheticUIEvent.js +0 -29
- data/public/vendor/npm/react@0.13.3/lib/SyntheticWheelEvent.js +0 -18
- data/public/vendor/npm/react@0.13.3/lib/Transaction.js +0 -90
- data/public/vendor/npm/react@0.13.3/lib/ViewportMetrics.js +0 -27
- data/public/vendor/npm/react@0.13.3/lib/accumulateInto.js +0 -26
- data/public/vendor/npm/react@0.13.3/lib/adler32.js +0 -32
- data/public/vendor/npm/react@0.13.3/lib/camelize.js +0 -30
- data/public/vendor/npm/react@0.13.3/lib/camelizeStyleName.js +0 -8
- data/public/vendor/npm/react@0.13.3/lib/cloneWithProps.js +0 -20
- data/public/vendor/npm/react@0.13.3/lib/containsNode.js +0 -20
- data/public/vendor/npm/react@0.13.3/lib/createArrayFromMixed.js +0 -15
- data/public/vendor/npm/react@0.13.3/lib/createFullPageComponent.js +0 -22
- data/public/vendor/npm/react@0.13.3/lib/createNodesFromMarkup.js +0 -39
- data/public/vendor/npm/react@0.13.3/lib/cx.js +0 -20
- data/public/vendor/npm/react@0.13.3/lib/dangerousStyleValue.js +0 -19
- data/public/vendor/npm/react@0.13.3/lib/emptyFunction.js +0 -32
- data/public/vendor/npm/react@0.13.3/lib/emptyObject.js +0 -9
- data/public/vendor/npm/react@0.13.3/lib/escapeTextContentForBrowser.js +0 -38
- data/public/vendor/npm/react@0.13.3/lib/findDOMNode.js +0 -31
- data/public/vendor/npm/react@0.13.3/lib/flattenChildren.js +0 -25
- data/public/vendor/npm/react@0.13.3/lib/focusNode.js +0 -27
- data/public/vendor/npm/react@0.13.3/lib/forEachAccumulated.js +0 -29
- data/public/vendor/npm/react@0.13.3/lib/getActiveElement.js +0 -27
- data/public/vendor/npm/react@0.13.3/lib/getEventCharCode.js +0 -50
- data/public/vendor/npm/react@0.13.3/lib/getEventKey.js +0 -72
- data/public/vendor/npm/react@0.13.3/lib/getEventModifierState.js +0 -45
- data/public/vendor/npm/react@0.13.3/lib/getEventTarget.js +0 -29
- data/public/vendor/npm/react@0.13.3/lib/getIteratorFn.js +0 -42
- data/public/vendor/npm/react@0.13.3/lib/getMarkupWrap.js +0 -73
- data/public/vendor/npm/react@0.13.3/lib/getNodeForCharacterOffset.js +0 -73
- data/public/vendor/npm/react@0.13.3/lib/getReactRootElementInContainer.js +0 -33
- data/public/vendor/npm/react@0.13.3/lib/getTextContentAccessor.js +0 -11
- data/public/vendor/npm/react@0.13.3/lib/getUnboundedScrollPosition.js +0 -38
- data/public/vendor/npm/react@0.13.3/lib/hyphenate.js +0 -31
- data/public/vendor/npm/react@0.13.3/lib/hyphenateStyleName.js +0 -8
- data/public/vendor/npm/react@0.13.3/lib/instantiateReactComponent.js +0 -55
- data/public/vendor/npm/react@0.13.3/lib/invariant.js +0 -26
- data/public/vendor/npm/react@0.13.3/lib/isEventSupported.js +0 -24
- data/public/vendor/npm/react@0.13.3/lib/isNode.js +0 -25
- data/public/vendor/npm/react@0.13.3/lib/isTextInputElement.js +0 -41
- data/public/vendor/npm/react@0.13.3/lib/isTextNode.js +0 -6
- data/public/vendor/npm/react@0.13.3/lib/joinClasses.js +0 -39
- data/public/vendor/npm/react@0.13.3/lib/keyMirror.js +0 -18
- data/public/vendor/npm/react@0.13.3/lib/keyOf.js +0 -34
- data/public/vendor/npm/react@0.13.3/lib/mapObject.js +0 -51
- data/public/vendor/npm/react@0.13.3/lib/memoizeStringOnly.js +0 -31
- data/public/vendor/npm/react@0.13.3/lib/onlyChild.js +0 -11
- data/public/vendor/npm/react@0.13.3/lib/performance.js +0 -8
- data/public/vendor/npm/react@0.13.3/lib/performanceNow.js +0 -7
- data/public/vendor/npm/react@0.13.3/lib/quoteAttributeValueForBrowser.js +0 -7
- data/public/vendor/npm/react@0.13.3/lib/setInnerHTML.js +0 -40
- data/public/vendor/npm/react@0.13.3/lib/setTextContent.js +0 -16
- data/public/vendor/npm/react@0.13.3/lib/shallowEqual.js +0 -42
- data/public/vendor/npm/react@0.13.3/lib/shouldUpdateReactComponent.js +0 -51
- data/public/vendor/npm/react@0.13.3/lib/toArray.js +0 -21
- data/public/vendor/npm/react@0.13.3/lib/traverseAllChildren.js +0 -104
- data/public/vendor/npm/react@0.13.3/lib/update.js +0 -78
- data/public/vendor/npm/react@0.13.3/lib/warning.js +0 -34
- data/public/vendor/npm/react@0.13.3/package.json +0 -34
- data/public/vendor/npm/react@0.13.3/react.js +0 -2
- data/public/vendor/npm/react@0.13.3.js +0 -1
- data/public/vendor/npm/readable-stream@1.1.13/duplex.js +0 -2
- data/public/vendor/npm/readable-stream@1.1.13/passthrough.js +0 -2
- data/public/vendor/npm/readable-stream@1.1.13/readable.js +0 -8
- data/public/vendor/npm/readable-stream@1.1.13/transform.js +0 -2
- data/public/vendor/npm/readable-stream@1.1.13/writable.js +0 -2
- data/public/vendor/npm/readable-stream@1.1.13.js +0 -1
- data/public/vendor/npm/source-map@0.1.31/CHANGELOG.md +0 -112
- data/public/vendor/npm/source-map@0.1.31/LICENSE +0 -28
- data/public/vendor/npm/source-map@0.1.31/Makefile.dryice.js +0 -89
- data/public/vendor/npm/source-map@0.1.31/README.md +0 -434
- data/public/vendor/npm/source-map@0.1.31/build/assert-shim.js +0 -58
- data/public/vendor/npm/source-map@0.1.31/build/mini-require.js +0 -154
- data/public/vendor/npm/source-map@0.1.31/build/prefix-source-map.jsm +0 -20
- data/public/vendor/npm/source-map@0.1.31/build/prefix-utils.jsm +0 -18
- data/public/vendor/npm/source-map@0.1.31/build/suffix-browser.js +0 -8
- data/public/vendor/npm/source-map@0.1.31/build/suffix-source-map.jsm +0 -6
- data/public/vendor/npm/source-map@0.1.31/build/suffix-utils.jsm +0 -21
- data/public/vendor/npm/source-map@0.1.31/build/test-prefix.js +0 -10
- data/public/vendor/npm/source-map@0.1.31/build/test-suffix.js +0 -5
- data/public/vendor/npm/source-map@0.1.31/lib/source-map/array-set.js +0 -49
- data/public/vendor/npm/source-map@0.1.31/lib/source-map/base64-vlq.js +0 -56
- data/public/vendor/npm/source-map@0.1.31/lib/source-map/base64.js +0 -44
- data/public/vendor/npm/source-map@0.1.31/lib/source-map/binary-search.js +0 -83
- data/public/vendor/npm/source-map@0.1.31/lib/source-map/source-map-consumer.js +0 -238
- data/public/vendor/npm/source-map@0.1.31/lib/source-map/source-map-generator.js +0 -231
- data/public/vendor/npm/source-map@0.1.31/lib/source-map/source-node.js +0 -234
- data/public/vendor/npm/source-map@0.1.31/lib/source-map/util.js +0 -207
- data/public/vendor/npm/source-map@0.1.31/lib/source-map.js +0 -4
- data/public/vendor/npm/source-map@0.1.31/package.json +0 -52
- data/public/vendor/npm/source-map@0.1.31/test/run-tests.js +0 -50
- data/public/vendor/npm/source-map@0.1.31/test/source-map/test-api.js +0 -19
- data/public/vendor/npm/source-map@0.1.31/test/source-map/test-array-set.js +0 -84
- data/public/vendor/npm/source-map@0.1.31/test/source-map/test-base64-vlq.js +0 -17
- data/public/vendor/npm/source-map@0.1.31/test/source-map/test-base64.js +0 -26
- data/public/vendor/npm/source-map@0.1.31/test/source-map/test-binary-search.js +0 -37
- data/public/vendor/npm/source-map@0.1.31/test/source-map/test-dog-fooding.js +0 -76
- data/public/vendor/npm/source-map@0.1.31/test/source-map/test-source-map-consumer.js +0 -426
- data/public/vendor/npm/source-map@0.1.31/test/source-map/test-source-map-generator.js +0 -480
- data/public/vendor/npm/source-map@0.1.31/test/source-map/test-source-node.js +0 -307
- data/public/vendor/npm/source-map@0.1.31/test/source-map/util.js +0 -84
- data/public/vendor/npm/source-map@0.1.31.js +0 -1
- data/public/vendor/npm/through@2.3.8/LICENSE.APACHE2 +0 -15
- data/public/vendor/npm/through@2.3.8/LICENSE.MIT +0 -24
- data/public/vendor/npm/through@2.3.8/index.js +0 -93
- data/public/vendor/npm/through@2.3.8/package.json +0 -36
- data/public/vendor/npm/through@2.3.8/readme.markdown +0 -64
- data/public/vendor/npm/through@2.3.8/test/async.js +0 -26
- data/public/vendor/npm/through@2.3.8/test/auto-destroy.js +0 -26
- data/public/vendor/npm/through@2.3.8/test/buffering.js +0 -57
- data/public/vendor/npm/through@2.3.8/test/end.js +0 -37
- data/public/vendor/npm/through@2.3.8/test/index.js +0 -98
- data/public/vendor/npm/through@2.3.8/test.js +0 -2
- data/public/vendor/npm/through@2.3.8.js +0 -1
- data/views/_options.erb +0 -156
- /data/public/vendor/github/jspm/{nodelibs-buffer@0.1.0 → nodelibs-buffer@0.1.1}/index.js +0 -0
- /data/public/vendor/github/jspm/{nodelibs-process@0.1.1 → nodelibs-process@0.1.2}/index.js +0 -0
- /data/public/vendor/npm/{readable-stream@1.1.13 → assert@1.5.0}/LICENSE +0 -0
- /data/public/vendor/npm/{buffer@3.4.3 → buffer@5.7.1}/LICENSE +0 -0
- /data/public/vendor/npm/{core-util-is@1.0.1 → core-util-is@1.0.3}/README.md +0 -0
- /data/public/vendor/npm/{process@0.10.1 → process@0.11.10}/LICENSE +0 -0
- /data/public/vendor/npm/{process@0.10.1 → process@0.11.10}/index.js +0 -0
- /data/public/vendor/npm/{readable-stream@1.1.13 → readable-stream@1.1.14}/README.md +0 -0
- /data/public/vendor/npm/{readable-stream@1.1.13 → readable-stream@1.1.14}/float.patch +0 -0
@@ -0,0 +1,1640 @@
|
|
1
|
+
var circosJS,
|
2
|
+
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
3
|
+
|
4
|
+
if (typeof Object.assign !== 'function') {
|
5
|
+
Object.assign = function(target) {
|
6
|
+
'use strict';
|
7
|
+
var index, key, source;
|
8
|
+
if (target === null) {
|
9
|
+
throw new TypeError('Cannot convert undefined or null to object');
|
10
|
+
}
|
11
|
+
target = Object(target);
|
12
|
+
index = 1;
|
13
|
+
while (index < arguments.length) {
|
14
|
+
source = arguments[index];
|
15
|
+
if (source !== null) {
|
16
|
+
for (key in source) {
|
17
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
18
|
+
target[key] = source[key];
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
index++;
|
23
|
+
}
|
24
|
+
return target;
|
25
|
+
};
|
26
|
+
}
|
27
|
+
|
28
|
+
circosJS = function(conf) {
|
29
|
+
var instance;
|
30
|
+
instance = new circosJS.Core(conf);
|
31
|
+
return instance;
|
32
|
+
};
|
33
|
+
|
34
|
+
circosJS.Core = function(conf) {
|
35
|
+
this.tracks = {
|
36
|
+
heatmaps: {},
|
37
|
+
histograms: {},
|
38
|
+
chords: {},
|
39
|
+
scatters: {},
|
40
|
+
lines: {},
|
41
|
+
stacks: {},
|
42
|
+
highlights: {},
|
43
|
+
texts: {}
|
44
|
+
};
|
45
|
+
this.conf = circosJS.mixConf(conf, this.defaultConf);
|
46
|
+
return this;
|
47
|
+
};
|
48
|
+
|
49
|
+
circosJS.Core.prototype.removeTracks = function(trackIds) {
|
50
|
+
var id, l, len, ref, store, svg, trackId, type;
|
51
|
+
svg = d3.select(this.conf.container);
|
52
|
+
ref = this.tracks;
|
53
|
+
for (type in ref) {
|
54
|
+
store = ref[type];
|
55
|
+
if (typeof trackIds === 'object') {
|
56
|
+
for (l = 0, len = trackIds.length; l < len; l++) {
|
57
|
+
id = trackIds[l];
|
58
|
+
if (id in store) {
|
59
|
+
svg.select('.' + id).remove();
|
60
|
+
delete store[id];
|
61
|
+
}
|
62
|
+
}
|
63
|
+
} else if (typeof trackIds === 'string') {
|
64
|
+
if (trackIds in store) {
|
65
|
+
svg.select('.' + trackIds).remove();
|
66
|
+
delete store[trackIds];
|
67
|
+
}
|
68
|
+
} else if (typeof trackIds === 'undefined') {
|
69
|
+
for (trackId in store) {
|
70
|
+
svg.select('.' + trackId).remove();
|
71
|
+
delete store[trackId];
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
return this;
|
76
|
+
};
|
77
|
+
|
78
|
+
circosJS.Core.prototype.layout = function(conf, data) {
|
79
|
+
this._layout = new circosJS.Layout(conf, data);
|
80
|
+
return this;
|
81
|
+
};
|
82
|
+
|
83
|
+
circosJS.log = function(level, code, message, data) {
|
84
|
+
var levels;
|
85
|
+
levels = ['Permanent log', 'Error', 'Warning', 'Info'];
|
86
|
+
console.log('CircosJS: ', levels[level] + ' [' + code + '] ', message, data);
|
87
|
+
};
|
88
|
+
|
89
|
+
circosJS.mixConf = function(conf, defaultConf) {
|
90
|
+
var key, newConf, value;
|
91
|
+
newConf = {};
|
92
|
+
for (key in defaultConf) {
|
93
|
+
value = defaultConf[key];
|
94
|
+
if (key in conf) {
|
95
|
+
if (Object.prototype.toString.call(value) === '[object Array]') {
|
96
|
+
newConf[key] = conf[key];
|
97
|
+
} else if (typeof value === 'object' && (value != null)) {
|
98
|
+
if ((value != null) && Object.keys(value).length === 0) {
|
99
|
+
newConf[key] = conf[key];
|
100
|
+
} else {
|
101
|
+
newConf[key] = circosJS.mixConf(conf[key], value);
|
102
|
+
}
|
103
|
+
} else {
|
104
|
+
newConf[key] = conf[key];
|
105
|
+
}
|
106
|
+
} else {
|
107
|
+
newConf[key] = value;
|
108
|
+
}
|
109
|
+
}
|
110
|
+
return newConf;
|
111
|
+
};
|
112
|
+
|
113
|
+
circosJS.Core.prototype.smartBorders = function() {
|
114
|
+
var border, borders, currentBorder, l, layout, len, ref, store, track, trackId, trackType, width;
|
115
|
+
width = this.conf.defaultTrackWidth;
|
116
|
+
layout = {
|
117
|
+
'in': this._layout.conf.innerRadius,
|
118
|
+
out: this._layout.conf.outerRadius
|
119
|
+
};
|
120
|
+
borders = [];
|
121
|
+
ref = this.tracks;
|
122
|
+
for (trackType in ref) {
|
123
|
+
store = ref[trackType];
|
124
|
+
for (trackId in store) {
|
125
|
+
track = store[trackId];
|
126
|
+
if (track.conf.innerRadius) {
|
127
|
+
borders.push({
|
128
|
+
'in': track.conf.innerRadius,
|
129
|
+
out: track.conf.outerRadius
|
130
|
+
});
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
borders = borders.sort(function(a, b) {
|
135
|
+
if (a.out > b.out) {
|
136
|
+
1;
|
137
|
+
}
|
138
|
+
if (a.out < b.out) {
|
139
|
+
-1;
|
140
|
+
}
|
141
|
+
return 0;
|
142
|
+
});
|
143
|
+
currentBorder = layout;
|
144
|
+
for (l = 0, len = borders.length; l < len; l++) {
|
145
|
+
border = borders[l];
|
146
|
+
if (border.out < currentBorder['in'] - width) {
|
147
|
+
return {
|
148
|
+
'in': currentBorder['in'] - width,
|
149
|
+
out: currentBorder['in']
|
150
|
+
};
|
151
|
+
}
|
152
|
+
currentBorder = border;
|
153
|
+
}
|
154
|
+
if (currentBorder['in'] > width) {
|
155
|
+
return {
|
156
|
+
'in': currentBorder['in'] - width,
|
157
|
+
out: currentBorder['in']
|
158
|
+
};
|
159
|
+
} else {
|
160
|
+
return {
|
161
|
+
'in': borders[0].out,
|
162
|
+
out: borders[0].out + width
|
163
|
+
};
|
164
|
+
}
|
165
|
+
};
|
166
|
+
|
167
|
+
if (typeof module !== 'undefined' && module !== null) {
|
168
|
+
module.exports = circosJS;
|
169
|
+
}
|
170
|
+
|
171
|
+
circosJS.checkParent = function(key, index, layoutSummary, header) {
|
172
|
+
if (!(key in layoutSummary)) {
|
173
|
+
circosJS.log(1, 'datum', 'unknown parent id', {
|
174
|
+
line: index + 1,
|
175
|
+
value: key,
|
176
|
+
header: header,
|
177
|
+
layoutSummary: layoutSummary
|
178
|
+
});
|
179
|
+
return false;
|
180
|
+
}
|
181
|
+
return true;
|
182
|
+
};
|
183
|
+
|
184
|
+
circosJS.checkNumber = function(keys, index) {
|
185
|
+
var header, value;
|
186
|
+
for (header in keys) {
|
187
|
+
value = keys[header];
|
188
|
+
if (isNaN(value)) {
|
189
|
+
circosJS.log(1, 'datum', 'not a number', {
|
190
|
+
line: index + 1,
|
191
|
+
value: value,
|
192
|
+
header: header
|
193
|
+
});
|
194
|
+
return false;
|
195
|
+
}
|
196
|
+
}
|
197
|
+
return true;
|
198
|
+
};
|
199
|
+
|
200
|
+
circosJS.parseSpanValueData = function(data, layoutSummary) {
|
201
|
+
var groups, sample;
|
202
|
+
if (!(data.length > 0)) {
|
203
|
+
return {
|
204
|
+
data: [],
|
205
|
+
meta: {
|
206
|
+
min: null,
|
207
|
+
max: null
|
208
|
+
}
|
209
|
+
};
|
210
|
+
}
|
211
|
+
sample = data[0];
|
212
|
+
if ('parent_id' in sample && 'start' in sample && 'end' in sample && 'value' in sample) {
|
213
|
+
data = data.map(function(datum) {
|
214
|
+
return [datum.parent_id, datum.start, datum.end, datum.value];
|
215
|
+
});
|
216
|
+
}
|
217
|
+
data = data.filter(function(datum, index) {
|
218
|
+
return circosJS.checkParent(datum[0], index, layoutSummary, 'parent');
|
219
|
+
}).filter(function(datum, index) {
|
220
|
+
return circosJS.checkNumber({
|
221
|
+
start: datum[1],
|
222
|
+
end: datum[2],
|
223
|
+
value: datum[3]
|
224
|
+
}, index);
|
225
|
+
}).map(function(datum) {
|
226
|
+
if (datum[1] < 0 || datum[2] > layoutSummary[datum[0]]) {
|
227
|
+
circosJS.log(2, 'position', 'position inconsistency', {
|
228
|
+
datum: datum,
|
229
|
+
layoutSummary: layoutSummary
|
230
|
+
});
|
231
|
+
}
|
232
|
+
return {
|
233
|
+
block_id: datum[0],
|
234
|
+
start: Math.max(0, parseFloat(datum[1])),
|
235
|
+
end: Math.min(layoutSummary[datum[0]], parseFloat(datum[2])),
|
236
|
+
value: parseFloat(datum[3]) || 1
|
237
|
+
};
|
238
|
+
});
|
239
|
+
groups = d3.nest().key(function(datum) {
|
240
|
+
return datum.block_id;
|
241
|
+
}).entries(data);
|
242
|
+
return {
|
243
|
+
data: groups,
|
244
|
+
meta: {
|
245
|
+
min: d3.min(data, function(d) {
|
246
|
+
return d.value;
|
247
|
+
}),
|
248
|
+
max: d3.max(data, function(d) {
|
249
|
+
return d.value;
|
250
|
+
})
|
251
|
+
}
|
252
|
+
};
|
253
|
+
};
|
254
|
+
|
255
|
+
circosJS.parseSpanStringData = function(data, layoutSummary) {
|
256
|
+
var groups, sample;
|
257
|
+
sample = data[0];
|
258
|
+
if ('parent_id' in sample && 'start' in sample && 'end' in sample && 'value' in sample) {
|
259
|
+
data = data.map(function(datum) {
|
260
|
+
return [datum.parent_id, datum.start, datum.end, datum.value];
|
261
|
+
});
|
262
|
+
}
|
263
|
+
data = data.filter(function(datum, index) {
|
264
|
+
return circosJS.checkParent(datum[0], index, layoutSummary, 'parent');
|
265
|
+
}).filter(function(datum, index) {
|
266
|
+
return circosJS.checkNumber({
|
267
|
+
start: datum[1],
|
268
|
+
end: datum[2]
|
269
|
+
}, index);
|
270
|
+
}).map(function(datum) {
|
271
|
+
var value;
|
272
|
+
if (datum[1] < 0 || datum[2] > layoutSummary[datum[0]]) {
|
273
|
+
circosJS.log(2, 'position', 'position inconsistency', {
|
274
|
+
datum: datum,
|
275
|
+
layoutSummary: layoutSummary
|
276
|
+
});
|
277
|
+
}
|
278
|
+
value = datum[3] != null ? datum[3] : null;
|
279
|
+
return {
|
280
|
+
block_id: datum[0],
|
281
|
+
start: Math.max(0, parseFloat(datum[1])),
|
282
|
+
end: Math.min(layoutSummary[datum[0]], parseFloat(datum[2])),
|
283
|
+
value: value
|
284
|
+
};
|
285
|
+
});
|
286
|
+
groups = d3.nest().key(function(datum) {
|
287
|
+
return datum.block_id;
|
288
|
+
}).entries(data);
|
289
|
+
return {
|
290
|
+
data: groups,
|
291
|
+
meta: {
|
292
|
+
min: d3.min(data, function(d) {
|
293
|
+
return d.value;
|
294
|
+
}),
|
295
|
+
max: d3.max(data, function(d) {
|
296
|
+
return d.value;
|
297
|
+
})
|
298
|
+
}
|
299
|
+
};
|
300
|
+
};
|
301
|
+
|
302
|
+
circosJS.parsePositionValueData = function(data, layoutSummary) {
|
303
|
+
var groups, sample;
|
304
|
+
sample = data[0];
|
305
|
+
if ('parent_id' in sample && 'position' in sample) {
|
306
|
+
data = data.map(function(datum) {
|
307
|
+
return [datum.parent_id, datum.position, datum.value];
|
308
|
+
});
|
309
|
+
}
|
310
|
+
data = data.filter(function(datum, index) {
|
311
|
+
return circosJS.checkParent(datum[0], index, layoutSummary, 'parent');
|
312
|
+
}).filter(function(datum, index) {
|
313
|
+
return circosJS.checkNumber({
|
314
|
+
position: datum[1],
|
315
|
+
value: datum[2]
|
316
|
+
}, index);
|
317
|
+
}).map(function(datum) {
|
318
|
+
return {
|
319
|
+
block_id: datum[0],
|
320
|
+
position: Math.min(layoutSummary[datum[0]], parseFloat(datum[1])),
|
321
|
+
value: parseFloat(datum[2]) || 1
|
322
|
+
};
|
323
|
+
});
|
324
|
+
groups = d3.nest().key(function(datum) {
|
325
|
+
return datum.block_id;
|
326
|
+
}).entries(data);
|
327
|
+
return {
|
328
|
+
data: groups,
|
329
|
+
meta: {
|
330
|
+
min: d3.min(data, function(d) {
|
331
|
+
return d.value;
|
332
|
+
}),
|
333
|
+
max: d3.max(data, function(d) {
|
334
|
+
return d.value;
|
335
|
+
})
|
336
|
+
}
|
337
|
+
};
|
338
|
+
};
|
339
|
+
|
340
|
+
circosJS.parsePositionTextData = function(data, layoutSummary) {
|
341
|
+
var groups, sample;
|
342
|
+
sample = data[0];
|
343
|
+
if ('parent_id' in sample && 'position' in sample) {
|
344
|
+
data = data.map(function(datum) {
|
345
|
+
return [datum.parent_id, datum.position, datum.value];
|
346
|
+
});
|
347
|
+
}
|
348
|
+
data = data.filter(function(datum, index) {
|
349
|
+
return circosJS.checkParent(datum[0], index, layoutSummary, 'parent');
|
350
|
+
}).filter(function(datum, index) {
|
351
|
+
return circosJS.checkNumber({
|
352
|
+
position: datum[1]
|
353
|
+
}, index);
|
354
|
+
}).map(function(datum) {
|
355
|
+
return {
|
356
|
+
block_id: datum[0],
|
357
|
+
position: Math.min(layoutSummary[datum[0]], parseFloat(datum[1])),
|
358
|
+
value: datum[2]
|
359
|
+
};
|
360
|
+
});
|
361
|
+
groups = d3.nest().key(function(datum) {
|
362
|
+
return datum.block_id;
|
363
|
+
}).entries(data);
|
364
|
+
return {
|
365
|
+
data: groups,
|
366
|
+
meta: {
|
367
|
+
min: d3.min(data, function(d) {
|
368
|
+
return d.value;
|
369
|
+
}),
|
370
|
+
max: d3.max(data, function(d) {
|
371
|
+
return d.value;
|
372
|
+
})
|
373
|
+
}
|
374
|
+
};
|
375
|
+
};
|
376
|
+
|
377
|
+
circosJS.parseChordData = function(data, layoutSummary) {
|
378
|
+
var sample;
|
379
|
+
sample = data[0];
|
380
|
+
if ('source_id' in sample && 'source_start' in sample && 'source_end' && 'target_id' in sample && 'target_start' in sample && 'target_end' in sample) {
|
381
|
+
data = data.map(function(datum) {
|
382
|
+
var elts;
|
383
|
+
elts = [datum.source_id, datum.source_start, datum.source_end, datum.target_id, datum.target_start, datum.target_end];
|
384
|
+
if (datum.value != null) {
|
385
|
+
elts.push(datum.value);
|
386
|
+
}
|
387
|
+
return elts;
|
388
|
+
});
|
389
|
+
}
|
390
|
+
data = data.filter(function(datum, index) {
|
391
|
+
return circosJS.checkParent(datum[0], index, layoutSummary, 'source_id');
|
392
|
+
}).filter(function(datum, index) {
|
393
|
+
return circosJS.checkParent(datum[3], index, layoutSummary, 'target_id');
|
394
|
+
}).filter(function(datum, index) {
|
395
|
+
return circosJS.checkNumber({
|
396
|
+
source_start: datum[1],
|
397
|
+
source_end: datum[2],
|
398
|
+
target_start: datum[4],
|
399
|
+
target_end: datum[5],
|
400
|
+
value: datum[6] || 1
|
401
|
+
}, index);
|
402
|
+
}).map(function(datum) {
|
403
|
+
return {
|
404
|
+
source: {
|
405
|
+
id: datum[0],
|
406
|
+
start: Math.max(0, parseFloat(datum[1])),
|
407
|
+
end: Math.min(layoutSummary[datum[0]], parseFloat(datum[2]))
|
408
|
+
},
|
409
|
+
target: {
|
410
|
+
id: datum[3],
|
411
|
+
start: Math.max(0, parseFloat(datum[4])),
|
412
|
+
end: Math.min(layoutSummary[datum[3]], parseFloat(datum[5]))
|
413
|
+
},
|
414
|
+
value: parseFloat(datum[6]),
|
415
|
+
hsp: datum[7]
|
416
|
+
};
|
417
|
+
});
|
418
|
+
return {
|
419
|
+
data: data,
|
420
|
+
meta: {
|
421
|
+
min: d3.min(data, function(d) {
|
422
|
+
return d.value;
|
423
|
+
}),
|
424
|
+
max: d3.max(data, function(d) {
|
425
|
+
return d.value;
|
426
|
+
})
|
427
|
+
}
|
428
|
+
};
|
429
|
+
};
|
430
|
+
|
431
|
+
circosJS.Layout = function(conf, data) {
|
432
|
+
var block_nb, gap, k, offset, ref, ref1, size, v;
|
433
|
+
if (data == null) {
|
434
|
+
circosJS.log(2, 'no layout data', '');
|
435
|
+
}
|
436
|
+
this.conf = circosJS.mixConf(conf, JSON.parse(JSON.stringify(this.defaultConf)));
|
437
|
+
this.data = data;
|
438
|
+
this.blocks = {};
|
439
|
+
this.size = 0;
|
440
|
+
offset = 0;
|
441
|
+
ref = this.data;
|
442
|
+
for (k in ref) {
|
443
|
+
v = ref[k];
|
444
|
+
this.blocks[v.id] = {
|
445
|
+
label: v.label,
|
446
|
+
len: v.len,
|
447
|
+
color: v.color,
|
448
|
+
offset: offset
|
449
|
+
};
|
450
|
+
v.offset = offset;
|
451
|
+
offset += v.len;
|
452
|
+
}
|
453
|
+
this.size = offset;
|
454
|
+
gap = this.conf.gap;
|
455
|
+
size = this.size;
|
456
|
+
block_nb = this.data.length;
|
457
|
+
ref1 = this.data;
|
458
|
+
for (k in ref1) {
|
459
|
+
v = ref1[k];
|
460
|
+
this.blocks[v.id].start = v.offset / size * (2 * Math.PI - block_nb * gap) + k * gap;
|
461
|
+
this.blocks[v.id].end = (v.offset + v.len) / size * (2 * Math.PI - block_nb * gap) + k * gap;
|
462
|
+
v.start = v.offset / size * (2 * Math.PI - block_nb * gap) + k * gap;
|
463
|
+
v.end = (v.offset + v.len) / size * (2 * Math.PI - block_nb * gap) + k * gap;
|
464
|
+
}
|
465
|
+
this.getAngle = function(blockId, unit) {
|
466
|
+
var block;
|
467
|
+
block = this.blocks[blockId].start / this._size;
|
468
|
+
if (unit === 'deg') {
|
469
|
+
return block * 360;
|
470
|
+
} else if (unit === 'rad') {
|
471
|
+
return block * 2 * Math.PI;
|
472
|
+
} else {
|
473
|
+
return null;
|
474
|
+
}
|
475
|
+
};
|
476
|
+
this.summary = function() {
|
477
|
+
var d, l, layoutSummary, len, ref2;
|
478
|
+
layoutSummary = {};
|
479
|
+
ref2 = this._data;
|
480
|
+
for (l = 0, len = ref2.length; l < len; l++) {
|
481
|
+
d = ref2[l];
|
482
|
+
layoutSummary[d.id] = d.len;
|
483
|
+
}
|
484
|
+
return layoutSummary;
|
485
|
+
};
|
486
|
+
return this;
|
487
|
+
};
|
488
|
+
|
489
|
+
circosJS.Core.prototype.heatmap = function(id, conf, data) {
|
490
|
+
var track;
|
491
|
+
track = new circosJS.Heatmap();
|
492
|
+
track.build(this, conf, data);
|
493
|
+
this.tracks.heatmaps[id] = track;
|
494
|
+
return this;
|
495
|
+
};
|
496
|
+
|
497
|
+
circosJS.Core.prototype.histogram = function(id, conf, data) {
|
498
|
+
var track;
|
499
|
+
track = new circosJS.Histogram();
|
500
|
+
track.build(this, conf, data);
|
501
|
+
this.tracks.histograms[id] = track;
|
502
|
+
return this;
|
503
|
+
};
|
504
|
+
|
505
|
+
circosJS.Core.prototype.chord = function(id, conf, data) {
|
506
|
+
var track;
|
507
|
+
track = new circosJS.Chord();
|
508
|
+
track.build(this, conf, data);
|
509
|
+
this.tracks.chords[id] = track;
|
510
|
+
return this;
|
511
|
+
};
|
512
|
+
|
513
|
+
circosJS.Core.prototype.scatter = function(id, conf, data) {
|
514
|
+
var track;
|
515
|
+
track = new circosJS.Scatter();
|
516
|
+
track.build(this, conf, data);
|
517
|
+
this.tracks.scatters[id] = track;
|
518
|
+
return this;
|
519
|
+
};
|
520
|
+
|
521
|
+
circosJS.Core.prototype.line = function(id, conf, data) {
|
522
|
+
var track;
|
523
|
+
track = new circosJS.Line();
|
524
|
+
track.build(this, conf, data);
|
525
|
+
this.tracks.lines[id] = track;
|
526
|
+
return this;
|
527
|
+
};
|
528
|
+
|
529
|
+
circosJS.Core.prototype.stack = function(id, conf, data) {
|
530
|
+
var track;
|
531
|
+
track = new circosJS.Stack();
|
532
|
+
track.build(this, conf, data);
|
533
|
+
this.tracks.stacks[id] = track;
|
534
|
+
return this;
|
535
|
+
};
|
536
|
+
|
537
|
+
circosJS.Core.prototype.highlight = function(id, conf, data) {
|
538
|
+
var track;
|
539
|
+
track = new circosJS.Highlight();
|
540
|
+
track.build(this, conf, data);
|
541
|
+
this.tracks.highlights[id] = track;
|
542
|
+
return this;
|
543
|
+
};
|
544
|
+
|
545
|
+
circosJS.Core.prototype.text = function(id, conf, data) {
|
546
|
+
var track;
|
547
|
+
track = new circosJS.Text();
|
548
|
+
track.build(this, conf, data);
|
549
|
+
this.tracks.texts[id] = track;
|
550
|
+
return this;
|
551
|
+
};
|
552
|
+
|
553
|
+
circosJS.Chord = function() {
|
554
|
+
circosJS.Track.call(this);
|
555
|
+
this.parseData = circosJS.parseChordData;
|
556
|
+
this.applyRules = function(rules, data) {
|
557
|
+
var datum, l, len, results, rule;
|
558
|
+
rules = rules || [];
|
559
|
+
results = [];
|
560
|
+
for (l = 0, len = data.length; l < len; l++) {
|
561
|
+
datum = data[l];
|
562
|
+
results.push((function() {
|
563
|
+
var len1, m, results1;
|
564
|
+
results1 = [];
|
565
|
+
for (m = 0, len1 = rules.length; m < len1; m++) {
|
566
|
+
rule = rules[m];
|
567
|
+
if (rule.condition(datum)) {
|
568
|
+
results1.push(datum[rule.parameter] = rule.value);
|
569
|
+
} else {
|
570
|
+
results1.push(void 0);
|
571
|
+
}
|
572
|
+
}
|
573
|
+
return results1;
|
574
|
+
})());
|
575
|
+
}
|
576
|
+
return results;
|
577
|
+
};
|
578
|
+
this.getSource = (function(_this) {
|
579
|
+
return function(d, layout) {
|
580
|
+
var block, endAngle, result, startAngle;
|
581
|
+
d = d.source;
|
582
|
+
block = layout.blocks[d.id];
|
583
|
+
startAngle = block.start + d.start / block.len * (block.end - block.start);
|
584
|
+
endAngle = block.start + d.end / block.len * (block.end - block.start);
|
585
|
+
return result = {
|
586
|
+
radius: layout.conf.innerRadius,
|
587
|
+
startAngle: startAngle,
|
588
|
+
endAngle: endAngle
|
589
|
+
};
|
590
|
+
};
|
591
|
+
})(this);
|
592
|
+
this.getTarget = (function(_this) {
|
593
|
+
return function(d, layout) {
|
594
|
+
var block, endAngle, result, startAngle;
|
595
|
+
d = d.target;
|
596
|
+
block = layout.blocks[d.id];
|
597
|
+
startAngle = block.start + d.start / block.len * (block.end - block.start);
|
598
|
+
endAngle = block.start + d.end / block.len * (block.end - block.start);
|
599
|
+
return result = {
|
600
|
+
radius: layout.conf.innerRadius,
|
601
|
+
startAngle: startAngle,
|
602
|
+
endAngle: endAngle
|
603
|
+
};
|
604
|
+
};
|
605
|
+
})(this);
|
606
|
+
this.dimChords = function (parentElement, d, conf, index) {
|
607
|
+
parentElement.selectAll('path').style('opacity', function (p, i) {
|
608
|
+
if (index == i) {
|
609
|
+
return 1;
|
610
|
+
}
|
611
|
+
return 0;
|
612
|
+
});
|
613
|
+
};
|
614
|
+
this.resetChords = function (parentElement,conf) {
|
615
|
+
parentElement.selectAll('path').style('opacity',conf.opacity);
|
616
|
+
};
|
617
|
+
this.renderChords = function(parentElement, name, conf, data, layout, ratio, getSource, getTarget) {
|
618
|
+
var link, track;
|
619
|
+
track = parentElement.append('g').attr('class', conf.colorPalette);
|
620
|
+
link = track.selectAll('.chord').data(data).enter().append('path').attr('class', 'chord').attr('d', d3.svg.chord().source(function(d) {
|
621
|
+
return getSource(d, layout);
|
622
|
+
}).target(function(d) {
|
623
|
+
return getTarget(d, layout);
|
624
|
+
})).attr('opacity', function(d) {
|
625
|
+
return conf.opacity;
|
626
|
+
}).attr('id',function (d) {
|
627
|
+
return d.source.id+'_'+d.target.id;
|
628
|
+
}).on('mouseover', (function(_this) {
|
629
|
+
return function(d, i, j) {
|
630
|
+
_this.dimChords(track, d, conf, i);
|
631
|
+
return _this.dispatch.mouseover(d, i, j);
|
632
|
+
};
|
633
|
+
})(this)).on('mouseout', (function(_this) {
|
634
|
+
return function(d, i, j) {
|
635
|
+
_this.resetChords(track,conf);
|
636
|
+
return _this.dispatch.mouseout(d, i, j);
|
637
|
+
};
|
638
|
+
})(this));
|
639
|
+
if (conf.usePalette) {
|
640
|
+
link.attr('class', function(d) {
|
641
|
+
return 'q' + ratio(d.value, conf.cmin, conf.cmax, conf.colorPaletteSize, conf.colorPaletteReverse, conf.logScale) + '-' + conf.colorPaletteSize;
|
642
|
+
});
|
643
|
+
} else {
|
644
|
+
link.attr('fill', function(d) {
|
645
|
+
return d.color || conf.color;
|
646
|
+
});
|
647
|
+
}
|
648
|
+
return link;
|
649
|
+
};
|
650
|
+
this.render = (function(_this) {
|
651
|
+
return function(instance, parentElement, name) {
|
652
|
+
var selection, track;
|
653
|
+
parentElement.select('.' + name).remove();
|
654
|
+
track = parentElement.append('g').attr('class', name).attr('z-index', _this.conf.zIndex);
|
655
|
+
selection = _this.renderChords(track, name, _this.conf, _this.data, instance._layout, _this.ratio, _this.getSource, _this.getTarget);
|
656
|
+
if (_this.conf.tooltipContent != null) {
|
657
|
+
return circosJS.registerTooltip(instance, _this, selection, _this.conf);
|
658
|
+
}
|
659
|
+
};
|
660
|
+
})(this);
|
661
|
+
return this;
|
662
|
+
};
|
663
|
+
|
664
|
+
circosJS.Heatmap = function() {
|
665
|
+
circosJS.Track.call(this);
|
666
|
+
this.parseData = circosJS.parseSpanValueData;
|
667
|
+
this.renderDatumContainer = (function(_this) {
|
668
|
+
return function(instance, parentElement, name, data, conf) {
|
669
|
+
var group, track;
|
670
|
+
track = parentElement.append('g').attr('class', conf.colorPalette);
|
671
|
+
return group = _this.renderBlock(track, data, instance._layout, conf);
|
672
|
+
};
|
673
|
+
})(this);
|
674
|
+
this.renderDatum = function(parentElement, conf, layout, utils) {
|
675
|
+
return parentElement.selectAll('tile').data(function(d) {
|
676
|
+
return d.values;
|
677
|
+
}).enter().append('path').attr('class', 'tile').attr('opacity', function(d) {
|
678
|
+
return d.opacity || conf.opacity;
|
679
|
+
}).attr('d', d3.svg.arc().innerRadius(conf.innerRadius).outerRadius(conf.outerRadius).startAngle(function(d, i) {
|
680
|
+
return utils.theta(d.start, layout.blocks[d.block_id]);
|
681
|
+
}).endAngle(function(d, i) {
|
682
|
+
return utils.theta(d.end, layout.blocks[d.block_id]);
|
683
|
+
})).attr('class', function(d) {
|
684
|
+
return 'q' + utils.ratio(d.value, conf.cmin, conf.cmax, conf.colorPaletteSize, conf.colorPaletteReverse, conf.logScale) + '-' + conf.colorPaletteSize;
|
685
|
+
});
|
686
|
+
};
|
687
|
+
return this;
|
688
|
+
};
|
689
|
+
|
690
|
+
circosJS.Highlight = function() {
|
691
|
+
circosJS.Track.call(this);
|
692
|
+
this.parseData = circosJS.parseSpanStringData;
|
693
|
+
this.renderDatumContainer = (function(_this) {
|
694
|
+
return function(instance, parentElement, name, data, conf) {
|
695
|
+
var group;
|
696
|
+
return group = _this.renderBlock(parentElement, data, instance._layout, conf);
|
697
|
+
};
|
698
|
+
})(this);
|
699
|
+
this.renderDatum = function(parentElement, conf, layout, utils) {
|
700
|
+
return parentElement.selectAll('tile').data(function(d) {
|
701
|
+
return d.values;
|
702
|
+
}).enter().append('path').attr('class', 'tile').attr('d', d3.svg.arc().innerRadius(conf.innerRadius).outerRadius(conf.outerRadius).startAngle(function(d, i) {
|
703
|
+
return utils.theta(d.start, layout.blocks[d.block_id]);
|
704
|
+
}).endAngle(function(d, i) {
|
705
|
+
return utils.theta(d.end, layout.blocks[d.block_id]);
|
706
|
+
})).attr('fill', function(d) {
|
707
|
+
return d.value || conf.color;
|
708
|
+
}).attr('opacity', function(d) {
|
709
|
+
return d.opacity || conf.opacity;
|
710
|
+
}).attr('stroke-width', function(d) {
|
711
|
+
return d.strokeWidth || conf.strokeWidth;
|
712
|
+
}).attr('stroke', function(d) {
|
713
|
+
return d.strokeColor || conf.strokeColor;
|
714
|
+
});
|
715
|
+
};
|
716
|
+
return this;
|
717
|
+
};
|
718
|
+
|
719
|
+
circosJS.Histogram = function() {
|
720
|
+
circosJS.Track.call(this);
|
721
|
+
this.parseData = circosJS.parseSpanValueData;
|
722
|
+
this.renderDatumContainer = (function(_this) {
|
723
|
+
return function(instance, parentElement, name, data, conf) {
|
724
|
+
var group, track;
|
725
|
+
track = parentElement.append('g').attr('class', _this.conf.colorPalette);
|
726
|
+
return group = _this.renderBlock(track, data, instance._layout, conf);
|
727
|
+
};
|
728
|
+
})(this);
|
729
|
+
this.renderDatum = function(parentElement, conf, layout, utils) {
|
730
|
+
var bin;
|
731
|
+
bin = parentElement.selectAll('.bin').data(function(d) {
|
732
|
+
return d.values;
|
733
|
+
}).enter().append('path').attr('class', 'bin').attr('opacity', function(d) {
|
734
|
+
return d.opacity || conf.opacity;
|
735
|
+
}).attr('d', d3.svg.arc().innerRadius(function(d) {
|
736
|
+
var height;
|
737
|
+
if (conf.direction === 'in') {
|
738
|
+
height = utils.ratio(d.value, conf.cmin, conf.cmax, conf.outerRadius - conf.innerRadius, false, conf.logscale);
|
739
|
+
return conf.outerRadius - height;
|
740
|
+
} else {
|
741
|
+
return conf.innerRadius;
|
742
|
+
}
|
743
|
+
}).outerRadius(function(d) {
|
744
|
+
var height;
|
745
|
+
if (conf.direction === 'out') {
|
746
|
+
height = utils.ratio(d.value, conf.cmin, conf.cmax, conf.outerRadius - conf.innerRadius, false, conf.logscale);
|
747
|
+
return conf.innerRadius + height;
|
748
|
+
} else {
|
749
|
+
return conf.outerRadius;
|
750
|
+
}
|
751
|
+
}).startAngle(function(d) {
|
752
|
+
return utils.theta(d.start, layout.blocks[d.block_id]);
|
753
|
+
}).endAngle(function(d) {
|
754
|
+
return utils.theta(d.end, layout.blocks[d.block_id]);
|
755
|
+
}));
|
756
|
+
if (conf.usePalette) {
|
757
|
+
bin.attr('class', function(d) {
|
758
|
+
return 'q' + utils.ratio(d.value, conf.cmin, conf.cmax, conf.colorPaletteSize, conf.colorPaletteReverse, conf.logScale) + '-' + conf.colorPaletteSize;
|
759
|
+
});
|
760
|
+
} else {
|
761
|
+
bin.attr('fill', d.color || conf.color);
|
762
|
+
}
|
763
|
+
return bin;
|
764
|
+
};
|
765
|
+
return this;
|
766
|
+
};
|
767
|
+
|
768
|
+
circosJS.Line = function() {
|
769
|
+
circosJS.Track.call(this);
|
770
|
+
this.parseData = circosJS.parsePositionValueData;
|
771
|
+
this.renderDatumContainer = (function(_this) {
|
772
|
+
return function(instance, parentElement, name, data, conf) {
|
773
|
+
var group, track;
|
774
|
+
track = parentElement.append('g').attr('class', name);
|
775
|
+
return group = _this.renderBlock(track, data, instance._layout, conf);
|
776
|
+
};
|
777
|
+
})(this);
|
778
|
+
this.renderDatum = function(parentElement, conf, layout, utils) {
|
779
|
+
var line;
|
780
|
+
line = d3.svg.line().x(function(d) {
|
781
|
+
return utils.x(d, layout, conf);
|
782
|
+
}).y(function(d) {
|
783
|
+
return utils.y(d, layout, conf);
|
784
|
+
}).interpolate(conf.interpolation);
|
785
|
+
return parentElement.append('path').datum(function(d) {
|
786
|
+
return d.values;
|
787
|
+
}).attr('class', 'line').attr('d', line).attr('opacity', function(d) {
|
788
|
+
return d.opacity || conf.opacity;
|
789
|
+
}).attr('stroke-width', function(d) {
|
790
|
+
return d.thickness || conf.thickness;
|
791
|
+
}).attr('stroke', function(d) {
|
792
|
+
return d.color || conf.color;
|
793
|
+
}).attr('fill', function(d) {
|
794
|
+
var color, fill;
|
795
|
+
fill = d.fill || conf.fill;
|
796
|
+
color = d.fill_color || conf.fill_color;
|
797
|
+
if (fill) {
|
798
|
+
return color;
|
799
|
+
} else {
|
800
|
+
return 'none';
|
801
|
+
}
|
802
|
+
});
|
803
|
+
};
|
804
|
+
return this;
|
805
|
+
};
|
806
|
+
|
807
|
+
circosJS.Scatter = function() {
|
808
|
+
circosJS.Track.call(this);
|
809
|
+
this.parseData = circosJS.parsePositionValueData;
|
810
|
+
this.renderDatumContainer = (function(_this) {
|
811
|
+
return function(instance, parentElement, name, data, conf) {
|
812
|
+
var group, track;
|
813
|
+
track = parentElement.append('g').attr('class', name);
|
814
|
+
return group = _this.renderBlock(track, data, instance._layout, conf);
|
815
|
+
};
|
816
|
+
})(this);
|
817
|
+
this.renderDatum = function(parentElement, conf, layout, utils) {
|
818
|
+
var point;
|
819
|
+
point = parentElement.selectAll('.point').data(function(d) {
|
820
|
+
return d.values;
|
821
|
+
}).enter().append('path').attr('class', 'point').attr('opacity', function(d) {
|
822
|
+
return d.opacity || conf.opacity;
|
823
|
+
}).attr('d', d3.svg.symbol().type(conf.glyph.shape).size(conf.glyph.size)).attr('transform', (function(_this) {
|
824
|
+
return function(d) {
|
825
|
+
return 'translate(' + utils.x(d, layout, conf) + ',' + utils.y(d, layout, conf) + ') rotate(' + utils.theta(d.position, layout.blocks[d.block_id]) * 360 / (2 * Math.PI) + ')';
|
826
|
+
};
|
827
|
+
})(this)).attr('stroke', function(d) {
|
828
|
+
return d.glyph_strokeColor || conf.glyph.strokeColor;
|
829
|
+
}).attr('stroke-width', function(d) {
|
830
|
+
return d.glyph_strokeWidth || conf.glyph.strokeWidth;
|
831
|
+
}).attr('fill', function(d) {
|
832
|
+
var color, fill;
|
833
|
+
fill = d.glyph_fill || conf.glyph.fill;
|
834
|
+
color = d.glyph_color || conf.glyph.color;
|
835
|
+
if (fill) {
|
836
|
+
return color;
|
837
|
+
} else {
|
838
|
+
return 'none';
|
839
|
+
}
|
840
|
+
});
|
841
|
+
return point;
|
842
|
+
};
|
843
|
+
return this;
|
844
|
+
};
|
845
|
+
|
846
|
+
circosJS.Stack = function() {
|
847
|
+
circosJS.Track.call(this);
|
848
|
+
this.parseData = circosJS.parseSpanValueData;
|
849
|
+
this.build = function(instance, conf, data, rules, backgrounds) {
|
850
|
+
this.loadData(data, instance);
|
851
|
+
this.conf = this.processConf(conf, this.defaultConf, this.meta, instance, this);
|
852
|
+
this.buildLayers(this.data, this.conf.margin);
|
853
|
+
return this.applyRules(conf.rules, this.data);
|
854
|
+
};
|
855
|
+
this.buildLayers = function(data, margin) {
|
856
|
+
var block, datum, i, idx, l, lastDatumInLayer, layer, layers, len, len1, m, placed, ref;
|
857
|
+
for (idx in data) {
|
858
|
+
block = data[idx];
|
859
|
+
block.values = block.values.sort(function(a, b) {
|
860
|
+
if (a.start < b.start) {
|
861
|
+
return -1;
|
862
|
+
}
|
863
|
+
if (a.start === b.start && a.end > b.end) {
|
864
|
+
return -1;
|
865
|
+
}
|
866
|
+
if (a.start === b.start && a.end === b.end) {
|
867
|
+
return 0;
|
868
|
+
}
|
869
|
+
return 1;
|
870
|
+
});
|
871
|
+
layers = [];
|
872
|
+
ref = block.values;
|
873
|
+
for (l = 0, len = ref.length; l < len; l++) {
|
874
|
+
datum = ref[l];
|
875
|
+
placed = false;
|
876
|
+
for (i = m = 0, len1 = layers.length; m < len1; i = ++m) {
|
877
|
+
layer = layers[i];
|
878
|
+
lastDatumInLayer = layer.slice(0).pop();
|
879
|
+
if (lastDatumInLayer.end + margin < datum.start) {
|
880
|
+
layer.push(datum);
|
881
|
+
datum.layer = i;
|
882
|
+
placed = true;
|
883
|
+
break;
|
884
|
+
}
|
885
|
+
}
|
886
|
+
if (!placed) {
|
887
|
+
datum.layer = layers.length;
|
888
|
+
}
|
889
|
+
if (!placed) {
|
890
|
+
layers.push([datum]);
|
891
|
+
}
|
892
|
+
}
|
893
|
+
}
|
894
|
+
};
|
895
|
+
this.applyRules = function(rules, data) {
|
896
|
+
var datum, i, k, layer, results, rule, v;
|
897
|
+
rules = rules || [];
|
898
|
+
results = [];
|
899
|
+
for (k in data) {
|
900
|
+
v = data[k];
|
901
|
+
results.push((function() {
|
902
|
+
var ref, results1;
|
903
|
+
ref = v.layers;
|
904
|
+
results1 = [];
|
905
|
+
for (i in ref) {
|
906
|
+
layer = ref[i];
|
907
|
+
results1.push((function() {
|
908
|
+
var l, len, results2;
|
909
|
+
results2 = [];
|
910
|
+
for (l = 0, len = layer.length; l < len; l++) {
|
911
|
+
datum = layer[l];
|
912
|
+
results2.push((function() {
|
913
|
+
var len1, m, results3;
|
914
|
+
results3 = [];
|
915
|
+
for (m = 0, len1 = rules.length; m < len1; m++) {
|
916
|
+
rule = rules[m];
|
917
|
+
if (rule.condition(v.parent, datum, i)) {
|
918
|
+
results3.push(datum[rule.parameter] = rule.value);
|
919
|
+
} else {
|
920
|
+
results3.push(void 0);
|
921
|
+
}
|
922
|
+
}
|
923
|
+
return results3;
|
924
|
+
})());
|
925
|
+
}
|
926
|
+
return results2;
|
927
|
+
})());
|
928
|
+
}
|
929
|
+
return results1;
|
930
|
+
})());
|
931
|
+
}
|
932
|
+
return results;
|
933
|
+
};
|
934
|
+
this.datumRadialPosition = (function(_this) {
|
935
|
+
return function(d) {
|
936
|
+
var origin, radialEnd, radialStart;
|
937
|
+
radialStart = (_this.conf.thickness + _this.conf.radialMargin) * d.layer;
|
938
|
+
radialEnd = radialStart + _this.conf.thickness;
|
939
|
+
if (_this.conf.direction === 'out') {
|
940
|
+
return [_this.conf.innerRadius + radialStart, Math.min(_this.conf.innerRadius + radialEnd, _this.conf.outerRadius)];
|
941
|
+
}
|
942
|
+
if (_this.conf.direction === 'in') {
|
943
|
+
return [Math.max(_this.conf.outerRadius - radialEnd, _this.conf.innerRadius), _this.conf.outerRadius - radialStart];
|
944
|
+
}
|
945
|
+
if (_this.conf.direction === 'center') {
|
946
|
+
origin = Math.floor((_this.conf.outerRadius + _this.conf.innerRadius) / 2);
|
947
|
+
radialStart = (_this.conf.thickness + _this.conf.radialMargin) * Math.floor(d.layer / 2);
|
948
|
+
radialEnd = radialStart + _this.conf.thickness;
|
949
|
+
if (d.layer % 2 === 0) {
|
950
|
+
return [origin + radialStart, origin + radialEnd];
|
951
|
+
} else {
|
952
|
+
return [origin - radialStart - _this.conf.radialMargin, origin - radialEnd - _this.conf.radialMargin];
|
953
|
+
}
|
954
|
+
}
|
955
|
+
};
|
956
|
+
})(this);
|
957
|
+
this.datumInnerRadius = (function(_this) {
|
958
|
+
return function(d, i, j) {
|
959
|
+
return _this.datumRadialPosition(d, i, j)[0];
|
960
|
+
};
|
961
|
+
})(this);
|
962
|
+
this.datumOuterRadius = (function(_this) {
|
963
|
+
return function(d, i, j) {
|
964
|
+
return _this.datumRadialPosition(d, i, j)[1];
|
965
|
+
};
|
966
|
+
})(this);
|
967
|
+
this.renderDatumContainer = (function(_this) {
|
968
|
+
return function(instance, parentElement, name, data, conf) {
|
969
|
+
var group, track;
|
970
|
+
track = parentElement.append('g').attr('class', conf.colorPalette);
|
971
|
+
return group = _this.renderBlock(track, data, instance._layout, conf);
|
972
|
+
};
|
973
|
+
})(this);
|
974
|
+
this.renderDatum = function(parentElement, conf, layout, utils) {
|
975
|
+
var tile;
|
976
|
+
tile = parentElement.selectAll('.tile').data(function(d) {
|
977
|
+
return d.values;
|
978
|
+
}).enter().append('path').attr('class', 'tile').attr('d', d3.svg.arc().innerRadius(utils.datumInnerRadius).outerRadius(utils.datumOuterRadius).startAngle(function(d) {
|
979
|
+
return utils.theta(d.start, layout.blocks[d.block_id]);
|
980
|
+
}).endAngle(function(d) {
|
981
|
+
return utils.theta(d.end, layout.blocks[d.block_id]);
|
982
|
+
}));
|
983
|
+
tile.attr('opacity', function(d) {
|
984
|
+
return d.opacity || conf.opacity;
|
985
|
+
});
|
986
|
+
tile.attr('stroke-width', function(d) {
|
987
|
+
return d.strokeWidth || conf.strokeWidth;
|
988
|
+
});
|
989
|
+
tile.attr('stroke', function(d) {
|
990
|
+
return d.strokeColor || conf.strokeColor;
|
991
|
+
});
|
992
|
+
tile.attr('fill', function(d) {
|
993
|
+
return d.color || conf.color;
|
994
|
+
});
|
995
|
+
tile.attr('class', function(d) {
|
996
|
+
var usePalette;
|
997
|
+
usePalette = d.usePalette || conf.usePalette;
|
998
|
+
if (usePalette) {
|
999
|
+
return 'q' + utils.ratio(d.value, conf.cmin, conf.cmax, conf.colorPaletteSize, conf.colorPaletteReverse, conf.logScale) + '-' + conf.colorPaletteSize;
|
1000
|
+
}
|
1001
|
+
});
|
1002
|
+
return tile;
|
1003
|
+
};
|
1004
|
+
return this;
|
1005
|
+
};
|
1006
|
+
|
1007
|
+
circosJS.Text = function() {
|
1008
|
+
circosJS.Track.call(this);
|
1009
|
+
this.parseData = circosJS.parsePositionTextData;
|
1010
|
+
this.renderDatumContainer = (function(_this) {
|
1011
|
+
return function(instance, parentElement, name, data, conf) {
|
1012
|
+
var group, track;
|
1013
|
+
track = parentElement.append('g').attr('class', name);
|
1014
|
+
return group = _this.renderBlock(track, data, instance._layout, conf);
|
1015
|
+
};
|
1016
|
+
})(this);
|
1017
|
+
this.renderDatum = function(parentElement, conf, layout, utils) {
|
1018
|
+
var key, ref, text, value;
|
1019
|
+
text = parentElement.selectAll('g').data(function(d) {
|
1020
|
+
return d.values;
|
1021
|
+
}).enter().append('g').append('text').text(function(d) {
|
1022
|
+
return d.value;
|
1023
|
+
}).attr('transform', function(d) {
|
1024
|
+
var angle;
|
1025
|
+
angle = utils.theta(d.position, layout.blocks[d.block_id]) * 360 / (2 * Math.PI) - 90;
|
1026
|
+
return 'rotate(' + angle + ')' + 'translate(' + conf.innerRadius + ',0)';
|
1027
|
+
});
|
1028
|
+
ref = conf.style;
|
1029
|
+
for (key in ref) {
|
1030
|
+
value = ref[key];
|
1031
|
+
text.style(key, value);
|
1032
|
+
}
|
1033
|
+
return text;
|
1034
|
+
};
|
1035
|
+
return this;
|
1036
|
+
};
|
1037
|
+
|
1038
|
+
circosJS.Track = function() {
|
1039
|
+
this.build = function(instance, conf, data) {
|
1040
|
+
this.dispatch = d3.dispatch('mouseover', 'mouseout');
|
1041
|
+
this.loadData(data, instance);
|
1042
|
+
this.conf = this.processConf(conf, this.defaultConf, this.meta, instance, this);
|
1043
|
+
return this.applyRules(conf.rules, this.data);
|
1044
|
+
};
|
1045
|
+
this.loadData = function(data, instance) {
|
1046
|
+
var d, l, layoutSummary, len, ref, result;
|
1047
|
+
layoutSummary = {};
|
1048
|
+
ref = instance._layout.data;
|
1049
|
+
for (l = 0, len = ref.length; l < len; l++) {
|
1050
|
+
d = ref[l];
|
1051
|
+
layoutSummary[d.id] = d.len;
|
1052
|
+
}
|
1053
|
+
result = this.parseData(data, layoutSummary);
|
1054
|
+
this.data = result.data;
|
1055
|
+
return this.meta = result.meta;
|
1056
|
+
};
|
1057
|
+
this.processConf = function(conf, defaultConf, meta, instance, utils) {
|
1058
|
+
var smartBorders;
|
1059
|
+
conf = circosJS.mixConf(conf, Object.assign({}, defaultConf));
|
1060
|
+
conf = utils.computeMinMax(conf, meta);
|
1061
|
+
if (conf.innerRadius === 0 && conf.outerRadius === 0) {
|
1062
|
+
smartBorders = instance.smartBorders();
|
1063
|
+
conf.innerRadius = smartBorders['in'];
|
1064
|
+
conf.outerRadius = smartBorders.out;
|
1065
|
+
}
|
1066
|
+
return conf;
|
1067
|
+
};
|
1068
|
+
this.applyRules = function(rules, data) {
|
1069
|
+
var datum, i, k, results, rule, v;
|
1070
|
+
rules = rules || [];
|
1071
|
+
results = [];
|
1072
|
+
for (k in data) {
|
1073
|
+
v = data[k];
|
1074
|
+
results.push((function() {
|
1075
|
+
var ref, results1;
|
1076
|
+
ref = v.values;
|
1077
|
+
results1 = [];
|
1078
|
+
for (i in ref) {
|
1079
|
+
datum = ref[i];
|
1080
|
+
results1.push((function() {
|
1081
|
+
var l, len, results2;
|
1082
|
+
results2 = [];
|
1083
|
+
for (l = 0, len = rules.length; l < len; l++) {
|
1084
|
+
rule = rules[l];
|
1085
|
+
if (rule.condition(v.key, datum, i)) {
|
1086
|
+
results2.push(datum[rule.parameter] = rule.value);
|
1087
|
+
} else {
|
1088
|
+
results2.push(void 0);
|
1089
|
+
}
|
1090
|
+
}
|
1091
|
+
return results2;
|
1092
|
+
})());
|
1093
|
+
}
|
1094
|
+
return results1;
|
1095
|
+
})());
|
1096
|
+
}
|
1097
|
+
return results;
|
1098
|
+
};
|
1099
|
+
this.computeMinMax = function(conf, meta) {
|
1100
|
+
conf.cmin = conf.min === 'smart' ? meta.min : conf.min;
|
1101
|
+
conf.cmax = conf.max === 'smart' ? meta.max : conf.max;
|
1102
|
+
return conf;
|
1103
|
+
};
|
1104
|
+
this.ratio = function(value, min, max, scope, reverse, logScale) {
|
1105
|
+
var fraction, scaleLogBase, x;
|
1106
|
+
scaleLogBase = logScale ? 2.3 : 1;
|
1107
|
+
if (min === max || (value === min && !reverse) || (value === max && reverse)) {
|
1108
|
+
return 0;
|
1109
|
+
}
|
1110
|
+
if (value === max || (value === min && reverse)) {
|
1111
|
+
return scope - 1;
|
1112
|
+
}
|
1113
|
+
fraction = (value - min) / (max - min);
|
1114
|
+
x = Math.exp(1 / scaleLogBase * Math.log(fraction));
|
1115
|
+
if (reverse) {
|
1116
|
+
x = 1 - x;
|
1117
|
+
}
|
1118
|
+
return Math.floor(scope * x);
|
1119
|
+
};
|
1120
|
+
this.render = (function(_this) {
|
1121
|
+
return function(instance, parentElement, name) {
|
1122
|
+
var datumContainer, ref, selection, track;
|
1123
|
+
parentElement.select('.' + name).remove();
|
1124
|
+
track = parentElement.append('g').attr('class', name).attr('z-index', _this.conf.zIndex);
|
1125
|
+
datumContainer = _this.renderDatumContainer(instance, track, name, _this.data, _this.conf);
|
1126
|
+
if ((ref = _this.conf.axes) != null ? ref.display : void 0) {
|
1127
|
+
_this.renderAxes(datumContainer, _this.conf, instance._layout, _this.data);
|
1128
|
+
}
|
1129
|
+
selection = _this.renderDatum(datumContainer, _this.conf, instance._layout, _this);
|
1130
|
+
if (_this.conf.tooltipContent != null) {
|
1131
|
+
circosJS.registerTooltip(instance, _this, selection, _this.conf);
|
1132
|
+
}
|
1133
|
+
selection.on('mouseover', function(d, i, j) {
|
1134
|
+
return _this.dispatch.mouseover(d, i, j);
|
1135
|
+
});
|
1136
|
+
return selection.on('mouseout', function(d, i, j) {
|
1137
|
+
return _this.dispatch.mouseout(d, i, j);
|
1138
|
+
});
|
1139
|
+
};
|
1140
|
+
})(this);
|
1141
|
+
this.renderBlock = function(parentElement, data, layout, conf) {
|
1142
|
+
var block, scope;
|
1143
|
+
scope = conf.outerRadius - conf.innerRadius;
|
1144
|
+
block = parentElement.selectAll('.block').data(data).enter().append('g').attr('class', 'block').attr('transform', function(d) {
|
1145
|
+
return 'rotate(' + layout.blocks[d.key].start * 360 / (2 * Math.PI) + ')';
|
1146
|
+
});
|
1147
|
+
if (conf.backgrounds) {
|
1148
|
+
block.selectAll('.background').data(conf.backgrounds).enter().append('path').attr('class', 'background').attr('fill', function(background) {
|
1149
|
+
return background.color;
|
1150
|
+
}).attr('opacity', function(background) {
|
1151
|
+
return background.opacity || 1;
|
1152
|
+
}).attr('d', d3.svg.arc().innerRadius(function(background) {
|
1153
|
+
if (conf.direction === 'in') {
|
1154
|
+
return conf.outerRadius - scope * background.start;
|
1155
|
+
} else {
|
1156
|
+
return conf.innerRadius + scope * background.start;
|
1157
|
+
}
|
1158
|
+
}).outerRadius(function(background) {
|
1159
|
+
if (conf.direction === 'in') {
|
1160
|
+
return conf.outerRadius - scope * background.end;
|
1161
|
+
} else {
|
1162
|
+
return conf.innerRadius + scope * background.end;
|
1163
|
+
}
|
1164
|
+
}).startAngle(function(d, i, j) {
|
1165
|
+
return 0;
|
1166
|
+
}).endAngle(function(d, i, j) {
|
1167
|
+
return layout.blocks[data[j].key].end - layout.blocks[data[j].key].start;
|
1168
|
+
}));
|
1169
|
+
}
|
1170
|
+
return block;
|
1171
|
+
};
|
1172
|
+
this.renderAxes = function(parentElement, conf, layout, data) {
|
1173
|
+
var axes, axis, x;
|
1174
|
+
if (conf.axes.minor.spacingType === 'pixel') {
|
1175
|
+
axes = (function() {
|
1176
|
+
var l, ref, ref1, ref2, results;
|
1177
|
+
results = [];
|
1178
|
+
for (x = l = ref = conf.innerRadius, ref1 = conf.outerRadius, ref2 = conf.axes.minor.spacing; ref2 > 0 ? l <= ref1 : l >= ref1; x = l += ref2) {
|
1179
|
+
results.push(x);
|
1180
|
+
}
|
1181
|
+
return results;
|
1182
|
+
})();
|
1183
|
+
}
|
1184
|
+
axis = d3.svg.arc().innerRadius(function(d) {
|
1185
|
+
return d;
|
1186
|
+
}).outerRadius(function(d) {
|
1187
|
+
return d;
|
1188
|
+
}).startAngle(0).endAngle(function(d, i, j) {
|
1189
|
+
var block;
|
1190
|
+
block = layout.blocks[data[j].key];
|
1191
|
+
return block.end - block.start;
|
1192
|
+
});
|
1193
|
+
return parentElement.selectAll('.axis').data(axes).enter().append('path').attr('opacity', conf.opacity).attr('class', 'axis').attr('d', axis).attr('stroke-width', function(d, i) {
|
1194
|
+
if (i % conf.axes.major.spacing === 0) {
|
1195
|
+
return conf.axes.major.thickness;
|
1196
|
+
} else {
|
1197
|
+
return conf.axes.minor.thickness;
|
1198
|
+
}
|
1199
|
+
}).attr('stroke', function(d, i) {
|
1200
|
+
if (i % conf.axes.major.spacing === 0) {
|
1201
|
+
return conf.axes.major.color;
|
1202
|
+
} else {
|
1203
|
+
return conf.axes.minor.color;
|
1204
|
+
}
|
1205
|
+
});
|
1206
|
+
};
|
1207
|
+
this.theta = function(position, block) {
|
1208
|
+
return position / block.len * (block.end - block.start);
|
1209
|
+
};
|
1210
|
+
this.x = (function(_this) {
|
1211
|
+
return function(d, layout, conf) {
|
1212
|
+
var angle, height, r;
|
1213
|
+
height = _this.ratio(d.value, conf.cmin, conf.cmax, conf.outerRadius - conf.innerRadius, false, conf.logscale);
|
1214
|
+
if (conf.direction === 'in') {
|
1215
|
+
r = conf.outerRadius - height;
|
1216
|
+
} else {
|
1217
|
+
r = conf.innerRadius + height;
|
1218
|
+
}
|
1219
|
+
angle = _this.theta(d.position, layout.blocks[d.block_id]) - Math.PI / 2;
|
1220
|
+
return r * Math.cos(angle);
|
1221
|
+
};
|
1222
|
+
})(this);
|
1223
|
+
this.y = (function(_this) {
|
1224
|
+
return function(d, layout, conf) {
|
1225
|
+
var angle, height, r;
|
1226
|
+
height = _this.ratio(d.value, conf.cmin, conf.cmax, conf.outerRadius - conf.innerRadius, false, conf.logscale);
|
1227
|
+
if (conf.direction === 'in') {
|
1228
|
+
r = conf.outerRadius - height;
|
1229
|
+
} else {
|
1230
|
+
r = conf.innerRadius + height;
|
1231
|
+
}
|
1232
|
+
angle = _this.theta(d.position, layout.blocks[d.block_id]) - Math.PI / 2;
|
1233
|
+
return r * Math.sin(angle);
|
1234
|
+
};
|
1235
|
+
})(this);
|
1236
|
+
this.ratio = function(value, min, max, scope, reverse, logScale) {
|
1237
|
+
var fraction, scaleLogBase, x;
|
1238
|
+
scaleLogBase = logScale ? 2.3 : 1;
|
1239
|
+
if (min === max || (value === min && !reverse) || (value === max && reverse)) {
|
1240
|
+
return 0;
|
1241
|
+
}
|
1242
|
+
if (value === max || (value === min && reverse)) {
|
1243
|
+
return scope - 1;
|
1244
|
+
}
|
1245
|
+
fraction = (value - min) / (max - min);
|
1246
|
+
x = Math.exp(1 / scaleLogBase * Math.log(fraction));
|
1247
|
+
if (reverse) {
|
1248
|
+
x = 1 - x;
|
1249
|
+
}
|
1250
|
+
return Math.floor(scope * x);
|
1251
|
+
};
|
1252
|
+
return this;
|
1253
|
+
};
|
1254
|
+
|
1255
|
+
circosJS.renderLayout = function(d3, parentElement, instance) {
|
1256
|
+
var block, conf, entry, layout;
|
1257
|
+
conf = instance._layout.conf;
|
1258
|
+
parentElement.select('.cs-layout').remove();
|
1259
|
+
layout = parentElement.append('g').attr('class', 'cs-layout').attr('z-index', conf.zIndex).on('click', conf.onClick);
|
1260
|
+
block = layout.selectAll('g').data(instance._layout.data).enter().append('g').attr('class', function(d) {
|
1261
|
+
return d.id;
|
1262
|
+
}).attr('opacity', conf.opacity);
|
1263
|
+
entry = d3.svg.arc().innerRadius(conf.innerRadius).outerRadius(conf.outerRadius).cornerRadius(conf.cornerRadius).startAngle(function(d) {
|
1264
|
+
return d.start;
|
1265
|
+
}).endAngle(function(d) {
|
1266
|
+
return d.end;
|
1267
|
+
});
|
1268
|
+
block.append('path').attr('d', entry).attr('fill', function(d) {
|
1269
|
+
return d.color;
|
1270
|
+
}).attr('id', function(d) {
|
1271
|
+
return d.id;
|
1272
|
+
});
|
1273
|
+
if (conf.labels.display) {
|
1274
|
+
circosJS.renderLayoutLabels(conf, d3, block);
|
1275
|
+
}
|
1276
|
+
if (conf.ticks.display) {
|
1277
|
+
return circosJS.renderLayoutTicks(conf, layout, d3, instance);
|
1278
|
+
}
|
1279
|
+
};
|
1280
|
+
|
1281
|
+
circosJS.renderLayoutLabels = function(conf, d3, block) {
|
1282
|
+
var label, labelArc, r;
|
1283
|
+
r = conf.innerRadius + conf.labels.radialOffset;
|
1284
|
+
labelArc = d3.svg.arc().innerRadius(r).outerRadius(r).startAngle(function(d, i) {
|
1285
|
+
return d.start;
|
1286
|
+
}).endAngle(function(d, i) {
|
1287
|
+
return d.end;
|
1288
|
+
});
|
1289
|
+
block.append('path').attr('fill', 'none').attr('stroke', 'none').attr('d', labelArc).attr('id', function(d) {
|
1290
|
+
return 'arc-label' + d.id;
|
1291
|
+
});
|
1292
|
+
label = block.append('text').attr('font-size', conf.labels.size).attr('text-anchor', 'middle');
|
1293
|
+
return label.append('textPath').attr('startOffset', '25%').attr('xlink:href', function(d) {
|
1294
|
+
return '#arc-label' + d.id;
|
1295
|
+
}).style('fill', conf.labels.color).text(function(d) {
|
1296
|
+
var arc_len = d.end - d.start;
|
1297
|
+
return d.label.slice(0, Math.floor(21 * arc_len)) + '..';
|
1298
|
+
});
|
1299
|
+
};
|
1300
|
+
|
1301
|
+
circosJS.renderLayoutTicks = function(conf, layout, d3, instance) {
|
1302
|
+
var blockTicks, displayLabel, ticks;
|
1303
|
+
blockTicks = function(d) {
|
1304
|
+
var k,space;
|
1305
|
+
k = (d.end - d.start) / d.len;
|
1306
|
+
if ((d.end - d.start) > 1.57) {
|
1307
|
+
space = 8;
|
1308
|
+
} else if ((d.end - d.start) > 0.785) {
|
1309
|
+
space = 4;
|
1310
|
+
} else if ((d.end - d.start) > 0.3925) {
|
1311
|
+
space = 2;
|
1312
|
+
} else if ((d.end - d.start) > 0) {
|
1313
|
+
space = 0;
|
1314
|
+
}
|
1315
|
+
var arr = [];
|
1316
|
+
var item = {angle: 0 * k + d.start, label: 0};
|
1317
|
+
arr.push(item);
|
1318
|
+
var temp_scale = d3.scale.linear()
|
1319
|
+
.domain([1, d.len])
|
1320
|
+
.range([d.start, d.end]);
|
1321
|
+
var len = temp_scale.ticks(space).length;
|
1322
|
+
temp_scale.ticks(space).map(function (v,i) {
|
1323
|
+
var init = v * k + d.start;
|
1324
|
+
var final = d.len * k +d.start;
|
1325
|
+
if ((final - init) > 0.5) {
|
1326
|
+
}
|
1327
|
+
var item = {
|
1328
|
+
angle: v * k + d.start,
|
1329
|
+
label: v / conf.ticks.labelDenominator + conf.ticks.labelSuffix
|
1330
|
+
};
|
1331
|
+
arr.push(item);
|
1332
|
+
});
|
1333
|
+
arr.splice(len, 1);
|
1334
|
+
var item = {
|
1335
|
+
angle: (d.len * k + d.start) - 0.006,
|
1336
|
+
label: d.len / conf.ticks.labelDenominator + conf.ticks.labelSuffix
|
1337
|
+
};
|
1338
|
+
arr.push(item);
|
1339
|
+
return arr;
|
1340
|
+
};
|
1341
|
+
displayLabel = function(v, i) {
|
1342
|
+
if (conf.ticks.labels === false) {
|
1343
|
+
return null;
|
1344
|
+
} else if (conf.ticks.labelDisplay0 === false && i === 0) {
|
1345
|
+
return null;
|
1346
|
+
} else if (i % conf.ticks.labelSpacing) {
|
1347
|
+
return null;
|
1348
|
+
} else if (i === 0) {
|
1349
|
+
return v / conf.ticks.labelDenominator; // added support for 0 without suffix.
|
1350
|
+
}
|
1351
|
+
else {
|
1352
|
+
return v / conf.ticks.labelDenominator + conf.ticks.labelSuffix;
|
1353
|
+
}
|
1354
|
+
};
|
1355
|
+
ticks = layout.append('g').selectAll('g').data(instance._layout.data).enter().append('g').selectAll('g').data(blockTicks).enter().append('g').attr('transform', function(d) {
|
1356
|
+
return 'rotate(' + (d.angle * 180 / Math.PI - 90) + ')' + 'translate(' + conf.outerRadius + ',0)';
|
1357
|
+
});
|
1358
|
+
ticks.append('line').attr('x1', 0).attr('y1', 1).attr('x2', function(d, i) {
|
1359
|
+
return conf.ticks.size.major;
|
1360
|
+
}).attr('y2', 1).style('stroke', conf.ticks.color);
|
1361
|
+
return ticks.append('text').attr('x', 8).attr('dy', '.35em').attr('transform', function(d) {
|
1362
|
+
if (d.angle > Math.PI) {
|
1363
|
+
return 'rotate(180)translate(-16)';
|
1364
|
+
} else {
|
1365
|
+
return null;
|
1366
|
+
}
|
1367
|
+
}).attr('text-anchor', function(d) {
|
1368
|
+
if (d.angle > Math.PI) {
|
1369
|
+
return 'end';
|
1370
|
+
} else {
|
1371
|
+
return null;
|
1372
|
+
}
|
1373
|
+
}).attr('font-size', conf.ticks.labelSize).style('fill', conf.ticks.labelColor).text(function(d) {
|
1374
|
+
return d.label;
|
1375
|
+
});
|
1376
|
+
};
|
1377
|
+
|
1378
|
+
circosJS.Core.prototype.render = function(ids, removeTracks) {
|
1379
|
+
var name, ref, ref1, renderAll, svg, track, trackStore, trackType, tracks, translated;
|
1380
|
+
if (typeof ids === 'undefined') {
|
1381
|
+
renderAll = true;
|
1382
|
+
ids = [];
|
1383
|
+
}
|
1384
|
+
if (removeTracks) {
|
1385
|
+
ref = this.tracks;
|
1386
|
+
for (trackType in ref) {
|
1387
|
+
trackStore = ref[trackType];
|
1388
|
+
for (name in trackStore) {
|
1389
|
+
track = trackStore[name];
|
1390
|
+
svg.select('.' + name).remove();
|
1391
|
+
}
|
1392
|
+
}
|
1393
|
+
}
|
1394
|
+
svg = d3.select(this.conf.container).attr('width', this.conf.width).attr('height', this.conf.height);
|
1395
|
+
translated = svg.select('.all');
|
1396
|
+
if (translated.empty()) {
|
1397
|
+
translated = svg.append('g').attr('class', 'all').attr('transform', 'translate(' + parseInt(this.conf.width / 2) + ',' + parseInt(this.conf.height / 2) + ')');
|
1398
|
+
}
|
1399
|
+
ref1 = this.tracks;
|
1400
|
+
for (trackType in ref1) {
|
1401
|
+
trackStore = ref1[trackType];
|
1402
|
+
for (name in trackStore) {
|
1403
|
+
track = trackStore[name];
|
1404
|
+
if (renderAll || indexOf.call(ids, name) >= 0) {
|
1405
|
+
track.render(this, translated, name);
|
1406
|
+
}
|
1407
|
+
}
|
1408
|
+
}
|
1409
|
+
if (renderAll || indexOf.call(ids, 'layout') >= 0) {
|
1410
|
+
circosJS.renderLayout(d3, translated, this);
|
1411
|
+
}
|
1412
|
+
tracks = svg.selectAll('.all > g').remove();
|
1413
|
+
tracks[0].sort(function(a, b) {
|
1414
|
+
if (parseInt(a.getAttribute('z-index')) < parseInt(b.getAttribute('z-index'))) {
|
1415
|
+
return -1;
|
1416
|
+
} else if (parseInt(a.getAttribute('z-index')) > parseInt(b.getAttribute('z-index'))) {
|
1417
|
+
return 1;
|
1418
|
+
} else {
|
1419
|
+
return 0;
|
1420
|
+
}
|
1421
|
+
});
|
1422
|
+
svg.select('.all').selectAll('g').data(tracks[0]).enter().append(function(d) {
|
1423
|
+
return d;
|
1424
|
+
});
|
1425
|
+
return this;
|
1426
|
+
};
|
1427
|
+
|
1428
|
+
circosJS.Core.prototype.defaultConf = {
|
1429
|
+
width: 700,
|
1430
|
+
height: 700,
|
1431
|
+
container: 'circos',
|
1432
|
+
defaultTrackWidth: 10
|
1433
|
+
};
|
1434
|
+
|
1435
|
+
circosJS.Layout.prototype.defaultConf = {
|
1436
|
+
innerRadius: 250,
|
1437
|
+
outerRadius: 300,
|
1438
|
+
cornerRadius: 5,
|
1439
|
+
gap: 0.04,
|
1440
|
+
opacity: 1,
|
1441
|
+
labels: {
|
1442
|
+
position: 'center',
|
1443
|
+
display: true,
|
1444
|
+
size: 14,
|
1445
|
+
color: '#000',
|
1446
|
+
radialOffset: 20
|
1447
|
+
},
|
1448
|
+
ticks: {
|
1449
|
+
display: true,
|
1450
|
+
color: 'grey',
|
1451
|
+
spacing: 10000000,
|
1452
|
+
labels: true,
|
1453
|
+
labelSpacing: 10,
|
1454
|
+
labelSuffix: 'Mb',
|
1455
|
+
labelDenominator: 1000000,
|
1456
|
+
labelDisplay0: true,
|
1457
|
+
labelSize: 10,
|
1458
|
+
labelColor: '#000',
|
1459
|
+
labelFont: 'default',
|
1460
|
+
majorSpacing: 5,
|
1461
|
+
size: {
|
1462
|
+
minor: 2,
|
1463
|
+
major: 5
|
1464
|
+
}
|
1465
|
+
},
|
1466
|
+
onClick: null,
|
1467
|
+
onMouseOver: null,
|
1468
|
+
zIndex: 100
|
1469
|
+
};
|
1470
|
+
|
1471
|
+
circosJS.axes = {
|
1472
|
+
display: false,
|
1473
|
+
minor: {
|
1474
|
+
spacing: 5,
|
1475
|
+
spacingType: 'pixel',
|
1476
|
+
color: '#d3d3d3',
|
1477
|
+
thickness: 2
|
1478
|
+
},
|
1479
|
+
major: {
|
1480
|
+
spacing: 5,
|
1481
|
+
color: '#000000',
|
1482
|
+
thickness: 2
|
1483
|
+
}
|
1484
|
+
};
|
1485
|
+
|
1486
|
+
circosJS.Heatmap.prototype.defaultConf = {
|
1487
|
+
innerRadius: 0,
|
1488
|
+
outerRadius: 0,
|
1489
|
+
min: 'smart',
|
1490
|
+
max: 'smart',
|
1491
|
+
colorPalette: 'YlGnBu',
|
1492
|
+
colorPaletteSize: 9,
|
1493
|
+
colorPaletteReverse: false,
|
1494
|
+
logScale: false,
|
1495
|
+
rules: [],
|
1496
|
+
backgrounds: [],
|
1497
|
+
zIndex: 1,
|
1498
|
+
opacity: 1,
|
1499
|
+
tooltipContent: null
|
1500
|
+
};
|
1501
|
+
|
1502
|
+
circosJS.Histogram.prototype.defaultConf = {
|
1503
|
+
innerRadius: 0,
|
1504
|
+
outerRadius: 0,
|
1505
|
+
min: 'smart',
|
1506
|
+
max: 'smart',
|
1507
|
+
direction: 'out',
|
1508
|
+
colorPaletteSize: 9,
|
1509
|
+
colorPalette: 'YlGnBu',
|
1510
|
+
usePalette: true,
|
1511
|
+
colorPaletteReverse: false,
|
1512
|
+
color: '#fd6a62',
|
1513
|
+
logScale: false,
|
1514
|
+
axes: circosJS.axes,
|
1515
|
+
rules: [],
|
1516
|
+
backgrounds: [],
|
1517
|
+
zIndex: 1,
|
1518
|
+
opacity: 1,
|
1519
|
+
tooltipContent: null
|
1520
|
+
};
|
1521
|
+
|
1522
|
+
circosJS.Chord.prototype.defaultConf = {
|
1523
|
+
colorPaletteSize: 9,
|
1524
|
+
colorPalette: 'PuBuGn',
|
1525
|
+
usePalette: true,
|
1526
|
+
colorPaletteReverse: false,
|
1527
|
+
color: '#fd6a62',
|
1528
|
+
opacity: 0.7,
|
1529
|
+
min: 'smart',
|
1530
|
+
max: 'smart',
|
1531
|
+
logScale: false,
|
1532
|
+
rules: [],
|
1533
|
+
backgrounds: [],
|
1534
|
+
zIndex: 1,
|
1535
|
+
tooltipContent: null
|
1536
|
+
};
|
1537
|
+
|
1538
|
+
circosJS.Scatter.prototype.defaultConf = {
|
1539
|
+
innerRadius: 0,
|
1540
|
+
outerRadius: 0,
|
1541
|
+
min: 'smart',
|
1542
|
+
max: 'smart',
|
1543
|
+
direction: 'out',
|
1544
|
+
logScale: false,
|
1545
|
+
glyph: {
|
1546
|
+
color: '#fd6a62',
|
1547
|
+
fill: true,
|
1548
|
+
size: 15,
|
1549
|
+
shape: 'circle',
|
1550
|
+
strokeColor: '#d3d3d3',
|
1551
|
+
strokeWidth: 2
|
1552
|
+
},
|
1553
|
+
axes: circosJS.axes,
|
1554
|
+
rules: [],
|
1555
|
+
backgrounds: [],
|
1556
|
+
zIndex: 1,
|
1557
|
+
opacity: 1,
|
1558
|
+
tooltipContent: null
|
1559
|
+
};
|
1560
|
+
|
1561
|
+
circosJS.Line.prototype.defaultConf = {
|
1562
|
+
innerRadius: 0,
|
1563
|
+
outerRadius: 0,
|
1564
|
+
min: 'smart',
|
1565
|
+
max: 'smart',
|
1566
|
+
direction: 'out',
|
1567
|
+
logScale: false,
|
1568
|
+
color: '#fd6a62',
|
1569
|
+
fill: true,
|
1570
|
+
fill_color: '#d3d3d3',
|
1571
|
+
thickness: 2,
|
1572
|
+
max_gap: 10000000,
|
1573
|
+
interpolation: 'linear',
|
1574
|
+
axes: circosJS.axes,
|
1575
|
+
rules: [],
|
1576
|
+
backgrounds: [],
|
1577
|
+
zIndex: 1,
|
1578
|
+
opacity: 1,
|
1579
|
+
tooltipContent: null
|
1580
|
+
};
|
1581
|
+
|
1582
|
+
circosJS.Stack.prototype.defaultConf = {
|
1583
|
+
innerRadius: 0,
|
1584
|
+
outerRadius: 0,
|
1585
|
+
colorPaletteSize: 9,
|
1586
|
+
colorPalette: 'PuBuGn',
|
1587
|
+
usePalette: true,
|
1588
|
+
colorPaletteReverse: false,
|
1589
|
+
color: '#fd6a62',
|
1590
|
+
min: 'smart',
|
1591
|
+
max: 'smart',
|
1592
|
+
direction: 'out',
|
1593
|
+
logScale: false,
|
1594
|
+
color: '#fd6a62',
|
1595
|
+
thickness: 10,
|
1596
|
+
radialMargin: 2,
|
1597
|
+
margin: 2,
|
1598
|
+
strokeWidth: 1,
|
1599
|
+
strokeColor: '#000000',
|
1600
|
+
axes: circosJS.axes,
|
1601
|
+
rules: [],
|
1602
|
+
backgrounds: [],
|
1603
|
+
zIndex: 1,
|
1604
|
+
opacity: 1,
|
1605
|
+
tooltipContent: null
|
1606
|
+
};
|
1607
|
+
|
1608
|
+
circosJS.Highlight.prototype.defaultConf = {
|
1609
|
+
innerRadius: 0,
|
1610
|
+
outerRadius: 0,
|
1611
|
+
defaultColor: '#fd6a62',
|
1612
|
+
opacity: 0.5,
|
1613
|
+
rules: [],
|
1614
|
+
zIndex: 101,
|
1615
|
+
strokeColor: '#d3d3d3',
|
1616
|
+
strokeWidth: 0,
|
1617
|
+
tooltipContent: null
|
1618
|
+
};
|
1619
|
+
|
1620
|
+
circosJS.Text.prototype.defaultConf = {
|
1621
|
+
innerRadius: 0,
|
1622
|
+
outerRadius: 0,
|
1623
|
+
rules: [],
|
1624
|
+
backgrounds: [],
|
1625
|
+
zIndex: 1,
|
1626
|
+
style: {},
|
1627
|
+
tooltipContent: null
|
1628
|
+
};
|
1629
|
+
|
1630
|
+
circosJS.registerTooltip = function(instance, track, element, trackParams) {
|
1631
|
+
track.tip = d3.tip().direction('s').offset([20, 0]).html(trackParams.tooltipContent);
|
1632
|
+
element.call(track.tip);
|
1633
|
+
track.dispatch.on('mouseover', function(d, i, j) {
|
1634
|
+
return track.tip.attr('class', 'd3-tip appear').show(d);
|
1635
|
+
});
|
1636
|
+
return track.dispatch.on('mouseout', function(d, i, j) {
|
1637
|
+
track.tip.attr('class', 'd3-tip').show(d);
|
1638
|
+
return track.tip.hide();
|
1639
|
+
});
|
1640
|
+
};
|