From b7ad2c1f028fb13487a6561704063fd17f2e8244 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Wed, 16 May 2018 21:40:49 -0400 Subject: [PATCH 01/19] Pass correct dependencies to AMD module --- assets/js/app/wrapper.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/app/wrapper.txt b/assets/js/app/wrapper.txt index d475e7ad..38d2d568 100644 --- a/assets/js/app/wrapper.txt +++ b/assets/js/app/wrapper.txt @@ -1,11 +1,11 @@ (function (root, factory) { if (typeof define === "function" && define.amd) { - define(["postal"], function(d3, Q){ + define(["d3", "Q"], function(d3, Q){ // amd return (root.LocusZoom = factory(d3, Q)); }); - } else if(typeof module === "object" && module.exports) { + } else if(typeof module === "object" && module.exports) { // commonJS module.exports = (root.LocusZoom = factory(require("d3"), require("Q"))); - } else { + } else { // globals root.LocusZoom = factory(root.d3, root.Q); } }(this, function(d3, Q) { From 6223a9f5cbb54aac47481f44a42b86c7a3267c3d Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Mon, 21 May 2018 22:27:23 -0400 Subject: [PATCH 02/19] Tooling and build improvements - DRY build code - Add sourcemap support for non-minified files - Add a clean task to avoid artifacts on failed builds - Add sinon to support future tests using mocks --- .eslintignore | 3 +- .eslintrc | 5 +- .npmignore | 2 + README.md | 2 +- assets/js/app/Dashboard.js | 1 + examples/.eslintrc | 5 + gulpfile.js | 66 ++++---- package-lock.json | 300 +++++++++++++++++++++++++++++++++---- package.json | 8 +- test/.eslintrc | 3 +- test/setup/node.js | 3 +- 11 files changed, 334 insertions(+), 64 deletions(-) create mode 100644 .npmignore create mode 100644 examples/.eslintrc diff --git a/.eslintignore b/.eslintignore index 3c4785b8..c7570f52 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,10 +3,9 @@ dist/ # Non-code items docs/ -examples/ node_modules/ staticdata/ package.json # ESLint seems to ignore env overrides on single files (for the es6 parser) in same directory -files.js \ No newline at end of file +files.js diff --git a/.eslintrc b/.eslintrc index 7032ea55..8fc932f1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -12,7 +12,10 @@ ], "quotes": [ 2, - "double" + "double", + { + "avoidEscape": true + } ], "linebreak-style": [ 2, diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..a7997913 --- /dev/null +++ b/.npmignore @@ -0,0 +1,2 @@ +.gitkeep +.idea diff --git a/README.md b/README.md index add65db0..1679b79d 100644 --- a/README.md +++ b/README.md @@ -245,7 +245,7 @@ The above command with enter forced-watch-mode, which will detect any changes to LocusZoom uses [Mocha](https://mochajs.org/) for unit testing. Tests are located in the `test` subdirectory, with a one-to-one mapping of test files to app files. -**Note that the plugins used by gulp in this project require Node.js version 4.x or higher.** +**Note that the build and test process requires Node.js version 6 LTS or higher.** ### Linting and Strict Mode diff --git a/assets/js/app/Dashboard.js b/assets/js/app/Dashboard.js index 3bb46a26..07f3660d 100644 --- a/assets/js/app/Dashboard.js +++ b/assets/js/app/Dashboard.js @@ -875,6 +875,7 @@ LocusZoom.Dashboard.Components.add("download", function(layout){ for (var stylesheet in Object.keys(document.styleSheets)){ if ( document.styleSheets[stylesheet].href !== null && document.styleSheets[stylesheet].href.indexOf("locuszoom.css") !== -1){ + // TODO: "Download image" button will render the image incorrectly if the stylesheet has been renamed or concatenated LocusZoom.createCORSPromise("GET", document.styleSheets[stylesheet].href) .then(function(response){ this.css_string = response.replace(/[\r\n]/g," ").replace(/\s+/g," "); diff --git a/examples/.eslintrc b/examples/.eslintrc new file mode 100644 index 00000000..b50e177e --- /dev/null +++ b/examples/.eslintrc @@ -0,0 +1,5 @@ +{ + "globals": { + "LocusZoom": false + } +} diff --git a/gulpfile.js b/gulpfile.js index 70366d65..a228b4fd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,28 +1,44 @@ -/* global require */ +/* eslint-env node */ var fs = require("fs"); +var path = require("path"); + var gulp = require("gulp"); var concat = require("gulp-concat"); var eslint = require("gulp-eslint"); +var filter = require("gulp-filter"); var mocha = require("gulp-mocha"); +var rename = require("gulp-rename"); var sass = require("gulp-sass"); var sourcemaps = require("gulp-sourcemaps"); var uglify = require("gulp-uglify"); var gutil = require("gulp-util"); var wrapJS = require("gulp-wrap-js"); + +var del = require("del"); var argv = require("yargs").argv; var files = require("./files.js"); +var manifest = require("./package.json"); +var mainFile = manifest.main; +var destinationFolder = path.dirname(mainFile); + +// Remove all existing built assets +gulp.task("clean", function(done) { + del([destinationFolder]).then(function() { + done(); + }); +}); // Perform syntax checking on all files gulp.task("lint", function() { - return gulp.src(["**/*.js", "!node_modules/**"]) + return gulp.src(["**/*.js", "!node_modules/**", "!examples/**"]) .pipe(eslint()) .pipe(eslint.format()) .pipe(eslint.failAfterError()); }); -// Test app files, then build both app and vendor javascript files if all tests pass +// Test app files, then build both app and vendor javascript files if all tests pass (DEPRECATED) gulp.task("js", function() { return gulp.start("app_js", "vendor_js"); }); @@ -53,28 +69,24 @@ gulp.task("test", ["lint"], function () { // Concatenate all app-specific JS libraries into unminified and minified single app files gulp.task("app_js", ["test"], function() { var moduleTemplate = fs.readFileSync("./assets/js/app/wrapper.txt", "utf8"); - gulp.src(files.app_build) - .pipe(concat("dist/locuszoom.app.js")) - .pipe(wrapJS(moduleTemplate)) - .pipe(gulp.dest(".")) - .on("end", function() { - gutil.log(gutil.colors.bold.white.bgBlue(" Generated locuszoom.app.js ")); - }) - .on("error", function() { - gutil.log(gutil.colors.bold.white.bgRed(" FAILED to generate locuszoom.app.js ")); - }); gulp.src(files.app_build) .pipe(sourcemaps.init()) - .pipe(concat("dist/locuszoom.app.min.js")) + .pipe(concat("locuszoom.app.js")) + .pipe(wrapJS(moduleTemplate)) + .pipe(sourcemaps.write(".")) + .pipe(gulp.dest(destinationFolder)) + // Then make .min.js + .pipe(filter(["**", "!**/*.js.map"])) + .pipe(rename("locuszoom.app.min.js")) + .pipe(sourcemaps.init({ loadMaps: true })) .pipe(wrapJS(moduleTemplate)) .pipe(uglify()) .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")) + .pipe(gulp.dest(destinationFolder)) .on("end", function() { - gutil.log(gutil.colors.bold.white.bgBlue(" Generated locuszoom.app.min.js ")); - }) - .on("error", function() { - gutil.log(gutil.colors.bold.white.bgRed(" FAILED to generate locuszoom.app.min.js ")); + gutil.log(gutil.colors.bold.white.bgBlue(" Generated locuszoom.app.js bundles ")); + }).on("error", function() { + gutil.log(gutil.colors.bold.white.bgRed(" FAILED to generate locuszoom.app.js bundles ")); }); }); @@ -82,10 +94,10 @@ gulp.task("app_js", ["test"], function() { gulp.task("vendor_js", function() { return gulp.src(files.vendor_build) .pipe(sourcemaps.init()) - .pipe(concat("dist/locuszoom.vendor.min.js")) + .pipe(concat("locuszoom.vendor.min.js")) .pipe(uglify()) .pipe(sourcemaps.write(".")) - .pipe(gulp.dest(".")) + .pipe(gulp.dest(destinationFolder)) .on("end", function() { gutil.log(gutil.colors.bold.white.bgBlue("Generated locuszoom.vendor.min.js")); }) @@ -98,7 +110,7 @@ gulp.task("vendor_js", function() { gulp.task("css", function() { return gulp.src("./assets/css/*.scss") .pipe(sass()) - .pipe(gulp.dest("dist/")) + .pipe(gulp.dest(destinationFolder)) .on("end", function() { gutil.log(gutil.colors.bold.white.bgBlue("Generated locuszoom.css")); }) @@ -110,10 +122,12 @@ gulp.task("css", function() { // Watch for changes in app source files to trigger fresh builds gulp.task("watch", function() { gutil.log(gutil.colors.bold.black.bgYellow("Watching for changes in app and test files...")); - gulp.watch(files.app_build.concat(files.test_suite), ["app_js"]); + gulp.watch(files.app_build.concat(files.extensions, files.test_suite), ["app_js"]); gulp.watch(["./assets/css/*.scss"], ["css"]); }); - -// Default task: make all the javascripts and css -gulp.task("default", ["js", "css"]); +// Default task: do a clean build of all assets, and ensure tests + linting pass (suitable for making a release) +gulp.task("build", ["clean"], function() { + return gulp.start("app_js", "vendor_js", "css"); +}); +gulp.task("default", ["build"]); diff --git a/package-lock.json b/package-lock.json index ddf3651c..84e108ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-1.0.1.tgz", "integrity": "sha1-z6I7xYQPkQTOMqZedNt+epdLvuE=", + "dev": true, "requires": { "acorn": "5.3.0", "css": "2.2.1", @@ -20,11 +21,21 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=", + "dev": true, "requires": { "normalize-path": "2.1.1", "through2": "2.0.3" } }, + "@sinonjs/formatio": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", + "integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==", + "dev": true, + "requires": { + "samsam": "1.3.0" + } + }, "abab": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.3.tgz", @@ -40,7 +51,8 @@ "acorn": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz", - "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==" + "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==", + "dev": true }, "acorn-globals": { "version": "3.1.0", @@ -108,7 +120,8 @@ "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true }, "ansi-cyan": { "version": "0.1.1", @@ -319,7 +332,8 @@ "atob": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/atob/-/atob-1.1.3.tgz", - "integrity": "sha1-lfE2KbEsOlGl0hWr3OKqnzL4B3M=" + "integrity": "sha1-lfE2KbEsOlGl0hWr3OKqnzL4B3M=", + "dev": true }, "aws-sign2": { "version": "0.6.0", @@ -702,12 +716,14 @@ "convert-source-map": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", - "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=" + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true }, "cross-spawn": { "version": "5.1.0", @@ -733,6 +749,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/css/-/css-2.2.1.tgz", "integrity": "sha1-c6TIHehdtmTU7mdPfUcIXjstVdw=", + "dev": true, "requires": { "inherits": "2.0.3", "source-map": "0.1.43", @@ -744,6 +761,7 @@ "version": "0.1.43", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, "requires": { "amdefine": "1.0.1" } @@ -778,6 +796,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, "requires": { "es5-ext": "0.10.38" } @@ -829,6 +848,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-1.0.0.tgz", "integrity": "sha512-dsd50qQ1atDeurcxL7XOjPp4nZCGZzWIONDujDXzl1atSyC3hMbZD+v6440etw+Vt0Pr8ce4TQzHfX3KZM05Mw==", + "dev": true, "requires": { "debug": "3.1.0", "memoizee": "0.4.11", @@ -839,6 +859,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, "requires": { "ms": "2.0.0" } @@ -867,18 +888,46 @@ } }, "del": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", - "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz", + "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=", "dev": true, "requires": { - "globby": "5.0.0", + "globby": "6.1.0", "is-path-cwd": "1.0.0", "is-path-in-cwd": "1.0.0", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", + "p-map": "1.2.0", + "pify": "3.0.0", "rimraf": "2.6.1" + }, + "dependencies": { + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } } }, "delayed-stream": { @@ -911,7 +960,8 @@ "detect-newline": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", - "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=" + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true }, "diff": { "version": "3.2.0", @@ -1006,6 +1056,7 @@ "version": "0.10.38", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.38.tgz", "integrity": "sha512-jCMyePo7AXbUESwbl8Qi01VSH2piY9s/a3rSU/5w/MlTIx8HPL1xn2InGN8ejt/xulcJgnTO7vqNtOAxzYd2Kg==", + "dev": true, "requires": { "es6-iterator": "2.0.3", "es6-symbol": "3.1.1" @@ -1015,6 +1066,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.38", @@ -1025,6 +1077,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.38" @@ -1034,6 +1087,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.38", @@ -1269,6 +1323,7 @@ "version": "0.3.5", "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.38" @@ -1505,6 +1560,23 @@ "del": "2.2.2", "graceful-fs": "4.1.11", "write": "0.2.1" + }, + "dependencies": { + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.1" + } + } } }, "for-in": { @@ -2784,7 +2856,8 @@ "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true }, "graceful-readlink": { "version": "1.0.1", @@ -2902,6 +2975,17 @@ } } }, + "gulp-filter": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-5.1.0.tgz", + "integrity": "sha1-oF4Rr/sHz33PQafeHLe2OsN4PnM=", + "dev": true, + "requires": { + "multimatch": "2.1.0", + "plugin-error": "0.1.2", + "streamfilter": "1.0.7" + } + }, "gulp-mocha": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/gulp-mocha/-/gulp-mocha-4.0.1.tgz", @@ -2966,6 +3050,12 @@ } } }, + "gulp-rename": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.2.3.tgz", + "integrity": "sha512-CmdPM0BjJ105QCX1fk+j7NGhiN/1rCl9HLGss+KllBS/tdYadpjTxqdKyh/5fNV+M3yjT1MFz5z93bXdrTyzAw==", + "dev": true + }, "gulp-sass": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/gulp-sass/-/gulp-sass-3.1.0.tgz", @@ -2983,6 +3073,7 @@ "version": "2.6.3", "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-2.6.3.tgz", "integrity": "sha1-EbAz91n5CeCl8Vt730esKcxU76Q=", + "dev": true, "requires": { "@gulp-sourcemaps/identity-map": "1.0.1", "@gulp-sourcemaps/map-sources": "1.0.0", @@ -3321,7 +3412,8 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true }, "ini": { "version": "1.3.4", @@ -3565,7 +3657,8 @@ "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true }, "is-relative": { "version": "0.2.1", @@ -3618,7 +3711,8 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true }, "isexe": { "version": "2.0.0", @@ -3799,6 +3893,12 @@ } } }, + "just-extend": { + "version": "1.1.27", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-1.1.27.tgz", + "integrity": "sha512-mJVp13Ix6gFo3SBAy9U/kL+oeZqzlYYYLQBwXVBlVzIsZwBqGREnOro24oC/8s8aox+rJhtZ2DiQof++IrkA+g==", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -4009,6 +4109,12 @@ "lodash._root": "3.0.1" } }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, "lodash.isarguments": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", @@ -4089,6 +4195,12 @@ "lodash.escape": "3.2.0" } }, + "lolex": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.6.0.tgz", + "integrity": "sha512-e1UtIo1pbrIqEXib/yMjHciyqkng5lc0rrIbytgjmRgDR9+2ceNIAcwOWSgylRjoEP9VdVguCSRwnNmlbnOUwA==", + "dev": true + }, "longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", @@ -4119,6 +4231,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "dev": true, "requires": { "es5-ext": "0.10.38" } @@ -4169,6 +4282,7 @@ "version": "0.4.11", "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.11.tgz", "integrity": "sha1-vemBdmPJ5A/bKk6hw2cpYIeujI8=", + "dev": true, "requires": { "d": "1.0.0", "es5-ext": "0.10.38", @@ -4337,7 +4451,20 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "multimatch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "dev": true, + "requires": { + "array-differ": "1.0.0", + "array-union": "1.0.2", + "arrify": "1.0.1", + "minimatch": "3.0.4" + } }, "multipipe": { "version": "0.1.2", @@ -4375,7 +4502,21 @@ "next-tick": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "nise": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.3.3.tgz", + "integrity": "sha512-v1J/FLUB9PfGqZLGDBhQqODkbLotP0WtLo9R4EJY2PPu5f5Xg4o0rA8FDlmrjFSv9vBBKcfnOSpfYYuu5RTHqg==", + "dev": true, + "requires": { + "@sinonjs/formatio": "2.0.0", + "just-extend": "1.1.27", + "lolex": "2.6.0", + "path-to-regexp": "1.7.0", + "text-encoding": "0.6.4" + } }, "node-gyp": { "version": "3.6.2", @@ -4489,6 +4630,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, "requires": { "remove-trailing-separator": "1.0.2" } @@ -4535,7 +4677,8 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true }, "object.defaults": { "version": "1.1.0", @@ -4686,6 +4829,12 @@ "p-limit": "1.1.0" } }, + "p-map": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz", + "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==", + "dev": true + }, "parse-filepath": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.1.tgz", @@ -4784,6 +4933,23 @@ "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", "dev": true }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", @@ -4880,7 +5046,8 @@ "process-nextick-args": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true }, "progress": { "version": "2.0.0", @@ -4977,6 +5144,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", @@ -5031,7 +5199,8 @@ "remove-trailing-separator": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz", - "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=" + "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=", + "dev": true }, "repeat-element": { "version": "1.1.2", @@ -5157,7 +5326,8 @@ "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true }, "restore-cursor": { "version": "2.0.0", @@ -5214,7 +5384,14 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "samsam": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", + "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", + "dev": true }, "sass-graph": { "version": "2.2.4", @@ -5409,6 +5586,38 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "sinon": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.5.0.tgz", + "integrity": "sha512-trdx+mB0VBBgoYucy6a9L7/jfQOmvGeaKZT4OOJ+lPAtI8623xyGr8wLiE4eojzBS8G9yXbhx42GHUOVLr4X2w==", + "dev": true, + "requires": { + "@sinonjs/formatio": "2.0.0", + "diff": "3.2.0", + "lodash.get": "4.4.2", + "lolex": "2.6.0", + "nise": "1.3.3", + "supports-color": "5.4.0", + "type-detect": "4.0.8" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "slash": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", @@ -5436,12 +5645,14 @@ "source-map": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=" + "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", + "dev": true }, "source-map-resolve": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.3.1.tgz", "integrity": "sha1-YQ9hIqRFuN1RU1oqcbeD38Ekh2E=", + "dev": true, "requires": { "atob": "1.1.3", "resolve-url": "0.2.1", @@ -5452,7 +5663,8 @@ "source-map-url": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.3.0.tgz", - "integrity": "sha1-fsrxO1e80J2opAxdJp2zN5nUqvk=" + "integrity": "sha1-fsrxO1e80J2opAxdJp2zN5nUqvk=", + "dev": true }, "sparkles": { "version": "1.0.0", @@ -5526,6 +5738,15 @@ "integrity": "sha1-pB6tGm1ggc63n2WwYZAbbY89HQ8=", "dev": true }, + "streamfilter": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-1.0.7.tgz", + "integrity": "sha512-Gk6KZM+yNA1JpW0KzlZIhjo3EaBJDkYfXtYSbOwNIQ7Zd6006E6+sCFlW1NDvFG/vnXhKmw6TJJgiEQg/8lXfQ==", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -5557,6 +5778,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, "requires": { "safe-buffer": "5.1.1" } @@ -5619,7 +5841,8 @@ "strip-bom-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", - "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=" + "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=", + "dev": true }, "strip-eof": { "version": "1.0.0", @@ -5716,6 +5939,12 @@ "inherits": "2.0.3" } }, + "text-encoding": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", + "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", + "dev": true + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -5732,6 +5961,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, "requires": { "readable-stream": "2.3.3", "xtend": "4.0.1" @@ -5756,6 +5986,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.2.tgz", "integrity": "sha1-YcxHp2wavTGV8UUn+XjViulMUgQ=", + "dev": true, "requires": { "es5-ext": "0.10.38", "next-tick": "1.0.0" @@ -5816,6 +6047,12 @@ "prelude-ls": "1.1.2" } }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -5921,7 +6158,8 @@ "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true }, "user-home": { "version": "1.1.1", @@ -5932,7 +6170,8 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true }, "uuid": { "version": "3.1.0", @@ -6272,7 +6511,8 @@ "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true }, "y18n": { "version": "3.2.1", diff --git a/package.json b/package.json index 72d37048..850211b6 100644 --- a/package.json +++ b/package.json @@ -28,24 +28,27 @@ }, "scripts": { "gulp": "gulp", - "build": "gulp css js", + "build": "gulp build", "test": "gulp test", "lint": "gulp lint", "watch": "gulp watch" }, "dependencies": { "d3": "3.5.6", - "gulp-sourcemaps": "^2.6.3", "q": "1.4.1" }, "devDependencies": { + "del": "^3.0.0", "eslint": "^4.15.0", "glob": "^7.1.2", "gulp": "~3.9.1", "gulp-concat": "~2.6.0", "gulp-eslint": "^4.0.1", + "gulp-filter": "^5.1.0", "gulp-mocha": "~4.0.0", + "gulp-rename": "^1.2.2", "gulp-sass": "~3.1.0", + "gulp-sourcemaps": "^2.6.3", "gulp-uglify": "~2.0.1", "gulp-util": "~3.0.8", "gulp-watch": "~4.3.11", @@ -55,6 +58,7 @@ "mocha": "~4.0.1", "mocha-jsdom": "~1.1.0", "should": "~13.1.3", + "sinon": "^4.5.0", "yargs": "~10.0.3" } } diff --git a/test/.eslintrc b/test/.eslintrc index 19cfb62d..1a2c38ee 100644 --- a/test/.eslintrc +++ b/test/.eslintrc @@ -9,6 +9,7 @@ "d3": false, "LocusZoom": false, "Q": false, - "should": false + "should": false, + "sinon": false } } diff --git a/test/setup/node.js b/test/setup/node.js index e67d3f7d..9c5bb3dc 100644 --- a/test/setup/node.js +++ b/test/setup/node.js @@ -8,10 +8,11 @@ var files = require("../../files.js"); global.assert = require("assert"); global.should = require("should"); +global.sinon = require("sinon"); before(function() { var src = files.test_include.map(function(file){ return fs.readFileSync(file); }); - jsdom({ src: src }); + jsdom({ src: src, url: "https://locuszoom.org" }); }); // Reset DOM after each test (but keep the JS we loaded in) From d5f44efd684a6137b66ed75d009b46a1e1000265 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Mon, 21 May 2018 22:32:24 -0400 Subject: [PATCH 03/19] Update copyright year on all example pages --- examples/covariates_model.html | 2 +- examples/credible_sets.html | 2 +- examples/interval_annotations.html | 2 +- examples/multiple_phenotypes_layered.html | 2 +- examples/phewas_forest.html | 2 +- examples/phewas_scatter.html | 2 +- examples/template.html | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/covariates_model.html b/examples/covariates_model.html index 57686a03..f502c4f8 100644 --- a/examples/covariates_model.html +++ b/examples/covariates_model.html @@ -53,7 +53,7 @@

Top Hits

diff --git a/examples/credible_sets.html b/examples/credible_sets.html index d54190a3..ebb792a2 100644 --- a/examples/credible_sets.html +++ b/examples/credible_sets.html @@ -76,7 +76,7 @@

Top Hits

diff --git a/examples/interval_annotations.html b/examples/interval_annotations.html index 8dda513a..f9d63989 100644 --- a/examples/interval_annotations.html +++ b/examples/interval_annotations.html @@ -52,7 +52,7 @@

Top Hits

diff --git a/examples/multiple_phenotypes_layered.html b/examples/multiple_phenotypes_layered.html index 91631747..d251766e 100644 --- a/examples/multiple_phenotypes_layered.html +++ b/examples/multiple_phenotypes_layered.html @@ -55,7 +55,7 @@

Top Hits

diff --git a/examples/phewas_forest.html b/examples/phewas_forest.html index a823c5e7..0e68cfaa 100644 --- a/examples/phewas_forest.html +++ b/examples/phewas_forest.html @@ -45,7 +45,7 @@
< return home
diff --git a/examples/phewas_scatter.html b/examples/phewas_scatter.html index 4220d165..b5ecfd34 100644 --- a/examples/phewas_scatter.html +++ b/examples/phewas_scatter.html @@ -166,7 +166,7 @@

API (for developers)

diff --git a/examples/template.html b/examples/template.html index ecb78b6a..622ed99b 100644 --- a/examples/template.html +++ b/examples/template.html @@ -43,7 +43,7 @@
< return home
From a6ee06d144c9a65287d9b27455c442c9b80467c0 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Mon, 21 May 2018 23:12:08 -0400 Subject: [PATCH 04/19] Refactor events (BREAKING CHANGE for niche uses) - Data is passed as {sourceID: string, data: object} instead of as bound context - Explicitly allow bubbling (and preserve context) - New `element_selection` event allows identifying toggled state - New `state_changed` event - Allow event listeners to be removed / cleaned up - Core `subscribeToData` behavior (TODO: `discrete` fetch mode) --- assets/js/app/DataLayer.js | 31 +++--- assets/js/app/DataLayers/forest.js | 5 +- assets/js/app/DataLayers/intervals.js | 5 +- assets/js/app/DataLayers/line.js | 4 +- assets/js/app/DataLayers/scatter.js | 3 +- assets/js/app/Panel.js | 70 +++++++++++--- assets/js/app/Plot.js | 131 ++++++++++++++++++++++--- files.js | 7 +- test/unit/Panel.js | 132 ++++++++++++++++++++++++++ test/unit/Plot.js | 107 +++++++++++++++++++++ 10 files changed, 447 insertions(+), 48 deletions(-) diff --git a/assets/js/app/DataLayer.js b/assets/js/app/DataLayer.js index 01e57853..50734dff 100644 --- a/assets/js/app/DataLayer.js +++ b/assets/js/app/DataLayer.js @@ -109,7 +109,8 @@ LocusZoom.DataLayer.prototype.addField = function(fieldName, namespace, transfor * possible to reset without destroying the panel entirely. It is used by `Plot.clearPanelData`. */ LocusZoom.DataLayer.prototype.setDefaultState = function() { - // Define state parameters specific to this data layer + // Define state parameters specific to this data layer. Within plot state, this will live under a key + // `panel_name.layer_name`. if (this.parent){ this.state = this.parent.state; this.state_id = this.parent.id + "." + this.id; @@ -742,14 +743,13 @@ LocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){ /** * Toggle a status (e.g. highlighted, selected, identified) on an element - * @param {String} status - * @param {String|Object} element - * @param {Boolean} toggle - * @param {Boolean} exclusive + * @param {String} status The name of a recognized status to be added/removed on an appropriate element + * @param {String|Object} element The data bound to the element of interest + * @param {Boolean} toggle True to add the status (and associated CSS styles); false to remove it + * @param {Boolean} exclusive Whether to only allow a state for a single element at a time * @returns {LocusZoom.DataLayer} */ LocusZoom.DataLayer.prototype.setElementStatus = function(status, element, toggle, exclusive){ - // Sanity checks if (typeof status == "undefined" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){ throw("Invalid status passed to DataLayer.setElementStatus()"); @@ -793,9 +793,13 @@ LocusZoom.DataLayer.prototype.setElementStatus = function(status, element, toggl this.showOrHideTooltip(element); // Trigger layout changed event hook - this.parent.emit("layout_changed"); - this.parent_plot.emit("layout_changed"); - + this.parent.emit("layout_changed", true); + if (status === "selected") { + // Notify parents that a given element has been interacted with. For now, we will only notify on + // "selected" type events, which is (usually) a toggle-able state. If elements are exclusive, two selection + // events will be sent in short order as the previously selected element has to be de-selected first + this.parent.emit("element_selection", { element: element, active: toggle }, true); + } return this; }; @@ -870,7 +874,7 @@ LocusZoom.DataLayer.prototype.setAllElementStatus = function(status, toggle){ }; /** - * Apply all layout-defined behaviors to a selection of elements with event handlers + * Apply all layout-defined behaviors (DOM event handlers) to a selection of elements * @param {d3.selection} selection */ LocusZoom.DataLayer.prototype.applyBehaviors = function(selection){ @@ -1048,16 +1052,15 @@ LocusZoom.DataLayer.prototype.reMap = function(){ this.destroyAllTooltips(); // hack - only non-visible tooltips should be destroyed // and then recreated if returning to visibility - // Fetch new data - var promise = this.parent_plot.lzd.getData(this.state, this.layout.fields); //,"ld:best" - promise.then(function(new_data){ + // Fetch new data. Datalayers are only given access to the final consolidated data from the chain (not headers or raw payloads) + var promise = this.parent_plot.lzd.getData(this.state, this.layout.fields); + promise.then(function(new_data) { this.data = new_data.body; this.applyDataMethods(); this.initialized = true; }.bind(this)); return promise; - }; diff --git a/assets/js/app/DataLayers/forest.js b/assets/js/app/DataLayers/forest.js index b5859efb..a7ba2b6c 100644 --- a/assets/js/app/DataLayers/forest.js +++ b/assets/js/app/DataLayers/forest.js @@ -183,9 +183,8 @@ LocusZoom.DataLayers.add("forest", function(layout){ points_selection.exit().remove(); // Apply default event emitters to selection - points_selection.on("click.event_emitter", function(element){ - this.parent.emit("element_clicked", element); - this.parent_plot.emit("element_clicked", element); + points_selection.on("click.event_emitter", function(element_data){ + this.parent.emit("element_clicked", element_data, true); }.bind(this)); // Apply behaviors to points diff --git a/assets/js/app/DataLayers/intervals.js b/assets/js/app/DataLayers/intervals.js index f970a386..2c1d997a 100644 --- a/assets/js/app/DataLayers/intervals.js +++ b/assets/js/app/DataLayers/intervals.js @@ -316,9 +316,8 @@ LocusZoom.DataLayers.add("intervals", function(layout){ clickareas.exit().remove(); // Apply default event emitters to clickareas - clickareas.on("click", function(element){ - element.parent.parent.emit("element_clicked", element); - element.parent.parent_plot.emit("element_clicked", element); + clickareas.on("click", function(element_data){ + element_data.parent.parent.emit("element_clicked", element_data, true); }.bind(this)); // Apply mouse behaviors to clickareas diff --git a/assets/js/app/DataLayers/line.js b/assets/js/app/DataLayers/line.js index 3be5a890..7962bffb 100644 --- a/assets/js/app/DataLayers/line.js +++ b/assets/js/app/DataLayers/line.js @@ -286,9 +286,7 @@ LocusZoom.DataLayers.add("line", function(layout){ this.path.attr("class", path_class); // Trigger layout changed event hook - this.parent.emit("layout_changed"); - this.parent_plot.emit("layout_changed"); - + this.parent.emit("layout_changed", true); return this; }; diff --git a/assets/js/app/DataLayers/scatter.js b/assets/js/app/DataLayers/scatter.js index cd230e00..e86119c0 100644 --- a/assets/js/app/DataLayers/scatter.js +++ b/assets/js/app/DataLayers/scatter.js @@ -423,8 +423,7 @@ LocusZoom.DataLayers.add("scatter", function(layout){ // Apply default event emitters to selection selection.on("click.event_emitter", function(element){ - this.parent.emit("element_clicked", element); - this.parent_plot.emit("element_clicked", element); + this.parent.emit("element_clicked", element, true); }.bind(this)); // Apply mouse behaviors diff --git a/assets/js/app/Panel.js b/assets/js/app/Panel.js index a938f272..3e5c1d3a 100644 --- a/assets/js/app/Panel.js +++ b/assets/js/app/Panel.js @@ -131,7 +131,8 @@ LocusZoom.Panel = function(layout, parent) { "layout_changed": [], "data_requested": [], "data_rendered": [], - "element_clicked": [] + "element_clicked": [], + "element_selection": [] }; /** * There are several events that a LocusZoom panel can "emit" when appropriate, and LocusZoom supports registering @@ -141,7 +142,9 @@ LocusZoom.Panel = function(layout, parent) { * - `layout_changed` - context: panel - Any aspect of the panel's layout (including dimensions or state) has changed. * - `data_requested` - context: panel - A request for new data from any data source used in the panel has been made. * - `data_rendered` - context: panel - Data from a request has been received and rendered in the panel. - * - `element_clicked` - context: element - A data element in any of the panel's data layers has been clicked. + * - `element_clicked` - context: panel - A data element in any of the panel's data layers has been clicked. + * - `element_selection` - context: panel - Triggered when an element changes "selection" status, and identifies + * whether the element is being selected or deselected. * * To register a hook for any of these events use `panel.on('event_name', function() {})`. * @@ -151,11 +154,12 @@ LocusZoom.Panel = function(layout, parent) { * panel itself, but when element_clicked is emitted the context for this in the event hook will be the element * that was clicked. * - * @param {String} event + * @param {String} event The name of the event (as defined in `event_hooks`) * @param {function} hook - * @returns {LocusZoom.Panel} + * @returns {function} The registered event listener */ this.on = function(event, hook){ + // TODO: Dry plot and panel event code into a shared mixin if (typeof "event" != "string" || !Array.isArray(this.event_hooks[event])){ throw("Unable to register event hook, invalid event: " + event.toString()); } @@ -163,23 +167,68 @@ LocusZoom.Panel = function(layout, parent) { throw("Unable to register event hook, invalid hook function passed"); } this.event_hooks[event].push(hook); + return hook; + }; + /** + * Remove one or more previously defined event listeners + * @param {String} event The name of an event (as defined in `event_hooks`) + * @param {eventCallback} [hook] The callback to deregister + * @returns {LocusZoom.Panel} + */ + this.off = function(event, hook) { + var theseHooks = this.event_hooks[event]; + if (typeof "event" != "string" || !Array.isArray(theseHooks)){ + throw("Unable to remove event hook, invalid event: " + event.toString()); + } + if (hook === undefined) { + // Deregistering all hooks for this event may break basic functionality, and should only be used during + // cleanup operations (eg to prevent memory leaks) + this.event_hooks[event] = []; + } else { + var hookMatch = theseHooks.indexOf(hook); + if (hookMatch !== -1) { + theseHooks.splice(hookMatch, 1); + } else { + throw("The specified event listener is not registered and therefore cannot be removed"); + } + } return this; }; /** * Handle running of event hooks when an event is emitted - * @protected + * + * There is a shorter overloaded form of this method: if the event does not have any data, the second + * argument can be a boolean to control bubbling + * * @param {string} event A known event name - * @param {*} context Controls function execution context (value of `this` for the hook to be fired) + * @param {*} [eventData] Data or event description that will be passed to the event listener + * @param {boolean} [bubble=false] Whether to bubble the event to the parent * @returns {LocusZoom.Panel} */ - this.emit = function(event, context){ + this.emit = function(event, eventData, bubble) { + bubble = bubble || false; + + // TODO: DRY this with the parent plot implementation. Ensure interfaces remain compatible. + // TODO: Improve documentation for overloaded method signature (JSDoc may have trouble here) if (typeof "event" != "string" || !Array.isArray(this.event_hooks[event])){ throw("LocusZoom attempted to throw an invalid event: " + event.toString()); } - context = context || this; + if (typeof eventData === "boolean" && arguments.length === 2) { + // Overloaded method signature: emit(event, bubble) + bubble = eventData; + eventData = null; + } + var sourceID = this.getBaseId(); + var self = this; + var eventContext = {sourceID: sourceID, data: eventData || null}; this.event_hooks[event].forEach(function(hookToRun) { - hookToRun.call(context); + // By default, any handlers fired here will see the panel as the value of `this`. If a bound function is + // registered as a handler, the previously bound `this` will override anything provided to `call` below. + hookToRun.call(self, eventContext); }); + if (bubble && this.parent) { + this.parent.emit(event, eventContext); + } return this; }; @@ -721,8 +770,7 @@ LocusZoom.Panel.prototype.reMap = function(){ .then(function(){ this.initialized = true; this.render(); - this.emit("layout_changed"); - this.parent.emit("layout_changed"); + this.emit("layout_changed", true); this.emit("data_rendered"); }.bind(this)) .catch(function(error){ diff --git a/assets/js/app/Plot.js b/assets/js/app/Plot.js index 10fb836d..59bef104 100644 --- a/assets/js/app/Plot.js +++ b/assets/js/app/Plot.js @@ -116,8 +116,20 @@ LocusZoom.Plot = function(id, datasource, layout) { "layout_changed": [], "data_requested": [], "data_rendered": [], - "element_clicked": [] + "element_clicked": [], + "element_selection": [], + "state_changed": [] // Only triggered when a state change causes rerender }; + + /** + * @callback eventCallback + * @param {object} eventData A description of the event + * @param {String|null} eventData.sourceID The unique identifier (eg plot or parent name) of the element that + * triggered the event. Will be automatically filled in if not explicitly provided. + * @param {Object|null} eventData.context Any additional information to be passed to the callback, eg the data + * associated with a clicked plot element + */ + /** * There are several events that a LocusZoom plot can "emit" when appropriate, and LocusZoom supports registering * "hooks" for these events which are essentially custom functions intended to fire at certain times. @@ -126,7 +138,9 @@ LocusZoom.Plot = function(id, datasource, layout) { * - `layout_changed` - context: plot - Any aspect of the plot's layout (including dimensions or state) has changed. * - `data_requested` - context: plot - A request for new data from any data source used in the plot has been made. * - `data_rendered` - context: plot - Data from a request has been received and rendered in the plot. - * - `element_clicked` - context: element - A data element in any of the plot's data layers has been clicked. + * - `element_clicked` - context: plot - A data element in any of the plot's data layers has been clicked. + * - `element_selection` - context: plot - Triggered when an element changes "selection" status, and identifies + * whether the element is being selected or deselected. * * To register a hook for any of these events use `plot.on('event_name', function() {})`. * @@ -136,9 +150,9 @@ LocusZoom.Plot = function(id, datasource, layout) { * plot itself, but when element_clicked is emitted the context for this in the event hook will be the element * that was clicked. * - * @param {String} event - * @param {function} hook - * @returns {LocusZoom.Plot} + * @param {String} event The name of an event (as defined in `event_hooks`) + * @param {eventCallback} hook + * @returns {function} The registered event listener */ this.on = function(event, hook){ if (typeof "event" != "string" || !Array.isArray(this.event_hooks[event])){ @@ -148,22 +162,60 @@ LocusZoom.Plot = function(id, datasource, layout) { throw("Unable to register event hook, invalid hook function passed"); } this.event_hooks[event].push(hook); + return hook; + }; + /** + * Remove one or more previously defined event listeners + * @param {String} event The name of an event (as defined in `event_hooks`) + * @param {eventCallback} [hook] The callback to deregister + * @returns {LocusZoom.Plot} + */ + this.off = function(event, hook) { + var theseHooks = this.event_hooks[event]; + if (typeof "event" != "string" || !Array.isArray(theseHooks)){ + throw("Unable to remove event hook, invalid event: " + event.toString()); + } + if (hook === undefined) { + // Deregistering all hooks for this event may break basic functionality, and should only be used during + // cleanup operations (eg to prevent memory leaks) + this.event_hooks[event] = []; + } else { + var hookMatch = theseHooks.indexOf(hook); + if (hookMatch !== -1) { + theseHooks.splice(hookMatch, 1); + } else { + throw("The specified event listener is not registered and therefore cannot be removed"); + } + } return this; }; /** * Handle running of event hooks when an event is emitted - * @protected * @param {string} event A known event name - * @param {*} context Controls function execution context (value of `this` for the hook to be fired) + * @param {*} eventData Data or event description that will be passed to the event listener * @returns {LocusZoom.Plot} */ - this.emit = function(event, context){ + this.emit = function(event, eventData) { + // TODO: there are small differences between the emit implementation between plots and panels. In the future, + // DRY this code via mixins, and make sure to keep the interfaces compatible when refactoring. if (typeof "event" != "string" || !Array.isArray(this.event_hooks[event])){ throw("LocusZoom attempted to throw an invalid event: " + event.toString()); } - context = context || this; + var sourceID = this.getBaseId(); + var self = this; this.event_hooks[event].forEach(function(hookToRun) { - hookToRun.call(context); + var eventContext; + if (eventData && eventData.sourceID) { + // If we detect that an event originated elsewhere (via bubbling or externally), preserve the context + // when re-emitting the event to plot-level listeners + eventContext = eventData; + } else { + eventContext = {sourceID: sourceID, data: eventData || null}; + } + // By default, any handlers fired here (either directly, or bubbled) will see the plot as the + // value of `this`. If a bound function is registered as a handler, the previously bound `this` will + // override anything provided to `call` below. + hookToRun.call(self, eventContext); }); return this; }; @@ -877,13 +929,69 @@ LocusZoom.Plot.prototype.refresh = function(){ return this.applyState(); }; + +/** + * A user-defined callback function that can receive (and potentially act on) new plot data. + * @callback externalDataCallback + * @param {Object} new_data The body resulting from a data request. This represents the same information that would be passed to + * a data layer making an equivalent request. + */ + +/** + * A user-defined callback function that can respond to errors received during a previous operation + * @callback externalErrorCallback + * @param err A representation of the error that occurred + */ + +/** + * Allow newly fetched data to be made available outside the LocusZoom plot. For example, a callback could be + * registered to draw an HTML table of top GWAS hits, and update that table whenever the plot region changes. + * + * This is a convenience method for external hooks. It registers an event listener and returns parsed data, + * using the same fields syntax and underlying methods as data layers. + * + * @param {String[]} fields An array of field names and transforms, in the same syntax used by a data layer. + * Different data sources should be prefixed by the source name. + * @param {externalDataCallback} success_callback Used defined function that is automatically called any time that + * new data is received by the plot. + * @param {Object} [opts] Options + * @param {externalErrorCallback} [opts.onerror] User defined function that is automatically called if a problem + * occurs during the data request or subsequent callback operations + * @param {boolean} [opts.discrete=false] Normally the callback will subscribe to the combined body from the chain, + * which may not be in a format that matches what the external callback wants to do. If discrete=true, returns the + * uncombined record info + * @return {function} The newly created event listener, to allow for later cleanup/removal + */ +LocusZoom.Plot.prototype.subscribeToData = function(fields, success_callback, opts) { + opts = opts || {}; + + // Register an event listener that is notified whenever new data has been rendered + var error_callback = opts.onerror || function(err) { + console.log("An error occurred while acting on an external callback", err); + }; + var self = this; + + var listener = function() { + try { + self.lzd.getData(self.state, fields) + .then(function (new_data) { + success_callback(opts.discrete ? new_data.discrete : new_data.body); + }).catch(error_callback); + } catch (error) { + // In certain cases, errors are thrown before a promise can be generated, and LZ error display seems to rely on these errors bubbling up + error_callback(error); + } + }; + this.on("data_rendered", listener); + return listener; +}; + /** * Update state values and trigger a pull for fresh data on all data sources for all data layers * @param state_changes * @returns {Promise} A promise that resolves when all data fetch and update operations are complete */ LocusZoom.Plot.prototype.applyState = function(state_changes){ - state_changes = state_changes || {}; if (typeof state_changes != "object"){ throw("LocusZoom.applyState only accepts an object; " + (typeof state_changes) + " given"); @@ -950,6 +1058,7 @@ LocusZoom.Plot.prototype.applyState = function(state_changes){ // Emit events this.emit("layout_changed"); this.emit("data_rendered"); + this.emit("state_changed", state_changes); this.loading_data = false; diff --git a/files.js b/files.js index ad40e30a..66582b1e 100644 --- a/files.js +++ b/files.js @@ -35,12 +35,16 @@ var app_build = [ "./assets/js/app/Panel.js" ]; +// LocusZoom extensions: not part of the default build, but we may want to bundle separately in the future +var extensions = ["ext/**/*.js"]; + // App, vendor, and helper files to be included at the top of each test suite // NOTE: Order of inclusion is important! var test_include = [ "./node_modules/should/should.js", ...app_build, - ...vendor_build + ...vendor_build, + ...extensions ]; // Since this list gets read manually, resolve the globs first test_include = test_include.reduce(function (acc, pattern) { @@ -51,5 +55,6 @@ module.exports = { test_suite: test_suite, test_include: test_include, app_build: app_build, + extensions: extensions, vendor_build: vendor_build }; diff --git a/test/unit/Panel.js b/test/unit/Panel.js index 3f3ce800..378e0016 100644 --- a/test/unit/Panel.js +++ b/test/unit/Panel.js @@ -251,6 +251,11 @@ describe("LocusZoom.Panel", function(){ this.plot = LocusZoom.populate("#plot", datasources, this.layout); this.panel = this.plot.panels.test; }); + + afterEach(function() { + d3.select("#plot").remove(); + }); + it("should have a curtain object with show/update/hide methods, a showing boolean, and selectors", function(){ this.panel.should.have.property("curtain").which.is.an.Object; this.panel.curtain.should.have.property("showing").which.is.exactly(false); @@ -602,4 +607,131 @@ describe("LocusZoom.Panel", function(){ }); }); + describe("Panel events", function() { + beforeEach(function() { + var layout = { + panels: [ + { id: "panel0" } + ] + }; + d3.select("body").append("div").attr("id", "plot"); + this.plot = LocusZoom.populate("#plot", {}, layout); + this.panel = this.plot.panels.panel0; + }); + + afterEach(function(){ + d3.select("#plot").remove(); + this.plot = null; + }); + + it("should send events packaged with source and data", function() { + var spy = sinon.spy(); + this.panel.on("element_clicked", spy); + this.panel.emit("element_clicked", { something: 1 }); + + assert.ok(spy.calledWith({ + sourceID: "plot.panel0", + data: {something:1} + })); + }); + it("should bubble events to plot and preserve event source + data when expected", function() { + var panel_spy = sinon.spy(); + var plot_spy = sinon.spy(); + + this.plot.on("element_clicked", plot_spy); + this.panel.on("element_clicked", panel_spy); + + this.panel.emit("element_clicked", {something: 1}, true); + + var expectedEvent = { sourceID: "plot.panel0", data: {something: 1} }; + + assert.ok(plot_spy.calledOnce, "Plot event was fired"); + assert.ok(plot_spy.calledWith(expectedEvent), "Plot called with expected event"); + assert.ok(panel_spy.calledOnce, "Panel event was fired"); + assert.ok(panel_spy.calledWith(expectedEvent), "Panel called with expected event"); + }); + it("should bubble events to plot (overloaded no-data call signature)", function() { + var panel_spy = sinon.spy(); + var plot_spy = sinon.spy(); + + this.plot.on("element_clicked", plot_spy); + this.panel.on("element_clicked", panel_spy); + + // When only two arguments are specified, with last one a boolean + this.panel.emit("element_clicked", true); + + var expectedEvent = { sourceID: "plot.panel0", data: null }; + + assert.ok(plot_spy.calledOnce, "Plot event was fired"); + assert.ok(plot_spy.calledWith(expectedEvent), "Plot called with expected event"); + assert.ok(panel_spy.calledOnce, "Panel event was fired"); + assert.ok(panel_spy.calledWith(expectedEvent), "Panel called with expected event"); + }); + it("should not bubble events to plot when not expected", function() { + // "No data" call signature + var panel_nodata_spy = sinon.spy(); + var plot_nodata_spy = sinon.spy(); + + this.plot.on("element_clicked", plot_nodata_spy); + this.panel.on("element_clicked", panel_nodata_spy); + + this.panel.emit("element_clicked", false); + + var expectedEvent = { sourceID: "plot.panel0", data: null }; + + assert.ok(plot_nodata_spy.notCalled, "Plot event should not be fired"); + assert.ok(panel_nodata_spy.calledOnce, "Panel event was fired"); + assert.ok(panel_nodata_spy.calledWith(expectedEvent), "Panel called with expected event"); + + // "Has data" call signature + var panel_withdata_spy = sinon.spy(); + var plot_withdata_spy = sinon.spy(); + this.panel.on("element_clicked", panel_withdata_spy); + this.panel.emit("element_clicked", {something: 1}, false); + + var expectedDataEvent = { sourceID: "plot.panel0", data: {something: 1} }; + + assert.ok(plot_withdata_spy.notCalled, "Plot event (with data) should not be not fired"); + assert.ok(panel_withdata_spy.calledOnce, "Panel event (with data) was fired"); + assert.ok(panel_withdata_spy.calledWith(expectedDataEvent), "Panel event (with data) called with expected event"); + }); + it("allows event listeners to be removed / cleaned up individually", function() { + var listener_handle = this.panel.on("element_clicked", function() {}); + assert.equal(this.panel.event_hooks["element_clicked"].length, 1, "Registered event listener"); + + this.panel.off("element_clicked", listener_handle); + assert.equal(this.panel.event_hooks["element_clicked"].length, 0, "De-registered event listener"); + }); + it("allows event listeners to be removed / cleaned up all at once", function() { + // Register two events! + this.panel.on("element_clicked", function() {}); + this.panel.on("element_clicked", function() {}); + assert.equal(this.panel.event_hooks["element_clicked"].length, 2, "Registered event listeners"); + + this.panel.off("element_clicked"); + assert.equal(this.panel.event_hooks["element_clicked"].length, 0, "De-registered event listener"); + }); + it("should scope the value of this to wherever the listener was attached, unless overridden", function() { + var call_count = 0; + this.plot.on("element_clicked", function() { + assert.ok(this instanceof LocusZoom.Plot, "Plot listener is bound to plot"); + call_count +=1; + }); + this.panel.on("element_clicked", function(event) { + assert.ok(this instanceof LocusZoom.Panel, "Panel listener is bound to panel"); + call_count +=1; + }); + + // Any manually provided binding context will override the one used by default. For example, an event + // listener could be used to trigger changes to a viewmodel for a different widget + var bind_context = { someInstanceMethod: function() {} }; + this.panel.on("element_clicked", function () { + assert.deepEqual(this, bind_context, "Manually bound context overrides defaults"); + call_count +=1; + }.bind(bind_context)); + + this.panel.emit("element_clicked", true); + assert.equal(call_count, 3, "All listener handlers were called as expected"); + }); + }); }); diff --git a/test/unit/Plot.js b/test/unit/Plot.js index 7309c3c6..ffb78754 100644 --- a/test/unit/Plot.js +++ b/test/unit/Plot.js @@ -497,4 +497,111 @@ describe("LocusZoom.Plot", function(){ }); }); + describe("subscribeToData", function() { + beforeEach(function() { + this.sandbox = sinon.sandbox.create(); + var layout = { + panels: [ { id: "panel0" } ] + }; + + this.first_source_data = [ { x: 0, y: false }, { x: 1, y: true } ]; + this.data_sources = new LocusZoom.DataSources() + .add("first", ["StaticJSON", this.first_source_data ]); + + d3.select("body").append("div").attr("id", "plot"); + this.plot = LocusZoom.populate("#plot", this.data_sources, layout); + }); + + afterEach(function() { + d3.select("#plot").remove(); + this.sandbox.restore(); + }); + + it("allows subscribing to data using a standard limited fields array", function (done) { + var expectedData = [ {"first:x": 0}, {"first:x": 1} ]; + + var dataCallback = this.sandbox.spy(); + + this.plot.subscribeToData( + [ "first:x" ], + dataCallback, + { onerror: done } + ); + + this.plot.applyState().catch(done); + + // Ugly hack: callback was not recognized at time of promise resolution, and data_rendered may be fired + // more than once during rerender + window.setTimeout(function() { + try { + assert.ok(dataCallback.called, "Data handler was called"); + assert.ok(dataCallback.calledWith(expectedData), "Data handler received the expected data"); + done(); + } catch(error) { + done(error); + } + }, 0); + }); + + it.skip("allows subscribing to individual (not combined) sources", function (done) { + var expectedData = { first: [ {"first:x": 0}, {"first:x": 1} ] }; + var dataCallback = this.sandbox.spy(); + + this.plot.subscribeToData( + [ "first:x" ], + dataCallback, + { onerror: done , discrete: true } + ); + // Ugly hack: callback was not recognized at time of promise resolution, and data_rendered may be fired + // more than once during rerender + window.setTimeout(function() { + try { + assert.ok(dataCallback.called, "Data handler was called"); + assert.ok(dataCallback.calledWith(expectedData), "Data handler received the expected data"); + done(); + } catch(error) { + done(error); + } + }, 0); + }); + + it("calls an error callback if a problem occurs while fetching data", function() { + var dataCallback = this.sandbox.spy(); + var errorCallback = this.sandbox.spy(); + + this.plot.subscribeToData( + [ "nosource:x" ], + dataCallback, + { onerror: errorCallback } + ); + + return this.plot.applyState() + .then(function() { + assert.ok(dataCallback.notCalled, "Data callback was not called"); + assert.ok(errorCallback.called, "Error callback was called"); + }); + }); + + it("allows event listeners to be removed / cleaned up individually", function() { + var dataCallback = sinon.spy(); + var errorCallback= sinon.spy(); + + var listener = this.plot.subscribeToData( + [ "nosource:x" ], + dataCallback, + { onerror: errorCallback } + ); + + this.plot.off("data_rendered", listener); + this.plot.emit("data_rendered"); + assert.equal( + this.plot.event_hooks["data_rendered"].indexOf(listener), + -1, + "Listener should not be registered" + ); + assert.ok(dataCallback.notCalled, "listener success callback was not fired"); + assert.ok(errorCallback.notCalled, "listener error callback was not fired"); + }); + }); + }); From 446daf7c9a61db23aa000c20edcb7c7984c6272b Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Mon, 21 May 2018 23:21:09 -0400 Subject: [PATCH 05/19] New extension namespace for optional extra features: - Dynamic URLs: update the URL in response to plot state changes --- assets/js/app/LocusZoom.js | 10 ++ assets/js/ext/lz-dynamic-urls.js | 153 +++++++++++++++++++++++++ files.js | 2 +- test/unit/ext_dynamic-urls.js | 189 +++++++++++++++++++++++++++++++ 4 files changed, 353 insertions(+), 1 deletion(-) create mode 100644 assets/js/ext/lz-dynamic-urls.js create mode 100644 test/unit/ext_dynamic-urls.js diff --git a/assets/js/app/LocusZoom.js b/assets/js/app/LocusZoom.js index e5eccb67..693c2ddc 100644 --- a/assets/js/app/LocusZoom.js +++ b/assets/js/app/LocusZoom.js @@ -729,3 +729,13 @@ LocusZoom.subclass = function(parent, extra, new_constructor) { return Sub; }; + + +/** + * LocusZoom optional extensions will live under this namespace. + * + * Extension code is not part of the core LocusZoom app.js bundle. + * @namespace + * @public + */ +LocusZoom.ext = {}; \ No newline at end of file diff --git a/assets/js/ext/lz-dynamic-urls.js b/assets/js/ext/lz-dynamic-urls.js new file mode 100644 index 00000000..47e6cf76 --- /dev/null +++ b/assets/js/ext/lz-dynamic-urls.js @@ -0,0 +1,153 @@ +/* global LocusZoom */ +/** + * Optional LocusZoom extension: must be included separately, and after LocusZoom has been loaded + * + * Demonstrates a mechanism by which the plot can be loaded to a specific initial state based on the URL query string + * (and, optionally, to update the URL bar when the plot state changes, with back button support) + * + * This makes it possible to create "direct links" to a particular plot of interest (and go back to a previous state + * as the user interacts with the page). Optionally, there is support for custom callbacks to connect the URL to + * arbitrarily complex plot behaviors. + */ +"use strict"; + +!function() { + function _serializeQueryParams(paramsObj) { + // Serialize an object of parameter values into a query string + // TODO: Improve support for array values v[]=1&v[]=2 + return "?" + + Object.keys(paramsObj).map(function(key) { + return encodeURIComponent(key) + "=" + + encodeURIComponent(paramsObj[key]); + }).join("&"); + } + + function _parseQueryParams(queryString) { + // Parse a query string into an object of parameter values. + // Does not attempt any type coercion; all values are, therefore, strings. + // TODO future: Support arrays / params that specify more than one value + var query = {}; + if (queryString) { + var pairs = (queryString[0] === "?" ? queryString.substr(1) : queryString).split("&"); + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i].split("="); + query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || ""); + } + } + return query; + } + + function _extractValues(data, mapping, reverse) { + // Use the mapping to convert between {stateField: urlParam} (or the reverse). Any fields not referenced in + // the "key" side of the mapping will be omitted from the return value. + // Likewise, will omit any requested keys that the source side of the mapping has no information for + reverse = reverse || false; + + var ret = {}; + var newMapping = mapping; + if (reverse) { + newMapping = {}; + Object.keys(mapping).forEach(function(k) { newMapping[mapping[k]] = k; }); + } + + Object.keys(newMapping).forEach(function(k) { + var asName = newMapping[k]; + if (data.hasOwnProperty(k)) { + ret[asName] = data[k]; + } + + }); + return ret; + } + + function _setStateFromUrlHandler(plot, stateData) { + // A default way to deal with URL changes: push all the params as state into plot and rerender + // More complex handlers are possible- example, URL parameters could be used to add or remove data layers + plot.applyState(stateData); + } + + function _setUrlFromStateHandler(plot, mapping) { + // Serialize and return basic query params based solely on information from plot.state + // More complex handlers are possible- the serializer can extract any information desired because it is given + // a direct reference to the plot object + + // This default method does not use the eventContext data, because so many things change plot.state without + // officially triggering an event. + return _extractValues(plot.state, mapping); + } + + function paramsFromUrl(mapping, queryString) { + // Internal helper function: second argument only used for unit testing + queryString = queryString || window.location.search; + var queryParams = _parseQueryParams(queryString); + return _extractValues(queryParams, mapping, true); + } + + // Public interface for this extension + LocusZoom.ext.DynamicUrls = { + /** + * Extract plot parameters from the URL query string. Very useful for setting up the plot on initial page load. + * @param {object} mapping How to map elements of plot state to URL param fields. Hash of + * {plotFieldName: urlParamName} entries (both values should be unique) + * @param {string} [queryString='window.location.search'] The query string to parse + * @returns {object} Plot parameter values + */ + paramsFromUrl: paramsFromUrl, + + /** + * Allows the plot to monitor changes in the URL and take action when the URL changes. + * + * For example, this enables using the browser back button to jump to a previous plot after user interaction. + * + * @param {LocusZoom.Plot} plot A reference to the LZ plot + * @param {object} mapping How to map elements of plot state to URL param fields. Hash of + * {plotFieldName: urlParamName} entries (both values should be unique) + * @param {function} [callback] Specify how the plot acts on information read in from query params. + * The default behavior is to push the data into `plot.state` + * Signature is function(plot, plotDataFromQueryString) + * @returns {function} The function handle for the new listener (allows cleanup if plot is removed later) + */ + plotWatchesUrl: function(plot, mapping, callback) { + callback = callback || _setStateFromUrlHandler; + + var listener = function(event) { + var stateData = paramsFromUrl(mapping); + // Tell the plot what to do with the params extracted from the URL + callback(plot, stateData); + }; + window.addEventListener("popstate", listener); + return listener; + }, + /** + * Update the URL whenever the plot state changes + * @param {LocusZoom.Plot} plot A reference to the LZ plot + * @param {object} mapping How to map elements of plot state to URL param fields. Hash of + * {plotFieldName: urlParamName} entries (both values should be unique) + * @param {function} [callback] Specify how plot data will be serialized into query params + * The default behavior is to extract all the URL params from plot.state as the only source. + * Signature is function(plot, mapping, eventContext) + * @returns {function} The function handle for the new listener (allows cleanup if plot is removed later) + */ + plotUpdatesUrl: function(plot, mapping, callback) { + callback = callback || _setUrlFromStateHandler; + // Note: this event only fires when applyState receives *new* information that would trigger a rerender. + // Plot state is sometimes changed without the event being fired. + var listener = function(eventContext) { + var oldParams = _parseQueryParams(window.location.search); + // Apply custom serialization to convert plot data to URL params + var serializedPlotData = callback(plot, mapping, eventContext); + var newParams = Object.assign({}, oldParams, serializedPlotData); + + // Not every state change would affect the URL. Allow type coercion since query is a string. + // eslint-disable-next-line eqeqeq + var update = Object.keys(newParams).some(function(k) { return (oldParams[k] != newParams[k]); }); + if (update) { + var queryString = _serializeQueryParams(newParams); + history.pushState({}, document.title, queryString); + } + }; + plot.on("state_changed", listener); + return listener; + } + }; +}(); diff --git a/files.js b/files.js index 66582b1e..19a4a170 100644 --- a/files.js +++ b/files.js @@ -36,7 +36,7 @@ var app_build = [ ]; // LocusZoom extensions: not part of the default build, but we may want to bundle separately in the future -var extensions = ["ext/**/*.js"]; +var extensions = ["assets/js/ext/**/*.js"]; // App, vendor, and helper files to be included at the top of each test suite // NOTE: Order of inclusion is important! diff --git a/test/unit/ext_dynamic-urls.js b/test/unit/ext_dynamic-urls.js new file mode 100644 index 00000000..f3bd8345 --- /dev/null +++ b/test/unit/ext_dynamic-urls.js @@ -0,0 +1,189 @@ +"use strict"; + +/** + * LocusZoom.ext.DynamicUrls : Extension functionality + */ +describe("LocusZoom.ext.DynamicUrls", function() { + beforeEach(function() { + this.extension = LocusZoom.ext.DynamicUrls; + }); + + // Tests + it("registers itself as a LocusZoom extension with a well-defined public interface", function () { + var extension = this.extension; + should.exist(extension, "Extension should be registered"); + + var publicMethods = ["paramsFromUrl", "plotWatchesUrl", "plotUpdatesUrl"]; + assert.equal(Object.keys(extension).length, publicMethods.length, "Some methods do not match the expected public interface"); + publicMethods.forEach(function(name) { + assert.ok(extension.hasOwnProperty(name), "Interface is missing an expected method: " + name); + }); + }); + + describe("paramsFromUrl", function() { + it("can use different names in the query string vs output", function() { + var func = this.extension.paramsFromUrl; + var query = "?urlParamName=avalue"; + var plotData = func({plotFieldName: "urlParamName" }, query); + + assert.deepEqual(plotData, {plotFieldName: "avalue"}); + + }); + it("handles value decoding", function() { + var func = this.extension.paramsFromUrl; + var query = "?param=soda%20bunny"; + var plotData = func({param: "param"}, query); + + assert.deepEqual(plotData, {param: "soda bunny"}); + }); + it("ignores parameters not specified in the mapping", function() { + var func = this.extension.paramsFromUrl; + var query = "?first=value&second=ignored"; + var plotData = func({one: "first"}, query); + + assert.deepEqual(plotData, {one: "value"}); + }); + + it("does not perform type coercion when deserializing", function() { + // TODO: We may wish to change type handling, but for now capture the expected behavior + var func = this.extension.paramsFromUrl; + var query = "?numeric=1&boolean=false&short_boolean=0&no_value"; + var plotData = func( + {numeric: "numeric", boolean: "boolean", short_boolean: "short_boolean", no_value: "no_value"}, + query + ); + + // Hack: deepStrictEqual behaving oddly in various scenarios; compare types separately + assert.deepEqual( + plotData, + {numeric: "1", boolean: "false", short_boolean: "0", no_value: ""}, + "Numeric value deserialized as string" + ); + + assert.ok(typeof plotData["numeric"] === "string", "Numeric field represented as string"); + assert.ok(typeof plotData["boolean"] === "string", "Boolean field represented as string"); + assert.ok(typeof plotData["short_boolean"] === "string", "Empty numeric type represented as string"); + assert.ok(plotData["no_value"] === "", "Valueless params are empty string"); + + + assert.ok(plotData["boolean"], "Non-empty strings are truthy"); + assert.ok(plotData["short_boolean"], "Numerals are strings, and therefore always truthy"); + assert.ok(!plotData["no_value"], "But a parameter with no value at all is still falsy"); + }); + }); + + describe("plotUpdateUrl", function() { + beforeEach(function() { + this.plot = new LocusZoom.Plot("plot", null, {state: { chr: 1, start: 1000, end: 5000 }}); + + // jsdom doesn't fully implement navigation, so we will check the act of changing URL instead of the result + this.sandbox = sinon.sandbox.create(); + + this.historySpy = this.sandbox.stub(history, "pushState"); + }); + + it("returns a handle to the newly created event listener", function () { + var handle = this.extension.plotUpdatesUrl(this.plot, {}); + assert.ok(typeof handle === "function"); + }); + + it("calls a custom serialization callback if provided", function() { + var spy = this.sandbox.spy(function() { return {}; }); + var stateUrlMapping = { chr: "chrom", start: "start", end: "end" }; + this.extension.plotUpdatesUrl(this.plot, stateUrlMapping, spy); + + this.plot.emit("state_changed"); + + assert.ok(spy.called); + }); + + it("changes the URL with new information from plot state with specified mapping", function() { + // Note: in a real case, the event gets triggered in the natural course of updating the plot. + // We fire the event directly to bypass unnecessary code for efficiency. + var stateUrlMapping = { chr: "chrom" }; + this.extension.plotUpdatesUrl(this.plot, stateUrlMapping); + + this.plot.state.chr = 7; + this.plot.emit("state_changed"); + + assert.ok(this.historySpy.called, "pushState was called"); + assert.ok(this.historySpy.calledWith({}, "", "?chrom=7"), "History URL params updated with the expected values"); + }); + + it("does not update the URL if plot state changes contain the same data as the URL", function() { + var stateUrlMapping = { chr: "chrom" }; + // Sinon + jsdom has trouble stubbing globals like window.location, so instead test not calling if "no old data" = "no new data" + this.plot.state = {}; + this.extension.plotUpdatesUrl(this.plot, stateUrlMapping); + + this.plot.emit("state_changed"); + assert.ok(!this.historySpy.called); + }); + + it.skip("does not update the URL if the parameters that change are not in the mapping", function() { + // In the absence of a good way to set window.location.search initially, this is difficult to test + // TODO: Revisit if jsdom navigation support improves in the future + }); + + afterEach(function() { + d3.select("#plot").remove(); + delete this.plot; + + // Remove all sinon stubs used for this test + this.sandbox.restore(); + }); + }); + + describe("plotWatchesUrl", function() { + // Because jsdom has trouble setting url before tests, coverage in this section will be low + beforeEach(function() { + this.plot = new LocusZoom.Plot("plot", null, {state: { chr: 1, start: 1000, end: 5000 }}); + + // jsdom doesn't fully implement navigation, so we will check the act of changing URL instead of the result + this.sandbox = sinon.sandbox.create(); + }); + + it("calls a custom deserialization callback when appropriate", function() { + var stateUrlMapping = { chr: "chrom", start: "start", end: "end" }; + var plot = this.plot; + var spy = this.sandbox.spy(function(plot, data) { + // jsdom has trouble mutating window.location, so data will be blank. The callback can perform + // arbitrary operations on the plot as evidence the watcher has worked. + plot.state.newField = 1; + }); + + this.extension.plotWatchesUrl(this.plot, stateUrlMapping, spy); + + // Inform jsdom of a navigation event that should trigger the callback + var anEvent = document.createEvent("Event"); + anEvent.initEvent("popstate", true, true); + window.dispatchEvent(anEvent); + + assert.ok(spy.called, "Custom callback was called"); + assert.equal(plot.state.newField, 1, "Callback successfully mutated the plot"); + }); + + it("uses new information from the url to alter the plot state", function() { + var stateUrlMapping = { chr: "chrom", start: "start", end: "end" }; + var spy = this.sandbox.spy(); + + this.extension.plotWatchesUrl(this.plot, stateUrlMapping, spy); + + // Inform jsdom of a navigation event that should trigger the callback + var anEvent = document.createEvent("Event"); + anEvent.initEvent("popstate", true, true); + window.dispatchEvent(anEvent); + + assert.ok(spy.called); + }); + + afterEach(function() { + d3.select("#plot").remove(); + delete this.plot; + + // Remove all sinon stubs used for this test + this.sandbox.restore(); + }); + }); + +}); From 6af04eba5562ac12c5e62a727b526acae2cc38c9 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Mon, 21 May 2018 23:23:44 -0400 Subject: [PATCH 06/19] Allow subclass to specify constructor in object (TODO: add mixin support) --- assets/js/app/LocusZoom.js | 14 ++++++-------- test/unit/LocusZoom.js | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/assets/js/app/LocusZoom.js b/assets/js/app/LocusZoom.js index 693c2ddc..3aa09a23 100644 --- a/assets/js/app/LocusZoom.js +++ b/assets/js/app/LocusZoom.js @@ -706,18 +706,18 @@ LocusZoom.generateLoader = function(){ * enable code reuse and customization of known LZ core functionality. * * @param {Function} parent A parent class constructor that will be extended by the child class - * @param {Object} extra An object of additional properties and methods to add/override behavior for the child class - * @param {Function} [new_constructor] An optional constructor function that performs additional setup. If omitted, - * just calls the parent constructor by default. Implementer must manage super calls when overriding the constructor. + * @param {Object} extra An object of additional properties and methods to add/override behavior for the child class. + * The special "constructor" property can be used to specify a custom constructor, or it will call parent by default. + * Implementer must manage super calls when overriding the constructor. * @returns {Function} The constructor for the new child class */ -LocusZoom.subclass = function(parent, extra, new_constructor) { +LocusZoom.subclass = function(parent, extra) { if (typeof parent !== "function" ) { throw "Parent must be a callable constructor"; } extra = extra || {}; - var Sub = new_constructor || function() { + var Sub = extra.hasOwnProperty("constructor") ? extra.constructor : function() { parent.apply(this, arguments); }; @@ -725,8 +725,6 @@ LocusZoom.subclass = function(parent, extra, new_constructor) { Object.keys(extra).forEach(function(k) { Sub.prototype[k] = extra[k]; }); - Sub.prototype.constructor = Sub; - return Sub; }; @@ -738,4 +736,4 @@ LocusZoom.subclass = function(parent, extra, new_constructor) { * @namespace * @public */ -LocusZoom.ext = {}; \ No newline at end of file +LocusZoom.ext = {}; diff --git a/test/unit/LocusZoom.js b/test/unit/LocusZoom.js index 1d337d93..cc9b5ece 100644 --- a/test/unit/LocusZoom.js +++ b/test/unit/LocusZoom.js @@ -333,7 +333,9 @@ describe("LocusZoom Core", function(){ }); it("will use a custom constructor function if provided", function() { var Parent = function() {this.name = "parent";}; - var Child = LocusZoom.subclass(Parent, {}, function() {this.name = "child";}); + var Child = LocusZoom.subclass(Parent, { + constructor: function() {this.name = "child";} + }); var instance = new Child(); assert.equal(instance.name, "child"); }); @@ -352,10 +354,12 @@ describe("LocusZoom Core", function(){ }; var Child = LocusZoom.subclass( Parent, - { isChild: true }, - function(one, two, three) { - Parent.apply(this, arguments); - this.three = three; + { + constructor: function(one, two, three) { + Parent.apply(this, arguments); + this.three = three; + }, + isChild: true }); var instance = new Child("one", "two", "three"); assert.equal(instance.name, "parent"); @@ -375,13 +379,13 @@ describe("LocusZoom Core", function(){ var Child = LocusZoom.subclass( Parent, { + constructor: function() { + // Implementer must manage super calls when overriding the constructor + Parent.apply(this, arguments); + this.classname = "special"; + }, field: "child1", overrideMe: function() {return "child2";} - }, - function() { - // Implementer must manage super calls when overriding the constructor - Parent.apply(this, arguments); - this.classname="special"; }); var instance = new Child(); From 24aef1a3489734edb001af4dee0f0187a934686d Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 22 May 2018 09:57:57 -0400 Subject: [PATCH 07/19] Build minified extensions for `dist` --- gulpfile.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index a228b4fd..25d6822b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -88,6 +88,21 @@ gulp.task("app_js", ["test"], function() { }).on("error", function() { gutil.log(gutil.colors.bold.white.bgRed(" FAILED to generate locuszoom.app.js bundles ")); }); + + // Provide minified versions of each optional extension, separate from the main bundle + gulp.src(files.extensions) + .pipe(rename(function (fn) { + fn.extname = ".min.js"; + })) + .pipe(sourcemaps.init()) + .pipe(uglify()) + .pipe(sourcemaps.write(".")) + .pipe(gulp.dest(path.join(destinationFolder, "ext"))) + .on("end", function() { + gutil.log(gutil.colors.bold.white.bgBlue(" Generated minified extensions ")); + }).on("error", function() { + gutil.log(gutil.colors.bold.white.bgRed(" FAILED to generate minified extensions ")); + }); }); // Concatenate vendor js files into a single vendor file From b56eb69bfae6285cbff89cb86b529e9eead929fd Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 22 May 2018 10:37:20 -0400 Subject: [PATCH 08/19] Make pr131 changes consistent with events refactor --- assets/js/app/DataLayers/scatter.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/js/app/DataLayers/scatter.js b/assets/js/app/DataLayers/scatter.js index e86119c0..f39fc0b2 100644 --- a/assets/js/app/DataLayers/scatter.js +++ b/assets/js/app/DataLayers/scatter.js @@ -436,8 +436,7 @@ LocusZoom.DataLayers.add("scatter", function(layout){ this.separate_labels(); // Apply default event emitters to selection this.label_texts.on("click.event_emitter", function(element){ - this.parent.emit("element_clicked", element); - this.parent_plot.emit("element_clicked", element); + this.parent.emit("element_clicked", element, true); }.bind(this)); // Extend mouse behaviors to labels this.applyBehaviors(this.label_texts); From 0d3d040aa1832ee20fc07721c0c66baeef68c3d1 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 22 May 2018 10:52:54 -0400 Subject: [PATCH 09/19] Use dynamic urls in index.html demo --- index.html | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 42bc1d9c..ef8efdcd 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,8 @@ + + LocusZoom.js @@ -51,7 +53,7 @@

Top Hits

    -
    +

    To see other forms of LocusZoom.js in action take a look at locuszoom.org or the examples on this page.

    @@ -207,7 +209,13 @@
    Credible Sets
    } // Get the standard association plot layout from LocusZoom's built-in layouts - layout = LocusZoom.Layouts.get("plot", "standard_association"); + var stateUrlMapping = {chr: "chrom", start: "start", end: "end"}; + // Fetch initial position from the URL, or use some defaults + var initialState = LocusZoom.ext.DynamicUrls.paramsFromUrl(stateUrlMapping); + if (!Object.keys(initialState).length) { + initialState = {chr: 10, start: 114550452, end: 115067678}; + } + layout = LocusZoom.Layouts.get("plot", "standard_association", {state: initialState}); layout.dashboard = LocusZoom.Layouts.get("dashboard", "region_nav_plot"); // Add a button to show the study abstract the layout @@ -220,8 +228,13 @@
    Credible Sets
    menu_html: abstract }); - // Generate the LocusZoom plot - var plot = LocusZoom.populate("#plot", data_sources, layout); + // Generate the LocusZoom plot, and reflect the initial plot state in url + window.plot = LocusZoom.populate("#plot", data_sources, layout); + + // Changes in the plot can be reflected in the URL, and vice versa (eg browser back button can go back to + // a previously viewed region) + LocusZoom.ext.DynamicUrls.plotUpdatesUrl(plot, stateUrlMapping); + LocusZoom.ext.DynamicUrls.plotWatchesUrl(plot, stateUrlMapping); // Add a basic loader to each panel (one that shows when data is requested and hides when one rendering) plot.layout.panels.forEach(function(panel){ From 5ca2471402377d3aaca63fbc9d0fda220b976651 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 22 May 2018 11:01:02 -0400 Subject: [PATCH 10/19] Allow gene colors to be configured via a layout directive --- assets/css/locuszoom.scss | 4 ---- assets/js/app/DataLayers/genes.js | 25 +++++++++++++++++++------ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/assets/css/locuszoom.scss b/assets/css/locuszoom.scss index 7deb7fed..88a5027e 100644 --- a/assets/css/locuszoom.scss +++ b/assets/css/locuszoom.scss @@ -183,17 +183,13 @@ svg.#{$namespace}-locuszoom { } rect.#{$namespace}-data_layer-genes.#{$namespace}-boundary { - stroke: rgb(54, 54, 150); stroke-opacity: 1; stroke-width: 1px; - fill: #000099; } rect.#{$namespace}-data_layer-genes.#{$namespace}-exon { - stroke: rgb(54, 54, 150); stroke-opacity: 1; stroke-width: 1px; - fill: #000099; } g.#{$namespace}-data_layer-intervals-faded { diff --git a/assets/js/app/DataLayers/genes.js b/assets/js/app/DataLayers/genes.js index eac6c6a4..7927ce20 100644 --- a/assets/js/app/DataLayers/genes.js +++ b/assets/js/app/DataLayers/genes.js @@ -13,11 +13,14 @@ LocusZoom.DataLayers.add("genes", function(layout){ * @member {Object} * */ this.DefaultLayout = { + // Optionally specify different fill and stroke properties + stroke: "rgb(54, 54, 150)", + color: "#363696", label_font_size: 12, label_exon_spacing: 4, exon_height: 16, bounding_box_padding: 6, - track_vertical_spacing: 10, + track_vertical_spacing: 10 }; layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout); @@ -206,6 +209,7 @@ LocusZoom.DataLayers.add("genes", function(layout){ */ this.render = function(){ + var self = this; this.assignTracks(); var width, height, x, y; @@ -266,8 +270,11 @@ LocusZoom.DataLayers.add("genes", function(layout){ bboxes.exit().remove(); // Render gene boundaries + var boundary_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d); }; + var boundary_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d); }; var boundaries = d3.select(this).selectAll("rect.lz-data_layer-genes.lz-boundary") - .data([gene], function(d){ return d.gene_name + "_boundary"; }); + .data([gene], function(d){ return d.gene_name + "_boundary"; }) + .style({ fill: boundary_fill, stroke: boundary_stroke }); boundaries.enter().append("rect") .attr("class", "lz-data_layer-genes lz-boundary"); @@ -345,12 +352,19 @@ LocusZoom.DataLayers.add("genes", function(layout){ labels.exit().remove(); // Render exon rects (first transcript only, for now) + // Exons: by default color on gene properties for consistency with the gene boundary track- hence color uses d.parent.parent + var exon_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d.parent.parent); }; + var exon_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d.parent.parent); }; + var exons = d3.select(this).selectAll("rect.lz-data_layer-genes.lz-exon") .data(gene.transcripts[gene.parent.transcript_idx].exons, function(d){ return d.exon_id; }); - + exons.enter().append("rect") .attr("class", "lz-data_layer-genes lz-exon"); - + + exons + .style({ fill: exon_fill, stroke: exon_stroke }); + width = function(d){ return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start); }; @@ -425,8 +439,7 @@ LocusZoom.DataLayers.add("genes", function(layout){ // Apply default event emitters to clickareas clickareas.on("click.event_emitter", function(element){ - element.parent.parent.emit("element_clicked", element); - element.parent.parent_plot.emit("element_clicked", element); + element.parent.parent.emit("element_clicked", element, true); }); // Apply mouse behaviors to clickareas From 99f95537bcb7731a42749c63da496933833e3f43 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 22 May 2018 11:42:34 -0400 Subject: [PATCH 11/19] Rework parseResponse flow into 4 step sequence for more control Also: add capabilities for reusing the same request data in multiple ways - New "Connector Source" type (base class) - New `chain.discrete` field (allows building up a body in a separate step from data fetching- "fetch once, use in different ways") - Connect subscribeToData with an option to use `chain.discrete` DEPRECATES: parseData, parseArrayToObjects, parseObjectsToObjects, prepareData Provides stub implementations to avoid breaking legacy applications Steps are: - standardize - annotate/cleanup values with custom fields - extract fields for this source (and apply transformations) - combine response body from this source with chain This allows annotations to obey the fields array (previously not possible because parseData was doing everything in one step). The result of step 3 is what gets added to chain.discrete, the payload generated from handling just this source Update existing sources and examples to use the new processing steps (resolves some hacky aspects of credible sets calculation) Allow parseResponse steps to return either data or promises (for future async operations, eg calculated values) Special non-fields-array layouts use `namespace:all` now as convention for clarity (avoid mysterious fake field names) Adds unit tests around data chain (new and old methods) --- assets/js/app/Data.js | 380 ++++++++++++++++++--------- assets/js/app/Layouts.js | 2 +- examples/js/credible-sets-example.js | 239 +++++++++-------- test/unit/Data.js | 352 +++++++++++++++++++++++-- test/unit/Plot.js | 2 +- 5 files changed, 713 insertions(+), 262 deletions(-) diff --git a/assets/js/app/Data.js b/assets/js/app/Data.js index 703065df..a1dd18b1 100644 --- a/assets/js/app/Data.js +++ b/assets/js/app/Data.js @@ -38,10 +38,15 @@ LocusZoom.DataSources.prototype.add = function(ns, x) { /** @protected */ LocusZoom.DataSources.prototype.set = function(ns, x) { if (Array.isArray(x)) { + // If passed array of source name and options, make the source var dsobj = LocusZoom.KnownDataSources.create.apply(null, x); + // Each datasource in the chain should be aware of its assigned namespace + dsobj.source_id = ns; this.sources[ns] = dsobj; } else { + // If passed the already-created source object if (x !== null) { + x.source_id = ns; this.sources[ns] = x; } else { delete this.sources[ns]; @@ -212,7 +217,7 @@ LocusZoom.Data.Requester = function(sources) { this.getData = function(state, fields) { var requests = split_requests(fields); // Create an array of functions that, when called, will trigger the request to the specified datasource - var promises = Object.keys(requests).map(function(key) { + var request_handles = Object.keys(requests).map(function(key) { if (!sources.get(key)) { throw("Datasource for namespace " + key + " not found"); } @@ -221,10 +226,10 @@ LocusZoom.Data.Requester = function(sources) { }); //assume the fields are requested in dependent order //TODO: better manage dependencies - var ret = Q.when({header:{}, body:{}}); - for(var i=0; i < promises.length; i++) { + var ret = Q.when({header:{}, body:{}, discrete: {}}); + for(var i=0; i < request_handles.length; i++) { // If a single datalayer uses multiple sources, perform the next request when the previous one completes - ret = ret.then(promises[i]); + ret = ret.then(request_handles[i]); } return ret; }; @@ -273,7 +278,7 @@ LocusZoom.Data.Source.prototype.parseInit = function(init) { }; /** - * Fetch the internal string used to represent this data when cache is used + * A unique identifier that indicates whether cached data is valid for this request * @protected * @param state * @param chain @@ -281,12 +286,16 @@ LocusZoom.Data.Source.prototype.parseInit = function(init) { * @returns {String|undefined} */ LocusZoom.Data.Source.prototype.getCacheKey = function(state, chain, fields) { - var url = this.getURL && this.getURL(state, chain, fields); - return url; + return this.getURL && this.getURL(state, chain, fields); }; /** - * Fetch data from a remote location + * Stub: build the URL for any requests made by this source. + */ +LocusZoom.Data.Source.prototype.getURL = function(state, chain, fields) { return this.url; }; + +/** + * Perform a network request to fetch data for this source * @protected * @param {Object} state The state of the parent plot * @param chain @@ -296,11 +305,9 @@ LocusZoom.Data.Source.prototype.fetchRequest = function(state, chain, fields) { var url = this.getURL(state, chain, fields); return LocusZoom.createCORSPromise("GET", url); }; -// TODO: move this.getURL stub into parent class and add documentation; parent should not check for methods known only to children - /** - * TODO Rename to handleRequest (to disambiguate from, say HTTP get requests) and update wiki docs and other references + * Gets the data for just this source, typically via a network request (caching where possible) * @protected */ LocusZoom.Data.Source.prototype.getRequest = function(state, chain, fields) { @@ -321,15 +328,17 @@ LocusZoom.Data.Source.prototype.getRequest = function(state, chain, fields) { }; /** - * Fetch the data from the specified data source, and format it in a way that can be used by the consuming plot - * @protected + * Fetch the data from the specified data source, and apply transformations requested by an external consumer. + * This is the public-facing datasource method that will most commonly be called by external code. + * + * @public * @param {Object} state The current "state" of the plot, such as chromosome and start/end positions - * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the "namespace" prefix) TODO: Clarify how this fieldname maps to raw datasource output, and how it differs from outnames + * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the "namespace" prefix) * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the * originally requested field name, including the namespace. This must be an array with the same length as `fields` * @param {Function[]} trans The collection of transformation functions to be run on selected fields. * This must be an array with the same length as `fields` - * @returns {function(this:LocusZoom.Data.Source)} A callable operation that can be used as part of the data chain + * @returns {function} A callable operation that can be used as part of the data chain */ LocusZoom.Data.Source.prototype.getData = function(state, fields, outnames, trans) { if (this.preGetData) { @@ -357,108 +366,108 @@ LocusZoom.Data.Source.prototype.getData = function(state, fields, outnames, tran }; /** - * Parse response data. Return an object containing "header" (metadata or request parameters) and "body" - * (data to be used for plotting). The response from this request is combined with responses from all other requests - * in the chain. - * @public - * @param {String|Object} resp The raw data associated with the response - * @param {Object} chain The combined parsed response data from this and all other requests made in the chain - * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the "namespace" prefix) TODO: Clarify how this fieldname maps to raw datasource output, and how it differs from outnames - * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the - * originally requested field name, including the namespace. This must be an array with the same length as `fields` - * @param {Function[]} trans The collection of transformation functions to be run on selected fields. - * This must be an array with the same length as `fields` - * @returns {{header: ({}|*), body: {}}} - */ -LocusZoom.Data.Source.prototype.parseResponse = function(resp, chain, fields, outnames, trans) { - var json = typeof resp == "string" ? JSON.parse(resp) : resp; - var records = this.parseData(json.data || json, fields, outnames, trans); - return {header: chain.header || {}, body: records}; -}; -/** - * Some API endpoints return an object containing several arrays, representing columns of data. Each array should have - * the same length, and a given array index corresponds to a single row. + * Ensure the server response is in a canonical form, an array of one object per record. [ {field: oneval} ]. + * If the server response contains columns, reformats the response from {column1: [], column2: []} to the above. * - * This gathers column data into an array of objects, each one representing the combined data for a given record. - * See `parseData` for usage + * Does not apply namespacing or transformations. * + * May be overridden by data sources that inherently return more complex payloads, or that exist to annotate other + * sources. + * + * @param {Object[]|Object} data The original parsed server response * @protected - * @param {Object} x A response payload object - * @param {Array} fields - * @param {Array} outnames - * @param {Array} trans - * @returns {Object[]} - */ -LocusZoom.Data.Source.prototype.parseArraysToObjects = function(x, fields, outnames, trans) { - //intended for an object of arrays - //{"id":[1,2], "val":[5,10]} - var records = []; - fields.forEach(function(f, i) { - if (!(f in x)) {throw "field " + f + " not found in response for " + outnames[i];} - }); - // Safeguard: check that arrays are of same length - var keys = Object.keys(x); - var N = x[keys[0]].length; + */ +LocusZoom.Data.Source.prototype.normalizeResponse = function (data) { + if (Array.isArray(data)) { + // Already in the desired form + return data; + } + + // Otherwise, assume the server response is an object representing columns of data. + // Each array should have the same length (verify), and a given array index corresponds to a single row. + var keys = Object.keys(data); + var N = data[keys[0]].length; var sameLength = keys.every(function(key) { - var item = x[key]; + var item = data[key]; return item.length === N; }); if (!sameLength) { throw this.constructor.SOURCE_NAME + " expects a response in which all arrays of data are the same length"; } + // Go down the rows, and create an object for each record + var records = []; + var fields = Object.keys(data); for(var i = 0; i < N; i++) { var record = {}; - for(var j=0; j{{{{namespace[assoc]}}variant}}
    " - + "P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
    " + - "
    Posterior probability: {{assoc:credibleSetPosteriorProb|scinotation}}" + + "P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
    " + + "
    Posterior probability: {{{{namespace[assoc]}}credibleSetPosteriorProb|scinotation}}" }); // Define layouts that incorporate credible set annotations into the plot @@ -69,23 +71,23 @@ LocusZoom.Layouts.add("data_layer", "credible_set_annotation", { color: "#00CC00", // Credible set markings are derived fields. Although they don't need to be specified in the fields array, // we DO need to specify the fields used to do the calculation (eg pvalue) - fields: ["{{namespace[assoc]}}variant", "{{namespace[assoc]}}position", "{{namespace[assoc]}}log_pvalue"], + fields: ["{{namespace[assoc]}}variant", "{{namespace[assoc]}}position", "{{namespace[assoc]}}log_pvalue", "{{namespace[assoc]}}credibleSetPosteriorProb", "{{namespace[assoc]}}credibleSetContribution", "{{namespace[assoc]}}isCredible"], filters: [ // Specify which points to show on the track. Any selection must satisfy ALL filters - ["assoc:isCredible", true] + ["{{namespace[assoc]}}isCredible", true] ], behaviors: { onmouseover: [ - { action: "set", status: "highlighted" } + {action: "set", status: "highlighted"} ], onmouseout: [ - { action: "unset", status: "highlighted" } + {action: "unset", status: "highlighted"} ], onclick: [ - { action: "toggle", status: "selected", exclusive: true } + {action: "toggle", status: "selected", exclusive: true} ], onshiftclick: [ - { action: "toggle", status: "selected" } + {action: "toggle", status: "selected"} ] }, tooltip: LocusZoom.Layouts.get("tooltip", "credible_set_annotation"), @@ -98,7 +100,7 @@ LocusZoom.Layouts.add("panel", "credible_set_panel", { height: 100, min_height: 100, proportional_width: 1, - margin: { top: 35, right: 50, bottom: 40, left: 50 }, + margin: {top: 35, right: 50, bottom: 40, left: 50}, inner_border: "rgb(210, 210, 210)", interaction: { drag_background_to_pan: true, @@ -106,7 +108,7 @@ LocusZoom.Layouts.add("panel", "credible_set_panel", { x_linked: true }, data_layers: [ - LocusZoom.Layouts.get("data_layer", "credible_set_annotation", { unnamespaced: true }) + LocusZoom.Layouts.get("data_layer", "credible_set_annotation", {unnamespaced: true}) ] }); @@ -117,84 +119,93 @@ LocusZoom.Layouts.add("plot", "association_credible_sets", { responsive_resize: true, min_region_scale: 20000, max_region_scale: 1000000, - dashboard: LocusZoom.Layouts.get("dashboard", "standard_plot", { unnamespaced: true }), + dashboard: LocusZoom.Layouts.get("dashboard", "standard_plot", {unnamespaced: true}), panels: [ - function() { + function () { // Use a slightly modified association panel: custom tooltip - var l = LocusZoom.Layouts.get("panel", "association", { unnamespaced: true }); + var assoc_panel = LocusZoom.Layouts.get("panel", "association", {unnamespaced: true}); // Add "display options" button to control how credible set coloring is overlaid on the standard association plot - l.dashboard.components.push( + assoc_panel.dashboard.components.push( { - type: "display_options", - position: "right", - color: "blue", - // Below: special config specific to this widget - button_html: "Display options...", - button_title: "Control how plot items are displayed", - - layer_name: "associationpvalues", - default_config_display_name: "Linkage Disequilibrium (default)", // display name for the default plot color option (allow user to revert to plot defaults) - - options: [ - { - // First dropdown menu item - display_name: "95% credible set (boolean)", // Human readable representation of field name - display: { // Specify layout directives that control display of the plot for this option - point_shape: "circle", - point_size: 40, - color: { - field: "assoc:isCredible", - scale_function: "if", - parameters: { - field_value: true, - then: "#00CC00", - else: "#CCCCCC" - } - }, - legend: [ // Tells the legend how to represent this display option - { shape: "circle", color: "#00CC00", size: 40, label: "In credible set", class: "lz-data_layer-scatter" }, - { shape: "circle", color: "#CCCCCC", size: 40, label: "Not in credible set", class: "lz-data_layer-scatter" } - ] - } - }, - { - // Second option. The same plot- or even the same field- can be colored in more than one way. - display_name: "95% credible set (gradient by contribution)", - display: { - point_shape: "circle", - point_size: 40, - color: [ - { - field: "assoc:credibleSetContribution", - scale_function: "if", - parameters: { - field_value: 0, - then: "#777777" - } - }, - { - scale_function: "interpolate", - field: "assoc:credibleSetContribution", - parameters: { - breaks: [0, 1], - values: ["#fafe87", "#9c0000"] - } - } - ], - legend: [ - { shape: "circle", color: "#777777", size: 40, label: "No contribution", class: "lz-data_layer-scatter" }, - { shape: "circle", color: "#fafe87", size: 40, label: "Some contribution", class: "lz-data_layer-scatter" }, - { shape: "circle", color: "#9c0000", size: 40, label: "Most contribution", class: "lz-data_layer-scatter" } - ] - } - } - ] - } + type: "display_options", + position: "right", + color: "blue", + // Below: special config specific to this widget + button_html: "Display options...", + button_title: "Control how plot items are displayed", + + layer_name: "associationpvalues", + default_config_display_name: "Linkage Disequilibrium (default)", // display name for the default plot color option (allow user to revert to plot defaults) + + options: [ + { + // First dropdown menu item + display_name: "95% credible set (boolean)", // Human readable representation of field name + display: { // Specify layout directives that control display of the plot for this option + point_shape: "circle", + point_size: 40, + color: { + field: "assoc:isCredible", + scale_function: "if", + parameters: { + field_value: true, + then: "#00CC00", + else: "#CCCCCC" + } + }, + legend: [ // Tells the legend how to represent this display option + { shape: "circle", color: "#00CC00", size: 40, label: "In credible set", class: "lz-data_layer-scatter" }, + { shape: "circle", color: "#CCCCCC", size: 40, label: "Not in credible set", class: "lz-data_layer-scatter" } + ] + } + }, + { + // Second option. The same plot- or even the same field- can be colored in more than one way. + display_name: "95% credible set (gradient by contribution)", + display: { + point_shape: "circle", + point_size: 40, + color: [ + { // FIXME: Display options dropdown should support namespacing (namespaces have already been resolved by the time this works, so "assoc" is hardcoded) + field: "assoc:credibleSetContribution", + scale_function: "if", + parameters: { + field_value: 0, + then: "#777777" + } + }, + { + scale_function: "interpolate", + field: "assoc:credibleSetContribution", + parameters: { + breaks: [0, 1], + values: ["#fafe87", "#9c0000"] + } + } + ], + legend: [ + { shape: "circle", color: "#777777", size: 40, label: "No contribution", class: "lz-data_layer-scatter" }, + { shape: "circle", color: "#fafe87", size: 40, label: "Some contribution", class: "lz-data_layer-scatter" }, + { shape: "circle", color: "#9c0000", size: 40, label: "Most contribution", class: "lz-data_layer-scatter" } + ] + } + } + ] + } ); - l.data_layers[2].tooltip = LocusZoom.Layouts.get("tooltip", "credible_set_association"); - return l; + var assoc_layer = assoc_panel.data_layers[2]; + assoc_layer.tooltip = LocusZoom.Layouts.get("tooltip", "credible_set_association"); + + //["{{namespace[assoc]}}variant", "{{namespace[assoc]}}position", "{{namespace[assoc]}}log_pvalue", "{{namespace[assoc]}}credibleSetPosteriorProb", "{{namespace[assoc]}}credibleSetContribution", "{{namespace[assoc]}}isCredible"] + + // assoc_layer.fields.push("{{namespace[assoc]}}credibleSetPosteriorProb", "{{namespace[assoc]}}credibleSetContribution", "{{namespace[assoc]}}isCredible"); + assoc_layer.fields = [ + "{{namespace[assoc]}}variant", "{{namespace[assoc]}}position", "{{namespace[assoc]}}log_pvalue", "{{namespace[assoc]}}log_pvalue|logtoscinotation", "{{namespace[assoc]}}ref_allele", "{{namespace[assoc]}}credibleSetPosteriorProb", "{{namespace[assoc]}}credibleSetContribution", "{{namespace[assoc]}}isCredible", + "{{namespace[ld]}}state", "{{namespace[ld]}}isrefvar"]; + + return assoc_panel; }(), - LocusZoom.Layouts.get("panel", "credible_set_panel", { unnamespaced: true }) + LocusZoom.Layouts.get("panel", "credible_set_panel", {unnamespaced: true}) ] }); diff --git a/test/unit/Data.js b/test/unit/Data.js index 6f51a590..fe852b00 100644 --- a/test/unit/Data.js +++ b/test/unit/Data.js @@ -4,7 +4,7 @@ LocusZoom.js Data Test Suite Test LocusZoom Data access objects */ -describe("LocusZoom Data", function(){ +describe("LocusZoom Data", function() { describe("LocusZoom.Data.Field", function() { beforeEach(function() { LocusZoom.TransformationFunctions.add("herp", function(x) { return x.toString() + "herp"; }); @@ -156,6 +156,14 @@ describe("LocusZoom Data", function(){ should.not.exist(ds.get("t1")); should.exist(ds.get("t2")); }); + it("should provide a source_id for all sources defined as part of a chain", function() { + var ds = new LocusZoom.DataSources(); + ds.add("t1", new TestSource1()); + ds.add("t2", ["test2", {}]); + + assert.equal(ds.sources.t1.source_id, "t1", "Directly added source is aware of chain namespace"); + assert.equal(ds.sources.t2.source_id, "t2", "Source created via options is aware of chain namespace"); + }); }); describe("LocusZoom Data.Source", function() { @@ -256,40 +264,247 @@ describe("LocusZoom Data", function(){ }); }); - describe("Source.parseArraysToObjects", function() { - it("should require all columns of data to be of same length", function() { + describe("Source.getData", function() { + beforeEach(function() { + this.sandbox = sinon.sandbox.create(); + }); + + it("dependentSource skips making a request if previous sources did not add data to chain.body", function() { var source = new LocusZoom.Data.Source(); - assert.throws( - function() { - source.parseArraysToObjects( - {a: [1], b: [1,2], c: [1,2,3]}, - [], [], []); - }, - /expects a response in which all arrays of data are the same length/ - ); + source.dependentSource = true; + var requestStub = this.sandbox.stub(source, "getRequest"); + + var callable = source.getData(); + var noRecordsChain = { body: [] }; + callable(noRecordsChain); + + assert.ok(requestStub.notCalled, "Request should be skipped"); + }); + + it("dependentSource makes a request if chain.body has data from previous sources", function(done) { + var source = new LocusZoom.Data.Source(); + source.dependentSource = false; + var requestStub = this.sandbox.stub(source, "getRequest").callsFake(function() { return Q.when(); }); + this.sandbox.stub(source, "parseResponse").callsFake(function() { + // Because this is an async test, `done` will serve as proof that parseResponse was called + done(); + }); + + var callable = source.getData(); + var hasRecordsChain = { body: [{ some: "data" }] }; + callable(hasRecordsChain); + + assert.ok(requestStub.called, "Request was made"); + }); + + afterEach(function() { + this.sandbox.restore(); }); }); - describe("Source.prepareData", function() { - it("should annotate returned records with an additional custom field", function () { - var custom_source_class = LocusZoom.KnownDataSources.extend( - "StaticJSON", - "AnnotatedJSON", - { - prepareData: function(records) { + describe("Source.parseResponse", function() { + // Parse response is a wrapper for a set of helper methods. Test them individually, and combined. + describe("Source.parseArraysToObjects", function() { + it("should provide a legacy wrapper for completely deprecated method", function() { + var source = new LocusZoom.Data.Source(); + var res = source.parseArraysToObjects( + {a: [1], b: [1]}, + ["a", "b"], ["namespace:a|add1", "bork:bork"], [function(v) { return v + 1; }, null] + ); + + assert.deepEqual(res, [{"namespace:a|add1": 2, "bork:bork": 1}], "Transformations were applied"); + }); + }); + + describe("Source.parseObjectsToObjects", function () { + it("should provide a legacy wrapper for completely deprecated method", function() { + var source = new LocusZoom.Data.Source(); + var stub = sinon.stub(source, "extractFields"); + source.parseObjectsToObjects([], [], [], []); + assert.ok(stub.called, "extractFields was called"); + }); + }); + + describe("Source.normalizeResponse", function () { + it("should create one object per piece of data", function() { + var source = new LocusZoom.Data.Source(); + var res = source.normalizeResponse( + { a: [1, 2], b: [3, 4] } ); + assert.deepEqual( + res, + [ {a: 1, b: 3}, {a: 2, b: 4} ], + "Correct number and union of elements" + ); + }); + + it("should require all columns of data to be of same length", function() { + var source = new LocusZoom.Data.Source(); + assert.throws( + function() { + source.normalizeResponse( { a: [1], b: [1,2], c: [1,2,3] } ); + }, + /expects a response in which all arrays of data are the same length/ + ); + }); + + it("should return the data unchanged if it is already in the desired shape", function () { + var source = new LocusZoom.Data.Source(); + var data = [ {a: 1, b: 3}, {a: 2, b: 4} ]; + var res = source.normalizeResponse( data ); + assert.deepEqual(res, data); + }); + }); + + describe("Source.annotateData", function() { + it("should be able to add fields to the returned records", function () { + var source = LocusZoom.subclass(LocusZoom.Data.Source, { + annotateData(records) { // Custom hook that adds a field to every parsed record return records.map(function(item) { item.force = true; return item; }); } - } - ); - var source = new custom_source_class([{r:2, d:2}, {c:3, p: "o"}]); - // Async test depends on promise - return source.getData({}, [], [])({header: []}).then(function(records) { - records.body.forEach(function(item) { - assert.ok(item.force, "Record should have an additional key not in raw server payload"); + }); + + // Async test depends on promise + return new source().parseResponse([{a:1, b:1}, {a:2, b: 2}], {}, ["a", "b", "force"], ["a", "b", "force"], []).then(function(records) { + records.body.forEach(function(item) { + assert.ok(item.force, "Record should have an additional key not in raw server payload"); + }); + }); + }); + + it("should be able to annotate based on info in the body and chain", function() { + var source = LocusZoom.subclass(LocusZoom.Data.Source, { + annotateData (records, chain) { return records + chain.header.param; } + }); + var result = new source().annotateData( + "some data", + { header: { param: " up the chain" } } + ); + assert.equal(result, "some data up the chain"); + }); + }); + + describe("Source.extractFields", function () { + it("allows a legacy alias via parseArraysToObjects", function () { + var source = new LocusZoom.Data.Source(); + var res = source.parseArraysToObjects( + [ {"id":1, "val":5}, {"id":2, "val":10}], + ["id"], ["namespace:id"], [null] + ); + + assert.deepEqual(res, [{"namespace:id": 1}, {"namespace:id": 2}]); + }); + + it("extracts the specified fields from each record", function () { + var source = new LocusZoom.Data.Source(); + var res = source.extractFields( + [ {"id":1, "val":5}, {"id":2, "val":10}], + ["id"], ["namespace:id"], [null] + ); + assert.deepEqual(res, [{"namespace:id": 1}, {"namespace:id": 2}]); + }); + + it("applies value transformations where appropriate", function () { + var source = new LocusZoom.Data.Source(); + var res = source.extractFields( + [ {"id":1, "val":5}, {"id":2, "val":10}], + ["id", "val"], ["namespace:id|add1", "bork:bork"], [function (val) { return val + 1; }, null] + ); + // Output fields can be mapped to any arbitrary based on the field->outnames provided + assert.deepEqual(res, [{"namespace:id|add1": 2, "bork:bork": 5}, {"namespace:id|add1": 3, "bork:bork": 10}]); + }); + + it("throws an error when requesting a field not present in at least one record", function () { + var source = new LocusZoom.Data.Source(); + + + assert.throws(function() { + source.extractFields( + [ {"a":1}, {"a":2}], + ["b"], ["namespace:b"], [null] + ); + }, /field b not found in response for namespace:b/); + }); + }); + + describe("Source.combineChainBody", function () { + it("returns only the body by default", function() { + var source = new LocusZoom.Data.Source(); + + var expectedBody = [ { "namespace:a": 1 } ]; + var res = source.combineChainBody(expectedBody, {header: {}, body: [], discrete: {}}); + + assert.deepEqual(res, expectedBody); + }); + + it("can build a body based on records from all sources in the chain", function() { + var base_source = LocusZoom.subclass(LocusZoom.Data.Source, { + combineChainBody(records, chain) { + return records.map(function(item, index) { + return Object.assign({}, item, chain.body[index]); + }); + } + }); + var source = new base_source(); + + var records = [ { "namespace:a": 1 } ]; + var res = source.combineChainBody(records, {header: {}, body: [{"namespace:b": 2}], discrete: {}}); + + assert.deepEqual(res, [{ "namespace:a":1, "namespace:b": 2 }]); + }); + }); + + describe("integration of steps", function () { + it("should interpret a string response as JSON", function () { + var source = new LocusZoom.Data.Source(); + + return source.parseResponse('{"a_field": ["val"]}', {}, ["a_field"], ["namespace:a_field"], [null]) + .then(function (chain) { + assert.deepEqual(chain.body, [{"namespace:a_field": "val"}]); + }); + }); + + it("should store annotations in body and chain.discrete where appropriate", function() { + var source = LocusZoom.subclass(LocusZoom.Data.Source, { + annotateData: function (data) { return data + " with annotation"; }, + normalizeResponse(data) { return data; }, + extractFields(data) { return data; } + }); + source.prototype.constructor.SOURCE_NAME = "fake_source"; + + var result = new source().parseResponse({data: "a response"}, {}); + return result.then(function(chain) { + assert.deepEqual(chain.discrete, {fake_source: "a response with annotation"}, "Discrete response uses annotations"); + assert.deepEqual(chain.body, "a response with annotation", "Combined body uses annotations"); + }); + }); + + it("integrates all methods via promise semantics", function () { + // Returning a promise is optional, but should be supported if a custom subclass chooses to do so + var basic_source = LocusZoom.subclass(LocusZoom.Data.Source, { + normalizeResponse() { return Q.when( [{a:1}] ); }, + annotateData(records) { + return Q.when(records.map(function(item) { + item.b = item.a + 1; + return item; + })); + }, + extractFields(data, fields, outnames, trans) { + var rec = data.map(function(item) { return {"bfield": item.b}; }); + return Q.when(rec); }, + combineChainBody(records) { return Q.when(records); } + }); + basic_source.prototype.constructor.SOURCE_NAME = "fake_source"; + + var result = new basic_source().parseResponse({}, {}); + var thisBody = [{bfield: 2}]; + var expected = { header: {}, discrete: { fake_source: thisBody }, body: thisBody}; + return result.then(function (final) { + assert.deepEqual(final.body, expected.body, "Chain produces expected result body"); + assert.deepEqual(final.discrete, expected.discrete, "The parsed results from this source are also stored in chain.discrete"); }); }); }); @@ -353,4 +568,91 @@ describe("LocusZoom Data", function(){ }); }); + describe("LocusZoom Data.ConnectorSource", function() { + beforeEach(function () { + this.sandbox = sinon.sandbox.create(); + + // Create a source that internally looks for data as "first" from the specified + this.basic_config = { sources: { first: "a_source", second: "b_source" } }; + this.basic_source = LocusZoom.subclass(LocusZoom.Data.ConnectorSource, { + combineChainBody: function(records, chain) { + // A sample method that uses 2 chain sources + an existing body to build an combined response + + // Tell the internal method how to find the actual data it relies on internally, regardless of how + // it is called in the namespaced data chain + var nameFirst = this._source_name_mapping["first"]; + var nameSecond = this._source_name_mapping["second"]; + + records.forEach(function(item) { + item.a = chain.discrete[nameFirst].a_field; + item.b = chain.discrete[nameSecond].b_field; + }); + return records; + } + }); + this.basic_source.prototype.constructor.SOURCE_NAME = "test_connector"; + }); + + afterEach(function() { + this.sandbox.restore(); + }); + + it("must specify the data it requires from other sources", function() { + var source = LocusZoom.subclass(LocusZoom.Data.ConnectorSource); + assert.throws( + function() { new source(); }, + /Connectors must specify the data they require as init.sources = {internal_name: chain_source_id}} pairs/ + ); + assert.ok( + new source(this.basic_config), + "Correctly specifies the namespaces containing data that this connector relies on" + ); + }); + it("must implement a combineChainBody method", function() { + var self = this; + var source = LocusZoom.subclass(LocusZoom.Data.ConnectorSource); + assert.throws( + function() { new source(self.basic_config).combineChainBody(); }, + /This method must be implemented in a subclass/ + ); + }); + it("should fail if the namespaces it relies on are not present in the chain", function() { + var instance = new this.basic_source(this.basic_config); + assert.throws( + function() { instance.getRequest({}, { discrete: { } }); }, + /test_connector cannot be used before loading required data for: a_source/ + ); + }); + it("should not make any network requests", function() { + var instance = new this.basic_source(this.basic_config); + var fetchSpy = this.sandbox.stub(instance, "fetchRequest"); + + return instance.getRequest({}, { discrete: { a_source: 1, b_source: 2 } }) + .then(function() { assert.ok(fetchSpy.notCalled, "No network request was fired"); }); + }); + it("should not return any new data from getRequest", function() { + var instance = new this.basic_source(this.basic_config); + var expectedBody = { sample: "response data" }; + return instance.getRequest({}, { discrete: { a_source: 1, b_source: 2 }, body: expectedBody }) + .then(function(records) { assert.deepEqual(records, expectedBody, "Should return the previous body"); }); + }); + it("should build a response by combining data from multiple places", function() { + // Should have access to data in both chain.discrete and chain.body. (connectors don't have their own data) + // Not every source in chain.discrete has to be an array of records- this tests arbitrary blobs of JSON + var rawChain = { a_source: { a_field: "aaa" }, b_source: { b_field: "bbb" } }; + var expectedBody = [{who: 1, a: "aaa", b: "bbb"}, {what: 2, a: "aaa", b: "bbb"}]; + + var instance = new this.basic_source(this.basic_config); + return instance.getData()( + { + discrete: rawChain, + body: [{ who: 1 }, { what: 2 }] + } + ).then(function(response) { + assert.deepEqual(response.body, expectedBody, "Response body was correctly annotated"); + assert.deepEqual(response.discrete, rawChain, "The chain of individual sources was not changed"); + }); + }); + }); }); + diff --git a/test/unit/Plot.js b/test/unit/Plot.js index ffb78754..af84a110 100644 --- a/test/unit/Plot.js +++ b/test/unit/Plot.js @@ -543,7 +543,7 @@ describe("LocusZoom.Plot", function(){ }, 0); }); - it.skip("allows subscribing to individual (not combined) sources", function (done) { + it("allows subscribing to individual (not combined) sources", function (done) { var expectedData = { first: [ {"first:x": 0}, {"first:x": 1} ] }; var dataCallback = this.sandbox.spy(); From 1df7c7028ddea3069e643320507685484d4457b4 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 5 Jun 2018 12:41:24 -0400 Subject: [PATCH 12/19] Bugfix: sci notation helper should handle negative numbers --- assets/js/app/Singletons.js | 10 ++++++---- test/unit/Singletons.js | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/assets/js/app/Singletons.js b/assets/js/app/Singletons.js index 1a9bd378..8a4615aa 100644 --- a/assets/js/app/Singletons.js +++ b/assets/js/app/Singletons.js @@ -291,11 +291,13 @@ LocusZoom.TransformationFunctions.add("logtoscinotation", function(x) { LocusZoom.TransformationFunctions.add("scinotation", function(x) { if (isNaN(x)){ return "NaN"; } if (x === 0){ return "0"; } + + var abs = Math.abs(x); var log; - if (Math.abs(x) > 1){ - log = Math.ceil(Math.log(x) / Math.LN10); - } else { - log = Math.floor(Math.log(x) / Math.LN10); + if (abs > 1) { + log = Math.ceil(Math.log(abs) / Math.LN10); + } else { // 0...1 + log = Math.floor(Math.log(abs) / Math.LN10); } if (Math.abs(log) <= 3){ return x.toFixed(3); diff --git a/test/unit/Singletons.js b/test/unit/Singletons.js index fd306156..b920c2c3 100644 --- a/test/unit/Singletons.js +++ b/test/unit/Singletons.js @@ -68,6 +68,8 @@ describe("LocusZoom Singletons", function(){ }); describe("scinotation", function() { var tests = [ + { arg: -14000, expected: "-1.40 × 10^4" }, + { arg: -5.50105, expected: "-5.501" }, { arg: 0, expected: "0" }, { arg: 1, expected: "1.000" }, { arg: 0.0562435, expected: "0.056" }, From e25806d95f3e0f41a34badf3922760c69035cd38 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Wed, 20 Jun 2018 16:41:45 -0400 Subject: [PATCH 13/19] Workaround for aborted request edge case (promises reported success on mixed content warning) This should be regarded as a temporary workaround until ExAC issue has been updated- this sort of situation appears to be difficult to reliably detect cross-browser. --- assets/js/app/Data.js | 18 ++++++++++++++---- test/unit/Data.js | 21 +++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/assets/js/app/Data.js b/assets/js/app/Data.js index a1dd18b1..14a75a81 100644 --- a/assets/js/app/Data.js +++ b/assets/js/app/Data.js @@ -511,6 +511,15 @@ LocusZoom.Data.Source.prototype.parseResponse = function(resp, chain, fields, ou chain.discrete = {}; } + if (!resp) { + // FIXME: Hack. Certain browser issues (such as mixed content warnings) are reported as a successful promise + // resolution, even though the request was aborted. This is difficult to reliably detect, and is most likely + // to occur for annotation sources (such as from ExAC). If empty response is received, skip parsing and log. + // FIXME: Throw an error after pending, eg https://github.com/konradjk/exac_browser/issues/345 + console.error("No usable response was returned for source: '" + source_id + "'. Parsing will be skipped."); + return Q.when(chain); + } + var json = typeof resp == "string" ? JSON.parse(resp) : resp; var self = this; @@ -993,7 +1002,7 @@ LocusZoom.Data.ConnectorSource.prototype.REQUIRED_SOURCES = []; LocusZoom.Data.ConnectorSource.prototype.parseInit = function(init) {}; // Stub LocusZoom.Data.ConnectorSource.prototype.getRequest = function(state, chain, fields) { - // Connectors do not have their own data by definition, but they *do* depend on other sources having been loaded + // Connectors do not request their own data by definition, but they *do* depend on other sources having been loaded // first. This method performs basic validation, and preserves the accumulated body from the chain so far. var self = this; Object.keys(this._source_name_mapping).forEach(function(ns) { @@ -1007,9 +1016,10 @@ LocusZoom.Data.ConnectorSource.prototype.getRequest = function(state, chain, fie LocusZoom.Data.ConnectorSource.prototype.parseResponse = function(data, chain, fields, outnames) { // A connector source does not update chain.discrete, but it may use it. It bypasses data formatting - // and field selection (because it has no data of its own) - // Typically connectors are called with `connector_name:all` in the fields array. Since they are only responsible - // for joining two sources, the final fields array is already limited by whatever came in. + // and field selection (both are assumed to have been done already, by the previous sources this draws from) + + // Because of how the chain works, connectors are not very good at applying new transformations or namespacing. + // Typically connectors are called with `connector_name:all` in the fields array. return Q.when(this.combineChainBody(data, chain, fields, outnames)) .then(function(new_body) { return {header: chain.header || {}, discrete: chain.discrete || {}, body: new_body}; diff --git a/test/unit/Data.js b/test/unit/Data.js index fe852b00..2b2b9a90 100644 --- a/test/unit/Data.js +++ b/test/unit/Data.js @@ -304,6 +304,27 @@ describe("LocusZoom Data", function() { describe("Source.parseResponse", function() { // Parse response is a wrapper for a set of helper methods. Test them individually, and combined. + + beforeEach(function() { + this.sandbox = sinon.sandbox.create(); + }); + + afterEach(function() { + this.sandbox.restore(); + }); + + it("lets empty response edge cases pass with a warning", function () { + // This is a hack around a browser edge case, and intent may change later + var error_stub = this.sandbox.stub(console, "error"); + var source = new LocusZoom.Data.Source(); + + var expected_chain = { dummy: true }; + return source.parseResponse("", expected_chain, [], [], []).then(function(res) { + assert.deepEqual(res, expected_chain); + assert.ok(error_stub.called, "An error message was logged"); + }); + }); + describe("Source.parseArraysToObjects", function() { it("should provide a legacy wrapper for completely deprecated method", function() { var source = new LocusZoom.Data.Source(); From 21fbce5dcdeea1e4f509dcc21ce8eb756ee99a67 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 26 Jun 2018 10:08:25 -0400 Subject: [PATCH 14/19] Dyn urls: prevent broken back button on 1st pageload --- assets/js/ext/lz-dynamic-urls.js | 10 +++++++++- dist/ext/lz-dynamic-urls.min.js | 2 ++ dist/ext/lz-dynamic-urls.min.js.map | 1 + test/unit/ext_dynamic-urls.js | 4 ++-- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 dist/ext/lz-dynamic-urls.min.js create mode 100644 dist/ext/lz-dynamic-urls.min.js.map diff --git a/assets/js/ext/lz-dynamic-urls.js b/assets/js/ext/lz-dynamic-urls.js index 47e6cf76..f61a3cc9 100644 --- a/assets/js/ext/lz-dynamic-urls.js +++ b/assets/js/ext/lz-dynamic-urls.js @@ -143,7 +143,15 @@ var update = Object.keys(newParams).some(function(k) { return (oldParams[k] != newParams[k]); }); if (update) { var queryString = _serializeQueryParams(newParams); - history.pushState({}, document.title, queryString); + + if (Object.keys(oldParams).length) { + history.pushState({}, document.title, queryString); + } else { + // Prevent broken back behavior on first page load: the first time query params are set, + // we don't generate a separate history entry + history.replaceState({}, document.title, queryString); + } + } }; plot.on("state_changed", listener); diff --git a/dist/ext/lz-dynamic-urls.min.js b/dist/ext/lz-dynamic-urls.min.js new file mode 100644 index 00000000..e27a66fc --- /dev/null +++ b/dist/ext/lz-dynamic-urls.min.js @@ -0,0 +1,2 @@ +"use strict";!function(){function t(t){return"?"+Object.keys(t).map(function(n){return encodeURIComponent(n)+"="+encodeURIComponent(t[n])}).join("&")}function n(t){var n={};if(t)for(var e=("?"===t[0]?t.substr(1):t).split("&"),o=0;o Date: Tue, 26 Jun 2018 11:10:12 -0400 Subject: [PATCH 15/19] Add dynamic urls to cred sets demo --- examples/credible_sets.html | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/examples/credible_sets.html b/examples/credible_sets.html index ebb792a2..c8867709 100644 --- a/examples/credible_sets.html +++ b/examples/credible_sets.html @@ -9,14 +9,13 @@ - + + - - + + LocusZoom.js ~ Credible Sets @@ -69,7 +68,7 @@

    Top Hits

      -
      +

      @@ -121,12 +120,24 @@

      Top Hits

      Define and render the plot */ // Fetch custom layout defined for usage with credible sets - layout = LocusZoom.Layouts.get("plot", "association_credible_sets"); + var stateUrlMapping = {chr: "chrom", start: "start", end: "end"}; + // Fetch initial position from the URL, or use some defaults + var initialState = LocusZoom.ext.DynamicUrls.paramsFromUrl(stateUrlMapping); + if (!Object.keys(initialState).length) { + initialState = {chr: 16, start: 74947245, end: 75547245}; + } + + layout = LocusZoom.Layouts.get("plot", "association_credible_sets", {state: initialState}); layout.dashboard = LocusZoom.Layouts.get("dashboard", "region_nav_plot"); // Generate the LocusZoom plot window.plot = LocusZoom.populate("#plot", data_sources, layout); + // Changes in the plot can be reflected in the URL, and vice versa (eg browser back button can go back to + // a previously viewed region) + LocusZoom.ext.DynamicUrls.plotUpdatesUrl(plot, stateUrlMapping); + LocusZoom.ext.DynamicUrls.plotWatchesUrl(plot, stateUrlMapping); + /* Add a sidebar to the page with "top hits" items From 7440a3525cb349850a4d9d6a63b2c3c5d0d9f413 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 26 Jun 2018 11:46:49 -0400 Subject: [PATCH 16/19] Display results from burden and gene based tests (#123) New demo: aggregation tests in-browser. Uses sample data from static JSON, but APIs can be supported. --- assets/js/app/LocusZoom.js | 2 +- dist/locuszoom.app.js | 700 +++++++++++++----- dist/locuszoom.app.js.map | 1 + dist/locuszoom.app.min.js | 12 +- dist/locuszoom.app.min.js.map | 2 +- dist/locuszoom.css | 8 +- examples/aggregation_tests.html | 194 +++++ examples/aggregation_tests.png | Bin 0 -> 6542 bytes examples/data/aggregation_masks.json | 22 + examples/data/scorecov.json | 331 +++++++++ examples/js/aggregation-test-helpers.js | 170 +++++ examples/js/aggregation-tests-example-page.js | 498 +++++++++++++ index.html | 9 + 13 files changed, 1749 insertions(+), 200 deletions(-) create mode 100644 dist/locuszoom.app.js.map create mode 100644 examples/aggregation_tests.html create mode 100644 examples/aggregation_tests.png create mode 100644 examples/data/aggregation_masks.json create mode 100644 examples/data/scorecov.json create mode 100644 examples/js/aggregation-test-helpers.js create mode 100644 examples/js/aggregation-tests-example-page.js diff --git a/assets/js/app/LocusZoom.js b/assets/js/app/LocusZoom.js index 3aa09a23..ab5e11d2 100644 --- a/assets/js/app/LocusZoom.js +++ b/assets/js/app/LocusZoom.js @@ -2,7 +2,7 @@ * @namespace */ var LocusZoom = { - version: "0.7.2" + version: "0.8.0" }; /** diff --git a/dist/locuszoom.app.js b/dist/locuszoom.app.js index 6f84ebe3..8ef1d1da 100644 --- a/dist/locuszoom.app.js +++ b/dist/locuszoom.app.js @@ -1,11 +1,17 @@ (function (root, factory) { if (typeof define === 'function' && define.amd) { - define(['postal'], function (d3, Q) { + define([ + 'd3', + 'Q' + ], function (d3, Q) { + // amd return root.LocusZoom = factory(d3, Q); }); } else if (typeof module === 'object' && module.exports) { + // commonJS module.exports = root.LocusZoom = factory(require('d3'), require('Q')); } else { + // globals root.LocusZoom = factory(root.d3, root.Q); } }(this, function (d3, Q) { @@ -40,7 +46,7 @@ } // ESTemplate: module content goes here // ESTemplate: module content goes here ; - var LocusZoom = { version: '0.7.2' }; + var LocusZoom = { version: '0.8.0' }; /** * Populate a single element with a LocusZoom plot. * selector can be a string for a DOM Query or a d3 selector. @@ -757,26 +763,33 @@ * enable code reuse and customization of known LZ core functionality. * * @param {Function} parent A parent class constructor that will be extended by the child class - * @param {Object} extra An object of additional properties and methods to add/override behavior for the child class - * @param {Function} [new_constructor] An optional constructor function that performs additional setup. If omitted, - * just calls the parent constructor by default. Implementer must manage super calls when overriding the constructor. + * @param {Object} extra An object of additional properties and methods to add/override behavior for the child class. + * The special "constructor" property can be used to specify a custom constructor, or it will call parent by default. + * Implementer must manage super calls when overriding the constructor. * @returns {Function} The constructor for the new child class */ - LocusZoom.subclass = function (parent, extra, new_constructor) { + LocusZoom.subclass = function (parent, extra) { if (typeof parent !== 'function') { throw 'Parent must be a callable constructor'; } extra = extra || {}; - var Sub = new_constructor || function () { + var Sub = extra.hasOwnProperty('constructor') ? extra.constructor : function () { parent.apply(this, arguments); }; Sub.prototype = Object.create(parent.prototype); Object.keys(extra).forEach(function (k) { Sub.prototype[k] = extra[k]; }); - Sub.prototype.constructor = Sub; return Sub; }; + /** + * LocusZoom optional extensions will live under this namespace. + * + * Extension code is not part of the core LocusZoom app.js bundle. + * @namespace + * @public + */ + LocusZoom.ext = {}; /* global LocusZoom */ 'use strict'; /** @@ -1317,8 +1330,8 @@ id: 'genes', type: 'genes', fields: [ - '{{namespace[gene]}}gene', - '{{namespace[constraint]}}constraint' + '{{namespace[gene]}}all', + '{{namespace[constraint]}}all' ], id_field: 'gene_id', behaviors: { @@ -2243,7 +2256,8 @@ * possible to reset without destroying the panel entirely. It is used by `Plot.clearPanelData`. */ LocusZoom.DataLayer.prototype.setDefaultState = function () { - // Define state parameters specific to this data layer + // Define state parameters specific to this data layer. Within plot state, this will live under a key + // `panel_name.layer_name`. if (this.parent) { this.state = this.parent.state; this.state_id = this.parent.id + '.' + this.id; @@ -2892,10 +2906,10 @@ }); /** * Toggle a status (e.g. highlighted, selected, identified) on an element - * @param {String} status - * @param {String|Object} element - * @param {Boolean} toggle - * @param {Boolean} exclusive + * @param {String} status The name of a recognized status to be added/removed on an appropriate element + * @param {String|Object} element The data bound to the element of interest + * @param {Boolean} toggle True to add the status (and associated CSS styles); false to remove it + * @param {Boolean} exclusive Whether to only allow a state for a single element at a time * @returns {LocusZoom.DataLayer} */ LocusZoom.DataLayer.prototype.setElementStatus = function (status, element, toggle, exclusive) { @@ -2936,8 +2950,16 @@ // Trigger tool tip show/hide logic this.showOrHideTooltip(element); // Trigger layout changed event hook - this.parent.emit('layout_changed'); - this.parent_plot.emit('layout_changed'); + this.parent.emit('layout_changed', true); + if (status === 'selected') { + // Notify parents that a given element has been interacted with. For now, we will only notify on + // "selected" type events, which is (usually) a toggle-able state. If elements are exclusive, two selection + // events will be sent in short order as the previously selected element has to be de-selected first + this.parent.emit('element_selection', { + element: element, + active: toggle + }, true); + } return this; }; /** @@ -3016,7 +3038,7 @@ return this; }; /** - * Apply all layout-defined behaviors to a selection of elements with event handlers + * Apply all layout-defined behaviors (DOM event handlers) to a selection of elements * @param {d3.selection} selection */ LocusZoom.DataLayer.prototype.applyBehaviors = function (selection) { @@ -3183,9 +3205,8 @@ this.destroyAllTooltips(); // hack - only non-visible tooltips should be destroyed // and then recreated if returning to visibility - // Fetch new data + // Fetch new data. Datalayers are only given access to the final consolidated data from the chain (not headers or raw payloads) var promise = this.parent_plot.lzd.getData(this.state, this.layout.fields); - //,"ld:best" promise.then(function (new_data) { this.data = new_data.body; this.applyDataMethods(); @@ -3535,9 +3556,8 @@ // Remove old elements as needed points_selection.exit().remove(); // Apply default event emitters to selection - points_selection.on('click.event_emitter', function (element) { - this.parent.emit('element_clicked', element); - this.parent_plot.emit('element_clicked', element); + points_selection.on('click.event_emitter', function (element_data) { + this.parent.emit('element_clicked', element_data, true); }.bind(this)); // Apply behaviors to points this.applyBehaviors(points_selection); @@ -3558,6 +3578,9 @@ * @member {Object} * */ this.DefaultLayout = { + // Optionally specify different fill and stroke properties + stroke: 'rgb(54, 54, 150)', + color: '#363696', label_font_size: 12, label_exon_spacing: 4, exon_height: 16, @@ -3722,6 +3745,7 @@ * Main render function */ this.render = function () { + var self = this; this.assignTracks(); var width, height, x, y; // Render gene groups @@ -3764,8 +3788,17 @@ } bboxes.exit().remove(); // Render gene boundaries + var boundary_fill = function (d) { + return self.resolveScalableParameter(self.layout.color, d); + }; + var boundary_stroke = function (d) { + return self.resolveScalableParameter(self.layout.stroke, d); + }; var boundaries = d3.select(this).selectAll('rect.lz-data_layer-genes.lz-boundary').data([gene], function (d) { return d.gene_name + '_boundary'; + }).style({ + fill: boundary_fill, + stroke: boundary_stroke }); boundaries.enter().append('rect').attr('class', 'lz-data_layer-genes lz-boundary'); width = function (d) { @@ -3815,10 +3848,21 @@ } labels.exit().remove(); // Render exon rects (first transcript only, for now) + // Exons: by default color on gene properties for consistency with the gene boundary track- hence color uses d.parent.parent + var exon_fill = function (d) { + return self.resolveScalableParameter(self.layout.color, d.parent.parent); + }; + var exon_stroke = function (d) { + return self.resolveScalableParameter(self.layout.stroke, d.parent.parent); + }; var exons = d3.select(this).selectAll('rect.lz-data_layer-genes.lz-exon').data(gene.transcripts[gene.parent.transcript_idx].exons, function (d) { return d.exon_id; }); exons.enter().append('rect').attr('class', 'lz-data_layer-genes lz-exon'); + exons.style({ + fill: exon_fill, + stroke: exon_stroke + }); width = function (d) { return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start); }; @@ -3870,8 +3914,7 @@ clickareas.exit().remove(); // Apply default event emitters to clickareas clickareas.on('click.event_emitter', function (element) { - element.parent.parent.emit('element_clicked', element); - element.parent.parent_plot.emit('element_clicked', element); + element.parent.parent.emit('element_clicked', element, true); }); // Apply mouse behaviors to clickareas data_layer.applyBehaviors(clickareas); @@ -4248,9 +4291,8 @@ // Remove old clickareas as needed clickareas.exit().remove(); // Apply default event emitters to clickareas - clickareas.on('click', function (element) { - element.parent.parent.emit('element_clicked', element); - element.parent.parent_plot.emit('element_clicked', element); + clickareas.on('click', function (element_data) { + element_data.parent.parent.emit('element_clicked', element_data, true); }.bind(this)); // Apply mouse behaviors to clickareas data_layer.applyBehaviors(clickareas); @@ -4631,8 +4673,7 @@ }.bind(this)); this.path.attr('class', path_class); // Trigger layout changed event hook - this.parent.emit('layout_changed'); - this.parent_plot.emit('layout_changed'); + this.parent.emit('layout_changed', true); return this; }; return this; @@ -5155,8 +5196,7 @@ selection.exit().remove(); // Apply default event emitters to selection selection.on('click.event_emitter', function (element) { - this.parent.emit('element_clicked', element); - this.parent_plot.emit('element_clicked', element); + this.parent.emit('element_clicked', element, true); }.bind(this)); // Apply mouse behaviors this.applyBehaviors(selection); @@ -5167,8 +5207,7 @@ this.separate_labels(); // Apply default event emitters to selection this.label_texts.on('click.event_emitter', function (element) { - this.parent.emit('element_clicked', element); - this.parent_plot.emit('element_clicked', element); + this.parent.emit('element_clicked', element, true); }.bind(this)); // Extend mouse behaviors to labels this.applyBehaviors(this.label_texts); @@ -5669,11 +5708,13 @@ if (x === 0) { return '0'; } + var abs = Math.abs(x); var log; - if (Math.abs(x) > 1) { - log = Math.ceil(Math.log(x) / Math.LN10); + if (abs > 1) { + log = Math.ceil(Math.log(abs) / Math.LN10); } else { - log = Math.floor(Math.log(x) / Math.LN10); + // 0...1 + log = Math.floor(Math.log(abs) / Math.LN10); } if (Math.abs(log) <= 3) { return x.toFixed(3); @@ -6886,6 +6927,7 @@ this.css_string = ''; for (var stylesheet in Object.keys(document.styleSheets)) { if (document.styleSheets[stylesheet].href !== null && document.styleSheets[stylesheet].href.indexOf('locuszoom.css') !== -1) { + // TODO: "Download image" button will render the image incorrectly if the stylesheet has been renamed or concatenated LocusZoom.createCORSPromise('GET', document.styleSheets[stylesheet].href).then(function (response) { this.css_string = response.replace(/[\r\n]/g, ' ').replace(/\s+/g, ' '); if (this.css_string.indexOf('/* ! LocusZoom HTML Styles */')) { @@ -7721,10 +7763,15 @@ /** @protected */ LocusZoom.DataSources.prototype.set = function (ns, x) { if (Array.isArray(x)) { + // If passed array of source name and options, make the source var dsobj = LocusZoom.KnownDataSources.create.apply(null, x); + // Each datasource in the chain should be aware of its assigned namespace + dsobj.source_id = ns; this.sources[ns] = dsobj; } else { + // If passed the already-created source object if (x !== null) { + x.source_id = ns; this.sources[ns] = x; } else { delete this.sources[ns]; @@ -7886,7 +7933,7 @@ this.getData = function (state, fields) { var requests = split_requests(fields); // Create an array of functions that, when called, will trigger the request to the specified datasource - var promises = Object.keys(requests).map(function (key) { + var request_handles = Object.keys(requests).map(function (key) { if (!sources.get(key)) { throw 'Datasource for namespace ' + key + ' not found'; } @@ -7896,11 +7943,12 @@ //TODO: better manage dependencies var ret = Q.when({ header: {}, - body: {} + body: {}, + discrete: {} }); - for (var i = 0; i < promises.length; i++) { + for (var i = 0; i < request_handles.length; i++) { // If a single datalayer uses multiple sources, perform the next request when the previous one completes - ret = ret.then(promises[i]); + ret = ret.then(request_handles[i]); } return ret; }; @@ -7945,7 +7993,7 @@ } }; /** - * Fetch the internal string used to represent this data when cache is used + * A unique identifier that indicates whether cached data is valid for this request * @protected * @param state * @param chain @@ -7953,11 +8001,16 @@ * @returns {String|undefined} */ LocusZoom.Data.Source.prototype.getCacheKey = function (state, chain, fields) { - var url = this.getURL && this.getURL(state, chain, fields); - return url; + return this.getURL && this.getURL(state, chain, fields); }; /** - * Fetch data from a remote location + * Stub: build the URL for any requests made by this source. + */ + LocusZoom.Data.Source.prototype.getURL = function (state, chain, fields) { + return this.url; + }; + /** + * Perform a network request to fetch data for this source * @protected * @param {Object} state The state of the parent plot * @param chain @@ -7967,9 +8020,8 @@ var url = this.getURL(state, chain, fields); return LocusZoom.createCORSPromise('GET', url); }; - // TODO: move this.getURL stub into parent class and add documentation; parent should not check for methods known only to children /** - * TODO Rename to handleRequest (to disambiguate from, say HTTP get requests) and update wiki docs and other references + * Gets the data for just this source, typically via a network request (caching where possible) * @protected */ LocusZoom.Data.Source.prototype.getRequest = function (state, chain, fields) { @@ -7989,15 +8041,17 @@ return req; }; /** - * Fetch the data from the specified data source, and format it in a way that can be used by the consuming plot - * @protected + * Fetch the data from the specified data source, and apply transformations requested by an external consumer. + * This is the public-facing datasource method that will most commonly be called by external code. + * + * @public * @param {Object} state The current "state" of the plot, such as chromosome and start/end positions - * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the "namespace" prefix) TODO: Clarify how this fieldname maps to raw datasource output, and how it differs from outnames + * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the "namespace" prefix) * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the * originally requested field name, including the namespace. This must be an array with the same length as `fields` * @param {Function[]} trans The collection of transformation functions to be run on selected fields. * This must be an array with the same length as `fields` - * @returns {function(this:LocusZoom.Data.Source)} A callable operation that can be used as part of the data chain + * @returns {function} A callable operation that can be used as part of the data chain */ LocusZoom.Data.Source.prototype.getData = function (state, fields, outnames, trans) { if (this.preGetData) { @@ -8022,110 +8076,101 @@ }; }; /** - * Parse response data. Return an object containing "header" (metadata or request parameters) and "body" - * (data to be used for plotting). The response from this request is combined with responses from all other requests - * in the chain. - * @public - * @param {String|Object} resp The raw data associated with the response - * @param {Object} chain The combined parsed response data from this and all other requests made in the chain - * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the "namespace" prefix) TODO: Clarify how this fieldname maps to raw datasource output, and how it differs from outnames - * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the - * originally requested field name, including the namespace. This must be an array with the same length as `fields` - * @param {Function[]} trans The collection of transformation functions to be run on selected fields. - * This must be an array with the same length as `fields` - * @returns {{header: ({}|*), body: {}}} - */ - LocusZoom.Data.Source.prototype.parseResponse = function (resp, chain, fields, outnames, trans) { - var json = typeof resp == 'string' ? JSON.parse(resp) : resp; - var records = this.parseData(json.data || json, fields, outnames, trans); - return { - header: chain.header || {}, - body: records - }; - }; - /** - * Some API endpoints return an object containing several arrays, representing columns of data. Each array should have - * the same length, and a given array index corresponds to a single row. + * Ensure the server response is in a canonical form, an array of one object per record. [ {field: oneval} ]. + * If the server response contains columns, reformats the response from {column1: [], column2: []} to the above. * - * This gathers column data into an array of objects, each one representing the combined data for a given record. - * See `parseData` for usage + * Does not apply namespacing or transformations. * + * May be overridden by data sources that inherently return more complex payloads, or that exist to annotate other + * sources. + * + * @param {Object[]|Object} data The original parsed server response * @protected - * @param {Object} x A response payload object - * @param {Array} fields - * @param {Array} outnames - * @param {Array} trans - * @returns {Object[]} */ - LocusZoom.Data.Source.prototype.parseArraysToObjects = function (x, fields, outnames, trans) { - //intended for an object of arrays - //{"id":[1,2], "val":[5,10]} - var records = []; - fields.forEach(function (f, i) { - if (!(f in x)) { - throw 'field ' + f + ' not found in response for ' + outnames[i]; - } - }); - // Safeguard: check that arrays are of same length - var keys = Object.keys(x); - var N = x[keys[0]].length; + LocusZoom.Data.Source.prototype.normalizeResponse = function (data) { + if (Array.isArray(data)) { + // Already in the desired form + return data; + } + // Otherwise, assume the server response is an object representing columns of data. + // Each array should have the same length (verify), and a given array index corresponds to a single row. + var keys = Object.keys(data); + var N = data[keys[0]].length; var sameLength = keys.every(function (key) { - var item = x[key]; + var item = data[key]; return item.length === N; }); if (!sameLength) { throw this.constructor.SOURCE_NAME + ' expects a response in which all arrays of data are the same length'; } + // Go down the rows, and create an object for each record + var records = []; + var fields = Object.keys(data); for (var i = 0; i < N; i++) { var record = {}; for (var j = 0; j < fields.length; j++) { - var val = x[fields[j]][i]; - if (trans && trans[j]) { - val = trans[j](val); - } - record[outnames[j]] = val; + record[fields[j]] = data[fields[j]][i]; } records.push(record); } return records; }; + /** @deprecated */ + LocusZoom.Data.Source.prototype.prepareData = function (records) { + console.warn('Warning: .prepareData() is deprecated. Use .annotateData() instead'); + return this.annotateData(records); + }; + /** + * Hook to post-process the data returned by this source with new, additional behavior. + * (eg cleaning up API values or performing complex calculations on the returned data) + * + * @param {Object[]} records The parsed data from the source (eg standardized api response) + * @param {Object} chain The data chain object. For example, chain.headers may provide useful annotation metadata + * @returns {Object[]|Promise} The modified set of records + */ + LocusZoom.Data.Source.prototype.annotateData = function (records, chain) { + // Default behavior: no transformations + return records; + }; /** - * Given an array response in which each record is represented as one coherent bundle of data (an object of - * {field:value} entries), perform any parsing or transformations required to represent the field in a form required - * by the datalayer. See `parseData` for usage. + * Clean up the server records for use by datalayers: extract only certain fields, with the specified names. + * Apply per-field transformations as appropriate. + * + * This hook can be overridden, eg to create a source that always returns all records and ignores the "fields" array. + * This is particularly common for sources at the end of a chain- many "dependent" sources do not allow + * cherry-picking individual fields, in which case by **convention** the fields array specifies "last_source_name:all" + * + * @param {Object[]} data One record object per element + * @param {String[]} fields The names of fields to extract (as named in the source data). Eg "afield" + * @param {String[]} outnames How to represent the source fields in the output. Eg "namespace:afield|atransform" + * @param {function[]} trans An array of transformation functions (if any). One function per data element, or null. * @protected - * @param {Object[]} x An array of response payload objects, each describing one record - * @param {Array} fields - * @param {Array} outnames - * @param {Array} trans - * @returns {Object[]} */ - LocusZoom.Data.Source.prototype.parseObjectsToObjects = function (x, fields, outnames, trans) { + LocusZoom.Data.Source.prototype.extractFields = function (data, fields, outnames, trans) { //intended for an array of objects - // [ {"id":1, "val":5}, {"id":2, "val":10}] - var records = []; + // [ {"id":1, "val":5}, {"id":2, "val":10}] + // Since a number of sources exist that do not obey this format, we will provide a convenient pass-through + if (!Array.isArray(data)) { + return data; + } var fieldFound = []; for (var k = 0; k < fields.length; k++) { fieldFound[k] = 0; } - if (!x.length) { - // Do not attempt to parse records if there are no records, and bubble up an informative error message. - throw 'No data found for specified query'; - } - for (var i = 0; i < x.length; i++) { - var record = {}; + var records = data.map(function (item) { + var output_record = {}; for (var j = 0; j < fields.length; j++) { - var val = x[i][fields[j]]; + var val = item[fields[j]]; if (typeof val != 'undefined') { fieldFound[j] = 1; } if (trans && trans[j]) { val = trans[j](val); } - record[outnames[j]] = val; + output_record[outnames[j]] = val; } - records.push(record); - } + return output_record; + }); fieldFound.forEach(function (v, i) { if (!v) { throw 'field ' + fields[i] + ' not found in response for ' + outnames[i]; @@ -8134,33 +8179,85 @@ return records; }; /** - * Parse the response data TODO Hide private entries from user-facing api docs + * Combine records from this source with others in the chain to yield final chain body. + * Handles merging this data with other sources (if applicable). + * + * @param {Object[]} data The data That would be returned from this source alone + * @param {Object} chain The data chain built up during previous requests + * @param {String[]} fields + * @param {String[]} outnames + * @return {Promise|Object[]} The new chain body * @protected - * @param {Object} x The raw response data to be parsed - * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the "namespace" prefix) TODO: Clarify how this fieldname maps to raw datasource output, and how it differs from outnames - * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the - * originally requested field name, including the namespace. This must be an array with the same length as `fields` + */ + LocusZoom.Data.Source.prototype.combineChainBody = function (data, chain, fields, outnames) { + return data; + }; + /** + * Coordinates the work of parsing a response and returning records. This is broken into 4 steps, which may be + * overridden separately for fine-grained control. Each step can return either raw data or a promise. + * + * @public + * @param {String|Object} resp The raw data associated with the response + * @param {Object} chain The combined parsed response data from this and all other requests made in the chain + * @param {String[]} fields Array of requested field names (as they would appear in the response payload) + * @param {String[]} outnames Array of field names as they will be represented in the data returned by this source, + * including the namespace. This must be an array with the same length as `fields` * @param {Function[]} trans The collection of transformation functions to be run on selected fields. * This must be an array with the same length as `fields` + * @returns {Promise|{header: ({}|*), discrete: {}, body: []}} A promise that resolves to an object containing + * request metadata (headers), the consolidated data for plotting (body), and the individual responses that would be + * returned by each source in the chain in isolation (discrete) */ - LocusZoom.Data.Source.prototype.parseData = function (x, fields, outnames, trans) { - var records; - if (Array.isArray(x)) { - records = this.parseObjectsToObjects(x, fields, outnames, trans); - } else { - records = this.parseArraysToObjects(x, fields, outnames, trans); + LocusZoom.Data.Source.prototype.parseResponse = function (resp, chain, fields, outnames, trans) { + var source_id = this.source_id || this.constructor.SOURCE_NAME; + if (!chain.discrete) { + chain.discrete = {}; + } + if (!resp) { + // FIXME: Hack. Certain browser issues (such as mixed content warnings) are reported as a successful promise + // resolution, even though the request was aborted. This is difficult to reliably detect, and is most likely + // to occur for annotation sources (such as from ExAC). If empty response is received, skip parsing and log. + // FIXME: Throw an error after pending, eg https://github.com/konradjk/exac_browser/issues/345 + console.error('No usable response was returned for source: \'' + source_id + '\'. Parsing will be skipped.'); + return Q.when(chain); } - // Perform any custom transformations on the resulting data - return this.prepareData(records); + var json = typeof resp == 'string' ? JSON.parse(resp) : resp; + var self = this; + // Perform the 4 steps of parsing the payload and return a combined chain object + return Q.when(self.normalizeResponse(json.data || json)).then(function (standardized) { + // Perform calculations on the data from just this source + return Q.when(self.annotateData(standardized, chain)); + }).then(function (data) { + return Q.when(self.extractFields(data, fields, outnames, trans)); + }).then(function (one_source_body) { + // Store a copy of the data that would be returned by parsing this source in isolation (and taking the + // fields array into account). This is useful when we want to re-use the source output in many ways. + chain.discrete[source_id] = one_source_body; + return Q.when(self.combineChainBody(one_source_body, chain, fields, outnames)); + }).then(function (new_body) { + return { + header: chain.header || {}, + discrete: chain.discrete, + body: new_body + }; + }); }; - /** - * Post-process the server response. This is a hook that allows custom sources to specify any optional transformations - * that should be performed on the data that is returned from the server. - * @param {Object[]} records - * @returns Object[] - */ - LocusZoom.Data.Source.prototype.prepareData = function (records) { - return records; + /** @deprecated */ + LocusZoom.Data.Source.prototype.parseArraysToObjects = function (data, fields, outnames, trans) { + console.warn('Warning: .parseArraysToObjects() is no longer used. A stub is provided for legacy use'); + var standard = this.normalizeResponse(data); + return this.extractFields(standard, fields, outnames, trans); + }; + /** @deprecated */ + LocusZoom.Data.Source.prototype.parseObjectsToObjects = function (data, fields, outnames, trans) { + console.warn('Warning: .parseObjectsToObjects() is deprecated. Use .extractFields() instead'); + return this.extractFields(data, fields, outnames, trans); + }; + /** @deprecated */ + LocusZoom.Data.Source.prototype.parseData = function (data, fields, outnames, trans) { + console.warn('Warning: .parseData() is no longer used. A stub is provided for legacy use'); + var standard = this.normalizeResponse(data); + return this.extractFields(standard, fields, outnames, trans); }; /** * Method to define new custom datasources based on a provided constructor. (does not allow registering any additional methods) @@ -8196,6 +8293,9 @@ /** * Datasources can be instantiated from a JSON object instead of code. This represents an existing source in that data format. * For example, this can be helpful when sharing plots, or to share settings with others when debugging + * + * Custom sources with their own parameters may need to re-implement this method + * * @public * @returns {Object} */ @@ -8306,6 +8406,9 @@ } return obj; }; + LocusZoom.Data.LDSource.prototype.normalizeResponse = function (data) { + return data; + }; LocusZoom.Data.LDSource.prototype.getURL = function (state, chain, fields) { var findExtremeValue = function (x, pval, sign) { pval = pval || 'pvalue'; @@ -8348,8 +8451,7 @@ chain.header.ldrefvar = refVar; return this.url + 'results/?filter=reference eq ' + refSource + ' and chromosome2 eq \'' + state.chr + '\'' + ' and position2 ge ' + state.start + ' and position2 le ' + state.end + ' and variant1 eq \'' + refVar + '\'' + '&fields=chr,pos,rsquare'; }; - LocusZoom.Data.LDSource.prototype.parseResponse = function (resp, chain, fields, outnames) { - var json = JSON.parse(resp); + LocusZoom.Data.LDSource.prototype.combineChainBody = function (data, chain, fields, outnames) { var keys = this.findMergeFields(chain); var reqFields = this.findRequestedFields(fields, outnames); if (!keys.position) { @@ -8378,11 +8480,11 @@ } } }; - leftJoin(chain.body, json.data, reqFields.ldout, 'rsquare'); + leftJoin(chain.body, data, reqFields.ldout, 'rsquare'); if (reqFields.isrefvarin && chain.header.ldrefvar) { tagRefVariant(chain.body, chain.header.ldrefvar, keys.id, reqFields.isrefvarout); } - return chain; + return chain.body; }; /** * Data Source for Gene Data, as fetched from the LocusZoom API server (or compatible) @@ -8397,12 +8499,13 @@ var source = state.source || chain.header.source || this.params.source || 2; return this.url + '?filter=source in ' + source + ' and chrom eq \'' + state.chr + '\'' + ' and start le ' + state.end + ' and end ge ' + state.start; }; - LocusZoom.Data.GeneSource.prototype.parseResponse = function (resp, chain, fields, outnames) { - var json = JSON.parse(resp); - return { - header: chain.header, - body: json.data - }; + // Genes have a very complex internal data format. Bypass any record parsing, and provide the data layer with the + // exact information returned by the API. (ignoring the fields array in the layout) + LocusZoom.Data.GeneSource.prototype.normalizeResponse = function (data) { + return data; + }; + LocusZoom.Data.GeneSource.prototype.extractFields = function (data, fields, outnames, trans) { + return data; }; /** * Data Source for Gene Constraint Data, as fetched from the LocusZoom API server (or compatible) @@ -8416,6 +8519,9 @@ LocusZoom.Data.GeneConstraintSource.prototype.getURL = function () { return this.url; }; + LocusZoom.Data.GeneConstraintSource.prototype.normalizeResponse = function (data) { + return data; + }; LocusZoom.Data.GeneConstraintSource.prototype.getCacheKey = function (state, chain, fields) { return this.url + JSON.stringify(state); }; @@ -8433,15 +8539,10 @@ var headers = { 'Content-Type': 'application/x-www-form-urlencoded' }; return LocusZoom.createCORSPromise('POST', url, body, headers); }; - LocusZoom.Data.GeneConstraintSource.prototype.parseResponse = function (resp, chain, fields, outnames) { - if (!resp) { - return { - header: chain.header, - body: chain.body - }; + LocusZoom.Data.GeneConstraintSource.prototype.combineChainBody = function (data, chain, fields, outnames) { + if (!data) { + return chain; } - var data = JSON.parse(resp); - // Loop through the array of genes in the body and match each to a result from the constraints request var constraint_fields = [ 'bp', 'exp_lof', @@ -8481,10 +8582,7 @@ } }); }); - return { - header: chain.header, - body: chain.body - }; + return chain.body; }; /** * Data Source for Recombination Rate Data, as fetched from the LocusZoom API server (or compatible) @@ -8565,6 +8663,81 @@ ]; return url.join(''); }; + /** + * Base class for "connectors"- this is meant to be subclassed, rather than used directly. + * + * A connector is a source that makes no server requests and caches no data of its own. Instead, it decides how to + * combine data from other sources in the chain. Connectors are useful when we want to request (or calculate) some + * useful piece of information once, but apply it to many different kinds of record types. + * + * Typically, a subclass will implement the field merging logic in `combineChainBody`. + * + * @public + * @class + * @augments LocusZoom.Data.Source + * @param {Object} init Configuration for this source + * @param {Object} init.sources Specify how the hard-coded logic should find the data it relies on in the chain, + * as {internal_name: chain_source_id} pairs. This allows writing a reusable connector that does not need to make + * assumptions about what namespaces a source is using. + * @type {*|Function} + */ + LocusZoom.Data.ConnectorSource = LocusZoom.Data.Source.extend(function (init) { + if (!init || !init.sources) { + throw 'Connectors must specify the data they require as init.sources = {internal_name: chain_source_id}} pairs'; + } + /** + * Tells the connector how to find the data it relies on + * + * For example, a connector that applies burden test information to the genes layer might specify: + * {gene_ns: "gene", aggregation_ns: "aggregation"} + * + * @member {Object} + */ + this._source_name_mapping = init.sources; + // Validate that this source has been told how to find the required information + var specified_ids = Object.keys(init.sources); + var self = this; + this.REQUIRED_SOURCES.forEach(function (k) { + if (specified_ids.indexOf(k) === -1) { + throw 'Configuration for ' + self.constructor.SOURCE_NAME + ' must specify a source ID corresponding to ' + k; + } + }); + this.parseInit(init); + }, 'ConnectorSource'); + /** @property {String[]} Specifies the sources that must be provided in the original config object */ + LocusZoom.Data.ConnectorSource.prototype.REQUIRED_SOURCES = []; + LocusZoom.Data.ConnectorSource.prototype.parseInit = function (init) { + }; + // Stub + LocusZoom.Data.ConnectorSource.prototype.getRequest = function (state, chain, fields) { + // Connectors do not request their own data by definition, but they *do* depend on other sources having been loaded + // first. This method performs basic validation, and preserves the accumulated body from the chain so far. + var self = this; + Object.keys(this._source_name_mapping).forEach(function (ns) { + var chain_source_id = self._source_name_mapping[ns]; + if (chain.discrete && !chain.discrete[chain_source_id]) { + throw self.constructor.SOURCE_NAME + ' cannot be used before loading required data for: ' + chain_source_id; + } + }); + return Q.when(chain.body || []); + }; + LocusZoom.Data.ConnectorSource.prototype.parseResponse = function (data, chain, fields, outnames) { + // A connector source does not update chain.discrete, but it may use it. It bypasses data formatting + // and field selection (both are assumed to have been done already, by the previous sources this draws from) + // Because of how the chain works, connectors are not very good at applying new transformations or namespacing. + // Typically connectors are called with `connector_name:all` in the fields array. + return Q.when(this.combineChainBody(data, chain, fields, outnames)).then(function (new_body) { + return { + header: chain.header || {}, + discrete: chain.discrete || {}, + body: new_body + }; + }); + }; + LocusZoom.Data.ConnectorSource.prototype.combineChainBody = function (records, chain) { + // Stub method: specifies how to combine the data + throw 'This method must be implemented in a subclass'; + }; /* global LocusZoom */ 'use strict'; /** @@ -8669,9 +8842,19 @@ 'layout_changed': [], 'data_requested': [], 'data_rendered': [], - 'element_clicked': [] + 'element_clicked': [], + 'element_selection': [], + 'state_changed': [] // Only triggered when a state change causes rerender }; /** + * @callback eventCallback + * @param {object} eventData A description of the event + * @param {String|null} eventData.sourceID The unique identifier (eg plot or parent name) of the element that + * triggered the event. Will be automatically filled in if not explicitly provided. + * @param {Object|null} eventData.context Any additional information to be passed to the callback, eg the data + * associated with a clicked plot element + */ + /** * There are several events that a LocusZoom plot can "emit" when appropriate, and LocusZoom supports registering * "hooks" for these events which are essentially custom functions intended to fire at certain times. * @@ -8679,7 +8862,9 @@ * - `layout_changed` - context: plot - Any aspect of the plot's layout (including dimensions or state) has changed. * - `data_requested` - context: plot - A request for new data from any data source used in the plot has been made. * - `data_rendered` - context: plot - Data from a request has been received and rendered in the plot. - * - `element_clicked` - context: element - A data element in any of the plot's data layers has been clicked. + * - `element_clicked` - context: plot - A data element in any of the plot's data layers has been clicked. + * - `element_selection` - context: plot - Triggered when an element changes "selection" status, and identifies + * whether the element is being selected or deselected. * * To register a hook for any of these events use `plot.on('event_name', function() {})`. * @@ -8689,9 +8874,9 @@ * plot itself, but when element_clicked is emitted the context for this in the event hook will be the element * that was clicked. * - * @param {String} event - * @param {function} hook - * @returns {LocusZoom.Plot} + * @param {String} event The name of an event (as defined in `event_hooks`) + * @param {eventCallback} hook + * @returns {function} The registered event listener */ this.on = function (event, hook) { if (typeof 'event' != 'string' || !Array.isArray(this.event_hooks[event])) { @@ -8701,22 +8886,63 @@ throw 'Unable to register event hook, invalid hook function passed'; } this.event_hooks[event].push(hook); + return hook; + }; + /** + * Remove one or more previously defined event listeners + * @param {String} event The name of an event (as defined in `event_hooks`) + * @param {eventCallback} [hook] The callback to deregister + * @returns {LocusZoom.Plot} + */ + this.off = function (event, hook) { + var theseHooks = this.event_hooks[event]; + if (typeof 'event' != 'string' || !Array.isArray(theseHooks)) { + throw 'Unable to remove event hook, invalid event: ' + event.toString(); + } + if (hook === undefined) { + // Deregistering all hooks for this event may break basic functionality, and should only be used during + // cleanup operations (eg to prevent memory leaks) + this.event_hooks[event] = []; + } else { + var hookMatch = theseHooks.indexOf(hook); + if (hookMatch !== -1) { + theseHooks.splice(hookMatch, 1); + } else { + throw 'The specified event listener is not registered and therefore cannot be removed'; + } + } return this; }; /** * Handle running of event hooks when an event is emitted - * @protected * @param {string} event A known event name - * @param {*} context Controls function execution context (value of `this` for the hook to be fired) + * @param {*} eventData Data or event description that will be passed to the event listener * @returns {LocusZoom.Plot} */ - this.emit = function (event, context) { + this.emit = function (event, eventData) { + // TODO: there are small differences between the emit implementation between plots and panels. In the future, + // DRY this code via mixins, and make sure to keep the interfaces compatible when refactoring. if (typeof 'event' != 'string' || !Array.isArray(this.event_hooks[event])) { throw 'LocusZoom attempted to throw an invalid event: ' + event.toString(); } - context = context || this; + var sourceID = this.getBaseId(); + var self = this; this.event_hooks[event].forEach(function (hookToRun) { - hookToRun.call(context); + var eventContext; + if (eventData && eventData.sourceID) { + // If we detect that an event originated elsewhere (via bubbling or externally), preserve the context + // when re-emitting the event to plot-level listeners + eventContext = eventData; + } else { + eventContext = { + sourceID: sourceID, + data: eventData || null + }; + } + // By default, any handlers fired here (either directly, or bubbled) will see the plot as the + // value of `this`. If a bound function is registered as a handler, the previously bound `this` will + // override anything provided to `call` below. + hookToRun.call(self, eventContext); }); return this; }; @@ -9357,6 +9583,56 @@ return this.applyState(); }; /** + * A user-defined callback function that can receive (and potentially act on) new plot data. + * @callback externalDataCallback + * @param {Object} new_data The body resulting from a data request. This represents the same information that would be passed to + * a data layer making an equivalent request. + */ + /** + * A user-defined callback function that can respond to errors received during a previous operation + * @callback externalErrorCallback + * @param err A representation of the error that occurred + */ + /** + * Allow newly fetched data to be made available outside the LocusZoom plot. For example, a callback could be + * registered to draw an HTML table of top GWAS hits, and update that table whenever the plot region changes. + * + * This is a convenience method for external hooks. It registers an event listener and returns parsed data, + * using the same fields syntax and underlying methods as data layers. + * + * @param {String[]} fields An array of field names and transforms, in the same syntax used by a data layer. + * Different data sources should be prefixed by the source name. + * @param {externalDataCallback} success_callback Used defined function that is automatically called any time that + * new data is received by the plot. + * @param {Object} [opts] Options + * @param {externalErrorCallback} [opts.onerror] User defined function that is automatically called if a problem + * occurs during the data request or subsequent callback operations + * @param {boolean} [opts.discrete=false] Normally the callback will subscribe to the combined body from the chain, + * which may not be in a format that matches what the external callback wants to do. If discrete=true, returns the + * uncombined record info + * @return {function} The newly created event listener, to allow for later cleanup/removal + */ + LocusZoom.Plot.prototype.subscribeToData = function (fields, success_callback, opts) { + opts = opts || {}; + // Register an event listener that is notified whenever new data has been rendered + var error_callback = opts.onerror || function (err) { + console.log('An error occurred while acting on an external callback', err); + }; + var self = this; + var listener = function () { + try { + self.lzd.getData(self.state, fields).then(function (new_data) { + success_callback(opts.discrete ? new_data.discrete : new_data.body); + }).catch(error_callback); + } catch (error) { + // In certain cases, errors are thrown before a promise can be generated, and LZ error display seems to rely on these errors bubbling up + error_callback(error); + } + }; + this.on('data_rendered', listener); + return listener; + }; + /** * Update state values and trigger a pull for fresh data on all data sources for all data layers * @param state_changes * @returns {Promise} A promise that resolves when all data fetch and update operations are complete @@ -9420,6 +9696,7 @@ // Emit events this.emit('layout_changed'); this.emit('data_rendered'); + this.emit('state_changed', state_changes); this.loading_data = false; }.bind(this)); }; @@ -9634,7 +9911,8 @@ 'layout_changed': [], 'data_requested': [], 'data_rendered': [], - 'element_clicked': [] + 'element_clicked': [], + 'element_selection': [] }; /** * There are several events that a LocusZoom panel can "emit" when appropriate, and LocusZoom supports registering @@ -9644,7 +9922,9 @@ * - `layout_changed` - context: panel - Any aspect of the panel's layout (including dimensions or state) has changed. * - `data_requested` - context: panel - A request for new data from any data source used in the panel has been made. * - `data_rendered` - context: panel - Data from a request has been received and rendered in the panel. - * - `element_clicked` - context: element - A data element in any of the panel's data layers has been clicked. + * - `element_clicked` - context: panel - A data element in any of the panel's data layers has been clicked. + * - `element_selection` - context: panel - Triggered when an element changes "selection" status, and identifies + * whether the element is being selected or deselected. * * To register a hook for any of these events use `panel.on('event_name', function() {})`. * @@ -9654,11 +9934,12 @@ * panel itself, but when element_clicked is emitted the context for this in the event hook will be the element * that was clicked. * - * @param {String} event + * @param {String} event The name of the event (as defined in `event_hooks`) * @param {function} hook - * @returns {LocusZoom.Panel} + * @returns {function} The registered event listener */ this.on = function (event, hook) { + // TODO: Dry plot and panel event code into a shared mixin if (typeof 'event' != 'string' || !Array.isArray(this.event_hooks[event])) { throw 'Unable to register event hook, invalid event: ' + event.toString(); } @@ -9666,23 +9947,70 @@ throw 'Unable to register event hook, invalid hook function passed'; } this.event_hooks[event].push(hook); + return hook; + }; + /** + * Remove one or more previously defined event listeners + * @param {String} event The name of an event (as defined in `event_hooks`) + * @param {eventCallback} [hook] The callback to deregister + * @returns {LocusZoom.Panel} + */ + this.off = function (event, hook) { + var theseHooks = this.event_hooks[event]; + if (typeof 'event' != 'string' || !Array.isArray(theseHooks)) { + throw 'Unable to remove event hook, invalid event: ' + event.toString(); + } + if (hook === undefined) { + // Deregistering all hooks for this event may break basic functionality, and should only be used during + // cleanup operations (eg to prevent memory leaks) + this.event_hooks[event] = []; + } else { + var hookMatch = theseHooks.indexOf(hook); + if (hookMatch !== -1) { + theseHooks.splice(hookMatch, 1); + } else { + throw 'The specified event listener is not registered and therefore cannot be removed'; + } + } return this; }; /** * Handle running of event hooks when an event is emitted - * @protected + * + * There is a shorter overloaded form of this method: if the event does not have any data, the second + * argument can be a boolean to control bubbling + * * @param {string} event A known event name - * @param {*} context Controls function execution context (value of `this` for the hook to be fired) + * @param {*} [eventData] Data or event description that will be passed to the event listener + * @param {boolean} [bubble=false] Whether to bubble the event to the parent * @returns {LocusZoom.Panel} */ - this.emit = function (event, context) { + this.emit = function (event, eventData, bubble) { + bubble = bubble || false; + // TODO: DRY this with the parent plot implementation. Ensure interfaces remain compatible. + // TODO: Improve documentation for overloaded method signature (JSDoc may have trouble here) if (typeof 'event' != 'string' || !Array.isArray(this.event_hooks[event])) { throw 'LocusZoom attempted to throw an invalid event: ' + event.toString(); } - context = context || this; + if (typeof eventData === 'boolean' && arguments.length === 2) { + // Overloaded method signature: emit(event, bubble) + bubble = eventData; + eventData = null; + } + var sourceID = this.getBaseId(); + var self = this; + var eventContext = { + sourceID: sourceID, + data: eventData || null + }; this.event_hooks[event].forEach(function (hookToRun) { - hookToRun.call(context); + // By default, any handlers fired here will see the panel as the value of `this`. If a bound function is + // registered as a handler, the previously bound `this` will override anything provided to `call` below. + hookToRun.call(self, eventContext); }); + if (bubble && this.parent) { + this.parent.emit(event, eventContext); + } return this; }; /** @@ -10219,8 +10547,7 @@ return Q.all(this.data_promises).then(function () { this.initialized = true; this.render(); - this.emit('layout_changed'); - this.parent.emit('layout_changed'); + this.emit('layout_changed', true); this.emit('data_rendered'); }.bind(this)).catch(function (error) { console.warn(error); @@ -10783,4 +11110,5 @@ console.error('LocusZoom Plugin error: ' + plugin_loading_error); } return LocusZoom; -})); \ No newline at end of file +})); +//# sourceMappingURL=locuszoom.app.js.map diff --git a/dist/locuszoom.app.js.map b/dist/locuszoom.app.js.map new file mode 100644 index 00000000..9fde4f5d --- /dev/null +++ b/dist/locuszoom.app.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["LocusZoom.js","Layouts.js","DataLayer.js","annotation_track.js","forest.js","genes.js","genome_legend.js","intervals.js","line.js","scatter.js","Singletons.js","Dashboard.js","Legend.js","Data.js","Plot.js","Panel.js"],"names":["LocusZoom","version","populate","selector","datasource","layout","d3","select","html","plot","call","node","id","iterator","empty","attr","Plot","container","dataset","region","parsed_state","parsePositionQuery","Object","keys","forEach","key","state","svg","append","style","setDimensions","positionPanels","initialize","length","refresh","populateAll","plots","selectAll","each","d","i","positionIntToString","pos","exp","suffix","exp_symbols","isNaN","log","Math","LN10","min","max","places_exp","floor","toFixed","min_exp","places","ret","pow","positionStringToInt","p","val","toUpperCase","replace","suffixre","exec","mult","Number","x","chrposoff","chrpos","match","center","offset","chr","start","end","position","prettyTicks","range","clip_range","target_tick_count","parseInt","min_n","shrink_sml","high_u_bias","u5_bias","abs","c","base","base_toFixed","round","unit","ticks","parseFloat","push","indexOf","slice","pop","createCORSPromise","method","url","body","headers","timeout","response","Q","defer","xhr","XMLHttpRequest","open","XDomainRequest","onreadystatechange","readyState","status","resolve","reject","setTimeout","header","setRequestHeader","send","promise","validateState","new_state","validated_region","attempted_midpoint","attempted_scale","temp","min_region_scale","max_region_scale","parseFields","data","tokens","regex","m","text","index","condition","variable","close","console","error","JSON","stringify","astify","token","shift","then","ast","cache","hasOwnProperty","Data","Field","render_node","value","map","join","getToolTipData","parentNode","classed","getToolTipDataLayer","getDataLayer","getToolTipPanel","data_layer","parent","getToolTipPlot","panel","generateCurtain","curtain","showing","content_selector","hide_delay","show","content","css","parent_plot","insert","on","hide","bind","update","clearTimeout","page_origin","getPageOrigin","top","y","left","width","height","delay","remove","generateLoader","loader","progress_selector","cancel_selector","percent","padding","loader_boundrect","getBoundingClientRect","animate","setPercentCompleted","subclass","extra","Sub","constructor","apply","arguments","prototype","create","k","ext","Layouts","obj","layouts","get","type","name","modifications","merge","unnamespaced","parse","default_namespace","namespace","default","toString","applyNamespaces","element","re","resolved_namespace","r","merge_namespace","namespaced_element","namespaced_property","property","set","add","list","custom_layout","default_layout","custom_type","default_type","Array","isArray","closable","or","and","covariates_model_association","orientation","fields","z_index","x_axis","field","y_axis","axis","ceiling","point_shape","scale_function","parameters","field_value","else","point_size","color","breaks","values","legend","shape","size","label","class","id_field","upper_buffer","min_extent","behaviors","onmouseover","action","onmouseout","onclick","exclusive","onshiftclick","tooltip","tooltip_positioning","category_field","lower_buffer","categories","null_value","fill_opacity","spacing","lines","filters","operator","start_field","end_field","track_split_field","split_tracks","always_hide_legend","components","group_position","title","subtitle","covariates_model_plot_dashboard","button_html","button_title","region_nav_plot_dashboard","step","min_width","min_height","proportional_width","margin","right","bottom","inner_border","dashboard","l","axes","label_offset","tick_format","extent","y1","y2","origin","hidden","interaction","drag_background_to_pan","drag_x_ticks_to_scale","drag_y1_ticks_to_scale","drag_y2_ticks_to_scale","scroll_to_zoom","x_linked","data_layers","transform","data_layer_id","pad_from_bottom","responsive_resize","panels","proportional_height","StandardLayout","mouse_guide","DataLayer","initialized","layout_idx","Panel","DefaultLayout","_base_layout","state_id","setDefaultState","tooltips","global_statuses","addField","fieldName","transformations","fieldString","Statuses","adjectives","verbs","menu_antiverbs","getBaseId","getAbsoluteDataHeight","dataBCR","group","canTransition","transition","panel_boundaries","dragging","panel_id","getElementId","element_id","getElementStatusNodeId","getElementById","applyDataMethods","toHTML","deselect","unselectElement","applyCustomDataMethods","clipRect","moveUp","data_layer_ids_by_z_index","resortDataLayers","moveDown","resolveScalableParameter","idx","f","ScaleFunctions","getAxisExtent","dimension","axis_name","axis_layout","data_extent","original_extent_span","range_min","range_max","getTicks","config","createTooltip","positionTooltip","arrow","updateTooltip","destroyTooltip","destroyAllTooltips","event","pageX","pageY","positionAllTooltips","showOrHideTooltip","resolveStatus","statuses","directive","reduce","previousValue","currentValue","sub_status","sub_operator","show_directive","hide_directive","antistatus","show_resolved","hide_resolved","filter","return_type","test","operators","a","b","matches","filterIndexes","filterElements","verb","adjective","antiverb","setElementStatus","setElementStatusByFilters","setAllElementStatus","toggle","get_element_id_error","element_status_node_id","element_status_idx","splice","emit","active","status_ids","applyBehaviors","selection","event_match","executeBehaviors","requiredKeyStates","ctrl","ctrlKey","shiftKey","behavior","current_status_boolean","href","target","window","location","panel_origin","exportData","format","default_format","toLowerCase","e","jsonified","delimiter","record","draw","cliparea","reMap","lzd","getData","new_data","DataLayers","datalayers","datalayer","extend","parent_name","overrides","child","render","self","trackData","enter","exit","arrow_type","arrow_top","arrow_left","arrow_width","stroke_width","tooltip_box","data_layer_height","data_layer_width","x_center","x_scale","y_center","offset_right","offset_left","confidence_intervals","show_no_significance_line","border_radius","y_scale","sqrt","PI","ci_selection","ci_transform","ci_width","ci_height","duration","ease","points_selection","initial_y","fill","symbol","element_data","stroke","label_font_size","label_exon_spacing","exon_height","bounding_box_padding","track_vertical_spacing","getTrackHeight","transcript_idx","tracks","gene_track_index","assignTracks","getLabelWidth","gene_name","font_size","temp_text","label_width","getBBox","g","gene_id","split","gene_version","transcript_id","transcripts","display_range","text_anchor","centered_margin","display_domain","invert","track","potential_track","collision_on_potential_track","placed_gene","min_start","max_end","t","exons","gene","bboxes","boundary_fill","boundary_stroke","boundaries","labels","strand","exon_fill","exon_stroke","exon_id","clickareas","gene_bbox_id","gene_bbox","gene_center_x","chromosome_fill_colors","light","dark","chromosome_label_colors","genome_start","genome_end","chromosomes","variant_parts","variant","track_split_order","track_split_legend_to_y_axis","track_height","previous_tracks","interval_track_index","track_split_field_index","reverse","placed_interval","psuedoElement","sharedstatusnode_style","display","interval","statusnode_style","statusnodes","rects","interval_name","updateSplitTrackAxis","interval_bbox","interval_center_x","legend_axis","track_spacing","target_height","scaleHeightToData","toggleSplitTracks","interpolate","hitarea_width","mouse_event","line","tooltip_timeout","getMouseDisplayAndData","mouse","slope","x_field","y_field","bisect","bisector","datum","startDatum","endDatum","interpolateNumber","x_precision","toPrecision","y_precision","dd","min_arrow_left","max_arrow_left","path","hitarea","hitarea_line","path_class","global_status","decoupled","x_extent","y_extent","x_range","y_range","flip_labels","handle_lines","Boolean","min_x","max_x","flip","dn","dnl","dnx","text_swing","dnlx2","line_swing","label_texts","da","dax","abound","dal","label_lines","db","bbound","collision","separate_labels","seperate_iterations","alpha","again","sign","adjust","new_a_y","new_b_y","min_y","max_y","delta","label_elements","label_line","filtered_data","label_groups","makeLDReference","ref","applyState","ldrefvar","_prepareData","xField","sourceData","sort","ak","bk","av","bv","_generateCategoryBounds","uniqueCategories","item","category","bounds","categoryNames","_setDynamicColorScheme","colorParams","baseParams","parameters_categories_hash","every","colors","color_scale","scale","category10","category20","concat","categoryBounds","_categories","knownCategories","knownColors","xPos","diff","KnownDataSources","sources","findSourceByName","SOURCE_NAME","source","warn","source_name","newObj","params","Function","getAll","setAll","clear","TransformationFunctions","getTrans","fun","parseTrans","parseTransString","funs","result","substring","fn","ceil","toExponential","str","encodeURIComponent","s","functions","input","threshold","prev","curr","nullval","upper_idx","brk","normalized_input","isFinite","Dashboard","hide_timeout","persist","component","Components","shouldPersist","visibility","destroy","force","Component","parent_panel","parent_svg","button","menu","Button","parent_dashboard","tag","setTag","setHtml","setText","setHTML","setTitle","setColor","setStyle","getClass","permanent","setPermanent","bool","setStatus","highlight","disable","setOnMouseover","setOnMouseout","setOnclick","preUpdate","postUpdate","outer_selector","inner_selector","scroll_position","scrollTop","scrollbar_padding","menu_height_padding","page_scroll_top","document","documentElement","container_offset","getContainerOffset","dashboard_client_rect","button_client_rect","menu_client_rect","total_content_height","scrollHeight","base_max_width","container_max_width","content_max_width","base_max_height","max_height","setPopulate","menu_populate_function","div_selector","title_selector","display_width","display_height","generateBase64SVG","base64_string","css_string","stylesheet","styleSheets","fcall","outerHTML","dy","initial_html","style_def","insert_at","btoa","p1","String","fromCharCode","suppress_confirm","confirm","removePanel","is_at_top","y_index","is_at_bottom","panel_ids_by_y_index","can_zoom","current_region_scale","zoom_factor","new_region_scale","menu_html","model","covariates","CovariatesModel","element_reference","updateComponent","removeByIdx","removeAll","table","covariate","row","cov","scale_timeout","status_adj","status_idx","status_verb","at_top","at_bottom","td","removeDataLayer","allowed_fields","fields_whitelist","dataLayer","layer_name","dataLayerLayout","defaultConfig","configSlot","_selected_item","uniqueID","random","menuLayout","renderRow","display_name","display_options","row_id","field_name","defaultName","default_config_display_name","options","Legend","background_rect","elements","elements_group","label_size","line_height","label_x","label_y","path_y","symbolTypes","radius","bcr","right_x","pad_from_right","DataSources","addSource","ns","dsobj","source_id","getSource","removeSource","fromJSON","ds","toJSON","parts","full_name","applyTransformations","Requester","split_requests","requests","raw","trans","outnames","request_handles","when","discrete","Source","enableCache","dependentSource","parseInit","init","getCacheKey","chain","getURL","fetchRequest","getRequest","req","cacheKey","_cachedKey","_cachedResponse","preGetData","pre","resp","parseResponse","normalizeResponse","N","sameLength","records","j","prepareData","annotateData","extractFields","fieldFound","output_record","v","combineChainBody","json","standardized","one_source_body","new_body","parseArraysToObjects","standard","parseObjectsToObjects","parseData","constructorFun","uniqueName","getPrototypeOf","AssociationSource","unshift","analysis","LDSource","findMergeFields","exactMatch","arr","regexes","dataFields","position_field","pvalue","pvalue_field","_names_","names","nameMatch","findRequestedFields","isrefvarin","isrefvarout","ldin","ldout","findExtremeValue","pval","extremeVal","extremeIdx","refSource","ldrefsource","reqFields","refVar","columns","leftJoin","lfield","rfield","position2","tagRefVariant","refvar","idfield","outname","GeneSource","GeneConstraintSource","geneids","substr","constraint_fields","RecombinationRateSource","recombsource","IntervalSource","bedtracksource","StaticSource","_data","PheWASSource","build","ConnectorSource","_source_name_mapping","specified_ids","REQUIRED_SOURCES","chain_source_id","applyPanelYIndexesToPanelLayouts","pid","remap_promises","window_onresize","event_hooks","hook","off","theseHooks","undefined","hookMatch","eventData","sourceID","hookToRun","eventContext","bounding_client_rect","x_offset","scrollLeft","y_offset","offsetParent","offsetTop","offsetLeft","canInteract","loading_data","zooming","initializeLayout","aspect_ratio","sumProportional","total","rescaleSVG","clientRect","panel_layout","addPanel","panel_width","panel_height","setOrigin","proportional_origin","clearPanelData","panelId","mode","panelsList","dlid","layer","x_linked_margins","total_proportional_height","proportional_adjustment","calculated_plot_height","mouse_guide_svg","mouse_guide_vertical_svg","mouse_guide_horizontal_svg","vertical","horizontal","selectors","corner_selector","panel_idx","panel_resize_drag","drag","this_panel","original_panel_height","panel_height_change","new_calculated_plot_height","loop_panel_id","loop_panel_idx","loop_panel","corner_drag","dx","plot_page_origin","panel_page_origin","corner_padding","corner_size","mouseout_mouse_guide","mousemove_mouse_guide","coords","mouseup","stopDrag","mousemove","preventDefault","dragged_x","start_x","dragged_y","start_y","linked_panel_ids","client_rect","subscribeToData","success_callback","opts","error_callback","onerror","err","listener","catch","state_changes","all","drop","startDrag","getLinkedPanelIds","overrideAxisLayout","axis_number","y_axis_number","generateID","applyDataLayerZIndexesToDataLayerLayouts","data_promises","y1_scale","y2_scale","y1_extent","y2_extent","x_ticks","y1_ticks","y2_ticks","zoom_timeout","bubble","plot_origin","background_click","y1_linked","y2_linked","panel_count","setMargin","y1_range","y2_range","label_function","data_layer_layout","addDataLayer","clipPath","clearSelections","x_axis_label","y1_axis","y1_axis_label","y2_axis","y2_axis_label","mousedown","ascending","generateExtents","generateTicks","baseTickConfig","combinedTicks","acc","nextLayer","itemConfig","constrain","limit_exponent","neg_min","neg_max","pos_min","pos_max","Infinity","ranges","base_x_range","x_shifted","base_y1_range","y1_shifted","base_y2_range","y2_shifted","anchor","scalar","current_extent_size","current_scaled_extent_size","potential_extent_size","new_extent_size","offset_ratio","new_x_extent_start","y_shifted","linear","domain","renderAxis","zoom_handler","wheelDelta","detail","deltaY","zoom_listener","zoom","canRender","axis_params","label_rotate","ticksAreAllNumbers","orient","tickPadding","tickValues","tickFormat","tick_selector","tick_mouseover","focus","cursor","dh","addBasicLoader","show_immediately"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAGA,IAAAA,SAAA,GAAA,EACAC,OAAA,EAAA,OADA,EAAA,C;QAaA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAAD,SAAA,CAAAE,QAAA,GAAA,UAAAC,QAAA,EAAAC,UAAA,EAAAC,MAAA,EAAA;AAAA,YACA,IAAA,OAAAF,QAAA,IAAA,WAAA,EAAA;AAAA,gBACA,MAAA,yCAAA,CADA;AAAA,aADA;AAAA,YAKA;AAAA,YAAAG,EAAA,CAAAC,MAAA,CAAAJ,QAAA,EAAAK,IAAA,CAAA,EAAA,EALA;AAAA,YAMA,IAAAC,IAAA,CANA;AAAA,YAOAH,EAAA,CAAAC,MAAA,CAAAJ,QAAA,EAAAO,IAAA,CAAA,YAAA;AAAA,gBAEA;AAAA,oBAAA,OAAA,KAAAC,IAAA,GAAAC,EAA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A,gBACA,KAAAe,MAAA,CAAAd,IAAA,GADA;AAAA,aAAA,CAEAC,IAFA,CAEA,IAFA,CAAA,EARA;AAAA,YAWA,OAAA,IAAA,CAXA;AAAA,SAAA,C","file":"locuszoom.app.js","sourcesContent":["/**\n * @namespace\n */\nvar LocusZoom = {\n version: \"0.8.0\"\n};\n\n/**\n * Populate a single element with a LocusZoom plot.\n * selector can be a string for a DOM Query or a d3 selector.\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot} The newly created plot instance\n */\nLocusZoom.populate = function(selector, datasource, layout) {\n if (typeof selector == \"undefined\"){\n throw (\"LocusZoom.populate selector not defined\");\n }\n // Empty the selector of any existing content\n d3.select(selector).html(\"\");\n var plot;\n d3.select(selector).call(function(){\n // Require each containing element have an ID. If one isn't present, create one.\n if (typeof this.node().id == \"undefined\"){\n var iterator = 0;\n while (!d3.select(\"#lz-\" + iterator).empty()){ iterator++; }\n this.attr(\"id\", \"#lz-\" + iterator);\n }\n // Create the plot\n plot = new LocusZoom.Plot(this.node().id, datasource, layout);\n plot.container = this.node();\n // Detect data-region and fill in state values if present\n if (typeof this.node().dataset !== \"undefined\" && typeof this.node().dataset.region !== \"undefined\"){\n var parsed_state = LocusZoom.parsePositionQuery(this.node().dataset.region);\n Object.keys(parsed_state).forEach(function(key){\n plot.state[key] = parsed_state[key];\n });\n }\n // Add an SVG to the div and set its dimensions\n plot.svg = d3.select(\"div#\" + plot.id)\n .append(\"svg\")\n .attr(\"version\", \"1.1\")\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .attr(\"id\", plot.id + \"_svg\").attr(\"class\", \"lz-locuszoom\")\n .style(plot.layout.style);\n plot.setDimensions();\n plot.positionPanels();\n // Initialize the plot\n plot.initialize();\n // If the plot has defined data sources then trigger its first mapping based on state values\n if (typeof datasource == \"object\" && Object.keys(datasource).length){\n plot.refresh();\n }\n });\n return plot;\n};\n\n/**\n * Populate arbitrarily many elements each with a LocusZoom plot\n * using a common datasource and layout\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot[]}\n */\nLocusZoom.populateAll = function(selector, datasource, layout) {\n var plots = [];\n d3.selectAll(selector).each(function(d,i) {\n plots[i] = LocusZoom.populate(this, datasource, layout);\n });\n return plots;\n};\n\n/**\n * Convert an integer chromosome position to an SI string representation (e.g. 23423456 => \"23.42\" (Mb))\n * @param {Number} pos Position\n * @param {String} [exp] Exponent to use for the returned string, eg 6=> MB. If not specified, will attempt to guess\n * the most appropriate SI prefix based on the number provided.\n * @param {Boolean} [suffix=false] Whether or not to append a suffix (e.g. \"Mb\") to the end of the returned string\n * @returns {string}\n */\nLocusZoom.positionIntToString = function(pos, exp, suffix){\n var exp_symbols = { 0: \"\", 3: \"K\", 6: \"M\", 9: \"G\" };\n suffix = suffix || false;\n if (isNaN(exp) || exp === null){\n var log = Math.log(pos) / Math.LN10;\n exp = Math.min(Math.max(log - (log % 3), 0), 9);\n }\n var places_exp = exp - Math.floor((Math.log(pos) / Math.LN10).toFixed(exp + 3));\n var min_exp = Math.min(Math.max(exp, 0), 2);\n var places = Math.min(Math.max(places_exp, min_exp), 12);\n var ret = \"\" + (pos / Math.pow(10, exp)).toFixed(places);\n if (suffix && typeof exp_symbols[exp] !== \"undefined\"){\n ret += \" \" + exp_symbols[exp] + \"b\";\n }\n return ret;\n};\n\n/**\n * Convert an SI string chromosome position to an integer representation (e.g. \"5.8 Mb\" => 58000000)\n * @param {String} p The chromosome position\n * @returns {Number}\n */\nLocusZoom.positionStringToInt = function(p) {\n var val = p.toUpperCase();\n val = val.replace(/,/g, \"\");\n var suffixre = /([KMG])[B]*$/;\n var suffix = suffixre.exec(val);\n var mult = 1;\n if (suffix) {\n if (suffix[1]===\"M\") {\n mult = 1e6;\n } else if (suffix[1]===\"G\") {\n mult = 1e9;\n } else {\n mult = 1e3; //K\n }\n val = val.replace(suffixre,\"\");\n }\n val = Number(val) * mult;\n return val;\n};\n\n/**\n * Parse region queries into their constituent parts\n * TODO: handle genes (or send off to API)\n * @param {String} x A chromosome position query. May be any of the forms `chr:start-end`, `chr:center+offset`,\n * or `chr:pos`\n * @returns {{chr:*, start: *, end:*} | {chr:*, position:*}}\n */\nLocusZoom.parsePositionQuery = function(x) {\n var chrposoff = /^(\\w+):([\\d,.]+[kmgbKMGB]*)([-+])([\\d,.]+[kmgbKMGB]*)$/;\n var chrpos = /^(\\w+):([\\d,.]+[kmgbKMGB]*)$/;\n var match = chrposoff.exec(x);\n if (match) {\n if (match[3] === \"+\") {\n var center = LocusZoom.positionStringToInt(match[2]);\n var offset = LocusZoom.positionStringToInt(match[4]);\n return {\n chr:match[1],\n start: center - offset,\n end: center + offset\n };\n } else {\n return {\n chr: match[1],\n start: LocusZoom.positionStringToInt(match[2]),\n end: LocusZoom.positionStringToInt(match[4])\n };\n }\n }\n match = chrpos.exec(x);\n if (match) {\n return {\n chr:match[1],\n position: LocusZoom.positionStringToInt(match[2])\n };\n }\n return null;\n};\n\n/**\n * Generate a \"pretty\" set of ticks (multiples of 1, 2, or 5 on the same order of magnitude for the range)\n * Based on R's \"pretty\" function: https://github.com/wch/r-source/blob/b156e3a711967f58131e23c1b1dc1ea90e2f0c43/src/appl/pretty.c\n * @param {Number[]} range A two-item array specifying [low, high] values for the axis range\n * @param {('low'|'high'|'both'|'neither')} [clip_range='neither'] What to do if first and last generated ticks extend\n * beyond the range. Set this to \"low\", \"high\", \"both\", or \"neither\" to clip the first (low) or last (high) tick to\n * be inside the range or allow them to extend beyond.\n * e.g. \"low\" will clip the first (low) tick if it extends beyond the low end of the range but allow the\n * last (high) tick to extend beyond the range. \"both\" clips both ends, \"neither\" allows both to extend beyond.\n * @param {Number} [target_tick_count=5] The approximate number of ticks you would like to be returned; may not be exact\n * @returns {Number[]}\n */\nLocusZoom.prettyTicks = function(range, clip_range, target_tick_count){\n if (typeof target_tick_count == \"undefined\" || isNaN(parseInt(target_tick_count))){\n target_tick_count = 5;\n }\n target_tick_count = parseInt(target_tick_count);\n \n var min_n = target_tick_count / 3;\n var shrink_sml = 0.75;\n var high_u_bias = 1.5;\n var u5_bias = 0.5 + 1.5 * high_u_bias;\n \n var d = Math.abs(range[0] - range[1]);\n var c = d / target_tick_count;\n if ((Math.log(d) / Math.LN10) < -2){\n c = (Math.max(Math.abs(d)) * shrink_sml) / min_n;\n }\n \n var base = Math.pow(10, Math.floor(Math.log(c)/Math.LN10));\n var base_toFixed = 0;\n if (base < 1 && base !== 0){\n base_toFixed = Math.abs(Math.round(Math.log(base)/Math.LN10));\n }\n \n var unit = base;\n if ( ((2 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 2 * base;\n if ( ((5 * base) - c) < (u5_bias * (c - unit)) ){\n unit = 5 * base;\n if ( ((10 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 10 * base;\n }\n }\n }\n \n var ticks = [];\n var i = parseFloat( (Math.floor(range[0]/unit)*unit).toFixed(base_toFixed) );\n while (i < range[1]){\n ticks.push(i);\n i += unit;\n if (base_toFixed > 0){\n i = parseFloat(i.toFixed(base_toFixed));\n }\n }\n ticks.push(i);\n \n if (typeof clip_range == \"undefined\" || [\"low\", \"high\", \"both\", \"neither\"].indexOf(clip_range) === -1){\n clip_range = \"neither\";\n }\n if (clip_range === \"low\" || clip_range === \"both\"){\n if (ticks[0] < range[0]){ ticks = ticks.slice(1); }\n }\n if (clip_range === \"high\" || clip_range === \"both\"){\n if (ticks[ticks.length-1] > range[1]){ ticks.pop(); }\n }\n \n return ticks;\n};\n\n/**\n * Make an AJAX request and return a promise.\n * From http://www.html5rocks.com/en/tutorials/cors/\n * and with promises from https://gist.github.com/kriskowal/593076\n *\n * @param {String} method The HTTP verb\n * @param {String} url\n * @param {String} body The request body to send to the server\n * @param {Object} headers Object of custom request headers\n * @param {Number} [timeout] If provided, wait this long (in ms) before timing out\n * @returns {Promise}\n */\nLocusZoom.createCORSPromise = function (method, url, body, headers, timeout) {\n var response = Q.defer();\n var xhr = new XMLHttpRequest();\n if (\"withCredentials\" in xhr) {\n // Check if the XMLHttpRequest object has a \"withCredentials\" property.\n // \"withCredentials\" only exists on XMLHTTPRequest2 objects.\n xhr.open(method, url, true);\n } else if (typeof XDomainRequest != \"undefined\") {\n // Otherwise, check if XDomainRequest.\n // XDomainRequest only exists in IE, and is IE's way of making CORS requests.\n xhr = new XDomainRequest();\n xhr.open(method, url);\n } else {\n // Otherwise, CORS is not supported by the browser.\n xhr = null;\n }\n if (xhr) {\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200 || xhr.status === 0 ) {\n response.resolve(xhr.response);\n } else {\n response.reject(\"HTTP \" + xhr.status + \" for \" + url);\n }\n }\n };\n timeout && setTimeout(response.reject, timeout);\n body = typeof body !== \"undefined\" ? body : \"\";\n if (typeof headers !== \"undefined\"){\n for (var header in headers){\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n // Send the request\n xhr.send(body);\n } \n return response.promise;\n};\n\n/**\n * Validate a (presumed complete) plot state object against internal rules for consistency, and ensure the plot fits\n * within any constraints imposed by the layout.\n * @param {Object} new_state\n * @param {Number} new_state.start\n * @param {Number} new_state.end\n * @param {Object} layout\n * @returns {*|{}}\n */\nLocusZoom.validateState = function(new_state, layout){\n\n new_state = new_state || {};\n layout = layout || {};\n\n // If a \"chr\", \"start\", and \"end\" are present then resolve start and end\n // to numeric values that are not decimal, negative, or flipped\n var validated_region = false;\n if (typeof new_state.chr != \"undefined\" && typeof new_state.start != \"undefined\" && typeof new_state.end != \"undefined\"){\n // Determine a numeric scale and midpoint for the attempted region,\n var attempted_midpoint = null; var attempted_scale;\n new_state.start = Math.max(parseInt(new_state.start), 1);\n new_state.end = Math.max(parseInt(new_state.end), 1);\n if (isNaN(new_state.start) && isNaN(new_state.end)){\n new_state.start = 1;\n new_state.end = 1;\n attempted_midpoint = 0.5;\n attempted_scale = 0;\n } else if (isNaN(new_state.start) || isNaN(new_state.end)){\n attempted_midpoint = new_state.start || new_state.end;\n attempted_scale = 0;\n new_state.start = (isNaN(new_state.start) ? new_state.end : new_state.start);\n new_state.end = (isNaN(new_state.end) ? new_state.start : new_state.end);\n } else {\n attempted_midpoint = Math.round((new_state.start + new_state.end) / 2);\n attempted_scale = new_state.end - new_state.start;\n if (attempted_scale < 0){\n var temp = new_state.start;\n new_state.end = new_state.start;\n new_state.start = temp;\n attempted_scale = new_state.end - new_state.start;\n }\n if (attempted_midpoint < 0){\n new_state.start = 1;\n new_state.end = 1;\n attempted_scale = 0;\n }\n }\n validated_region = true;\n }\n\n // Constrain w/r/t layout-defined minimum region scale\n if (!isNaN(layout.min_region_scale) && validated_region && attempted_scale < layout.min_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.min_region_scale / 2), 1);\n new_state.end = new_state.start + layout.min_region_scale;\n }\n\n // Constrain w/r/t layout-defined maximum region scale\n if (!isNaN(layout.max_region_scale) && validated_region && attempted_scale > layout.max_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.max_region_scale / 2), 1);\n new_state.end = new_state.start + layout.max_region_scale;\n }\n\n return new_state;\n};\n\n//\n/**\n * Replace placeholders in an html string with field values defined in a data object\n * Only works on scalar values! Will ignore non-scalars.\n *\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @param {Object} data\n * @param {String} html A placeholder string in which to substitute fields. Supports several template options:\n * `{{field_name}}` is a variable placeholder for the value of `field_name` from the provided data\n * `{{#if {{field_name}} }} Conditional text {{/if}} will insert the contents of the tag only if the value exists.\n * Since this is only an existence check, **variables with a value of 0 will be evaluated as true**.\n * @returns {string}\n */\nLocusZoom.parseFields = function (data, html) {\n if (typeof data != \"object\"){\n throw (\"LocusZoom.parseFields invalid arguments: data is not an object\");\n }\n if (typeof html != \"string\"){\n throw (\"LocusZoom.parseFields invalid arguments: html is not a string\");\n }\n // `tokens` is like [token,...]\n // `token` is like {text: '...'} or {variable: 'foo|bar'} or {condition: 'foo|bar'} or {close: 'if'}\n var tokens = [];\n var regex = /\\{\\{(?:(#if )?([A-Za-z0-9_:|]+)|(\\/if))\\}\\}/;\n while (html.length > 0){\n var m = regex.exec(html);\n if (!m) { tokens.push({text: html}); html = \"\"; }\n else if (m.index !== 0) { tokens.push({text: html.slice(0, m.index)}); html = html.slice(m.index); }\n else if (m[1] === \"#if \") { tokens.push({condition: m[2]}); html = html.slice(m[0].length); }\n else if (m[2]) { tokens.push({variable: m[2]}); html = html.slice(m[0].length); }\n else if (m[3] === \"/if\") { tokens.push({close: \"if\"}); html = html.slice(m[0].length); }\n else {\n console.error(\"Error tokenizing tooltip when remaining template is \" + JSON.stringify(html) +\n \" and previous tokens are \" + JSON.stringify(tokens) +\n \" and current regex match is \" + JSON.stringify([m[1], m[2], m[3]]));\n html=html.slice(m[0].length);\n }\n }\n var astify = function() {\n var token = tokens.shift();\n if (typeof token.text !== \"undefined\" || token.variable) {\n return token;\n } else if (token.condition) {\n token.then = [];\n while(tokens.length > 0) {\n if (tokens[0].close === \"if\") { tokens.shift(); break; }\n token.then.push(astify());\n }\n return token;\n } else {\n console.error(\"Error making tooltip AST due to unknown token \" + JSON.stringify(token));\n return { text: \"\" };\n }\n };\n // `ast` is like [thing,...]\n // `thing` is like {text: \"...\"} or {variable:\"foo|bar\"} or {condition: \"foo|bar\", then:[thing,...]}\n var ast = [];\n while (tokens.length > 0) ast.push(astify());\n\n var resolve = function(variable) {\n if (!resolve.cache.hasOwnProperty(variable)) {\n resolve.cache[variable] = (new LocusZoom.Data.Field(variable)).resolve(data);\n }\n return resolve.cache[variable];\n };\n resolve.cache = {};\n var render_node = function(node) {\n if (typeof node.text !== \"undefined\") {\n return node.text;\n } else if (node.variable) {\n try {\n var value = resolve(node.variable);\n if ([\"string\",\"number\",\"boolean\"].indexOf(typeof value) !== -1) { return value; }\n if (value === null) { return \"\"; }\n } catch (error) { console.error(\"Error while processing variable \" + JSON.stringify(node.variable)); }\n return \"{{\" + node.variable + \"}}\";\n } else if (node.condition) {\n try {\n var condition = resolve(node.condition);\n if (condition || condition === 0) {\n return node.then.map(render_node).join(\"\");\n }\n } catch (error) { console.error(\"Error while processing condition \" + JSON.stringify(node.variable)); }\n return \"\";\n } else { console.error(\"Error rendering tooltip due to unknown AST node \" + JSON.stringify(node)); }\n };\n return ast.map(render_node).join(\"\");\n};\n\n/**\n * Shortcut method for getting the data bound to a tool tip.\n * @param {Element} node\n * @returns {*} The first element of data bound to the tooltip\n */\nLocusZoom.getToolTipData = function(node){\n if (typeof node != \"object\" || typeof node.parentNode == \"undefined\"){\n throw(\"Invalid node object\");\n }\n // If this node is a locuszoom tool tip then return its data\n var selector = d3.select(node);\n if (selector.classed(\"lz-data_layer-tooltip\") && typeof selector.data()[0] != \"undefined\"){\n return selector.data()[0];\n } else {\n return LocusZoom.getToolTipData(node.parentNode);\n }\n};\n\n/**\n * Shortcut method for getting a reference to the data layer that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.getToolTipDataLayer = function(node){\n var data = LocusZoom.getToolTipData(node);\n if (data.getDataLayer){ return data.getDataLayer(); }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the panel that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.getToolTipPanel = function(node){\n var data_layer = LocusZoom.getToolTipDataLayer(node);\n if (data_layer){ return data_layer.parent; }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the plot that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.getToolTipPlot = function(node){\n var panel = LocusZoom.getToolTipPanel(node);\n if (panel){ return panel.parent; }\n return null;\n};\n\n/**\n * Generate a curtain object for a plot, panel, or any other subdivision of a layout\n * The panel curtain, like the plot curtain is an HTML overlay that obscures the entire panel. It can be styled\n * arbitrarily and display arbitrary messages. It is useful for reporting error messages visually to an end user\n * when the error renders the panel unusable.\n * TODO: Improve type doc here\n * @returns {object}\n */\nLocusZoom.generateCurtain = function(){\n var curtain = {\n showing: false,\n selector: null,\n content_selector: null,\n hide_delay: null,\n\n /**\n * Generate the curtain. Any content (string) argument passed will be displayed in the curtain as raw HTML.\n * CSS (object) can be passed which will apply styles to the curtain and its content.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n show: function(content, css){\n if (!this.curtain.showing){\n this.curtain.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-curtain\").attr(\"id\", this.id + \".curtain\");\n this.curtain.content_selector = this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-content\");\n this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-dismiss\").html(\"Dismiss\")\n .on(\"click\", function(){\n this.curtain.hide();\n }.bind(this));\n this.curtain.showing = true;\n }\n return this.curtain.update(content, css);\n }.bind(this),\n\n /**\n * Update the content and css of the curtain that's currently being shown. This method also adjusts the size\n * and positioning of the curtain to ensure it still covers the entire panel with no overlap.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n update: function(content, css){\n if (!this.curtain.showing){ return this.curtain; }\n clearTimeout(this.curtain.hide_delay);\n // Apply CSS if provided\n if (typeof css == \"object\"){\n this.curtain.selector.style(css);\n }\n // Update size and position\n var page_origin = this.getPageOrigin();\n this.curtain.selector.style({\n top: page_origin.y + \"px\",\n left: page_origin.x + \"px\",\n width: this.layout.width + \"px\",\n height: this.layout.height + \"px\"\n });\n this.curtain.content_selector.style({\n \"max-width\": (this.layout.width - 40) + \"px\",\n \"max-height\": (this.layout.height - 40) + \"px\"\n });\n // Apply content if provided\n if (typeof content == \"string\"){\n this.curtain.content_selector.html(content);\n }\n return this.curtain;\n }.bind(this),\n\n /**\n * Remove the curtain\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.curtain.showing){ return this.curtain; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.curtain.hide_delay);\n this.curtain.hide_delay = setTimeout(this.curtain.hide, delay);\n return this.curtain;\n }\n // Remove curtain\n this.curtain.selector.remove();\n this.curtain.selector = null;\n this.curtain.content_selector = null;\n this.curtain.showing = false;\n return this.curtain;\n }.bind(this)\n };\n return curtain;\n};\n\n/**\n * Generate a loader object for a plot, panel, or any other subdivision of a layout\n *\n * The panel loader is a small HTML overlay that appears in the lower left corner of the panel. It cannot be styled\n * arbitrarily, but can show a custom message and show a minimalist loading bar that can be updated to specific\n * completion percentages or be animated.\n * TODO Improve type documentation\n * @returns {object}\n */\nLocusZoom.generateLoader = function(){\n var loader = {\n showing: false,\n selector: null,\n content_selector: null,\n progress_selector: null,\n cancel_selector: null,\n\n /**\n * Show a loading indicator\n * @param {string} [content='Loading...'] Loading message (displayed as raw HTML)\n */\n show: function(content){\n // Generate loader\n if (!this.loader.showing){\n this.loader.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-loader\").attr(\"id\", this.id + \".loader\");\n this.loader.content_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-content\");\n this.loader.progress_selector = this.loader.selector\n .append(\"div\").attr(\"class\", \"lz-loader-progress-container\")\n .append(\"div\").attr(\"class\", \"lz-loader-progress\");\n /* TODO: figure out how to make this cancel button work\n this.loader.cancel_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-cancel\").html(\"Cancel\")\n .on(\"click\", function(){\n this.loader.hide();\n }.bind(this));\n */\n this.loader.showing = true;\n if (typeof content == \"undefined\"){ content = \"Loading...\"; }\n }\n return this.loader.update(content);\n }.bind(this),\n\n /**\n * Update the currently displayed loader and ensure the new content is positioned correctly.\n * @param {string} content The text to display (as raw HTML). If not a string, will be ignored.\n * @param {number} [percent] A number from 1-100. If a value is specified, it will stop all animations\n * in progress.\n */\n update: function(content, percent){\n if (!this.loader.showing){ return this.loader; }\n clearTimeout(this.loader.hide_delay);\n // Apply content if provided\n if (typeof content == \"string\"){\n this.loader.content_selector.html(content);\n }\n // Update size and position\n var padding = 6; // is there a better place to store/define this?\n var page_origin = this.getPageOrigin();\n var loader_boundrect = this.loader.selector.node().getBoundingClientRect();\n this.loader.selector.style({\n top: (page_origin.y + this.layout.height - loader_boundrect.height - padding) + \"px\",\n left: (page_origin.x + padding) + \"px\"\n });\n /* Uncomment this code when a functional cancel button can be shown\n var cancel_boundrect = this.loader.cancel_selector.node().getBoundingClientRect();\n this.loader.content_selector.style({\n \"padding-right\": (cancel_boundrect.width + padding) + \"px\"\n });\n */\n // Apply percent if provided\n if (typeof percent == \"number\"){\n this.loader.progress_selector.style({\n width: (Math.min(Math.max(percent, 1), 100)) + \"%\"\n });\n }\n return this.loader;\n }.bind(this),\n\n /**\n * Adds a class to the loading bar that makes it loop infinitely in a loading animation. Useful when exact\n * percent progress is not available.\n */\n animate: function(){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", true);\n return this.loader;\n }.bind(this),\n\n /**\n * Sets the loading bar in the loader to percentage width equal to the percent (number) value passed. Percents\n * will automatically be limited to a range of 1 to 100. Will stop all animations in progress.\n */\n setPercentCompleted: function(percent){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", false);\n return this.loader.update(null, percent);\n }.bind(this),\n\n /**\n * Remove the loader\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.loader.showing){ return this.loader; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.loader.hide_delay);\n this.loader.hide_delay = setTimeout(this.loader.hide, delay);\n return this.loader;\n }\n // Remove loader\n this.loader.selector.remove();\n this.loader.selector = null;\n this.loader.content_selector = null;\n this.loader.progress_selector = null;\n this.loader.cancel_selector = null;\n this.loader.showing = false;\n return this.loader;\n }.bind(this)\n };\n return loader;\n};\n\n/**\n * Create a new subclass following classical inheritance patterns. Some registry singletons use this internally to\n * enable code reuse and customization of known LZ core functionality.\n *\n * @param {Function} parent A parent class constructor that will be extended by the child class\n * @param {Object} extra An object of additional properties and methods to add/override behavior for the child class.\n * The special \"constructor\" property can be used to specify a custom constructor, or it will call parent by default.\n * Implementer must manage super calls when overriding the constructor.\n * @returns {Function} The constructor for the new child class\n */\nLocusZoom.subclass = function(parent, extra) {\n if (typeof parent !== \"function\" ) {\n throw \"Parent must be a callable constructor\";\n }\n\n extra = extra || {};\n var Sub = extra.hasOwnProperty(\"constructor\") ? extra.constructor : function() {\n parent.apply(this, arguments);\n };\n\n Sub.prototype = Object.create(parent.prototype);\n Object.keys(extra).forEach(function(k) {\n Sub.prototype[k] = extra[k];\n });\n return Sub;\n};\n\n\n/**\n * LocusZoom optional extensions will live under this namespace.\n *\n * Extension code is not part of the core LocusZoom app.js bundle.\n * @namespace\n * @public\n */\nLocusZoom.ext = {};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * Manage known layouts for all parts of the LocusZoom plot\n *\n * This registry allows for layouts to be reused and customized many times on a page, using a common base pattern.\n * It handles the work of ensuring that each new instance of the layout has no shared state with other copies.\n *\n * @class\n */\nLocusZoom.Layouts = (function() {\n var obj = {};\n var layouts = {\n \"plot\": {},\n \"panel\": {},\n \"data_layer\": {},\n \"dashboard\": {},\n \"tooltip\": {}\n };\n\n /**\n * Generate a layout configuration object\n * @param {('plot'|'panel'|'data_layer'|'dashboard'|'tooltip')} type The type of layout to retrieve\n * @param {string} name Identifier of the predefined layout within the specified type\n * @param {object} [modifications] Custom properties that override default settings for this layout\n * @returns {object} A JSON-serializable object representation\n */\n obj.get = function(type, name, modifications) {\n if (typeof type != \"string\" || typeof name != \"string\") {\n throw(\"invalid arguments passed to LocusZoom.Layouts.get, requires string (layout type) and string (layout name)\");\n } else if (layouts[type][name]) {\n // Get the base layout\n var layout = LocusZoom.Layouts.merge(modifications || {}, layouts[type][name]);\n // If \"unnamespaced\" is true then strike that from the layout and return the layout without namespacing\n if (layout.unnamespaced){\n delete layout.unnamespaced;\n return JSON.parse(JSON.stringify(layout));\n }\n // Determine the default namespace for namespaced values\n var default_namespace = \"\";\n if (typeof layout.namespace == \"string\"){\n default_namespace = layout.namespace;\n } else if (typeof layout.namespace == \"object\" && Object.keys(layout.namespace).length){\n if (typeof layout.namespace.default != \"undefined\"){\n default_namespace = layout.namespace.default;\n } else {\n default_namespace = layout.namespace[Object.keys(layout.namespace)[0]].toString();\n }\n }\n default_namespace += default_namespace.length ? \":\" : \"\";\n // Apply namespaces to layout, recursively\n var applyNamespaces = function(element, namespace){\n if (namespace){\n if (typeof namespace == \"string\"){\n namespace = { default: namespace }; \n }\n } else {\n namespace = { default: \"\" };\n }\n if (typeof element == \"string\"){\n var re = /\\{\\{namespace(\\[[A-Za-z_0-9]+\\]|)\\}\\}/g;\n var match, base, key, resolved_namespace;\n var replace = [];\n while ((match = re.exec(element)) !== null){\n base = match[0];\n key = match[1].length ? match[1].replace(/(\\[|\\])/g,\"\") : null;\n resolved_namespace = default_namespace;\n if (namespace != null && typeof namespace == \"object\" && typeof namespace[key] != \"undefined\"){\n resolved_namespace = namespace[key] + (namespace[key].length ? \":\" : \"\");\n }\n replace.push({ base: base, namespace: resolved_namespace });\n }\n for (var r in replace){\n element = element.replace(replace[r].base, replace[r].namespace);\n }\n } else if (typeof element == \"object\" && element != null){\n if (typeof element.namespace != \"undefined\"){\n var merge_namespace = (typeof element.namespace == \"string\") ? { default: element.namespace } : element.namespace;\n namespace = LocusZoom.Layouts.merge(namespace, merge_namespace);\n }\n var namespaced_element, namespaced_property;\n for (var property in element) {\n if (property === \"namespace\"){ continue; }\n namespaced_element = applyNamespaces(element[property], namespace);\n namespaced_property = applyNamespaces(property, namespace);\n if (property !== namespaced_property){\n delete element[property];\n }\n element[namespaced_property] = namespaced_element;\n }\n }\n return element;\n };\n layout = applyNamespaces(layout, layout.namespace);\n // Return the layout as valid JSON only\n return JSON.parse(JSON.stringify(layout));\n } else {\n throw(\"layout type [\" + type + \"] name [\" + name + \"] not found\");\n }\n };\n\n /** @private */\n obj.set = function(type, name, layout) {\n if (typeof type != \"string\" || typeof name != \"string\" || typeof layout != \"object\"){\n throw (\"unable to set new layout; bad arguments passed to set()\");\n }\n if (!layouts[type]){\n layouts[type] = {};\n }\n if (layout){\n return (layouts[type][name] = JSON.parse(JSON.stringify(layout)));\n } else {\n delete layouts[type][name];\n return null;\n }\n };\n\n /**\n * Register a new layout definition by name.\n *\n * @param {string} type The type of layout to add. Usually, this will be one of the predefined LocusZoom types,\n * but if you pass a different name, this method will automatically create the new `type` bucket\n * @param {string} name The identifier of the newly added layout\n * @param {object} [layout] A JSON-serializable object containing configuration properties for this layout\n * @returns The JSON representation of the newly created layout\n */\n obj.add = function(type, name, layout) {\n return obj.set(type, name, layout);\n };\n\n /**\n * List all registered layouts\n * @param [type] Optionally narrow the list to only layouts of a specific type; else return all known layouts\n * @returns {*}\n */\n obj.list = function(type) {\n if (!layouts[type]){\n var list = {};\n Object.keys(layouts).forEach(function(type){\n list[type] = Object.keys(layouts[type]);\n });\n return list;\n } else {\n return Object.keys(layouts[type]);\n }\n };\n\n /**\n * A helper method used for merging two objects. If a key is present in both, takes the value from the first object\n * Values from `default_layout` will be cleanly copied over, ensuring no references or shared state.\n *\n * Frequently used for preparing custom layouts. Both objects should be JSON-serializable.\n *\n * @param {object} custom_layout An object containing configuration parameters that override or add to defaults\n * @param {object} default_layout An object containing default settings.\n * @returns The custom layout is modified in place and also returned from this method.\n */\n obj.merge = function (custom_layout, default_layout) {\n if (typeof custom_layout !== \"object\" || typeof default_layout !== \"object\"){\n throw(\"LocusZoom.Layouts.merge only accepts two layout objects; \" + (typeof custom_layout) + \", \" + (typeof default_layout) + \" given\");\n }\n for (var property in default_layout) {\n if (!default_layout.hasOwnProperty(property)){ continue; }\n // Get types for comparison. Treat nulls in the custom layout as undefined for simplicity.\n // (javascript treats nulls as \"object\" when we just want to overwrite them as if they're undefined)\n // Also separate arrays from objects as a discrete type.\n var custom_type = custom_layout[property] === null ? \"undefined\" : typeof custom_layout[property];\n var default_type = typeof default_layout[property];\n if (custom_type === \"object\" && Array.isArray(custom_layout[property])){ custom_type = \"array\"; }\n if (default_type === \"object\" && Array.isArray(default_layout[property])){ default_type = \"array\"; }\n // Unsupported property types: throw an exception\n if (custom_type === \"function\" || default_type === \"function\"){\n throw(\"LocusZoom.Layouts.merge encountered an unsupported property type\");\n }\n // Undefined custom value: pull the default value\n if (custom_type === \"undefined\"){\n custom_layout[property] = JSON.parse(JSON.stringify(default_layout[property]));\n continue;\n }\n // Both values are objects: merge recursively\n if (custom_type === \"object\" && default_type === \"object\"){\n custom_layout[property] = LocusZoom.Layouts.merge(custom_layout[property], default_layout[property]);\n continue;\n }\n }\n return custom_layout;\n };\n\n return obj;\n})();\n\n\n/**\n * Tooltip Layouts\n * @namespace LocusZoom.Layouts.tooltips\n */\n\n// TODO: Improve documentation of predefined types within layout namespaces\nLocusZoom.Layouts.add(\"tooltip\", \"standard_association\", {\n namespace: { \"assoc\": \"assoc\" },\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[assoc]}}variant}}
      \"\n + \"P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
      \"\n + \"Ref. Allele: {{{{namespace[assoc]}}ref_allele}}
      \"\n + \"Make LD Reference
      \"\n});\n\nvar covariates_model_association = LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true });\ncovariates_model_association.html += \"Condition on Variant
      \";\nLocusZoom.Layouts.add(\"tooltip\", \"covariates_model_association\", covariates_model_association);\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_genes\", {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"

      {{gene_name}}

      \"\n + \"
      Gene ID: {{gene_id}}
      \"\n + \"
      Transcript ID: {{transcript_id}}
      \"\n + \"
      \"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"
      ConstraintExpected variantsObserved variantsConst. Metric
      Synonymous{{exp_syn}}{{n_syn}}z = {{syn_z}}
      Missense{{exp_mis}}{{n_mis}}z = {{mis_z}}
      LoF{{exp_lof}}{{n_lof}}pLI = {{pLI}}
      \"\n + \"More data on ExAC\"\n});\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n closable: false,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[intervals]}}state_name}}
      {{{{namespace[intervals]}}start}}-{{{{namespace[intervals]}}end}}\"\n});\n\n/**\n * Data Layer Layouts: represent specific information from a data source\n * @namespace Layouts.data_layer\n*/\n\nLocusZoom.Layouts.add(\"data_layer\", \"significance\", {\n id: \"significance\",\n type: \"orthogonal_line\",\n orientation: \"horizontal\",\n offset: 4.522\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"recomb_rate\", {\n namespace: { \"recomb\": \"recomb\" },\n id: \"recombrate\",\n type: \"line\",\n fields: [\"{{namespace[recomb]}}position\", \"{{namespace[recomb]}}recomb_rate\"],\n z_index: 1,\n style: {\n \"stroke\": \"#0000FF\",\n \"stroke-width\": \"1.5px\"\n },\n x_axis: {\n field: \"{{namespace[recomb]}}position\"\n },\n y_axis: {\n axis: 2,\n field: \"{{namespace[recomb]}}recomb_rate\",\n floor: 0,\n ceiling: 100\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"association_pvalues\", {\n namespace: { \"assoc\": \"assoc\", \"ld\": \"ld\" },\n id: \"associationpvalues\",\n type: \"scatter\",\n point_shape: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"diamond\",\n else: \"circle\"\n }\n },\n point_size: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: 80,\n else: 40\n }\n },\n color: [\n {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"#9632b8\"\n }\n },\n {\n scale_function: \"numerical_bin\",\n field: \"{{namespace[ld]}}state\",\n parameters: {\n breaks: [0, 0.2, 0.4, 0.6, 0.8],\n values: [\"#357ebd\",\"#46b8da\",\"#5cb85c\",\"#eea236\",\"#d43f3a\"]\n }\n },\n \"#B8B8B8\"\n ],\n legend: [\n { shape: \"diamond\", color: \"#9632b8\", size: 40, label: \"LD Ref Var\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#d43f3a\", size: 40, label: \"1.0 > r² ≥ 0.8\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#eea236\", size: 40, label: \"0.8 > r² ≥ 0.6\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#5cb85c\", size: 40, label: \"0.6 > r² ≥ 0.4\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#46b8da\", size: 40, label: \"0.4 > r² ≥ 0.2\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#357ebd\", size: 40, label: \"0.2 > r² ≥ 0.0\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#B8B8B8\", size: 40, label: \"no r² data\", class: \"lz-data_layer-scatter\" }\n ],\n fields: [\"{{namespace[assoc]}}variant\", \"{{namespace[assoc]}}position\", \"{{namespace[assoc]}}log_pvalue\", \"{{namespace[assoc]}}log_pvalue|logtoscinotation\", \"{{namespace[assoc]}}ref_allele\", \"{{namespace[ld]}}state\", \"{{namespace[ld]}}isrefvar\"],\n id_field: \"{{namespace[assoc]}}variant\",\n z_index: 2,\n x_axis: {\n field: \"{{namespace[assoc]}}position\"\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[assoc]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.10,\n min_extent: [ 0, 10 ]\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"phewas_pvalues\", {\n namespace: {\"phewas\": \"phewas\"},\n id: \"phewaspvalues\",\n type: \"category_scatter\",\n point_shape: \"circle\",\n point_size: 70,\n tooltip_positioning: \"vertical\",\n id_field: \"{{namespace[phewas]}}id\",\n fields: [\"{{namespace[phewas]}}id\", \"{{namespace[phewas]}}log_pvalue\", \"{{namespace[phewas]}}trait_group\", \"{{namespace[phewas]}}trait_label\"],\n x_axis: {\n field: \"{{namespace[phewas]}}x\", // Synthetic/derived field added by `category_scatter` layer\n category_field: \"{{namespace[phewas]}}trait_group\",\n lower_buffer: 0.025,\n upper_buffer: 0.025\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[phewas]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.15\n },\n color: {\n field: \"{{namespace[phewas]}}trait_group\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [],\n values: [],\n null_value: \"#B8B8B8\"\n }\n },\n fill_opacity: 0.7,\n tooltip: {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: [\n \"Trait: {{{{namespace[phewas]}}trait_label|htmlescape}}
      \",\n \"Trait Category: {{{{namespace[phewas]}}trait_group|htmlescape}}
      \",\n \"P-value: {{{{namespace[phewas]}}log_pvalue|logtoscinotation|htmlescape}}
      \"\n ].join(\"\")\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n label: {\n text: \"{{{{namespace[phewas]}}trait_label}}\",\n spacing: 6,\n lines: {\n style: {\n \"stroke-width\": \"2px\",\n \"stroke\": \"#333333\",\n \"stroke-dasharray\": \"2px 2px\"\n }\n },\n filters: [\n {\n field: \"{{namespace[phewas]}}log_pvalue\",\n operator: \">=\",\n value: 20\n }\n ],\n style: {\n \"font-size\": \"14px\",\n \"font-weight\": \"bold\",\n \"fill\": \"#333333\"\n }\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genes\", {\n namespace: { \"gene\": \"gene\", \"constraint\": \"constraint\" },\n id: \"genes\",\n type: \"genes\",\n fields: [\"{{namespace[gene]}}all\", \"{{namespace[constraint]}}all\"],\n id_field: \"gene_id\",\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_genes\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genome_legend\", {\n namespace: { \"genome\": \"genome\" },\n id: \"genome_legend\",\n type: \"genome_legend\",\n fields: [\"{{namespace[genome]}}chr\", \"{{namespace[genome]}}base_pairs\"],\n x_axis: {\n floor: 0,\n ceiling: 2881033286\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n id: \"intervals\",\n type: \"intervals\",\n fields: [\"{{namespace[intervals]}}start\",\"{{namespace[intervals]}}end\",\"{{namespace[intervals]}}state_id\",\"{{namespace[intervals]}}state_name\"],\n id_field: \"{{namespace[intervals]}}start\",\n start_field: \"{{namespace[intervals]}}start\",\n end_field: \"{{namespace[intervals]}}end\",\n track_split_field: \"{{namespace[intervals]}}state_id\",\n split_tracks: true,\n always_hide_legend: false,\n color: {\n field: \"{{namespace[intervals]}}state_id\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [1,2,3,4,5,6,7,8,9,10,11,12,13],\n values: [\"rgb(212,63,58)\", \"rgb(250,120,105)\", \"rgb(252,168,139)\", \"rgb(240,189,66)\", \"rgb(250,224,105)\", \"rgb(240,238,84)\", \"rgb(244,252,23)\", \"rgb(23,232,252)\", \"rgb(32,191,17)\", \"rgb(23,166,77)\", \"rgb(32,191,17)\", \"rgb(162,133,166)\", \"rgb(212,212,212)\"],\n null_value: \"#B8B8B8\"\n }\n },\n legend: [\n { shape: \"rect\", color: \"rgb(212,63,58)\", width: 9, label: \"Active Promoter\", \"{{namespace[intervals]}}state_id\": 1 },\n { shape: \"rect\", color: \"rgb(250,120,105)\", width: 9, label: \"Weak Promoter\", \"{{namespace[intervals]}}state_id\": 2 },\n { shape: \"rect\", color: \"rgb(252,168,139)\", width: 9, label: \"Poised Promoter\", \"{{namespace[intervals]}}state_id\": 3 },\n { shape: \"rect\", color: \"rgb(240,189,66)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 4 },\n { shape: \"rect\", color: \"rgb(250,224,105)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 5 },\n { shape: \"rect\", color: \"rgb(240,238,84)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 6 },\n { shape: \"rect\", color: \"rgb(244,252,23)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 7 },\n { shape: \"rect\", color: \"rgb(23,232,252)\", width: 9, label: \"Insulator\", \"{{namespace[intervals]}}state_id\": 8 },\n { shape: \"rect\", color: \"rgb(32,191,17)\", width: 9, label: \"Transcriptional transition\", \"{{namespace[intervals]}}state_id\": 9 },\n { shape: \"rect\", color: \"rgb(23,166,77)\", width: 9, label: \"Transcriptional elongation\", \"{{namespace[intervals]}}state_id\": 10 },\n { shape: \"rect\", color: \"rgb(136,240,129)\", width: 9, label: \"Weak transcribed\", \"{{namespace[intervals]}}state_id\": 11 },\n { shape: \"rect\", color: \"rgb(162,133,166)\", width: 9, label: \"Polycomb-repressed\", \"{{namespace[intervals]}}state_id\": 12 },\n { shape: \"rect\", color: \"rgb(212,212,212)\", width: 9, label: \"Heterochromatin / low signal\", \"{{namespace[intervals]}}state_id\": 13 }\n ],\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_intervals\", { unnamespaced: true })\n});\n\n/**\n * Dashboard Layouts: toolbar buttons etc\n * @namespace Layouts.dashboard\n */\nLocusZoom.Layouts.add(\"dashboard\", \"standard_panel\", {\n components: [\n {\n type: \"remove_panel\",\n position: \"right\",\n color: \"red\",\n group_position: \"end\"\n },\n {\n type: \"move_panel_up\",\n position: \"right\",\n group_position: \"middle\"\n },\n {\n type: \"move_panel_down\",\n position: \"right\",\n group_position: \"start\",\n style: { \"margin-left\": \"0.75em\" }\n }\n ]\n}); \n\nLocusZoom.Layouts.add(\"dashboard\", \"standard_plot\", {\n components: [\n {\n type: \"title\",\n title: \"LocusZoom\",\n subtitle: \"v\" + LocusZoom.version + \"\",\n position: \"left\"\n },\n {\n type: \"dimensions\",\n position: \"right\"\n },\n {\n type: \"region_scale\",\n position: \"right\"\n },\n {\n type: \"download\",\n position: \"right\"\n }\n ]\n});\n\nvar covariates_model_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\ncovariates_model_plot_dashboard.components.push({\n type: \"covariates_model\",\n button_html: \"Model\",\n button_title: \"Show and edit covariates currently in model\",\n position: \"left\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"covariates_model_plot\", covariates_model_plot_dashboard);\n\nvar region_nav_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 500000,\n button_html: \">>\",\n position: \"right\",\n group_position: \"end\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 50000,\n button_html: \">\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: 0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: -0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -50000,\n button_html: \"<\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -500000,\n button_html: \"<<\",\n position: \"right\",\n group_position: \"start\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"region_nav_plot\", region_nav_plot_dashboard);\n\n/**\n * Panel Layouts\n * @namespace Layouts.panel\n */\n\nLocusZoom.Layouts.add(\"panel\", \"association\", {\n id: \"association\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 200,\n proportional_width: 1,\n margin: { top: 35, right: 50, bottom: 40, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_legend\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n },\n y2: {\n label: \"Recombination Rate (cM/Mb)\",\n label_offset: 40\n }\n },\n legend: {\n orientation: \"vertical\",\n origin: { x: 55, y: 40 },\n hidden: true\n },\n interaction: {\n drag_background_to_pan: true,\n drag_x_ticks_to_scale: true,\n drag_y1_ticks_to_scale: true,\n drag_y2_ticks_to_scale: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"recomb_rate\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"association_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genes\", {\n id: \"genes\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 112.5,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 20, left: 50 },\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"resize_to_data\",\n position: \"right\"\n });\n return l;\n })(), \n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genes\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"phewas\", {\n id: \"phewas\",\n width: 800,\n height: 300,\n min_width: 800,\n min_height: 300,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 120, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n axes: {\n x: {\n ticks: { // Object based config (shared defaults; allow layers to specify ticks)\n style: {\n \"font-weight\": \"bold\",\n \"font-size\": \"11px\",\n \"text-anchor\": \"start\"\n },\n transform: \"rotate(50)\",\n position: \"left\" // Special param recognized by `category_scatter` layers\n }\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"phewas_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genome_legend\", {\n id: \"genome_legend\",\n width: 800,\n height: 50,\n origin: { x: 0, y: 300 },\n min_width: 800,\n min_height: 50,\n proportional_width: 1,\n margin: { top: 0, right: 50, bottom: 35, left: 50 },\n axes: {\n x: {\n label: \"Genomic Position (number denotes chromosome)\",\n label_offset: 35,\n ticks: [\n {\n x: 124625310,\n text: \"1\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 370850307,\n text: \"2\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 591461209,\n text: \"3\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 786049562,\n text: \"4\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 972084330,\n text: \"5\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1148099493,\n text: \"6\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1313226358,\n text: \"7\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1465977701,\n text: \"8\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1609766427,\n text: \"9\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1748140516,\n text: \"10\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1883411148,\n text: \"11\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2017840353,\n text: \"12\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2142351240,\n text: \"13\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2253610949,\n text: \"14\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2358551415,\n text: \"15\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2454994487,\n text: \"16\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2540769469,\n text: \"17\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2620405698,\n text: \"18\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2689008813,\n text: \"19\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2750086065,\n text: \"20\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2805663772,\n text: \"21\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2855381003,\n text: \"22\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n }\n ]\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genome_legend\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"intervals\", {\n id: \"intervals\",\n width: 1000,\n height: 50,\n min_width: 500,\n min_height: 50,\n margin: { top: 25, right: 150, bottom: 5, left: 50 },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_split_tracks\",\n data_layer_id: \"intervals\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n legend: {\n hidden: true,\n orientation: \"horizontal\",\n origin: { x: 50, y: 0 },\n pad_from_bottom: 5\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"intervals\", { unnamespaced: true })\n ]\n});\n\n\n/**\n * Plot Layouts\n * @namespace Layouts.plot\n */\n\nLocusZoom.Layouts.add(\"plot\", \"standard_association\", {\n state: {},\n width: 800,\n height: 450,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, proportional_height: 0.5 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, proportional_height: 0.5 })\n ]\n});\n\n// Shortcut to \"StandardLayout\" for backward compatibility\nLocusZoom.StandardLayout = LocusZoom.Layouts.get(\"plot\", \"standard_association\");\n\nLocusZoom.Layouts.add(\"plot\", \"standard_phewas\", {\n width: 800,\n height: 600,\n min_width: 800,\n min_height: 600,\n responsive_resize: true,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true } ),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"phewas\", { unnamespaced: true, proportional_height: 0.45 }),\n LocusZoom.Layouts.get(\"panel\", \"genome_legend\", { unnamespaced: true, proportional_height: 0.1 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", {\n unnamespaced: true, proportional_height: 0.45,\n margin: { bottom: 40 },\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n }\n }\n })\n ],\n mouse_guide: false\n});\n\nLocusZoom.Layouts.add(\"plot\", \"interval_association\", {\n state: {},\n width: 800,\n height: 550,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, width: 800, proportional_height: (225/570) }),\n LocusZoom.Layouts.get(\"panel\", \"intervals\", { unnamespaced: true, proportional_height: (120/570) }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, width: 800, proportional_height: (225/570) })\n ]\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A data layer is an abstract class representing a data set and its graphical representation within a panel\n * @public\n * @class\n * @param {Object} layout A JSON-serializable object describing the layout for this layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n*/\nLocusZoom.DataLayer = function(layout, parent) {\n /** @member {Boolean} */\n this.initialized = false;\n /** @member {Number} */\n this.layout_idx = null;\n\n /** @member {String} */\n this.id = null;\n /** @member {LocusZoom.Panel} */\n this.parent = parent || null;\n /**\n * @member {{group: d3.selection, container: d3.selection, clipRect: d3.selection}}\n */\n this.svg = {};\n\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n if (typeof parent != \"undefined\" && parent instanceof LocusZoom.Panel){ this.parent_plot = parent.parent; }\n\n /** @member {Object} */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.DataLayer.DefaultLayout);\n if (this.layout.id){ this.id = this.layout.id; }\n\n // Ensure any axes defined in the layout have an explicit axis number (default: 1)\n if (this.layout.x_axis !== {} && typeof this.layout.x_axis.axis !== \"number\"){ this.layout.x_axis.axis = 1; }\n if (this.layout.y_axis !== {} && typeof this.layout.y_axis.axis !== \"number\"){ this.layout.y_axis.axis = 1; }\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original data layer state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n /** @member {Object} */\n this.state = {};\n /** @member {String} */\n this.state_id = null;\n\n this.setDefaultState();\n\n // Initialize parameters for storing data and tool tips\n /** @member {Array} */\n this.data = [];\n if (this.layout.tooltip){\n /** @member {Object} */\n this.tooltips = {};\n }\n\n // Initialize flags for tracking global statuses\n this.global_statuses = {\n \"highlighted\": false,\n \"selected\": false,\n \"faded\": false,\n \"hidden\": false\n };\n \n return this;\n\n};\n\n/**\n * Instruct this datalayer to begin tracking additional fields from data sources (does not guarantee that such a field actually exists)\n *\n * Custom plots can use this to dynamically extend datalayer functionality after the plot is drawn\n *\n * (since removing core fields may break layer functionality, there is presently no hook for the inverse behavior)\n * @param fieldName\n * @param namespace\n * @param {String|String[]} transformations The name (or array of names) of transformations to apply to this field\n * @returns {String} The raw string added to the fields array\n */\nLocusZoom.DataLayer.prototype.addField = function(fieldName, namespace, transformations) {\n if (!fieldName || !namespace) {\n throw \"Must specify field name and namespace to use when adding field\";\n }\n var fieldString = namespace + \":\" + fieldName;\n if (transformations) {\n fieldString += \"|\";\n if (typeof transformations === \"string\") {\n fieldString += transformations;\n } else if (Array.isArray(transformations)) {\n fieldString += transformations.join(\"|\");\n } else {\n throw \"Must provide transformations as either a string or array of strings\";\n }\n }\n var fields = this.layout.fields;\n if (fields.indexOf(fieldString) === -1) {\n fields.push(fieldString);\n }\n return fieldString;\n};\n\n/**\n * Define default state that should get tracked during the lifetime of this layer.\n *\n * In some special custom usages, it may be useful to completely reset a panel (eg \"click for\n * genome region\" links), plotting new data that invalidates any previously tracked state. This hook makes it\n * possible to reset without destroying the panel entirely. It is used by `Plot.clearPanelData`.\n */\nLocusZoom.DataLayer.prototype.setDefaultState = function() {\n // Define state parameters specific to this data layer. Within plot state, this will live under a key\n // `panel_name.layer_name`.\n if (this.parent){\n this.state = this.parent.state;\n this.state_id = this.parent.id + \".\" + this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n this.state[this.state_id][status] = this.state[this.state_id][status] || [];\n }.bind(this));\n }\n};\n\n/**\n * A basic description of keys expected in a layout. Not intended to be directly used or modified by an end user.\n * @protected\n * @type {{type: string, fields: Array, x_axis: {}, y_axis: {}}}\n */\nLocusZoom.DataLayer.DefaultLayout = {\n type: \"\",\n fields: [],\n x_axis: {},\n y_axis: {}\n};\n\n/**\n * Available statuses that individual elements can have. Each status is described by\n * a verb/antiverb and an adjective. Verbs and antiverbs are used to generate data layer\n * methods for updating the status on one or more elements. Adjectives are used in class\n * names and applied or removed from elements to have a visual representation of the status,\n * as well as used as keys in the state for tracking which elements are in which status(es)\n * @static\n * @type {{verbs: String[], adjectives: String[], menu_antiverbs: String[]}}\n */\nLocusZoom.DataLayer.Statuses = {\n verbs: [\"highlight\", \"select\", \"fade\", \"hide\"],\n adjectives: [\"highlighted\", \"selected\", \"faded\", \"hidden\"],\n menu_antiverbs: [\"unhighlight\", \"deselect\", \"unfade\", \"show\"]\n};\n\n/**\n * Get the fully qualified identifier for the data layer, prefixed by any parent or container elements\n *\n * @returns {string} A dot-delimited string of the format ..\n */\nLocusZoom.DataLayer.prototype.getBaseId = function(){\n return this.parent_plot.id + \".\" + this.parent.id + \".\" + this.id;\n};\n\n/**\n * Determine the pixel height of data-bound objects represented inside this data layer. (excluding elements such as axes)\n *\n * May be used by operations that resize the data layer to fit available data\n *\n * @public\n * @returns {number}\n */\nLocusZoom.DataLayer.prototype.getAbsoluteDataHeight = function(){\n var dataBCR = this.svg.group.node().getBoundingClientRect();\n return dataBCR.height;\n};\n\n/**\n * Whether transitions can be applied to this data layer\n * @returns {boolean}\n */\nLocusZoom.DataLayer.prototype.canTransition = function(){\n if (!this.layout.transition){ return false; }\n return !(this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.panel_id);\n};\n\n/**\n * Fetch the fully qualified ID to be associated with a specific visual element, based on the data to which that\n * element is bound. In general this element ID will be unique, allowing it to be addressed directly via selectors.\n * @param {String|Object} element\n * @returns {String}\n */\nLocusZoom.DataLayer.prototype.getElementId = function(element){\n var element_id = \"element\";\n if (typeof element == \"string\"){\n element_id = element;\n } else if (typeof element == \"object\"){\n var id_field = this.layout.id_field || \"id\";\n if (typeof element[id_field] == \"undefined\"){\n throw(\"Unable to generate element ID\");\n }\n element_id = element[id_field].toString().replace(/\\W/g,\"\");\n }\n return (this.getBaseId() + \"-\" + element_id).replace(/(:|\\.|\\[|\\]|,)/g, \"_\");\n};\n\n/**\n * Fetch an ID that may bind a data element to a separate visual node for displaying status\n * Examples of this might be seperate visual nodes to show select/highlight statuses, or\n * even a common/shared node to show status across many elements in a set.\n * Abstract method. It should be overridden by data layers that implement seperate status\n * nodes specifically to the use case of the data layer type.\n * @param {String|Object} element\n * @returns {String|null}\n */\nLocusZoom.DataLayer.prototype.getElementStatusNodeId = function(element){\n return null;\n};\n\n/**\n * Returns a reference to the underlying data associated with a single visual element in the data layer, as\n * referenced by the unique identifier for the element\n\n * @param {String} id The unique identifier for the element, as defined by `getElementId`\n * @returns {Object|null} The data bound to that element\n */\nLocusZoom.DataLayer.prototype.getElementById = function(id){\n var selector = d3.select(\"#\" + id.replace(/(:|\\.|\\[|\\]|,)/g, \"\\\\$1\"));\n if (!selector.empty() && selector.data() && selector.data().length){\n return selector.data()[0];\n } else {\n return null;\n }\n};\n\n/**\n * Basic method to apply arbitrary methods and properties to data elements.\n * This is called on all data immediately after being fetched.\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyDataMethods = function(){\n this.data.forEach(function(d, i){\n // Basic toHTML() method - return the stringified value in the id_field, if defined.\n this.data[i].toHTML = function(){\n var id_field = this.layout.id_field || \"id\";\n var html = \"\";\n if (this.data[i][id_field]){ html = this.data[i][id_field].toString(); }\n return html;\n }.bind(this);\n // getDataLayer() method - return a reference to the data layer\n this.data[i].getDataLayer = function(){\n return this;\n }.bind(this);\n // deselect() method - shortcut method to deselect the element\n this.data[i].deselect = function(){\n var data_layer = this.getDataLayer();\n data_layer.unselectElement(this);\n };\n }.bind(this));\n this.applyCustomDataMethods();\n return this;\n};\n\n/**\n * Hook that allows custom datalayers to apply additional methods and properties to data elements as needed\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyCustomDataMethods = function(){\n return this;\n};\n\n/**\n * Initialize a data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.initialize = function(){\n\n // Append a container group element to house the main data layer group element and the clip path\n this.svg.container = this.parent.svg.group.append(\"g\")\n .attr(\"class\", \"lz-data_layer-container\")\n .attr(\"id\", this.getBaseId() + \".data_layer_container\");\n \n // Append clip path to the container element\n this.svg.clipRect = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\")\n .append(\"rect\");\n \n // Append svg group for rendering all data layer elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".data_layer\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n return this;\n\n};\n\n/**\n * Move a data layer up relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveUp = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Move a data layer down relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveDown = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Apply scaling functions to an element or parameter as needed, based on its layout and the element's data\n * If the layout parameter is already a primitive type, simply return the value as given\n * @param {Array|Number|String|Object} layout\n * @param {*} data The value to be used with the filter\n * @returns {*} The transformed value\n */\nLocusZoom.DataLayer.prototype.resolveScalableParameter = function(layout, data){\n var ret = null;\n if (Array.isArray(layout)){\n var idx = 0;\n while (ret === null && idx < layout.length){\n ret = this.resolveScalableParameter(layout[idx], data);\n idx++;\n }\n } else {\n switch (typeof layout){\n case \"number\":\n case \"string\":\n ret = layout;\n break;\n case \"object\":\n if (layout.scale_function){\n if(layout.field) {\n var f = new LocusZoom.Data.Field(layout.field);\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, f.resolve(data));\n } else {\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, data);\n }\n }\n break;\n }\n }\n return ret;\n};\n\n/**\n * Generate dimension extent function based on layout parameters\n * @param {('x'|'y')} dimension\n */\nLocusZoom.DataLayer.prototype.getAxisExtent = function(dimension){\n\n if ([\"x\", \"y\"].indexOf(dimension) === -1){\n throw(\"Invalid dimension identifier passed to LocusZoom.DataLayer.getAxisExtent()\");\n }\n\n var axis_name = dimension + \"_axis\";\n var axis_layout = this.layout[axis_name];\n\n // If a floor AND a ceiling are explicitly defined then just return that extent and be done\n if (!isNaN(axis_layout.floor) && !isNaN(axis_layout.ceiling)){\n return [+axis_layout.floor, +axis_layout.ceiling];\n }\n\n // If a field is defined for the axis and the data layer has data then generate the extent from the data set\n var data_extent = [];\n if (axis_layout.field && this.data) {\n if (!this.data.length) {\n // If data has been fetched (but no points in region), enforce the min_extent (with no buffers,\n // because we don't need padding around an empty screen)\n data_extent = axis_layout.min_extent || [];\n return data_extent;\n } else {\n data_extent = d3.extent(this.data, function (d) {\n var f = new LocusZoom.Data.Field(axis_layout.field);\n return +f.resolve(d);\n });\n\n // Apply upper/lower buffers, if applicable\n var original_extent_span = data_extent[1] - data_extent[0];\n if (!isNaN(axis_layout.lower_buffer)) {\n data_extent[0] -= original_extent_span * axis_layout.lower_buffer;\n }\n if (!isNaN(axis_layout.upper_buffer)) {\n data_extent[1] += original_extent_span * axis_layout.upper_buffer;\n }\n\n if (typeof axis_layout.min_extent == \"object\") {\n // The data should span at least the range specified by min_extent, an array with [low, high]\n var range_min = axis_layout.min_extent[0];\n var range_max = axis_layout.min_extent[1];\n if (!isNaN(range_min) && !isNaN(range_max)) {\n data_extent[0] = Math.min(data_extent[0], range_min);\n }\n if (!isNaN(range_max)) {\n data_extent[1] = Math.max(data_extent[1], range_max);\n }\n }\n // If specified, floor and ceiling will override the actual data range\n return [\n isNaN(axis_layout.floor) ? data_extent[0] : axis_layout.floor,\n isNaN(axis_layout.ceiling) ? data_extent[1] : axis_layout.ceiling\n ];\n }\n }\n\n // If this is for the x axis and no extent could be generated yet but state has a defined start and end\n // then default to using the state-defined region as the extent\n if (dimension === \"x\" && !isNaN(this.state.start) && !isNaN(this.state.end)) {\n return [this.state.start, this.state.end];\n }\n\n // No conditions met for generating a valid extent, return an empty array\n return [];\n\n};\n\n/**\n * Allow this data layer to tell the panel what axis ticks it thinks it will require. The panel may choose whether\n * to use some, all, or none of these when rendering, either alone or in conjunction with other data layers.\n *\n * This method is a stub and should be overridden in data layers that need to specify custom behavior.\n *\n * @param {('x'|'y')} dimension\n * @param {Object} [config] Additional parameters for the panel to specify how it wants ticks to be drawn. The names\n * and meanings of these parameters may vary between different data layers.\n * @returns {Object[]}\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.DataLayer.prototype.getTicks = function (dimension, config) {\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw(\"Invalid dimension identifier\");\n }\n return [];\n};\n\n/**\n * Generate a tool tip for a given element\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.createTooltip = function(d, id){\n if (typeof this.layout.tooltip != \"object\"){\n throw (\"DataLayer [\" + this.id + \"] layout does not define a tooltip\");\n }\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n if (this.tooltips[id]){\n this.positionTooltip(id);\n return;\n }\n this.tooltips[id] = {\n data: d,\n arrow: null,\n selector: d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-data_layer-tooltip\")\n .attr(\"id\", id + \"-tooltip\")\n };\n this.updateTooltip(d);\n return this;\n};\n\n/**\n * Update a tool tip (generate its inner HTML)\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.updateTooltip = function(d, id){\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n // Empty the tooltip of all HTML (including its arrow!)\n this.tooltips[id].selector.html(\"\");\n this.tooltips[id].arrow = null;\n // Set the new HTML\n if (this.layout.tooltip.html){\n this.tooltips[id].selector.html(LocusZoom.parseFields(d, this.layout.tooltip.html));\n }\n // If the layout allows tool tips on this data layer to be closable then add the close button\n // and add padding to the tooltip to accommodate it\n if (this.layout.tooltip.closable){\n this.tooltips[id].selector.insert(\"button\", \":first-child\")\n .attr(\"class\", \"lz-tooltip-close-button\")\n .attr(\"title\", \"Close\")\n .text(\"×\")\n .on(\"click\", function(){\n this.destroyTooltip(id);\n }.bind(this));\n }\n // Apply data directly to the tool tip for easier retrieval by custom UI elements inside the tool tip\n this.tooltips[id].selector.data([d]);\n // Reposition and draw a new arrow\n this.positionTooltip(id);\n return this;\n};\n\n/**\n * Destroy tool tip - remove the tool tip element from the DOM and delete the tool tip's record on the data layer\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyTooltip = function(d, id){\n if (typeof d == \"string\"){\n id = d;\n } else if (typeof id == \"undefined\"){\n id = this.getElementId(d);\n }\n if (this.tooltips[id]){\n if (typeof this.tooltips[id].selector == \"object\"){\n this.tooltips[id].selector.remove();\n }\n delete this.tooltips[id];\n }\n return this;\n};\n\n/**\n * Loop through and destroy all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyAllTooltips = function(){\n for (var id in this.tooltips){\n this.destroyTooltip(id);\n }\n return this;\n};\n\n//\n/**\n * Position tool tip - naïve function to place a tool tip to the lower right of the current mouse element\n * Most data layers reimplement this method to position tool tips specifically for the data they display\n * @param {String} id The identifier of the tooltip to position\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n // Position the div itself\n this.tooltips[id].selector\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY) + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!this.tooltips[id].arrow){\n this.tooltips[id].arrow = this.tooltips[id].selector.append(\"div\")\n .style(\"position\", \"absolute\")\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_top_left\");\n }\n this.tooltips[id].arrow\n .style(\"left\", \"-1px\")\n .style(\"top\", \"-1px\");\n return this;\n};\n\n/**\n * Loop through and position all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionAllTooltips = function(){\n for (var id in this.tooltips){\n this.positionTooltip(id);\n }\n return this;\n};\n\n/**\n * Show or hide a tool tip by ID depending on directives in the layout and state values relative to the ID\n * @param {String|Object} element The element associated with the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.showOrHideTooltip = function(element){\n \n if (typeof this.layout.tooltip != \"object\"){ return; }\n var id = this.getElementId(element);\n\n var resolveStatus = function(statuses, directive, operator){\n var status = null;\n if (typeof statuses != \"object\" || statuses === null){ return null; }\n if (Array.isArray(directive)){\n if (typeof operator == \"undefined\"){ operator = \"and\"; }\n if (directive.length === 1){\n status = statuses[directive[0]];\n } else {\n status = directive.reduce(function(previousValue, currentValue) {\n if (operator === \"and\"){\n return statuses[previousValue] && statuses[currentValue];\n } else if (operator === \"or\"){\n return statuses[previousValue] || statuses[currentValue];\n }\n return null;\n });\n }\n } else if (typeof directive == \"object\"){\n var sub_status;\n for (var sub_operator in directive){\n sub_status = resolveStatus(statuses, directive[sub_operator], sub_operator);\n if (status === null){\n status = sub_status;\n } else if (operator === \"and\"){\n status = status && sub_status;\n } else if (operator === \"or\"){\n status = status || sub_status;\n }\n }\n }\n return status;\n };\n\n var show_directive = {};\n if (typeof this.layout.tooltip.show == \"string\"){\n show_directive = { and: [ this.layout.tooltip.show ] };\n } else if (typeof this.layout.tooltip.show == \"object\"){\n show_directive = this.layout.tooltip.show;\n }\n\n var hide_directive = {};\n if (typeof this.layout.tooltip.hide == \"string\"){\n hide_directive = { and: [ this.layout.tooltip.hide ] };\n } else if (typeof this.layout.tooltip.hide == \"object\"){\n hide_directive = this.layout.tooltip.hide;\n }\n\n var statuses = {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n var antistatus = \"un\" + status;\n statuses[status] = this.state[this.state_id][status].indexOf(id) !== -1;\n statuses[antistatus] = !statuses[status];\n }.bind(this));\n\n var show_resolved = resolveStatus(statuses, show_directive);\n var hide_resolved = resolveStatus(statuses, hide_directive);\n\n // Only show tooltip if the resolved logic explicitly shows and explicitly not hides the tool tip\n // Otherwise ensure tooltip does not exist\n if (show_resolved && !hide_resolved){\n this.createTooltip(element);\n } else {\n this.destroyTooltip(element);\n }\n\n return this;\n \n};\n\n/**\n * Find the elements (or indices) that match any of a set of provided filters\n * @protected\n * @param {Array[]} filters A list of filter entries: [field, value] (for equivalence testing) or\n * [field, operator, value] for other operators\n * @param {('indexes'|'elements')} [return_type='indexes'] Specify whether to return either the indices of the matching\n * elements, or references to the elements themselves\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filter = function(filters, return_type){\n if (typeof return_type == \"undefined\" || [\"indexes\",\"elements\"].indexOf(return_type) === -1){\n return_type = \"indexes\";\n }\n if (!Array.isArray(filters)){ return []; }\n var test = function(element, filter){\n var operators = {\n \"=\": function(a,b){ return a === b; },\n \"<\": function(a,b){ return a < b; },\n \"<=\": function(a,b){ return a <= b; },\n \">\": function(a,b){ return a > b; },\n \">=\": function(a,b){ return a >= b; },\n \"%\": function(a,b){ return a % b; }\n };\n if (!Array.isArray(filter)){ return false; }\n if (filter.length === 2){\n return element[filter[0]] === filter[1];\n } else if (filter.length === 3 && operators[filter[1]]){\n return operators[filter[1]](element[filter[0]], filter[2]);\n } else {\n return false;\n }\n };\n var matches = [];\n this.data.forEach(function(element, idx){\n var match = true;\n filters.forEach(function(filter){\n if (!test(element, filter)){ match = false; }\n });\n if (match){ matches.push(return_type === \"indexes\" ? idx : element); }\n });\n return matches;\n};\n\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterIndexes = function(filters){ return this.filter(filters, \"indexes\"); };\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterElements = function(filters){ return this.filter(filters, \"elements\"); };\n\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset a single element's status\n // TODO: Improve documentation for dynamically generated methods/properties\n LocusZoom.DataLayer.prototype[verb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, true, exclusive);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, false, exclusive);\n return this;\n };\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.DataLayer.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.DataLayer.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.DataLayer.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n/**\n * Toggle a status (e.g. highlighted, selected, identified) on an element\n * @param {String} status The name of a recognized status to be added/removed on an appropriate element\n * @param {String|Object} element The data bound to the element of interest\n * @param {Boolean} toggle True to add the status (and associated CSS styles); false to remove it\n * @param {Boolean} exclusive Whether to only allow a state for a single element at a time\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatus = function(status, element, toggle, exclusive){\n // Sanity checks\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatus()\");\n }\n if (typeof element == \"undefined\"){\n throw(\"Invalid element passed to DataLayer.setElementStatus()\");\n }\n if (typeof toggle == \"undefined\"){\n toggle = true;\n }\n\n // Get an ID for the element or return having changed nothing\n try {\n var element_id = this.getElementId(element);\n } catch (get_element_id_error){\n return this;\n }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Set/unset the proper status class on the appropriate DOM element(s)\n d3.select(\"#\" + element_id).classed(\"lz-data_layer-\" + this.layout.type + \"-\" + status, toggle);\n var element_status_node_id = this.getElementStatusNodeId(element);\n if (element_status_node_id !== null){\n d3.select(\"#\" + element_status_node_id).classed(\"lz-data_layer-\" + this.layout.type + \"-statusnode-\" + status, toggle);\n }\n \n // Track element ID in the proper status state array\n var element_status_idx = this.state[this.state_id][status].indexOf(element_id);\n if (toggle && element_status_idx === -1){\n this.state[this.state_id][status].push(element_id);\n }\n if (!toggle && element_status_idx !== -1){\n this.state[this.state_id][status].splice(element_status_idx, 1);\n }\n \n // Trigger tool tip show/hide logic\n this.showOrHideTooltip(element);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n if (status === \"selected\") {\n // Notify parents that a given element has been interacted with. For now, we will only notify on\n // \"selected\" type events, which is (usually) a toggle-able state. If elements are exclusive, two selection\n // events will be sent in short order as the previously selected element has to be de-selected first\n this.parent.emit(\"element_selection\", { element: element, active: toggle }, true);\n }\n return this;\n \n};\n\n/**\n * Toggle a status on elements in the data layer based on a set of filters\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatusByFilters()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; } else { toggle = !!toggle; }\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n if (!Array.isArray(filters)){ filters = []; }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Apply statuses\n this.filterElements(filters).forEach(function(element){\n this.setElementStatus(status, element, toggle);\n }.bind(this));\n \n return this;\n};\n\n/**\n * Toggle a status on all elements in the data layer\n * @param {String} status\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setAllElementStatus = function(status, toggle){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Apply statuses\n if (toggle){\n this.data.forEach(function(element){\n this.setElementStatus(status, element, true);\n }.bind(this));\n } else {\n var status_ids = this.state[this.state_id][status].slice();\n status_ids.forEach(function(id){\n var element = this.getElementById(id);\n if (typeof element == \"object\" && element !== null){\n this.setElementStatus(status, element, false);\n }\n }.bind(this));\n this.state[this.state_id][status] = [];\n }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n return this;\n};\n\n/**\n * Apply all layout-defined behaviors (DOM event handlers) to a selection of elements\n * @param {d3.selection} selection\n */\nLocusZoom.DataLayer.prototype.applyBehaviors = function(selection){\n if (typeof this.layout.behaviors != \"object\"){ return; }\n Object.keys(this.layout.behaviors).forEach(function(directive){\n var event_match = /(click|mouseover|mouseout)/.exec(directive);\n if (!event_match){ return; }\n selection.on(event_match[0] + \".\" + directive, this.executeBehaviors(directive, this.layout.behaviors[directive]));\n }.bind(this));\n};\n\n/**\n * Generate a function that executes an arbitrary list of behaviors on an element during an event\n * @param {String} directive The name of the event, as described in layout.behaviors for this datalayer\n * @param {Object} behaviors An object describing the behavior to attach to this single element\n * @param {string} behaviors.action The name of the action that would trigger this behavior (eg click, mouseover, etc)\n * @param {string} behaviors.status What status to apply to the element when this behavior is triggered (highlighted,\n * selected, etc)\n * @param {string} [behaviors.exclusive] Whether triggering the event for this element should unset the relevant status\n * for all other elements. Useful for, eg, click events that exclusively highlight one thing.\n * @returns {function(this:LocusZoom.DataLayer)} Return a function that handles the event in context with the behavior\n * and the element- can be attached as an event listener\n */\nLocusZoom.DataLayer.prototype.executeBehaviors = function(directive, behaviors) {\n\n // Determine the required state of control and shift keys during the event\n var requiredKeyStates = {\n \"ctrl\": (directive.indexOf(\"ctrl\") !== -1),\n \"shift\": (directive.indexOf(\"shift\") !== -1)\n };\n\n return function(element){\n\n // Do nothing if the required control and shift key presses (or lack thereof) doesn't match the event\n if (requiredKeyStates.ctrl !== !!d3.event.ctrlKey || requiredKeyStates.shift !== !!d3.event.shiftKey){ return; }\n\n // Loop through behaviors making each one go in succession\n behaviors.forEach(function(behavior){\n \n // Route first by the action, if defined\n if (typeof behavior != \"object\" || behavior === null){ return; }\n \n switch (behavior.action){\n \n // Set a status (set to true regardless of current status, optionally with exclusivity)\n case \"set\":\n this.setElementStatus(behavior.status, element, true, behavior.exclusive);\n break;\n \n // Unset a status (set to false regardless of current status, optionally with exclusivity)\n case \"unset\":\n this.setElementStatus(behavior.status, element, false, behavior.exclusive);\n break;\n \n // Toggle a status\n case \"toggle\":\n var current_status_boolean = (this.state[this.state_id][behavior.status].indexOf(this.getElementId(element)) !== -1);\n var exclusive = behavior.exclusive && !current_status_boolean;\n this.setElementStatus(behavior.status, element, !current_status_boolean, exclusive);\n break;\n \n // Link to a dynamic URL\n case \"link\":\n if (typeof behavior.href == \"string\"){\n var url = LocusZoom.parseFields(element, behavior.href);\n if (typeof behavior.target == \"string\"){\n window.open(url, behavior.target);\n } else {\n window.location.href = url;\n }\n }\n break;\n \n // Action not defined, just return\n default:\n break;\n \n }\n \n return;\n \n }.bind(this));\n\n }.bind(this);\n\n};\n\n/**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\nLocusZoom.DataLayer.prototype.getPageOrigin = function(){\n var panel_origin = this.parent.getPageOrigin();\n return {\n x: panel_origin.x + this.parent.layout.margin.left,\n y: panel_origin.y + this.parent.layout.margin.top\n };\n};\n\n/**\n * Get a data layer's current underlying data in a standard format (e.g. JSON or CSV)\n * @param {('csv'|'tsv'|'json')} format How to export the data\n * @returns {*}\n */\nLocusZoom.DataLayer.prototype.exportData = function(format){\n var default_format = \"json\";\n format = format || default_format;\n format = (typeof format == \"string\" ? format.toLowerCase() : default_format);\n if ([\"json\",\"csv\",\"tsv\"].indexOf(format) === -1){ format = default_format; }\n var ret;\n switch (format){\n case \"json\":\n try {\n ret = JSON.stringify(this.data);\n } catch (e){\n ret = null;\n console.error(\"Unable to export JSON data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n case \"tsv\":\n case \"csv\":\n try {\n var jsonified = JSON.parse(JSON.stringify(this.data));\n if (typeof jsonified != \"object\"){\n ret = jsonified.toString();\n } else if (!Array.isArray(jsonified)){\n ret = \"Object\";\n } else {\n var delimiter = (format === \"tsv\") ? \"\\t\" : \",\";\n var header = this.layout.fields.map(function(header){\n return JSON.stringify(header);\n }).join(delimiter) + \"\\n\";\n ret = header + jsonified.map(function(record){\n return this.layout.fields.map(function(field){\n if (typeof record[field] == \"undefined\"){\n return JSON.stringify(null);\n } else if (typeof record[field] == \"object\" && record[field] !== null){\n return Array.isArray(record[field]) ? \"\\\"[Array(\" + record[field].length + \")]\\\"\" : \"\\\"[Object]\\\"\";\n } else {\n return JSON.stringify(record[field]);\n }\n }).join(delimiter);\n }.bind(this)).join(\"\\n\");\n }\n } catch (e){\n ret = null;\n console.error(\"Unable to export CSV data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n }\n return ret;\n};\n\n/**\n * Position the datalayer and all tooltips\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.draw = function(){\n this.svg.container.attr(\"transform\", \"translate(\" + this.parent.layout.cliparea.origin.x + \",\" + this.parent.layout.cliparea.origin.y + \")\");\n this.svg.clipRect\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.parent.layout.cliparea.height);\n this.positionAllTooltips();\n return this;\n};\n\n\n/**\n * Re-Map a data layer to reflect changes in the state of a plot (such as viewing region/ chromosome range)\n * @return {Promise}\n */\nLocusZoom.DataLayer.prototype.reMap = function(){\n\n this.destroyAllTooltips(); // hack - only non-visible tooltips should be destroyed\n // and then recreated if returning to visibility\n\n // Fetch new data. Datalayers are only given access to the final consolidated data from the chain (not headers or raw payloads)\n var promise = this.parent_plot.lzd.getData(this.state, this.layout.fields);\n promise.then(function(new_data) {\n this.data = new_data.body;\n this.applyDataMethods();\n this.initialized = true;\n }.bind(this));\n\n return promise;\n};\n\n\n/**\n * The central registry of known data layer definitions (which may be stored in separate files due to length)\n * @namespace\n */\nLocusZoom.DataLayers = (function() {\n var obj = {};\n var datalayers = {};\n /**\n * @name LocusZoom.DataLayers.get\n * @param {String} name The name of the datalayer\n * @param {Object} layout The configuration object for this data layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n * @returns {LocusZoom.DataLayer}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (datalayers[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for data layer [\" + name + \"]\");\n } else {\n return new datalayers[name](layout, parent);\n }\n } else {\n throw(\"data layer [\" + name + \"] not found\");\n }\n };\n\n /**\n * @name LocusZoom.DataLayers.set\n * @protected\n * @param {String} name\n * @param {Function} datalayer Constructor for the datalayer\n */\n obj.set = function(name, datalayer) {\n if (datalayer) {\n if (typeof datalayer != \"function\"){\n throw(\"unable to set data layer [\" + name + \"], argument provided is not a function\");\n } else {\n datalayers[name] = datalayer;\n datalayers[name].prototype = new LocusZoom.DataLayer();\n }\n } else {\n delete datalayers[name];\n }\n };\n\n /**\n * Add a new type of datalayer to the registry of known layer types\n * @name LocusZoom.DataLayers.add\n * @param {String} name The name of the data layer to register\n * @param {Function} datalayer\n */\n obj.add = function(name, datalayer) {\n if (datalayers[name]) {\n throw(\"data layer already exists with name: \" + name);\n } else {\n obj.set(name, datalayer);\n }\n };\n\n /**\n * Register a new datalayer that inherits and extends basic behaviors from a known datalayer\n * @param {String} parent_name The name of the parent data layer whose behavior is to be extended\n * @param {String} name The name of the new datalayer to register\n * @param {Object} [overrides] Object of properties and methods to combine with the prototype of the parent datalayer\n * @returns {Function} The constructor for the new child class\n */\n obj.extend = function(parent_name, name, overrides) {\n // TODO: Consider exposing additional constructor argument, if there is a use case for very granular extension\n overrides = overrides || {};\n\n var parent = datalayers[parent_name];\n if (!parent) {\n throw \"Attempted to subclass an unknown or unregistered datalayer type\";\n }\n if (typeof overrides !== \"object\") {\n throw \"Must specify an object of properties and methods\";\n }\n var child = LocusZoom.subclass(parent, overrides);\n // Bypass .set() because we want a layer of inheritance below `DataLayer`\n datalayers[name] = child;\n return child;\n };\n\n /**\n * List the names of all known datalayers\n * @name LocusZoom.DataLayers.list\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(datalayers);\n };\n\n return obj;\n})();\n","\"use strict\";\n\n/**\n * Create a single continuous 2D track that provides information about each datapoint\n *\n * For example, this can be used to color by membership in a group, alongside information in other panels\n *\n * @class LocusZoom.DataLayers.annotation_track\n * @augments LocusZoom.DataLayer\n * @param {Object} layout\n * @param {Object|String} [layout.color]\n * @param {Array[]} An array of filter entries specifying which points to draw annotations for.\n * See `LocusZoom.DataLayer.filter` for details\n */\nLocusZoom.DataLayers.add(\"annotation_track\", function(layout) {\n // In the future we may add additional options for controlling marker size/ shape, based on user feedback\n this.DefaultLayout = {\n color: \"#000000\",\n filters: []\n };\n\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n if (!Array.isArray(layout.filters)) {\n throw \"Annotation track must specify array of filters for selecting points to annotate\";\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n this.render = function() {\n var self = this;\n // Only render points that currently satisfy all provided filter conditions.\n var trackData = this.filter(this.layout.filters, \"elements\");\n\n var selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-\" + self.layout.type)\n .data(trackData, function(d) { return d[self.layout.id_field]; });\n\n // Add new elements as needed\n selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function (d){ return self.getElementId(d); });\n // Update the set of elements to reflect new data\n selection\n .attr(\"x\", function (d) { return self.parent[\"x_scale\"](d[self.layout.x_axis.field]); })\n .attr(\"width\", 1) // TODO autocalc width of track? Based on datarange / pixel width presumably\n .attr(\"height\", self.parent.layout.height)\n .attr(\"fill\", function(d){ return self.resolveScalableParameter(self.layout.color, d); });\n // Remove unused elements\n selection.exit().remove();\n\n // Set up tooltips and mouse interaction\n this.applyBehaviors(selection);\n };\n\n // Reimplement the positionTooltip() method to be annotation-specific\n this.positionTooltip = function(id) {\n if (typeof id != \"string\") {\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]) {\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var offset = stroke_width / 2;\n var page_origin = this.getPageOrigin();\n\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_center = data_layer_height / 2;\n\n // Tooltip should be horizontally centered above the point to be annotated. (or below if space is limited)\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width) + offset_left - offset_right - offset;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - y_center) {\n top = page_origin.y + y_center - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow) {\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n return this;\n});\n","\"use strict\";\n\n/*********************\n Forest Data Layer\n Implements a standard forest plot\n*/\n\nLocusZoom.DataLayers.add(\"forest\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"square\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 2\n },\n id_field: \"id\",\n confidence_intervals: {\n start_field: \"ci_start\",\n end_field: \"ci_end\"\n },\n show_no_significance_line: true\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be forest-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n var offset = Math.sqrt(point_size / Math.PI);\n var left, arrow_type, arrow_left;\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var top, arrow_top;\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n } \n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Implement the main render function\n this.render = function(){\n\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate confidence interval paths if fields are defined\n if (this.layout.confidence_intervals\n && this.layout.fields.indexOf(this.layout.confidence_intervals.start_field) !== -1\n && this.layout.fields.indexOf(this.layout.confidence_intervals.end_field) !== -1){\n // Generate a selection for all forest plot confidence intervals\n var ci_selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-forest.lz-data_layer-forest-ci\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n // Create confidence interval rect elements\n ci_selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-ci\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_ci\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + (isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height) + \")\");\n // Apply position and size parameters using transition if necessary\n var ci_transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n var ci_width = function(d){\n return this.parent[x_scale](d[this.layout.confidence_intervals.end_field])\n - this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n }.bind(this);\n var ci_height = 1;\n if (this.canTransition()){\n ci_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n } else {\n ci_selection\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n }\n // Remove old elements as needed\n ci_selection.exit().remove();\n }\n \n // Generate a selection for all forest plot points\n var points_selection = this.svg.group\n .selectAll(\"path.lz-data_layer-forest.lz-data_layer-forest-point\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n points_selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-point\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_point\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n if (this.canTransition()){\n points_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n points_selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n points_selection.exit().remove();\n\n // Apply default event emitters to selection\n points_selection.on(\"click.event_emitter\", function(element_data){\n this.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n \n // Apply behaviors to points\n this.applyBehaviors(points_selection);\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Genes Data Layer\n * Implements a data layer that will render gene tracks\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"genes\", function(layout){\n /**\n * Define a default layout for this DataLayer type and merge it with the passed argument\n * @protected\n * @member {Object}\n * */\n this.DefaultLayout = {\n // Optionally specify different fill and stroke properties\n stroke: \"rgb(54, 54, 150)\",\n color: \"#363696\",\n label_font_size: 12,\n label_exon_spacing: 4,\n exon_height: 16,\n bounding_box_padding: 6,\n track_vertical_spacing: 10\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Generate a statusnode ID for a given element\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n return this.getElementId(element) + \"-statusnode\";\n };\n\n /**\n * Helper function to sum layout values to derive total height for a single gene track\n * @returns {number}\n */\n this.getTrackHeight = function(){\n return 2 * this.layout.bounding_box_padding\n + this.layout.label_font_size\n + this.layout.label_exon_spacing\n + this.layout.exon_height\n + this.layout.track_vertical_spacing;\n };\n\n /**\n * A gene may have arbitrarily many transcripts, but this data layer isn't set up to render them yet.\n * Stash a transcript_idx to point to the first transcript and use that for all transcript refs.\n * @member {number}\n * @type {number}\n */\n this.transcript_idx = 0;\n\n /**\n * An internal counter for the number of tracks in the data layer. Used as an internal counter for looping\n * over positions / assignments\n * @protected\n * @member {number}\n */\n this.tracks = 1;\n\n /**\n * Store information about genes in dataset, in a hash indexed by track number: {track_number: [gene_indices]}\n * @member {Object.}\n */\n this.gene_track_index = { 1: [] };\n\n /**\n * Ensure that genes in overlapping chromosome regions are positioned so that parts of different genes do not\n * overlap in the view. A track is a row used to vertically separate overlapping genes.\n * @returns {LocusZoom.DataLayer}\n */\n this.assignTracks = function(){\n /**\n * Function to get the width in pixels of a label given the text and layout attributes\n * TODO: Move to outer scope?\n * @param {String} gene_name\n * @param {number|string} font_size\n * @returns {number}\n */\n this.getLabelWidth = function(gene_name, font_size){\n try {\n var temp_text = this.svg.group.append(\"text\")\n .attr(\"x\", 0).attr(\"y\", 0).attr(\"class\", \"lz-data_layer-genes lz-label\")\n .style(\"font-size\", font_size)\n .text(gene_name + \"→\");\n var label_width = temp_text.node().getBBox().width;\n temp_text.remove();\n return label_width;\n } catch (e){\n return 0;\n }\n };\n\n // Reinitialize some metadata\n this.tracks = 1;\n this.gene_track_index = { 1: [] };\n\n this.data.map(function(d, g){\n\n // If necessary, split combined gene id / version fields into discrete fields.\n // NOTE: this may be an issue with CSG's genes data source that may eventually be solved upstream.\n if (this.data[g].gene_id && this.data[g].gene_id.indexOf(\".\")){\n var split = this.data[g].gene_id.split(\".\");\n this.data[g].gene_id = split[0];\n this.data[g].gene_version = split[1];\n }\n\n // Stash the transcript ID on the parent gene\n this.data[g].transcript_id = this.data[g].transcripts[this.transcript_idx].transcript_id;\n\n // Determine display range start and end, based on minimum allowable gene display width, bounded by what we can see\n // (range: values in terms of pixels on the screen)\n this.data[g].display_range = {\n start: this.parent.x_scale(Math.max(d.start, this.state.start)),\n end: this.parent.x_scale(Math.min(d.end, this.state.end))\n };\n this.data[g].display_range.label_width = this.getLabelWidth(this.data[g].gene_name, this.layout.label_font_size);\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n // Determine label text anchor (default to middle)\n this.data[g].display_range.text_anchor = \"middle\";\n if (this.data[g].display_range.width < this.data[g].display_range.label_width){\n if (d.start < this.state.start){\n this.data[g].display_range.end = this.data[g].display_range.start\n + this.data[g].display_range.label_width\n + this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"start\";\n } else if (d.end > this.state.end){\n this.data[g].display_range.start = this.data[g].display_range.end\n - this.data[g].display_range.label_width\n - this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n var centered_margin = ((this.data[g].display_range.label_width - this.data[g].display_range.width) / 2)\n + this.layout.label_font_size;\n if ((this.data[g].display_range.start - centered_margin) < this.parent.x_scale(this.state.start)){\n this.data[g].display_range.start = this.parent.x_scale(this.state.start);\n this.data[g].display_range.end = this.data[g].display_range.start + this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"start\";\n } else if ((this.data[g].display_range.end + centered_margin) > this.parent.x_scale(this.state.end)) {\n this.data[g].display_range.end = this.parent.x_scale(this.state.end);\n this.data[g].display_range.start = this.data[g].display_range.end - this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n this.data[g].display_range.start -= centered_margin;\n this.data[g].display_range.end += centered_margin;\n }\n }\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n }\n // Add bounding box padding to the calculated display range start, end, and width\n this.data[g].display_range.start -= this.layout.bounding_box_padding;\n this.data[g].display_range.end += this.layout.bounding_box_padding;\n this.data[g].display_range.width += 2 * this.layout.bounding_box_padding;\n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[g].display_domain = {\n start: this.parent.x_scale.invert(this.data[g].display_range.start),\n end: this.parent.x_scale.invert(this.data[g].display_range.end)\n };\n this.data[g].display_domain.width = this.data[g].display_domain.end - this.data[g].display_domain.start;\n\n // Using display range/domain data generated above cast each gene to tracks such that none overlap\n this.data[g].track = null;\n var potential_track = 1;\n while (this.data[g].track === null){\n var collision_on_potential_track = false;\n this.gene_track_index[potential_track].map(function(placed_gene){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_gene.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_gene.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_gene.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[g]));\n if (!collision_on_potential_track){\n this.data[g].track = potential_track;\n this.gene_track_index[potential_track].push(this.data[g]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.gene_track_index[potential_track] = [];\n }\n }\n }\n\n // Stash parent references on all genes, trascripts, and exons\n this.data[g].parent = this;\n this.data[g].transcripts.map(function(d, t){\n this.data[g].transcripts[t].parent = this.data[g];\n this.data[g].transcripts[t].exons.map(function(d, e){\n this.data[g].transcripts[t].exons[e].parent = this.data[g].transcripts[t];\n }.bind(this));\n }.bind(this));\n\n }.bind(this));\n return this;\n };\n\n /**\n * Main render function\n */\n this.render = function(){\n\n var self = this;\n this.assignTracks();\n\n var width, height, x, y;\n\n // Render gene groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-genes\")\n .data(this.data, function(d){ return d.gene_name; });\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-genes\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(gene){\n\n var data_layer = gene.parent;\n\n // Render gene bounding boxes (status nodes to show selected/highlighted)\n var bboxes = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-data_layer-genes-statusnode\")\n .data([gene], function(d){ return data_layer.getElementStatusNodeId(d); });\n\n bboxes.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-data_layer-genes-statusnode\");\n \n bboxes\n .attr(\"id\", function(d){\n return data_layer.getElementStatusNodeId(d);\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n bboxes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n bboxes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n bboxes.exit().remove();\n\n // Render gene boundaries\n var boundary_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d); };\n var boundary_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d); };\n var boundaries = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-boundary\")\n .data([gene], function(d){ return d.gene_name + \"_boundary\"; })\n .style({ fill: boundary_fill, stroke: boundary_stroke });\n\n boundaries.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-boundary\");\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return 1; // TODO: scale dynamically?\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing\n + (Math.max(data_layer.layout.exon_height, 3) / 2);\n };\n if (data_layer.canTransition()){\n boundaries\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n boundaries\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n \n boundaries.exit().remove();\n\n // Render gene labels\n var labels = d3.select(this).selectAll(\"text.lz-data_layer-genes.lz-label\")\n .data([gene], function(d){ return d.gene_name + \"_label\"; });\n\n labels.enter().append(\"text\")\n .attr(\"class\", \"lz-data_layer-genes lz-label\");\n\n labels\n .attr(\"text-anchor\", function(d){\n return d.display_range.text_anchor;\n })\n .text(function(d){\n return (d.strand === \"+\") ? d.gene_name + \"→\" : \"←\" + d.gene_name;\n })\n .style(\"font-size\", gene.parent.layout.label_font_size);\n\n x = function(d){\n if (d.display_range.text_anchor === \"middle\"){\n return d.display_range.start + (d.display_range.width / 2);\n } else if (d.display_range.text_anchor === \"start\"){\n return d.display_range.start + data_layer.layout.bounding_box_padding;\n } else if (d.display_range.text_anchor === \"end\"){\n return d.display_range.end - data_layer.layout.bounding_box_padding;\n }\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size;\n };\n if (data_layer.canTransition()){\n labels\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"x\", x).attr(\"y\", y);\n } else {\n labels\n .attr(\"x\", x).attr(\"y\", y);\n }\n\n labels.exit().remove();\n\n // Render exon rects (first transcript only, for now)\n // Exons: by default color on gene properties for consistency with the gene boundary track- hence color uses d.parent.parent\n var exon_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d.parent.parent); };\n var exon_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d.parent.parent); };\n\n var exons = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-exon\")\n .data(gene.transcripts[gene.parent.transcript_idx].exons, function(d){ return d.exon_id; });\n\n exons.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-exon\");\n\n exons\n .style({ fill: exon_fill, stroke: exon_stroke });\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return data_layer.layout.exon_height;\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(){\n return ((gene.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing;\n };\n if (data_layer.canTransition()){\n exons\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n exons\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n exons.exit().remove();\n\n // Render gene click area\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-clickarea\")\n .data([gene], function(d){ return d.gene_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click.event_emitter\", function(element){\n element.parent.parent.emit(\"element_clicked\", element, true);\n });\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n };\n\n /**\n * Reimplement the positionTooltip() method to be gene-specific\n * @param {String} id\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var gene_bbox_id = this.getElementStatusNodeId(tooltip.data);\n var gene_bbox = d3.select(\"#\" + gene_bbox_id).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the gene that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var gene_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - gene_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + gene_center_x - data_layer_width, 0);\n var left = page_origin.x + gene_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the gene unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (gene_bbox.y + gene_bbox.height)){\n top = page_origin.y + gene_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + gene_bbox.y + gene_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Genome Legend Data Layer\n Implements a data layer that will render a genome legend\n*/\n\n// Build a custom data layer for a genome legend\nLocusZoom.DataLayers.add(\"genome_legend\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n chromosome_fill_colors: {\n light: \"rgb(155, 155, 188)\",\n dark: \"rgb(95, 95, 128)\"\n },\n chromosome_label_colors: {\n light: \"rgb(120, 120, 186)\",\n dark: \"rgb(0, 0, 66)\"\n }\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Implement the main render function\n this.render = function(){\n\n // Iterate over data to generate genome-wide start/end values for each chromosome\n var position = 0;\n this.data.forEach(function(d, i){\n this.data[i].genome_start = position;\n this.data[i].genome_end = position + d[\"genome:base_pairs\"];\n position += d[\"genome:base_pairs\"];\n }.bind(this));\n\n var chromosomes = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend\")\n .data(this.data, function(d){ return d[\"genome:chr\"]; });\n\n // Create chromosome elements, apply class\n chromosomes.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend\");\n\n // Position and fill chromosome rects\n var data_layer = this;\n var panel = this.parent;\n\n chromosomes\n .attr(\"fill\", function(d){ return (d[\"genome:chr\"] % 2 ? data_layer.layout.chromosome_fill_colors.light : data_layer.layout.chromosome_fill_colors.dark); })\n .attr(\"x\", function(d){ return panel.x_scale(d.genome_start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d[\"genome:base_pairs\"]); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n // Remove old elements as needed\n chromosomes.exit().remove();\n\n // Parse current state variant into a position\n // Assumes that variant string is of the format 10:123352136_C/T or 10:123352136\n var variant_parts = /([^:]+):(\\d+)(?:_.*)?/.exec(this.state.variant);\n if (!variant_parts) {\n throw(\"Genome legend cannot understand the specified variant position\");\n }\n var chr = variant_parts[1];\n var offset = variant_parts[2];\n // TODO: How does this handle representation of X or Y chromosomes?\n position = +this.data[chr-1].genome_start + +offset;\n\n // Render the position\n var region = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend-marker\")\n .data([{ start: position, end: position + 1 }]);\n\n region.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend-marker\");\n\n region\n .transition()\n .duration(500)\n .style({\n \"fill\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke-width\": \"3px\"\n })\n .attr(\"x\", function(d){ return panel.x_scale(d.start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d.end - d.start); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n region.exit().remove();\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/**\n * Intervals Data Layer\n * Implements a data layer that will render interval annotation tracks (intervals must provide start and end values)\n * @class LocusZoom.DataLayers.intervals\n * @augments LocusZoom.DataLayer\n */\nLocusZoom.DataLayers.add(\"intervals\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n start_field: \"start\",\n end_field: \"end\",\n track_split_field: \"state_id\",\n track_split_order: \"DESC\",\n track_split_legend_to_y_axis: 2,\n split_tracks: true,\n track_height: 15,\n track_vertical_spacing: 3,\n bounding_box_padding: 2,\n always_hide_legend: false,\n color: \"#B8B8B8\",\n fill_opacity: 1\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n \n /**\n * To define shared highlighting on the track split field define the status node id override\n * to generate an ID common to the track when we're actively splitting data out to separate tracks\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n if (this.layout.split_tracks){\n return (this.getBaseId() + \"-statusnode-\" + element[this.layout.track_split_field]).replace(/[:.[\\],]/g, \"_\");\n }\n return this.getElementId(element) + \"-statusnode\";\n }.bind(this);\n \n // Helper function to sum layout values to derive total height for a single interval track\n this.getTrackHeight = function(){\n return this.layout.track_height\n + this.layout.track_vertical_spacing\n + (2 * this.layout.bounding_box_padding);\n };\n\n this.tracks = 1;\n this.previous_tracks = 1;\n \n // track-number-indexed object with arrays of interval indexes in the dataset\n this.interval_track_index = { 1: [] };\n\n // After we've loaded interval data interpret it to assign\n // each to a track so that they do not overlap in the view\n this.assignTracks = function(){\n\n // Reinitialize some metadata\n this.previous_tracks = this.tracks;\n this.tracks = 0;\n this.interval_track_index = { 1: [] };\n this.track_split_field_index = {};\n \n // If splitting tracks by a field's value then do a first pass determine\n // a value/track mapping that preserves the order of possible values\n if (this.layout.track_split_field && this.layout.split_tracks){\n this.data.map(function(d){\n this.track_split_field_index[d[this.layout.track_split_field]] = null;\n }.bind(this));\n var index = Object.keys(this.track_split_field_index);\n if (this.layout.track_split_order === \"DESC\"){ index.reverse(); }\n index.forEach(function(val){\n this.track_split_field_index[val] = this.tracks + 1;\n this.interval_track_index[this.tracks + 1] = [];\n this.tracks++;\n }.bind(this));\n }\n\n this.data.map(function(d, i){\n\n // Stash a parent reference on the interval\n this.data[i].parent = this;\n\n // Determine display range start and end, based on minimum allowable interval display width,\n // bounded by what we can see (range: values in terms of pixels on the screen)\n this.data[i].display_range = {\n start: this.parent.x_scale(Math.max(d[this.layout.start_field], this.state.start)),\n end: this.parent.x_scale(Math.min(d[this.layout.end_field], this.state.end))\n };\n this.data[i].display_range.width = this.data[i].display_range.end - this.data[i].display_range.start;\n \n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[i].display_domain = {\n start: this.parent.x_scale.invert(this.data[i].display_range.start),\n end: this.parent.x_scale.invert(this.data[i].display_range.end)\n };\n this.data[i].display_domain.width = this.data[i].display_domain.end - this.data[i].display_domain.start;\n\n // If splitting to tracks based on the value of the designated track split field\n // then don't bother with collision detection (intervals will be grouped on tracks\n // solely by the value of track_split_field)\n if (this.layout.track_split_field && this.layout.split_tracks){\n var val = this.data[i][this.layout.track_split_field];\n this.data[i].track = this.track_split_field_index[val];\n this.interval_track_index[this.data[i].track].push(i);\n } else {\n // If not splitting to tracks based on a field value then do so based on collision\n // detection (as how it's done for genes). Use display range/domain data generated\n // above and cast each interval to tracks such that none overlap\n this.tracks = 1;\n this.data[i].track = null;\n var potential_track = 1;\n while (this.data[i].track === null){\n var collision_on_potential_track = false;\n this.interval_track_index[potential_track].map(function(placed_interval){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_interval.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_interval.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_interval.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[i]));\n if (!collision_on_potential_track){\n this.data[i].track = potential_track;\n this.interval_track_index[potential_track].push(this.data[i]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.interval_track_index[potential_track] = [];\n }\n }\n }\n\n }\n\n }.bind(this));\n\n return this;\n };\n\n // Implement the main render function\n this.render = function(){\n\n this.assignTracks();\n\n // Remove any shared highlight nodes and re-render them if we're splitting on tracks\n // At most there will only be dozen or so nodes here (one per track) and each time\n // we render data we may have new tracks, so wiping/redrawing all is reasonable.\n this.svg.group.selectAll(\".lz-data_layer-intervals-statusnode.lz-data_layer-intervals-shared\").remove();\n Object.keys(this.track_split_field_index).forEach(function(key){\n // Make a psuedo-element so that we can generate an id for the shared node\n var psuedoElement = {};\n psuedoElement[this.layout.track_split_field] = key;\n // Insert the shared node\n var sharedstatusnode_style = {display: (this.layout.split_tracks ? null : \"none\")};\n this.svg.group.insert(\"rect\", \":first-child\")\n .attr(\"id\", this.getElementStatusNodeId(psuedoElement))\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-shared\")\n .attr(\"rx\", this.layout.bounding_box_padding).attr(\"ry\", this.layout.bounding_box_padding)\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.getTrackHeight() - this.layout.track_vertical_spacing)\n .attr(\"x\", 0)\n .attr(\"y\", (this.track_split_field_index[key]-1) * this.getTrackHeight())\n .style(sharedstatusnode_style);\n }.bind(this));\n\n var width, height, x, y, fill, fill_opacity;\n \n // Render interval groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-intervals\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-intervals\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(interval){\n\n var data_layer = interval.parent;\n\n // Render interval status nodes (displayed behind intervals to show highlight\n // without needing to modify interval display element(s))\n var statusnode_style = {display: (data_layer.layout.split_tracks ? \"none\" : null)};\n var statusnodes = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-data_layer-intervals-statusnode.lz-data_layer-intervals-statusnode-discrete\")\n .data([interval], function(d){ return data_layer.getElementId(d) + \"-statusnode\"; });\n statusnodes.enter().insert(\"rect\", \":first-child\")\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-statusnode-discrete\");\n statusnodes\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"-statusnode\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .style(statusnode_style);\n width = function(d){\n return d.display_range.width + (2 * data_layer.layout.bounding_box_padding);\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start - data_layer.layout.bounding_box_padding;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n statusnodes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n statusnodes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n statusnodes.exit().remove();\n\n // Render primary interval rects\n var rects = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-interval_rect\")\n .data([interval], function(d){ return d[data_layer.layout.id_field] + \"_interval_rect\"; });\n\n rects.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-interval_rect\");\n\n height = data_layer.layout.track_height;\n width = function(d){\n return d.display_range.width;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding;\n };\n fill = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.color, d);\n };\n fill_opacity = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.fill_opacity, d);\n };\n \n \n if (data_layer.canTransition()){\n rects\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n } else {\n rects\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n }\n \n rects.exit().remove();\n\n // Render interval click areas\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-clickarea\")\n .data([interval], function(d){ return d.interval_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click\", function(element_data){\n element_data.parent.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Update the legend axis if the number of ticks changed\n if (this.previous_tracks !== this.tracks){\n this.updateSplitTrackAxis();\n }\n\n return this;\n\n };\n \n // Reimplement the positionTooltip() method to be interval-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var interval_bbox = d3.select(\"#\" + this.getElementStatusNodeId(tooltip.data)).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the interval that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var interval_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - interval_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + interval_center_x - data_layer_width, 0);\n var left = page_origin.x + interval_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the interval unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (interval_bbox.y + interval_bbox.height)){\n top = page_origin.y + interval_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + interval_bbox.y + interval_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Redraw split track axis or hide it, and show/hide the legend, as determined\n // by current layout parameters and data\n this.updateSplitTrackAxis = function(){\n var legend_axis = this.layout.track_split_legend_to_y_axis ? \"y\" + this.layout.track_split_legend_to_y_axis : false;\n if (this.layout.split_tracks){\n var tracks = +this.tracks || 0;\n var track_height = +this.layout.track_height || 0;\n var track_spacing = 2 * (+this.layout.bounding_box_padding || 0) + (+this.layout.track_vertical_spacing || 0);\n var target_height = (tracks * track_height) + ((tracks - 1) * track_spacing);\n this.parent.scaleHeightToData(target_height);\n if (legend_axis && this.parent.legend){\n this.parent.legend.hide(); \n this.parent.layout.axes[legend_axis] = {\n render: true,\n ticks: [],\n range: {\n start: (target_height - (this.layout.track_height/2)),\n end: (this.layout.track_height/2)\n }\n };\n this.layout.legend.forEach(function(element){\n var key = element[this.layout.track_split_field];\n var track = this.track_split_field_index[key];\n if (track){\n if (this.layout.track_split_order === \"DESC\"){\n track = Math.abs(track - tracks - 1);\n }\n this.parent.layout.axes[legend_axis].ticks.push({\n y: track,\n text: element.label\n });\n }\n }.bind(this));\n this.layout.y_axis = {\n axis: this.layout.track_split_legend_to_y_axis,\n floor: 1,\n ceiling: tracks\n };\n this.parent.render();\n }\n this.parent_plot.positionPanels();\n } else {\n if (legend_axis && this.parent.legend){\n if (!this.layout.always_hide_legend){ this.parent.legend.show(); }\n this.parent.layout.axes[legend_axis] = { render: false };\n this.parent.render();\n }\n }\n return this;\n };\n\n // Method to not only toggle the split tracks boolean but also update\n // necessary display values to animate a complete merge/split\n this.toggleSplitTracks = function(){\n this.layout.split_tracks = !this.layout.split_tracks;\n if (this.parent.legend && !this.layout.always_hide_legend){\n this.parent.layout.margin.bottom = 5 + (this.layout.split_tracks ? 0 : this.parent.legend.layout.height + 5);\n }\n this.render();\n this.updateSplitTrackAxis();\n return this;\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Line Data Layer\n * Implements a standard line plot\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n /** @member {Object} */\n this.DefaultLayout = {\n style: {\n fill: \"none\",\n \"stroke-width\": \"2px\"\n },\n interpolate: \"linear\",\n x_axis: { field: \"x\" },\n y_axis: { field: \"y\", axis: 1 },\n hitarea_width: 5\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Var for storing mouse events for use in tool tip positioning\n /** @member {String} */\n this.mouse_event = null;\n\n /**\n * Var for storing the generated line function itself\n * @member {d3.svg.line}\n * */\n this.line = null;\n\n /**\n * The timeout identifier returned by setTimeout\n * @member {Number}\n */\n this.tooltip_timeout = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n\n /**\n * Helper function to get display and data objects representing\n * the x/y coordinates of the current mouse event with respect to the line in terms of the display\n * and the interpolated values of the x/y fields with respect to the line\n * @returns {{display: {x: *, y: null}, data: {}, slope: null}}\n */\n this.getMouseDisplayAndData = function(){\n var ret = {\n display: {\n x: d3.mouse(this.mouse_event)[0],\n y: null\n },\n data: {},\n slope: null\n };\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n ret.data[x_field] = this.parent[x_scale].invert(ret.display.x);\n var bisect = d3.bisector(function(datum) { return +datum[x_field]; }).left;\n var index = bisect(this.data, ret.data[x_field]) - 1;\n var startDatum = this.data[index];\n var endDatum = this.data[index + 1];\n var interpolate = d3.interpolateNumber(+startDatum[y_field], +endDatum[y_field]);\n var range = +endDatum[x_field] - +startDatum[x_field];\n ret.data[y_field] = interpolate((ret.data[x_field] % range) / range);\n ret.display.y = this.parent[y_scale](ret.data[y_field]);\n if (this.layout.tooltip.x_precision){\n ret.data[x_field] = ret.data[x_field].toPrecision(this.layout.tooltip.x_precision);\n }\n if (this.layout.tooltip.y_precision){\n ret.data[y_field] = ret.data[y_field].toPrecision(this.layout.tooltip.y_precision);\n }\n ret.slope = (this.parent[y_scale](endDatum[y_field]) - this.parent[y_scale](startDatum[y_field]))\n / (this.parent[x_scale](endDatum[x_field]) - this.parent[x_scale](startDatum[x_field]));\n return ret;\n };\n\n /**\n * Reimplement the positionTooltip() method to be line-specific\n * @param {String} id Identify the tooltip to be positioned\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var arrow_width = 7; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var stroke_width = parseFloat(this.layout.style[\"stroke-width\"]) || 1;\n var page_origin = this.getPageOrigin();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n var top, left, arrow_top, arrow_left, arrow_type;\n\n // Determine x/y coordinates for display and data\n var dd = this.getMouseDisplayAndData();\n\n // If the absolute value of the slope of the line at this point is above 1 (including Infinity)\n // then position the tool tip left/right. Otherwise position top/bottom.\n if (Math.abs(dd.slope) > 1){\n\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (dd.display.x <= this.parent.layout.width / 2){\n left = page_origin.x + dd.display.x + stroke_width + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + dd.display.x - tooltip_box.width - stroke_width - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n if (dd.display.y - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + dd.display.y - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (dd.display.y + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + dd.display.y + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + dd.display.y - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n\n } else {\n\n // Position horizontally: attempt to center on the mouse's x coordinate\n // pad to either side if bumping up against the edge of the data layer\n var offset_right = Math.max((tooltip_box.width / 2) - dd.display.x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + dd.display.x - data_layer_width, 0);\n left = page_origin.x + dd.display.x - (tooltip_box.width / 2) - offset_left + offset_right;\n var min_arrow_left = arrow_width / 2;\n var max_arrow_left = tooltip_box.width - (2.5 * arrow_width);\n arrow_left = (tooltip_box.width / 2) - arrow_width + offset_left - offset_right;\n arrow_left = Math.min(Math.max(arrow_left, min_arrow_left), max_arrow_left);\n\n // Position vertically above the line unless there's insufficient space\n if (tooltip_box.height + stroke_width + arrow_width > dd.display.y){\n top = page_origin.y + dd.display.y + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n } else {\n top = page_origin.y + dd.display.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n }\n }\n\n // Apply positions to the main div\n tooltip.selector.style({ left: left + \"px\", top: top + \"px\" });\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style({ \"left\": arrow_left + \"px\", top: arrow_top + \"px\" });\n\n };\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var data_layer = this;\n var panel = this.parent;\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Apply tooltip, etc\n if (this.layout.tooltip){\n // Generate an overlaying transparent \"hit area\" line for more intuitive mouse events\n var hitarea_width = parseFloat(this.layout.hitarea_width).toString() + \"px\";\n var hitarea = this.svg.group\n .selectAll(\"path.lz-data_layer-line-hitarea\")\n .data([this.data]);\n hitarea.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line-hitarea\")\n .style(\"stroke-width\", hitarea_width);\n var hitarea_line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n hitarea\n .attr(\"d\", hitarea_line)\n .on(\"mouseover\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.createTooltip(dd.data);\n })\n .on(\"mousemove\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.updateTooltip(dd.data);\n data_layer.positionTooltip(data_layer.getElementId());\n })\n .on(\"mouseout\", function(){\n data_layer.tooltip_timeout = setTimeout(function(){\n data_layer.mouse_event = null;\n data_layer.destroyTooltip(data_layer.getElementId());\n }, 300);\n });\n hitarea.exit().remove();\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n /**\n * Redefine setElementStatus family of methods as line data layers will only ever have a single path element\n * @param {String} status A member of `LocusZoom.DataLayer.Statuses.adjectives`\n * @param {String|Object} element\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\n this.setElementStatus = function(status, element, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setElementStatusByFilters = function(status, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setAllElementStatus = function(status, toggle){\n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n // Apply class to path based on global status flags\n var path_class = \"lz-data_layer-line\";\n Object.keys(this.global_statuses).forEach(function(global_status){\n if (this.global_statuses[global_status]){ path_class += \" lz-data_layer-line-\" + global_status; }\n }.bind(this));\n this.path.attr(\"class\", path_class);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n return this;\n };\n\n return this;\n\n});\n\n\n/***************************\n * Orthogonal Line Data Layer\n * Implements a horizontal or vertical line given an orientation and an offset in the layout\n * Does not require a data source\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"orthogonal_line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n style: {\n \"stroke\": \"#D3D3D3\",\n \"stroke-width\": \"3px\",\n \"stroke-dasharray\": \"10px 10px\"\n },\n orientation: \"horizontal\",\n x_axis: {\n axis: 1,\n decoupled: true\n },\n y_axis: {\n axis: 1,\n decoupled: true\n },\n offset: 0\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Require that orientation be \"horizontal\" or \"vertical\" only\n if ([\"horizontal\",\"vertical\"].indexOf(layout.orientation) === -1){\n layout.orientation = \"horizontal\";\n }\n\n // Vars for storing the data generated line\n /** @member {Array} */\n this.data = [];\n /** @member {d3.svg.line} */\n this.line = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var panel = this.parent;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n var x_extent = \"x_extent\";\n var y_extent = \"y\" + this.layout.y_axis.axis + \"_extent\";\n var x_range = \"x_range\";\n var y_range = \"y\" + this.layout.y_axis.axis + \"_range\";\n\n // Generate data using extents depending on orientation\n if (this.layout.orientation === \"horizontal\"){\n this.data = [\n { x: panel[x_extent][0], y: this.layout.offset },\n { x: panel[x_extent][1], y: this.layout.offset }\n ];\n } else {\n this.data = [\n { x: this.layout.offset, y: panel[y_extent][0] },\n { x: this.layout.offset, y: panel[y_extent][1] }\n ];\n }\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d, i) {\n var x = parseFloat(panel[x_scale](d[\"x\"]));\n return isNaN(x) ? panel[x_range][i] : x;\n })\n .y(function(d, i) {\n var y = parseFloat(panel[y_scale](d[\"y\"]));\n return isNaN(y) ? panel[y_range][i] : y;\n })\n .interpolate(\"linear\");\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Scatter Data Layer\n Implements a standard scatter plot\n*/\n\nLocusZoom.DataLayers.add(\"scatter\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"circle\",\n tooltip_positioning: \"horizontal\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 1\n },\n id_field: \"id\"\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Extra default for layout spacing\n // Not in default layout since that would make the label attribute always present\n if (layout.label && isNaN(layout.label.spacing)){\n layout.label.spacing = 4;\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be scatter-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var offset = Math.sqrt(point_size / Math.PI);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n if (this.layout.tooltip_positioning === \"vertical\"){\n // Position horizontally centered above the point\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right - offset;\n // Position vertically above the point unless there's insufficient space, then go below\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (y_center + offset)){\n top = page_origin.y + y_center - (offset + tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + offset + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n } else {\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Function to flip labels from being anchored at the start of the text to the end\n // Both to keep labels from running outside the data layer and also as a first\n // pass on recursive separation\n this.flip_labels = function(){\n var data_layer = this;\n var point_size = data_layer.resolveScalableParameter(data_layer.layout.point_size, {});\n var spacing = data_layer.layout.label.spacing;\n var handle_lines = Boolean(data_layer.layout.label.lines);\n var min_x = 2 * spacing;\n var max_x = data_layer.parent.layout.width - data_layer.parent.layout.margin.left - data_layer.parent.layout.margin.right - (2 * spacing);\n var flip = function(dn, dnl){\n var dnx = +dn.attr(\"x\");\n var text_swing = (2 * spacing) + (2 * Math.sqrt(point_size));\n if (handle_lines){\n var dnlx2 = +dnl.attr(\"x2\");\n var line_swing = spacing + (2 * Math.sqrt(point_size));\n }\n if (dn.style(\"text-anchor\") === \"start\"){\n dn.style(\"text-anchor\", \"end\");\n dn.attr(\"x\", dnx - text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 - line_swing); }\n } else {\n dn.style(\"text-anchor\", \"start\");\n dn.attr(\"x\", dnx + text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 + line_swing); }\n }\n };\n // Flip any going over the right edge from the right side to the left side\n // (all labels start on the right side)\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n if (dax + abound.width + spacing > max_x){\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n flip(da, dal);\n }\n });\n // Second pass to flip any others that haven't flipped yet if they collide with another label\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n if (da.style(\"text-anchor\") === \"end\") return;\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n data_layer.label_texts.each(function () {\n var b = this;\n var db = d3.select(b);\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (collision){\n flip(da, dal);\n // Double check that this flip didn't push the label past min_x. If it did, immediately flip back.\n dax = +da.attr(\"x\");\n if (dax - abound.width - spacing < min_x){\n flip(da, dal);\n }\n }\n return;\n });\n });\n };\n\n // Recursive function to space labels apart immediately after initial render\n // Adapted from thudfactor's fiddle here: https://jsfiddle.net/thudfactor/HdwTH/\n // TODO: Make labels also aware of data elements\n this.separate_labels = function(){\n this.seperate_iterations++;\n var data_layer = this;\n var alpha = 0.5;\n var spacing = this.layout.label.spacing;\n var again = false;\n data_layer.label_texts.each(function () {\n var a = this;\n var da = d3.select(a);\n var y1 = da.attr(\"y\");\n data_layer.label_texts.each(function () {\n var b = this;\n // a & b are the same element and don't collide.\n if (a === b) return;\n var db = d3.select(b);\n // a & b are on opposite sides of the chart and\n // don't collide\n if (da.attr(\"text-anchor\") !== db.attr(\"text-anchor\")) return;\n // Determine if the bounding rects for the two text elements collide\n var abound = da.node().getBoundingClientRect();\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (!collision) return;\n again = true;\n // If the labels collide, we'll push each\n // of the two labels up and down a little bit.\n var y2 = db.attr(\"y\");\n var sign = abound.top < bbound.top ? 1 : -1;\n var adjust = sign * alpha;\n var new_a_y = +y1 - adjust;\n var new_b_y = +y2 + adjust;\n // Keep new values from extending outside the data layer\n var min_y = 2 * spacing;\n var max_y = data_layer.parent.layout.height - data_layer.parent.layout.margin.top - data_layer.parent.layout.margin.bottom - (2 * spacing);\n var delta;\n if (new_a_y - (abound.height/2) < min_y){\n delta = +y1 - new_a_y;\n new_a_y = +y1;\n new_b_y += delta;\n } else if (new_b_y - (bbound.height/2) < min_y){\n delta = +y2 - new_b_y;\n new_b_y = +y2;\n new_a_y += delta;\n }\n if (new_a_y + (abound.height/2) > max_y){\n delta = new_a_y - +y1;\n new_a_y = +y1;\n new_b_y -= delta;\n } else if (new_b_y + (bbound.height/2) > max_y){\n delta = new_b_y - +y2;\n new_b_y = +y2;\n new_a_y -= delta;\n }\n da.attr(\"y\",new_a_y);\n db.attr(\"y\",new_b_y);\n });\n });\n if (again) {\n // Adjust lines to follow the labels\n if (data_layer.layout.label.lines){\n var label_elements = data_layer.label_texts[0];\n data_layer.label_lines.attr(\"y2\",function(d,i) {\n var label_line = d3.select(label_elements[i]);\n return label_line.attr(\"y\");\n });\n }\n // After ~150 iterations we're probably beyond diminising returns, so stop recursing\n if (this.seperate_iterations < 150){\n setTimeout(function(){\n this.separate_labels();\n }.bind(this), 1);\n }\n }\n };\n\n // Implement the main render function\n this.render = function(){\n\n var data_layer = this;\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate labels first (if defined)\n if (this.layout.label){\n // Apply filters to generate a filtered data set\n var filtered_data = this.data.filter(function(d){\n if (!data_layer.layout.label.filters){\n return true;\n } else {\n // Start by assuming a match, run through all filters to test if not a match on any one\n var match = true;\n data_layer.layout.label.filters.forEach(function(filter){\n var field_value = (new LocusZoom.Data.Field(filter.field)).resolve(d);\n if (isNaN(field_value)){\n match = false;\n } else {\n switch (filter.operator){\n case \"<\":\n if (!(field_value < filter.value)){ match = false; }\n break;\n case \"<=\":\n if (!(field_value <= filter.value)){ match = false; }\n break;\n case \">\":\n if (!(field_value > filter.value)){ match = false; }\n break;\n case \">=\":\n if (!(field_value >= filter.value)){ match = false; }\n break;\n case \"=\":\n if (!(field_value === filter.value)){ match = false; }\n break;\n default:\n // If we got here the operator is not valid, so the filter should fail\n match = false;\n break;\n }\n }\n });\n return match;\n }\n });\n // Render label groups\n var self = this;\n this.label_groups = this.svg.group\n .selectAll(\"g.lz-data_layer-\" + this.layout.type + \"-label\")\n .data(filtered_data, function(d){ return d[self.layout.id_field] + \"_label\"; });\n this.label_groups.enter()\n .append(\"g\")\n .attr(\"class\", \"lz-data_layer-\"+ this.layout.type + \"-label\");\n // Render label texts\n if (this.label_texts){ this.label_texts.remove(); }\n this.label_texts = this.label_groups.append(\"text\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_texts\n .text(function(d){\n return LocusZoom.parseFields(d, data_layer.layout.label.text || \"\");\n })\n .style(data_layer.layout.label.style || {})\n .attr({\n \"x\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + data_layer.layout.label.spacing;\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"text-anchor\": function(){\n return \"start\";\n }\n });\n // Render label lines\n if (data_layer.layout.label.lines){\n if (this.label_lines){ this.label_lines.remove(); }\n this.label_lines = this.label_groups.append(\"line\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_lines\n .style(data_layer.layout.label.lines.style || {})\n .attr({\n \"x1\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field]);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y1\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"x2\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + (data_layer.layout.label.spacing/2);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y2\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n }\n });\n }\n // Remove labels when they're no longer in the filtered data set\n this.label_groups.exit().remove();\n }\n \n // Generate main scatter data elements\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-\" + this.layout.type)\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Apply default event emitters to selection\n selection.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n \n // Apply mouse behaviors\n this.applyBehaviors(selection);\n \n // Apply method to keep labels from overlapping each other\n if (this.layout.label){\n this.flip_labels();\n this.seperate_iterations = 0;\n this.separate_labels();\n // Apply default event emitters to selection\n this.label_texts.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n // Extend mouse behaviors to labels\n this.applyBehaviors(this.label_texts);\n }\n \n };\n\n // Method to set a passed element as the LD reference in the plot-level state\n this.makeLDReference = function(element){\n var ref = null;\n if (typeof element == \"undefined\"){\n throw(\"makeLDReference requires one argument of any type\");\n } else if (typeof element == \"object\"){\n if (this.layout.id_field && typeof element[this.layout.id_field] != \"undefined\"){\n ref = element[this.layout.id_field].toString();\n } else if (typeof element[\"id\"] != \"undefined\"){\n ref = element[\"id\"].toString();\n } else {\n ref = element.toString();\n }\n } else {\n ref = element.toString();\n }\n this.parent_plot.applyState({ ldrefvar: ref });\n };\n \n return this;\n\n});\n\n/**\n * A scatter plot in which the x-axis represents categories, rather than individual positions.\n * For example, this can be used by PheWAS plots to show related groups. This plot allows the categories to be\n * determined dynamically when data is first loaded.\n *\n * @class LocusZoom.DataLayers.category_scatter\n * @augments LocusZoom.DataLayers.scatter\n */\nLocusZoom.DataLayers.extend(\"scatter\", \"category_scatter\", {\n /**\n * This plot layer makes certain assumptions about the data passed in. Transform the raw array of records from\n * the datasource to prepare it for plotting, as follows:\n * 1. The scatter plot assumes that all records are given in sequence (pre-grouped by `category_field`)\n * 2. It assumes that all records have an x coordinate for individual plotting\n * @private\n */\n _prepareData: function() {\n var xField = this.layout.x_axis.field || \"x\";\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n if (!category_field) {\n throw \"Layout for \" + this.layout.id + \" must specify category_field\";\n }\n // Sort the data so that things in the same category are adjacent (case-insensitive by specified field)\n var sourceData = this.data\n .sort(function(a, b) {\n var ak = a[category_field];\n var bk = b[category_field];\n var av = ak.toString ? ak.toString().toLowerCase() : ak;\n var bv = bk.toString ? bk.toString().toLowerCase() : bk;\n return (av === bv) ? 0 : (av < bv ? -1 : 1);});\n sourceData.forEach(function(d, i){\n // Implementation detail: Scatter plot requires specifying an x-axis value, and most datasources do not\n // specify plotting positions. If a point is missing this field, fill in a synthetic value.\n d[xField] = d[xField] || i;\n });\n return sourceData;\n },\n\n /**\n * Identify the unique categories on the plot, and update the layout with an appropriate color scheme.\n * Also identify the min and max x value associated with the category, which will be used to generate ticks\n * @private\n * @returns {Object.} Series of entries used to build category name ticks {category_name: [min_x, max_x]}\n */\n _generateCategoryBounds: function() {\n // TODO: API may return null values in category_field; should we add placeholder category label?\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n var xField = this.layout.x_axis.field || \"x\";\n var uniqueCategories = {};\n this.data.forEach(function(item) {\n var category = item[category_field];\n var x = item[xField];\n var bounds = uniqueCategories[category] || [x, x];\n uniqueCategories[category] = [Math.min(bounds[0], x), Math.max(bounds[1], x)];\n });\n\n var categoryNames = Object.keys(uniqueCategories);\n this._setDynamicColorScheme(categoryNames);\n\n return uniqueCategories;\n },\n\n /**\n * Automatically define a color scheme for the layer based on data returned from the server.\n * If part of the color scheme has been specified, it will fill in remaining missing information.\n *\n * There are three scenarios:\n * 1. The layout does not specify either category names or (color) values. Dynamically build both based on\n * the data and update the layout.\n * 2. The layout specifies colors, but not categories. Use that exact color information provided, and dynamically\n * determine what categories are present in the data. (cycle through the available colors, reusing if there\n * are a lot of categories)\n * 3. The layout specifies exactly what colors and categories to use (and they match the data!). This is useful to\n * specify an explicit mapping between color scheme and category names, when you want to be sure that the\n * plot matches a standard color scheme.\n * (If the layout specifies categories that do not match the data, the user specified categories will be ignored)\n *\n * This method will only act if the layout defines a `categorical_bin` scale function for coloring. It may be\n * overridden in a subclass to suit other types of coloring methods.\n *\n * @param {String[]} categoryNames\n * @private\n */\n _setDynamicColorScheme: function(categoryNames) {\n var colorParams = this.layout.color.parameters;\n var baseParams = this._base_layout.color.parameters;\n\n // If the layout does not use a supported coloring scheme, or is already complete, this method should do nothing\n if (this.layout.color.scale_function !== \"categorical_bin\") {\n throw \"This layer requires that coloring be specified as a `categorical_bin`\";\n }\n\n if (baseParams.categories.length && baseParams.values.length) {\n // If there are preset category/color combos, make sure that they apply to the actual dataset\n var parameters_categories_hash = {};\n baseParams.categories.forEach(function (category) { parameters_categories_hash[category] = 1; });\n if (categoryNames.every(function (name) { return parameters_categories_hash.hasOwnProperty(name); })) {\n // The layout doesn't have to specify categories in order, but make sure they are all there\n colorParams.categories = baseParams.categories;\n } else {\n colorParams.categories = categoryNames;\n }\n } else {\n colorParams.categories = categoryNames;\n }\n // Prefer user-specified colors if provided. Make sure that there are enough colors for all the categories.\n var colors;\n if (baseParams.values.length) {\n colors = baseParams.values;\n } else {\n var color_scale = categoryNames.length <= 10 ? d3.scale.category10 : d3.scale.category20;\n colors = color_scale().range();\n }\n while (colors.length < categoryNames.length) { colors = colors.concat(colors); }\n colors = colors.slice(0, categoryNames.length); // List of hex values, should be of same length as categories array\n colorParams.values = colors;\n },\n\n /**\n *\n * @param dimension\n * @param {Object} [config] Parameters that customize how ticks are calculated (not style)\n * @param {('left'|'center'|'right')} [config.position='left'] Align ticks with the center or edge of category\n * @returns {Array}\n */\n getTicks: function(dimension, config) { // Overrides parent method\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw \"Invalid dimension identifier\";\n }\n var position = config.position || \"left\";\n if ([\"left\", \"center\", \"right\"].indexOf(position) === -1) {\n throw \"Invalid tick position\";\n }\n\n var categoryBounds = this._categories;\n if (!categoryBounds || !Object.keys(categoryBounds).length) {\n return [];\n }\n\n if (dimension === \"y\") {\n return [];\n }\n\n if (dimension === \"x\") {\n // If colors have been defined by this layer, use them to make tick colors match scatterplot point colors\n var knownCategories = this.layout.color.parameters.categories || [];\n var knownColors = this.layout.color.parameters.values || [];\n\n return Object.keys(categoryBounds).map(function (category, index) {\n var bounds = categoryBounds[category];\n var xPos;\n\n switch(position) {\n case \"left\":\n xPos = bounds[0];\n break;\n case \"center\":\n // Center tick under one or many elements as appropriate\n var diff = bounds[1] - bounds[0];\n xPos = bounds[0] + (diff !== 0 ? diff : bounds[0]) / 2;\n break;\n case \"right\":\n xPos = bounds[1];\n break;\n }\n return {\n x: xPos,\n text: category,\n style: {\n \"fill\": knownColors[knownCategories.indexOf(category)] || \"#000000\"\n }\n };\n });\n }\n },\n\n applyCustomDataMethods: function() {\n this.data = this._prepareData();\n /**\n * Define category names and extents (boundaries) for plotting. TODO: properties in constructor\n * @member {Object.} Category names and extents, in the form {category_name: [min_x, max_x]}\n */\n this._categories = this._generateCategoryBounds();\n return this;\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n *\n * LocusZoom has various singleton objects that are used for registering functions or classes.\n * These objects provide safe, standard methods to redefine or delete existing functions/classes\n * as well as define new custom functions/classes to be used in a plot.\n *\n * @namespace Singletons\n */\n\n\n/*\n * The Collection of \"Known\" Data Sources. This registry is used internally by the `DataSources` class\n * @class\n * @static\n */\nLocusZoom.KnownDataSources = (function() {\n /** @lends LocusZoom.KnownDataSources */\n var obj = {};\n /* @member {function[]} */\n var sources = [];\n\n var findSourceByName = function(x) {\n for(var i=0; i 1) {\n return function(x) {\n var val = x;\n for(var i = 0; i 1) {\n log = Math.ceil(Math.log(abs) / Math.LN10);\n } else { // 0...1\n log = Math.floor(Math.log(abs) / Math.LN10);\n }\n if (Math.abs(log) <= 3){\n return x.toFixed(3);\n } else {\n return x.toExponential(2).replace(\"+\", \"\").replace(\"e\", \" × 10^\");\n }\n});\n\n/**\n * URL-encode the provided text, eg for constructing hyperlinks\n * @function urlencode\n * @param {String} str\n */\nLocusZoom.TransformationFunctions.add(\"urlencode\", function(str) {\n return encodeURIComponent(str);\n});\n\n/**\n * HTML-escape user entered values for use in constructed HTML fragments\n *\n * For example, this filter can be used on tooltips with custom HTML display\n * @function htmlescape\n * @param {String} str HTML-escape the provided value\n */\nLocusZoom.TransformationFunctions.add(\"htmlescape\", function(str) {\n if ( !str ) {\n return \"\";\n }\n str = str + \"\";\n\n return str.replace( /['\"<>&`]/g, function( s ) {\n switch ( s ) {\n case \"'\":\n return \"'\";\n case \"\\\"\":\n return \""\";\n case \"<\":\n return \"<\";\n case \">\":\n return \">\";\n case \"&\":\n return \"&\";\n case \"`\":\n return \"`\";\n }\n });\n});\n\n/**\n * Singleton for accessing/storing functions that will convert arbitrary data points to values in a given scale\n * Useful for anything that needs to scale discretely with data (e.g. color, point size, etc.)\n *\n * A Scale Function can be thought of as a modifier to a layout directive that adds extra logic to how a piece of data\n * can be resolved to a value.\n *\n * All scale functions must accept an object of parameters and a value to process.\n * @class\n * @static\n */\nLocusZoom.ScaleFunctions = (function() {\n /** @lends LocusZoom.ScaleFunctions */\n var obj = {};\n var functions = {};\n\n /**\n * Find a scale function and return it. If parameters and values are passed, calls the function directly; otherwise\n * returns a callable.\n * @param {String} name\n * @param {Object} [parameters] Configuration parameters specific to the specified scale function\n * @param {*} [value] The value to operate on\n * @returns {*}\n */\n obj.get = function(name, parameters, value) {\n if (!name) {\n return null;\n } else if (functions[name]) {\n if (typeof parameters === \"undefined\" && typeof value === \"undefined\"){\n return functions[name];\n } else {\n return functions[name](parameters, value);\n }\n } else {\n throw(\"scale function [\" + name + \"] not found\");\n }\n };\n\n /**\n * @protected\n * @param {String} name The name of the function to set/unset\n * @param {Function} [fn] The function to register. If blank, removes this function name from the registry.\n */\n obj.set = function(name, fn) {\n if (fn) {\n functions[name] = fn;\n } else {\n delete functions[name];\n }\n };\n\n /**\n * Add a new scale function to the registry\n * @param {String} name The name of the scale function\n * @param {function} fn A scale function that accepts two parameters: an object of configuration and a value\n */\n obj.add = function(name, fn) {\n if (functions[name]) {\n throw(\"scale function already exists with name: \" + name);\n } else {\n obj.set(name, fn);\n }\n };\n\n /**\n * List the names of all registered scale functions\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(functions);\n };\n\n return obj;\n})();\n\n/**\n * Basic conditional function to evaluate the value of the input field and return based on equality.\n * @param {Object} parameters\n * @param {*} parameters.field_value The value against which to test the input value.\n * @param {*} parameters.then The value to return if the input value matches the field value\n * @param {*} parameters.else The value to return if the input value does not match the field value. Optional. If not\n * defined this scale function will return null (or value of null_value parameter, if defined) when input value fails\n * to match field_value.\n * @param {*} input value\n */\nLocusZoom.ScaleFunctions.add(\"if\", function(parameters, input){\n if (typeof input == \"undefined\" || parameters.field_value !== input){\n if (typeof parameters.else != \"undefined\"){\n return parameters.else;\n } else {\n return null;\n }\n } else {\n return parameters.then;\n }\n});\n\n/**\n * Function to sort numerical values into bins based on numerical break points. Will only operate on numbers and\n * return null (or value of null_value parameter, if defined) if provided a non-numeric input value. Parameters:\n * @function numerical_bin\n * @param {Object} parameters\n * @param {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter. If the input value is greater than or equal to break n and less than\n * or equal to break n+1 (or break n+1 doesn't exist) then returned value is the nth entry in the values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against break points. Must be of\n * equal length to breaks parameter. Each entry n represents the value to return if the input value is greater than\n * or equal to break n and less than or equal to break n+1 (or break n+1 doesn't exist).\n * @param {*} null_value\n * @param {*} input value\n * @returns\n */\nLocusZoom.ScaleFunctions.add(\"numerical_bin\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){\n return (parameters.null_value ? parameters.null_value : null);\n }\n var threshold = breaks.reduce(function(prev, curr){\n if (+input < prev || (+input >= prev && +input < curr)){\n return prev;\n } else {\n return curr;\n }\n });\n return values[breaks.indexOf(threshold)];\n});\n\n/**\n * Function to sort values of any type into bins based on direct equality testing with a list of categories.\n * Will return null if provided an input value that does not match to a listed category.\n * @function categorical_bin\n * @param {Object} parameters\n * @param {Array} parameters.categories Array of values against which to evaluate the input value. Must be of equal\n * length to values parameter. If the input value is equal to category n then returned value is the nth entry in the\n * values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against categories. Must be of equal\n * length to categories parameter. Each entry n represents the value to return if the input value is equal to the nth\n * value in the categories parameter.\n * @param {*} parameters.null_value Value to return if the input value fails to match to any categories. Optional.\n */\nLocusZoom.ScaleFunctions.add(\"categorical_bin\", function(parameters, value){\n if (typeof value == \"undefined\" || parameters.categories.indexOf(value) === -1){\n return (parameters.null_value ? parameters.null_value : null); \n } else {\n return parameters.values[parameters.categories.indexOf(value)];\n }\n});\n\n/**\n * Function for continuous interpolation of numerical values along a gradient with arbitrarily many break points.\n * @function interpolate\n * @parameters {Object} parameters\n * @parameters {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter and contain at least two elements. Input value will be evaluated for\n * relative position between two break points n and n+1 and the returned value will be interpolated at a relative\n * position between values n and n+1.\n * @parameters {*[]} parameters.values Array of values to interpolate and return given evaluations against break\n * points. Must be of equal length to breaks parameter and contain at least two elements. Each entry n represents\n * the value to return if the input value matches the nth entry in breaks exactly. Note that this scale function\n * uses d3.interpolate to provide for effective interpolation of many different value types, including numbers,\n * colors, shapes, etc.\n * @parameters {*} parameters.null_value\n */\nLocusZoom.ScaleFunctions.add(\"interpolate\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n var nullval = (parameters.null_value ? parameters.null_value : null);\n if (breaks.length < 2 || breaks.length !== values.length){ return nullval; }\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){ return nullval; }\n if (+input <= parameters.breaks[0]){\n return values[0];\n } else if (+input >= parameters.breaks[parameters.breaks.length-1]){\n return values[breaks.length-1];\n } else {\n var upper_idx = null;\n breaks.forEach(function(brk, idx){\n if (!idx){ return; }\n if (breaks[idx-1] <= +input && breaks[idx] >= +input){ upper_idx = idx; }\n });\n if (upper_idx === null){ return nullval; }\n var normalized_input = (+input - breaks[upper_idx-1]) / (breaks[upper_idx] - breaks[upper_idx-1]);\n if (!isFinite(normalized_input)){ return nullval; }\n return d3.interpolate(values[upper_idx-1], values[upper_idx])(normalized_input);\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A Dashboard is an HTML element used for presenting arbitrary user interface components. Dashboards are anchored\n * to either the entire Plot or to individual Panels.\n *\n * Each dashboard is an HTML-based (read: not SVG) collection of components used to display information or provide\n * user interface. Dashboards can exist on entire plots, where their visibility is permanent and vertically adjacent\n * to the plot, or on individual panels, where their visibility is tied to a behavior (e.g. a mouseover) and is as\n * an overlay.\n * @class\n */\nLocusZoom.Dashboard = function(parent){\n // parent must be a locuszoom plot or panel\n if (!(parent instanceof LocusZoom.Plot) && !(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create dashboard, parent must be a locuszoom plot or panel\";\n }\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".dashboard\";\n /** @member {('plot'|'panel')} */\n this.type = (this.parent instanceof LocusZoom.Plot) ? \"plot\" : \"panel\";\n /** @member {LocusZoom.Plot} */\n this.parent_plot = this.type === \"plot\" ? this.parent : this.parent.parent;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {LocusZoom.Dashboard.Component[]} */\n this.components = [];\n /**\n * The timer identifier as returned by setTimeout\n * @member {Number}\n */\n this.hide_timeout = null;\n /**\n * Whether to hide the dashboard. Can be overridden by a child component. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n\n // TODO: Return value from constructor function?\n return this.initialize();\n};\n\n/**\n * Prepare the dashboard for first use: generate all component instances for this dashboard, based on the provided\n * layout of the parent. Connects event listeners and shows/hides as appropriate.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.initialize = function() {\n // Parse layout to generate component instances\n if (Array.isArray(this.parent.layout.dashboard.components)){\n this.parent.layout.dashboard.components.forEach(function(layout){\n try {\n var component = LocusZoom.Dashboard.Components.get(layout.type, layout, this);\n this.components.push(component);\n } catch (e) {\n console.warn(e);\n }\n }.bind(this));\n }\n\n // Add mouseover event handlers to show/hide panel dashboard\n if (this.type === \"panel\"){\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseover.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n if (!this.selector || this.selector.style(\"visibility\") === \"hidden\"){ this.show(); }\n }.bind(this));\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseout.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n this.hide_timeout = setTimeout(function(){ this.hide(); }.bind(this), 300);\n }.bind(this));\n }\n\n return this;\n\n};\n\n/**\n * Whether to persist the dashboard. Returns true if at least one component should persist, or if the panel is engaged\n * in an active drag event.\n * @returns {boolean}\n */\nLocusZoom.Dashboard.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n var persist = false;\n // Persist if at least one component should also persist\n this.components.forEach(function(component){\n persist = persist || component.shouldPersist();\n });\n // Persist if in a parent drag event\n persist = persist || (this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.dragging);\n return !!persist;\n};\n\n/**\n * Make the dashboard appear. If it doesn't exist yet create it, including creating/positioning all components within,\n * and make sure it is set to be visible.\n */\nLocusZoom.Dashboard.prototype.show = function(){\n if (!this.selector){\n switch (this.type){\n case \"plot\":\n this.selector = d3.select(this.parent.svg.node().parentNode)\n .insert(\"div\",\":first-child\");\n break;\n case \"panel\":\n this.selector = d3.select(this.parent.parent.svg.node().parentNode)\n .insert(\"div\", \".lz-data_layer-tooltip, .lz-dashboard-menu, .lz-curtain\").classed(\"lz-panel-dashboard\", true);\n break;\n }\n this.selector.classed(\"lz-dashboard\", true).classed(\"lz-\"+this.type+\"-dashboard\", true).attr(\"id\", this.id);\n }\n this.components.forEach(function(component){ component.show(); });\n this.selector.style({ visibility: \"visible\" });\n return this.update();\n};\n\n/**\n * Update the dashboard and rerender all child components. This can be called whenever plot state changes.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.update = function(){\n if (!this.selector){ return this; }\n this.components.forEach(function(component){ component.update(); });\n return this.position();\n};\n\n/**\n * Position the dashboard (and child components) within the panel\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.position = function(){\n if (!this.selector){ return this; }\n // Position the dashboard itself (panel only)\n if (this.type === \"panel\"){\n var page_origin = this.parent.getPageOrigin();\n var top = (page_origin.y + 3.5).toString() + \"px\";\n var left = page_origin.x.toString() + \"px\";\n var width = (this.parent.layout.width - 4).toString() + \"px\";\n this.selector.style({ position: \"absolute\", top: top, left: left, width: width });\n }\n // Recursively position components\n this.components.forEach(function(component){ component.position(); });\n return this;\n};\n\n/**\n * Hide the dashboard (make invisible but do not destroy). Will do nothing if `shouldPersist` returns true.\n *\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n this.components.forEach(function(component){ component.hide(); });\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n\n/**\n * Completely remove dashboard and all child components. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n this.components.forEach(function(component){ component.destroy(true); });\n this.components = [];\n this.selector.remove();\n this.selector = null;\n return this;\n};\n\n/**\n *\n * A dashboard component is an empty div rendered on a dashboard that can display custom\n * html of user interface elements. LocusZoom.Dashboard.Components is a singleton used to\n * define and manage an extendable collection of dashboard components.\n * (e.g. by LocusZoom.Dashboard.Components.add())\n * @class\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @param {('left'|'right')} [layout.position='left'] Whether to float the component left or right.\n * @param {('start'|'middle'|'end')} [layout.group_position] Buttons can optionally be gathered into a visually\n * distinctive group whose elements are closer together. If a button is identified as the start or end of a group,\n * it will be drawn with rounded corners and an extra margin of spacing from any button not part of the group.\n * For example, the region_nav_plot dashboard is a defined as a group.\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple'} [layout.color='gray'] Color scheme for the\n * component. Applies to buttons and menus.\n * @param {LocusZoom.Dashboard} parent The dashboard that contains this component\n*/\nLocusZoom.Dashboard.Component = function(layout, parent) {\n /** @member {Object} */\n this.layout = layout || {};\n if (!this.layout.color){ this.layout.color = \"gray\"; }\n\n /** @member {LocusZoom.Dashboard|*} */\n this.parent = parent || null;\n /**\n * Some dashboards are attached to a panel, rather than directly to a plot\n * @member {LocusZoom.Panel|null}\n */\n this.parent_panel = null;\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n /**\n * This is a reference to either the panel or the plot, depending on what the dashboard is\n * tied to. Useful when absolutely positioning dashboard components relative to their SVG anchor.\n * @member {LocusZoom.Plot|LocusZoom.Panel}\n */\n this.parent_svg = null;\n if (this.parent instanceof LocusZoom.Dashboard){\n // TODO: when is the immediate parent *not* a dashboard?\n if (this.parent.type === \"panel\"){\n this.parent_panel = this.parent.parent;\n this.parent_plot = this.parent.parent.parent;\n this.parent_svg = this.parent_panel;\n } else {\n this.parent_plot = this.parent.parent;\n this.parent_svg = this.parent_plot;\n }\n }\n /** @member {d3.selection} */\n this.selector = null;\n /**\n * If this is an interactive component, it will contain a button or menu instance that handles the interactivity.\n * There is a 1-to-1 relationship of dashboard component to button\n * @member {null|LocusZoom.Dashboard.Component.Button}\n */\n this.button = null;\n /**\n * If any single component is marked persistent, it will bubble up to prevent automatic hide behavior on a\n * component's parent dashboard. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n if (!this.layout.position){ this.layout.position = \"left\"; }\n\n // TODO: Return value in constructor\n return this;\n};\n/**\n * Perform all rendering of component, including toggling visibility to true. Will initialize and create SVG element\n * if necessary, as well as updating with new data and performing layout actions.\n */\nLocusZoom.Dashboard.Component.prototype.show = function(){\n if (!this.parent || !this.parent.selector){ return; }\n if (!this.selector){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.layout.group_position) !== -1 ? \" lz-dashboard-group-\" + this.layout.group_position : \"\");\n this.selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-\" + this.layout.position + group_position);\n if (this.layout.style){ this.selector.style(this.layout.style); }\n if (typeof this.initialize == \"function\"){ this.initialize(); }\n }\n if (this.button && this.button.status === \"highlighted\"){ this.button.menu.show(); }\n this.selector.style({ visibility: \"visible\" });\n this.update();\n return this.position();\n};\n/**\n * Update the dashboard component with any new data or plot state as appropriate. This method performs all\n * necessary rendering steps.\n */\nLocusZoom.Dashboard.Component.prototype.update = function(){ /* stub */ };\n/**\n * Place the component correctly in the plot\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.position = function(){\n if (this.button){ this.button.menu.position(); }\n return this;\n};\n/**\n * Determine whether the component should persist (will bubble up to parent dashboard)\n * @returns {boolean}\n */\nLocusZoom.Dashboard.Component.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n if (this.button && this.button.persist){ return true; }\n return false;\n};\n/**\n * Toggle visibility to hidden, unless marked as persistent\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n if (this.button){ this.button.menu.hide(); }\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n/**\n * Completely remove component and button. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.Component.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n if (this.button && this.button.menu){ this.button.menu.destroy(); }\n this.selector.remove();\n this.selector = null;\n this.button = null;\n return this;\n};\n\n/**\n * Singleton registry of all known components\n * @class\n * @static\n */\nLocusZoom.Dashboard.Components = (function() {\n /** @lends LocusZoom.Dashboard.Components */\n var obj = {};\n var components = {};\n\n /**\n * Create a new component instance by name\n * @param {String} name The string identifier of the desired component\n * @param {Object} layout The layout to use to create the component\n * @param {LocusZoom.Dashboard} parent The containing dashboard to use when creating the component\n * @returns {LocusZoom.Dashboard.Component}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (components[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for dashboard component [\" + name + \"]\");\n } else {\n return new components[name](layout, parent);\n }\n } else {\n throw(\"dashboard component [\" + name + \"] not found\");\n }\n };\n /**\n * Add a new component constructor to the registry and ensure that it extends the correct parent class\n * @protected\n * @param name\n * @param component\n */\n obj.set = function(name, component) {\n if (component) {\n if (typeof component != \"function\"){\n throw(\"unable to set dashboard component [\" + name + \"], argument provided is not a function\");\n } else {\n components[name] = component;\n components[name].prototype = new LocusZoom.Dashboard.Component();\n }\n } else {\n delete components[name];\n }\n };\n\n /**\n * Register a new component constructor by name\n * @param {String} name\n * @param {function} component The component constructor\n */\n obj.add = function(name, component) {\n if (components[name]) {\n throw(\"dashboard component already exists with name: \" + name);\n } else {\n obj.set(name, component);\n }\n };\n\n /**\n * List the names of all registered components\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(components);\n };\n\n return obj;\n})();\n\n/**\n * Plots and panels may have a \"dashboard\" element suited for showing HTML components that may be interactive.\n * When components need to incorporate a generic button, or additionally a button that generates a menu, this\n * class provides much of the necessary framework.\n * @class\n * @param {LocusZoom.Dashboard.Component} parent\n */\nLocusZoom.Dashboard.Component.Button = function(parent) { \n \n if (!(parent instanceof LocusZoom.Dashboard.Component)){\n throw \"Unable to create dashboard component button, invalid parent\";\n }\n /** @member {LocusZoom.Dashboard.Component} */\n this.parent = parent;\n /** @member {LocusZoom.Dashboard.Panel} */\n this.parent_panel = this.parent.parent_panel;\n /** @member {LocusZoom.Dashboard.Plot} */\n this.parent_plot = this.parent.parent_plot;\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent_svg = this.parent.parent_svg;\n\n /** @member {LocusZoom.Dashboard|null|*} */\n this.parent_dashboard = this.parent.parent;\n /** @member {d3.selection} */\n this.selector = null;\n\n /**\n * Tag to use for the button (default: a)\n * @member {String}\n */\n this.tag = \"a\";\n\n /**\n * TODO This method does not appear to be used anywhere\n * @param {String} tag\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTag = function(tag){\n if (typeof tag != \"undefined\"){ this.tag = tag.toString(); }\n return this;\n };\n\n /**\n * HTML for the button to show.\n * @protected\n * @member {String}\n */\n this.html = \"\";\n /**\n * Specify the HTML content of this button.\n * WARNING: The string provided will be inserted into the document as raw markup; XSS mitigation is the\n * responsibility of each button implementation.\n * @param {String} html\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setHtml = function(html){\n if (typeof html != \"undefined\"){ this.html = html.toString(); }\n return this;\n };\n /**\n * @deprecated since 0.5.6; use setHTML instead\n */\n this.setText = this.setHTML;\n\n /**\n * Mouseover title text for the button to show\n * @protected\n * @member {String}\n */\n this.title = \"\";\n /**\n * Set the mouseover title text for the button (if any)\n * @param {String} title Simple text to display\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTitle = function(title){\n if (typeof title != \"undefined\"){ this.title = title.toString(); }\n return this;\n };\n\n /**\n * Color of the button\n * @member {String}\n */\n this.color = \"gray\";\n\n /**\n * Set the color associated with this button\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple')} color Any selection not in the preset list\n * will be replaced with gray.\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setColor = function(color){\n if (typeof color != \"undefined\"){\n if ([\"gray\", \"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"purple\"].indexOf(color) !== -1){ this.color = color; }\n else { this.color = \"gray\"; }\n }\n return this;\n };\n\n /**\n * Hash of arbitrary button styles to apply as {name: value} entries\n * @protected\n * @member {Object}\n */\n this.style = {};\n /**\n * Set a collection of custom styles to be used by the button\n * @param {Object} style Hash of {name:value} entries\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setStyle = function(style){\n if (typeof style != \"undefined\"){ this.style = style; }\n return this;\n };\n\n //\n /**\n * Method to generate a CSS class string\n * @returns {string}\n */\n this.getClass = function(){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.parent.layout.group_position) !== -1 ? \" lz-dashboard-button-group-\" + this.parent.layout.group_position : \"\");\n return \"lz-dashboard-button lz-dashboard-button-\" + this.color + (this.status ? \"-\" + this.status : \"\") + group_position;\n };\n\n // Permanence\n /**\n * Track internal state on whether to keep showing the button/ menu contents at the moment\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n /**\n * Configuration when defining a button: track whether this component should be allowed to keep open\n * menu/button contents in response to certain events\n * @protected\n * @member {Boolean}\n */\n this.permanent = false;\n /**\n * Allow code to change whether the button is allowed to be `permanent`\n * @param {boolean} bool\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setPermanent = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n this.permanent = bool;\n if (this.permanent){ this.persist = true; }\n return this;\n };\n /**\n * Determine whether the button/menu contents should persist in response to a specific event\n * @returns {Boolean}\n */\n this.shouldPersist = function(){\n return this.permanent || this.persist;\n };\n\n /**\n * Button status (highlighted / disabled/ etc)\n * @protected\n * @member {String}\n */\n this.status = \"\";\n /**\n * Change button state\n * @param {('highlighted'|'disabled'|'')} status\n */\n this.setStatus = function(status){\n if (typeof status != \"undefined\" && [\"\", \"highlighted\", \"disabled\"].indexOf(status) !== -1){ this.status = status; }\n return this.update();\n };\n /**\n * Toggle whether the button is highlighted\n * @param {boolean} bool If provided, explicitly set highlighted state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.highlight = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"highlighted\"); }\n else if (this.status === \"highlighted\"){ return this.setStatus(\"\"); }\n return this;\n };\n /**\n * Toggle whether the button is disabled\n * @param {boolean} bool If provided, explicitly set disabled state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.disable = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"disabled\"); }\n else if (this.status === \"disabled\"){ return this.setStatus(\"\"); }\n return this;\n };\n\n // Mouse events\n /** @member {function} */\n this.onmouseover = function(){};\n this.setOnMouseover = function(onmouseover){\n if (typeof onmouseover == \"function\"){ this.onmouseover = onmouseover; }\n else { this.onmouseover = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onmouseout = function(){};\n this.setOnMouseout = function(onmouseout){\n if (typeof onmouseout == \"function\"){ this.onmouseout = onmouseout; }\n else { this.onmouseout = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onclick = function(){};\n this.setOnclick = function(onclick){\n if (typeof onclick == \"function\"){ this.onclick = onclick; }\n else { this.onclick = function(){}; }\n return this;\n };\n \n // Primary behavior functions\n /**\n * Show the button, including creating DOM elements if necessary for first render\n */\n this.show = function(){\n if (!this.parent){ return; }\n if (!this.selector){\n this.selector = this.parent.selector.append(this.tag).attr(\"class\", this.getClass());\n }\n return this.update();\n };\n /**\n * Hook for any actions or state cleanup to be performed before rerendering\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.preUpdate = function(){ return this; };\n /**\n * Update button state and contents, and fully rerender\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.update = function(){\n if (!this.selector){ return this; }\n this.preUpdate();\n this.selector\n .attr(\"class\", this.getClass())\n .attr(\"title\", this.title).style(this.style)\n .on(\"mouseover\", (this.status === \"disabled\") ? null : this.onmouseover)\n .on(\"mouseout\", (this.status === \"disabled\") ? null : this.onmouseout)\n .on(\"click\", (this.status === \"disabled\") ? null : this.onclick)\n .html(this.html);\n this.menu.update();\n this.postUpdate();\n return this;\n };\n /**\n * Hook for any behavior to be added/changed after the button has been re-rendered\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.postUpdate = function(){ return this; };\n /**\n * Hide the button by removing it from the DOM (may be overridden by current persistence setting)\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.hide = function(){\n if (this.selector && !this.shouldPersist()){\n this.selector.remove();\n this.selector = null;\n }\n return this;\n }; \n\n /**\n * Button Menu Object\n * The menu is an HTML overlay that can appear below a button. It can contain arbitrary HTML and\n * has logic to be automatically positioned and sized to behave more or less like a dropdown menu.\n * @member {Object}\n */\n this.menu = {\n outer_selector: null,\n inner_selector: null,\n scroll_position: 0,\n hidden: true,\n /**\n * Show the button menu, including setting up any DOM elements needed for first rendering\n */\n show: function(){\n if (!this.menu.outer_selector){\n this.menu.outer_selector = d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu lz-dashboard-menu-\" + this.color)\n .attr(\"id\", this.parent_svg.getBaseId() + \".dashboard.menu\");\n this.menu.inner_selector = this.menu.outer_selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu-content\");\n this.menu.inner_selector.on(\"scroll\", function(){\n this.menu.scroll_position = this.menu.inner_selector.node().scrollTop;\n }.bind(this));\n }\n this.menu.outer_selector.style({ visibility: \"visible\" });\n this.menu.hidden = false;\n return this.menu.update();\n }.bind(this),\n /**\n * Update the rendering of the menu\n */\n update: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.populate(); // This function is stubbed for all buttons by default and custom implemented in component definition\n if (this.menu.inner_selector){ this.menu.inner_selector.node().scrollTop = this.menu.scroll_position; }\n return this.menu.position();\n }.bind(this),\n position: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n // Unset any explicitly defined outer selector height so that menus dynamically shrink if content is removed\n this.menu.outer_selector.style({ height: null });\n var padding = 3;\n var scrollbar_padding = 20;\n var menu_height_padding = 14; // 14: 2x 6px padding, 2x 1px border\n var page_origin = this.parent_svg.getPageOrigin();\n var page_scroll_top = document.documentElement.scrollTop || document.body.scrollTop;\n var container_offset = this.parent_plot.getContainerOffset();\n var dashboard_client_rect = this.parent_dashboard.selector.node().getBoundingClientRect();\n var button_client_rect = this.selector.node().getBoundingClientRect();\n var menu_client_rect = this.menu.outer_selector.node().getBoundingClientRect();\n var total_content_height = this.menu.inner_selector.node().scrollHeight;\n var top = 0; var left = 0;\n if (this.parent_dashboard.type === \"panel\"){\n top = (page_origin.y + dashboard_client_rect.height + (2 * padding));\n left = Math.max(page_origin.x + this.parent_svg.layout.width - menu_client_rect.width - padding, page_origin.x + padding);\n } else {\n top = button_client_rect.bottom + page_scroll_top + padding - container_offset.top;\n left = Math.max(button_client_rect.left + button_client_rect.width - menu_client_rect.width - container_offset.left, page_origin.x + padding);\n }\n var base_max_width = Math.max(this.parent_svg.layout.width - (2 * padding) - scrollbar_padding, scrollbar_padding);\n var container_max_width = base_max_width;\n var content_max_width = (base_max_width - (4 * padding));\n var base_max_height = Math.max(this.parent_svg.layout.height - (10 * padding) - menu_height_padding, menu_height_padding);\n var height = Math.min(total_content_height, base_max_height);\n var max_height = base_max_height;\n this.menu.outer_selector.style({\n \"top\": top.toString() + \"px\",\n \"left\": left.toString() + \"px\",\n \"max-width\": container_max_width.toString() + \"px\",\n \"max-height\": max_height.toString() + \"px\",\n \"height\": height.toString() + \"px\"\n });\n this.menu.inner_selector.style({ \"max-width\": content_max_width.toString() + \"px\" });\n this.menu.inner_selector.node().scrollTop = this.menu.scroll_position;\n return this.menu;\n }.bind(this),\n hide: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.outer_selector.style({ visibility: \"hidden\" });\n this.menu.hidden = true;\n return this.menu;\n }.bind(this),\n destroy: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.inner_selector.remove();\n this.menu.outer_selector.remove();\n this.menu.inner_selector = null;\n this.menu.outer_selector = null;\n return this.menu;\n }.bind(this),\n /**\n * Internal method definition\n * By convention populate() does nothing and should be reimplemented with each dashboard button definition\n * Reimplement by way of Dashboard.Component.Button.menu.setPopulate to define the populate method and hook\n * up standard menu click-toggle behavior prototype.\n * @protected\n */\n populate: function(){ /* stub */ }.bind(this),\n /**\n * Define how the menu is populated with items, and set up click and display properties as appropriate\n * @public\n */\n setPopulate: function(menu_populate_function){\n if (typeof menu_populate_function == \"function\"){\n this.menu.populate = menu_populate_function;\n this.setOnclick(function(){\n if (this.menu.hidden){\n this.menu.show();\n this.highlight().update();\n this.persist = true;\n } else {\n this.menu.hide();\n this.highlight(false).update();\n if (!this.permanent){ this.persist = false; }\n }\n }.bind(this));\n } else {\n this.setOnclick();\n }\n return this;\n }.bind(this)\n };\n\n};\n\n/**\n * Renders arbitrary text with title formatting\n * @class LocusZoom.Dashboard.Components.title\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.title Text to render\n */\nLocusZoom.Dashboard.Components.add(\"title\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.show = function(){\n this.div_selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-title lz-dashboard-\" + this.layout.position);\n this.title_selector = this.div_selector.append(\"h3\");\n return this.update();\n };\n this.update = function(){\n var title = layout.title.toString();\n if (this.layout.subtitle){ title += \" \" + this.layout.subtitle + \"\"; }\n this.title_selector.html(title);\n return this;\n };\n});\n\n/**\n * Renders text to display the current dimensions of the plot. Automatically updated as plot dimensions change\n * @class LocusZoom.Dashboard.Components.dimensions\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"dimensions\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var display_width = this.parent_plot.layout.width.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.width : this.parent_plot.layout.width.toFixed(2);\n var display_height = this.parent_plot.layout.height.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.height : this.parent_plot.layout.height.toFixed(2);\n this.selector.html(display_width + \"px × \" + display_height + \"px\");\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Display the current scale of the genome region displayed in the plot, as defined by the difference between\n * `state.end` and `state.start`.\n * @class LocusZoom.Dashboard.Components.region_scale\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"region_scale\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (!isNaN(this.parent_plot.state.start) && !isNaN(this.parent_plot.state.end)\n && this.parent_plot.state.start !== null && this.parent_plot.state.end !== null){\n this.selector.style(\"display\", null);\n this.selector.html(LocusZoom.positionIntToString(this.parent_plot.state.end - this.parent_plot.state.start, null, true));\n } else {\n this.selector.style(\"display\", \"none\");\n }\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Button to export current plot to an SVG image\n * @class LocusZoom.Dashboard.Components.download\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"download\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Download Image\").setTitle(\"Download image of the current plot as locuszoom.svg\")\n .setOnMouseover(function() {\n this.button.selector\n .classed(\"lz-dashboard-button-gray-disabled\", true)\n .html(\"Preparing Image\");\n this.generateBase64SVG().then(function(base64_string){\n this.button.selector\n .attr(\"href\", \"data:image/svg+xml;base64,\\n\" + base64_string)\n .classed(\"lz-dashboard-button-gray-disabled\", false)\n .classed(\"lz-dashboard-button-gray-highlighted\", true)\n .html(\"Download Image\");\n }.bind(this));\n }.bind(this))\n .setOnMouseout(function() {\n this.button.selector.classed(\"lz-dashboard-button-gray-highlighted\", false);\n }.bind(this));\n this.button.show();\n this.button.selector.attr(\"href-lang\", \"image/svg+xml\").attr(\"download\", \"locuszoom.svg\");\n return this;\n };\n this.css_string = \"\";\n for (var stylesheet in Object.keys(document.styleSheets)){\n if ( document.styleSheets[stylesheet].href !== null\n && document.styleSheets[stylesheet].href.indexOf(\"locuszoom.css\") !== -1){\n // TODO: \"Download image\" button will render the image incorrectly if the stylesheet has been renamed or concatenated\n LocusZoom.createCORSPromise(\"GET\", document.styleSheets[stylesheet].href)\n .then(function(response){\n this.css_string = response.replace(/[\\r\\n]/g,\" \").replace(/\\s+/g,\" \");\n if (this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\")){\n this.css_string = this.css_string.substring(0, this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\"));\n }\n }.bind(this));\n break;\n }\n } \n this.generateBase64SVG = function(){\n return Q.fcall(function () {\n // Insert a hidden div, clone the node into that so we can modify it with d3\n var container = this.parent.selector.append(\"div\").style(\"display\", \"none\")\n .html(this.parent_plot.svg.node().outerHTML);\n // Remove unnecessary elements\n container.selectAll(\"g.lz-curtain\").remove();\n container.selectAll(\"g.lz-mouse_guide\").remove();\n // Convert units on axis tick dy attributes from ems to pixels\n container.selectAll(\"g.tick text\").each(function(){\n var dy = +(d3.select(this).attr(\"dy\").substring(-2).slice(0,-2))*10;\n d3.select(this).attr(\"dy\", dy);\n });\n // Pull the svg into a string and add the contents of the locuszoom stylesheet\n // Don't add this with d3 because it will escape the CDATA declaration incorrectly\n var initial_html = d3.select(container.select(\"svg\").node().parentNode).html();\n var style_def = \"\";\n var insert_at = initial_html.indexOf(\">\") + 1;\n initial_html = initial_html.slice(0,insert_at) + style_def + initial_html.slice(insert_at);\n // Delete the container node\n container.remove();\n // Base64-encode the string and return it\n return btoa(encodeURIComponent(initial_html).replace(/%([0-9A-F]{2})/g, function(match, p1) {\n return String.fromCharCode(\"0x\" + p1);\n }));\n }.bind(this));\n };\n});\n\n/**\n * Button to remove panel from plot.\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.remove_panel\n * @augments LocusZoom.Dashboard.Component\n * @param {Boolean} [layout.suppress_confirm=false] If true, removes the panel without prompting user for confirmation\n */\nLocusZoom.Dashboard.Components.add(\"remove_panel\", function(layout) {\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function() {\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"×\").setTitle(\"Remove panel\")\n .setOnclick(function(){\n if (!layout.suppress_confirm && !confirm(\"Are you sure you want to remove this panel? This cannot be undone!\")){\n return false;\n }\n var panel = this.parent_panel;\n panel.dashboard.hide(true);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseover.\" + panel.getBaseId() + \".dashboard\", null);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseout.\" + panel.getBaseId() + \".dashboard\", null);\n return panel.parent.removePanel(panel.id);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to move panel up relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_up\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_up\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_top = (this.parent_panel.layout.y_index === 0);\n this.button.disable(is_at_top);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▴\").setTitle(\"Move panel up\")\n .setOnclick(function(){\n this.parent_panel.moveUp();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to move panel down relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_down\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_down\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_bottom = (this.parent_panel.layout.y_index === this.parent_plot.panel_ids_by_y_index.length-1);\n this.button.disable(is_at_bottom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▾\").setTitle(\"Move panel down\")\n .setOnclick(function(){\n this.parent_panel.moveDown();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to shift plot region forwards or back by a `step` increment provided in the layout\n * @class LocusZoom.Dashboard.Components.shift_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=50000] The stepsize to change the region by\n * @param {string} [layout.button_html]\n * @param {string} [layout.button_title]\n */\nLocusZoom.Dashboard.Components.add(\"shift_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add shift_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 50000; }\n if (typeof layout.button_html !== \"string\"){ layout.button_html = layout.step > 0 ? \">\" : \"<\"; }\n if (typeof layout.button_title !== \"string\"){\n layout.button_title = \"Shift region by \" + (layout.step > 0 ? \"+\" : \"-\") + LocusZoom.positionIntToString(Math.abs(layout.step),null,true);\n }\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start + layout.step, 1),\n end: this.parent_plot.state.end + layout.step\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Zoom in or out on the plot, centered on the middle of the plot region, by the specified amount\n * @class LocusZoom.Dashboard.Components.zoom_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=0.2] The amount to zoom in by (where 1 indicates 100%)\n */\nLocusZoom.Dashboard.Components.add(\"zoom_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add zoom_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 0.2; }\n if (typeof layout.button_html != \"string\"){ layout.button_html = layout.step > 0 ? \"z–\" : \"z+\"; }\n if (typeof layout.button_title != \"string\"){\n layout.button_title = \"Zoom region \" + (layout.step > 0 ? \"out\" : \"in\") + \" by \" + (Math.abs(layout.step)*100).toFixed(1) + \"%\";\n }\n this.update = function(){\n if (this.button){\n var can_zoom = true;\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n if (layout.step > 0 && !isNaN(this.parent_plot.layout.max_region_scale) && current_region_scale >= this.parent_plot.layout.max_region_scale){\n can_zoom = false;\n }\n if (layout.step < 0 && !isNaN(this.parent_plot.layout.min_region_scale) && current_region_scale <= this.parent_plot.layout.min_region_scale){\n can_zoom = false;\n }\n this.button.disable(!can_zoom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n var zoom_factor = 1 + layout.step;\n var new_region_scale = current_region_scale * zoom_factor;\n if (!isNaN(this.parent_plot.layout.max_region_scale)){\n new_region_scale = Math.min(new_region_scale, this.parent_plot.layout.max_region_scale);\n }\n if (!isNaN(this.parent_plot.layout.min_region_scale)){\n new_region_scale = Math.max(new_region_scale, this.parent_plot.layout.min_region_scale);\n }\n var delta = Math.floor((new_region_scale - current_region_scale) / 2);\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start - delta, 1),\n end: this.parent_plot.state.end + delta\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Renders button with arbitrary text that, when clicked, shows a dropdown containing arbitrary HTML\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @class LocusZoom.Dashboard.Components.menu\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n * @param {string} layout.menu_html The HTML content of the dropdown menu\n */\nLocusZoom.Dashboard.Components.add(\"menu\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title);\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(layout.menu_html);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Special button/menu to allow model building by tracking individual covariants. Will track a list of covariate\n * objects and store them in the special `model.covariates` field of plot `state`.\n * @class LocusZoom.Dashboard.Components.covariates_model\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n */\nLocusZoom.Dashboard.Components.add(\"covariates_model\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.initialize = function(){\n // Initialize state.model.covariates\n this.parent_plot.state.model = this.parent_plot.state.model || {};\n this.parent_plot.state.model.covariates = this.parent_plot.state.model.covariates || [];\n // Create an object at the plot level for easy access to interface methods in custom client-side JS\n /**\n * When a covariates model dashboard element is present, create (one) object at the plot level that exposes\n * component data and state for custom interactions with other plot elements.\n * @class LocusZoom.Plot.CovariatesModel\n */\n this.parent_plot.CovariatesModel = {\n /** @member {LocusZoom.Dashboard.Component.Button} */\n button: this,\n /**\n * Add an element to the model and show a representation of it in the dashboard component menu. If the\n * element is already part of the model, do nothing (to avoid adding duplicates).\n * When plot state is changed, this will automatically trigger requests for new data accordingly.\n * @param {string|object} element_reference Can be any value that can be put through JSON.stringify()\n * to create a serialized representation of itself.\n */\n add: function(element_reference){\n var element = JSON.parse(JSON.stringify(element_reference));\n if (typeof element_reference == \"object\" && typeof element.html != \"string\"){\n element.html = ( (typeof element_reference.toHTML == \"function\") ? element_reference.toHTML() : element_reference.toString());\n }\n // Check if the element is already in the model covariates array and return if it is.\n for (var i = 0; i < this.state.model.covariates.length; i++) {\n if (JSON.stringify(this.state.model.covariates[i]) === JSON.stringify(element)) {\n return this;\n }\n }\n this.state.model.covariates.push(element);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Remove an element from `state.model.covariates` (and from the dashboard component menu's\n * representation of the state model). When plot state is changed, this will automatically trigger\n * requests for new data accordingly.\n * @param {number} idx Array index of the element, in the `state.model.covariates array`.\n */\n removeByIdx: function(idx){\n if (typeof this.state.model.covariates[idx] == \"undefined\"){\n throw(\"Unable to remove model covariate, invalid index: \" + idx.toString());\n }\n this.state.model.covariates.splice(idx, 1);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Empty the `state.model.covariates` array (and dashboard component menu representation thereof) of all\n * elements. When plot state is changed, this will automatically trigger requests for new data accordingly\n */\n removeAll: function(){\n this.state.model.covariates = [];\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Manually trigger the update methods on the dashboard component's button and menu elements to force\n * display of most up-to-date content. Can be used to force the dashboard to reflect changes made, eg if\n * modifying `state.model.covariates` directly instead of via `plot.CovariatesModel`\n */\n updateComponent: function(){\n this.button.update();\n this.button.menu.update();\n }.bind(this)\n };\n }.bind(this);\n\n this.update = function(){\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n var selector = this.button.menu.inner_selector;\n selector.html(\"\");\n // General model HTML representation\n if (typeof this.parent_plot.state.model.html != \"undefined\"){\n selector.append(\"div\").html(this.parent_plot.state.model.html);\n }\n // Model covariates table\n if (!this.parent_plot.state.model.covariates.length){\n selector.append(\"i\").html(\"no covariates in model\");\n } else {\n selector.append(\"h5\").html(\"Model Covariates (\" + this.parent_plot.state.model.covariates.length + \")\");\n var table = selector.append(\"table\");\n this.parent_plot.state.model.covariates.forEach(function(covariate, idx){\n var html = ( (typeof covariate == \"object\" && typeof covariate.html == \"string\") ? covariate.html : covariate.toString() );\n var row = table.append(\"tr\");\n row.append(\"td\").append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeByIdx(idx);\n }.bind(this))\n .html(\"×\");\n row.append(\"td\").html(html);\n }.bind(this));\n selector.append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"4px\" }).html(\"× Remove All Covariates\")\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeAll();\n }.bind(this));\n }\n }.bind(this));\n\n this.button.preUpdate = function(){\n var html = \"Model\";\n if (this.parent_plot.state.model.covariates.length){\n var cov = this.parent_plot.state.model.covariates.length > 1 ? \"covariates\" : \"covariate\";\n html += \" (\" + this.parent_plot.state.model.covariates.length + \" \" + cov + \")\";\n }\n this.button.setHtml(html).disable(false);\n }.bind(this);\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Button to toggle split tracks\n * @class LocusZoom.Dashboard.Components.toggle_split_tracks\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_split_tracks\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (!layout.data_layer_id){ layout.data_layer_id = \"intervals\"; }\n if (!this.parent_panel.data_layers[layout.data_layer_id]){\n throw (\"Dashboard toggle split tracks component missing valid data layer ID\");\n }\n this.update = function(){\n var data_layer = this.parent_panel.data_layers[layout.data_layer_id];\n var html = data_layer.layout.split_tracks ? \"Merge Tracks\" : \"Split Tracks\";\n if (this.button){\n this.button.setHtml(html);\n this.button.show();\n this.parent.position();\n return this;\n } else {\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(html)\n .setTitle(\"Toggle whether tracks are split apart or merged together\")\n .setOnclick(function(){\n data_layer.toggleSplitTracks();\n if (this.scale_timeout){ clearTimeout(this.scale_timeout); }\n var timeout = data_layer.layout.transition ? +data_layer.layout.transition.duration || 0 : 0;\n this.scale_timeout = setTimeout(function(){\n this.parent_panel.scaleHeightToData();\n this.parent_plot.positionPanels();\n }.bind(this), timeout);\n this.update();\n }.bind(this));\n return this.update();\n }\n };\n});\n\n/**\n * Button to resize panel height to fit available data (eg when showing a list of tracks)\n * @class LocusZoom.Dashboard.Components.resize_to_data\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"resize_to_data\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Resize to Data\")\n .setTitle(\"Automatically resize this panel to fit the data its currently showing\")\n .setOnclick(function(){\n this.parent_panel.scaleHeightToData();\n this.update();\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to toggle legend\n * @class LocusZoom.Dashboard.Components.toggle_legend\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_legend\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var html = this.parent_panel.legend.layout.hidden ? \"Show Legend\" : \"Hide Legend\";\n if (this.button){\n this.button.setHtml(html).show();\n this.parent.position();\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color)\n .setTitle(\"Show or hide the legend for this panel\")\n .setOnclick(function(){\n this.parent_panel.legend.layout.hidden = !this.parent_panel.legend.layout.hidden;\n this.parent_panel.legend.render();\n this.update();\n }.bind(this));\n return this.update();\n };\n});\n\n/**\n * Menu for manipulating multiple data layers in a single panel: show/hide, change order, etc.\n * @class LocusZoom.Dashboard.Components.data_layers\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"data_layers\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.update = function(){\n\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Data Layers\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Manipulate Data Layers (sort, dim, show/hide, etc.)\"; }\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(\"\");\n var table = this.button.menu.inner_selector.append(\"table\");\n this.parent_panel.data_layer_ids_by_z_index.slice().reverse().forEach(function(id, idx){\n var data_layer = this.parent_panel.data_layers[id];\n var name = (typeof data_layer.layout.name != \"string\") ? data_layer.id : data_layer.layout.name;\n var row = table.append(\"tr\");\n // Layer name\n row.append(\"td\").html(name);\n // Status toggle buttons\n layout.statuses.forEach(function(status_adj){\n var status_idx = LocusZoom.DataLayer.Statuses.adjectives.indexOf(status_adj);\n var status_verb = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n var html, onclick, highlight;\n if (data_layer.global_statuses[status_adj]){\n html = LocusZoom.DataLayer.Statuses.menu_antiverbs[status_idx];\n onclick = \"un\" + status_verb + \"AllElements\";\n highlight = \"-highlighted\";\n } else {\n html = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n onclick = status_verb + \"AllElements\";\n highlight = \"\";\n }\n row.append(\"td\").append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color + highlight)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer[onclick](); this.button.menu.populate(); }.bind(this))\n .html(html);\n }.bind(this));\n // Sort layer buttons\n var at_top = (idx === 0);\n var at_bottom = (idx === (this.parent_panel.data_layer_ids_by_z_index.length - 1));\n var td = row.append(\"td\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-start lz-dashboard-button-\" + this.layout.color + (at_bottom ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveDown(); this.button.menu.populate(); }.bind(this))\n .html(\"▾\").attr(\"title\", \"Move layer down (further back)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-middle lz-dashboard-button-\" + this.layout.color + (at_top ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveUp(); this.button.menu.populate(); }.bind(this))\n .html(\"▴\").attr(\"title\", \"Move layer up (further front)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-end lz-dashboard-button-red\")\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n if (confirm(\"Are you sure you want to remove the \" + name + \" layer? This cannot be undone!\")){\n data_layer.parent.removeDataLayer(id);\n }\n return this.button.menu.populate();\n }.bind(this))\n .html(\"×\").attr(\"title\", \"Remove layer\");\n }.bind(this));\n return this;\n }.bind(this));\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Dropdown menu allowing the user to choose between different display options for a single specific data layer\n * within a panel.\n *\n * This allows controlling how points on a datalayer can be displayed- any display options supported via the layout for the target datalayer. This includes point\n * size/shape, coloring, etc.\n *\n * This button intentionally limits display options it can control to those available on common plot types.\n * Although the list of options it sets can be overridden (to control very special custom plot types), this\n * capability should be used sparingly if at all.\n *\n * @class LocusZoom.Dashboard.Components.display_options\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {String} [layout.button_html=\"Display options\"] Text to display on the toolbar button\n * @param {String} [layout.button_title=\"Control how plot items are displayed\"] Hover text for the toolbar button\n * @param {string} layout.layer_name Specify the datalayer that this button should affect\n * @param {string} [layout.default_config_display_name] Store the default configuration for this datalayer\n * configuration, and show a button to revert to the \"default\" (listing the human-readable display name provided)\n * @param {Array} [layout.fields_whitelist='see code'] The list of presentation fields that this button can control.\n * This can be overridden if this button needs to be used on a custom layer type with special options.\n * @typedef {{display_name: string, display: Object}} DisplayOptionsButtonConfigField\n * @param {DisplayOptionsButtonConfigField[]} layout.options Specify a label and set of layout directives associated\n * with this `display` option. Display field should include all changes to datalayer presentation options.\n */\nLocusZoom.Dashboard.Components.add(\"display_options\", function (layout) {\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Display options\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Control how plot items are displayed\"; }\n\n // Call parent constructor\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n // List of layout fields that this button is allowed to control. This ensures that we don't override any other\n // information (like plot height etc) while changing point rendering\n var allowed_fields = layout.fields_whitelist || [\"color\", \"fill_opacity\", \"label\", \"legend\",\n \"point_shape\", \"point_size\", \"tooltip\", \"tooltip_positioning\"];\n\n var dataLayer = this.parent_panel.data_layers[layout.layer_name];\n var dataLayerLayout = dataLayer.layout;\n\n // Store default configuration for the layer as a clean deep copy, so we may revert later\n var defaultConfig = {};\n allowed_fields.forEach(function(name) {\n var configSlot = dataLayerLayout[name];\n if (configSlot) {\n defaultConfig[name] = JSON.parse(JSON.stringify(configSlot));\n }\n });\n\n /**\n * Which item in the menu is currently selected. (track for rerendering menu)\n * @member {String}\n * @private\n */\n this._selected_item = \"default\";\n\n // Define the button + menu that provides the real functionality for this dashboard component\n var self = this;\n this.button = new LocusZoom.Dashboard.Component.Button(self)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function () {\n self.button.menu.populate();\n });\n this.button.menu.setPopulate(function () {\n // Multiple copies of this button might be used on a single LZ page; append unique IDs where needed\n var uniqueID = Math.floor(Math.random() * 1e4).toString();\n\n self.button.menu.inner_selector.html(\"\");\n var table = self.button.menu.inner_selector.append(\"table\");\n\n var menuLayout = self.layout;\n\n var renderRow = function(display_name, display_options, row_id) { // Helper method\n var row = table.append(\"tr\");\n row.append(\"td\")\n .append(\"input\")\n .attr({type: \"radio\", name: \"color-picker-\" + uniqueID, value: row_id})\n .property(\"checked\", (row_id === self._selected_item))\n .on(\"click\", function () {\n Object.keys(display_options).forEach(function(field_name) {\n dataLayer.layout[field_name] = display_options[field_name];\n });\n self._selected_item = row_id;\n self.parent_panel.render();\n var legend = self.parent_panel.legend;\n if (legend && display_options.legend) {\n // Update the legend only if necessary\n legend.render();\n }\n });\n row.append(\"td\").text(display_name);\n };\n // Render the \"display options\" menu: default and special custom options\n var defaultName = menuLayout.default_config_display_name || \"Default style\";\n renderRow(defaultName, defaultConfig, \"default\");\n menuLayout.options.forEach(function (item, index) {\n renderRow(item.display_name, item.display, index);\n });\n return self;\n });\n\n this.update = function () {\n this.button.show();\n return this;\n };\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * An SVG object used to display contextual information about a panel.\n * Panel layouts determine basic features of a legend - its position in the panel, orientation, title, etc.\n * Layouts of child data layers of the panel determine the actual content of the legend.\n *\n * @class\n * @param {LocusZoom.Panel} parent\n*/\nLocusZoom.Legend = function(parent){\n if (!(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create legend, parent must be a locuszoom panel\";\n }\n /** @member {LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".legend\";\n\n this.parent.layout.legend = LocusZoom.Layouts.merge(this.parent.layout.legend || {}, LocusZoom.Legend.DefaultLayout);\n /** @member {Object} */\n this.layout = this.parent.layout.legend;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {d3.selection} */\n this.background_rect = null;\n /** @member {d3.selection[]} */\n this.elements = [];\n /**\n * SVG selector for the group containing all elements in the legend\n * @protected\n * @member {d3.selection|null}\n */\n this.elements_group = null;\n\n /**\n * TODO: Not sure if this property is used; the external-facing methods are setting `layout.hidden` instead. Tentatively mark deprecated.\n * @deprecated\n * @protected\n * @member {Boolean}\n */\n this.hidden = false;\n\n // TODO Revisit constructor return value; see https://stackoverflow.com/a/3350364/1422268\n return this.render();\n};\n\n/**\n * The default layout used by legends (used internally)\n * @protected\n * @member {Object}\n */\nLocusZoom.Legend.DefaultLayout = {\n orientation: \"vertical\",\n origin: { x: 0, y: 0 },\n width: 10,\n height: 10,\n padding: 5,\n label_size: 12,\n hidden: false\n};\n\n/**\n * Render the legend in the parent panel\n */\nLocusZoom.Legend.prototype.render = function(){\n\n // Get a legend group selector if not yet defined\n if (!this.selector){\n this.selector = this.parent.svg.group.append(\"g\")\n .attr(\"id\", this.parent.getBaseId() + \".legend\").attr(\"class\", \"lz-legend\");\n }\n\n // Get a legend background rect selector if not yet defined\n if (!this.background_rect){\n this.background_rect = this.selector.append(\"rect\")\n .attr(\"width\", 100).attr(\"height\", 100).attr(\"class\", \"lz-legend-background\");\n }\n\n // Get a legend elements group selector if not yet defined\n if (!this.elements_group){\n this.elements_group = this.selector.append(\"g\");\n }\n\n // Remove all elements from the document and re-render from scratch\n this.elements.forEach(function(element){\n element.remove();\n });\n this.elements = [];\n\n // Gather all elements from data layers in order (top to bottom) and render them\n var padding = +this.layout.padding || 1;\n var x = padding;\n var y = padding;\n var line_height = 0;\n this.parent.data_layer_ids_by_z_index.slice().reverse().forEach(function(id){\n if (Array.isArray(this.parent.data_layers[id].layout.legend)){\n this.parent.data_layers[id].layout.legend.forEach(function(element){\n var selector = this.elements_group.append(\"g\")\n .attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n var label_size = +element.label_size || +this.layout.label_size || 12;\n var label_x = 0;\n var label_y = (label_size/2) + (padding/2);\n line_height = Math.max(line_height, label_size + padding);\n // Draw the legend element symbol (line, rect, shape, etc)\n if (element.shape === \"line\"){\n // Line symbol\n var length = +element.length || 16;\n var path_y = (label_size/4) + (padding/2);\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", \"M0,\" + path_y + \"L\" + length + \",\" + path_y)\n .style(element.style || {});\n label_x = length + padding;\n } else if (element.shape === \"rect\"){\n // Rect symbol\n var width = +element.width || 16;\n var height = +element.height || width;\n selector.append(\"rect\").attr(\"class\", element.class || \"\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = width + padding;\n line_height = Math.max(line_height, height + padding);\n } else if (d3.svg.symbolTypes.indexOf(element.shape) !== -1) {\n // Shape symbol (circle, diamond, etc.)\n var size = +element.size || 40;\n var radius = Math.ceil(Math.sqrt(size/Math.PI));\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", d3.svg.symbol().size(size).type(element.shape))\n .attr(\"transform\", \"translate(\" + radius + \",\" + (radius+(padding/2)) + \")\")\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = (2*radius) + padding;\n label_y = Math.max((2*radius)+(padding/2), label_y);\n line_height = Math.max(line_height, (2*radius) + padding);\n }\n // Draw the legend element label\n selector.append(\"text\").attr(\"text-anchor\", \"left\").attr(\"class\", \"lz-label\")\n .attr(\"x\", label_x).attr(\"y\", label_y).style({\"font-size\": label_size}).text(element.label);\n // Position the legend element group based on legend layout orientation\n var bcr = selector.node().getBoundingClientRect();\n if (this.layout.orientation === \"vertical\"){\n y += bcr.height + padding;\n line_height = 0;\n } else {\n // Ensure this element does not exceed the panel width\n // (E.g. drop to the next line if it does, but only if it's not the only element on this line)\n var right_x = this.layout.origin.x + x + bcr.width;\n if (x > padding && right_x > this.parent.layout.width){\n y += line_height;\n x = padding;\n selector.attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n }\n x += bcr.width + (3*padding);\n }\n // Store the element\n this.elements.push(selector);\n }.bind(this));\n }\n }.bind(this));\n\n // Scale the background rect to the elements in the legend\n var bcr = this.elements_group.node().getBoundingClientRect();\n this.layout.width = bcr.width + (2*this.layout.padding);\n this.layout.height = bcr.height + (2*this.layout.padding);\n this.background_rect\n .attr(\"width\", this.layout.width)\n .attr(\"height\", this.layout.height);\n\n // Set the visibility on the legend from the \"hidden\" flag\n // TODO: `show()` and `hide()` call a full rerender; might be able to make this more lightweight?\n this.selector.style({ visibility: this.layout.hidden ? \"hidden\" : \"visible\" });\n\n // TODO: Annotate return type and make consistent\n return this.position();\n};\n\n/**\n * Place the legend in position relative to the panel, as specified in the layout configuration\n * @returns {LocusZoom.Legend | null}\n * TODO: should this always be chainable?\n */\nLocusZoom.Legend.prototype.position = function(){\n if (!this.selector){ return this; }\n var bcr = this.selector.node().getBoundingClientRect();\n if (!isNaN(+this.layout.pad_from_bottom)){\n this.layout.origin.y = this.parent.layout.height - bcr.height - +this.layout.pad_from_bottom;\n }\n if (!isNaN(+this.layout.pad_from_right)){\n this.layout.origin.x = this.parent.layout.width - bcr.width - +this.layout.pad_from_right;\n }\n this.selector.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n};\n\n/**\n * Hide the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.hide = function(){\n this.layout.hidden = true;\n this.render();\n};\n\n/**\n * Show the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.show = function(){\n this.layout.hidden = false;\n this.render();\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * LocusZoom functionality used for data parsing and retrieval\n * @namespace\n * @public\n */\nLocusZoom.Data = LocusZoom.Data || {};\n\n/**\n * Create and coordinate an ensemble of (namespaced) data source instances\n * @public\n * @class\n */\nLocusZoom.DataSources = function() {\n /** @member {Object.} */\n this.sources = {};\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.addSource = function(ns, x) {\n console.warn(\"Warning: .addSource() is deprecated. Use .add() instead\");\n return this.add(ns, x);\n};\n\n/**\n * Add a (namespaced) datasource to the plot\n * @public\n * @param {String} ns A namespace used for fields from this data source\n * @param {LocusZoom.Data.Source|Array|null} x An instantiated datasource, or an array of arguments that can be used to\n * create a known datasource type.\n */\nLocusZoom.DataSources.prototype.add = function(ns, x) {\n return this.set(ns, x);\n};\n\n/** @protected */\nLocusZoom.DataSources.prototype.set = function(ns, x) {\n if (Array.isArray(x)) {\n // If passed array of source name and options, make the source\n var dsobj = LocusZoom.KnownDataSources.create.apply(null, x);\n // Each datasource in the chain should be aware of its assigned namespace\n dsobj.source_id = ns;\n this.sources[ns] = dsobj;\n } else {\n // If passed the already-created source object\n if (x !== null) {\n x.source_id = ns;\n this.sources[ns] = x;\n } else {\n delete this.sources[ns];\n }\n }\n return this;\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.getSource = function(ns) {\n console.warn(\"Warning: .getSource() is deprecated. Use .get() instead\");\n return this.get(ns);\n};\n\n/**\n * Return the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n * @returns {LocusZoom.Data.Source}\n */\nLocusZoom.DataSources.prototype.get = function(ns) {\n return this.sources[ns];\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.removeSource = function(ns) {\n console.warn(\"Warning: .removeSource() is deprecated. Use .remove() instead\");\n return this.remove(ns);\n};\n\n/**\n * Remove the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n */\nLocusZoom.DataSources.prototype.remove = function(ns) {\n return this.set(ns, null);\n};\n\n/**\n * Populate a list of datasources specified as a JSON object\n * @public\n * @param {String|Object} x An object or JSON representation containing {ns: configArray} entries\n * @returns {LocusZoom.DataSources}\n */\nLocusZoom.DataSources.prototype.fromJSON = function(x) {\n if (typeof x === \"string\") {\n x = JSON.parse(x);\n }\n var ds = this;\n Object.keys(x).forEach(function(ns) {\n ds.set(ns, x[ns]);\n });\n return ds;\n};\n\n/**\n * Return the names of all currently recognized datasources\n * @public\n * @returns {Array}\n */\nLocusZoom.DataSources.prototype.keys = function() {\n return Object.keys(this.sources);\n};\n\n/**\n * Datasources can be instantiated from a JSON object instead of code. This represents existing sources in that format.\n * For example, this can be helpful when sharing plots, or to share settings with others when debugging\n * @public\n */\nLocusZoom.DataSources.prototype.toJSON = function() {\n return this.sources;\n};\n\n/**\n * Represents an addressable unit of data from a namespaced datasource, subject to specified value transformations.\n *\n * When used by a data layer, fields will automatically be re-fetched from the appropriate data source whenever the\n * state of a plot fetches, eg pan or zoom operations that would affect what data is displayed.\n *\n * @public\n * @class\n * @param {String} field A string representing the namespace of the datasource, the name of the desired field to fetch\n * from that datasource, and arbitrarily many transformations to apply to the value. The namespace and\n * transformation(s) are optional and information is delimited according to the general syntax\n * `[namespace:]name[|transformation][|transformation]`. For example, `association:pvalue|neglog10`\n */\nLocusZoom.Data.Field = function(field){\n \n var parts = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/.exec(field);\n /** @member {String} */\n this.full_name = field;\n /** @member {String} */\n this.namespace = parts[1] || null;\n /** @member {String} */\n this.name = parts[2] || null;\n /** @member {Array} */\n this.transformations = [];\n \n if (typeof parts[3] == \"string\" && parts[3].length > 1){\n this.transformations = parts[3].substring(1).split(\"|\");\n this.transformations.forEach(function(transform, i){\n this.transformations[i] = LocusZoom.TransformationFunctions.get(transform);\n }.bind(this));\n }\n\n this.applyTransformations = function(val){\n this.transformations.forEach(function(transform){\n val = transform(val);\n });\n return val;\n };\n\n // Resolve the field for a given data element.\n // First look for a full match with transformations already applied by the data requester.\n // Otherwise prefer a namespace match and fall back to just a name match, applying transformations on the fly.\n this.resolve = function(d){\n if (typeof d[this.full_name] == \"undefined\"){\n var val = null;\n if (typeof (d[this.namespace+\":\"+this.name]) != \"undefined\"){ val = d[this.namespace+\":\"+this.name]; }\n else if (typeof d[this.name] != \"undefined\"){ val = d[this.name]; }\n d[this.full_name] = this.applyTransformations(val);\n }\n return d[this.full_name];\n };\n \n};\n\n/**\n * The Requester manages fetching of data across multiple data sources. It is used internally by LocusZoom data layers.\n * It passes state information and ensures that data is formatted in the manner expected by the plot.\n *\n * It is also responsible for constructing a \"chain\" of dependent requests, by requesting each datasource\n * sequentially in the order specified in the datalayer `fields` array. Data sources are only chained within a\n * data layer, and only if that layer requests more than one kind of data source.\n * @param {LocusZoom.DataSources} sources An object of {ns: LocusZoom.Data.Source} instances\n * @class\n */\nLocusZoom.Data.Requester = function(sources) {\n\n function split_requests(fields) {\n // Given a fields array, return an object specifying what datasource names the data layer should make requests\n // to, and how to handle the returned data\n var requests = {};\n // Regular expression finds namespace:field|trans\n var re = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/;\n fields.forEach(function(raw) {\n var parts = re.exec(raw);\n var ns = parts[1] || \"base\";\n var field = parts[2];\n var trans = LocusZoom.TransformationFunctions.get(parts[3]);\n if (typeof requests[ns] ==\"undefined\") {\n requests[ns] = {outnames:[], fields:[], trans:[]};\n }\n requests[ns].outnames.push(raw);\n requests[ns].fields.push(field);\n requests[ns].trans.push(trans);\n });\n return requests;\n }\n\n /**\n * Fetch data, and create a chain that only connects two data sources if they depend on each other\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields The list of data fields specified in the `layout` for a specific data layer\n * @returns {Promise}\n */\n this.getData = function(state, fields) {\n var requests = split_requests(fields);\n // Create an array of functions that, when called, will trigger the request to the specified datasource\n var request_handles = Object.keys(requests).map(function(key) {\n if (!sources.get(key)) {\n throw(\"Datasource for namespace \" + key + \" not found\");\n }\n return sources.get(key).getData(state, requests[key].fields, \n requests[key].outnames, requests[key].trans);\n });\n //assume the fields are requested in dependent order\n //TODO: better manage dependencies\n var ret = Q.when({header:{}, body:{}, discrete: {}});\n for(var i=0; i < request_handles.length; i++) {\n // If a single datalayer uses multiple sources, perform the next request when the previous one completes\n ret = ret.then(request_handles[i]);\n }\n return ret;\n };\n};\n\n/**\n * Base class for LocusZoom data sources\n * This can be extended with .extend() to create custom data sources\n * @class\n * @public\n */\nLocusZoom.Data.Source = function() {\n /**\n * Whether this source should enable caching\n * @member {Boolean}\n */\n this.enableCache = true;\n /**\n * Whether this data source type is dependent on previous requests- for example, the LD source cannot annotate\n * association data if no data was found for that region.\n * @member {boolean}\n */\n this.dependentSource = false;\n};\n\n/**\n * A default constructor that can be used when creating new data sources\n * @param {String|Object} init Basic configuration- either a url, or a config object\n * @param {String} [init.url] The datasource URL\n * @param {String} [init.params] Initial config params for the datasource\n */\nLocusZoom.Data.Source.prototype.parseInit = function(init) {\n if (typeof init === \"string\") {\n /** @member {String} */\n this.url = init;\n /** @member {String} */\n this.params = {};\n } else {\n this.url = init.url;\n this.params = init.params || {};\n }\n if (!this.url) {\n throw(\"Source not initialized with required URL\");\n }\n\n};\n\n/**\n * A unique identifier that indicates whether cached data is valid for this request\n * @protected\n * @param state\n * @param chain\n * @param fields\n * @returns {String|undefined}\n */\nLocusZoom.Data.Source.prototype.getCacheKey = function(state, chain, fields) {\n return this.getURL && this.getURL(state, chain, fields);\n};\n\n/**\n * Stub: build the URL for any requests made by this source.\n */\nLocusZoom.Data.Source.prototype.getURL = function(state, chain, fields) { return this.url; };\n\n/**\n * Perform a network request to fetch data for this source\n * @protected\n * @param {Object} state The state of the parent plot\n * @param chain\n * @param fields\n */\nLocusZoom.Data.Source.prototype.fetchRequest = function(state, chain, fields) {\n var url = this.getURL(state, chain, fields);\n return LocusZoom.createCORSPromise(\"GET\", url); \n};\n\n/**\n * Gets the data for just this source, typically via a network request (caching where possible)\n * @protected\n */\nLocusZoom.Data.Source.prototype.getRequest = function(state, chain, fields) {\n var req;\n var cacheKey = this.getCacheKey(state, chain, fields);\n if (this.enableCache && typeof(cacheKey) !== \"undefined\" && cacheKey === this._cachedKey) {\n req = Q.when(this._cachedResponse);\n } else {\n req = this.fetchRequest(state, chain, fields);\n if (this.enableCache) {\n req = req.then(function(x) {\n this._cachedKey = cacheKey;\n return this._cachedResponse = x;\n }.bind(this));\n }\n }\n return req;\n};\n\n/**\n * Fetch the data from the specified data source, and apply transformations requested by an external consumer.\n * This is the public-facing datasource method that will most commonly be called by external code.\n *\n * @public\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the \"namespace\" prefix)\n * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the\n * originally requested field name, including the namespace. This must be an array with the same length as `fields`\n * @param {Function[]} trans The collection of transformation functions to be run on selected fields.\n * This must be an array with the same length as `fields`\n * @returns {function} A callable operation that can be used as part of the data chain\n */\nLocusZoom.Data.Source.prototype.getData = function(state, fields, outnames, trans) {\n if (this.preGetData) {\n var pre = this.preGetData(state, fields, outnames, trans);\n if(this.pre) {\n state = pre.state || state;\n fields = pre.fields || fields;\n outnames = pre.outnames || outnames;\n trans = pre.trans || trans;\n }\n }\n\n var self = this;\n return function (chain) {\n if (self.dependentSource && chain && chain.body && !chain.body.length) {\n // A \"dependent\" source should not attempt to fire a request if there is no data for it to act on.\n // Therefore, it should simply return the previous data chain.\n return Q.when(chain);\n }\n\n return self.getRequest(state, chain, fields).then(function(resp) {\n return self.parseResponse(resp, chain, fields, outnames, trans);\n });\n };\n};\n\n/**\n * Ensure the server response is in a canonical form, an array of one object per record. [ {field: oneval} ].\n * If the server response contains columns, reformats the response from {column1: [], column2: []} to the above.\n *\n * Does not apply namespacing or transformations.\n *\n * May be overridden by data sources that inherently return more complex payloads, or that exist to annotate other\n * sources.\n *\n * @param {Object[]|Object} data The original parsed server response\n * @protected\n */\nLocusZoom.Data.Source.prototype.normalizeResponse = function (data) {\n if (Array.isArray(data)) {\n // Already in the desired form\n return data;\n }\n\n // Otherwise, assume the server response is an object representing columns of data.\n // Each array should have the same length (verify), and a given array index corresponds to a single row.\n var keys = Object.keys(data);\n var N = data[keys[0]].length;\n var sameLength = keys.every(function(key) {\n var item = data[key];\n return item.length === N;\n });\n if (!sameLength) {\n throw this.constructor.SOURCE_NAME + \" expects a response in which all arrays of data are the same length\";\n }\n\n // Go down the rows, and create an object for each record\n var records = [];\n var fields = Object.keys(data);\n for(var i = 0; i < N; i++) {\n var record = {};\n for(var j = 0; j < fields.length; j++) {\n record[fields[j]] = data[fields[j]][i];\n }\n records.push(record);\n }\n return records;\n};\n\n/** @deprecated */\nLocusZoom.Data.Source.prototype.prepareData = function (records) {\n console.warn(\"Warning: .prepareData() is deprecated. Use .annotateData() instead\");\n return this.annotateData(records);\n};\n\n/**\n * Hook to post-process the data returned by this source with new, additional behavior.\n * (eg cleaning up API values or performing complex calculations on the returned data)\n *\n * @param {Object[]} records The parsed data from the source (eg standardized api response)\n * @param {Object} chain The data chain object. For example, chain.headers may provide useful annotation metadata\n * @returns {Object[]|Promise} The modified set of records\n */\nLocusZoom.Data.Source.prototype.annotateData = function(records, chain) {\n // Default behavior: no transformations\n return records;\n};\n\n/**\n * Clean up the server records for use by datalayers: extract only certain fields, with the specified names.\n * Apply per-field transformations as appropriate.\n *\n * This hook can be overridden, eg to create a source that always returns all records and ignores the \"fields\" array.\n * This is particularly common for sources at the end of a chain- many \"dependent\" sources do not allow\n * cherry-picking individual fields, in which case by **convention** the fields array specifies \"last_source_name:all\"\n *\n * @param {Object[]} data One record object per element\n * @param {String[]} fields The names of fields to extract (as named in the source data). Eg \"afield\"\n * @param {String[]} outnames How to represent the source fields in the output. Eg \"namespace:afield|atransform\"\n * @param {function[]} trans An array of transformation functions (if any). One function per data element, or null.\n * @protected\n */\nLocusZoom.Data.Source.prototype.extractFields = function (data, fields, outnames, trans) {\n //intended for an array of objects\n // [ {\"id\":1, \"val\":5}, {\"id\":2, \"val\":10}]\n // Since a number of sources exist that do not obey this format, we will provide a convenient pass-through\n if (!Array.isArray(data)) {\n return data;\n }\n\n var fieldFound = [];\n for (var k=0; k1) {\n if (fields.length!==2 || fields.indexOf(\"isrefvar\")===-1) {\n throw(\"LD does not know how to get all fields: \" + fields.join(\", \"));\n }\n }\n};\n\nLocusZoom.Data.LDSource.prototype.findMergeFields = function(chain) {\n // since LD may be shared across sources with different namespaces\n // we use regex to find columns to join on rather than \n // requiring exact matches\n var exactMatch = function(arr) {return function() {\n var regexes = arguments;\n for(var i=0; i0) {\n var names = Object.keys(chain.body[0]);\n var nameMatch = exactMatch(names);\n dataFields.id = dataFields.id || nameMatch(/\\bvariant\\b/) || nameMatch(/\\bid\\b/);\n dataFields.position = dataFields.position || nameMatch(/\\bposition\\b/i, /\\bpos\\b/i);\n dataFields.pvalue = dataFields.pvalue || nameMatch(/\\bpvalue\\b/i, /\\blog_pvalue\\b/i);\n dataFields._names_ = names;\n }\n return dataFields;\n};\n\nLocusZoom.Data.LDSource.prototype.findRequestedFields = function(fields, outnames) {\n var obj = {};\n for(var i=0; i extremeVal) {\n extremeVal = x[i][pval] * sign;\n extremeIdx = i;\n }\n }\n return extremeIdx;\n };\n\n var refSource = state.ldrefsource || chain.header.ldrefsource || 1;\n var reqFields = this.findRequestedFields(fields);\n var refVar = reqFields.ldin;\n if (refVar === \"state\") {\n refVar = state.ldrefvar || chain.header.ldrefvar || \"best\";\n }\n if (refVar === \"best\") {\n if (!chain.body) {\n throw(\"No association data found to find best pvalue\");\n }\n var keys = this.findMergeFields(chain);\n if (!keys.pvalue || !keys.id) {\n var columns = \"\";\n if (!keys.id){ columns += (columns.length ? \", \" : \"\") + \"id\"; }\n if (!keys.pvalue){ columns += (columns.length ? \", \" : \"\") + \"pvalue\"; }\n throw(\"Unable to find necessary column(s) for merge: \" + columns + \" (available: \" + keys._names_ + \")\");\n }\n refVar = chain.body[findExtremeValue(chain.body, keys.pvalue)][keys.id];\n }\n if (!chain.header) {chain.header = {};}\n chain.header.ldrefvar = refVar;\n return this.url + \"results/?filter=reference eq \" + refSource + \n \" and chromosome2 eq '\" + state.chr + \"'\" + \n \" and position2 ge \" + state.start + \n \" and position2 le \" + state.end + \n \" and variant1 eq '\" + refVar + \"'\" + \n \"&fields=chr,pos,rsquare\";\n};\n\nLocusZoom.Data.LDSource.prototype.combineChainBody = function (data, chain, fields, outnames) {\n var keys = this.findMergeFields(chain);\n var reqFields = this.findRequestedFields(fields, outnames);\n if (!keys.position) {\n throw(\"Unable to find position field for merge: \" + keys._names_);\n }\n var leftJoin = function(left, right, lfield, rfield) {\n var i=0, j=0;\n while (i < left.length && j < right.position2.length) {\n if (left[i][keys.position] === right.position2[j]) {\n left[i][lfield] = right[rfield][j];\n i++;\n j++;\n } else if (left[i][keys.position] < right.position2[j]) {\n i++;\n } else {\n j++;\n }\n }\n };\n var tagRefVariant = function(data, refvar, idfield, outname) {\n for(var i=0; i} */\n this.panels = {};\n /**\n * TODO: This is currently used by external classes that manipulate the parent and may indicate room for a helper method in the api to coordinate boilerplate\n * @protected\n * @member {String[]}\n */\n this.panel_ids_by_y_index = [];\n\n /**\n * Notify each child panel of the plot of changes in panel ordering/ arrangement\n */\n this.applyPanelYIndexesToPanelLayouts = function(){\n this.panel_ids_by_y_index.forEach(function(pid, idx){\n this.panels[pid].layout.y_index = idx;\n }.bind(this));\n };\n\n /**\n * Get the qualified ID pathname for the plot\n * @returns {String}\n */\n this.getBaseId = function(){\n return this.id;\n };\n\n /**\n * Track update operations (reMap) performed on all child panels, and notify the parent plot when complete\n * TODO: Reconsider whether we need to be tracking this as global state outside of context of specific operations\n * @protected\n * @member {Promise[]}\n */\n this.remap_promises = [];\n\n if (typeof layout == \"undefined\"){\n /**\n * The layout is a serializable object used to describe the composition of the Plot\n * If no layout was passed, use the Standard Association Layout\n * Otherwise merge whatever was passed with the Default Layout\n * TODO: Review description; we *always* merge with default layout?\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge({}, LocusZoom.Layouts.get(\"plot\", \"standard_association\"));\n } else {\n this.layout = layout;\n }\n LocusZoom.Layouts.merge(this.layout, LocusZoom.Plot.DefaultLayout);\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original plot state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n\n /**\n * Create a shortcut to the state in the layout on the Plot. Tracking in the layout allows the plot to be created\n * with initial state/setup.\n *\n * Tracks state of the plot, eg start and end position\n * @member {Object}\n */\n this.state = this.layout.state;\n\n /** @member {LocusZoom.Data.Requester} */\n this.lzd = new LocusZoom.Data.Requester(datasource);\n\n /**\n * Window.onresize listener (responsive layouts only)\n * TODO: .on appears to return a selection, not a listener? Check logic here\n * https://github.com/d3/d3-selection/blob/00b904b9bcec4dfaf154ae0bbc777b1fc1d7bc08/test/selection/on-test.js#L11\n * @deprecated\n * @member {d3.selection}\n */\n this.window_onresize = null;\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": [],\n \"state_changed\": [] // Only triggered when a state change causes rerender\n };\n\n /**\n * @callback eventCallback\n * @param {object} eventData A description of the event\n * @param {String|null} eventData.sourceID The unique identifier (eg plot or parent name) of the element that\n * triggered the event. Will be automatically filled in if not explicitly provided.\n * @param {Object|null} eventData.context Any additional information to be passed to the callback, eg the data\n * associated with a clicked plot element\n */\n\n /**\n * There are several events that a LocusZoom plot can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following plot-level events are currently supported:\n * - `layout_changed` - context: plot - Any aspect of the plot's layout (including dimensions or state) has changed.\n * - `data_requested` - context: plot - A request for new data from any data source used in the plot has been made.\n * - `data_rendered` - context: plot - Data from a request has been received and rendered in the plot.\n * - `element_clicked` - context: plot - A data element in any of the plot's data layers has been clicked.\n * - `element_selection` - context: plot - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `plot.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * plot itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Plot}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n * @param {string} event A known event name\n * @param {*} eventData Data or event description that will be passed to the event listener\n * @returns {LocusZoom.Plot}\n */\n this.emit = function(event, eventData) {\n // TODO: there are small differences between the emit implementation between plots and panels. In the future,\n // DRY this code via mixins, and make sure to keep the interfaces compatible when refactoring.\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n var sourceID = this.getBaseId();\n var self = this;\n this.event_hooks[event].forEach(function(hookToRun) {\n var eventContext;\n if (eventData && eventData.sourceID) {\n // If we detect that an event originated elsewhere (via bubbling or externally), preserve the context\n // when re-emitting the event to plot-level listeners\n eventContext = eventData;\n } else {\n eventContext = {sourceID: sourceID, data: eventData || null};\n }\n // By default, any handlers fired here (either directly, or bubbled) will see the plot as the\n // value of `this`. If a bound function is registered as a handler, the previously bound `this` will\n // override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the plot's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the plot\n * @returns {{x: Number, y: Number, width: Number, height: Number}}\n */\n this.getPageOrigin = function(){\n var bounding_client_rect = this.svg.node().getBoundingClientRect();\n var x_offset = document.documentElement.scrollLeft || document.body.scrollLeft;\n var y_offset = document.documentElement.scrollTop || document.body.scrollTop;\n var container = this.svg.node();\n while (container.parentNode !== null){\n container = container.parentNode;\n if (container !== document && d3.select(container).style(\"position\") !== \"static\"){\n x_offset = -1 * container.getBoundingClientRect().left;\n y_offset = -1 * container.getBoundingClientRect().top;\n break;\n }\n }\n return {\n x: x_offset + bounding_client_rect.left,\n y: y_offset + bounding_client_rect.top,\n width: bounding_client_rect.width,\n height: bounding_client_rect.height\n };\n };\n\n /**\n * Get the top and left offset values for the plot's container element (the div that was populated)\n * @returns {{top: number, left: number}}\n */\n this.getContainerOffset = function(){\n var offset = { top: 0, left: 0 };\n var container = this.container.offsetParent || null;\n while (container !== null){\n offset.top += container.offsetTop;\n offset.left += container.offsetLeft;\n container = container.offsetParent || null;\n }\n return offset;\n };\n\n //\n /**\n * Event information describing interaction (e.g. panning and zooming) is stored on the plot\n * TODO: Add/ document details of interaction structure as we expand\n * @member {{panel_id: String, linked_panel_ids: Array, x_linked: *, dragging: *, zooming: *}}\n * @returns {LocusZoom.Plot}\n */\n this.interaction = {};\n\n /**\n * Track whether the target panel can respond to mouse interaction events\n * @param {String} panel_id\n * @returns {boolean}\n */\n this.canInteract = function(panel_id){\n panel_id = panel_id || null;\n if (panel_id){\n return ((typeof this.interaction.panel_id == \"undefined\" || this.interaction.panel_id === panel_id) && !this.loading_data);\n } else {\n return !(this.interaction.dragging || this.interaction.zooming || this.loading_data);\n }\n };\n\n // Initialize the layout\n this.initializeLayout();\n // TODO: Possibly superfluous return from constructor\n return this;\n};\n\n/**\n * Default/ expected configuration parameters for basic plotting; most plots will override\n *\n * @protected\n * @static\n * @type {Object}\n */\nLocusZoom.Plot.DefaultLayout = {\n state: {},\n width: 1,\n height: 1,\n min_width: 1,\n min_height: 1,\n responsive_resize: false,\n aspect_ratio: 1,\n panels: [],\n dashboard: {\n components: []\n },\n panel_boundaries: true,\n mouse_guide: true\n};\n\n/**\n * Helper method to sum the proportional dimensions of panels, a value that's checked often as panels are added/removed\n * @param {('Height'|'Width')} dimension\n * @returns {number}\n */\nLocusZoom.Plot.prototype.sumProportional = function(dimension){\n if (dimension !== \"height\" && dimension !== \"width\"){\n throw (\"Bad dimension value passed to LocusZoom.Plot.prototype.sumProportional\");\n }\n var total = 0;\n for (var id in this.panels){\n // Ensure every panel contributing to the sum has a non-zero proportional dimension\n if (!this.panels[id].layout[\"proportional_\" + dimension]){\n this.panels[id].layout[\"proportional_\" + dimension] = 1 / Object.keys(this.panels).length;\n }\n total += this.panels[id].layout[\"proportional_\" + dimension];\n }\n return total;\n};\n\n/**\n * Resize the plot to fit the bounding container\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.rescaleSVG = function(){\n var clientRect = this.svg.node().getBoundingClientRect();\n this.setDimensions(clientRect.width, clientRect.height);\n return this;\n};\n\n/**\n * Prepare the plot for first use by performing parameter validation, setting up panels, and calculating dimensions\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initializeLayout = function(){\n\n // Sanity check layout values\n // TODO: Find a way to generally abstract this, maybe into an object that models allowed layout values?\n if (isNaN(this.layout.width) || this.layout.width <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.height) || this.layout.height <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.aspect_ratio) || this.layout.aspect_ratio <= 0){\n throw (\"Plot layout parameter `aspect_ratio` must be a positive number\");\n }\n\n // If this is a responsive layout then set a namespaced/unique onresize event listener on the window\n if (this.layout.responsive_resize){\n this.window_onresize = d3.select(window).on(\"resize.lz-\"+this.id, function(){\n this.rescaleSVG();\n }.bind(this));\n // Forcing one additional setDimensions() call after the page is loaded clears up\n // any disagreements between the initial layout and the loaded responsive container's size\n d3.select(window).on(\"load.lz-\"+this.id, function(){\n this.setDimensions();\n }.bind(this));\n }\n\n // Add panels\n this.layout.panels.forEach(function(panel_layout){\n this.addPanel(panel_layout);\n }.bind(this));\n\n return this;\n};\n\n/**\n * Set the dimensions for a plot, and ensure that panels are sized and positioned correctly.\n *\n * If dimensions are provided, resizes each panel proportionally to match the new plot dimensions. Otherwise,\n * calculates the appropriate plot dimensions based on all panels.\n * @param {Number} [width] If provided and larger than minimum size, set plot to this width\n * @param {Number} [height] If provided and larger than minimum size, set plot to this height\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.setDimensions = function(width, height){\n\n var id;\n\n // Update minimum allowable width and height by aggregating minimums from panels, then apply minimums to containing element.\n var min_width = parseFloat(this.layout.min_width) || 0;\n var min_height = parseFloat(this.layout.min_height) || 0;\n for (id in this.panels){\n min_width = Math.max(min_width, this.panels[id].layout.min_width);\n if (parseFloat(this.panels[id].layout.min_height) > 0 && parseFloat(this.panels[id].layout.proportional_height) > 0){\n min_height = Math.max(min_height, (this.panels[id].layout.min_height / this.panels[id].layout.proportional_height));\n }\n }\n this.layout.min_width = Math.max(min_width, 1);\n this.layout.min_height = Math.max(min_height, 1);\n d3.select(this.svg.node().parentNode).style({\n \"min-width\": this.layout.min_width + \"px\",\n \"min-height\": this.layout.min_height + \"px\"\n });\n\n // If width and height arguments were passed then adjust them against plot minimums if necessary.\n // Then resize the plot and proportionally resize panels to fit inside the new plot dimensions.\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n // Override discrete values if resizing responsively\n if (this.layout.responsive_resize){\n if (this.svg){\n this.layout.width = Math.max(this.svg.node().parentNode.getBoundingClientRect().width, this.layout.min_width);\n }\n this.layout.height = this.layout.width / this.layout.aspect_ratio;\n if (this.layout.height < this.layout.min_height){\n this.layout.height = this.layout.min_height;\n this.layout.width = this.layout.height * this.layout.aspect_ratio;\n }\n }\n // Resize/reposition panels to fit, update proportional origins if necessary\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel_width = this.layout.width;\n var panel_height = this.panels[panel_id].layout.proportional_height * this.layout.height;\n this.panels[panel_id].setDimensions(panel_width, panel_height);\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n this.panels[panel_id].layout.proportional_origin.y = y_offset / this.layout.height;\n y_offset += panel_height;\n this.panels[panel_id].dashboard.update();\n }.bind(this));\n }\n\n // If width and height arguments were NOT passed (and panels exist) then determine the plot dimensions\n // by making it conform to panel dimensions, assuming panels are already positioned correctly.\n else if (Object.keys(this.panels).length) {\n this.layout.width = 0;\n this.layout.height = 0;\n for (id in this.panels){\n this.layout.width = Math.max(this.panels[id].layout.width, this.layout.width);\n this.layout.height += this.panels[id].layout.height;\n }\n this.layout.width = Math.max(this.layout.width, this.layout.min_width);\n this.layout.height = Math.max(this.layout.height, this.layout.min_height);\n }\n\n // Keep aspect ratio in agreement with dimensions\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n\n // Apply layout width and height as discrete values or viewbox values\n if (this.svg !== null){\n if (this.layout.responsive_resize){\n this.svg\n .attr(\"viewBox\", \"0 0 \" + this.layout.width + \" \" + this.layout.height)\n .attr(\"preserveAspectRatio\", \"xMinYMin meet\");\n } else {\n this.svg.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n }\n\n // If the plot has been initialized then trigger some necessary render functions\n if (this.initialized){\n this.panel_boundaries.position();\n this.dashboard.update();\n this.curtain.update();\n this.loader.update();\n }\n\n return this.emit(\"layout_changed\");\n};\n\n/**\n * Create a new panel from a layout, and handle the work of initializing and placing the panel on the plot\n * @param {Object} layout\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Plot.prototype.addPanel = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\"){\n throw \"Invalid panel layout passed to LocusZoom.Plot.prototype.addPanel()\";\n }\n\n // Create the Panel and set its parent\n var panel = new LocusZoom.Panel(layout, this);\n\n // Store the Panel on the Plot\n this.panels[panel.id] = panel;\n\n // If a discrete y_index was set in the layout then adjust other panel y_index values to accommodate this one\n if (panel.layout.y_index !== null && !isNaN(panel.layout.y_index)\n && this.panel_ids_by_y_index.length > 0){\n // Negative y_index values should count backwards from the end, so convert negatives to appropriate values here\n if (panel.layout.y_index < 0){\n panel.layout.y_index = Math.max(this.panel_ids_by_y_index.length + panel.layout.y_index, 0);\n }\n this.panel_ids_by_y_index.splice(panel.layout.y_index, 0, panel.id);\n this.applyPanelYIndexesToPanelLayouts();\n } else {\n var length = this.panel_ids_by_y_index.push(panel.id);\n this.panels[panel.id].layout.y_index = length - 1;\n }\n\n // Determine if this panel was already in the layout.panels array.\n // If it wasn't, add it. Either way store the layout.panels array index on the panel.\n var layout_idx = null;\n this.layout.panels.forEach(function(panel_layout, idx){\n if (panel_layout.id === panel.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.panels.push(this.panels[panel.id].layout) - 1;\n }\n this.panels[panel.id].layout_idx = layout_idx;\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n this.positionPanels();\n // Initialize and load data into the new panel\n this.panels[panel.id].initialize();\n this.panels[panel.id].reMap();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this.panels[panel.id];\n};\n\n\n/**\n * Clear all state, tooltips, and other persisted data associated with one (or all) panel(s) in the plot\n *\n * This is useful when reloading an existing plot with new data, eg \"click for genome region\" links.\n * This is a utility method for custom usage. It is not fired automatically during normal rerender of existing panels\n * @param {String} [panelId] If provided, clear state for only this panel. Otherwise, clear state for all panels.\n * @param {('wipe'|'reset')} [mode='wipe'] Optionally specify how state should be cleared. `wipe` deletes all data\n * and is useful for when the panel is being removed; `reset` is best when the panel will be reused in place.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.clearPanelData = function(panelId, mode) {\n mode = mode || \"wipe\";\n\n // TODO: Add unit tests for this method\n var panelsList;\n if (panelId) {\n panelsList = [panelId];\n } else {\n panelsList = Object.keys(this.panels);\n }\n var self = this;\n panelsList.forEach(function(pid) {\n self.panels[pid].data_layer_ids_by_z_index.forEach(function(dlid){\n var layer = self.panels[pid].data_layers[dlid];\n layer.destroyAllTooltips();\n\n delete self.layout.state[pid + \".\" + dlid];\n if(mode === \"reset\") {\n layer.setDefaultState();\n }\n });\n });\n return this;\n};\n\n/**\n * Remove the panel from the plot, and clear any state, tooltips, or other visual elements belonging to nested content\n * @param {String} id\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.removePanel = function(id){\n if (!this.panels[id]){\n throw (\"Unable to remove panel, ID not found: \" + id);\n }\n\n // Hide all panel boundaries\n this.panel_boundaries.hide();\n\n // Destroy all tooltips and state vars for all data layers on the panel\n this.clearPanelData(id);\n\n // Remove all panel-level HTML overlay elements\n this.panels[id].loader.hide();\n this.panels[id].dashboard.destroy(true);\n this.panels[id].curtain.hide();\n\n // Remove the svg container for the panel if it exists\n if (this.panels[id].svg.container){\n this.panels[id].svg.container.remove();\n }\n\n // Delete the panel and its presence in the plot layout and state\n this.layout.panels.splice(this.panels[id].layout_idx, 1);\n delete this.panels[id];\n delete this.layout.state[id];\n\n // Update layout_idx values for all remaining panels\n this.layout.panels.forEach(function(panel_layout, idx){\n this.panels[panel_layout.id].layout_idx = idx;\n }.bind(this));\n\n // Remove the panel id from the y_index array\n this.panel_ids_by_y_index.splice(this.panel_ids_by_y_index.indexOf(id), 1);\n this.applyPanelYIndexesToPanelLayouts();\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n // Allow the plot to shrink when panels are removed, by forcing it to recalculate min dimensions from scratch\n this.layout.min_height = this._base_layout.min_height;\n this.layout.min_width = this._base_layout.min_width;\n\n this.positionPanels();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this;\n};\n\n\n/**\n * Automatically position panels based on panel positioning rules and values.\n * Keep panels from overlapping vertically by adjusting origins, and keep the sum of proportional heights at 1.\n *\n * TODO: This logic currently only supports dynamic positioning of panels to prevent overlap in a VERTICAL orientation.\n * Some framework exists for positioning panels in horizontal orientations as well (width, proportional_width, origin.x, etc.)\n * but the logic for keeping these user-definable values straight approaches the complexity of a 2D box-packing algorithm.\n * That's complexity we don't need right now, and may not ever need, so it's on hiatus until a use case materializes.\n */\nLocusZoom.Plot.prototype.positionPanels = function(){\n\n var id;\n\n // We want to enforce that all x-linked panels have consistent horizontal margins\n // (to ensure that aligned items stay aligned despite inconsistent initial layout parameters)\n // NOTE: This assumes panels have consistent widths already. That should probably be enforced too!\n var x_linked_margins = { left: 0, right: 0 };\n\n // Proportional heights for newly added panels default to null unless explicitly set, so determine appropriate\n // proportional heights for all panels with a null value from discretely set dimensions.\n // Likewise handle default nulls for proportional widths, but instead just force a value of 1 (full width)\n for (id in this.panels){\n if (this.panels[id].layout.proportional_height === null){\n this.panels[id].layout.proportional_height = this.panels[id].layout.height / this.layout.height;\n }\n if (this.panels[id].layout.proportional_width === null){\n this.panels[id].layout.proportional_width = 1;\n }\n if (this.panels[id].layout.interaction.x_linked){\n x_linked_margins.left = Math.max(x_linked_margins.left, this.panels[id].layout.margin.left);\n x_linked_margins.right = Math.max(x_linked_margins.right, this.panels[id].layout.margin.right);\n }\n }\n\n // Sum the proportional heights and then adjust all proportionally so that the sum is exactly 1\n var total_proportional_height = this.sumProportional(\"height\");\n if (!total_proportional_height){\n return this;\n }\n var proportional_adjustment = 1 / total_proportional_height;\n for (id in this.panels){\n this.panels[id].layout.proportional_height *= proportional_adjustment;\n }\n\n // Update origins on all panels without changing plot-level dimensions yet\n // Also apply x-linked margins to x-linked panels, updating widths as needed\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n y_offset += this.panels[panel_id].layout.height;\n if (this.panels[panel_id].layout.interaction.x_linked){\n var delta = Math.max(x_linked_margins.left - this.panels[panel_id].layout.margin.left, 0)\n + Math.max(x_linked_margins.right - this.panels[panel_id].layout.margin.right, 0);\n this.panels[panel_id].layout.width += delta;\n this.panels[panel_id].layout.margin.left = x_linked_margins.left;\n this.panels[panel_id].layout.margin.right = x_linked_margins.right;\n this.panels[panel_id].layout.cliparea.origin.x = x_linked_margins.left;\n }\n }.bind(this));\n var calculated_plot_height = y_offset;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].layout.proportional_origin.y = this.panels[panel_id].layout.origin.y / calculated_plot_height;\n }.bind(this));\n\n // Update dimensions on the plot to accommodate repositioned panels\n this.setDimensions();\n\n // Set dimensions on all panels using newly set plot-level dimensions and panel-level proportional dimensions\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setDimensions(this.layout.width * this.panels[panel_id].layout.proportional_width,\n this.layout.height * this.panels[panel_id].layout.proportional_height);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Prepare the first rendering of the plot. This includes initializing the individual panels, but also creates shared\n * elements such as mouse events, panel guides/boundaries, and loader/curtain.\n *\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initialize = function(){\n\n // Ensure proper responsive class is present on the containing node if called for\n if (this.layout.responsive_resize){\n d3.select(this.container).classed(\"lz-container-responsive\", true);\n }\n\n // Create an element/layer for containing mouse guides\n if (this.layout.mouse_guide) {\n var mouse_guide_svg = this.svg.append(\"g\")\n .attr(\"class\", \"lz-mouse_guide\").attr(\"id\", this.id + \".mouse_guide\");\n var mouse_guide_vertical_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-vertical\").attr(\"x\",-1);\n var mouse_guide_horizontal_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-horizontal\").attr(\"y\",-1);\n this.mouse_guide = {\n svg: mouse_guide_svg,\n vertical: mouse_guide_vertical_svg,\n horizontal: mouse_guide_horizontal_svg\n };\n }\n\n // Add curtain and loader prototpyes to the plot\n this.curtain = LocusZoom.generateCurtain.call(this);\n this.loader = LocusZoom.generateLoader.call(this);\n\n // Create the panel_boundaries object with show/position/hide methods\n this.panel_boundaries = {\n parent: this,\n hide_timeout: null,\n showing: false,\n dragging: false,\n selectors: [],\n corner_selector: null,\n show: function(){\n // Generate panel boundaries\n if (!this.showing && !this.parent.curtain.showing){\n this.showing = true;\n // Loop through all panels to create a horizontal boundary for each\n this.parent.panel_ids_by_y_index.forEach(function(panel_id, panel_idx){\n var selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-boundary\")\n .attr(\"title\", \"Resize panel\");\n selector.append(\"span\");\n var panel_resize_drag = d3.behavior.drag();\n panel_resize_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n panel_resize_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n panel_resize_drag.on(\"drag\", function(){\n // First set the dimensions on the panel we're resizing\n var this_panel = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]];\n var original_panel_height = this_panel.layout.height;\n this_panel.setDimensions(this_panel.layout.width, this_panel.layout.height + d3.event.dy);\n var panel_height_change = this_panel.layout.height - original_panel_height;\n var new_calculated_plot_height = this.parent.layout.height + panel_height_change;\n // Next loop through all panels.\n // Update proportional dimensions for all panels including the one we've resized using discrete heights.\n // Reposition panels with a greater y-index than this panel to their appropriate new origin.\n this.parent.panel_ids_by_y_index.forEach(function(loop_panel_id, loop_panel_idx){\n var loop_panel = this.parent.panels[this.parent.panel_ids_by_y_index[loop_panel_idx]];\n loop_panel.layout.proportional_height = loop_panel.layout.height / new_calculated_plot_height;\n if (loop_panel_idx > panel_idx){\n loop_panel.setOrigin(loop_panel.layout.origin.x, loop_panel.layout.origin.y + panel_height_change);\n loop_panel.dashboard.position();\n }\n }.bind(this));\n // Reset dimensions on the entire plot and reposition panel boundaries\n this.parent.positionPanels();\n this.position();\n }.bind(this));\n selector.call(panel_resize_drag);\n this.parent.panel_boundaries.selectors.push(selector);\n }.bind(this));\n // Create a corner boundary / resize element on the bottom-most panel that resizes the entire plot\n var corner_selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-corner-boundary\")\n .attr(\"title\", \"Resize plot\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-outer\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-inner\");\n var corner_drag = d3.behavior.drag();\n corner_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n corner_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n corner_drag.on(\"drag\", function(){\n this.setDimensions(this.layout.width + d3.event.dx, this.layout.height + d3.event.dy);\n }.bind(this.parent));\n corner_selector.call(corner_drag);\n this.parent.panel_boundaries.corner_selector = corner_selector;\n }\n return this.position();\n },\n position: function(){\n if (!this.showing){ return this; }\n // Position panel boundaries\n var plot_page_origin = this.parent.getPageOrigin();\n this.selectors.forEach(function(selector, panel_idx){\n var panel_page_origin = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].getPageOrigin();\n var left = plot_page_origin.x;\n var top = panel_page_origin.y + this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].layout.height - 12;\n var width = this.parent.layout.width - 1;\n selector.style({\n top: top + \"px\",\n left: left + \"px\",\n width: width + \"px\"\n });\n selector.select(\"span\").style({\n width: width + \"px\"\n });\n }.bind(this));\n // Position corner selector\n var corner_padding = 10;\n var corner_size = 16;\n this.corner_selector.style({\n top: (plot_page_origin.y + this.parent.layout.height - corner_padding - corner_size) + \"px\",\n left: (plot_page_origin.x + this.parent.layout.width - corner_padding - corner_size) + \"px\"\n });\n return this;\n },\n hide: function(){\n if (!this.showing){ return this; }\n this.showing = false;\n // Remove panel boundaries\n this.selectors.forEach(function(selector){ selector.remove(); });\n this.selectors = [];\n // Remove corner boundary\n this.corner_selector.remove();\n this.corner_selector = null;\n return this;\n }\n };\n\n // Show panel boundaries stipulated by the layout (basic toggle, only show on mouse over plot)\n if (this.layout.panel_boundaries){\n d3.select(this.svg.node().parentNode).on(\"mouseover.\" + this.id + \".panel_boundaries\", function(){\n clearTimeout(this.panel_boundaries.hide_timeout);\n this.panel_boundaries.show();\n }.bind(this));\n d3.select(this.svg.node().parentNode).on(\"mouseout.\" + this.id + \".panel_boundaries\", function(){\n this.panel_boundaries.hide_timeout = setTimeout(function(){\n this.panel_boundaries.hide();\n }.bind(this), 300);\n }.bind(this));\n }\n\n // Create the dashboard object and immediately show it\n this.dashboard = new LocusZoom.Dashboard(this).show();\n\n // Initialize all panels\n for (var id in this.panels){\n this.panels[id].initialize();\n }\n\n // Define plot-level mouse events\n var namespace = \".\" + this.id;\n if (this.layout.mouse_guide) {\n var mouseout_mouse_guide = function(){\n this.mouse_guide.vertical.attr(\"x\", -1);\n this.mouse_guide.horizontal.attr(\"y\", -1);\n }.bind(this);\n var mousemove_mouse_guide = function(){\n var coords = d3.mouse(this.svg.node());\n this.mouse_guide.vertical.attr(\"x\", coords[0]);\n this.mouse_guide.horizontal.attr(\"y\", coords[1]);\n }.bind(this);\n this.svg\n .on(\"mouseout\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"touchleave\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"mousemove\" + namespace + \"-mouse_guide\", mousemove_mouse_guide);\n }\n var mouseup = function(){\n this.stopDrag();\n }.bind(this);\n var mousemove = function(){\n if (this.interaction.dragging){\n var coords = d3.mouse(this.svg.node());\n if (d3.event){ d3.event.preventDefault(); }\n this.interaction.dragging.dragged_x = coords[0] - this.interaction.dragging.start_x;\n this.interaction.dragging.dragged_y = coords[1] - this.interaction.dragging.start_y;\n this.panels[this.interaction.panel_id].render();\n this.interaction.linked_panel_ids.forEach(function(panel_id){\n this.panels[panel_id].render();\n }.bind(this));\n }\n }.bind(this);\n this.svg\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup)\n .on(\"mousemove\" + namespace, mousemove)\n .on(\"touchmove\" + namespace, mousemove);\n\n // Add an extra namespaced mouseup handler to the containing body, if there is one\n // This helps to stop interaction events gracefully when dragging outside of the plot element\n if (!d3.select(\"body\").empty()){\n d3.select(\"body\")\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup);\n }\n\n this.initialized = true;\n\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n var client_rect = this.svg.node().getBoundingClientRect();\n var width = client_rect.width ? client_rect.width : this.layout.width;\n var height = client_rect.height ? client_rect.height : this.layout.height;\n this.setDimensions(width, height);\n\n return this;\n\n};\n\n/**\n * Refresh (or fetch) a plot's data from sources, regardless of whether position or state has changed\n * @returns {Promise}\n */\nLocusZoom.Plot.prototype.refresh = function(){\n return this.applyState();\n};\n\n\n/**\n * A user-defined callback function that can receive (and potentially act on) new plot data.\n * @callback externalDataCallback\n * @param {Object} new_data The body resulting from a data request. This represents the same information that would be passed to\n * a data layer making an equivalent request.\n */\n\n/**\n * A user-defined callback function that can respond to errors received during a previous operation\n * @callback externalErrorCallback\n * @param err A representation of the error that occurred\n */\n\n/**\n * Allow newly fetched data to be made available outside the LocusZoom plot. For example, a callback could be\n * registered to draw an HTML table of top GWAS hits, and update that table whenever the plot region changes.\n *\n * This is a convenience method for external hooks. It registers an event listener and returns parsed data,\n * using the same fields syntax and underlying methods as data layers.\n *\n * @param {String[]} fields An array of field names and transforms, in the same syntax used by a data layer.\n * Different data sources should be prefixed by the source name.\n * @param {externalDataCallback} success_callback Used defined function that is automatically called any time that\n * new data is received by the plot.\n * @param {Object} [opts] Options\n * @param {externalErrorCallback} [opts.onerror] User defined function that is automatically called if a problem\n * occurs during the data request or subsequent callback operations\n * @param {boolean} [opts.discrete=false] Normally the callback will subscribe to the combined body from the chain,\n * which may not be in a format that matches what the external callback wants to do. If discrete=true, returns the\n * uncombined record info\n * @return {function} The newly created event listener, to allow for later cleanup/removal\n */\nLocusZoom.Plot.prototype.subscribeToData = function(fields, success_callback, opts) {\n opts = opts || {};\n\n // Register an event listener that is notified whenever new data has been rendered\n var error_callback = opts.onerror || function(err) {\n console.log(\"An error occurred while acting on an external callback\", err);\n };\n var self = this;\n\n var listener = function() {\n try {\n self.lzd.getData(self.state, fields)\n .then(function (new_data) {\n success_callback(opts.discrete ? new_data.discrete : new_data.body);\n }).catch(error_callback);\n } catch (error) {\n // In certain cases, errors are thrown before a promise can be generated, and LZ error display seems to rely on these errors bubbling up\n error_callback(error);\n }\n };\n this.on(\"data_rendered\", listener);\n return listener;\n};\n\n/**\n * Update state values and trigger a pull for fresh data on all data sources for all data layers\n * @param state_changes\n * @returns {Promise} A promise that resolves when all data fetch and update operations are complete\n */\nLocusZoom.Plot.prototype.applyState = function(state_changes){\n state_changes = state_changes || {};\n if (typeof state_changes != \"object\"){\n throw(\"LocusZoom.applyState only accepts an object; \" + (typeof state_changes) + \" given\");\n }\n\n // First make a copy of the current (old) state to work with\n var new_state = JSON.parse(JSON.stringify(this.state));\n\n // Apply changes by top-level property to the new state\n for (var property in state_changes) {\n new_state[property] = state_changes[property];\n }\n\n // Validate the new state (may do nothing, may do a lot, depends on how the user has things set up)\n new_state = LocusZoom.validateState(new_state, this.layout);\n\n // Apply new state to the actual state\n for (property in new_state) {\n this.state[property] = new_state[property];\n }\n\n // Generate requests for all panels given new state\n this.emit(\"data_requested\");\n this.remap_promises = [];\n this.loading_data = true;\n for (var id in this.panels){\n this.remap_promises.push(this.panels[id].reMap());\n }\n\n return Q.all(this.remap_promises)\n .catch(function(error){\n console.error(error);\n this.curtain.drop(error);\n this.loading_data = false;\n }.bind(this))\n .then(function(){\n // TODO: Check logic here; in some promise implementations, this would cause the error to be considered handled, and \"then\" would always fire. (may or may not be desired behavior)\n // Update dashboard / components\n this.dashboard.update();\n\n // Apply panel-level state values\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel = this.panels[panel_id];\n panel.dashboard.update();\n // Apply data-layer-level state values\n panel.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n var data_layer = this.data_layers[data_layer_id];\n var state_id = panel_id + \".\" + data_layer_id;\n for (var property in this.state[state_id]){\n if (!this.state[state_id].hasOwnProperty(property)){ continue; }\n if (Array.isArray(this.state[state_id][property])){\n this.state[state_id][property].forEach(function(element_id){\n try {\n this.setElementStatus(property, this.getElementById(element_id), true);\n } catch (e){\n console.error(\"Unable to apply state: \" + state_id + \", \" + property);\n }\n }.bind(data_layer));\n }\n }\n }.bind(panel));\n }.bind(this));\n\n // Emit events\n this.emit(\"layout_changed\");\n this.emit(\"data_rendered\");\n this.emit(\"state_changed\", state_changes);\n\n this.loading_data = false;\n\n }.bind(this));\n};\n\n/**\n * Register interactions along the specified axis, provided that the target panel allows interaction.\n *\n * @param {LocusZoom.Panel} panel\n * @param {('x_tick'|'y1_tick'|'y2_tick')} method The direction (axis) along which dragging is being performed.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.startDrag = function(panel, method){\n\n panel = panel || null;\n method = method || null;\n\n var axis = null;\n switch (method){\n case \"background\":\n case \"x_tick\":\n axis = \"x\";\n break;\n case \"y1_tick\":\n axis = \"y1\";\n break;\n case \"y2_tick\":\n axis = \"y2\";\n break;\n }\n\n if (!(panel instanceof LocusZoom.Panel) || !axis || !this.canInteract()){ return this.stopDrag(); }\n\n var coords = d3.mouse(this.svg.node());\n this.interaction = {\n panel_id: panel.id,\n linked_panel_ids: panel.getLinkedPanelIds(axis),\n dragging: {\n method: method,\n start_x: coords[0],\n start_y: coords[1],\n dragged_x: 0,\n dragged_y: 0,\n axis: axis\n }\n };\n\n this.svg.style(\"cursor\", \"all-scroll\");\n\n return this;\n\n};\n\n/**\n * Process drag interactions across the target panel and synchronize plot state across other panels in sync;\n * clear the event when complete\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.stopDrag = function(){\n\n if (!this.interaction.dragging){ return this; }\n\n if (typeof this.panels[this.interaction.panel_id] != \"object\"){\n this.interaction = {};\n return this;\n }\n var panel = this.panels[this.interaction.panel_id];\n\n // Helper function to find the appropriate axis layouts on child data layers\n // Once found, apply the extent as floor/ceiling and remove all other directives\n // This forces all associated axes to conform to the extent generated by a drag action\n var overrideAxisLayout = function(axis, axis_number, extent){\n panel.data_layer_ids_by_z_index.forEach(function(id){\n if (panel.data_layers[id].layout[axis+\"_axis\"].axis === axis_number){\n panel.data_layers[id].layout[axis+\"_axis\"].floor = extent[0];\n panel.data_layers[id].layout[axis+\"_axis\"].ceiling = extent[1];\n delete panel.data_layers[id].layout[axis+\"_axis\"].lower_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].upper_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].min_extent;\n delete panel.data_layers[id].layout[axis+\"_axis\"].ticks;\n }\n });\n };\n\n switch(this.interaction.dragging.method){\n case \"background\":\n case \"x_tick\":\n if (this.interaction.dragging.dragged_x !== 0){\n overrideAxisLayout(\"x\", 1, panel.x_extent);\n this.applyState({ start: panel.x_extent[0], end: panel.x_extent[1] });\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n if (this.interaction.dragging.dragged_y !== 0){\n // TODO: Hardcoded assumption of only two possible axes with single-digit #s (switch/case)\n var y_axis_number = parseInt(this.interaction.dragging.method[1]);\n overrideAxisLayout(\"y\", y_axis_number, panel[\"y\"+y_axis_number+\"_extent\"]);\n }\n break;\n }\n\n this.interaction = {};\n this.svg.style(\"cursor\", null);\n\n return this;\n\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A panel is an abstract class representing a subdivision of the LocusZoom stage\n * to display a distinct data representation as a collection of data layers.\n * @class\n * @param {Object} layout\n * @param {LocusZoom.Plot|null} parent\n*/\nLocusZoom.Panel = function(layout, parent) {\n\n if (typeof layout !== \"object\"){\n throw \"Unable to create panel, invalid layout\";\n }\n\n /** @member {LocusZoom.Plot|null} */\n this.parent = parent || null;\n /** @member {LocusZoom.Plot|null} */\n this.parent_plot = parent;\n\n // Ensure a valid ID is present. If there is no valid ID then generate one\n if (typeof layout.id !== \"string\" || !layout.id.length){\n if (!this.parent){\n layout.id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n } else {\n var id = null;\n var generateID = function(){\n id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n if (id == null || typeof this.parent.panels[id] != \"undefined\"){\n id = generateID();\n }\n }.bind(this);\n layout.id = id;\n }\n } else if (this.parent) {\n if (typeof this.parent.panels[layout.id] !== \"undefined\"){\n throw \"Cannot create panel with id [\" + layout.id + \"]; panel with that id already exists\";\n }\n }\n /** @member {String} */\n this.id = layout.id;\n\n /** @member {Boolean} */\n this.initialized = false;\n /**\n * The index of this panel in the parent plot's `layout.panels`\n * @member {number}\n * */\n this.layout_idx = null;\n /** @member {Object} */\n this.svg = {};\n\n /**\n * A JSON-serializable object used to describe the composition of the Panel\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.Panel.DefaultLayout);\n\n // Define state parameters specific to this panel\n if (this.parent){\n /** @member {Object} */\n this.state = this.parent.state;\n\n /** @member {String} */\n this.state_id = this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n } else {\n this.state = null;\n this.state_id = null;\n }\n\n /** @member {Object} */\n this.data_layers = {};\n /** @member {String[]} */\n this.data_layer_ids_by_z_index = [];\n\n /** @protected */\n this.applyDataLayerZIndexesToDataLayerLayouts = function(){\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n }.bind(this);\n\n /**\n * Track data requests in progress\n * @member {Promise[]}\n * @protected\n */\n this.data_promises = [];\n\n /** @member {d3.scale} */\n this.x_scale = null;\n /** @member {d3.scale} */\n this.y1_scale = null;\n /** @member {d3.scale} */\n this.y2_scale = null;\n\n /** @member {d3.extent} */\n this.x_extent = null;\n /** @member {d3.extent} */\n this.y1_extent = null;\n /** @member {d3.extent} */\n this.y2_extent = null;\n\n /** @member {Number[]} */\n this.x_ticks = [];\n /** @member {Number[]} */\n this.y1_ticks = [];\n /** @member {Number[]} */\n this.y2_ticks = [];\n\n /**\n * A timeout ID as returned by setTimeout\n * @protected\n * @member {number}\n */\n this.zoom_timeout = null;\n\n /** @returns {string} */\n this.getBaseId = function(){\n return this.parent.id + \".\" + this.id;\n };\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": []\n };\n /**\n * There are several events that a LocusZoom panel can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following panel-level events are currently supported:\n * - `layout_changed` - context: panel - Any aspect of the panel's layout (including dimensions or state) has changed.\n * - `data_requested` - context: panel - A request for new data from any data source used in the panel has been made.\n * - `data_rendered` - context: panel - Data from a request has been received and rendered in the panel.\n * - `element_clicked` - context: panel - A data element in any of the panel's data layers has been clicked.\n * - `element_selection` - context: panel - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `panel.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * panel itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of the event (as defined in `event_hooks`)\n * @param {function} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n // TODO: Dry plot and panel event code into a shared mixin\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Panel}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n *\n * There is a shorter overloaded form of this method: if the event does not have any data, the second\n * argument can be a boolean to control bubbling\n *\n * @param {string} event A known event name\n * @param {*} [eventData] Data or event description that will be passed to the event listener\n * @param {boolean} [bubble=false] Whether to bubble the event to the parent\n * @returns {LocusZoom.Panel}\n */\n this.emit = function(event, eventData, bubble) {\n bubble = bubble || false;\n\n // TODO: DRY this with the parent plot implementation. Ensure interfaces remain compatible.\n // TODO: Improve documentation for overloaded method signature (JSDoc may have trouble here)\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n if (typeof eventData === \"boolean\" && arguments.length === 2) {\n // Overloaded method signature: emit(event, bubble)\n bubble = eventData;\n eventData = null;\n }\n var sourceID = this.getBaseId();\n var self = this;\n var eventContext = {sourceID: sourceID, data: eventData || null};\n this.event_hooks[event].forEach(function(hookToRun) {\n // By default, any handlers fired here will see the panel as the value of `this`. If a bound function is\n // registered as a handler, the previously bound `this` will override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n if (bubble && this.parent) {\n this.parent.emit(event, eventContext);\n }\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\n this.getPageOrigin = function(){\n var plot_origin = this.parent.getPageOrigin();\n return {\n x: plot_origin.x + this.layout.origin.x,\n y: plot_origin.y + this.layout.origin.y\n };\n };\n\n // Initialize the layout\n this.initializeLayout();\n\n return this;\n\n};\n\n/**\n * Default panel layout\n * @static\n * @type {Object}\n */\nLocusZoom.Panel.DefaultLayout = {\n title: { text: \"\", style: {}, x: 10, y: 22 },\n y_index: null,\n width: 0,\n height: 0,\n origin: { x: 0, y: null },\n min_width: 1,\n min_height: 1,\n proportional_width: null,\n proportional_height: null,\n proportional_origin: { x: 0, y: null },\n margin: { top: 0, right: 0, bottom: 0, left: 0 },\n background_click: \"clear_selections\",\n dashboard: {\n components: []\n },\n cliparea: {\n height: 0,\n width: 0,\n origin: { x: 0, y: 0 }\n },\n axes: { // These are the only axes supported!!\n x: {},\n y1: {},\n y2: {}\n },\n legend: null,\n interaction: {\n drag_background_to_pan: false,\n drag_x_ticks_to_scale: false,\n drag_y1_ticks_to_scale: false,\n drag_y2_ticks_to_scale: false,\n scroll_to_zoom: false,\n x_linked: false,\n y1_linked: false,\n y2_linked: false\n },\n data_layers: []\n};\n\n/**\n * Prepare the panel for first use by performing parameter validation, creating axes, setting default dimensions,\n * and preparing / positioning data layers as appropriate.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initializeLayout = function(){\n\n // If the layout is missing BOTH width and proportional width then set the proportional width to 1.\n // This will default the panel to taking up the full width of the plot.\n if (this.layout.width === 0 && this.layout.proportional_width === null){\n this.layout.proportional_width = 1;\n }\n\n // If the layout is missing BOTH height and proportional height then set the proportional height to\n // an equal share of the plot's current height.\n if (this.layout.height === 0 && this.layout.proportional_height === null){\n var panel_count = Object.keys(this.parent.panels).length;\n if (panel_count > 0){\n this.layout.proportional_height = (1 / panel_count);\n } else {\n this.layout.proportional_height = 1;\n }\n }\n\n // Set panel dimensions, origin, and margin\n this.setDimensions();\n this.setOrigin();\n this.setMargin();\n\n // Set ranges\n // TODO: Define stub values in constructor\n this.x_range = [0, this.layout.cliparea.width];\n this.y1_range = [this.layout.cliparea.height, 0];\n this.y2_range = [this.layout.cliparea.height, 0];\n\n // Initialize panel axes\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!Object.keys(this.layout.axes[axis]).length || this.layout.axes[axis].render ===false){\n // The default layout sets the axis to an empty object, so set its render boolean here\n this.layout.axes[axis].render = false;\n } else {\n this.layout.axes[axis].render = true;\n this.layout.axes[axis].label = this.layout.axes[axis].label || null;\n this.layout.axes[axis].label_function = this.layout.axes[axis].label_function || null;\n }\n }.bind(this));\n\n // Add data layers (which define x and y extents)\n this.layout.data_layers.forEach(function(data_layer_layout){\n this.addDataLayer(data_layer_layout);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Set the dimensions for the panel. If passed with no arguments will calculate optimal size based on layout\n * directives and the available area within the plot. If passed discrete width (number) and height (number) will\n * attempt to resize the panel to them, but may be limited by minimum dimensions defined on the plot or panel.\n *\n * @public\n * @param {number} [width]\n * @param {number} [height]\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setDimensions = function(width, height){\n if (typeof width != \"undefined\" && typeof height != \"undefined\"){\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n }\n } else {\n if (this.layout.proportional_width !== null){\n this.layout.width = Math.max(this.layout.proportional_width * this.parent.layout.width, this.layout.min_width);\n }\n if (this.layout.proportional_height !== null){\n this.layout.height = Math.max(this.layout.proportional_height * this.parent.layout.height, this.layout.min_height);\n }\n }\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n if (this.svg.clipRect){\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n if (this.initialized){\n this.render();\n this.curtain.update();\n this.loader.update();\n this.dashboard.update();\n if (this.legend){ this.legend.position(); }\n }\n return this;\n};\n\n/**\n * Set panel origin on the plot, and re-render as appropriate\n *\n * @public\n * @param {number} x\n * @param {number} y\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setOrigin = function(x, y){\n if (!isNaN(x) && x >= 0){ this.layout.origin.x = Math.max(Math.round(+x), 0); }\n if (!isNaN(y) && y >= 0){ this.layout.origin.y = Math.max(Math.round(+y), 0); }\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set margins around this panel\n * @public\n * @param {number} top\n * @param {number} right\n * @param {number} bottom\n * @param {number} left\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setMargin = function(top, right, bottom, left){\n var extra;\n if (!isNaN(top) && top >= 0){ this.layout.margin.top = Math.max(Math.round(+top), 0); }\n if (!isNaN(right) && right >= 0){ this.layout.margin.right = Math.max(Math.round(+right), 0); }\n if (!isNaN(bottom) && bottom >= 0){ this.layout.margin.bottom = Math.max(Math.round(+bottom), 0); }\n if (!isNaN(left) && left >= 0){ this.layout.margin.left = Math.max(Math.round(+left), 0); }\n if (this.layout.margin.top + this.layout.margin.bottom > this.layout.height){\n extra = Math.floor(((this.layout.margin.top + this.layout.margin.bottom) - this.layout.height) / 2);\n this.layout.margin.top -= extra;\n this.layout.margin.bottom -= extra;\n }\n if (this.layout.margin.left + this.layout.margin.right > this.layout.width){\n extra = Math.floor(((this.layout.margin.left + this.layout.margin.right) - this.layout.width) / 2);\n this.layout.margin.left -= extra;\n this.layout.margin.right -= extra;\n }\n [\"top\", \"right\", \"bottom\", \"left\"].forEach(function(m){\n this.layout.margin[m] = Math.max(this.layout.margin[m], 0);\n }.bind(this));\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n this.layout.cliparea.origin.x = this.layout.margin.left;\n this.layout.cliparea.origin.y = this.layout.margin.top;\n\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set the title for the panel. If passed an object, will merge the object with the existing layout configuration, so\n * that all or only some of the title layout object's parameters can be customized. If passed null, false, or an empty\n * string, the title DOM element will be set to display: none.\n *\n * @param {string|object|null} title The title text, or an object with additional configuration\n * @param {string} title.text Text to display. Since titles are rendered as SVG text, HTML and newlines will not be rendered.\n * @param {number} title.x X-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n * @param {number} title.y Y-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n NOTE: SVG y values go from the top down, so the SVG origin of (0,0) is in the top left corner.\n * @param {object} title.style CSS styles object to be applied to the title's DOM element.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setTitle = function(title){\n if (typeof this.layout.title == \"string\"){\n var text = this.layout.title;\n this.layout.title = { text: text, x: 0, y: 0, style: {} };\n }\n if (typeof title == \"string\"){\n this.layout.title.text = title;\n } else if (typeof title == \"object\" && title !== null){\n this.layout.title = LocusZoom.Layouts.merge(title, this.layout.title);\n }\n if (this.layout.title.text.length){\n this.title.attr(\"display\", null)\n .attr(\"x\", parseFloat(this.layout.title.x))\n .attr(\"y\", parseFloat(this.layout.title.y))\n .style(this.layout.title.style)\n .text(this.layout.title.text);\n } else {\n this.title.attr(\"display\", \"none\");\n }\n return this;\n};\n\n\n/**\n * Prepare the first rendering of the panel. This includes drawing the individual data layers, but also creates shared\n * elements such as axes, title, and loader/curtain.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initialize = function(){\n\n // Append a container group element to house the main panel group element and the clip path\n // Position with initial layout parameters\n this.svg.container = this.parent.svg.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel_container\")\n .attr(\"transform\", \"translate(\" + (this.layout.origin.x || 0) + \",\" + (this.layout.origin.y || 0) + \")\");\n\n // Append clip path to the parent svg element, size with initial layout parameters\n var clipPath = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\");\n this.svg.clipRect = clipPath.append(\"rect\")\n .attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Append svg group for rendering all panel child elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n // Add curtain and loader prototypes to the panel\n /** @member {Object} */\n this.curtain = LocusZoom.generateCurtain.call(this);\n /** @member {Object} */\n this.loader = LocusZoom.generateLoader.call(this);\n\n /**\n * Create the dashboard object and hang components on it as defined by panel layout\n * @member {LocusZoom.Dashboard}\n */\n this.dashboard = new LocusZoom.Dashboard(this);\n\n // Inner border\n this.inner_border = this.svg.group.append(\"rect\")\n .attr(\"class\", \"lz-panel-background\")\n .on(\"click\", function(){\n if (this.layout.background_click === \"clear_selections\"){ this.clearSelections(); }\n }.bind(this));\n\n // Add the title\n /** @member {Element} */\n this.title = this.svg.group.append(\"text\").attr(\"class\", \"lz-panel-title\");\n if (typeof this.layout.title != \"undefined\"){ this.setTitle(); }\n\n // Initialize Axes\n this.svg.x_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".x_axis\").attr(\"class\", \"lz-x lz-axis\");\n if (this.layout.axes.x.render){\n this.svg.x_axis_label = this.svg.x_axis.append(\"text\")\n .attr(\"class\", \"lz-x lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y1_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y1_axis\").attr(\"class\", \"lz-y lz-y1 lz-axis\");\n if (this.layout.axes.y1.render){\n this.svg.y1_axis_label = this.svg.y1_axis.append(\"text\")\n .attr(\"class\", \"lz-y1 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y2_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y2_axis\").attr(\"class\", \"lz-y lz-y2 lz-axis\");\n if (this.layout.axes.y2.render){\n this.svg.y2_axis_label = this.svg.y2_axis.append(\"text\")\n .attr(\"class\", \"lz-y2 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n\n // Initialize child Data Layers\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].initialize();\n }.bind(this));\n\n /**\n * Legend object, as defined by panel layout and child data layer layouts\n * @member {LocusZoom.Legend}\n * */\n this.legend = null;\n if (this.layout.legend){\n this.legend = new LocusZoom.Legend(this);\n }\n\n // Establish panel background drag interaction mousedown event handler (on the panel background)\n if (this.layout.interaction.drag_background_to_pan){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var mousedown = function(){\n this.parent.startDrag(this, \"background\");\n }.bind(this);\n this.svg.container.select(\".lz-panel-background\")\n .on(\"mousedown\" + namespace + \".background\", mousedown)\n .on(\"touchstart\" + namespace + \".background\", mousedown);\n }\n\n return this;\n\n};\n\n/**\n * Refresh the sort order of all data layers (called by data layer moveUp and moveDown methods)\n */\nLocusZoom.Panel.prototype.resortDataLayers = function(){\n var sort = [];\n this.data_layer_ids_by_z_index.forEach(function(id){\n sort.push(this.data_layers[id].layout.z_index);\n }.bind(this));\n this.svg.group.selectAll(\"g.lz-data_layer-container\").data(sort).sort(d3.ascending);\n this.applyDataLayerZIndexesToDataLayerLayouts();\n};\n\n/**\n * Get an array of panel IDs that are axis-linked to this panel\n * @param {('x'|'y1'|'y2')} axis\n * @returns {Array}\n */\nLocusZoom.Panel.prototype.getLinkedPanelIds = function(axis){\n axis = axis || null;\n var linked_panel_ids = [];\n if ([\"x\",\"y1\",\"y2\"].indexOf(axis) === -1){ return linked_panel_ids; }\n if (!this.layout.interaction[axis + \"_linked\"]){ return linked_panel_ids; }\n this.parent.panel_ids_by_y_index.forEach(function(panel_id){\n if (panel_id !== this.id && this.parent.panels[panel_id].layout.interaction[axis + \"_linked\"]){\n linked_panel_ids.push(panel_id);\n }\n }.bind(this));\n return linked_panel_ids;\n};\n\n/**\n * Move a panel up relative to others by y-index\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveUp = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index - 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index - 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index - 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Move a panel down (y-axis) relative to others in the plot\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveDown = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index + 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index + 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index + 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Create a new data layer from a provided layout object. Should have the keys specified in `DefaultLayout`\n * Will automatically add at the top (depth/z-index) of the panel unless explicitly directed differently\n * in the layout provided.\n * @param {object} layout\n * @returns {*}\n */\nLocusZoom.Panel.prototype.addDataLayer = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\" || typeof layout.id !== \"string\" || !layout.id.length){\n throw \"Invalid data layer layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n if (typeof this.data_layers[layout.id] !== \"undefined\"){\n throw \"Cannot create data_layer with id [\" + layout.id + \"]; data layer with that id already exists in the panel\";\n }\n if (typeof layout.type !== \"string\"){\n throw \"Invalid data layer type in layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n\n // If the layout defines a y axis make sure the axis number is set and is 1 or 2 (default to 1)\n if (typeof layout.y_axis == \"object\" && (typeof layout.y_axis.axis == \"undefined\" || [1,2].indexOf(layout.y_axis.axis) === -1)){\n layout.y_axis.axis = 1;\n }\n\n // Create the Data Layer\n var data_layer = LocusZoom.DataLayers.get(layout.type, layout, this);\n\n // Store the Data Layer on the Panel\n this.data_layers[data_layer.id] = data_layer;\n\n // If a discrete z_index was set in the layout then adjust other data layer z_index values to accommodate this one\n if (data_layer.layout.z_index !== null && !isNaN(data_layer.layout.z_index)\n && this.data_layer_ids_by_z_index.length > 0){\n // Negative z_index values should count backwards from the end, so convert negatives to appropriate values here\n if (data_layer.layout.z_index < 0){\n data_layer.layout.z_index = Math.max(this.data_layer_ids_by_z_index.length + data_layer.layout.z_index, 0);\n }\n this.data_layer_ids_by_z_index.splice(data_layer.layout.z_index, 0, data_layer.id);\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n } else {\n var length = this.data_layer_ids_by_z_index.push(data_layer.id);\n this.data_layers[data_layer.id].layout.z_index = length - 1;\n }\n\n // Determine if this data layer was already in the layout.data_layers array.\n // If it wasn't, add it. Either way store the layout.data_layers array index on the data_layer.\n var layout_idx = null;\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n if (data_layer_layout.id === data_layer.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.data_layers.push(this.data_layers[data_layer.id].layout) - 1;\n }\n this.data_layers[data_layer.id].layout_idx = layout_idx;\n\n return this.data_layers[data_layer.id];\n};\n\n/**\n * Remove a data layer by id\n * @param {string} id\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.removeDataLayer = function(id){\n if (!this.data_layers[id]){\n throw (\"Unable to remove data layer, ID not found: \" + id);\n }\n\n // Destroy all tooltips for the data layer\n this.data_layers[id].destroyAllTooltips();\n\n // Remove the svg container for the data layer if it exists\n if (this.data_layers[id].svg.container){\n this.data_layers[id].svg.container.remove();\n }\n\n // Delete the data layer and its presence in the panel layout and state\n this.layout.data_layers.splice(this.data_layers[id].layout_idx, 1);\n delete this.state[this.data_layers[id].state_id];\n delete this.data_layers[id];\n\n // Remove the data_layer id from the z_index array\n this.data_layer_ids_by_z_index.splice(this.data_layer_ids_by_z_index.indexOf(id), 1);\n\n // Update layout_idx and layout.z_index values for all remaining data_layers\n this.applyDataLayerZIndexesToDataLayerLayouts();\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n this.data_layers[data_layer_layout.id].layout_idx = idx;\n }.bind(this));\n\n return this;\n};\n\n/**\n * Clear all selections on all data layers\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.clearSelections = function(){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(\"selected\", false);\n }.bind(this));\n return this;\n};\n\n/**\n * When the parent plot changes state, adjust the panel accordingly. For example, this may include fetching new data\n * from the API as the viewing region changes\n * @returns {Promise}\n */\nLocusZoom.Panel.prototype.reMap = function(){\n this.emit(\"data_requested\");\n this.data_promises = [];\n\n // Remove any previous error messages before attempting to load new data\n this.curtain.hide();\n // Trigger reMap on each Data Layer\n for (var id in this.data_layers){\n try {\n this.data_promises.push(this.data_layers[id].reMap());\n } catch (error) {\n console.warn(error);\n this.curtain.show(error);\n }\n }\n // When all finished trigger a render\n return Q.all(this.data_promises)\n .then(function(){\n this.initialized = true;\n this.render();\n this.emit(\"layout_changed\", true);\n this.emit(\"data_rendered\");\n }.bind(this))\n .catch(function(error){\n console.warn(error);\n this.curtain.show(error);\n }.bind(this));\n};\n\n/**\n * Iterate over data layers to generate panel axis extents\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.generateExtents = function(){\n\n // Reset extents\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n this[axis + \"_extent\"] = null;\n }.bind(this));\n\n // Loop through the data layers\n for (var id in this.data_layers){\n\n var data_layer = this.data_layers[id];\n\n // If defined and not decoupled, merge the x extent of the data layer with the panel's x extent\n if (data_layer.layout.x_axis && !data_layer.layout.x_axis.decoupled){\n this.x_extent = d3.extent((this.x_extent || []).concat(data_layer.getAxisExtent(\"x\")));\n }\n\n // If defined and not decoupled, merge the y extent of the data layer with the panel's appropriate y extent\n if (data_layer.layout.y_axis && !data_layer.layout.y_axis.decoupled){\n var y_axis = \"y\" + data_layer.layout.y_axis.axis;\n this[y_axis+\"_extent\"] = d3.extent((this[y_axis+\"_extent\"] || []).concat(data_layer.getAxisExtent(\"y\")));\n }\n\n }\n\n // Override x_extent from state if explicitly defined to do so\n if (this.layout.axes.x && this.layout.axes.x.extent === \"state\"){\n this.x_extent = [ this.state.start, this.state.end ];\n }\n\n return this;\n\n};\n\n/**\n * Generate an array of ticks for an axis. These ticks are generated in one of three ways (highest wins):\n * 1. An array of specific tick marks\n * 2. Query each data layer for what ticks are appropriate, and allow a panel-level tick configuration parameter\n * object to override the layer's default presentation settings\n * 3. Generate generic tick marks based on the extent of the data\n * @param {('x'|'y1'|'y2')} axis The string identifier of the axis\n * @returns {Number[]|Object[]} TODO: number format?\n * An array of numbers: interpreted as an array of axis value offsets for positioning.\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.Panel.prototype.generateTicks = function(axis){\n\n // Parse an explicit 'ticks' attribute in the axis layout\n if (this.layout.axes[axis].ticks){\n var layout = this.layout.axes[axis];\n\n var baseTickConfig = layout.ticks;\n if (Array.isArray(baseTickConfig)){\n // Array of specific ticks hard-coded into a panel will override any ticks that an individual layer might specify\n return baseTickConfig;\n }\n\n if (typeof baseTickConfig === \"object\") {\n // If the layout specifies base configuration for ticks- but without specific positions- then ask each\n // data layer to report the tick marks that it thinks it needs\n // TODO: Few layers currently need to specify custom ticks (which is ok!). But if it becomes common, consider adding mechanisms to deduplicate ticks across layers\n var self = this;\n\n // Pass any layer-specific customizations for how ticks are calculated. (styles are overridden separately)\n var config = { position: baseTickConfig.position };\n\n var combinedTicks = this.data_layer_ids_by_z_index.reduce(function(acc, data_layer_id) {\n var nextLayer = self.data_layers[data_layer_id];\n return acc.concat(nextLayer.getTicks(axis, config));\n }, []);\n\n return combinedTicks.map(function(item) {\n // The layer makes suggestions, but tick configuration params specified on the panel take precedence\n var itemConfig = {};\n itemConfig = LocusZoom.Layouts.merge(itemConfig, baseTickConfig);\n return LocusZoom.Layouts.merge(itemConfig, item);\n });\n }\n }\n\n // If no other configuration is provided, attempt to generate ticks from the extent\n if (this[axis + \"_extent\"]) {\n return LocusZoom.prettyTicks(this[axis + \"_extent\"], \"both\");\n }\n return [];\n};\n\n/**\n * Update rendering of this panel whenever an event triggers a redraw. Assumes that the panel has already been\n * prepared the first time via `initialize`\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.render = function(){\n\n // Position the panel container\n this.svg.container.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n\n // Set size on the clip rect\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Set and position the inner border, style if necessary\n this.inner_border\n .attr(\"x\", this.layout.margin.left).attr(\"y\", this.layout.margin.top)\n .attr(\"width\", this.layout.width - (this.layout.margin.left + this.layout.margin.right))\n .attr(\"height\", this.layout.height - (this.layout.margin.top + this.layout.margin.bottom));\n if (this.layout.inner_border){\n this.inner_border.style({ \"stroke-width\": 1, \"stroke\": this.layout.inner_border });\n }\n\n // Set/update panel title if necessary\n this.setTitle();\n\n // Regenerate all extents\n this.generateExtents();\n\n // Helper function to constrain any procedurally generated vectors (e.g. ranges, extents)\n // Constraints applied here keep vectors from going to infinity or beyond a definable power of ten\n var constrain = function(value, limit_exponent){\n var neg_min = Math.pow(-10, limit_exponent);\n var neg_max = Math.pow(-10, -limit_exponent);\n var pos_min = Math.pow(10, -limit_exponent);\n var pos_max = Math.pow(10, limit_exponent);\n if (value === Infinity){ value = pos_max; }\n if (value === -Infinity){ value = neg_min; }\n if (value === 0){ value = pos_min; }\n if (value > 0){ value = Math.max(Math.min(value, pos_max), pos_min); }\n if (value < 0){ value = Math.max(Math.min(value, neg_max), neg_min); }\n return value;\n };\n\n // Define default and shifted ranges for all axes\n var ranges = {};\n if (this.x_extent){\n var base_x_range = { start: 0, end: this.layout.cliparea.width };\n if (this.layout.axes.x.range){\n base_x_range.start = this.layout.axes.x.range.start || base_x_range.start;\n base_x_range.end = this.layout.axes.x.range.end || base_x_range.end;\n }\n ranges.x = [base_x_range.start, base_x_range.end];\n ranges.x_shifted = [base_x_range.start, base_x_range.end];\n }\n if (this.y1_extent){\n var base_y1_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y1.range){\n base_y1_range.start = this.layout.axes.y1.range.start || base_y1_range.start;\n base_y1_range.end = this.layout.axes.y1.range.end || base_y1_range.end;\n }\n ranges.y1 = [base_y1_range.start, base_y1_range.end];\n ranges.y1_shifted = [base_y1_range.start, base_y1_range.end];\n }\n if (this.y2_extent){\n var base_y2_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y2.range){\n base_y2_range.start = this.layout.axes.y2.range.start || base_y2_range.start;\n base_y2_range.end = this.layout.axes.y2.range.end || base_y2_range.end;\n }\n ranges.y2 = [base_y2_range.start, base_y2_range.end];\n ranges.y2_shifted = [base_y2_range.start, base_y2_range.end];\n }\n\n // Shift ranges based on any drag or zoom interactions currently underway\n if (this.parent.interaction.panel_id && (this.parent.interaction.panel_id === this.id || this.parent.interaction.linked_panel_ids.indexOf(this.id) !== -1)){\n var anchor, scalar = null;\n if (this.parent.interaction.zooming && typeof this.x_scale == \"function\"){\n var current_extent_size = Math.abs(this.x_extent[1] - this.x_extent[0]);\n var current_scaled_extent_size = Math.round(this.x_scale.invert(ranges.x_shifted[1])) - Math.round(this.x_scale.invert(ranges.x_shifted[0]));\n var zoom_factor = this.parent.interaction.zooming.scale;\n var potential_extent_size = Math.floor(current_scaled_extent_size * (1 / zoom_factor));\n if (zoom_factor < 1 && !isNaN(this.parent.layout.max_region_scale)){\n zoom_factor = 1 /(Math.min(potential_extent_size, this.parent.layout.max_region_scale) / current_scaled_extent_size);\n } else if (zoom_factor > 1 && !isNaN(this.parent.layout.min_region_scale)){\n zoom_factor = 1 / (Math.max(potential_extent_size, this.parent.layout.min_region_scale) / current_scaled_extent_size);\n }\n var new_extent_size = Math.floor(current_extent_size * zoom_factor);\n anchor = this.parent.interaction.zooming.center - this.layout.margin.left - this.layout.origin.x;\n var offset_ratio = anchor / this.layout.cliparea.width;\n var new_x_extent_start = Math.max(Math.floor(this.x_scale.invert(ranges.x_shifted[0]) - ((new_extent_size - current_scaled_extent_size) * offset_ratio)), 1);\n ranges.x_shifted = [ this.x_scale(new_x_extent_start), this.x_scale(new_x_extent_start + new_extent_size) ];\n } else if (this.parent.interaction.dragging){\n switch (this.parent.interaction.dragging.method){\n case \"background\":\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n break;\n case \"x_tick\":\n if (d3.event && d3.event.shiftKey){\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n } else {\n anchor = this.parent.interaction.dragging.start_x - this.layout.margin.left - this.layout.origin.x;\n scalar = constrain(anchor / (anchor + this.parent.interaction.dragging.dragged_x), 3);\n ranges.x_shifted[0] = 0;\n ranges.x_shifted[1] = Math.max(this.layout.cliparea.width * (1 / scalar), 1);\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n var y_shifted = \"y\" + this.parent.interaction.dragging.method[1] + \"_shifted\";\n if (d3.event && d3.event.shiftKey){\n ranges[y_shifted][0] = this.layout.cliparea.height + this.parent.interaction.dragging.dragged_y;\n ranges[y_shifted][1] = +this.parent.interaction.dragging.dragged_y;\n } else {\n anchor = this.layout.cliparea.height - (this.parent.interaction.dragging.start_y - this.layout.margin.top - this.layout.origin.y);\n scalar = constrain(anchor / (anchor - this.parent.interaction.dragging.dragged_y), 3);\n ranges[y_shifted][0] = this.layout.cliparea.height;\n ranges[y_shifted][1] = this.layout.cliparea.height - (this.layout.cliparea.height * (1 / scalar));\n }\n }\n }\n }\n\n // Generate scales and ticks for all axes, then render them\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!this[axis + \"_extent\"]){ return; }\n\n // Base Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"])\n .range(ranges[axis + \"_shifted\"]);\n\n // Shift the extent\n this[axis + \"_extent\"] = [\n this[axis + \"_scale\"].invert(ranges[axis][0]),\n this[axis + \"_scale\"].invert(ranges[axis][1])\n ];\n\n // Finalize Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"]).range(ranges[axis]);\n\n // Render axis (and generate ticks as needed)\n this.renderAxis(axis);\n }.bind(this));\n\n // Establish mousewheel zoom event handers on the panel (namespacing not passed through by d3, so not used here)\n if (this.layout.interaction.scroll_to_zoom){\n var zoom_handler = function(){\n // Look for a shift key press while scrolling to execute.\n // If not present, gracefully raise a notification and allow conventional scrolling\n if (!d3.event.shiftKey){\n if (this.parent.canInteract(this.id)){\n this.loader.show(\"Press [SHIFT] while scrolling to zoom\").hide(1000);\n }\n return;\n }\n d3.event.preventDefault();\n if (!this.parent.canInteract(this.id)){ return; }\n var coords = d3.mouse(this.svg.container.node());\n var delta = Math.max(-1, Math.min(1, (d3.event.wheelDelta || -d3.event.detail || -d3.event.deltaY)));\n if (delta === 0){ return; }\n this.parent.interaction = {\n panel_id: this.id,\n linked_panel_ids: this.getLinkedPanelIds(\"x\"),\n zooming: {\n scale: (delta < 1) ? 0.9 : 1.1,\n center: coords[0]\n }\n };\n this.render();\n this.parent.interaction.linked_panel_ids.forEach(function(panel_id){\n this.parent.panels[panel_id].render();\n }.bind(this));\n if (this.zoom_timeout !== null){ clearTimeout(this.zoom_timeout); }\n this.zoom_timeout = setTimeout(function(){\n this.parent.interaction = {};\n this.parent.applyState({ start: this.x_extent[0], end: this.x_extent[1] });\n }.bind(this), 500);\n }.bind(this);\n this.zoom_listener = d3.behavior.zoom();\n this.svg.container.call(this.zoom_listener)\n .on(\"wheel.zoom\", zoom_handler)\n .on(\"mousewheel.zoom\", zoom_handler)\n .on(\"DOMMouseScroll.zoom\", zoom_handler);\n }\n\n // Render data layers in order by z-index\n this.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n this.data_layers[data_layer_id].draw().render();\n }.bind(this));\n\n return this;\n};\n\n\n/**\n * Render ticks for a particular axis\n * @param {('x'|'y1'|'y2')} axis The identifier of the axes\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.renderAxis = function(axis){\n\n if ([\"x\", \"y1\", \"y2\"].indexOf(axis) === -1){\n throw(\"Unable to render axis; invalid axis identifier: \" + axis);\n }\n\n var canRender = this.layout.axes[axis].render\n && typeof this[axis + \"_scale\"] == \"function\"\n && !isNaN(this[axis + \"_scale\"](0));\n\n // If the axis has already been rendered then check if we can/can't render it\n // Make sure the axis element is shown/hidden to suit\n if (this[axis+\"_axis\"]){\n this.svg.container.select(\"g.lz-axis.lz-\"+axis).style(\"display\", canRender ? null : \"none\");\n }\n\n if (!canRender){ return this; }\n\n // Axis-specific values to plug in where needed\n var axis_params = {\n x: {\n position: \"translate(\" + this.layout.margin.left + \",\" + (this.layout.height - this.layout.margin.bottom) + \")\",\n orientation: \"bottom\",\n label_x: this.layout.cliparea.width / 2,\n label_y: (this.layout.axes[axis].label_offset || 0),\n label_rotate: null\n },\n y1: {\n position: \"translate(\" + this.layout.margin.left + \",\" + this.layout.margin.top + \")\",\n orientation: \"left\",\n label_x: -1 * (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n },\n y2: {\n position: \"translate(\" + (this.layout.width - this.layout.margin.right) + \",\" + this.layout.margin.top + \")\",\n orientation: \"right\",\n label_x: (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n }\n };\n\n // Generate Ticks\n this[axis + \"_ticks\"] = this.generateTicks(axis);\n\n // Determine if the ticks are all numbers (d3-automated tick rendering) or not (manual tick rendering)\n var ticksAreAllNumbers = (function(ticks){\n for (var i = 0; i < ticks.length; i++){\n if (isNaN(ticks[i])){\n return false;\n }\n }\n return true;\n })(this[axis+\"_ticks\"]);\n\n // Initialize the axis; set scale and orientation\n this[axis+\"_axis\"] = d3.svg.axis().scale(this[axis+\"_scale\"]).orient(axis_params[axis].orientation).tickPadding(3);\n\n // Set tick values and format\n if (ticksAreAllNumbers){\n this[axis+\"_axis\"].tickValues(this[axis+\"_ticks\"]);\n if (this.layout.axes[axis].tick_format === \"region\"){\n this[axis+\"_axis\"].tickFormat(function(d) { return LocusZoom.positionIntToString(d, 6); });\n }\n } else {\n var ticks = this[axis+\"_ticks\"].map(function(t){\n return(t[axis.substr(0,1)]);\n });\n this[axis+\"_axis\"].tickValues(ticks)\n .tickFormat(function(t, i) { return this[axis+\"_ticks\"][i].text; }.bind(this));\n }\n\n // Position the axis in the SVG and apply the axis construct\n this.svg[axis+\"_axis\"]\n .attr(\"transform\", axis_params[axis].position)\n .call(this[axis+\"_axis\"]);\n\n // If necessary manually apply styles and transforms to ticks as specified by the layout\n if (!ticksAreAllNumbers){\n var tick_selector = d3.selectAll(\"g#\" + this.getBaseId().replace(\".\",\"\\\\.\") + \"\\\\.\" + axis + \"_axis g.tick\");\n var panel = this;\n tick_selector.each(function(d, i){\n var selector = d3.select(this).select(\"text\");\n if (panel[axis+\"_ticks\"][i].style){\n selector.style(panel[axis+\"_ticks\"][i].style);\n }\n if (panel[axis+\"_ticks\"][i].transform){\n selector.attr(\"transform\", panel[axis+\"_ticks\"][i].transform);\n }\n });\n }\n\n // Render the axis label if necessary\n var label = this.layout.axes[axis].label || null;\n if (label !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"x\", axis_params[axis].label_x).attr(\"y\", axis_params[axis].label_y)\n .text(LocusZoom.parseFields(this.state, label));\n if (axis_params[axis].label_rotate !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"transform\", \"rotate(\" + axis_params[axis].label_rotate + \" \" + axis_params[axis].label_x + \",\" + axis_params[axis].label_y + \")\");\n }\n }\n\n // Attach interactive handlers to ticks as needed\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (this.layout.interaction[\"drag_\" + axis + \"_ticks_to_scale\"]){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var tick_mouseover = function(){\n if (typeof d3.select(this).node().focus == \"function\"){ d3.select(this).node().focus(); }\n var cursor = (axis === \"x\") ? \"ew-resize\" : \"ns-resize\";\n if (d3.event && d3.event.shiftKey){ cursor = \"move\"; }\n d3.select(this)\n .style({\"font-weight\": \"bold\", \"cursor\": cursor})\n .on(\"keydown\" + namespace, tick_mouseover)\n .on(\"keyup\" + namespace, tick_mouseover);\n };\n this.svg.container.selectAll(\".lz-axis.lz-\" + axis + \" .tick text\")\n .attr(\"tabindex\", 0) // necessary to make the tick focusable so keypress events can be captured\n .on(\"mouseover\" + namespace, tick_mouseover)\n .on(\"mouseout\" + namespace, function(){\n d3.select(this).style({\"font-weight\": \"normal\"});\n d3.select(this).on(\"keydown\" + namespace, null).on(\"keyup\" + namespace, null);\n })\n .on(\"mousedown\" + namespace, function(){\n this.parent.startDrag(this, axis + \"_tick\");\n }.bind(this));\n }\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Force the height of this panel to the largest absolute height of the data in\n * all child data layers (if not null for any child data layers)\n * @param {number} [target_height] A target height, which will be used in situations when the expected height can be\n * pre-calculated (eg when the layers are transitioning)\n */\nLocusZoom.Panel.prototype.scaleHeightToData = function(target_height){\n target_height = +target_height || null;\n if (target_height === null){\n this.data_layer_ids_by_z_index.forEach(function(id){\n var dh = this.data_layers[id].getAbsoluteDataHeight();\n if (+dh){\n if (target_height === null){ target_height = +dh; }\n else { target_height = Math.max(target_height, +dh); }\n }\n }.bind(this));\n }\n if (+target_height){\n target_height += +this.layout.margin.top + +this.layout.margin.bottom;\n this.setDimensions(this.layout.width, target_height);\n this.parent.setDimensions();\n this.parent.panel_ids_by_y_index.forEach(function(id){\n this.parent.panels[id].layout.proportional_height = null;\n }.bind(this));\n this.parent.positionPanels();\n }\n};\n\n/**\n * Methods to set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n */\nLocusZoom.Panel.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setElementStatusByFilters(status, toggle, filters, exclusive);\n }.bind(this));\n};\n/**\n * Set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n */\nLocusZoom.Panel.prototype.setAllElementStatus = function(status, toggle){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(status, toggle);\n }.bind(this));\n};\n// TODO: Capture documentation for dynamically generated methods\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.Panel.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.Panel.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.Panel.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.Panel.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n\n/**\n * Add a \"basic\" loader to a panel\n * This method is just a shortcut for adding the most commonly used type of loading indicator, which appears when\n * data is requested, animates (e.g. shows an infinitely cycling progress bar as opposed to one that loads from\n * 0-100% based on actual load progress), and disappears when new data is loaded and rendered.\n *\n *\n * @param {Boolean} show_immediately\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.addBasicLoader = function(show_immediately){\n if (typeof show_immediately != \"undefined\"){ show_immediately = true; }\n if (show_immediately){\n this.loader.show(\"Loading...\").animate();\n }\n this.on(\"data_requested\", function(){\n this.loader.show(\"Loading...\").animate();\n }.bind(this));\n this.on(\"data_rendered\", function(){\n this.loader.hide();\n }.bind(this));\n return this;\n};\n"]} \ No newline at end of file diff --git a/dist/locuszoom.app.min.js b/dist/locuszoom.app.min.js index 53c3244b..0b29568f 100644 --- a/dist/locuszoom.app.min.js +++ b/dist/locuszoom.app.min.js @@ -1,7 +1,7 @@ -!function(t,e){"function"==typeof define&&define.amd?define(["postal"],function(a,i){return t.LocusZoom=e(a,i)}):"object"==typeof module&&module.exports?module.exports=t.LocusZoom=e(require("d3"),require("Q")):t.LocusZoom=e(t.d3,t.Q)}(this,function(t,e){var a=function(t,e){if(e==t)return!0;var a=t.split("."),i=e.split("."),n=!1;return a.forEach(function(t,e){!n&&+i[e]>+a[e]&&(n=!0)}),n};try{var i="3.5.6";if("object"!=typeof t)throw"d3 dependency not met. Library missing.";if(!a(i,t.version))throw"d3 dependency not met. Outdated version detected.\nRequired d3 version: "+i+" or higher (found: "+t.version+").";if("function"!=typeof e)throw"Q dependency not met. Library missing.";var n={version:"0.7.2"};n.populate=function(e,a,i){if("undefined"==typeof e)throw"LocusZoom.populate selector not defined";t.select(e).html("");var s;return t.select(e).call(function(){if("undefined"==typeof this.node().id){for(var e=0;!t.select("#lz-"+e).empty();)e++;this.attr("id","#lz-"+e)}if(s=new n.Plot(this.node().id,a,i),s.container=this.node(),"undefined"!=typeof this.node().dataset&&"undefined"!=typeof this.node().dataset.region){var o=n.parsePositionQuery(this.node().dataset.region);Object.keys(o).forEach(function(t){s.state[t]=o[t]})}s.svg=t.select("div#"+s.id).append("svg").attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").attr("id",s.id+"_svg").attr("class","lz-locuszoom").style(s.layout.style),s.setDimensions(),s.positionPanels(),s.initialize(),"object"==typeof a&&Object.keys(a).length&&s.refresh()}),s},n.populateAll=function(e,a,i){var s=[];return t.selectAll(e).each(function(t,e){s[e]=n.populate(this,a,i)}),s},n.positionIntToString=function(t,e,a){var i={0:"",3:"K",6:"M",9:"G"};if(a=a||!1,isNaN(e)||null===e){var n=Math.log(t)/Math.LN10;e=Math.min(Math.max(n-n%3,0),9)}var s=e-Math.floor((Math.log(t)/Math.LN10).toFixed(e+3)),o=Math.min(Math.max(e,0),2),r=Math.min(Math.max(s,o),12),l=""+(t/Math.pow(10,e)).toFixed(r);return a&&"undefined"!=typeof i[e]&&(l+=" "+i[e]+"b"),l},n.positionStringToInt=function(t){var e=t.toUpperCase();e=e.replace(/,/g,"");var a=/([KMG])[B]*$/,i=a.exec(e),n=1;return i&&(n="M"===i[1]?1e6:"G"===i[1]?1e9:1e3,e=e.replace(a,"")),e=Number(e)*n},n.parsePositionQuery=function(t){var e=/^(\w+):([\d,.]+[kmgbKMGB]*)([-+])([\d,.]+[kmgbKMGB]*)$/,a=/^(\w+):([\d,.]+[kmgbKMGB]*)$/,i=e.exec(t);if(i){if("+"===i[3]){var s=n.positionStringToInt(i[2]),o=n.positionStringToInt(i[4]);return{chr:i[1],start:s-o,end:s+o}}return{chr:i[1],start:n.positionStringToInt(i[2]),end:n.positionStringToInt(i[4])}}return i=a.exec(t),i?{chr:i[1],position:n.positionStringToInt(i[2])}:null},n.prettyTicks=function(t,e,a){("undefined"==typeof a||isNaN(parseInt(a)))&&(a=5),a=parseInt(a);var i=a/3,n=.75,s=1.5,o=.5+1.5*s,r=Math.abs(t[0]-t[1]),l=r/a;Math.log(r)/Math.LN10<-2&&(l=Math.max(Math.abs(r))*n/i);var h=Math.pow(10,Math.floor(Math.log(l)/Math.LN10)),d=0;h<1&&0!==h&&(d=Math.abs(Math.round(Math.log(h)/Math.LN10)));var u=h;2*h-l0&&(c=parseFloat(c.toFixed(d)));return p.push(c),"undefined"!=typeof e&&["low","high","both","neither"].indexOf(e)!==-1||(e="neither"),"low"!==e&&"both"!==e||p[0]t[1]&&p.pop(),p},n.createCORSPromise=function(t,a,i,n,s){var o=e.defer(),r=new XMLHttpRequest;if("withCredentials"in r?r.open(t,a,!0):"undefined"!=typeof XDomainRequest?(r=new XDomainRequest,r.open(t,a)):r=null,r){if(r.onreadystatechange=function(){4===r.readyState&&(200===r.status||0===r.status?o.resolve(r.response):o.reject("HTTP "+r.status+" for "+a))},s&&setTimeout(o.reject,s),i="undefined"!=typeof i?i:"","undefined"!=typeof n)for(var l in n)r.setRequestHeader(l,n[l]);r.send(i)}return o.promise},n.validateState=function(t,e){t=t||{},e=e||{};var a=!1;if("undefined"!=typeof t.chr&&"undefined"!=typeof t.start&&"undefined"!=typeof t.end){var i,n=null;if(t.start=Math.max(parseInt(t.start),1),t.end=Math.max(parseInt(t.end),1),isNaN(t.start)&&isNaN(t.end))t.start=1,t.end=1,n=.5,i=0;else if(isNaN(t.start)||isNaN(t.end))n=t.start||t.end,i=0,t.start=isNaN(t.start)?t.end:t.start,t.end=isNaN(t.end)?t.start:t.end;else{if(n=Math.round((t.start+t.end)/2),i=t.end-t.start,i<0){var s=t.start;t.end=t.start,t.start=s,i=t.end-t.start}n<0&&(t.start=1,t.end=1,i=0)}a=!0}return!isNaN(e.min_region_scale)&&a&&ie.max_region_scale&&(t.start=Math.max(n-Math.floor(e.max_region_scale/2),1),t.end=t.start+e.max_region_scale),t},n.parseFields=function(t,e){if("object"!=typeof t)throw"LocusZoom.parseFields invalid arguments: data is not an object";if("string"!=typeof e)throw"LocusZoom.parseFields invalid arguments: html is not a string";for(var a=[],i=/\{\{(?:(#if )?([A-Za-z0-9_:|]+)|(\/if))\}\}/;e.length>0;){var s=i.exec(e);s?0!==s.index?(a.push({text:e.slice(0,s.index)}),e=e.slice(s.index)):"#if "===s[1]?(a.push({condition:s[2]}),e=e.slice(s[0].length)):s[2]?(a.push({variable:s[2]}),e=e.slice(s[0].length)):"/if"===s[3]?(a.push({close:"if"}),e=e.slice(s[0].length)):(console.error("Error tokenizing tooltip when remaining template is "+JSON.stringify(e)+" and previous tokens are "+JSON.stringify(a)+" and current regex match is "+JSON.stringify([s[1],s[2],s[3]])),e=e.slice(s[0].length)):(a.push({text:e}),e="")}for(var o=function(){var t=a.shift();if("undefined"!=typeof t.text||t.variable)return t;if(t.condition){for(t.then=[];a.length>0;){if("if"===a[0].close){a.shift();break}t.then.push(o())}return t}return console.error("Error making tooltip AST due to unknown token "+JSON.stringify(t)),{text:""}},r=[];a.length>0;)r.push(o());var l=function(e){return l.cache.hasOwnProperty(e)||(l.cache[e]=new n.Data.Field(e).resolve(t)),l.cache[e]};l.cache={};var h=function(t){if("undefined"!=typeof t.text)return t.text;if(t.variable){try{var e=l(t.variable);if(["string","number","boolean"].indexOf(typeof e)!==-1)return e;if(null===e)return""}catch(e){console.error("Error while processing variable "+JSON.stringify(t.variable))}return"{{"+t.variable+"}}"}if(t.condition){try{var a=l(t.condition);if(a||0===a)return t.then.map(h).join("")}catch(e){console.error("Error while processing condition "+JSON.stringify(t.variable))}return""}console.error("Error rendering tooltip due to unknown AST node "+JSON.stringify(t))};return r.map(h).join("")},n.getToolTipData=function(e){if("object"!=typeof e||"undefined"==typeof e.parentNode)throw"Invalid node object";var a=t.select(e);return a.classed("lz-data_layer-tooltip")&&"undefined"!=typeof a.data()[0]?a.data()[0]:n.getToolTipData(e.parentNode)},n.getToolTipDataLayer=function(t){var e=n.getToolTipData(t);return e.getDataLayer?e.getDataLayer():null},n.getToolTipPanel=function(t){var e=n.getToolTipDataLayer(t);return e?e.parent:null},n.getToolTipPlot=function(t){var e=n.getToolTipPanel(t);return e?e.parent:null},n.generateCurtain=function(){var e={showing:!1,selector:null,content_selector:null,hide_delay:null,show:function(e,a){return this.curtain.showing||(this.curtain.selector=t.select(this.parent_plot.svg.node().parentNode).insert("div").attr("class","lz-curtain").attr("id",this.id+".curtain"),this.curtain.content_selector=this.curtain.selector.append("div").attr("class","lz-curtain-content"),this.curtain.selector.append("div").attr("class","lz-curtain-dismiss").html("Dismiss").on("click",function(){this.curtain.hide()}.bind(this)),this.curtain.showing=!0),this.curtain.update(e,a)}.bind(this),update:function(t,e){if(!this.curtain.showing)return this.curtain;clearTimeout(this.curtain.hide_delay),"object"==typeof e&&this.curtain.selector.style(e);var a=this.getPageOrigin();return this.curtain.selector.style({top:a.y+"px",left:a.x+"px",width:this.layout.width+"px",height:this.layout.height+"px"}),this.curtain.content_selector.style({"max-width":this.layout.width-40+"px","max-height":this.layout.height-40+"px"}),"string"==typeof t&&this.curtain.content_selector.html(t),this.curtain}.bind(this),hide:function(t){return this.curtain.showing?"number"==typeof t?(clearTimeout(this.curtain.hide_delay),this.curtain.hide_delay=setTimeout(this.curtain.hide,t),this.curtain):(this.curtain.selector.remove(),this.curtain.selector=null,this.curtain.content_selector=null,this.curtain.showing=!1,this.curtain):this.curtain}.bind(this)};return e},n.generateLoader=function(){var e={showing:!1,selector:null,content_selector:null,progress_selector:null,cancel_selector:null,show:function(e){return this.loader.showing||(this.loader.selector=t.select(this.parent_plot.svg.node().parentNode).insert("div").attr("class","lz-loader").attr("id",this.id+".loader"),this.loader.content_selector=this.loader.selector.append("div").attr("class","lz-loader-content"),this.loader.progress_selector=this.loader.selector.append("div").attr("class","lz-loader-progress-container").append("div").attr("class","lz-loader-progress"),this.loader.showing=!0,"undefined"==typeof e&&(e="Loading...")),this.loader.update(e)}.bind(this),update:function(t,e){if(!this.loader.showing)return this.loader;clearTimeout(this.loader.hide_delay),"string"==typeof t&&this.loader.content_selector.html(t);var a=6,i=this.getPageOrigin(),n=this.loader.selector.node().getBoundingClientRect();return this.loader.selector.style({top:i.y+this.layout.height-n.height-a+"px",left:i.x+a+"px"}),"number"==typeof e&&this.loader.progress_selector.style({width:Math.min(Math.max(e,1),100)+"%"}),this.loader}.bind(this),animate:function(){return this.loader.progress_selector.classed("lz-loader-progress-animated",!0),this.loader}.bind(this),setPercentCompleted:function(t){return this.loader.progress_selector.classed("lz-loader-progress-animated",!1),this.loader.update(null,t)}.bind(this),hide:function(t){return this.loader.showing?"number"==typeof t?(clearTimeout(this.loader.hide_delay),this.loader.hide_delay=setTimeout(this.loader.hide,t),this.loader):(this.loader.selector.remove(),this.loader.selector=null,this.loader.content_selector=null,this.loader.progress_selector=null,this.loader.cancel_selector=null,this.loader.showing=!1,this.loader):this.loader}.bind(this)};return e},n.subclass=function(t,e,a){if("function"!=typeof t)throw"Parent must be a callable constructor";e=e||{};var i=a||function(){t.apply(this,arguments)};return i.prototype=Object.create(t.prototype),Object.keys(e).forEach(function(t){i.prototype[t]=e[t]}),i.prototype.constructor=i,i},n.Layouts=function(){var t={},e={plot:{},panel:{},data_layer:{},dashboard:{},tooltip:{}};return t.get=function(t,a,i){if("string"!=typeof t||"string"!=typeof a)throw"invalid arguments passed to LocusZoom.Layouts.get, requires string (layout type) and string (layout name)";if(e[t][a]){var s=n.Layouts.merge(i||{},e[t][a]);if(s.unnamespaced)return delete s.unnamespaced,JSON.parse(JSON.stringify(s));var o="";"string"==typeof s.namespace?o=s.namespace:"object"==typeof s.namespace&&Object.keys(s.namespace).length&&(o="undefined"!=typeof s.namespace.default?s.namespace.default:s.namespace[Object.keys(s.namespace)[0]].toString()),o+=o.length?":":"";var r=function(t,e){if(e?"string"==typeof e&&(e={default:e}):e={default:""},"string"==typeof t){for(var a,i,s,l,h=/\{\{namespace(\[[A-Za-z_0-9]+\]|)\}\}/g,d=[];null!==(a=h.exec(t));)i=a[0],s=a[1].length?a[1].replace(/(\[|\])/g,""):null,l=o,null!=e&&"object"==typeof e&&"undefined"!=typeof e[s]&&(l=e[s]+(e[s].length?":":"")),d.push({base:i,namespace:l});for(var u in d)t=t.replace(d[u].base,d[u].namespace)}else if("object"==typeof t&&null!=t){if("undefined"!=typeof t.namespace){var p="string"==typeof t.namespace?{default:t.namespace}:t.namespace;e=n.Layouts.merge(e,p)}var c,y;for(var f in t)"namespace"!==f&&(c=r(t[f],e),y=r(f,e),f!==y&&delete t[f],t[y]=c)}return t};return s=r(s,s.namespace),JSON.parse(JSON.stringify(s))}throw"layout type ["+t+"] name ["+a+"] not found"},t.set=function(t,a,i){if("string"!=typeof t||"string"!=typeof a||"object"!=typeof i)throw"unable to set new layout; bad arguments passed to set()";return e[t]||(e[t]={}),i?e[t][a]=JSON.parse(JSON.stringify(i)):(delete e[t][a],null)},t.add=function(e,a,i){return t.set(e,a,i)},t.list=function(t){if(e[t])return Object.keys(e[t]);var a={};return Object.keys(e).forEach(function(t){a[t]=Object.keys(e[t])}),a},t.merge=function(t,e){if("object"!=typeof t||"object"!=typeof e)throw"LocusZoom.Layouts.merge only accepts two layout objects; "+typeof t+", "+typeof e+" given";for(var a in e)if(e.hasOwnProperty(a)){var i=null===t[a]?"undefined":typeof t[a],s=typeof e[a];if("object"===i&&Array.isArray(t[a])&&(i="array"),"object"===s&&Array.isArray(e[a])&&(s="array"),"function"===i||"function"===s)throw"LocusZoom.Layouts.merge encountered an unsupported property type";"undefined"!==i?"object"!==i||"object"!==s||(t[a]=n.Layouts.merge(t[a],e[a])):t[a]=JSON.parse(JSON.stringify(e[a]))}return t},t}(),n.Layouts.add("tooltip","standard_association",{namespace:{assoc:"assoc"},closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:'{{{{namespace[assoc]}}variant}}
      P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
      Ref. Allele: {{{{namespace[assoc]}}ref_allele}}
      Make LD Reference
      '});var s=n.Layouts.get("tooltip","standard_association",{unnamespaced:!0});s.html+='Condition on Variant
      ',n.Layouts.add("tooltip","covariates_model_association",s),n.Layouts.add("tooltip","standard_genes",{closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:'

      {{gene_name}}

      Gene ID: {{gene_id}}
      Transcript ID: {{transcript_id}}
      ConstraintExpected variantsObserved variantsConst. Metric
      Synonymous{{exp_syn}}{{n_syn}}z = {{syn_z}}
      Missense{{exp_mis}}{{n_mis}}z = {{mis_z}}
      LoF{{exp_lof}}{{n_lof}}pLI = {{pLI}}
      More data on ExAC'}),n.Layouts.add("tooltip","standard_intervals",{namespace:{intervals:"intervals"},closable:!1,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:"{{{{namespace[intervals]}}state_name}}
      {{{{namespace[intervals]}}start}}-{{{{namespace[intervals]}}end}}"}),n.Layouts.add("data_layer","significance",{id:"significance",type:"orthogonal_line",orientation:"horizontal",offset:4.522}),n.Layouts.add("data_layer","recomb_rate",{namespace:{recomb:"recomb"},id:"recombrate",type:"line",fields:["{{namespace[recomb]}}position","{{namespace[recomb]}}recomb_rate"],z_index:1,style:{stroke:"#0000FF","stroke-width":"1.5px"},x_axis:{field:"{{namespace[recomb]}}position"},y_axis:{axis:2,field:"{{namespace[recomb]}}recomb_rate",floor:0,ceiling:100}}),n.Layouts.add("data_layer","association_pvalues",{namespace:{assoc:"assoc",ld:"ld"},id:"associationpvalues",type:"scatter",point_shape:{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:"diamond",else:"circle"}},point_size:{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:80,else:40}},color:[{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:"#9632b8"}},{scale_function:"numerical_bin",field:"{{namespace[ld]}}state",parameters:{breaks:[0,.2,.4,.6,.8],values:["#357ebd","#46b8da","#5cb85c","#eea236","#d43f3a"]}},"#B8B8B8"],legend:[{shape:"diamond",color:"#9632b8",size:40,label:"LD Ref Var",class:"lz-data_layer-scatter"},{shape:"circle",color:"#d43f3a",size:40,label:"1.0 > r² ≥ 0.8",class:"lz-data_layer-scatter"},{shape:"circle",color:"#eea236",size:40,label:"0.8 > r² ≥ 0.6",class:"lz-data_layer-scatter"},{shape:"circle",color:"#5cb85c",size:40,label:"0.6 > r² ≥ 0.4",class:"lz-data_layer-scatter"},{shape:"circle",color:"#46b8da",size:40,label:"0.4 > r² ≥ 0.2",class:"lz-data_layer-scatter"},{shape:"circle",color:"#357ebd",size:40,label:"0.2 > r² ≥ 0.0",class:"lz-data_layer-scatter"},{shape:"circle",color:"#B8B8B8",size:40,label:"no r² data",class:"lz-data_layer-scatter"}],fields:["{{namespace[assoc]}}variant","{{namespace[assoc]}}position","{{namespace[assoc]}}log_pvalue","{{namespace[assoc]}}log_pvalue|logtoscinotation","{{namespace[assoc]}}ref_allele","{{namespace[ld]}}state","{{namespace[ld]}}isrefvar"],id_field:"{{namespace[assoc]}}variant",z_index:2,x_axis:{field:"{{namespace[assoc]}}position"},y_axis:{axis:1,field:"{{namespace[assoc]}}log_pvalue",floor:0,upper_buffer:.1,min_extent:[0,10]},behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_association",{unnamespaced:!0})}),n.Layouts.add("data_layer","phewas_pvalues",{namespace:{phewas:"phewas"},id:"phewaspvalues",type:"category_scatter",point_shape:"circle",point_size:70,tooltip_positioning:"vertical",id_field:"{{namespace[phewas]}}id",fields:["{{namespace[phewas]}}id","{{namespace[phewas]}}log_pvalue","{{namespace[phewas]}}trait_group","{{namespace[phewas]}}trait_label"],x_axis:{field:"{{namespace[phewas]}}x",category_field:"{{namespace[phewas]}}trait_group",lower_buffer:.025,upper_buffer:.025},y_axis:{axis:1,field:"{{namespace[phewas]}}log_pvalue",floor:0,upper_buffer:.15},color:{field:"{{namespace[phewas]}}trait_group",scale_function:"categorical_bin",parameters:{categories:[],values:[],null_value:"#B8B8B8"}},fill_opacity:.7,tooltip:{closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:["Trait: {{{{namespace[phewas]}}trait_label|htmlescape}}
      ","Trait Category: {{{{namespace[phewas]}}trait_group|htmlescape}}
      ","P-value: {{{{namespace[phewas]}}log_pvalue|logtoscinotation|htmlescape}}
      "].join("")},behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},label:{text:"{{{{namespace[phewas]}}trait_label}}",spacing:6,lines:{style:{"stroke-width":"2px",stroke:"#333333","stroke-dasharray":"2px 2px"}},filters:[{field:"{{namespace[phewas]}}log_pvalue",operator:">=",value:20}],style:{"font-size":"14px","font-weight":"bold",fill:"#333333"}}}),n.Layouts.add("data_layer","genes",{namespace:{gene:"gene",constraint:"constraint"},id:"genes",type:"genes",fields:["{{namespace[gene]}}gene","{{namespace[constraint]}}constraint"],id_field:"gene_id",behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_genes",{unnamespaced:!0})}),n.Layouts.add("data_layer","genome_legend",{namespace:{genome:"genome"},id:"genome_legend",type:"genome_legend",fields:["{{namespace[genome]}}chr","{{namespace[genome]}}base_pairs"],x_axis:{floor:0,ceiling:2881033286}}),n.Layouts.add("data_layer","intervals",{namespace:{intervals:"intervals"},id:"intervals",type:"intervals",fields:["{{namespace[intervals]}}start","{{namespace[intervals]}}end","{{namespace[intervals]}}state_id","{{namespace[intervals]}}state_name"],id_field:"{{namespace[intervals]}}start",start_field:"{{namespace[intervals]}}start",end_field:"{{namespace[intervals]}}end",track_split_field:"{{namespace[intervals]}}state_id",split_tracks:!0,always_hide_legend:!1,color:{field:"{{namespace[intervals]}}state_id",scale_function:"categorical_bin",parameters:{categories:[1,2,3,4,5,6,7,8,9,10,11,12,13],values:["rgb(212,63,58)","rgb(250,120,105)","rgb(252,168,139)","rgb(240,189,66)","rgb(250,224,105)","rgb(240,238,84)","rgb(244,252,23)","rgb(23,232,252)","rgb(32,191,17)","rgb(23,166,77)","rgb(32,191,17)","rgb(162,133,166)","rgb(212,212,212)"],null_value:"#B8B8B8"}},legend:[{shape:"rect",color:"rgb(212,63,58)",width:9,label:"Active Promoter","{{namespace[intervals]}}state_id":1},{shape:"rect",color:"rgb(250,120,105)",width:9,label:"Weak Promoter","{{namespace[intervals]}}state_id":2},{shape:"rect",color:"rgb(252,168,139)",width:9,label:"Poised Promoter","{{namespace[intervals]}}state_id":3},{shape:"rect",color:"rgb(240,189,66)",width:9,label:"Strong enhancer","{{namespace[intervals]}}state_id":4},{shape:"rect",color:"rgb(250,224,105)",width:9,label:"Strong enhancer","{{namespace[intervals]}}state_id":5},{shape:"rect",color:"rgb(240,238,84)",width:9,label:"Weak enhancer","{{namespace[intervals]}}state_id":6},{shape:"rect",color:"rgb(244,252,23)",width:9,label:"Weak enhancer","{{namespace[intervals]}}state_id":7},{shape:"rect",color:"rgb(23,232,252)",width:9,label:"Insulator","{{namespace[intervals]}}state_id":8},{shape:"rect",color:"rgb(32,191,17)",width:9,label:"Transcriptional transition","{{namespace[intervals]}}state_id":9},{shape:"rect",color:"rgb(23,166,77)",width:9,label:"Transcriptional elongation","{{namespace[intervals]}}state_id":10},{shape:"rect",color:"rgb(136,240,129)",width:9,label:"Weak transcribed","{{namespace[intervals]}}state_id":11},{shape:"rect",color:"rgb(162,133,166)",width:9,label:"Polycomb-repressed","{{namespace[intervals]}}state_id":12},{shape:"rect",color:"rgb(212,212,212)",width:9,label:"Heterochromatin / low signal","{{namespace[intervals]}}state_id":13}],behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_intervals",{unnamespaced:!0})}),n.Layouts.add("dashboard","standard_panel",{components:[{type:"remove_panel",position:"right",color:"red",group_position:"end"},{type:"move_panel_up",position:"right",group_position:"middle"},{type:"move_panel_down",position:"right",group_position:"start",style:{"margin-left":"0.75em"}}]}),n.Layouts.add("dashboard","standard_plot",{components:[{type:"title",title:"LocusZoom",subtitle:'v'+n.version+"",position:"left"},{type:"dimensions",position:"right"},{type:"region_scale",position:"right"},{type:"download",position:"right"}]});var o=n.Layouts.get("dashboard","standard_plot");o.components.push({type:"covariates_model",button_html:"Model",button_title:"Show and edit covariates currently in model",position:"left"}),n.Layouts.add("dashboard","covariates_model_plot",o);var r=n.Layouts.get("dashboard","standard_plot");r.components.push({type:"shift_region",step:5e5,button_html:">>",position:"right",group_position:"end"}),r.components.push({type:"shift_region",step:5e4,button_html:">",position:"right",group_position:"middle"}),r.components.push({type:"zoom_region",step:.2,position:"right",group_position:"middle"}),r.components.push({type:"zoom_region",step:-.2,position:"right",group_position:"middle"}),r.components.push({type:"shift_region",step:-5e4,button_html:"<",position:"right",group_position:"middle"}),r.components.push({type:"shift_region",step:-5e5,button_html:"<<",position:"right",group_position:"start"}),n.Layouts.add("dashboard","region_nav_plot",r),n.Layouts.add("panel","association",{id:"association",width:800,height:225,min_width:400,min_height:200,proportional_width:1,margin:{top:35,right:50,bottom:40,left:50},inner_border:"rgb(210, 210, 210)",dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"toggle_legend",position:"right"}),t}(),axes:{x:{label:"Chromosome {{chr}} (Mb)",label_offset:32,tick_format:"region",extent:"state"},y1:{label:"-log10 p-value",label_offset:28},y2:{label:"Recombination Rate (cM/Mb)",label_offset:40}},legend:{orientation:"vertical",origin:{x:55,y:40},hidden:!0},interaction:{drag_background_to_pan:!0,drag_x_ticks_to_scale:!0,drag_y1_ticks_to_scale:!0,drag_y2_ticks_to_scale:!0,scroll_to_zoom:!0,x_linked:!0},data_layers:[n.Layouts.get("data_layer","significance",{unnamespaced:!0}),n.Layouts.get("data_layer","recomb_rate",{unnamespaced:!0}),n.Layouts.get("data_layer","association_pvalues",{unnamespaced:!0})]}),n.Layouts.add("panel","genes",{id:"genes",width:800,height:225,min_width:400,min_height:112.5,proportional_width:1,margin:{top:20,right:50,bottom:20,left:50},axes:{},interaction:{drag_background_to_pan:!0,scroll_to_zoom:!0,x_linked:!0},dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"resize_to_data",position:"right"}),t}(),data_layers:[n.Layouts.get("data_layer","genes",{unnamespaced:!0})]}),n.Layouts.add("panel","phewas",{id:"phewas",width:800,height:300,min_width:800,min_height:300,proportional_width:1,margin:{top:20,right:50,bottom:120,left:50},inner_border:"rgb(210, 210, 210)",axes:{x:{ticks:{style:{"font-weight":"bold","font-size":"11px","text-anchor":"start"},transform:"rotate(50)",position:"left"}},y1:{label:"-log10 p-value",label_offset:28}},data_layers:[n.Layouts.get("data_layer","significance",{unnamespaced:!0}),n.Layouts.get("data_layer","phewas_pvalues",{unnamespaced:!0})]}),n.Layouts.add("panel","genome_legend",{id:"genome_legend",width:800,height:50,origin:{x:0,y:300},min_width:800,min_height:50,proportional_width:1,margin:{top:0,right:50,bottom:35,left:50},axes:{x:{label:"Genomic Position (number denotes chromosome)",label_offset:35,ticks:[{x:124625310,text:"1",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:370850307,text:"2",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:591461209,text:"3",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:786049562,text:"4",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:972084330,text:"5",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1148099493,text:"6",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1313226358,text:"7",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1465977701,text:"8",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1609766427,text:"9",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1748140516,text:"10",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1883411148,text:"11",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2017840353,text:"12",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2142351240,text:"13",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2253610949,text:"14",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2358551415,text:"15",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2454994487,text:"16",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2540769469,text:"17",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2620405698,text:"18",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2689008813,text:"19",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2750086065,text:"20",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2805663772,text:"21",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2855381003,text:"22",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"}]}},data_layers:[n.Layouts.get("data_layer","genome_legend",{unnamespaced:!0})]}),n.Layouts.add("panel","intervals",{id:"intervals",width:1e3,height:50,min_width:500,min_height:50,margin:{top:25,right:150,bottom:5,left:50},dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"toggle_split_tracks",data_layer_id:"intervals",position:"right"}),t}(),axes:{},interaction:{drag_background_to_pan:!0,scroll_to_zoom:!0,x_linked:!0},legend:{hidden:!0,orientation:"horizontal",origin:{x:50,y:0},pad_from_bottom:5},data_layers:[n.Layouts.get("data_layer","intervals",{unnamespaced:!0})]}),n.Layouts.add("plot","standard_association",{state:{},width:800,height:450,responsive_resize:!0,min_region_scale:2e4,max_region_scale:1e6,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","association",{unnamespaced:!0,proportional_height:.5}),n.Layouts.get("panel","genes",{unnamespaced:!0,proportional_height:.5})]}),n.StandardLayout=n.Layouts.get("plot","standard_association"),n.Layouts.add("plot","standard_phewas",{width:800,height:600,min_width:800,min_height:600,responsive_resize:!0,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","phewas",{unnamespaced:!0,proportional_height:.45}),n.Layouts.get("panel","genome_legend",{unnamespaced:!0,proportional_height:.1}),n.Layouts.get("panel","genes",{unnamespaced:!0,proportional_height:.45,margin:{bottom:40},axes:{x:{label:"Chromosome {{chr}} (Mb)",label_offset:32,tick_format:"region",extent:"state"}}})],mouse_guide:!1}),n.Layouts.add("plot","interval_association",{state:{},width:800,height:550,responsive_resize:!0,min_region_scale:2e4,max_region_scale:1e6,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","association",{unnamespaced:!0,width:800,proportional_height:225/570}),n.Layouts.get("panel","intervals",{unnamespaced:!0,proportional_height:120/570}),n.Layouts.get("panel","genes",{unnamespaced:!0,width:800,proportional_height:225/570})]}),n.DataLayer=function(t,e){return this.initialized=!1,this.layout_idx=null,this.id=null,this.parent=e||null,this.svg={},this.parent_plot=null,"undefined"!=typeof e&&e instanceof n.Panel&&(this.parent_plot=e.parent),this.layout=n.Layouts.merge(t||{},n.DataLayer.DefaultLayout),this.layout.id&&(this.id=this.layout.id),this.layout.x_axis!=={}&&"number"!=typeof this.layout.x_axis.axis&&(this.layout.x_axis.axis=1),this.layout.y_axis!=={}&&"number"!=typeof this.layout.y_axis.axis&&(this.layout.y_axis.axis=1),this._base_layout=JSON.parse(JSON.stringify(this.layout)), -this.state={},this.state_id=null,this.setDefaultState(),this.data=[],this.layout.tooltip&&(this.tooltips={}),this.global_statuses={highlighted:!1,selected:!1,faded:!1,hidden:!1},this},n.DataLayer.prototype.addField=function(t,e,a){if(!t||!e)throw"Must specify field name and namespace to use when adding field";var i=e+":"+t;if(a)if(i+="|","string"==typeof a)i+=a;else{if(!Array.isArray(a))throw"Must provide transformations as either a string or array of strings";i+=a.join("|")}var n=this.layout.fields;return n.indexOf(i)===-1&&n.push(i),i},n.DataLayer.prototype.setDefaultState=function(){this.parent&&(this.state=this.parent.state,this.state_id=this.parent.id+"."+this.id,this.state[this.state_id]=this.state[this.state_id]||{},n.DataLayer.Statuses.adjectives.forEach(function(t){this.state[this.state_id][t]=this.state[this.state_id][t]||[]}.bind(this)))},n.DataLayer.DefaultLayout={type:"",fields:[],x_axis:{},y_axis:{}},n.DataLayer.Statuses={verbs:["highlight","select","fade","hide"],adjectives:["highlighted","selected","faded","hidden"],menu_antiverbs:["unhighlight","deselect","unfade","show"]},n.DataLayer.prototype.getBaseId=function(){return this.parent_plot.id+"."+this.parent.id+"."+this.id},n.DataLayer.prototype.getAbsoluteDataHeight=function(){var t=this.svg.group.node().getBoundingClientRect();return t.height},n.DataLayer.prototype.canTransition=function(){return!!this.layout.transition&&!(this.parent_plot.panel_boundaries.dragging||this.parent_plot.interaction.panel_id)},n.DataLayer.prototype.getElementId=function(t){var e="element";if("string"==typeof t)e=t;else if("object"==typeof t){var a=this.layout.id_field||"id";if("undefined"==typeof t[a])throw"Unable to generate element ID";e=t[a].toString().replace(/\W/g,"")}return(this.getBaseId()+"-"+e).replace(/(:|\.|\[|\]|,)/g,"_")},n.DataLayer.prototype.getElementStatusNodeId=function(t){return null},n.DataLayer.prototype.getElementById=function(e){var a=t.select("#"+e.replace(/(:|\.|\[|\]|,)/g,"\\$1"));return!a.empty()&&a.data()&&a.data().length?a.data()[0]:null},n.DataLayer.prototype.applyDataMethods=function(){return this.data.forEach(function(t,e){this.data[e].toHTML=function(){var t=this.layout.id_field||"id",a="";return this.data[e][t]&&(a=this.data[e][t].toString()),a}.bind(this),this.data[e].getDataLayer=function(){return this}.bind(this),this.data[e].deselect=function(){var t=this.getDataLayer();t.unselectElement(this)}}.bind(this)),this.applyCustomDataMethods(),this},n.DataLayer.prototype.applyCustomDataMethods=function(){return this},n.DataLayer.prototype.initialize=function(){return this.svg.container=this.parent.svg.group.append("g").attr("class","lz-data_layer-container").attr("id",this.getBaseId()+".data_layer_container"),this.svg.clipRect=this.svg.container.append("clipPath").attr("id",this.getBaseId()+".clip").append("rect"),this.svg.group=this.svg.container.append("g").attr("id",this.getBaseId()+".data_layer").attr("clip-path","url(#"+this.getBaseId()+".clip)"),this},n.DataLayer.prototype.moveUp=function(){return this.parent.data_layer_ids_by_z_index[this.layout.z_index+1]&&(this.parent.data_layer_ids_by_z_index[this.layout.z_index]=this.parent.data_layer_ids_by_z_index[this.layout.z_index+1],this.parent.data_layer_ids_by_z_index[this.layout.z_index+1]=this.id,this.parent.resortDataLayers()),this},n.DataLayer.prototype.moveDown=function(){return this.parent.data_layer_ids_by_z_index[this.layout.z_index-1]&&(this.parent.data_layer_ids_by_z_index[this.layout.z_index]=this.parent.data_layer_ids_by_z_index[this.layout.z_index-1],this.parent.data_layer_ids_by_z_index[this.layout.z_index-1]=this.id,this.parent.resortDataLayers()),this},n.DataLayer.prototype.resolveScalableParameter=function(t,e){var a=null;if(Array.isArray(t))for(var i=0;null===a&&i":function(t,e){return t>e},">=":function(t,e){return t>=e},"%":function(t,e){return t%e}};return!!Array.isArray(e)&&(2===e.length?t[e[0]]===e[1]:!(3!==e.length||!a[e[1]])&&a[e[1]](t[e[0]],e[2]))},i=[];return this.data.forEach(function(n,s){var o=!0;t.forEach(function(t){a(n,t)||(o=!1)}),o&&i.push("indexes"===e?s:n)}),i},n.DataLayer.prototype.filterIndexes=function(t){return this.filter(t,"indexes")},n.DataLayer.prototype.filterElements=function(t){return this.filter(t,"elements")},n.DataLayer.Statuses.verbs.forEach(function(t,e){var a=n.DataLayer.Statuses.adjectives[e],i="un"+t;n.DataLayer.prototype[t+"Element"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatus(a,t,!0,e),this},n.DataLayer.prototype[i+"Element"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatus(a,t,!1,e),this},n.DataLayer.prototype[t+"ElementsByFilters"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatusByFilters(a,!0,t,e)},n.DataLayer.prototype[i+"ElementsByFilters"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatusByFilters(a,!1,t,e)},n.DataLayer.prototype[t+"AllElements"]=function(){return this.setAllElementStatus(a,!0),this},n.DataLayer.prototype[i+"AllElements"]=function(){return this.setAllElementStatus(a,!1),this}}),n.DataLayer.prototype.setElementStatus=function(e,a,i,s){if("undefined"==typeof e||n.DataLayer.Statuses.adjectives.indexOf(e)===-1)throw"Invalid status passed to DataLayer.setElementStatus()";if("undefined"==typeof a)throw"Invalid element passed to DataLayer.setElementStatus()";"undefined"==typeof i&&(i=!0);try{var o=this.getElementId(a)}catch(t){return this}s&&this.setAllElementStatus(e,!i),t.select("#"+o).classed("lz-data_layer-"+this.layout.type+"-"+e,i);var r=this.getElementStatusNodeId(a);null!==r&&t.select("#"+r).classed("lz-data_layer-"+this.layout.type+"-statusnode-"+e,i);var l=this.state[this.state_id][e].indexOf(o);return i&&l===-1&&this.state[this.state_id][e].push(o),i||l===-1||this.state[this.state_id][e].splice(l,1),this.showOrHideTooltip(a),this.parent.emit("layout_changed"),this.parent_plot.emit("layout_changed"),this},n.DataLayer.prototype.setElementStatusByFilters=function(t,e,a,i){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setElementStatusByFilters()";return"undefined"==typeof this.state[this.state_id][t]?this:(e="undefined"==typeof e||!!e,i="undefined"!=typeof i&&!!i,Array.isArray(a)||(a=[]),i&&this.setAllElementStatus(t,!e),this.filterElements(a).forEach(function(a){this.setElementStatus(t,a,e)}.bind(this)),this)},n.DataLayer.prototype.setAllElementStatus=function(t,e){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setAllElementStatus()";if("undefined"==typeof this.state[this.state_id][t])return this;if("undefined"==typeof e&&(e=!0),e)this.data.forEach(function(e){this.setElementStatus(t,e,!0)}.bind(this));else{var a=this.state[this.state_id][t].slice();a.forEach(function(e){var a=this.getElementById(e);"object"==typeof a&&null!==a&&this.setElementStatus(t,a,!1)}.bind(this)),this.state[this.state_id][t]=[]}return this.global_statuses[t]=e,this},n.DataLayer.prototype.applyBehaviors=function(t){"object"==typeof this.layout.behaviors&&Object.keys(this.layout.behaviors).forEach(function(e){var a=/(click|mouseover|mouseout)/.exec(e);a&&t.on(a[0]+"."+e,this.executeBehaviors(e,this.layout.behaviors[e]))}.bind(this))},n.DataLayer.prototype.executeBehaviors=function(e,a){var i={ctrl:e.indexOf("ctrl")!==-1,shift:e.indexOf("shift")!==-1};return function(e){i.ctrl===!!t.event.ctrlKey&&i.shift===!!t.event.shiftKey&&a.forEach(function(t){if("object"==typeof t&&null!==t)switch(t.action){case"set":this.setElementStatus(t.status,e,!0,t.exclusive);break;case"unset":this.setElementStatus(t.status,e,!1,t.exclusive);break;case"toggle":var a=this.state[this.state_id][t.status].indexOf(this.getElementId(e))!==-1,i=t.exclusive&&!a;this.setElementStatus(t.status,e,!a,i);break;case"link":if("string"==typeof t.href){var s=n.parseFields(e,t.href);"string"==typeof t.target?window.open(s,t.target):window.location.href=s}}}.bind(this))}.bind(this)},n.DataLayer.prototype.getPageOrigin=function(){var t=this.parent.getPageOrigin();return{x:t.x+this.parent.layout.margin.left,y:t.y+this.parent.layout.margin.top}},n.DataLayer.prototype.exportData=function(t){var e="json";t=t||e,t="string"==typeof t?t.toLowerCase():e,["json","csv","tsv"].indexOf(t)===-1&&(t=e);var a;switch(t){case"json":try{a=JSON.stringify(this.data)}catch(t){a=null,console.error("Unable to export JSON data from data layer: "+this.getBaseId()+";",t)}break;case"tsv":case"csv":try{var i=JSON.parse(JSON.stringify(this.data));if("object"!=typeof i)a=i.toString();else if(Array.isArray(i)){var n="tsv"===t?"\t":",",s=this.layout.fields.map(function(t){return JSON.stringify(t)}).join(n)+"\n";a=s+i.map(function(t){return this.layout.fields.map(function(e){return"undefined"==typeof t[e]?JSON.stringify(null):"object"==typeof t[e]&&null!==t[e]?Array.isArray(t[e])?'"[Array('+t[e].length+')]"':'"[Object]"':JSON.stringify(t[e])}).join(n)}.bind(this)).join("\n")}else a="Object"}catch(t){a=null,console.error("Unable to export CSV data from data layer: "+this.getBaseId()+";",t)}}return a},n.DataLayer.prototype.draw=function(){return this.svg.container.attr("transform","translate("+this.parent.layout.cliparea.origin.x+","+this.parent.layout.cliparea.origin.y+")"),this.svg.clipRect.attr("width",this.parent.layout.cliparea.width).attr("height",this.parent.layout.cliparea.height),this.positionAllTooltips(),this},n.DataLayer.prototype.reMap=function(){this.destroyAllTooltips();var t=this.parent_plot.lzd.getData(this.state,this.layout.fields);return t.then(function(t){this.data=t.body,this.applyDataMethods(),this.initialized=!0}.bind(this)),t},n.DataLayers=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t]){if("object"!=typeof a)throw"invalid layout argument for data layer ["+t+"]";return new e[t](a,i)}throw"data layer ["+t+"] not found"}return null},t.set=function(t,a){if(a){if("function"!=typeof a)throw"unable to set data layer ["+t+"], argument provided is not a function";e[t]=a,e[t].prototype=new n.DataLayer}else delete e[t]},t.add=function(a,i){if(e[a])throw"data layer already exists with name: "+a;t.set(a,i)},t.extend=function(t,a,i){i=i||{};var s=e[t];if(!s)throw"Attempted to subclass an unknown or unregistered datalayer type";if("object"!=typeof i)throw"Must specify an object of properties and methods";var o=n.subclass(s,i);return e[a]=o,o},t.list=function(){return Object.keys(e)},t}(),n.DataLayers.add("annotation_track",function(t){if(this.DefaultLayout={color:"#000000",filters:[]},t=n.Layouts.merge(t,this.DefaultLayout),!Array.isArray(t.filters))throw"Annotation track must specify array of filters for selecting points to annotate";return n.DataLayer.apply(this,arguments),this.render=function(){var t=this,e=this.filter(this.layout.filters,"elements"),a=this.svg.group.selectAll("rect.lz-data_layer-"+t.layout.type).data(e,function(e){return e[t.layout.id_field]});a.enter().append("rect").attr("class","lz-data_layer-"+this.layout.type).attr("id",function(e){return t.getElementId(e)}),a.attr("x",function(e){return t.parent.x_scale(e[t.layout.x_axis.field])}).attr("width",1).attr("height",t.parent.layout.height).attr("fill",function(e){return t.resolveScalableParameter(t.layout.color,e)}),a.exit().remove(),this.applyBehaviors(a)},this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=7,l=1,h=l/2,d=this.getPageOrigin(),u=o.selector.node().getBoundingClientRect(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=this.parent.x_scale(o.data[this.layout.x_axis.field]),f=p/2,g=Math.max(u.width/2-y,0),_=Math.max(u.width/2+y-c,0);a=d.x+y-u.width/2-_+g,s=u.width/2-r+_-g-h,u.height+l+r>p-f?(e=d.y+f-(u.height+l+r),i="down",n=u.height-l):(e=d.y+f+l+r,i="up",n=0-l-r),o.selector.style("left",a+"px").style("top",e+"px"),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",s+"px").style("top",n+"px")},this}),n.DataLayers.add("forest",function(e){return this.DefaultLayout={point_size:40,point_shape:"square",color:"#888888",fill_opacity:1,y_axis:{axis:2},id_field:"id",confidence_intervals:{start_field:"ci_start",end_field:"ci_end"},show_no_significance_line:!0},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n=this.tooltips[t],s=this.resolveScalableParameter(this.layout.point_size,n.data),o=7,r=1,l=6,h=this.getPageOrigin(),d=this.parent.x_scale(n.data[this.layout.x_axis.field]),u="y"+this.layout.y_axis.axis+"_scale",p=this.parent[u](n.data[this.layout.y_axis.field]),c=n.selector.node().getBoundingClientRect(),y=Math.sqrt(s/Math.PI);d<=this.parent.layout.width/2?(e=h.x+d+y+o+r,a="left",i=-1*(o+r)):(e=h.x+d-c.width-y-o-r,a="right",i=c.width-r);var f,g,_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom);p-c.height/2<=0?(f=h.y+p-1.5*o-l,g=l):p+c.height/2>=_?(f=h.y+p+o+l-c.height,g=c.height-2*o-l):(f=h.y+p-c.height/2,g=c.height/2-o),n.selector.style("left",e+"px").style("top",f+"px"),n.arrow||(n.arrow=n.selector.append("div").style("position","absolute")),n.arrow.attr("class","lz-data_layer-tooltip-arrow_"+a).style("left",i+"px").style("top",g+"px")},this.render=function(){var e="x_scale",a="y"+this.layout.y_axis.axis+"_scale";if(this.layout.confidence_intervals&&this.layout.fields.indexOf(this.layout.confidence_intervals.start_field)!==-1&&this.layout.fields.indexOf(this.layout.confidence_intervals.end_field)!==-1){var i=this.svg.group.selectAll("rect.lz-data_layer-forest.lz-data_layer-forest-ci").data(this.data,function(t){return t[this.layout.id_field]}.bind(this));i.enter().append("rect").attr("class","lz-data_layer-forest lz-data_layer-forest-ci").attr("id",function(t){return this.getElementId(t)+"_ci"}.bind(this)).attr("transform","translate(0,"+(isNaN(this.parent.layout.height)?0:this.parent.layout.height)+")");var n=function(t){var i=this.parent[e](t[this.layout.confidence_intervals.start_field]),n=this.parent[a](t[this.layout.y_axis.field]);return isNaN(i)&&(i=-1e3),isNaN(n)&&(n=-1e3),"translate("+i+","+n+")"}.bind(this),s=function(t){return this.parent[e](t[this.layout.confidence_intervals.end_field])-this.parent[e](t[this.layout.confidence_intervals.start_field])}.bind(this),o=1;this.canTransition()?i.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",n).attr("width",s).attr("height",o):i.attr("transform",n).attr("width",s).attr("height",o),i.exit().remove()}var r=this.svg.group.selectAll("path.lz-data_layer-forest.lz-data_layer-forest-point").data(this.data,function(t){return t[this.layout.id_field]}.bind(this)),l=isNaN(this.parent.layout.height)?0:this.parent.layout.height;r.enter().append("path").attr("class","lz-data_layer-forest lz-data_layer-forest-point").attr("id",function(t){return this.getElementId(t)+"_point"}.bind(this)).attr("transform","translate(0,"+l+")");var h=function(t){var i=this.parent[e](t[this.layout.x_axis.field]),n=this.parent[a](t[this.layout.y_axis.field]);return isNaN(i)&&(i=-1e3),isNaN(n)&&(n=-1e3),"translate("+i+","+n+")"}.bind(this),d=function(t){return this.resolveScalableParameter(this.layout.color,t)}.bind(this),u=function(t){return this.resolveScalableParameter(this.layout.fill_opacity,t)}.bind(this),p=t.svg.symbol().size(function(t){return this.resolveScalableParameter(this.layout.point_size,t)}.bind(this)).type(function(t){return this.resolveScalableParameter(this.layout.point_shape,t)}.bind(this));this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p):r.attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p),r.exit().remove(),r.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t),this.parent_plot.emit("element_clicked",t)}.bind(this)),this.applyBehaviors(r)},this}),n.DataLayers.add("genes",function(e){return this.DefaultLayout={label_font_size:12,label_exon_spacing:4,exon_height:16,bounding_box_padding:6,track_vertical_spacing:10},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.getElementStatusNodeId=function(t){return this.getElementId(t)+"-statusnode"},this.getTrackHeight=function(){return 2*this.layout.bounding_box_padding+this.layout.label_font_size+this.layout.label_exon_spacing+this.layout.exon_height+this.layout.track_vertical_spacing},this.transcript_idx=0,this.tracks=1,this.gene_track_index={1:[]},this.assignTracks=function(){return this.getLabelWidth=function(t,e){try{var a=this.svg.group.append("text").attr("x",0).attr("y",0).attr("class","lz-data_layer-genes lz-label").style("font-size",e).text(t+"→"),i=a.node().getBBox().width;return a.remove(),i}catch(t){return 0}},this.tracks=1,this.gene_track_index={1:[]},this.data.map(function(t,e){if(this.data[e].gene_id&&this.data[e].gene_id.indexOf(".")){var a=this.data[e].gene_id.split(".");this.data[e].gene_id=a[0],this.data[e].gene_version=a[1]}if(this.data[e].transcript_id=this.data[e].transcripts[this.transcript_idx].transcript_id,this.data[e].display_range={start:this.parent.x_scale(Math.max(t.start,this.state.start)),end:this.parent.x_scale(Math.min(t.end,this.state.end))},this.data[e].display_range.label_width=this.getLabelWidth(this.data[e].gene_name,this.layout.label_font_size),this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start,this.data[e].display_range.text_anchor="middle",this.data[e].display_range.widththis.state.end)this.data[e].display_range.start=this.data[e].display_range.end-this.data[e].display_range.label_width-this.layout.label_font_size,this.data[e].display_range.text_anchor="end";else{var i=(this.data[e].display_range.label_width-this.data[e].display_range.width)/2+this.layout.label_font_size;this.data[e].display_range.start-ithis.parent.x_scale(this.state.end)?(this.data[e].display_range.end=this.parent.x_scale(this.state.end),this.data[e].display_range.start=this.data[e].display_range.end-this.data[e].display_range.label_width,this.data[e].display_range.text_anchor="end"):(this.data[e].display_range.start-=i,this.data[e].display_range.end+=i)}this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start}this.data[e].display_range.start-=this.layout.bounding_box_padding,this.data[e].display_range.end+=this.layout.bounding_box_padding,this.data[e].display_range.width+=2*this.layout.bounding_box_padding,this.data[e].display_domain={start:this.parent.x_scale.invert(this.data[e].display_range.start),end:this.parent.x_scale.invert(this.data[e].display_range.end)},this.data[e].display_domain.width=this.data[e].display_domain.end-this.data[e].display_domain.start,this.data[e].track=null;for(var n=1;null===this.data[e].track;){var s=!1;this.gene_track_index[n].map(function(t){if(!s){var e=Math.min(t.display_range.start,this.display_range.start),a=Math.max(t.display_range.end,this.display_range.end);a-ethis.tracks&&(this.tracks=n,this.gene_track_index[n]=[])):(this.data[e].track=n,this.gene_track_index[n].push(this.data[e]))}this.data[e].parent=this,this.data[e].transcripts.map(function(t,a){this.data[e].transcripts[a].parent=this.data[e],this.data[e].transcripts[a].exons.map(function(t,i){this.data[e].transcripts[a].exons[i].parent=this.data[e].transcripts[a]}.bind(this))}.bind(this))}.bind(this)),this},this.render=function(){this.assignTracks();var e,a,i,n,s=this.svg.group.selectAll("g.lz-data_layer-genes").data(this.data,function(t){return t.gene_name});s.enter().append("g").attr("class","lz-data_layer-genes"),s.attr("id",function(t){return this.getElementId(t)}.bind(this)).each(function(s){var o=s.parent,r=t.select(this).selectAll("rect.lz-data_layer-genes.lz-data_layer-genes-statusnode").data([s],function(t){return o.getElementStatusNodeId(t)});r.enter().append("rect").attr("class","lz-data_layer-genes lz-data_layer-genes-statusnode"),r.attr("id",function(t){return o.getElementStatusNodeId(t)}).attr("rx",function(){return o.layout.bounding_box_padding}).attr("ry",function(){return o.layout.bounding_box_padding}),e=function(t){return t.display_range.width},a=function(){return o.getTrackHeight()-o.layout.track_vertical_spacing},i=function(t){return t.display_range.start},n=function(t){return(t.track-1)*o.getTrackHeight()},o.canTransition()?r.transition().duration(o.layout.transition.duration||0).ease(o.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):r.attr("width",e).attr("height",a).attr("x",i).attr("y",n),r.exit().remove();var l=t.select(this).selectAll("rect.lz-data_layer-genes.lz-boundary").data([s],function(t){return t.gene_name+"_boundary"});l.enter().append("rect").attr("class","lz-data_layer-genes lz-boundary"),e=function(t){return o.parent.x_scale(t.end)-o.parent.x_scale(t.start)},a=function(){return 1},i=function(t){return o.parent.x_scale(t.start)},n=function(t){return(t.track-1)*o.getTrackHeight()+o.layout.bounding_box_padding+o.layout.label_font_size+o.layout.label_exon_spacing+Math.max(o.layout.exon_height,3)/2},o.canTransition()?l.transition().duration(o.layout.transition.duration||0).ease(o.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):l.attr("width",e).attr("height",a).attr("x",i).attr("y",n),l.exit().remove();var h=t.select(this).selectAll("text.lz-data_layer-genes.lz-label").data([s],function(t){return t.gene_name+"_label"});h.enter().append("text").attr("class","lz-data_layer-genes lz-label"),h.attr("text-anchor",function(t){return t.display_range.text_anchor}).text(function(t){return"+"===t.strand?t.gene_name+"→":"←"+t.gene_name}).style("font-size",s.parent.layout.label_font_size),i=function(t){return"middle"===t.display_range.text_anchor?t.display_range.start+t.display_range.width/2:"start"===t.display_range.text_anchor?t.display_range.start+o.layout.bounding_box_padding:"end"===t.display_range.text_anchor?t.display_range.end-o.layout.bounding_box_padding:void 0},n=function(t){return(t.track-1)*o.getTrackHeight()+o.layout.bounding_box_padding+o.layout.label_font_size},o.canTransition()?h.transition().duration(o.layout.transition.duration||0).ease(o.layout.transition.ease||"cubic-in-out").attr("x",i).attr("y",n):h.attr("x",i).attr("y",n),h.exit().remove();var d=t.select(this).selectAll("rect.lz-data_layer-genes.lz-exon").data(s.transcripts[s.parent.transcript_idx].exons,function(t){return t.exon_id});d.enter().append("rect").attr("class","lz-data_layer-genes lz-exon"),e=function(t){return o.parent.x_scale(t.end)-o.parent.x_scale(t.start)},a=function(){return o.layout.exon_height},i=function(t){return o.parent.x_scale(t.start)},n=function(){return(s.track-1)*o.getTrackHeight()+o.layout.bounding_box_padding+o.layout.label_font_size+o.layout.label_exon_spacing},o.canTransition()?d.transition().duration(o.layout.transition.duration||0).ease(o.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):d.attr("width",e).attr("height",a).attr("x",i).attr("y",n),d.exit().remove();var u=t.select(this).selectAll("rect.lz-data_layer-genes.lz-clickarea").data([s],function(t){return t.gene_name+"_clickarea"});u.enter().append("rect").attr("class","lz-data_layer-genes lz-clickarea"),u.attr("id",function(t){return o.getElementId(t)+"_clickarea"}).attr("rx",function(){return o.layout.bounding_box_padding}).attr("ry",function(){return o.layout.bounding_box_padding}),e=function(t){return t.display_range.width},a=function(){return o.getTrackHeight()-o.layout.track_vertical_spacing},i=function(t){return t.display_range.start},n=function(t){return(t.track-1)*o.getTrackHeight()},o.canTransition()?u.transition().duration(o.layout.transition.duration||0).ease(o.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):u.attr("width",e).attr("height",a).attr("x",i).attr("y",n),u.exit().remove(),u.on("click.event_emitter",function(t){t.parent.parent.emit("element_clicked",t),t.parent.parent_plot.emit("element_clicked",t)}),o.applyBehaviors(u)}),s.exit().remove()},this.positionTooltip=function(e){if("string"!=typeof e)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[e])throw"Unable to position tooltip: id does not point to a valid tooltip";var a,i,n,s=this.tooltips[e],o=7,r=1,l=this.getPageOrigin(),h=s.selector.node().getBoundingClientRect(),d=this.getElementStatusNodeId(s.data),u=t.select("#"+d).node().getBBox(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=(s.data.display_range.start+s.data.display_range.end)/2-this.layout.bounding_box_padding/2,f=Math.max(h.width/2-y,0),g=Math.max(h.width/2+y-c,0),_=l.x+y-h.width/2-g+f,m=h.width/2-o/2+g-f;h.height+r+o>p-(u.y+u.height)?(a=l.y+u.y-(h.height+r+o),i="down",n=h.height-r):(a=l.y+u.y+u.height+r+o,i="up",n=0-r-o),s.selector.style("left",_+"px").style("top",a+"px"),s.arrow||(s.arrow=s.selector.append("div").style("position","absolute")),s.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",m+"px").style("top",n+"px")},this}),n.DataLayers.add("genome_legend",function(t){return this.DefaultLayout={chromosome_fill_colors:{light:"rgb(155, 155, 188)",dark:"rgb(95, 95, 128)"},chromosome_label_colors:{light:"rgb(120, 120, 186)",dark:"rgb(0, 0, 66)"}},t=n.Layouts.merge(t,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.render=function(){var t=0;this.data.forEach(function(e,a){this.data[a].genome_start=t,this.data[a].genome_end=t+e["genome:base_pairs"],t+=e["genome:base_pairs"]}.bind(this));var e=this.svg.group.selectAll("rect.lz-data_layer-genome_legend").data(this.data,function(t){return t["genome:chr"]});e.enter().append("rect").attr("class","lz-data_layer-genome_legend");var a=this,i=this.parent;e.attr("fill",function(t){return t["genome:chr"]%2?a.layout.chromosome_fill_colors.light:a.layout.chromosome_fill_colors.dark}).attr("x",function(t){return i.x_scale(t.genome_start)}).attr("y",0).attr("width",function(t){return i.x_scale(t["genome:base_pairs"])}).attr("height",i.layout.cliparea.height),e.exit().remove(); -var n=/([^:]+):(\d+)(?:_.*)?/.exec(this.state.variant);if(!n)throw"Genome legend cannot understand the specified variant position";var s=n[1],o=n[2];t=+this.data[s-1].genome_start+ +o;var r=this.svg.group.selectAll("rect.lz-data_layer-genome_legend-marker").data([{start:t,end:t+1}]);r.enter().append("rect").attr("class","lz-data_layer-genome_legend-marker"),r.transition().duration(500).style({fill:"rgba(255, 250, 50, 0.8)",stroke:"rgba(255, 250, 50, 0.8)","stroke-width":"3px"}).attr("x",function(t){return i.x_scale(t.start)}).attr("y",0).attr("width",function(t){return i.x_scale(t.end-t.start)}).attr("height",i.layout.cliparea.height),r.exit().remove()},this}),n.DataLayers.add("intervals",function(e){return this.DefaultLayout={start_field:"start",end_field:"end",track_split_field:"state_id",track_split_order:"DESC",track_split_legend_to_y_axis:2,split_tracks:!0,track_height:15,track_vertical_spacing:3,bounding_box_padding:2,always_hide_legend:!1,color:"#B8B8B8",fill_opacity:1},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.getElementStatusNodeId=function(t){return this.layout.split_tracks?(this.getBaseId()+"-statusnode-"+t[this.layout.track_split_field]).replace(/[:.[\],]/g,"_"):this.getElementId(t)+"-statusnode"}.bind(this),this.getTrackHeight=function(){return this.layout.track_height+this.layout.track_vertical_spacing+2*this.layout.bounding_box_padding},this.tracks=1,this.previous_tracks=1,this.interval_track_index={1:[]},this.assignTracks=function(){if(this.previous_tracks=this.tracks,this.tracks=0,this.interval_track_index={1:[]},this.track_split_field_index={},this.layout.track_split_field&&this.layout.split_tracks){this.data.map(function(t){this.track_split_field_index[t[this.layout.track_split_field]]=null}.bind(this));var t=Object.keys(this.track_split_field_index);"DESC"===this.layout.track_split_order&&t.reverse(),t.forEach(function(t){this.track_split_field_index[t]=this.tracks+1,this.interval_track_index[this.tracks+1]=[],this.tracks++}.bind(this))}return this.data.map(function(t,e){if(this.data[e].parent=this,this.data[e].display_range={start:this.parent.x_scale(Math.max(t[this.layout.start_field],this.state.start)),end:this.parent.x_scale(Math.min(t[this.layout.end_field],this.state.end))},this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start,this.data[e].display_domain={start:this.parent.x_scale.invert(this.data[e].display_range.start),end:this.parent.x_scale.invert(this.data[e].display_range.end)},this.data[e].display_domain.width=this.data[e].display_domain.end-this.data[e].display_domain.start,this.layout.track_split_field&&this.layout.split_tracks){var a=this.data[e][this.layout.track_split_field];this.data[e].track=this.track_split_field_index[a],this.interval_track_index[this.data[e].track].push(e)}else{this.tracks=1,this.data[e].track=null;for(var i=1;null===this.data[e].track;){var n=!1;this.interval_track_index[i].map(function(t){if(!n){var e=Math.min(t.display_range.start,this.display_range.start),a=Math.max(t.display_range.end,this.display_range.end);a-ethis.tracks&&(this.tracks=i,this.interval_track_index[i]=[])):(this.data[e].track=i,this.interval_track_index[i].push(this.data[e]))}}}.bind(this)),this},this.render=function(){this.assignTracks(),this.svg.group.selectAll(".lz-data_layer-intervals-statusnode.lz-data_layer-intervals-shared").remove(),Object.keys(this.track_split_field_index).forEach(function(t){var e={};e[this.layout.track_split_field]=t;var a={display:this.layout.split_tracks?null:"none"};this.svg.group.insert("rect",":first-child").attr("id",this.getElementStatusNodeId(e)).attr("class","lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-shared").attr("rx",this.layout.bounding_box_padding).attr("ry",this.layout.bounding_box_padding).attr("width",this.parent.layout.cliparea.width).attr("height",this.getTrackHeight()-this.layout.track_vertical_spacing).attr("x",0).attr("y",(this.track_split_field_index[t]-1)*this.getTrackHeight()).style(a)}.bind(this));var e,a,i,n,s,o,r=this.svg.group.selectAll("g.lz-data_layer-intervals").data(this.data,function(t){return t[this.layout.id_field]}.bind(this));return r.enter().append("g").attr("class","lz-data_layer-intervals"),r.attr("id",function(t){return this.getElementId(t)}.bind(this)).each(function(r){var l=r.parent,h={display:l.layout.split_tracks?"none":null},d=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-data_layer-intervals-statusnode.lz-data_layer-intervals-statusnode-discrete").data([r],function(t){return l.getElementId(t)+"-statusnode"});d.enter().insert("rect",":first-child").attr("class","lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-statusnode-discrete"),d.attr("id",function(t){return l.getElementId(t)+"-statusnode"}).attr("rx",function(){return l.layout.bounding_box_padding}).attr("ry",function(){return l.layout.bounding_box_padding}).style(h),e=function(t){return t.display_range.width+2*l.layout.bounding_box_padding},a=function(){return l.getTrackHeight()-l.layout.track_vertical_spacing},i=function(t){return t.display_range.start-l.layout.bounding_box_padding},n=function(t){return(t.track-1)*l.getTrackHeight()},l.canTransition()?d.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):d.attr("width",e).attr("height",a).attr("x",i).attr("y",n),d.exit().remove();var u=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-interval_rect").data([r],function(t){return t[l.layout.id_field]+"_interval_rect"});u.enter().append("rect").attr("class","lz-data_layer-intervals lz-interval_rect"),a=l.layout.track_height,e=function(t){return t.display_range.width},i=function(t){return t.display_range.start},n=function(t){return(t.track-1)*l.getTrackHeight()+l.layout.bounding_box_padding},s=function(t){return l.resolveScalableParameter(l.layout.color,t)},o=function(t){return l.resolveScalableParameter(l.layout.fill_opacity,t)},l.canTransition()?u.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n).attr("fill",s).attr("fill-opacity",o):u.attr("width",e).attr("height",a).attr("x",i).attr("y",n).attr("fill",s).attr("fill-opacity",o),u.exit().remove();var p=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-clickarea").data([r],function(t){return t.interval_name+"_clickarea"});p.enter().append("rect").attr("class","lz-data_layer-intervals lz-clickarea"),p.attr("id",function(t){return l.getElementId(t)+"_clickarea"}).attr("rx",function(){return l.layout.bounding_box_padding}).attr("ry",function(){return l.layout.bounding_box_padding}),e=function(t){return t.display_range.width},a=function(){return l.getTrackHeight()-l.layout.track_vertical_spacing},i=function(t){return t.display_range.start},n=function(t){return(t.track-1)*l.getTrackHeight()},l.canTransition()?p.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):p.attr("width",e).attr("height",a).attr("x",i).attr("y",n),p.exit().remove(),p.on("click",function(t){t.parent.parent.emit("element_clicked",t),t.parent.parent_plot.emit("element_clicked",t)}.bind(this)),l.applyBehaviors(p)}),r.exit().remove(),this.previous_tracks!==this.tracks&&this.updateSplitTrackAxis(),this},this.positionTooltip=function(e){if("string"!=typeof e)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[e])throw"Unable to position tooltip: id does not point to a valid tooltip";var a,i,n,s=this.tooltips[e],o=7,r=1,l=this.getPageOrigin(),h=s.selector.node().getBoundingClientRect(),d=t.select("#"+this.getElementStatusNodeId(s.data)).node().getBBox(),u=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),p=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),c=(s.data.display_range.start+s.data.display_range.end)/2-this.layout.bounding_box_padding/2,y=Math.max(h.width/2-c,0),f=Math.max(h.width/2+c-p,0),g=l.x+c-h.width/2-f+y,_=h.width/2-o/2+f-y;h.height+r+o>u-(d.y+d.height)?(a=l.y+d.y-(h.height+r+o),i="down",n=h.height-r):(a=l.y+d.y+d.height+r+o,i="up",n=0-r-o),s.selector.style("left",g+"px").style("top",a+"px"),s.arrow||(s.arrow=s.selector.append("div").style("position","absolute")),s.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",_+"px").style("top",n+"px")},this.updateSplitTrackAxis=function(){var t=!!this.layout.track_split_legend_to_y_axis&&"y"+this.layout.track_split_legend_to_y_axis;if(this.layout.split_tracks){var e=+this.tracks||0,a=+this.layout.track_height||0,i=2*(+this.layout.bounding_box_padding||0)+(+this.layout.track_vertical_spacing||0),n=e*a+(e-1)*i;this.parent.scaleHeightToData(n),t&&this.parent.legend&&(this.parent.legend.hide(),this.parent.layout.axes[t]={render:!0,ticks:[],range:{start:n-this.layout.track_height/2,end:this.layout.track_height/2}},this.layout.legend.forEach(function(a){var i=a[this.layout.track_split_field],n=this.track_split_field_index[i];n&&("DESC"===this.layout.track_split_order&&(n=Math.abs(n-e-1)),this.parent.layout.axes[t].ticks.push({y:n,text:a.label}))}.bind(this)),this.layout.y_axis={axis:this.layout.track_split_legend_to_y_axis,floor:1,ceiling:e},this.parent.render()),this.parent_plot.positionPanels()}else t&&this.parent.legend&&(this.layout.always_hide_legend||this.parent.legend.show(),this.parent.layout.axes[t]={render:!1},this.parent.render());return this},this.toggleSplitTracks=function(){return this.layout.split_tracks=!this.layout.split_tracks,this.parent.legend&&!this.layout.always_hide_legend&&(this.parent.layout.margin.bottom=5+(this.layout.split_tracks?0:this.parent.legend.layout.height+5)),this.render(),this.updateSplitTrackAxis(),this},this}),n.DataLayers.add("line",function(e){return this.DefaultLayout={style:{fill:"none","stroke-width":"2px"},interpolate:"linear",x_axis:{field:"x"},y_axis:{field:"y",axis:1},hitarea_width:5},e=n.Layouts.merge(e,this.DefaultLayout),this.mouse_event=null,this.line=null,this.tooltip_timeout=null,n.DataLayer.apply(this,arguments),this.getMouseDisplayAndData=function(){var e={display:{x:t.mouse(this.mouse_event)[0],y:null},data:{},slope:null},a=this.layout.x_axis.field,i=this.layout.y_axis.field,n="x_scale",s="y"+this.layout.y_axis.axis+"_scale";e.data[a]=this.parent[n].invert(e.display.x);var o=t.bisector(function(t){return+t[a]}).left,r=o(this.data,e.data[a])-1,l=this.data[r],h=this.data[r+1],d=t.interpolateNumber(+l[i],+h[i]),u=+h[a]-+l[a];return e.data[i]=d(e.data[a]%u/u),e.display.y=this.parent[s](e.data[i]),this.layout.tooltip.x_precision&&(e.data[a]=e.data[a].toPrecision(this.layout.tooltip.x_precision)),this.layout.tooltip.y_precision&&(e.data[i]=e.data[i].toPrecision(this.layout.tooltip.y_precision)),e.slope=(this.parent[s](h[i])-this.parent[s](l[i]))/(this.parent[n](h[a])-this.parent[n](l[a])),e},this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=o.selector.node().getBoundingClientRect(),l=7,h=6,d=parseFloat(this.layout.style["stroke-width"])||1,u=this.getPageOrigin(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=this.getMouseDisplayAndData();if(Math.abs(y.slope)>1)y.display.x<=this.parent.layout.width/2?(a=u.x+y.display.x+d+l+d,s="left",n=-1*(l+d)):(a=u.x+y.display.x-r.width-d-l-d,s="right",n=r.width-d),y.display.y-r.height/2<=0?(e=u.y+y.display.y-1.5*l-h,i=h):y.display.y+r.height/2>=p?(e=u.y+y.display.y+l+h-r.height,i=r.height-2*l-h):(e=u.y+y.display.y-r.height/2,i=r.height/2-l);else{var f=Math.max(r.width/2-y.display.x,0),g=Math.max(r.width/2+y.display.x-c,0);a=u.x+y.display.x-r.width/2-g+f;var _=l/2,m=r.width-2.5*l;n=r.width/2-l+g-f,n=Math.min(Math.max(n,_),m),r.height+d+l>y.display.y?(e=u.y+y.display.y+d+l,s="up",i=0-d-l):(e=u.y+y.display.y-(r.height+d+l),s="down",i=r.height-d)}o.selector.style({left:a+"px",top:e+"px"}),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+s).style({left:n+"px",top:i+"px"})},this.render=function(){var e=this,a=this.parent,i=this.layout.x_axis.field,n=this.layout.y_axis.field,s="x_scale",o="y"+this.layout.y_axis.axis+"_scale",r=this.svg.group.selectAll("path.lz-data_layer-line").data([this.data]);if(this.path=r.enter().append("path").attr("class","lz-data_layer-line"),this.line=t.svg.line().x(function(t){return parseFloat(a[s](t[i]))}).y(function(t){return parseFloat(a[o](t[n]))}).interpolate(this.layout.interpolate),this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("d",this.line).style(this.layout.style):r.attr("d",this.line).style(this.layout.style),this.layout.tooltip){var l=parseFloat(this.layout.hitarea_width).toString()+"px",h=this.svg.group.selectAll("path.lz-data_layer-line-hitarea").data([this.data]);h.enter().append("path").attr("class","lz-data_layer-line-hitarea").style("stroke-width",l);var d=t.svg.line().x(function(t){return parseFloat(a[s](t[i]))}).y(function(t){return parseFloat(a[o](t[n]))}).interpolate(this.layout.interpolate);h.attr("d",d).on("mouseover",function(){clearTimeout(e.tooltip_timeout),e.mouse_event=this;var t=e.getMouseDisplayAndData();e.createTooltip(t.data)}).on("mousemove",function(){clearTimeout(e.tooltip_timeout),e.mouse_event=this;var t=e.getMouseDisplayAndData();e.updateTooltip(t.data),e.positionTooltip(e.getElementId())}).on("mouseout",function(){e.tooltip_timeout=setTimeout(function(){e.mouse_event=null,e.destroyTooltip(e.getElementId())},300)}),h.exit().remove()}r.exit().remove()},this.setElementStatus=function(t,e,a){return this.setAllElementStatus(t,a)},this.setElementStatusByFilters=function(t,e){return this.setAllElementStatus(t,e)},this.setAllElementStatus=function(t,e){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setAllElementStatus()";if("undefined"==typeof this.state[this.state_id][t])return this;"undefined"==typeof e&&(e=!0),this.global_statuses[t]=e;var a="lz-data_layer-line";return Object.keys(this.global_statuses).forEach(function(t){this.global_statuses[t]&&(a+=" lz-data_layer-line-"+t)}.bind(this)),this.path.attr("class",a),this.parent.emit("layout_changed"),this.parent_plot.emit("layout_changed"),this},this}),n.DataLayers.add("orthogonal_line",function(e){return this.DefaultLayout={style:{stroke:"#D3D3D3","stroke-width":"3px","stroke-dasharray":"10px 10px"},orientation:"horizontal",x_axis:{axis:1,decoupled:!0},y_axis:{axis:1,decoupled:!0},offset:0},e=n.Layouts.merge(e,this.DefaultLayout),["horizontal","vertical"].indexOf(e.orientation)===-1&&(e.orientation="horizontal"),this.data=[],this.line=null,n.DataLayer.apply(this,arguments),this.render=function(){var e=this.parent,a="x_scale",i="y"+this.layout.y_axis.axis+"_scale",n="x_extent",s="y"+this.layout.y_axis.axis+"_extent",o="x_range",r="y"+this.layout.y_axis.axis+"_range";"horizontal"===this.layout.orientation?this.data=[{x:e[n][0],y:this.layout.offset},{x:e[n][1],y:this.layout.offset}]:this.data=[{x:this.layout.offset,y:e[s][0]},{x:this.layout.offset,y:e[s][1]}];var l=this.svg.group.selectAll("path.lz-data_layer-line").data([this.data]);this.path=l.enter().append("path").attr("class","lz-data_layer-line"),this.line=t.svg.line().x(function(t,i){var n=parseFloat(e[a](t.x));return isNaN(n)?e[o][i]:n}).y(function(t,a){var n=parseFloat(e[i](t.y));return isNaN(n)?e[r][a]:n}).interpolate("linear"),this.canTransition()?l.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("d",this.line).style(this.layout.style):l.attr("d",this.line).style(this.layout.style),l.exit().remove()},this}),n.DataLayers.add("scatter",function(e){return this.DefaultLayout={point_size:40,point_shape:"circle",tooltip_positioning:"horizontal",color:"#888888",fill_opacity:1,y_axis:{axis:1},id_field:"id"},e=n.Layouts.merge(e,this.DefaultLayout),e.label&&isNaN(e.label.spacing)&&(e.label.spacing=4),n.DataLayer.apply(this,arguments),this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=this.resolveScalableParameter(this.layout.point_size,o.data),l=Math.sqrt(r/Math.PI),h=7,d=1,u=6,p=this.getPageOrigin(),c=this.parent.x_scale(o.data[this.layout.x_axis.field]),y="y"+this.layout.y_axis.axis+"_scale",f=this.parent[y](o.data[this.layout.y_axis.field]),g=o.selector.node().getBoundingClientRect(),_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),m=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right);if("vertical"===this.layout.tooltip_positioning){var b=Math.max(g.width/2-c,0),x=Math.max(g.width/2+c-m,0);a=p.x+c-g.width/2-x+b,s=g.width/2-h/2+x-b-l,g.height+d+h>_-(f+l)?(e=p.y+f-(l+g.height+d+h),i="down",n=g.height-d):(e=p.y+f+l+d+h,i="up",n=0-d-h)}else c<=this.parent.layout.width/2?(a=p.x+c+l+h+d,i="left",s=-1*(h+d)):(a=p.x+c-g.width-l-h-d,i="right",s=g.width-d),_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),f-g.height/2<=0?(e=p.y+f-1.5*h-u,n=u):f+g.height/2>=_?(e=p.y+f+h+u-g.height,n=g.height-2*h-u):(e=p.y+f-g.height/2,n=g.height/2-h);o.selector.style("left",a+"px").style("top",e+"px"),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",s+"px").style("top",n+"px")},this.flip_labels=function(){var e=this,a=e.resolveScalableParameter(e.layout.point_size,{}),i=e.layout.label.spacing,n=Boolean(e.layout.label.lines),s=2*i,o=e.parent.layout.width-e.parent.layout.margin.left-e.parent.layout.margin.right-2*i,r=function(t,e){var s=+t.attr("x"),o=2*i+2*Math.sqrt(a);if(n)var r=+e.attr("x2"),l=i+2*Math.sqrt(a);"start"===t.style("text-anchor")?(t.style("text-anchor","end"),t.attr("x",s-o),n&&e.attr("x2",r-l)):(t.style("text-anchor","start"),t.attr("x",s+o),n&&e.attr("x2",r+l))};e.label_texts.each(function(a,s){var l=this,h=t.select(l),d=+h.attr("x"),u=h.node().getBoundingClientRect();if(d+u.width+i>o){var p=n?t.select(e.label_lines[0][s]):null;r(h,p)}}),e.label_texts.each(function(a,o){var l=this,h=t.select(l);if("end"!==h.style("text-anchor")){var d=+h.attr("x"),u=h.node().getBoundingClientRect(),p=n?t.select(e.label_lines[0][o]):null;e.label_texts.each(function(){var e=this,a=t.select(e),n=a.node().getBoundingClientRect(),o=u.leftn.left&&u.topn.top;o&&(r(h,p),d=+h.attr("x"),d-u.width-iu.left&&d.topu.top;if(p){n=!0;var c,y=h.attr("y"),f=d.topx?(c=_-+r,_=+r,m-=c):m+u.height/2>x&&(c=m-+y,m=+y,_-=c),o.attr("y",_),h.attr("y",m)}}}})}),n){if(e.layout.label.lines){var s=e.label_texts[0];e.label_lines.attr("y2",function(e,a){var i=t.select(s[a]);return i.attr("y")})}this.seperate_iterations<150&&setTimeout(function(){this.separate_labels()}.bind(this),1)}},this.render=function(){var e=this,a="x_scale",i="y"+this.layout.y_axis.axis+"_scale";if(this.layout.label){var s=this.data.filter(function(t){if(e.layout.label.filters){var a=!0;return e.layout.label.filters.forEach(function(e){var i=new n.Data.Field(e.field).resolve(t);if(isNaN(i))a=!1;else switch(e.operator){case"<":i":i>e.value||(a=!1);break;case">=":i>=e.value||(a=!1);break;case"=":i!==e.value&&(a=!1);break;default:a=!1}}),a}return!0}),o=this;this.label_groups=this.svg.group.selectAll("g.lz-data_layer-"+this.layout.type+"-label").data(s,function(t){return t[o.layout.id_field]+"_label"}),this.label_groups.enter().append("g").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_texts&&this.label_texts.remove(),this.label_texts=this.label_groups.append("text").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_texts.text(function(t){return n.parseFields(t,e.layout.label.text||"")}).style(e.layout.label.style||{}).attr({x:function(t){var i=e.parent[a](t[e.layout.x_axis.field])+Math.sqrt(e.resolveScalableParameter(e.layout.point_size,t))+e.layout.label.spacing;return isNaN(i)&&(i=-1e3),i},y:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a},"text-anchor":function(){return"start"}}),e.layout.label.lines&&(this.label_lines&&this.label_lines.remove(),this.label_lines=this.label_groups.append("line").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_lines.style(e.layout.label.lines.style||{}).attr({x1:function(t){var i=e.parent[a](t[e.layout.x_axis.field]);return isNaN(i)&&(i=-1e3),i},y1:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a},x2:function(t){var i=e.parent[a](t[e.layout.x_axis.field])+Math.sqrt(e.resolveScalableParameter(e.layout.point_size,t))+e.layout.label.spacing/2;return isNaN(i)&&(i=-1e3),i},y2:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a}})),this.label_groups.exit().remove()}var r=this.svg.group.selectAll("path.lz-data_layer-"+this.layout.type).data(this.data,function(t){return t[this.layout.id_field]}.bind(this)),l=isNaN(this.parent.layout.height)?0:this.parent.layout.height;r.enter().append("path").attr("class","lz-data_layer-"+this.layout.type).attr("id",function(t){return this.getElementId(t)}.bind(this)).attr("transform","translate(0,"+l+")");var h=function(t){var e=this.parent[a](t[this.layout.x_axis.field]),n=this.parent[i](t[this.layout.y_axis.field]);return isNaN(e)&&(e=-1e3),isNaN(n)&&(n=-1e3),"translate("+e+","+n+")"}.bind(this),d=function(t){return this.resolveScalableParameter(this.layout.color,t)}.bind(this),u=function(t){return this.resolveScalableParameter(this.layout.fill_opacity,t)}.bind(this),p=t.svg.symbol().size(function(t){return this.resolveScalableParameter(this.layout.point_size,t)}.bind(this)).type(function(t){return this.resolveScalableParameter(this.layout.point_shape,t)}.bind(this));this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p):r.attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p),r.exit().remove(),r.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t),this.parent_plot.emit("element_clicked",t)}.bind(this)),this.applyBehaviors(r),this.layout.label&&(this.flip_labels(),this.seperate_iterations=0,this.separate_labels(),this.label_texts.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t),this.parent_plot.emit("element_clicked",t)}.bind(this)),this.applyBehaviors(this.label_texts))},this.makeLDReference=function(t){var e=null;if("undefined"==typeof t)throw"makeLDReference requires one argument of any type";e="object"==typeof t?this.layout.id_field&&"undefined"!=typeof t[this.layout.id_field]?t[this.layout.id_field].toString():"undefined"!=typeof t.id?t.id.toString():t.toString():t.toString(),this.parent_plot.applyState({ldrefvar:e})},this}),n.DataLayers.extend("scatter","category_scatter",{_prepareData:function(){var t=this.layout.x_axis.field||"x",e=this.layout.x_axis.category_field;if(!e)throw"Layout for "+this.layout.id+" must specify category_field";var a=this.data.sort(function(t,a){var i=t[e],n=a[e],s=i.toString?i.toString().toLowerCase():i,o=n.toString?n.toString().toLowerCase():n;return s===o?0:s1?function(t){for(var e=t,n=0;n1?Math.ceil(Math.log(t)/Math.LN10):Math.floor(Math.log(t)/Math.LN10),Math.abs(e)<=3?t.toFixed(3):t.toExponential(2).replace("+","").replace("e"," × 10^")}),n.TransformationFunctions.add("urlencode",function(t){return encodeURIComponent(t)}),n.TransformationFunctions.add("htmlescape",function(t){return t?(t+="",t.replace(/['"<>&`]/g,function(t){switch(t){case"'":return"'";case'"':return""";case"<":return"<";case">":return">";case"&":return"&";case"`":return"`"}})):""}),n.ScaleFunctions=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t])return"undefined"==typeof a&&"undefined"==typeof i?e[t]:e[t](a,i);throw"scale function ["+t+"] not found"}return null},t.set=function(t,a){a?e[t]=a:delete e[t]},t.add=function(a,i){if(e[a])throw"scale function already exists with name: "+a;t.set(a,i)},t.list=function(){return Object.keys(e)},t}(),n.ScaleFunctions.add("if",function(t,e){return"undefined"==typeof e||t.field_value!==e?"undefined"!=typeof t.else?t.else:null:t.then}),n.ScaleFunctions.add("numerical_bin",function(t,e){var a=t.breaks||[],i=t.values||[];if("undefined"==typeof e||null===e||isNaN(+e))return t.null_value?t.null_value:null;var n=a.reduce(function(t,a){return+e=t&&+e=e.breaks[e.breaks.length-1])return n[i.length-1];var o=null;if(i.forEach(function(t,e){e&&i[e-1]<=+a&&i[e]>=+a&&(o=e)}),null===o)return s;var r=(+a-i[o-1])/(i[o]-i[o-1]);return isFinite(r)?t.interpolate(n[o-1],n[o])(r):s}),n.Dashboard=function(t){if(!(t instanceof n.Plot||t instanceof n.Panel))throw"Unable to create dashboard, parent must be a locuszoom plot or panel";return this.parent=t,this.id=this.parent.getBaseId()+".dashboard",this.type=this.parent instanceof n.Plot?"plot":"panel",this.parent_plot="plot"===this.type?this.parent:this.parent.parent,this.selector=null,this.components=[],this.hide_timeout=null,this.persist=!1,this.initialize()},n.Dashboard.prototype.initialize=function(){return Array.isArray(this.parent.layout.dashboard.components)&&this.parent.layout.dashboard.components.forEach(function(t){try{var e=n.Dashboard.Components.get(t.type,t,this);this.components.push(e)}catch(t){console.warn(t)}}.bind(this)),"panel"===this.type&&(t.select(this.parent.parent.svg.node().parentNode).on("mouseover."+this.id,function(){clearTimeout(this.hide_timeout),this.selector&&"hidden"!==this.selector.style("visibility")||this.show()}.bind(this)),t.select(this.parent.parent.svg.node().parentNode).on("mouseout."+this.id,function(){clearTimeout(this.hide_timeout),this.hide_timeout=setTimeout(function(){this.hide()}.bind(this),300)}.bind(this))),this},n.Dashboard.prototype.shouldPersist=function(){if(this.persist)return!0;var t=!1;return this.components.forEach(function(e){t=t||e.shouldPersist()}),t=t||this.parent_plot.panel_boundaries.dragging||this.parent_plot.interaction.dragging, -!!t},n.Dashboard.prototype.show=function(){if(!this.selector){switch(this.type){case"plot":this.selector=t.select(this.parent.svg.node().parentNode).insert("div",":first-child");break;case"panel":this.selector=t.select(this.parent.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip, .lz-dashboard-menu, .lz-curtain").classed("lz-panel-dashboard",!0)}this.selector.classed("lz-dashboard",!0).classed("lz-"+this.type+"-dashboard",!0).attr("id",this.id)}return this.components.forEach(function(t){t.show()}),this.selector.style({visibility:"visible"}),this.update()},n.Dashboard.prototype.update=function(){return this.selector?(this.components.forEach(function(t){t.update()}),this.position()):this},n.Dashboard.prototype.position=function(){if(!this.selector)return this;if("panel"===this.type){var t=this.parent.getPageOrigin(),e=(t.y+3.5).toString()+"px",a=t.x.toString()+"px",i=(this.parent.layout.width-4).toString()+"px";this.selector.style({position:"absolute",top:e,left:a,width:i})}return this.components.forEach(function(t){t.position()}),this},n.Dashboard.prototype.hide=function(){return!this.selector||this.shouldPersist()?this:(this.components.forEach(function(t){t.hide()}),this.selector.style({visibility:"hidden"}),this)},n.Dashboard.prototype.destroy=function(t){return"undefined"==typeof t&&(t=!1),this.selector?this.shouldPersist()&&!t?this:(this.components.forEach(function(t){t.destroy(!0)}),this.components=[],this.selector.remove(),this.selector=null,this):this},n.Dashboard.Component=function(t,e){return this.layout=t||{},this.layout.color||(this.layout.color="gray"),this.parent=e||null,this.parent_panel=null,this.parent_plot=null,this.parent_svg=null,this.parent instanceof n.Dashboard&&("panel"===this.parent.type?(this.parent_panel=this.parent.parent,this.parent_plot=this.parent.parent.parent,this.parent_svg=this.parent_panel):(this.parent_plot=this.parent.parent,this.parent_svg=this.parent_plot)),this.selector=null,this.button=null,this.persist=!1,this.layout.position||(this.layout.position="left"),this},n.Dashboard.Component.prototype.show=function(){if(this.parent&&this.parent.selector){if(!this.selector){var t=["start","middle","end"].indexOf(this.layout.group_position)!==-1?" lz-dashboard-group-"+this.layout.group_position:"";this.selector=this.parent.selector.append("div").attr("class","lz-dashboard-"+this.layout.position+t),this.layout.style&&this.selector.style(this.layout.style),"function"==typeof this.initialize&&this.initialize()}return this.button&&"highlighted"===this.button.status&&this.button.menu.show(),this.selector.style({visibility:"visible"}),this.update(),this.position()}},n.Dashboard.Component.prototype.update=function(){},n.Dashboard.Component.prototype.position=function(){return this.button&&this.button.menu.position(),this},n.Dashboard.Component.prototype.shouldPersist=function(){return!!this.persist||!(!this.button||!this.button.persist)},n.Dashboard.Component.prototype.hide=function(){return!this.selector||this.shouldPersist()?this:(this.button&&this.button.menu.hide(),this.selector.style({visibility:"hidden"}),this)},n.Dashboard.Component.prototype.destroy=function(t){return"undefined"==typeof t&&(t=!1),this.selector?this.shouldPersist()&&!t?this:(this.button&&this.button.menu&&this.button.menu.destroy(),this.selector.remove(),this.selector=null,this.button=null,this):this},n.Dashboard.Components=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t]){if("object"!=typeof a)throw"invalid layout argument for dashboard component ["+t+"]";return new e[t](a,i)}throw"dashboard component ["+t+"] not found"}return null},t.set=function(t,a){if(a){if("function"!=typeof a)throw"unable to set dashboard component ["+t+"], argument provided is not a function";e[t]=a,e[t].prototype=new n.Dashboard.Component}else delete e[t]},t.add=function(a,i){if(e[a])throw"dashboard component already exists with name: "+a;t.set(a,i)},t.list=function(){return Object.keys(e)},t}(),n.Dashboard.Component.Button=function(e){if(!(e instanceof n.Dashboard.Component))throw"Unable to create dashboard component button, invalid parent";this.parent=e,this.parent_panel=this.parent.parent_panel,this.parent_plot=this.parent.parent_plot,this.parent_svg=this.parent.parent_svg,this.parent_dashboard=this.parent.parent,this.selector=null,this.tag="a",this.setTag=function(t){return"undefined"!=typeof t&&(this.tag=t.toString()),this},this.html="",this.setHtml=function(t){return"undefined"!=typeof t&&(this.html=t.toString()),this},this.setText=this.setHTML,this.title="",this.setTitle=function(t){return"undefined"!=typeof t&&(this.title=t.toString()),this},this.color="gray",this.setColor=function(t){return"undefined"!=typeof t&&(["gray","red","orange","yellow","green","blue","purple"].indexOf(t)!==-1?this.color=t:this.color="gray"),this},this.style={},this.setStyle=function(t){return"undefined"!=typeof t&&(this.style=t),this},this.getClass=function(){var t=["start","middle","end"].indexOf(this.parent.layout.group_position)!==-1?" lz-dashboard-button-group-"+this.parent.layout.group_position:"";return"lz-dashboard-button lz-dashboard-button-"+this.color+(this.status?"-"+this.status:"")+t},this.persist=!1,this.permanent=!1,this.setPermanent=function(t){return t="undefined"==typeof t||Boolean(t),this.permanent=t,this.permanent&&(this.persist=!0),this},this.shouldPersist=function(){return this.permanent||this.persist},this.status="",this.setStatus=function(t){return"undefined"!=typeof t&&["","highlighted","disabled"].indexOf(t)!==-1&&(this.status=t),this.update()},this.highlight=function(t){return t="undefined"==typeof t||Boolean(t),t?this.setStatus("highlighted"):"highlighted"===this.status?this.setStatus(""):this},this.disable=function(t){return t="undefined"==typeof t||Boolean(t),t?this.setStatus("disabled"):"disabled"===this.status?this.setStatus(""):this},this.onmouseover=function(){},this.setOnMouseover=function(t){return"function"==typeof t?this.onmouseover=t:this.onmouseover=function(){},this},this.onmouseout=function(){},this.setOnMouseout=function(t){return"function"==typeof t?this.onmouseout=t:this.onmouseout=function(){},this},this.onclick=function(){},this.setOnclick=function(t){return"function"==typeof t?this.onclick=t:this.onclick=function(){},this},this.show=function(){if(this.parent)return this.selector||(this.selector=this.parent.selector.append(this.tag).attr("class",this.getClass())),this.update()},this.preUpdate=function(){return this},this.update=function(){return this.selector?(this.preUpdate(),this.selector.attr("class",this.getClass()).attr("title",this.title).style(this.style).on("mouseover","disabled"===this.status?null:this.onmouseover).on("mouseout","disabled"===this.status?null:this.onmouseout).on("click","disabled"===this.status?null:this.onclick).html(this.html),this.menu.update(),this.postUpdate(),this):this},this.postUpdate=function(){return this},this.hide=function(){return this.selector&&!this.shouldPersist()&&(this.selector.remove(),this.selector=null),this},this.menu={outer_selector:null,inner_selector:null,scroll_position:0,hidden:!0,show:function(){return this.menu.outer_selector||(this.menu.outer_selector=t.select(this.parent_plot.svg.node().parentNode).append("div").attr("class","lz-dashboard-menu lz-dashboard-menu-"+this.color).attr("id",this.parent_svg.getBaseId()+".dashboard.menu"),this.menu.inner_selector=this.menu.outer_selector.append("div").attr("class","lz-dashboard-menu-content"),this.menu.inner_selector.on("scroll",function(){this.menu.scroll_position=this.menu.inner_selector.node().scrollTop}.bind(this))),this.menu.outer_selector.style({visibility:"visible"}),this.menu.hidden=!1,this.menu.update()}.bind(this),update:function(){return this.menu.outer_selector?(this.menu.populate(),this.menu.inner_selector&&(this.menu.inner_selector.node().scrollTop=this.menu.scroll_position),this.menu.position()):this.menu}.bind(this),position:function(){if(!this.menu.outer_selector)return this.menu;this.menu.outer_selector.style({height:null});var t=3,e=20,a=14,i=this.parent_svg.getPageOrigin(),n=document.documentElement.scrollTop||document.body.scrollTop,s=this.parent_plot.getContainerOffset(),o=this.parent_dashboard.selector.node().getBoundingClientRect(),r=this.selector.node().getBoundingClientRect(),l=this.menu.outer_selector.node().getBoundingClientRect(),h=this.menu.inner_selector.node().scrollHeight,d=0,u=0;"panel"===this.parent_dashboard.type?(d=i.y+o.height+2*t,u=Math.max(i.x+this.parent_svg.layout.width-l.width-t,i.x+t)):(d=r.bottom+n+t-s.top,u=Math.max(r.left+r.width-l.width-s.left,i.x+t));var p=Math.max(this.parent_svg.layout.width-2*t-e,e),c=p,y=p-4*t,f=Math.max(this.parent_svg.layout.height-10*t-a,a),g=Math.min(h,f),_=f;return this.menu.outer_selector.style({top:d.toString()+"px",left:u.toString()+"px","max-width":c.toString()+"px","max-height":_.toString()+"px",height:g.toString()+"px"}),this.menu.inner_selector.style({"max-width":y.toString()+"px"}),this.menu.inner_selector.node().scrollTop=this.menu.scroll_position,this.menu}.bind(this),hide:function(){return this.menu.outer_selector?(this.menu.outer_selector.style({visibility:"hidden"}),this.menu.hidden=!0,this.menu):this.menu}.bind(this),destroy:function(){return this.menu.outer_selector?(this.menu.inner_selector.remove(),this.menu.outer_selector.remove(),this.menu.inner_selector=null,this.menu.outer_selector=null,this.menu):this.menu}.bind(this),populate:function(){}.bind(this),setPopulate:function(t){return"function"==typeof t?(this.menu.populate=t,this.setOnclick(function(){this.menu.hidden?(this.menu.show(),this.highlight().update(),this.persist=!0):(this.menu.hide(),this.highlight(!1).update(),this.permanent||(this.persist=!1))}.bind(this))):this.setOnclick(),this}.bind(this)}},n.Dashboard.Components.add("title",function(t){n.Dashboard.Component.apply(this,arguments),this.show=function(){return this.div_selector=this.parent.selector.append("div").attr("class","lz-dashboard-title lz-dashboard-"+this.layout.position),this.title_selector=this.div_selector.append("h3"),this.update()},this.update=function(){var e=t.title.toString();return this.layout.subtitle&&(e+=" "+this.layout.subtitle+""),this.title_selector.html(e),this}}),n.Dashboard.Components.add("dimensions",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){var e=this.parent_plot.layout.width.toString().indexOf(".")===-1?this.parent_plot.layout.width:this.parent_plot.layout.width.toFixed(2),a=this.parent_plot.layout.height.toString().indexOf(".")===-1?this.parent_plot.layout.height:this.parent_plot.layout.height.toFixed(2);return this.selector.html(e+"px × "+a+"px"),t.class&&this.selector.attr("class",t.class),t.style&&this.selector.style(t.style),this}}),n.Dashboard.Components.add("region_scale",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)||null===this.parent_plot.state.start||null===this.parent_plot.state.end?this.selector.style("display","none"):(this.selector.style("display",null),this.selector.html(n.positionIntToString(this.parent_plot.state.end-this.parent_plot.state.start,null,!0))),t.class&&this.selector.attr("class",t.class),t.style&&this.selector.style(t.style),this}}),n.Dashboard.Components.add("download",function(a){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(a.color).setHtml("Download Image").setTitle("Download image of the current plot as locuszoom.svg").setOnMouseover(function(){this.button.selector.classed("lz-dashboard-button-gray-disabled",!0).html("Preparing Image"),this.generateBase64SVG().then(function(t){this.button.selector.attr("href","data:image/svg+xml;base64,\n"+t).classed("lz-dashboard-button-gray-disabled",!1).classed("lz-dashboard-button-gray-highlighted",!0).html("Download Image")}.bind(this))}.bind(this)).setOnMouseout(function(){this.button.selector.classed("lz-dashboard-button-gray-highlighted",!1)}.bind(this)),this.button.show(),this.button.selector.attr("href-lang","image/svg+xml").attr("download","locuszoom.svg"),this)},this.css_string="";for(var i in Object.keys(document.styleSheets))if(null!==document.styleSheets[i].href&&document.styleSheets[i].href.indexOf("locuszoom.css")!==-1){n.createCORSPromise("GET",document.styleSheets[i].href).then(function(t){this.css_string=t.replace(/[\r\n]/g," ").replace(/\s+/g," "),this.css_string.indexOf("/* ! LocusZoom HTML Styles */")&&(this.css_string=this.css_string.substring(0,this.css_string.indexOf("/* ! LocusZoom HTML Styles */")))}.bind(this));break}this.generateBase64SVG=function(){return e.fcall(function(){var e=this.parent.selector.append("div").style("display","none").html(this.parent_plot.svg.node().outerHTML);e.selectAll("g.lz-curtain").remove(),e.selectAll("g.lz-mouse_guide").remove(),e.selectAll("g.tick text").each(function(){var e=10*+t.select(this).attr("dy").substring(-2).slice(0,-2);t.select(this).attr("dy",e)});var a=t.select(e.select("svg").node().parentNode).html(),i='",n=a.indexOf(">")+1;return a=a.slice(0,n)+i+a.slice(n),e.remove(),btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode("0x"+e)}))}.bind(this))}}),n.Dashboard.Components.add("remove_panel",function(e){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(e.color).setHtml("×").setTitle("Remove panel").setOnclick(function(){if(!e.suppress_confirm&&!confirm("Are you sure you want to remove this panel? This cannot be undone!"))return!1;var a=this.parent_panel;return a.dashboard.hide(!0),t.select(a.parent.svg.node().parentNode).on("mouseover."+a.getBaseId()+".dashboard",null),t.select(a.parent.svg.node().parentNode).on("mouseout."+a.getBaseId()+".dashboard",null),a.parent.removePanel(a.id)}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("move_panel_up",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){if(this.button){var e=0===this.parent_panel.layout.y_index;return this.button.disable(e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("▴").setTitle("Move panel up").setOnclick(function(){this.parent_panel.moveUp(),this.update()}.bind(this)),this.button.show(),this.update()}}),n.Dashboard.Components.add("move_panel_down",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){if(this.button){var e=this.parent_panel.layout.y_index===this.parent_plot.panel_ids_by_y_index.length-1;return this.button.disable(e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("▾").setTitle("Move panel down").setOnclick(function(){this.parent_panel.moveDown(),this.update()}.bind(this)),this.button.show(),this.update()}}),n.Dashboard.Components.add("shift_region",function(t){return n.Dashboard.Component.apply(this,arguments),isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)?(this.update=function(){},void console.warn("Unable to add shift_region dashboard component: plot state does not have region bounds")):((isNaN(t.step)||0===t.step)&&(t.step=5e4),"string"!=typeof t.button_html&&(t.button_html=t.step>0?">":"<"),"string"!=typeof t.button_title&&(t.button_title="Shift region by "+(t.step>0?"+":"-")+n.positionIntToString(Math.abs(t.step),null,!0)),void(this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){this.parent_plot.applyState({start:Math.max(this.parent_plot.state.start+t.step,1),end:this.parent_plot.state.end+t.step})}.bind(this)),this.button.show(),this)}))}),n.Dashboard.Components.add("zoom_region",function(t){return n.Dashboard.Component.apply(this,arguments),isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)?(this.update=function(){},void console.warn("Unable to add zoom_region dashboard component: plot state does not have region bounds")):((isNaN(t.step)||0===t.step)&&(t.step=.2),"string"!=typeof t.button_html&&(t.button_html=t.step>0?"z–":"z+"),"string"!=typeof t.button_title&&(t.button_title="Zoom region "+(t.step>0?"out":"in")+" by "+(100*Math.abs(t.step)).toFixed(1)+"%"),void(this.update=function(){if(this.button){var e=!0,a=this.parent_plot.state.end-this.parent_plot.state.start;return t.step>0&&!isNaN(this.parent_plot.layout.max_region_scale)&&a>=this.parent_plot.layout.max_region_scale&&(e=!1),t.step<0&&!isNaN(this.parent_plot.layout.min_region_scale)&&a<=this.parent_plot.layout.min_region_scale&&(e=!1),this.button.disable(!e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){var e=this.parent_plot.state.end-this.parent_plot.state.start,a=1+t.step,i=e*a;isNaN(this.parent_plot.layout.max_region_scale)||(i=Math.min(i,this.parent_plot.layout.max_region_scale)),isNaN(this.parent_plot.layout.min_region_scale)||(i=Math.max(i,this.parent_plot.layout.min_region_scale));var n=Math.floor((i-e)/2);this.parent_plot.applyState({start:Math.max(this.parent_plot.state.start-n,1),end:this.parent_plot.state.end+n})}.bind(this)),this.button.show(),this}))}),n.Dashboard.Components.add("menu",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title),this.button.menu.setPopulate(function(){this.button.menu.inner_selector.html(t.menu_html)}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("covariates_model",function(t){n.Dashboard.Component.apply(this,arguments),this.initialize=function(){this.parent_plot.state.model=this.parent_plot.state.model||{},this.parent_plot.state.model.covariates=this.parent_plot.state.model.covariates||[],this.parent_plot.CovariatesModel={button:this,add:function(t){var e=JSON.parse(JSON.stringify(t));"object"==typeof t&&"string"!=typeof e.html&&(e.html="function"==typeof t.toHTML?t.toHTML():t.toString());for(var a=0;a1?"covariates":"covariate";t+=" ("+this.parent_plot.state.model.covariates.length+" "+e+")"}this.button.setHtml(t).disable(!1)}.bind(this),this.button.show(),this)}}),n.Dashboard.Components.add("toggle_split_tracks",function(t){if(n.Dashboard.Component.apply(this,arguments),t.data_layer_id||(t.data_layer_id="intervals"),!this.parent_panel.data_layers[t.data_layer_id])throw"Dashboard toggle split tracks component missing valid data layer ID";this.update=function(){var e=this.parent_panel.data_layers[t.data_layer_id],a=e.layout.split_tracks?"Merge Tracks":"Split Tracks";return this.button?(this.button.setHtml(a),this.button.show(),this.parent.position(),this):(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(a).setTitle("Toggle whether tracks are split apart or merged together").setOnclick(function(){e.toggleSplitTracks(),this.scale_timeout&&clearTimeout(this.scale_timeout);var t=e.layout.transition?+e.layout.transition.duration||0:0;this.scale_timeout=setTimeout(function(){this.parent_panel.scaleHeightToData(),this.parent_plot.positionPanels()}.bind(this),t),this.update()}.bind(this)),this.update())}}),n.Dashboard.Components.add("resize_to_data",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("Resize to Data").setTitle("Automatically resize this panel to fit the data its currently showing").setOnclick(function(){this.parent_panel.scaleHeightToData(),this.update()}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("toggle_legend",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){var e=this.parent_panel.legend.layout.hidden?"Show Legend":"Hide Legend";return this.button?(this.button.setHtml(e).show(),this.parent.position(),this):(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setTitle("Show or hide the legend for this panel").setOnclick(function(){this.parent_panel.legend.layout.hidden=!this.parent_panel.legend.layout.hidden,this.parent_panel.legend.render(),this.update()}.bind(this)),this.update())}}),n.Dashboard.Components.add("data_layers",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return"string"!=typeof t.button_html&&(t.button_html="Data Layers"),"string"!=typeof t.button_title&&(t.button_title="Manipulate Data Layers (sort, dim, show/hide, etc.)"),this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){this.button.menu.populate()}.bind(this)),this.button.menu.setPopulate(function(){this.button.menu.inner_selector.html("");var e=this.button.menu.inner_selector.append("table");return this.parent_panel.data_layer_ids_by_z_index.slice().reverse().forEach(function(a,i){var s=this.parent_panel.data_layers[a],o="string"!=typeof s.layout.name?s.id:s.layout.name,r=e.append("tr");r.append("td").html(o),t.statuses.forEach(function(t){var e,a,i,o=n.DataLayer.Statuses.adjectives.indexOf(t),l=n.DataLayer.Statuses.verbs[o];s.global_statuses[t]?(e=n.DataLayer.Statuses.menu_antiverbs[o],a="un"+l+"AllElements",i="-highlighted"):(e=n.DataLayer.Statuses.verbs[o],a=l+"AllElements",i=""),r.append("td").append("a").attr("class","lz-dashboard-button lz-dashboard-button-"+this.layout.color+i).style({"margin-left":"0em"}).on("click",function(){s[a](),this.button.menu.populate()}.bind(this)).html(e)}.bind(this));var l=0===i,h=i===this.parent_panel.data_layer_ids_by_z_index.length-1,d=r.append("td");d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-start lz-dashboard-button-"+this.layout.color+(h?"-disabled":"")).style({"margin-left":"0em"}).on("click",function(){s.moveDown(),this.button.menu.populate()}.bind(this)).html("▾").attr("title","Move layer down (further back)"),d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-middle lz-dashboard-button-"+this.layout.color+(l?"-disabled":"")).style({"margin-left":"0em"}).on("click",function(){s.moveUp(),this.button.menu.populate()}.bind(this)).html("▴").attr("title","Move layer up (further front)"),d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-end lz-dashboard-button-red").style({"margin-left":"0em"}).on("click",function(){return confirm("Are you sure you want to remove the "+o+" layer? This cannot be undone!")&&s.parent.removeDataLayer(a),this.button.menu.populate()}.bind(this)).html("×").attr("title","Remove layer")}.bind(this)),this}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("display_options",function(t){"string"!=typeof t.button_html&&(t.button_html="Display options"),"string"!=typeof t.button_title&&(t.button_title="Control how plot items are displayed"),n.Dashboard.Component.apply(this,arguments);var e=t.fields_whitelist||["color","fill_opacity","label","legend","point_shape","point_size","tooltip","tooltip_positioning"],a=this.parent_panel.data_layers[t.layer_name],i=a.layout,s={};e.forEach(function(t){var e=i[t];e&&(s[t]=JSON.parse(JSON.stringify(e)))}),this._selected_item="default";var o=this;this.button=new n.Dashboard.Component.Button(o).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){o.button.menu.populate()}),this.button.menu.setPopulate(function(){var t=Math.floor(1e4*Math.random()).toString();o.button.menu.inner_selector.html("");var e=o.button.menu.inner_selector.append("table"),i=o.layout,n=function(i,n,s){var r=e.append("tr");r.append("td").append("input").attr({type:"radio",name:"color-picker-"+t,value:s}).property("checked",s===o._selected_item).on("click",function(){Object.keys(n).forEach(function(t){a.layout[t]=n[t]}),o._selected_item=s,o.parent_panel.render();var t=o.parent_panel.legend;t&&n.legend&&t.render()}),r.append("td").text(i)},r=i.default_config_display_name||"Default style";return n(r,s,"default"),i.options.forEach(function(t,e){n(t.display_name,t.display,e)}),o}),this.update=function(){return this.button.show(),this}}),n.Legend=function(t){if(!(t instanceof n.Panel))throw"Unable to create legend, parent must be a locuszoom panel";return this.parent=t,this.id=this.parent.getBaseId()+".legend",this.parent.layout.legend=n.Layouts.merge(this.parent.layout.legend||{},n.Legend.DefaultLayout),this.layout=this.parent.layout.legend,this.selector=null,this.background_rect=null,this.elements=[],this.elements_group=null,this.hidden=!1,this.render()},n.Legend.DefaultLayout={orientation:"vertical",origin:{x:0,y:0},width:10,height:10,padding:5,label_size:12,hidden:!1},n.Legend.prototype.render=function(){this.selector||(this.selector=this.parent.svg.group.append("g").attr("id",this.parent.getBaseId()+".legend").attr("class","lz-legend")),this.background_rect||(this.background_rect=this.selector.append("rect").attr("width",100).attr("height",100).attr("class","lz-legend-background")),this.elements_group||(this.elements_group=this.selector.append("g")),this.elements.forEach(function(t){t.remove()}),this.elements=[];var e=+this.layout.padding||1,a=e,i=e,n=0;this.parent.data_layer_ids_by_z_index.slice().reverse().forEach(function(s){Array.isArray(this.parent.data_layers[s].layout.legend)&&this.parent.data_layers[s].layout.legend.forEach(function(s){var o=this.elements_group.append("g").attr("transform","translate("+a+","+i+")"),r=+s.label_size||+this.layout.label_size||12,l=0,h=r/2+e/2;if(n=Math.max(n,r+e),"line"===s.shape){var d=+s.length||16,u=r/4+e/2;o.append("path").attr("class",s.class||"").attr("d","M0,"+u+"L"+d+","+u).style(s.style||{}),l=d+e}else if("rect"===s.shape){var p=+s.width||16,c=+s.height||p;o.append("rect").attr("class",s.class||"").attr("width",p).attr("height",c).attr("fill",s.color||{}).style(s.style||{}),l=p+e,n=Math.max(n,c+e)}else if(t.svg.symbolTypes.indexOf(s.shape)!==-1){var y=+s.size||40,f=Math.ceil(Math.sqrt(y/Math.PI));o.append("path").attr("class",s.class||"").attr("d",t.svg.symbol().size(y).type(s.shape)).attr("transform","translate("+f+","+(f+e/2)+")").attr("fill",s.color||{}).style(s.style||{}),l=2*f+e,h=Math.max(2*f+e/2,h),n=Math.max(n,2*f+e)}o.append("text").attr("text-anchor","left").attr("class","lz-label").attr("x",l).attr("y",h).style({"font-size":r}).text(s.label);var g=o.node().getBoundingClientRect();if("vertical"===this.layout.orientation)i+=g.height+e,n=0;else{var _=this.layout.origin.x+a+g.width;a>e&&_>this.parent.layout.width&&(i+=n,a=e,o.attr("transform","translate("+a+","+i+")")),a+=g.width+3*e}this.elements.push(o)}.bind(this))}.bind(this));var s=this.elements_group.node().getBoundingClientRect();return this.layout.width=s.width+2*this.layout.padding,this.layout.height=s.height+2*this.layout.padding,this.background_rect.attr("width",this.layout.width).attr("height",this.layout.height),this.selector.style({visibility:this.layout.hidden?"hidden":"visible"}),this.position()},n.Legend.prototype.position=function(){if(!this.selector)return this;var t=this.selector.node().getBoundingClientRect();isNaN(+this.layout.pad_from_bottom)||(this.layout.origin.y=this.parent.layout.height-t.height-+this.layout.pad_from_bottom),isNaN(+this.layout.pad_from_right)||(this.layout.origin.x=this.parent.layout.width-t.width-+this.layout.pad_from_right),this.selector.attr("transform","translate("+this.layout.origin.x+","+this.layout.origin.y+")")},n.Legend.prototype.hide=function(){this.layout.hidden=!0,this.render()},n.Legend.prototype.show=function(){this.layout.hidden=!1,this.render()},n.Data=n.Data||{},n.DataSources=function(){this.sources={}},n.DataSources.prototype.addSource=function(t,e){return console.warn("Warning: .addSource() is deprecated. Use .add() instead"),this.add(t,e)},n.DataSources.prototype.add=function(t,e){return this.set(t,e)},n.DataSources.prototype.set=function(t,e){if(Array.isArray(e)){var a=n.KnownDataSources.create.apply(null,e);this.sources[t]=a}else null!==e?this.sources[t]=e:delete this.sources[t];return this},n.DataSources.prototype.getSource=function(t){return console.warn("Warning: .getSource() is deprecated. Use .get() instead"),this.get(t)},n.DataSources.prototype.get=function(t){return this.sources[t]},n.DataSources.prototype.removeSource=function(t){return console.warn("Warning: .removeSource() is deprecated. Use .remove() instead"),this.remove(t)},n.DataSources.prototype.remove=function(t){return this.set(t,null)},n.DataSources.prototype.fromJSON=function(t){"string"==typeof t&&(t=JSON.parse(t));var e=this;return Object.keys(t).forEach(function(a){e.set(a,t[a])}),e},n.DataSources.prototype.keys=function(){return Object.keys(this.sources)},n.DataSources.prototype.toJSON=function(){return this.sources},n.Data.Field=function(t){var e=/^(?:([^:]+):)?([^:|]*)(\|.+)*$/.exec(t);this.full_name=t,this.namespace=e[1]||null,this.name=e[2]||null,this.transformations=[],"string"==typeof e[3]&&e[3].length>1&&(this.transformations=e[3].substring(1).split("|"),this.transformations.forEach(function(t,e){this.transformations[e]=n.TransformationFunctions.get(t)}.bind(this))),this.applyTransformations=function(t){return this.transformations.forEach(function(e){t=e(t)}),t},this.resolve=function(t){if("undefined"==typeof t[this.full_name]){var e=null;"undefined"!=typeof t[this.namespace+":"+this.name]?e=t[this.namespace+":"+this.name]:"undefined"!=typeof t[this.name]&&(e=t[this.name]),t[this.full_name]=this.applyTransformations(e)}return t[this.full_name]; -}},n.Data.Requester=function(t){function a(t){var e={},a=/^(?:([^:]+):)?([^:|]*)(\|.+)*$/;return t.forEach(function(t){var i=a.exec(t),s=i[1]||"base",o=i[2],r=n.TransformationFunctions.get(i[3]);"undefined"==typeof e[s]&&(e[s]={outnames:[],fields:[],trans:[]}),e[s].outnames.push(t),e[s].fields.push(o),e[s].trans.push(r)}),e}this.getData=function(i,n){for(var s=a(n),o=Object.keys(s).map(function(e){if(!t.get(e))throw"Datasource for namespace "+e+" not found";return t.get(e).getData(i,s[e].fields,s[e].outnames,s[e].trans)}),r=e.when({header:{},body:{}}),l=0;l1&&(2!==e.length||e.indexOf("isrefvar")===-1))throw"LD does not know how to get all fields: "+e.join(", ")},n.Data.LDSource.prototype.findMergeFields=function(t){var e=function(t){return function(){for(var e=arguments,a=0;a0){var i=Object.keys(t.body[0]),n=e(i);a.id=a.id||n(/\bvariant\b/)||n(/\bid\b/),a.position=a.position||n(/\bposition\b/i,/\bpos\b/i),a.pvalue=a.pvalue||n(/\bpvalue\b/i,/\blog_pvalue\b/i),a._names_=i}return a},n.Data.LDSource.prototype.findRequestedFields=function(t,e){for(var a={},i=0;ii&&(i=t[s][e]*a,n=s);return n},n=t.ldrefsource||e.header.ldrefsource||1,s=this.findRequestedFields(a),o=s.ldin;if("state"===o&&(o=t.ldrefvar||e.header.ldrefvar||"best"),"best"===o){if(!e.body)throw"No association data found to find best pvalue";var r=this.findMergeFields(e);if(!r.pvalue||!r.id){var l="";throw r.id||(l+=(l.length?", ":"")+"id"),r.pvalue||(l+=(l.length?", ":"")+"pvalue"),"Unable to find necessary column(s) for merge: "+l+" (available: "+r._names_+")"}o=e.body[i(e.body,r.pvalue)][r.id]}return e.header||(e.header={}),e.header.ldrefvar=o,this.url+"results/?filter=reference eq "+n+" and chromosome2 eq '"+t.chr+"' and position2 ge "+t.start+" and position2 le "+t.end+" and variant1 eq '"+o+"'&fields=chr,pos,rsquare"},n.Data.LDSource.prototype.parseResponse=function(t,e,a,i){var n=JSON.parse(t),s=this.findMergeFields(e),o=this.findRequestedFields(a,i);if(!s.position)throw"Unable to find position field for merge: "+s._names_;var r=function(t,e,a,i){for(var n=0,o=0;n0&&parseFloat(this.panels[i].layout.proportional_height)>0&&(s=Math.max(s,this.panels[i].layout.min_height/this.panels[i].layout.proportional_height));if(this.layout.min_width=Math.max(n,1),this.layout.min_height=Math.max(s,1),t.select(this.svg.node().parentNode).style({"min-width":this.layout.min_width+"px","min-height":this.layout.min_height+"px"}),!isNaN(e)&&e>=0&&!isNaN(a)&&a>=0){this.layout.width=Math.max(Math.round(+e),this.layout.min_width),this.layout.height=Math.max(Math.round(+a),this.layout.min_height),this.layout.aspect_ratio=this.layout.width/this.layout.height,this.layout.responsive_resize&&(this.svg&&(this.layout.width=Math.max(this.svg.node().parentNode.getBoundingClientRect().width,this.layout.min_width)),this.layout.height=this.layout.width/this.layout.aspect_ratio,this.layout.height0)e.layout.y_index<0&&(e.layout.y_index=Math.max(this.panel_ids_by_y_index.length+e.layout.y_index,0)),this.panel_ids_by_y_index.splice(e.layout.y_index,0,e.id),this.applyPanelYIndexesToPanelLayouts();else{var a=this.panel_ids_by_y_index.push(e.id);this.panels[e.id].layout.y_index=a-1}var i=null;return this.layout.panels.forEach(function(t,a){t.id===e.id&&(i=a)}),null===i&&(i=this.layout.panels.push(this.panels[e.id].layout)-1),this.panels[e.id].layout_idx=i,this.initialized&&(this.positionPanels(),this.panels[e.id].initialize(),this.panels[e.id].reMap(),this.setDimensions(this.layout.width,this.layout.height)),this.panels[e.id]},n.Plot.prototype.clearPanelData=function(t,e){e=e||"wipe";var a;a=t?[t]:Object.keys(this.panels);var i=this;return a.forEach(function(t){i.panels[t].data_layer_ids_by_z_index.forEach(function(a){var n=i.panels[t].data_layers[a];n.destroyAllTooltips(),delete i.layout.state[t+"."+a],"reset"===e&&n.setDefaultState()})}),this},n.Plot.prototype.removePanel=function(t){if(!this.panels[t])throw"Unable to remove panel, ID not found: "+t;return this.panel_boundaries.hide(),this.clearPanelData(t),this.panels[t].loader.hide(),this.panels[t].dashboard.destroy(!0),this.panels[t].curtain.hide(),this.panels[t].svg.container&&this.panels[t].svg.container.remove(),this.layout.panels.splice(this.panels[t].layout_idx,1),delete this.panels[t],delete this.layout.state[t],this.layout.panels.forEach(function(t,e){this.panels[t.id].layout_idx=e}.bind(this)),this.panel_ids_by_y_index.splice(this.panel_ids_by_y_index.indexOf(t),1),this.applyPanelYIndexesToPanelLayouts(),this.initialized&&(this.layout.min_height=this._base_layout.min_height,this.layout.min_width=this._base_layout.min_width,this.positionPanels(),this.setDimensions(this.layout.width,this.layout.height)),this},n.Plot.prototype.positionPanels=function(){var t,e={left:0,right:0};for(t in this.panels)null===this.panels[t].layout.proportional_height&&(this.panels[t].layout.proportional_height=this.panels[t].layout.height/this.layout.height),null===this.panels[t].layout.proportional_width&&(this.panels[t].layout.proportional_width=1),this.panels[t].layout.interaction.x_linked&&(e.left=Math.max(e.left,this.panels[t].layout.margin.left),e.right=Math.max(e.right,this.panels[t].layout.margin.right));var a=this.sumProportional("height");if(!a)return this;var i=1/a;for(t in this.panels)this.panels[t].layout.proportional_height*=i;var n=0;this.panel_ids_by_y_index.forEach(function(t){if(this.panels[t].setOrigin(0,n),this.panels[t].layout.proportional_origin.x=0,n+=this.panels[t].layout.height,this.panels[t].layout.interaction.x_linked){var a=Math.max(e.left-this.panels[t].layout.margin.left,0)+Math.max(e.right-this.panels[t].layout.margin.right,0);this.panels[t].layout.width+=a,this.panels[t].layout.margin.left=e.left,this.panels[t].layout.margin.right=e.right,this.panels[t].layout.cliparea.origin.x=e.left}}.bind(this));var s=n;return this.panel_ids_by_y_index.forEach(function(t){this.panels[t].layout.proportional_origin.y=this.panels[t].layout.origin.y/s}.bind(this)),this.setDimensions(),this.panel_ids_by_y_index.forEach(function(t){this.panels[t].setDimensions(this.layout.width*this.panels[t].layout.proportional_width,this.layout.height*this.panels[t].layout.proportional_height)}.bind(this)),this},n.Plot.prototype.initialize=function(){if(this.layout.responsive_resize&&t.select(this.container).classed("lz-container-responsive",!0),this.layout.mouse_guide){var e=this.svg.append("g").attr("class","lz-mouse_guide").attr("id",this.id+".mouse_guide"),a=e.append("rect").attr("class","lz-mouse_guide-vertical").attr("x",-1),i=e.append("rect").attr("class","lz-mouse_guide-horizontal").attr("y",-1);this.mouse_guide={svg:e,vertical:a,horizontal:i}}this.curtain=n.generateCurtain.call(this),this.loader=n.generateLoader.call(this),this.panel_boundaries={parent:this,hide_timeout:null,showing:!1,dragging:!1,selectors:[],corner_selector:null,show:function(){if(!this.showing&&!this.parent.curtain.showing){this.showing=!0,this.parent.panel_ids_by_y_index.forEach(function(e,a){var i=t.select(this.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip").attr("class","lz-panel-boundary").attr("title","Resize panel");i.append("span");var n=t.behavior.drag();n.on("dragstart",function(){this.dragging=!0}.bind(this)),n.on("dragend",function(){this.dragging=!1}.bind(this)),n.on("drag",function(){var e=this.parent.panels[this.parent.panel_ids_by_y_index[a]],i=e.layout.height;e.setDimensions(e.layout.width,e.layout.height+t.event.dy);var n=e.layout.height-i,s=this.parent.layout.height+n;this.parent.panel_ids_by_y_index.forEach(function(t,e){var i=this.parent.panels[this.parent.panel_ids_by_y_index[e]];i.layout.proportional_height=i.layout.height/s,e>a&&(i.setOrigin(i.layout.origin.x,i.layout.origin.y+n),i.dashboard.position())}.bind(this)),this.parent.positionPanels(),this.position()}.bind(this)),i.call(n),this.parent.panel_boundaries.selectors.push(i)}.bind(this));var e=t.select(this.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip").attr("class","lz-panel-corner-boundary").attr("title","Resize plot");e.append("span").attr("class","lz-panel-corner-boundary-outer"),e.append("span").attr("class","lz-panel-corner-boundary-inner");var a=t.behavior.drag();a.on("dragstart",function(){this.dragging=!0}.bind(this)),a.on("dragend",function(){this.dragging=!1}.bind(this)),a.on("drag",function(){this.setDimensions(this.layout.width+t.event.dx,this.layout.height+t.event.dy)}.bind(this.parent)),e.call(a),this.parent.panel_boundaries.corner_selector=e}return this.position()},position:function(){if(!this.showing)return this;var t=this.parent.getPageOrigin();this.selectors.forEach(function(e,a){var i=this.parent.panels[this.parent.panel_ids_by_y_index[a]].getPageOrigin(),n=t.x,s=i.y+this.parent.panels[this.parent.panel_ids_by_y_index[a]].layout.height-12,o=this.parent.layout.width-1;e.style({top:s+"px",left:n+"px",width:o+"px"}),e.select("span").style({width:o+"px"})}.bind(this));var e=10,a=16;return this.corner_selector.style({top:t.y+this.parent.layout.height-e-a+"px",left:t.x+this.parent.layout.width-e-a+"px"}),this},hide:function(){return this.showing?(this.showing=!1,this.selectors.forEach(function(t){t.remove()}),this.selectors=[],this.corner_selector.remove(),this.corner_selector=null,this):this}},this.layout.panel_boundaries&&(t.select(this.svg.node().parentNode).on("mouseover."+this.id+".panel_boundaries",function(){clearTimeout(this.panel_boundaries.hide_timeout),this.panel_boundaries.show()}.bind(this)),t.select(this.svg.node().parentNode).on("mouseout."+this.id+".panel_boundaries",function(){this.panel_boundaries.hide_timeout=setTimeout(function(){this.panel_boundaries.hide()}.bind(this),300)}.bind(this))),this.dashboard=new n.Dashboard(this).show();for(var s in this.panels)this.panels[s].initialize();var o="."+this.id;if(this.layout.mouse_guide){var r=function(){this.mouse_guide.vertical.attr("x",-1),this.mouse_guide.horizontal.attr("y",-1)}.bind(this),l=function(){var e=t.mouse(this.svg.node());this.mouse_guide.vertical.attr("x",e[0]),this.mouse_guide.horizontal.attr("y",e[1])}.bind(this);this.svg.on("mouseout"+o+"-mouse_guide",r).on("touchleave"+o+"-mouse_guide",r).on("mousemove"+o+"-mouse_guide",l)}var h=function(){this.stopDrag()}.bind(this),d=function(){if(this.interaction.dragging){var e=t.mouse(this.svg.node());t.event&&t.event.preventDefault(),this.interaction.dragging.dragged_x=e[0]-this.interaction.dragging.start_x,this.interaction.dragging.dragged_y=e[1]-this.interaction.dragging.start_y,this.panels[this.interaction.panel_id].render(),this.interaction.linked_panel_ids.forEach(function(t){this.panels[t].render()}.bind(this))}}.bind(this);this.svg.on("mouseup"+o,h).on("touchend"+o,h).on("mousemove"+o,d).on("touchmove"+o,d),t.select("body").empty()||t.select("body").on("mouseup"+o,h).on("touchend"+o,h),this.initialized=!0;var u=this.svg.node().getBoundingClientRect(),p=u.width?u.width:this.layout.width,c=u.height?u.height:this.layout.height;return this.setDimensions(p,c),this},n.Plot.prototype.refresh=function(){return this.applyState()},n.Plot.prototype.applyState=function(t){if(t=t||{},"object"!=typeof t)throw"LocusZoom.applyState only accepts an object; "+typeof t+" given";var a=JSON.parse(JSON.stringify(this.state));for(var i in t)a[i]=t[i];a=n.validateState(a,this.layout);for(i in a)this.state[i]=a[i];this.emit("data_requested"),this.remap_promises=[],this.loading_data=!0;for(var s in this.panels)this.remap_promises.push(this.panels[s].reMap());return e.all(this.remap_promises).catch(function(t){console.error(t),this.curtain.drop(t),this.loading_data=!1}.bind(this)).then(function(){this.dashboard.update(),this.panel_ids_by_y_index.forEach(function(t){var e=this.panels[t];e.dashboard.update(),e.data_layer_ids_by_z_index.forEach(function(e){var a=this.data_layers[e],i=t+"."+e;for(var n in this.state[i])this.state[i].hasOwnProperty(n)&&Array.isArray(this.state[i][n])&&this.state[i][n].forEach(function(t){try{this.setElementStatus(n,this.getElementById(t),!0)}catch(t){console.error("Unable to apply state: "+i+", "+n)}}.bind(a))}.bind(e))}.bind(this)),this.emit("layout_changed"),this.emit("data_rendered"),this.loading_data=!1}.bind(this))},n.Plot.prototype.startDrag=function(e,a){e=e||null,a=a||null;var i=null;switch(a){case"background":case"x_tick":i="x";break;case"y1_tick":i="y1";break;case"y2_tick":i="y2"}if(!(e instanceof n.Panel&&i&&this.canInteract()))return this.stopDrag();var s=t.mouse(this.svg.node());return this.interaction={panel_id:e.id,linked_panel_ids:e.getLinkedPanelIds(i),dragging:{method:a,start_x:s[0],start_y:s[1],dragged_x:0,dragged_y:0,axis:i}},this.svg.style("cursor","all-scroll"),this},n.Plot.prototype.stopDrag=function(){if(!this.interaction.dragging)return this;if("object"!=typeof this.panels[this.interaction.panel_id])return this.interaction={},this;var t=this.panels[this.interaction.panel_id],e=function(e,a,i){t.data_layer_ids_by_z_index.forEach(function(n){t.data_layers[n].layout[e+"_axis"].axis===a&&(t.data_layers[n].layout[e+"_axis"].floor=i[0],t.data_layers[n].layout[e+"_axis"].ceiling=i[1],delete t.data_layers[n].layout[e+"_axis"].lower_buffer,delete t.data_layers[n].layout[e+"_axis"].upper_buffer,delete t.data_layers[n].layout[e+"_axis"].min_extent,delete t.data_layers[n].layout[e+"_axis"].ticks)})};switch(this.interaction.dragging.method){case"background":case"x_tick":0!==this.interaction.dragging.dragged_x&&(e("x",1,t.x_extent),this.applyState({start:t.x_extent[0],end:t.x_extent[1]}));break;case"y1_tick":case"y2_tick":if(0!==this.interaction.dragging.dragged_y){var a=parseInt(this.interaction.dragging.method[1]);e("y",a,t["y"+a+"_extent"])}}return this.interaction={},this.svg.style("cursor",null),this},n.Panel=function(t,e){if("object"!=typeof t)throw"Unable to create panel, invalid layout";if(this.parent=e||null,this.parent_plot=e,"string"==typeof t.id&&t.id.length){if(this.parent&&"undefined"!=typeof this.parent.panels[t.id])throw"Cannot create panel with id ["+t.id+"]; panel with that id already exists"}else if(this.parent){var a=null,i=function(){a="p"+Math.floor(Math.random()*Math.pow(10,8)),null!=a&&"undefined"==typeof this.parent.panels[a]||(a=i())}.bind(this);t.id=a}else t.id="p"+Math.floor(Math.random()*Math.pow(10,8));return this.id=t.id,this.initialized=!1,this.layout_idx=null,this.svg={},this.layout=n.Layouts.merge(t||{},n.Panel.DefaultLayout),this.parent?(this.state=this.parent.state,this.state_id=this.id,this.state[this.state_id]=this.state[this.state_id]||{}):(this.state=null,this.state_id=null),this.data_layers={},this.data_layer_ids_by_z_index=[],this.applyDataLayerZIndexesToDataLayerLayouts=function(){this.data_layer_ids_by_z_index.forEach(function(t,e){this.data_layers[t].layout.z_index=e}.bind(this))}.bind(this),this.data_promises=[],this.x_scale=null,this.y1_scale=null,this.y2_scale=null,this.x_extent=null,this.y1_extent=null,this.y2_extent=null,this.x_ticks=[],this.y1_ticks=[],this.y2_ticks=[],this.zoom_timeout=null,this.getBaseId=function(){return this.parent.id+"."+this.id},this.event_hooks={layout_changed:[],data_requested:[],data_rendered:[],element_clicked:[]},this.on=function(t,e){if(!Array.isArray(this.event_hooks[t]))throw"Unable to register event hook, invalid event: "+t.toString();if("function"!=typeof e)throw"Unable to register event hook, invalid hook function passed";return this.event_hooks[t].push(e),this},this.emit=function(t,e){if(!Array.isArray(this.event_hooks[t]))throw"LocusZoom attempted to throw an invalid event: "+t.toString();return e=e||this,this.event_hooks[t].forEach(function(t){t.call(e)}),this},this.getPageOrigin=function(){var t=this.parent.getPageOrigin();return{x:t.x+this.layout.origin.x,y:t.y+this.layout.origin.y}},this.initializeLayout(),this},n.Panel.DefaultLayout={title:{text:"",style:{},x:10,y:22},y_index:null,width:0,height:0,origin:{x:0,y:null},min_width:1,min_height:1,proportional_width:null,proportional_height:null,proportional_origin:{x:0,y:null},margin:{top:0,right:0,bottom:0,left:0},background_click:"clear_selections",dashboard:{components:[]},cliparea:{height:0,width:0,origin:{x:0,y:0}},axes:{x:{},y1:{},y2:{}},legend:null,interaction:{drag_background_to_pan:!1,drag_x_ticks_to_scale:!1,drag_y1_ticks_to_scale:!1,drag_y2_ticks_to_scale:!1,scroll_to_zoom:!1,x_linked:!1,y1_linked:!1,y2_linked:!1},data_layers:[]},n.Panel.prototype.initializeLayout=function(){if(0===this.layout.width&&null===this.layout.proportional_width&&(this.layout.proportional_width=1),0===this.layout.height&&null===this.layout.proportional_height){var t=Object.keys(this.parent.panels).length;t>0?this.layout.proportional_height=1/t:this.layout.proportional_height=1}return this.setDimensions(),this.setOrigin(),this.setMargin(),this.x_range=[0,this.layout.cliparea.width],this.y1_range=[this.layout.cliparea.height,0],this.y2_range=[this.layout.cliparea.height,0],["x","y1","y2"].forEach(function(t){Object.keys(this.layout.axes[t]).length&&this.layout.axes[t].render!==!1?(this.layout.axes[t].render=!0,this.layout.axes[t].label=this.layout.axes[t].label||null,this.layout.axes[t].label_function=this.layout.axes[t].label_function||null):this.layout.axes[t].render=!1}.bind(this)),this.layout.data_layers.forEach(function(t){this.addDataLayer(t)}.bind(this)),this},n.Panel.prototype.setDimensions=function(t,e){return"undefined"!=typeof t&&"undefined"!=typeof e?!isNaN(t)&&t>=0&&!isNaN(e)&&e>=0&&(this.layout.width=Math.max(Math.round(+t),this.layout.min_width),this.layout.height=Math.max(Math.round(+e),this.layout.min_height)):(null!==this.layout.proportional_width&&(this.layout.width=Math.max(this.layout.proportional_width*this.parent.layout.width,this.layout.min_width)),null!==this.layout.proportional_height&&(this.layout.height=Math.max(this.layout.proportional_height*this.parent.layout.height,this.layout.min_height))),this.layout.cliparea.width=Math.max(this.layout.width-(this.layout.margin.left+this.layout.margin.right),0),this.layout.cliparea.height=Math.max(this.layout.height-(this.layout.margin.top+this.layout.margin.bottom),0),this.svg.clipRect&&this.svg.clipRect.attr("width",this.layout.width).attr("height",this.layout.height),this.initialized&&(this.render(),this.curtain.update(),this.loader.update(),this.dashboard.update(),this.legend&&this.legend.position()),this},n.Panel.prototype.setOrigin=function(t,e){return!isNaN(t)&&t>=0&&(this.layout.origin.x=Math.max(Math.round(+t),0)),!isNaN(e)&&e>=0&&(this.layout.origin.y=Math.max(Math.round(+e),0)),this.initialized&&this.render(),this},n.Panel.prototype.setMargin=function(t,e,a,i){var n;return!isNaN(t)&&t>=0&&(this.layout.margin.top=Math.max(Math.round(+t),0)),!isNaN(e)&&e>=0&&(this.layout.margin.right=Math.max(Math.round(+e),0)),!isNaN(a)&&a>=0&&(this.layout.margin.bottom=Math.max(Math.round(+a),0)),!isNaN(i)&&i>=0&&(this.layout.margin.left=Math.max(Math.round(+i),0)),this.layout.margin.top+this.layout.margin.bottom>this.layout.height&&(n=Math.floor((this.layout.margin.top+this.layout.margin.bottom-this.layout.height)/2),this.layout.margin.top-=n, -this.layout.margin.bottom-=n),this.layout.margin.left+this.layout.margin.right>this.layout.width&&(n=Math.floor((this.layout.margin.left+this.layout.margin.right-this.layout.width)/2),this.layout.margin.left-=n,this.layout.margin.right-=n),["top","right","bottom","left"].forEach(function(t){this.layout.margin[t]=Math.max(this.layout.margin[t],0)}.bind(this)),this.layout.cliparea.width=Math.max(this.layout.width-(this.layout.margin.left+this.layout.margin.right),0),this.layout.cliparea.height=Math.max(this.layout.height-(this.layout.margin.top+this.layout.margin.bottom),0),this.layout.cliparea.origin.x=this.layout.margin.left,this.layout.cliparea.origin.y=this.layout.margin.top,this.initialized&&this.render(),this},n.Panel.prototype.setTitle=function(t){if("string"==typeof this.layout.title){var e=this.layout.title;this.layout.title={text:e,x:0,y:0,style:{}}}return"string"==typeof t?this.layout.title.text=t:"object"==typeof t&&null!==t&&(this.layout.title=n.Layouts.merge(t,this.layout.title)),this.layout.title.text.length?this.title.attr("display",null).attr("x",parseFloat(this.layout.title.x)).attr("y",parseFloat(this.layout.title.y)).style(this.layout.title.style).text(this.layout.title.text):this.title.attr("display","none"),this},n.Panel.prototype.initialize=function(){this.svg.container=this.parent.svg.append("g").attr("id",this.getBaseId()+".panel_container").attr("transform","translate("+(this.layout.origin.x||0)+","+(this.layout.origin.y||0)+")");var t=this.svg.container.append("clipPath").attr("id",this.getBaseId()+".clip");if(this.svg.clipRect=t.append("rect").attr("width",this.layout.width).attr("height",this.layout.height),this.svg.group=this.svg.container.append("g").attr("id",this.getBaseId()+".panel").attr("clip-path","url(#"+this.getBaseId()+".clip)"),this.curtain=n.generateCurtain.call(this),this.loader=n.generateLoader.call(this),this.dashboard=new n.Dashboard(this),this.inner_border=this.svg.group.append("rect").attr("class","lz-panel-background").on("click",function(){"clear_selections"===this.layout.background_click&&this.clearSelections()}.bind(this)),this.title=this.svg.group.append("text").attr("class","lz-panel-title"),"undefined"!=typeof this.layout.title&&this.setTitle(),this.svg.x_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".x_axis").attr("class","lz-x lz-axis"),this.layout.axes.x.render&&(this.svg.x_axis_label=this.svg.x_axis.append("text").attr("class","lz-x lz-axis lz-label").attr("text-anchor","middle")),this.svg.y1_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".y1_axis").attr("class","lz-y lz-y1 lz-axis"),this.layout.axes.y1.render&&(this.svg.y1_axis_label=this.svg.y1_axis.append("text").attr("class","lz-y1 lz-axis lz-label").attr("text-anchor","middle")),this.svg.y2_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".y2_axis").attr("class","lz-y lz-y2 lz-axis"),this.layout.axes.y2.render&&(this.svg.y2_axis_label=this.svg.y2_axis.append("text").attr("class","lz-y2 lz-axis lz-label").attr("text-anchor","middle")),this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].initialize()}.bind(this)),this.legend=null,this.layout.legend&&(this.legend=new n.Legend(this)),this.layout.interaction.drag_background_to_pan){var e="."+this.parent.id+"."+this.id+".interaction.drag",a=function(){this.parent.startDrag(this,"background")}.bind(this);this.svg.container.select(".lz-panel-background").on("mousedown"+e+".background",a).on("touchstart"+e+".background",a)}return this},n.Panel.prototype.resortDataLayers=function(){var e=[];this.data_layer_ids_by_z_index.forEach(function(t){e.push(this.data_layers[t].layout.z_index)}.bind(this)),this.svg.group.selectAll("g.lz-data_layer-container").data(e).sort(t.ascending),this.applyDataLayerZIndexesToDataLayerLayouts()},n.Panel.prototype.getLinkedPanelIds=function(t){t=t||null;var e=[];return["x","y1","y2"].indexOf(t)===-1?e:this.layout.interaction[t+"_linked"]?(this.parent.panel_ids_by_y_index.forEach(function(a){a!==this.id&&this.parent.panels[a].layout.interaction[t+"_linked"]&&e.push(a)}.bind(this)),e):e},n.Panel.prototype.moveUp=function(){return this.parent.panel_ids_by_y_index[this.layout.y_index-1]&&(this.parent.panel_ids_by_y_index[this.layout.y_index]=this.parent.panel_ids_by_y_index[this.layout.y_index-1],this.parent.panel_ids_by_y_index[this.layout.y_index-1]=this.id,this.parent.applyPanelYIndexesToPanelLayouts(),this.parent.positionPanels()),this},n.Panel.prototype.moveDown=function(){return this.parent.panel_ids_by_y_index[this.layout.y_index+1]&&(this.parent.panel_ids_by_y_index[this.layout.y_index]=this.parent.panel_ids_by_y_index[this.layout.y_index+1],this.parent.panel_ids_by_y_index[this.layout.y_index+1]=this.id,this.parent.applyPanelYIndexesToPanelLayouts(),this.parent.positionPanels()),this},n.Panel.prototype.addDataLayer=function(t){if("object"!=typeof t||"string"!=typeof t.id||!t.id.length)throw"Invalid data layer layout passed to LocusZoom.Panel.prototype.addDataLayer()";if("undefined"!=typeof this.data_layers[t.id])throw"Cannot create data_layer with id ["+t.id+"]; data layer with that id already exists in the panel";if("string"!=typeof t.type)throw"Invalid data layer type in layout passed to LocusZoom.Panel.prototype.addDataLayer()";"object"!=typeof t.y_axis||"undefined"!=typeof t.y_axis.axis&&[1,2].indexOf(t.y_axis.axis)!==-1||(t.y_axis.axis=1);var e=n.DataLayers.get(t.type,t,this);if(this.data_layers[e.id]=e,null!==e.layout.z_index&&!isNaN(e.layout.z_index)&&this.data_layer_ids_by_z_index.length>0)e.layout.z_index<0&&(e.layout.z_index=Math.max(this.data_layer_ids_by_z_index.length+e.layout.z_index,0)),this.data_layer_ids_by_z_index.splice(e.layout.z_index,0,e.id),this.data_layer_ids_by_z_index.forEach(function(t,e){this.data_layers[t].layout.z_index=e}.bind(this));else{var a=this.data_layer_ids_by_z_index.push(e.id);this.data_layers[e.id].layout.z_index=a-1}var i=null;return this.layout.data_layers.forEach(function(t,a){t.id===e.id&&(i=a)}),null===i&&(i=this.layout.data_layers.push(this.data_layers[e.id].layout)-1),this.data_layers[e.id].layout_idx=i,this.data_layers[e.id]},n.Panel.prototype.removeDataLayer=function(t){if(!this.data_layers[t])throw"Unable to remove data layer, ID not found: "+t;return this.data_layers[t].destroyAllTooltips(),this.data_layers[t].svg.container&&this.data_layers[t].svg.container.remove(),this.layout.data_layers.splice(this.data_layers[t].layout_idx,1),delete this.state[this.data_layers[t].state_id],delete this.data_layers[t],this.data_layer_ids_by_z_index.splice(this.data_layer_ids_by_z_index.indexOf(t),1),this.applyDataLayerZIndexesToDataLayerLayouts(),this.layout.data_layers.forEach(function(t,e){this.data_layers[t.id].layout_idx=e}.bind(this)),this},n.Panel.prototype.clearSelections=function(){return this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].setAllElementStatus("selected",!1)}.bind(this)),this},n.Panel.prototype.reMap=function(){this.emit("data_requested"),this.data_promises=[],this.curtain.hide();for(var t in this.data_layers)try{this.data_promises.push(this.data_layers[t].reMap())}catch(t){console.warn(t),this.curtain.show(t)}return e.all(this.data_promises).then(function(){this.initialized=!0,this.render(),this.emit("layout_changed"),this.parent.emit("layout_changed"),this.emit("data_rendered")}.bind(this)).catch(function(t){console.warn(t),this.curtain.show(t)}.bind(this))};n.Panel.prototype.generateExtents=function(){["x","y1","y2"].forEach(function(t){this[t+"_extent"]=null}.bind(this));for(var e in this.data_layers){var a=this.data_layers[e];if(a.layout.x_axis&&!a.layout.x_axis.decoupled&&(this.x_extent=t.extent((this.x_extent||[]).concat(a.getAxisExtent("x")))),a.layout.y_axis&&!a.layout.y_axis.decoupled){var i="y"+a.layout.y_axis.axis;this[i+"_extent"]=t.extent((this[i+"_extent"]||[]).concat(a.getAxisExtent("y")))}}return this.layout.axes.x&&"state"===this.layout.axes.x.extent&&(this.x_extent=[this.state.start,this.state.end]),this};n.Panel.prototype.generateTicks=function(t){if(this.layout.axes[t].ticks){var e=this.layout.axes[t],a=e.ticks;if(Array.isArray(a))return a;if("object"==typeof a){var i=this,s={position:a.position},o=this.data_layer_ids_by_z_index.reduce(function(e,a){var n=i.data_layers[a];return e.concat(n.getTicks(t,s))},[]);return o.map(function(t){var e={};return e=n.Layouts.merge(e,a),n.Layouts.merge(e,t)})}}return this[t+"_extent"]?n.prettyTicks(this[t+"_extent"],"both"):[]},n.Panel.prototype.render=function(){this.svg.container.attr("transform","translate("+this.layout.origin.x+","+this.layout.origin.y+")"),this.svg.clipRect.attr("width",this.layout.width).attr("height",this.layout.height),this.inner_border.attr("x",this.layout.margin.left).attr("y",this.layout.margin.top).attr("width",this.layout.width-(this.layout.margin.left+this.layout.margin.right)).attr("height",this.layout.height-(this.layout.margin.top+this.layout.margin.bottom)),this.layout.inner_border&&this.inner_border.style({"stroke-width":1,stroke:this.layout.inner_border}),this.setTitle(),this.generateExtents();var e=function(t,e){var a=Math.pow(-10,e),i=Math.pow(-10,-e),n=Math.pow(10,-e),s=Math.pow(10,e);return t===1/0&&(t=s),t===-(1/0)&&(t=a),0===t&&(t=n),t>0&&(t=Math.max(Math.min(t,s),n)),t<0&&(t=Math.max(Math.min(t,i),a)),t},a={};if(this.x_extent){var i={start:0,end:this.layout.cliparea.width};this.layout.axes.x.range&&(i.start=this.layout.axes.x.range.start||i.start,i.end=this.layout.axes.x.range.end||i.end),a.x=[i.start,i.end],a.x_shifted=[i.start,i.end]}if(this.y1_extent){var n={start:this.layout.cliparea.height,end:0};this.layout.axes.y1.range&&(n.start=this.layout.axes.y1.range.start||n.start,n.end=this.layout.axes.y1.range.end||n.end),a.y1=[n.start,n.end],a.y1_shifted=[n.start,n.end]}if(this.y2_extent){var s={start:this.layout.cliparea.height,end:0};this.layout.axes.y2.range&&(s.start=this.layout.axes.y2.range.start||s.start,s.end=this.layout.axes.y2.range.end||s.end),a.y2=[s.start,s.end],a.y2_shifted=[s.start,s.end]}if(this.parent.interaction.panel_id&&(this.parent.interaction.panel_id===this.id||this.parent.interaction.linked_panel_ids.indexOf(this.id)!==-1)){var o,r=null;if(this.parent.interaction.zooming&&"function"==typeof this.x_scale){var l=Math.abs(this.x_extent[1]-this.x_extent[0]),h=Math.round(this.x_scale.invert(a.x_shifted[1]))-Math.round(this.x_scale.invert(a.x_shifted[0])),d=this.parent.interaction.zooming.scale,u=Math.floor(h*(1/d));d<1&&!isNaN(this.parent.layout.max_region_scale)?d=1/(Math.min(u,this.parent.layout.max_region_scale)/h):d>1&&!isNaN(this.parent.layout.min_region_scale)&&(d=1/(Math.max(u,this.parent.layout.min_region_scale)/h));var p=Math.floor(l*d);o=this.parent.interaction.zooming.center-this.layout.margin.left-this.layout.origin.x;var c=o/this.layout.cliparea.width,y=Math.max(Math.floor(this.x_scale.invert(a.x_shifted[0])-(p-h)*c),1);a.x_shifted=[this.x_scale(y),this.x_scale(y+p)]}else if(this.parent.interaction.dragging)switch(this.parent.interaction.dragging.method){case"background":a.x_shifted[0]=+this.parent.interaction.dragging.dragged_x,a.x_shifted[1]=this.layout.cliparea.width+this.parent.interaction.dragging.dragged_x;break;case"x_tick":t.event&&t.event.shiftKey?(a.x_shifted[0]=+this.parent.interaction.dragging.dragged_x,a.x_shifted[1]=this.layout.cliparea.width+this.parent.interaction.dragging.dragged_x):(o=this.parent.interaction.dragging.start_x-this.layout.margin.left-this.layout.origin.x,r=e(o/(o+this.parent.interaction.dragging.dragged_x),3),a.x_shifted[0]=0,a.x_shifted[1]=Math.max(this.layout.cliparea.width*(1/r),1));break;case"y1_tick":case"y2_tick":var f="y"+this.parent.interaction.dragging.method[1]+"_shifted";t.event&&t.event.shiftKey?(a[f][0]=this.layout.cliparea.height+this.parent.interaction.dragging.dragged_y,a[f][1]=+this.parent.interaction.dragging.dragged_y):(o=this.layout.cliparea.height-(this.parent.interaction.dragging.start_y-this.layout.margin.top-this.layout.origin.y),r=e(o/(o-this.parent.interaction.dragging.dragged_y),3),a[f][0]=this.layout.cliparea.height,a[f][1]=this.layout.cliparea.height-this.layout.cliparea.height*(1/r))}}if(["x","y1","y2"].forEach(function(e){this[e+"_extent"]&&(this[e+"_scale"]=t.scale.linear().domain(this[e+"_extent"]).range(a[e+"_shifted"]),this[e+"_extent"]=[this[e+"_scale"].invert(a[e][0]),this[e+"_scale"].invert(a[e][1])],this[e+"_scale"]=t.scale.linear().domain(this[e+"_extent"]).range(a[e]),this.renderAxis(e))}.bind(this)),this.layout.interaction.scroll_to_zoom){var g=function(){if(!t.event.shiftKey)return void(this.parent.canInteract(this.id)&&this.loader.show("Press [SHIFT] while scrolling to zoom").hide(1e3));if(t.event.preventDefault(),this.parent.canInteract(this.id)){var e=t.mouse(this.svg.container.node()),a=Math.max(-1,Math.min(1,t.event.wheelDelta||-t.event.detail||-t.event.deltaY));0!==a&&(this.parent.interaction={panel_id:this.id,linked_panel_ids:this.getLinkedPanelIds("x"),zooming:{scale:a<1?.9:1.1,center:e[0]}},this.render(),this.parent.interaction.linked_panel_ids.forEach(function(t){this.parent.panels[t].render()}.bind(this)),null!==this.zoom_timeout&&clearTimeout(this.zoom_timeout),this.zoom_timeout=setTimeout(function(){this.parent.interaction={},this.parent.applyState({start:this.x_extent[0],end:this.x_extent[1]})}.bind(this),500))}}.bind(this);this.zoom_listener=t.behavior.zoom(),this.svg.container.call(this.zoom_listener).on("wheel.zoom",g).on("mousewheel.zoom",g).on("DOMMouseScroll.zoom",g)}return this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].draw().render()}.bind(this)),this},n.Panel.prototype.renderAxis=function(e){if(["x","y1","y2"].indexOf(e)===-1)throw"Unable to render axis; invalid axis identifier: "+e;var a=this.layout.axes[e].render&&"function"==typeof this[e+"_scale"]&&!isNaN(this[e+"_scale"](0));if(this[e+"_axis"]&&this.svg.container.select("g.lz-axis.lz-"+e).style("display",a?null:"none"),!a)return this;var i={x:{position:"translate("+this.layout.margin.left+","+(this.layout.height-this.layout.margin.bottom)+")",orientation:"bottom",label_x:this.layout.cliparea.width/2,label_y:this.layout.axes[e].label_offset||0,label_rotate:null},y1:{position:"translate("+this.layout.margin.left+","+this.layout.margin.top+")",orientation:"left",label_x:-1*(this.layout.axes[e].label_offset||0),label_y:this.layout.cliparea.height/2,label_rotate:-90},y2:{position:"translate("+(this.layout.width-this.layout.margin.right)+","+this.layout.margin.top+")",orientation:"right",label_x:this.layout.axes[e].label_offset||0,label_y:this.layout.cliparea.height/2,label_rotate:-90}};this[e+"_ticks"]=this.generateTicks(e);var s=function(t){for(var e=0;e+a[e]&&(n=!0)}),n};try{var i="3.5.6";if("object"!=typeof t)throw"d3 dependency not met. Library missing.";if(!a(i,t.version))throw"d3 dependency not met. Outdated version detected.\nRequired d3 version: "+i+" or higher (found: "+t.version+").";if("function"!=typeof e)throw"Q dependency not met. Library missing.";!function(t,e){"function"==typeof define&&define.amd?define(["d3","Q"],function(a,i){return t.LocusZoom=e(a,i)}):"object"==typeof module&&module.exports?module.exports=t.LocusZoom=e(require("d3"),require("Q")):t.LocusZoom=e(t.d3,t.Q)}(this,function(t,e){var a=function(t,e){if(e==t)return!0;var a=t.split("."),i=e.split("."),n=!1;return a.forEach(function(t,e){!n&&+i[e]>+a[e]&&(n=!0)}),n};try{var i="3.5.6";if("object"!=typeof t)throw"d3 dependency not met. Library missing.";if(!a(i,t.version))throw"d3 dependency not met. Outdated version detected.\nRequired d3 version: "+i+" or higher (found: "+t.version+").";if("function"!=typeof e)throw"Q dependency not met. Library missing.";var n={version:"0.8.0"};n.populate=function(e,a,i){if("undefined"==typeof e)throw"LocusZoom.populate selector not defined";t.select(e).html("");var s;return t.select(e).call(function(){if("undefined"==typeof this.node().id){for(var e=0;!t.select("#lz-"+e).empty();)e++;this.attr("id","#lz-"+e)}if(s=new n.Plot(this.node().id,a,i),s.container=this.node(),"undefined"!=typeof this.node().dataset&&"undefined"!=typeof this.node().dataset.region){var o=n.parsePositionQuery(this.node().dataset.region);Object.keys(o).forEach(function(t){s.state[t]=o[t]})}s.svg=t.select("div#"+s.id).append("svg").attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").attr("id",s.id+"_svg").attr("class","lz-locuszoom").style(s.layout.style),s.setDimensions(),s.positionPanels(),s.initialize(),"object"==typeof a&&Object.keys(a).length&&s.refresh()}),s},n.populateAll=function(e,a,i){var s=[];return t.selectAll(e).each(function(t,e){s[e]=n.populate(this,a,i)}),s},n.positionIntToString=function(t,e,a){var i={0:"",3:"K",6:"M",9:"G"};if(a=a||!1,isNaN(e)||null===e){var n=Math.log(t)/Math.LN10;e=Math.min(Math.max(n-n%3,0),9)}var s=e-Math.floor((Math.log(t)/Math.LN10).toFixed(e+3)),o=Math.min(Math.max(e,0),2),r=Math.min(Math.max(s,o),12),l=""+(t/Math.pow(10,e)).toFixed(r);return a&&"undefined"!=typeof i[e]&&(l+=" "+i[e]+"b"),l},n.positionStringToInt=function(t){var e=t.toUpperCase();e=e.replace(/,/g,"");var a=/([KMG])[B]*$/,i=a.exec(e),n=1;return i&&(n="M"===i[1]?1e6:"G"===i[1]?1e9:1e3,e=e.replace(a,"")),e=Number(e)*n},n.parsePositionQuery=function(t){var e=/^(\w+):([\d,.]+[kmgbKMGB]*)([-+])([\d,.]+[kmgbKMGB]*)$/,a=/^(\w+):([\d,.]+[kmgbKMGB]*)$/,i=e.exec(t);if(i){if("+"===i[3]){var s=n.positionStringToInt(i[2]),o=n.positionStringToInt(i[4]);return{chr:i[1],start:s-o,end:s+o}}return{chr:i[1],start:n.positionStringToInt(i[2]),end:n.positionStringToInt(i[4])}}return i=a.exec(t),i?{chr:i[1],position:n.positionStringToInt(i[2])}:null},n.prettyTicks=function(t,e,a){("undefined"==typeof a||isNaN(parseInt(a)))&&(a=5),a=parseInt(a);var i=a/3,n=.75,s=1.5,o=.5+1.5*s,r=Math.abs(t[0]-t[1]),l=r/a;Math.log(r)/Math.LN10<-2&&(l=Math.max(Math.abs(r))*n/i);var h=Math.pow(10,Math.floor(Math.log(l)/Math.LN10)),d=0;h<1&&0!==h&&(d=Math.abs(Math.round(Math.log(h)/Math.LN10)));var u=h;2*h-l0&&(c=parseFloat(c.toFixed(d)));return p.push(c),"undefined"!=typeof e&&["low","high","both","neither"].indexOf(e)!==-1||(e="neither"),"low"!==e&&"both"!==e||p[0]t[1]&&p.pop(),p},n.createCORSPromise=function(t,a,i,n,s){var o=e.defer(),r=new XMLHttpRequest;if("withCredentials"in r?r.open(t,a,!0):"undefined"!=typeof XDomainRequest?(r=new XDomainRequest,r.open(t,a)):r=null,r){if(r.onreadystatechange=function(){4===r.readyState&&(200===r.status||0===r.status?o.resolve(r.response):o.reject("HTTP "+r.status+" for "+a))},s&&setTimeout(o.reject,s),i="undefined"!=typeof i?i:"","undefined"!=typeof n)for(var l in n)r.setRequestHeader(l,n[l]);r.send(i)}return o.promise},n.validateState=function(t,e){t=t||{},e=e||{};var a=!1;if("undefined"!=typeof t.chr&&"undefined"!=typeof t.start&&"undefined"!=typeof t.end){var i,n=null;if(t.start=Math.max(parseInt(t.start),1),t.end=Math.max(parseInt(t.end),1),isNaN(t.start)&&isNaN(t.end))t.start=1,t.end=1,n=.5,i=0;else if(isNaN(t.start)||isNaN(t.end))n=t.start||t.end,i=0,t.start=isNaN(t.start)?t.end:t.start,t.end=isNaN(t.end)?t.start:t.end;else{if(n=Math.round((t.start+t.end)/2),i=t.end-t.start,i<0){var s=t.start;t.end=t.start,t.start=s,i=t.end-t.start}n<0&&(t.start=1,t.end=1,i=0)}a=!0}return!isNaN(e.min_region_scale)&&a&&ie.max_region_scale&&(t.start=Math.max(n-Math.floor(e.max_region_scale/2),1),t.end=t.start+e.max_region_scale),t},n.parseFields=function(t,e){if("object"!=typeof t)throw"LocusZoom.parseFields invalid arguments: data is not an object";if("string"!=typeof e)throw"LocusZoom.parseFields invalid arguments: html is not a string";for(var a=[],i=/\{\{(?:(#if )?([A-Za-z0-9_:|]+)|(\/if))\}\}/;e.length>0;){var s=i.exec(e);s?0!==s.index?(a.push({text:e.slice(0,s.index)}),e=e.slice(s.index)):"#if "===s[1]?(a.push({condition:s[2]}),e=e.slice(s[0].length)):s[2]?(a.push({variable:s[2]}),e=e.slice(s[0].length)):"/if"===s[3]?(a.push({close:"if"}),e=e.slice(s[0].length)):(console.error("Error tokenizing tooltip when remaining template is "+JSON.stringify(e)+" and previous tokens are "+JSON.stringify(a)+" and current regex match is "+JSON.stringify([s[1],s[2],s[3]])),e=e.slice(s[0].length)):(a.push({text:e}),e="")}for(var o=function(){var t=a.shift();if("undefined"!=typeof t.text||t.variable)return t;if(t.condition){for(t.then=[];a.length>0;){if("if"===a[0].close){a.shift();break}t.then.push(o())}return t}return console.error("Error making tooltip AST due to unknown token "+JSON.stringify(t)),{text:""}},r=[];a.length>0;)r.push(o());var l=function(e){return l.cache.hasOwnProperty(e)||(l.cache[e]=new n.Data.Field(e).resolve(t)),l.cache[e]};l.cache={};var h=function(t){if("undefined"!=typeof t.text)return t.text;if(t.variable){try{var e=l(t.variable);if(["string","number","boolean"].indexOf(typeof e)!==-1)return e;if(null===e)return""}catch(e){console.error("Error while processing variable "+JSON.stringify(t.variable))}return"{{"+t.variable+"}}"}if(t.condition){try{var a=l(t.condition);if(a||0===a)return t.then.map(h).join("")}catch(e){console.error("Error while processing condition "+JSON.stringify(t.variable))}return""}console.error("Error rendering tooltip due to unknown AST node "+JSON.stringify(t))};return r.map(h).join("")},n.getToolTipData=function(e){if("object"!=typeof e||"undefined"==typeof e.parentNode)throw"Invalid node object";var a=t.select(e);return a.classed("lz-data_layer-tooltip")&&"undefined"!=typeof a.data()[0]?a.data()[0]:n.getToolTipData(e.parentNode)},n.getToolTipDataLayer=function(t){var e=n.getToolTipData(t);return e.getDataLayer?e.getDataLayer():null},n.getToolTipPanel=function(t){var e=n.getToolTipDataLayer(t);return e?e.parent:null},n.getToolTipPlot=function(t){var e=n.getToolTipPanel(t);return e?e.parent:null},n.generateCurtain=function(){var e={showing:!1,selector:null,content_selector:null,hide_delay:null,show:function(e,a){return this.curtain.showing||(this.curtain.selector=t.select(this.parent_plot.svg.node().parentNode).insert("div").attr("class","lz-curtain").attr("id",this.id+".curtain"),this.curtain.content_selector=this.curtain.selector.append("div").attr("class","lz-curtain-content"),this.curtain.selector.append("div").attr("class","lz-curtain-dismiss").html("Dismiss").on("click",function(){this.curtain.hide()}.bind(this)),this.curtain.showing=!0),this.curtain.update(e,a)}.bind(this),update:function(t,e){if(!this.curtain.showing)return this.curtain;clearTimeout(this.curtain.hide_delay),"object"==typeof e&&this.curtain.selector.style(e);var a=this.getPageOrigin();return this.curtain.selector.style({top:a.y+"px",left:a.x+"px",width:this.layout.width+"px",height:this.layout.height+"px"}),this.curtain.content_selector.style({"max-width":this.layout.width-40+"px","max-height":this.layout.height-40+"px"}),"string"==typeof t&&this.curtain.content_selector.html(t),this.curtain}.bind(this),hide:function(t){return this.curtain.showing?"number"==typeof t?(clearTimeout(this.curtain.hide_delay),this.curtain.hide_delay=setTimeout(this.curtain.hide,t),this.curtain):(this.curtain.selector.remove(),this.curtain.selector=null,this.curtain.content_selector=null,this.curtain.showing=!1,this.curtain):this.curtain}.bind(this)};return e},n.generateLoader=function(){var e={showing:!1,selector:null,content_selector:null,progress_selector:null,cancel_selector:null,show:function(e){return this.loader.showing||(this.loader.selector=t.select(this.parent_plot.svg.node().parentNode).insert("div").attr("class","lz-loader").attr("id",this.id+".loader"),this.loader.content_selector=this.loader.selector.append("div").attr("class","lz-loader-content"),this.loader.progress_selector=this.loader.selector.append("div").attr("class","lz-loader-progress-container").append("div").attr("class","lz-loader-progress"),this.loader.showing=!0,"undefined"==typeof e&&(e="Loading...")),this.loader.update(e)}.bind(this),update:function(t,e){if(!this.loader.showing)return this.loader;clearTimeout(this.loader.hide_delay),"string"==typeof t&&this.loader.content_selector.html(t);var a=6,i=this.getPageOrigin(),n=this.loader.selector.node().getBoundingClientRect();return this.loader.selector.style({top:i.y+this.layout.height-n.height-a+"px",left:i.x+a+"px"}),"number"==typeof e&&this.loader.progress_selector.style({width:Math.min(Math.max(e,1),100)+"%"}),this.loader}.bind(this),animate:function(){return this.loader.progress_selector.classed("lz-loader-progress-animated",!0),this.loader}.bind(this),setPercentCompleted:function(t){return this.loader.progress_selector.classed("lz-loader-progress-animated",!1),this.loader.update(null,t)}.bind(this),hide:function(t){return this.loader.showing?"number"==typeof t?(clearTimeout(this.loader.hide_delay),this.loader.hide_delay=setTimeout(this.loader.hide,t),this.loader):(this.loader.selector.remove(),this.loader.selector=null,this.loader.content_selector=null,this.loader.progress_selector=null,this.loader.cancel_selector=null,this.loader.showing=!1,this.loader):this.loader}.bind(this)};return e},n.subclass=function(t,e){if("function"!=typeof t)throw"Parent must be a callable constructor";e=e||{};var a=e.hasOwnProperty("constructor")?e.constructor:function(){t.apply(this,arguments)};return a.prototype=Object.create(t.prototype),Object.keys(e).forEach(function(t){a.prototype[t]=e[t]}),a},n.ext={},n.Layouts=function(){var t={},e={plot:{},panel:{},data_layer:{},dashboard:{},tooltip:{}};return t.get=function(t,a,i){if("string"!=typeof t||"string"!=typeof a)throw"invalid arguments passed to LocusZoom.Layouts.get, requires string (layout type) and string (layout name)";if(e[t][a]){var s=n.Layouts.merge(i||{},e[t][a]);if(s.unnamespaced)return delete s.unnamespaced,JSON.parse(JSON.stringify(s));var o="";"string"==typeof s.namespace?o=s.namespace:"object"==typeof s.namespace&&Object.keys(s.namespace).length&&(o="undefined"!=typeof s.namespace.default?s.namespace.default:s.namespace[Object.keys(s.namespace)[0]].toString()),o+=o.length?":":"";var r=function(t,e){if(e?"string"==typeof e&&(e={default:e}):e={default:""},"string"==typeof t){for(var a,i,s,l,h=/\{\{namespace(\[[A-Za-z_0-9]+\]|)\}\}/g,d=[];null!==(a=h.exec(t));)i=a[0],s=a[1].length?a[1].replace(/(\[|\])/g,""):null,l=o,null!=e&&"object"==typeof e&&"undefined"!=typeof e[s]&&(l=e[s]+(e[s].length?":":"")),d.push({base:i,namespace:l});for(var u in d)t=t.replace(d[u].base,d[u].namespace)}else if("object"==typeof t&&null!=t){if("undefined"!=typeof t.namespace){var p="string"==typeof t.namespace?{default:t.namespace}:t.namespace;e=n.Layouts.merge(e,p)}var c,y;for(var f in t)"namespace"!==f&&(c=r(t[f],e),y=r(f,e),f!==y&&delete t[f],t[y]=c)}return t};return s=r(s,s.namespace),JSON.parse(JSON.stringify(s))}throw"layout type ["+t+"] name ["+a+"] not found"},t.set=function(t,a,i){if("string"!=typeof t||"string"!=typeof a||"object"!=typeof i)throw"unable to set new layout; bad arguments passed to set()";return e[t]||(e[t]={}),i?e[t][a]=JSON.parse(JSON.stringify(i)):(delete e[t][a],null)},t.add=function(e,a,i){return t.set(e,a,i)},t.list=function(t){if(e[t])return Object.keys(e[t]);var a={};return Object.keys(e).forEach(function(t){a[t]=Object.keys(e[t])}),a},t.merge=function(t,e){if("object"!=typeof t||"object"!=typeof e)throw"LocusZoom.Layouts.merge only accepts two layout objects; "+typeof t+", "+typeof e+" given";for(var a in e)if(e.hasOwnProperty(a)){var i=null===t[a]?"undefined":typeof t[a],s=typeof e[a];if("object"===i&&Array.isArray(t[a])&&(i="array"),"object"===s&&Array.isArray(e[a])&&(s="array"),"function"===i||"function"===s)throw"LocusZoom.Layouts.merge encountered an unsupported property type";"undefined"!==i?"object"!==i||"object"!==s||(t[a]=n.Layouts.merge(t[a],e[a])):t[a]=JSON.parse(JSON.stringify(e[a]))}return t},t}(),n.Layouts.add("tooltip","standard_association",{namespace:{assoc:"assoc"},closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:'{{{{namespace[assoc]}}variant}}
      P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
      Ref. Allele: {{{{namespace[assoc]}}ref_allele}}
      Make LD Reference
      '});var s=n.Layouts.get("tooltip","standard_association",{unnamespaced:!0});s.html+='Condition on Variant
      ',n.Layouts.add("tooltip","covariates_model_association",s),n.Layouts.add("tooltip","standard_genes",{closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:'

      {{gene_name}}

      Gene ID: {{gene_id}}
      Transcript ID: {{transcript_id}}
      ConstraintExpected variantsObserved variantsConst. Metric
      Synonymous{{exp_syn}}{{n_syn}}z = {{syn_z}}
      Missense{{exp_mis}}{{n_mis}}z = {{mis_z}}
      LoF{{exp_lof}}{{n_lof}}pLI = {{pLI}}
      More data on ExAC'}),n.Layouts.add("tooltip","standard_intervals",{namespace:{intervals:"intervals"},closable:!1,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:"{{{{namespace[intervals]}}state_name}}
      {{{{namespace[intervals]}}start}}-{{{{namespace[intervals]}}end}}"}),n.Layouts.add("data_layer","significance",{id:"significance",type:"orthogonal_line",orientation:"horizontal",offset:4.522}),n.Layouts.add("data_layer","recomb_rate",{namespace:{recomb:"recomb"},id:"recombrate",type:"line",fields:["{{namespace[recomb]}}position","{{namespace[recomb]}}recomb_rate"],z_index:1,style:{stroke:"#0000FF","stroke-width":"1.5px"},x_axis:{field:"{{namespace[recomb]}}position"},y_axis:{axis:2,field:"{{namespace[recomb]}}recomb_rate",floor:0,ceiling:100}}),n.Layouts.add("data_layer","association_pvalues",{namespace:{assoc:"assoc",ld:"ld"},id:"associationpvalues",type:"scatter",point_shape:{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:"diamond",else:"circle"}},point_size:{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:80,else:40}},color:[{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:"#9632b8"}},{scale_function:"numerical_bin",field:"{{namespace[ld]}}state",parameters:{breaks:[0,.2,.4,.6,.8],values:["#357ebd","#46b8da","#5cb85c","#eea236","#d43f3a"]}},"#B8B8B8"],legend:[{shape:"diamond",color:"#9632b8",size:40,label:"LD Ref Var",class:"lz-data_layer-scatter"},{shape:"circle",color:"#d43f3a",size:40,label:"1.0 > r² ≥ 0.8",class:"lz-data_layer-scatter"},{shape:"circle",color:"#eea236",size:40,label:"0.8 > r² ≥ 0.6",class:"lz-data_layer-scatter"},{shape:"circle",color:"#5cb85c",size:40,label:"0.6 > r² ≥ 0.4",class:"lz-data_layer-scatter"},{shape:"circle",color:"#46b8da",size:40,label:"0.4 > r² ≥ 0.2",class:"lz-data_layer-scatter"},{shape:"circle",color:"#357ebd",size:40,label:"0.2 > r² ≥ 0.0",class:"lz-data_layer-scatter"},{shape:"circle",color:"#B8B8B8",size:40,label:"no r² data",class:"lz-data_layer-scatter"}],fields:["{{namespace[assoc]}}variant","{{namespace[assoc]}}position","{{namespace[assoc]}}log_pvalue","{{namespace[assoc]}}log_pvalue|logtoscinotation","{{namespace[assoc]}}ref_allele","{{namespace[ld]}}state","{{namespace[ld]}}isrefvar"],id_field:"{{namespace[assoc]}}variant",z_index:2,x_axis:{field:"{{namespace[assoc]}}position"},y_axis:{axis:1,field:"{{namespace[assoc]}}log_pvalue",floor:0,upper_buffer:.1,min_extent:[0,10]},behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_association",{unnamespaced:!0})}),n.Layouts.add("data_layer","phewas_pvalues",{namespace:{phewas:"phewas"},id:"phewaspvalues",type:"category_scatter",point_shape:"circle",point_size:70,tooltip_positioning:"vertical",id_field:"{{namespace[phewas]}}id",fields:["{{namespace[phewas]}}id","{{namespace[phewas]}}log_pvalue","{{namespace[phewas]}}trait_group","{{namespace[phewas]}}trait_label"],x_axis:{field:"{{namespace[phewas]}}x",category_field:"{{namespace[phewas]}}trait_group",lower_buffer:.025,upper_buffer:.025},y_axis:{axis:1,field:"{{namespace[phewas]}}log_pvalue",floor:0,upper_buffer:.15},color:{field:"{{namespace[phewas]}}trait_group",scale_function:"categorical_bin",parameters:{categories:[],values:[],null_value:"#B8B8B8"}},fill_opacity:.7,tooltip:{closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:["Trait: {{{{namespace[phewas]}}trait_label|htmlescape}}
      ","Trait Category: {{{{namespace[phewas]}}trait_group|htmlescape}}
      ","P-value: {{{{namespace[phewas]}}log_pvalue|logtoscinotation|htmlescape}}
      "].join("")},behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},label:{text:"{{{{namespace[phewas]}}trait_label}}",spacing:6,lines:{style:{"stroke-width":"2px",stroke:"#333333","stroke-dasharray":"2px 2px"}},filters:[{field:"{{namespace[phewas]}}log_pvalue",operator:">=",value:20}],style:{"font-size":"14px","font-weight":"bold",fill:"#333333"}}}),n.Layouts.add("data_layer","genes",{namespace:{gene:"gene",constraint:"constraint"},id:"genes",type:"genes",fields:["{{namespace[gene]}}all","{{namespace[constraint]}}all"],id_field:"gene_id",behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_genes",{unnamespaced:!0})}),n.Layouts.add("data_layer","genome_legend",{namespace:{genome:"genome"},id:"genome_legend",type:"genome_legend",fields:["{{namespace[genome]}}chr","{{namespace[genome]}}base_pairs"],x_axis:{floor:0,ceiling:2881033286}}),n.Layouts.add("data_layer","intervals",{namespace:{intervals:"intervals"},id:"intervals",type:"intervals",fields:["{{namespace[intervals]}}start","{{namespace[intervals]}}end","{{namespace[intervals]}}state_id","{{namespace[intervals]}}state_name"],id_field:"{{namespace[intervals]}}start",start_field:"{{namespace[intervals]}}start",end_field:"{{namespace[intervals]}}end",track_split_field:"{{namespace[intervals]}}state_id",split_tracks:!0,always_hide_legend:!1,color:{field:"{{namespace[intervals]}}state_id",scale_function:"categorical_bin",parameters:{categories:[1,2,3,4,5,6,7,8,9,10,11,12,13],values:["rgb(212,63,58)","rgb(250,120,105)","rgb(252,168,139)","rgb(240,189,66)","rgb(250,224,105)","rgb(240,238,84)","rgb(244,252,23)","rgb(23,232,252)","rgb(32,191,17)","rgb(23,166,77)","rgb(32,191,17)","rgb(162,133,166)","rgb(212,212,212)"],null_value:"#B8B8B8"}},legend:[{shape:"rect",color:"rgb(212,63,58)",width:9,label:"Active Promoter","{{namespace[intervals]}}state_id":1},{shape:"rect",color:"rgb(250,120,105)",width:9,label:"Weak Promoter","{{namespace[intervals]}}state_id":2},{shape:"rect",color:"rgb(252,168,139)",width:9,label:"Poised Promoter","{{namespace[intervals]}}state_id":3},{shape:"rect",color:"rgb(240,189,66)",width:9,label:"Strong enhancer","{{namespace[intervals]}}state_id":4},{shape:"rect",color:"rgb(250,224,105)",width:9,label:"Strong enhancer","{{namespace[intervals]}}state_id":5},{shape:"rect",color:"rgb(240,238,84)",width:9,label:"Weak enhancer","{{namespace[intervals]}}state_id":6},{shape:"rect",color:"rgb(244,252,23)",width:9,label:"Weak enhancer","{{namespace[intervals]}}state_id":7},{shape:"rect",color:"rgb(23,232,252)",width:9,label:"Insulator","{{namespace[intervals]}}state_id":8},{shape:"rect",color:"rgb(32,191,17)",width:9,label:"Transcriptional transition","{{namespace[intervals]}}state_id":9},{shape:"rect",color:"rgb(23,166,77)",width:9,label:"Transcriptional elongation","{{namespace[intervals]}}state_id":10},{shape:"rect",color:"rgb(136,240,129)",width:9,label:"Weak transcribed","{{namespace[intervals]}}state_id":11},{shape:"rect",color:"rgb(162,133,166)",width:9,label:"Polycomb-repressed","{{namespace[intervals]}}state_id":12},{shape:"rect",color:"rgb(212,212,212)",width:9,label:"Heterochromatin / low signal","{{namespace[intervals]}}state_id":13}],behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_intervals",{unnamespaced:!0})}),n.Layouts.add("dashboard","standard_panel",{components:[{type:"remove_panel",position:"right",color:"red",group_position:"end"},{type:"move_panel_up",position:"right",group_position:"middle"},{type:"move_panel_down",position:"right",group_position:"start",style:{"margin-left":"0.75em"}}]}),n.Layouts.add("dashboard","standard_plot",{components:[{type:"title",title:"LocusZoom",subtitle:'v'+n.version+"",position:"left"},{type:"dimensions",position:"right"},{type:"region_scale",position:"right"},{type:"download",position:"right"}]});var o=n.Layouts.get("dashboard","standard_plot");o.components.push({type:"covariates_model",button_html:"Model",button_title:"Show and edit covariates currently in model",position:"left"}),n.Layouts.add("dashboard","covariates_model_plot",o);var r=n.Layouts.get("dashboard","standard_plot");r.components.push({type:"shift_region",step:5e5,button_html:">>",position:"right",group_position:"end"}),r.components.push({type:"shift_region",step:5e4,button_html:">",position:"right",group_position:"middle"}),r.components.push({type:"zoom_region",step:.2,position:"right",group_position:"middle"}),r.components.push({type:"zoom_region",step:-.2,position:"right",group_position:"middle"}),r.components.push({type:"shift_region",step:-5e4,button_html:"<",position:"right",group_position:"middle"}),r.components.push({type:"shift_region",step:-5e5,button_html:"<<",position:"right",group_position:"start"}),n.Layouts.add("dashboard","region_nav_plot",r),n.Layouts.add("panel","association",{id:"association",width:800,height:225,min_width:400,min_height:200,proportional_width:1,margin:{top:35,right:50,bottom:40,left:50},inner_border:"rgb(210, 210, 210)",dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"toggle_legend",position:"right"}),t}(),axes:{x:{label:"Chromosome {{chr}} (Mb)",label_offset:32,tick_format:"region",extent:"state"},y1:{label:"-log10 p-value",label_offset:28},y2:{label:"Recombination Rate (cM/Mb)",label_offset:40}},legend:{orientation:"vertical",origin:{x:55,y:40},hidden:!0},interaction:{drag_background_to_pan:!0,drag_x_ticks_to_scale:!0,drag_y1_ticks_to_scale:!0,drag_y2_ticks_to_scale:!0,scroll_to_zoom:!0,x_linked:!0},data_layers:[n.Layouts.get("data_layer","significance",{unnamespaced:!0}),n.Layouts.get("data_layer","recomb_rate",{unnamespaced:!0}),n.Layouts.get("data_layer","association_pvalues",{unnamespaced:!0})]}),n.Layouts.add("panel","genes",{id:"genes",width:800,height:225,min_width:400,min_height:112.5,proportional_width:1,margin:{top:20,right:50,bottom:20,left:50},axes:{},interaction:{drag_background_to_pan:!0,scroll_to_zoom:!0,x_linked:!0},dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"resize_to_data",position:"right"}),t}(),data_layers:[n.Layouts.get("data_layer","genes",{unnamespaced:!0})]}),n.Layouts.add("panel","phewas",{id:"phewas",width:800,height:300,min_width:800,min_height:300,proportional_width:1,margin:{top:20,right:50,bottom:120,left:50},inner_border:"rgb(210, 210, 210)",axes:{x:{ticks:{style:{"font-weight":"bold","font-size":"11px","text-anchor":"start"},transform:"rotate(50)",position:"left"}},y1:{label:"-log10 p-value",label_offset:28}},data_layers:[n.Layouts.get("data_layer","significance",{unnamespaced:!0}),n.Layouts.get("data_layer","phewas_pvalues",{unnamespaced:!0})]}),n.Layouts.add("panel","genome_legend",{id:"genome_legend",width:800,height:50,origin:{x:0,y:300},min_width:800,min_height:50,proportional_width:1,margin:{top:0,right:50,bottom:35,left:50},axes:{x:{label:"Genomic Position (number denotes chromosome)",label_offset:35,ticks:[{x:124625310,text:"1",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:370850307,text:"2",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:591461209,text:"3",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:786049562,text:"4",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:972084330,text:"5",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1148099493,text:"6",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1313226358,text:"7",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1465977701,text:"8",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1609766427,text:"9",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1748140516,text:"10",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1883411148,text:"11",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2017840353,text:"12",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2142351240,text:"13",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2253610949,text:"14",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2358551415,text:"15",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2454994487,text:"16",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2540769469,text:"17",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2620405698,text:"18",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2689008813,text:"19",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2750086065,text:"20",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2805663772,text:"21",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2855381003,text:"22",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"}]}},data_layers:[n.Layouts.get("data_layer","genome_legend",{unnamespaced:!0})]}),n.Layouts.add("panel","intervals",{id:"intervals",width:1e3,height:50,min_width:500,min_height:50,margin:{top:25,right:150,bottom:5,left:50},dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"toggle_split_tracks",data_layer_id:"intervals",position:"right"}),t}(),axes:{},interaction:{drag_background_to_pan:!0,scroll_to_zoom:!0,x_linked:!0},legend:{hidden:!0,orientation:"horizontal",origin:{x:50,y:0},pad_from_bottom:5},data_layers:[n.Layouts.get("data_layer","intervals",{unnamespaced:!0})]}),n.Layouts.add("plot","standard_association",{state:{},width:800,height:450,responsive_resize:!0,min_region_scale:2e4,max_region_scale:1e6,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","association",{unnamespaced:!0,proportional_height:.5}),n.Layouts.get("panel","genes",{unnamespaced:!0,proportional_height:.5})]}),n.StandardLayout=n.Layouts.get("plot","standard_association"),n.Layouts.add("plot","standard_phewas",{width:800,height:600,min_width:800,min_height:600,responsive_resize:!0,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","phewas",{unnamespaced:!0,proportional_height:.45}),n.Layouts.get("panel","genome_legend",{unnamespaced:!0,proportional_height:.1}),n.Layouts.get("panel","genes",{unnamespaced:!0,proportional_height:.45,margin:{bottom:40},axes:{x:{label:"Chromosome {{chr}} (Mb)",label_offset:32,tick_format:"region",extent:"state"}}})],mouse_guide:!1}),n.Layouts.add("plot","interval_association",{state:{},width:800,height:550,responsive_resize:!0,min_region_scale:2e4,max_region_scale:1e6,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","association",{unnamespaced:!0,width:800,proportional_height:225/570}),n.Layouts.get("panel","intervals",{ +unnamespaced:!0,proportional_height:120/570}),n.Layouts.get("panel","genes",{unnamespaced:!0,width:800,proportional_height:225/570})]}),n.DataLayer=function(t,e){return this.initialized=!1,this.layout_idx=null,this.id=null,this.parent=e||null,this.svg={},this.parent_plot=null,"undefined"!=typeof e&&e instanceof n.Panel&&(this.parent_plot=e.parent),this.layout=n.Layouts.merge(t||{},n.DataLayer.DefaultLayout),this.layout.id&&(this.id=this.layout.id),this.layout.x_axis!=={}&&"number"!=typeof this.layout.x_axis.axis&&(this.layout.x_axis.axis=1),this.layout.y_axis!=={}&&"number"!=typeof this.layout.y_axis.axis&&(this.layout.y_axis.axis=1),this._base_layout=JSON.parse(JSON.stringify(this.layout)),this.state={},this.state_id=null,this.setDefaultState(),this.data=[],this.layout.tooltip&&(this.tooltips={}),this.global_statuses={highlighted:!1,selected:!1,faded:!1,hidden:!1},this},n.DataLayer.prototype.addField=function(t,e,a){if(!t||!e)throw"Must specify field name and namespace to use when adding field";var i=e+":"+t;if(a)if(i+="|","string"==typeof a)i+=a;else{if(!Array.isArray(a))throw"Must provide transformations as either a string or array of strings";i+=a.join("|")}var n=this.layout.fields;return n.indexOf(i)===-1&&n.push(i),i},n.DataLayer.prototype.setDefaultState=function(){this.parent&&(this.state=this.parent.state,this.state_id=this.parent.id+"."+this.id,this.state[this.state_id]=this.state[this.state_id]||{},n.DataLayer.Statuses.adjectives.forEach(function(t){this.state[this.state_id][t]=this.state[this.state_id][t]||[]}.bind(this)))},n.DataLayer.DefaultLayout={type:"",fields:[],x_axis:{},y_axis:{}},n.DataLayer.Statuses={verbs:["highlight","select","fade","hide"],adjectives:["highlighted","selected","faded","hidden"],menu_antiverbs:["unhighlight","deselect","unfade","show"]},n.DataLayer.prototype.getBaseId=function(){return this.parent_plot.id+"."+this.parent.id+"."+this.id},n.DataLayer.prototype.getAbsoluteDataHeight=function(){var t=this.svg.group.node().getBoundingClientRect();return t.height},n.DataLayer.prototype.canTransition=function(){return!!this.layout.transition&&!(this.parent_plot.panel_boundaries.dragging||this.parent_plot.interaction.panel_id)},n.DataLayer.prototype.getElementId=function(t){var e="element";if("string"==typeof t)e=t;else if("object"==typeof t){var a=this.layout.id_field||"id";if("undefined"==typeof t[a])throw"Unable to generate element ID";e=t[a].toString().replace(/\W/g,"")}return(this.getBaseId()+"-"+e).replace(/(:|\.|\[|\]|,)/g,"_")},n.DataLayer.prototype.getElementStatusNodeId=function(t){return null},n.DataLayer.prototype.getElementById=function(e){var a=t.select("#"+e.replace(/(:|\.|\[|\]|,)/g,"\\$1"));return!a.empty()&&a.data()&&a.data().length?a.data()[0]:null},n.DataLayer.prototype.applyDataMethods=function(){return this.data.forEach(function(t,e){this.data[e].toHTML=function(){var t=this.layout.id_field||"id",a="";return this.data[e][t]&&(a=this.data[e][t].toString()),a}.bind(this),this.data[e].getDataLayer=function(){return this}.bind(this),this.data[e].deselect=function(){var t=this.getDataLayer();t.unselectElement(this)}}.bind(this)),this.applyCustomDataMethods(),this},n.DataLayer.prototype.applyCustomDataMethods=function(){return this},n.DataLayer.prototype.initialize=function(){return this.svg.container=this.parent.svg.group.append("g").attr("class","lz-data_layer-container").attr("id",this.getBaseId()+".data_layer_container"),this.svg.clipRect=this.svg.container.append("clipPath").attr("id",this.getBaseId()+".clip").append("rect"),this.svg.group=this.svg.container.append("g").attr("id",this.getBaseId()+".data_layer").attr("clip-path","url(#"+this.getBaseId()+".clip)"),this},n.DataLayer.prototype.moveUp=function(){return this.parent.data_layer_ids_by_z_index[this.layout.z_index+1]&&(this.parent.data_layer_ids_by_z_index[this.layout.z_index]=this.parent.data_layer_ids_by_z_index[this.layout.z_index+1],this.parent.data_layer_ids_by_z_index[this.layout.z_index+1]=this.id,this.parent.resortDataLayers()),this},n.DataLayer.prototype.moveDown=function(){return this.parent.data_layer_ids_by_z_index[this.layout.z_index-1]&&(this.parent.data_layer_ids_by_z_index[this.layout.z_index]=this.parent.data_layer_ids_by_z_index[this.layout.z_index-1],this.parent.data_layer_ids_by_z_index[this.layout.z_index-1]=this.id,this.parent.resortDataLayers()),this},n.DataLayer.prototype.resolveScalableParameter=function(t,e){var a=null;if(Array.isArray(t))for(var i=0;null===a&&i":function(t,e){return t>e},">=":function(t,e){return t>=e},"%":function(t,e){return t%e}};return!!Array.isArray(e)&&(2===e.length?t[e[0]]===e[1]:!(3!==e.length||!a[e[1]])&&a[e[1]](t[e[0]],e[2]))},i=[];return this.data.forEach(function(n,s){var o=!0;t.forEach(function(t){a(n,t)||(o=!1)}),o&&i.push("indexes"===e?s:n)}),i},n.DataLayer.prototype.filterIndexes=function(t){return this.filter(t,"indexes")},n.DataLayer.prototype.filterElements=function(t){return this.filter(t,"elements")},n.DataLayer.Statuses.verbs.forEach(function(t,e){var a=n.DataLayer.Statuses.adjectives[e],i="un"+t;n.DataLayer.prototype[t+"Element"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatus(a,t,!0,e),this},n.DataLayer.prototype[i+"Element"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatus(a,t,!1,e),this},n.DataLayer.prototype[t+"ElementsByFilters"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatusByFilters(a,!0,t,e)},n.DataLayer.prototype[i+"ElementsByFilters"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatusByFilters(a,!1,t,e)},n.DataLayer.prototype[t+"AllElements"]=function(){return this.setAllElementStatus(a,!0),this},n.DataLayer.prototype[i+"AllElements"]=function(){return this.setAllElementStatus(a,!1),this}}),n.DataLayer.prototype.setElementStatus=function(e,a,i,s){if("undefined"==typeof e||n.DataLayer.Statuses.adjectives.indexOf(e)===-1)throw"Invalid status passed to DataLayer.setElementStatus()";if("undefined"==typeof a)throw"Invalid element passed to DataLayer.setElementStatus()";"undefined"==typeof i&&(i=!0);try{var o=this.getElementId(a)}catch(t){return this}s&&this.setAllElementStatus(e,!i),t.select("#"+o).classed("lz-data_layer-"+this.layout.type+"-"+e,i);var r=this.getElementStatusNodeId(a);null!==r&&t.select("#"+r).classed("lz-data_layer-"+this.layout.type+"-statusnode-"+e,i);var l=this.state[this.state_id][e].indexOf(o);return i&&l===-1&&this.state[this.state_id][e].push(o),i||l===-1||this.state[this.state_id][e].splice(l,1),this.showOrHideTooltip(a),this.parent.emit("layout_changed",!0),"selected"===e&&this.parent.emit("element_selection",{element:a,active:i},!0),this},n.DataLayer.prototype.setElementStatusByFilters=function(t,e,a,i){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setElementStatusByFilters()";return"undefined"==typeof this.state[this.state_id][t]?this:(e="undefined"==typeof e||!!e,i="undefined"!=typeof i&&!!i,Array.isArray(a)||(a=[]),i&&this.setAllElementStatus(t,!e),this.filterElements(a).forEach(function(a){this.setElementStatus(t,a,e)}.bind(this)),this)},n.DataLayer.prototype.setAllElementStatus=function(t,e){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setAllElementStatus()";if("undefined"==typeof this.state[this.state_id][t])return this;if("undefined"==typeof e&&(e=!0),e)this.data.forEach(function(e){this.setElementStatus(t,e,!0)}.bind(this));else{var a=this.state[this.state_id][t].slice();a.forEach(function(e){var a=this.getElementById(e);"object"==typeof a&&null!==a&&this.setElementStatus(t,a,!1)}.bind(this)),this.state[this.state_id][t]=[]}return this.global_statuses[t]=e,this},n.DataLayer.prototype.applyBehaviors=function(t){"object"==typeof this.layout.behaviors&&Object.keys(this.layout.behaviors).forEach(function(e){var a=/(click|mouseover|mouseout)/.exec(e);a&&t.on(a[0]+"."+e,this.executeBehaviors(e,this.layout.behaviors[e]))}.bind(this))},n.DataLayer.prototype.executeBehaviors=function(e,a){var i={ctrl:e.indexOf("ctrl")!==-1,shift:e.indexOf("shift")!==-1};return function(e){i.ctrl===!!t.event.ctrlKey&&i.shift===!!t.event.shiftKey&&a.forEach(function(t){if("object"==typeof t&&null!==t)switch(t.action){case"set":this.setElementStatus(t.status,e,!0,t.exclusive);break;case"unset":this.setElementStatus(t.status,e,!1,t.exclusive);break;case"toggle":var a=this.state[this.state_id][t.status].indexOf(this.getElementId(e))!==-1,i=t.exclusive&&!a;this.setElementStatus(t.status,e,!a,i);break;case"link":if("string"==typeof t.href){var s=n.parseFields(e,t.href);"string"==typeof t.target?window.open(s,t.target):window.location.href=s}}}.bind(this))}.bind(this)},n.DataLayer.prototype.getPageOrigin=function(){var t=this.parent.getPageOrigin();return{x:t.x+this.parent.layout.margin.left,y:t.y+this.parent.layout.margin.top}},n.DataLayer.prototype.exportData=function(t){var e="json";t=t||e,t="string"==typeof t?t.toLowerCase():e,["json","csv","tsv"].indexOf(t)===-1&&(t=e);var a;switch(t){case"json":try{a=JSON.stringify(this.data)}catch(t){a=null,console.error("Unable to export JSON data from data layer: "+this.getBaseId()+";",t)}break;case"tsv":case"csv":try{var i=JSON.parse(JSON.stringify(this.data));if("object"!=typeof i)a=i.toString();else if(Array.isArray(i)){var n="tsv"===t?"\t":",",s=this.layout.fields.map(function(t){return JSON.stringify(t)}).join(n)+"\n";a=s+i.map(function(t){return this.layout.fields.map(function(e){return"undefined"==typeof t[e]?JSON.stringify(null):"object"==typeof t[e]&&null!==t[e]?Array.isArray(t[e])?'"[Array('+t[e].length+')]"':'"[Object]"':JSON.stringify(t[e])}).join(n)}.bind(this)).join("\n")}else a="Object"}catch(t){a=null,console.error("Unable to export CSV data from data layer: "+this.getBaseId()+";",t)}}return a},n.DataLayer.prototype.draw=function(){return this.svg.container.attr("transform","translate("+this.parent.layout.cliparea.origin.x+","+this.parent.layout.cliparea.origin.y+")"),this.svg.clipRect.attr("width",this.parent.layout.cliparea.width).attr("height",this.parent.layout.cliparea.height),this.positionAllTooltips(),this},n.DataLayer.prototype.reMap=function(){this.destroyAllTooltips();var t=this.parent_plot.lzd.getData(this.state,this.layout.fields);return t.then(function(t){this.data=t.body,this.applyDataMethods(),this.initialized=!0}.bind(this)),t},n.DataLayers=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t]){if("object"!=typeof a)throw"invalid layout argument for data layer ["+t+"]";return new e[t](a,i)}throw"data layer ["+t+"] not found"}return null},t.set=function(t,a){if(a){if("function"!=typeof a)throw"unable to set data layer ["+t+"], argument provided is not a function";e[t]=a,e[t].prototype=new n.DataLayer}else delete e[t]},t.add=function(a,i){if(e[a])throw"data layer already exists with name: "+a;t.set(a,i)},t.extend=function(t,a,i){i=i||{};var s=e[t];if(!s)throw"Attempted to subclass an unknown or unregistered datalayer type";if("object"!=typeof i)throw"Must specify an object of properties and methods";var o=n.subclass(s,i);return e[a]=o,o},t.list=function(){return Object.keys(e)},t}(),n.DataLayers.add("annotation_track",function(t){if(this.DefaultLayout={color:"#000000",filters:[]},t=n.Layouts.merge(t,this.DefaultLayout),!Array.isArray(t.filters))throw"Annotation track must specify array of filters for selecting points to annotate";return n.DataLayer.apply(this,arguments),this.render=function(){var t=this,e=this.filter(this.layout.filters,"elements"),a=this.svg.group.selectAll("rect.lz-data_layer-"+t.layout.type).data(e,function(e){return e[t.layout.id_field]});a.enter().append("rect").attr("class","lz-data_layer-"+this.layout.type).attr("id",function(e){return t.getElementId(e)}),a.attr("x",function(e){return t.parent.x_scale(e[t.layout.x_axis.field])}).attr("width",1).attr("height",t.parent.layout.height).attr("fill",function(e){return t.resolveScalableParameter(t.layout.color,e)}),a.exit().remove(),this.applyBehaviors(a)},this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=7,l=1,h=l/2,d=this.getPageOrigin(),u=o.selector.node().getBoundingClientRect(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=this.parent.x_scale(o.data[this.layout.x_axis.field]),f=p/2,g=Math.max(u.width/2-y,0),_=Math.max(u.width/2+y-c,0);a=d.x+y-u.width/2-_+g,s=u.width/2-r+_-g-h,u.height+l+r>p-f?(e=d.y+f-(u.height+l+r),i="down",n=u.height-l):(e=d.y+f+l+r,i="up",n=0-l-r),o.selector.style("left",a+"px").style("top",e+"px"),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",s+"px").style("top",n+"px")},this}),n.DataLayers.add("forest",function(e){return this.DefaultLayout={point_size:40,point_shape:"square",color:"#888888",fill_opacity:1,y_axis:{axis:2},id_field:"id",confidence_intervals:{start_field:"ci_start",end_field:"ci_end"},show_no_significance_line:!0},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n=this.tooltips[t],s=this.resolveScalableParameter(this.layout.point_size,n.data),o=7,r=1,l=6,h=this.getPageOrigin(),d=this.parent.x_scale(n.data[this.layout.x_axis.field]),u="y"+this.layout.y_axis.axis+"_scale",p=this.parent[u](n.data[this.layout.y_axis.field]),c=n.selector.node().getBoundingClientRect(),y=Math.sqrt(s/Math.PI);d<=this.parent.layout.width/2?(e=h.x+d+y+o+r,a="left",i=-1*(o+r)):(e=h.x+d-c.width-y-o-r,a="right",i=c.width-r);var f,g,_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom);p-c.height/2<=0?(f=h.y+p-1.5*o-l,g=l):p+c.height/2>=_?(f=h.y+p+o+l-c.height,g=c.height-2*o-l):(f=h.y+p-c.height/2,g=c.height/2-o),n.selector.style("left",e+"px").style("top",f+"px"),n.arrow||(n.arrow=n.selector.append("div").style("position","absolute")),n.arrow.attr("class","lz-data_layer-tooltip-arrow_"+a).style("left",i+"px").style("top",g+"px")},this.render=function(){var e="x_scale",a="y"+this.layout.y_axis.axis+"_scale";if(this.layout.confidence_intervals&&this.layout.fields.indexOf(this.layout.confidence_intervals.start_field)!==-1&&this.layout.fields.indexOf(this.layout.confidence_intervals.end_field)!==-1){var i=this.svg.group.selectAll("rect.lz-data_layer-forest.lz-data_layer-forest-ci").data(this.data,function(t){return t[this.layout.id_field]}.bind(this));i.enter().append("rect").attr("class","lz-data_layer-forest lz-data_layer-forest-ci").attr("id",function(t){return this.getElementId(t)+"_ci"}.bind(this)).attr("transform","translate(0,"+(isNaN(this.parent.layout.height)?0:this.parent.layout.height)+")");var n=function(t){var i=this.parent[e](t[this.layout.confidence_intervals.start_field]),n=this.parent[a](t[this.layout.y_axis.field]);return isNaN(i)&&(i=-1e3),isNaN(n)&&(n=-1e3),"translate("+i+","+n+")"}.bind(this),s=function(t){return this.parent[e](t[this.layout.confidence_intervals.end_field])-this.parent[e](t[this.layout.confidence_intervals.start_field])}.bind(this),o=1;this.canTransition()?i.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",n).attr("width",s).attr("height",o):i.attr("transform",n).attr("width",s).attr("height",o),i.exit().remove()}var r=this.svg.group.selectAll("path.lz-data_layer-forest.lz-data_layer-forest-point").data(this.data,function(t){return t[this.layout.id_field]}.bind(this)),l=isNaN(this.parent.layout.height)?0:this.parent.layout.height;r.enter().append("path").attr("class","lz-data_layer-forest lz-data_layer-forest-point").attr("id",function(t){return this.getElementId(t)+"_point"}.bind(this)).attr("transform","translate(0,"+l+")");var h=function(t){var i=this.parent[e](t[this.layout.x_axis.field]),n=this.parent[a](t[this.layout.y_axis.field]);return isNaN(i)&&(i=-1e3),isNaN(n)&&(n=-1e3),"translate("+i+","+n+")"}.bind(this),d=function(t){return this.resolveScalableParameter(this.layout.color,t)}.bind(this),u=function(t){return this.resolveScalableParameter(this.layout.fill_opacity,t)}.bind(this),p=t.svg.symbol().size(function(t){return this.resolveScalableParameter(this.layout.point_size,t)}.bind(this)).type(function(t){return this.resolveScalableParameter(this.layout.point_shape,t)}.bind(this));this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p):r.attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p),r.exit().remove(),r.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t,!0)}.bind(this)),this.applyBehaviors(r)},this}),n.DataLayers.add("genes",function(e){return this.DefaultLayout={stroke:"rgb(54, 54, 150)",color:"#363696",label_font_size:12,label_exon_spacing:4,exon_height:16,bounding_box_padding:6,track_vertical_spacing:10},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.getElementStatusNodeId=function(t){return this.getElementId(t)+"-statusnode"},this.getTrackHeight=function(){return 2*this.layout.bounding_box_padding+this.layout.label_font_size+this.layout.label_exon_spacing+this.layout.exon_height+this.layout.track_vertical_spacing},this.transcript_idx=0,this.tracks=1,this.gene_track_index={1:[]},this.assignTracks=function(){return this.getLabelWidth=function(t,e){try{var a=this.svg.group.append("text").attr("x",0).attr("y",0).attr("class","lz-data_layer-genes lz-label").style("font-size",e).text(t+"→"),i=a.node().getBBox().width;return a.remove(),i}catch(t){return 0}},this.tracks=1,this.gene_track_index={1:[]},this.data.map(function(t,e){if(this.data[e].gene_id&&this.data[e].gene_id.indexOf(".")){var a=this.data[e].gene_id.split(".");this.data[e].gene_id=a[0],this.data[e].gene_version=a[1]}if(this.data[e].transcript_id=this.data[e].transcripts[this.transcript_idx].transcript_id,this.data[e].display_range={start:this.parent.x_scale(Math.max(t.start,this.state.start)),end:this.parent.x_scale(Math.min(t.end,this.state.end))},this.data[e].display_range.label_width=this.getLabelWidth(this.data[e].gene_name,this.layout.label_font_size),this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start,this.data[e].display_range.text_anchor="middle",this.data[e].display_range.widththis.state.end)this.data[e].display_range.start=this.data[e].display_range.end-this.data[e].display_range.label_width-this.layout.label_font_size,this.data[e].display_range.text_anchor="end";else{var i=(this.data[e].display_range.label_width-this.data[e].display_range.width)/2+this.layout.label_font_size;this.data[e].display_range.start-ithis.parent.x_scale(this.state.end)?(this.data[e].display_range.end=this.parent.x_scale(this.state.end),this.data[e].display_range.start=this.data[e].display_range.end-this.data[e].display_range.label_width,this.data[e].display_range.text_anchor="end"):(this.data[e].display_range.start-=i,this.data[e].display_range.end+=i)}this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start}this.data[e].display_range.start-=this.layout.bounding_box_padding,this.data[e].display_range.end+=this.layout.bounding_box_padding,this.data[e].display_range.width+=2*this.layout.bounding_box_padding,this.data[e].display_domain={start:this.parent.x_scale.invert(this.data[e].display_range.start),end:this.parent.x_scale.invert(this.data[e].display_range.end)},this.data[e].display_domain.width=this.data[e].display_domain.end-this.data[e].display_domain.start,this.data[e].track=null;for(var n=1;null===this.data[e].track;){var s=!1;this.gene_track_index[n].map(function(t){if(!s){var e=Math.min(t.display_range.start,this.display_range.start),a=Math.max(t.display_range.end,this.display_range.end);a-ethis.tracks&&(this.tracks=n,this.gene_track_index[n]=[])):(this.data[e].track=n,this.gene_track_index[n].push(this.data[e]))}this.data[e].parent=this,this.data[e].transcripts.map(function(t,a){this.data[e].transcripts[a].parent=this.data[e],this.data[e].transcripts[a].exons.map(function(t,i){this.data[e].transcripts[a].exons[i].parent=this.data[e].transcripts[a]}.bind(this))}.bind(this))}.bind(this)),this},this.render=function(){var e=this;this.assignTracks();var a,i,n,s,o=this.svg.group.selectAll("g.lz-data_layer-genes").data(this.data,function(t){return t.gene_name});o.enter().append("g").attr("class","lz-data_layer-genes"),o.attr("id",function(t){return this.getElementId(t)}.bind(this)).each(function(o){var r=o.parent,l=t.select(this).selectAll("rect.lz-data_layer-genes.lz-data_layer-genes-statusnode").data([o],function(t){return r.getElementStatusNodeId(t)});l.enter().append("rect").attr("class","lz-data_layer-genes lz-data_layer-genes-statusnode"),l.attr("id",function(t){return r.getElementStatusNodeId(t)}).attr("rx",function(){return r.layout.bounding_box_padding}).attr("ry",function(){return r.layout.bounding_box_padding}),a=function(t){return t.display_range.width},i=function(){return r.getTrackHeight()-r.layout.track_vertical_spacing},n=function(t){return t.display_range.start},s=function(t){return(t.track-1)*r.getTrackHeight()},r.canTransition()?l.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):l.attr("width",a).attr("height",i).attr("x",n).attr("y",s),l.exit().remove();var h=function(t){return e.resolveScalableParameter(e.layout.color,t)},d=function(t){return e.resolveScalableParameter(e.layout.stroke,t)},u=t.select(this).selectAll("rect.lz-data_layer-genes.lz-boundary").data([o],function(t){return t.gene_name+"_boundary"}).style({fill:h,stroke:d});u.enter().append("rect").attr("class","lz-data_layer-genes lz-boundary"),a=function(t){return r.parent.x_scale(t.end)-r.parent.x_scale(t.start)},i=function(){return 1},n=function(t){return r.parent.x_scale(t.start)},s=function(t){return(t.track-1)*r.getTrackHeight()+r.layout.bounding_box_padding+r.layout.label_font_size+r.layout.label_exon_spacing+Math.max(r.layout.exon_height,3)/2},r.canTransition()?u.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):u.attr("width",a).attr("height",i).attr("x",n).attr("y",s),u.exit().remove();var p=t.select(this).selectAll("text.lz-data_layer-genes.lz-label").data([o],function(t){return t.gene_name+"_label"});p.enter().append("text").attr("class","lz-data_layer-genes lz-label"),p.attr("text-anchor",function(t){return t.display_range.text_anchor}).text(function(t){return"+"===t.strand?t.gene_name+"→":"←"+t.gene_name}).style("font-size",o.parent.layout.label_font_size),n=function(t){return"middle"===t.display_range.text_anchor?t.display_range.start+t.display_range.width/2:"start"===t.display_range.text_anchor?t.display_range.start+r.layout.bounding_box_padding:"end"===t.display_range.text_anchor?t.display_range.end-r.layout.bounding_box_padding:void 0},s=function(t){return(t.track-1)*r.getTrackHeight()+r.layout.bounding_box_padding+r.layout.label_font_size},r.canTransition()?p.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("x",n).attr("y",s):p.attr("x",n).attr("y",s),p.exit().remove();var c=function(t){return e.resolveScalableParameter(e.layout.color,t.parent.parent)},y=function(t){return e.resolveScalableParameter(e.layout.stroke,t.parent.parent)},f=t.select(this).selectAll("rect.lz-data_layer-genes.lz-exon").data(o.transcripts[o.parent.transcript_idx].exons,function(t){return t.exon_id});f.enter().append("rect").attr("class","lz-data_layer-genes lz-exon"),f.style({fill:c,stroke:y}),a=function(t){return r.parent.x_scale(t.end)-r.parent.x_scale(t.start)},i=function(){return r.layout.exon_height},n=function(t){return r.parent.x_scale(t.start)},s=function(){return(o.track-1)*r.getTrackHeight()+r.layout.bounding_box_padding+r.layout.label_font_size+r.layout.label_exon_spacing},r.canTransition()?f.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):f.attr("width",a).attr("height",i).attr("x",n).attr("y",s),f.exit().remove();var g=t.select(this).selectAll("rect.lz-data_layer-genes.lz-clickarea").data([o],function(t){return t.gene_name+"_clickarea"});g.enter().append("rect").attr("class","lz-data_layer-genes lz-clickarea"),g.attr("id",function(t){return r.getElementId(t)+"_clickarea"}).attr("rx",function(){return r.layout.bounding_box_padding}).attr("ry",function(){return r.layout.bounding_box_padding}),a=function(t){return t.display_range.width},i=function(){return r.getTrackHeight()-r.layout.track_vertical_spacing},n=function(t){return t.display_range.start},s=function(t){return(t.track-1)*r.getTrackHeight()},r.canTransition()?g.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):g.attr("width",a).attr("height",i).attr("x",n).attr("y",s),g.exit().remove(),g.on("click.event_emitter",function(t){t.parent.parent.emit("element_clicked",t,!0)}),r.applyBehaviors(g)}),o.exit().remove()},this.positionTooltip=function(e){if("string"!=typeof e)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[e])throw"Unable to position tooltip: id does not point to a valid tooltip";var a,i,n,s=this.tooltips[e],o=7,r=1,l=this.getPageOrigin(),h=s.selector.node().getBoundingClientRect(),d=this.getElementStatusNodeId(s.data),u=t.select("#"+d).node().getBBox(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=(s.data.display_range.start+s.data.display_range.end)/2-this.layout.bounding_box_padding/2,f=Math.max(h.width/2-y,0),g=Math.max(h.width/2+y-c,0),_=l.x+y-h.width/2-g+f,m=h.width/2-o/2+g-f;h.height+r+o>p-(u.y+u.height)?(a=l.y+u.y-(h.height+r+o),i="down",n=h.height-r):(a=l.y+u.y+u.height+r+o,i="up",n=0-r-o),s.selector.style("left",_+"px").style("top",a+"px"),s.arrow||(s.arrow=s.selector.append("div").style("position","absolute")),s.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",m+"px").style("top",n+"px"); +},this}),n.DataLayers.add("genome_legend",function(t){return this.DefaultLayout={chromosome_fill_colors:{light:"rgb(155, 155, 188)",dark:"rgb(95, 95, 128)"},chromosome_label_colors:{light:"rgb(120, 120, 186)",dark:"rgb(0, 0, 66)"}},t=n.Layouts.merge(t,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.render=function(){var t=0;this.data.forEach(function(e,a){this.data[a].genome_start=t,this.data[a].genome_end=t+e["genome:base_pairs"],t+=e["genome:base_pairs"]}.bind(this));var e=this.svg.group.selectAll("rect.lz-data_layer-genome_legend").data(this.data,function(t){return t["genome:chr"]});e.enter().append("rect").attr("class","lz-data_layer-genome_legend");var a=this,i=this.parent;e.attr("fill",function(t){return t["genome:chr"]%2?a.layout.chromosome_fill_colors.light:a.layout.chromosome_fill_colors.dark}).attr("x",function(t){return i.x_scale(t.genome_start)}).attr("y",0).attr("width",function(t){return i.x_scale(t["genome:base_pairs"])}).attr("height",i.layout.cliparea.height),e.exit().remove();var n=/([^:]+):(\d+)(?:_.*)?/.exec(this.state.variant);if(!n)throw"Genome legend cannot understand the specified variant position";var s=n[1],o=n[2];t=+this.data[s-1].genome_start+ +o;var r=this.svg.group.selectAll("rect.lz-data_layer-genome_legend-marker").data([{start:t,end:t+1}]);r.enter().append("rect").attr("class","lz-data_layer-genome_legend-marker"),r.transition().duration(500).style({fill:"rgba(255, 250, 50, 0.8)",stroke:"rgba(255, 250, 50, 0.8)","stroke-width":"3px"}).attr("x",function(t){return i.x_scale(t.start)}).attr("y",0).attr("width",function(t){return i.x_scale(t.end-t.start)}).attr("height",i.layout.cliparea.height),r.exit().remove()},this}),n.DataLayers.add("intervals",function(e){return this.DefaultLayout={start_field:"start",end_field:"end",track_split_field:"state_id",track_split_order:"DESC",track_split_legend_to_y_axis:2,split_tracks:!0,track_height:15,track_vertical_spacing:3,bounding_box_padding:2,always_hide_legend:!1,color:"#B8B8B8",fill_opacity:1},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.getElementStatusNodeId=function(t){return this.layout.split_tracks?(this.getBaseId()+"-statusnode-"+t[this.layout.track_split_field]).replace(/[:.[\],]/g,"_"):this.getElementId(t)+"-statusnode"}.bind(this),this.getTrackHeight=function(){return this.layout.track_height+this.layout.track_vertical_spacing+2*this.layout.bounding_box_padding},this.tracks=1,this.previous_tracks=1,this.interval_track_index={1:[]},this.assignTracks=function(){if(this.previous_tracks=this.tracks,this.tracks=0,this.interval_track_index={1:[]},this.track_split_field_index={},this.layout.track_split_field&&this.layout.split_tracks){this.data.map(function(t){this.track_split_field_index[t[this.layout.track_split_field]]=null}.bind(this));var t=Object.keys(this.track_split_field_index);"DESC"===this.layout.track_split_order&&t.reverse(),t.forEach(function(t){this.track_split_field_index[t]=this.tracks+1,this.interval_track_index[this.tracks+1]=[],this.tracks++}.bind(this))}return this.data.map(function(t,e){if(this.data[e].parent=this,this.data[e].display_range={start:this.parent.x_scale(Math.max(t[this.layout.start_field],this.state.start)),end:this.parent.x_scale(Math.min(t[this.layout.end_field],this.state.end))},this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start,this.data[e].display_domain={start:this.parent.x_scale.invert(this.data[e].display_range.start),end:this.parent.x_scale.invert(this.data[e].display_range.end)},this.data[e].display_domain.width=this.data[e].display_domain.end-this.data[e].display_domain.start,this.layout.track_split_field&&this.layout.split_tracks){var a=this.data[e][this.layout.track_split_field];this.data[e].track=this.track_split_field_index[a],this.interval_track_index[this.data[e].track].push(e)}else{this.tracks=1,this.data[e].track=null;for(var i=1;null===this.data[e].track;){var n=!1;this.interval_track_index[i].map(function(t){if(!n){var e=Math.min(t.display_range.start,this.display_range.start),a=Math.max(t.display_range.end,this.display_range.end);a-ethis.tracks&&(this.tracks=i,this.interval_track_index[i]=[])):(this.data[e].track=i,this.interval_track_index[i].push(this.data[e]))}}}.bind(this)),this},this.render=function(){this.assignTracks(),this.svg.group.selectAll(".lz-data_layer-intervals-statusnode.lz-data_layer-intervals-shared").remove(),Object.keys(this.track_split_field_index).forEach(function(t){var e={};e[this.layout.track_split_field]=t;var a={display:this.layout.split_tracks?null:"none"};this.svg.group.insert("rect",":first-child").attr("id",this.getElementStatusNodeId(e)).attr("class","lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-shared").attr("rx",this.layout.bounding_box_padding).attr("ry",this.layout.bounding_box_padding).attr("width",this.parent.layout.cliparea.width).attr("height",this.getTrackHeight()-this.layout.track_vertical_spacing).attr("x",0).attr("y",(this.track_split_field_index[t]-1)*this.getTrackHeight()).style(a)}.bind(this));var e,a,i,n,s,o,r=this.svg.group.selectAll("g.lz-data_layer-intervals").data(this.data,function(t){return t[this.layout.id_field]}.bind(this));return r.enter().append("g").attr("class","lz-data_layer-intervals"),r.attr("id",function(t){return this.getElementId(t)}.bind(this)).each(function(r){var l=r.parent,h={display:l.layout.split_tracks?"none":null},d=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-data_layer-intervals-statusnode.lz-data_layer-intervals-statusnode-discrete").data([r],function(t){return l.getElementId(t)+"-statusnode"});d.enter().insert("rect",":first-child").attr("class","lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-statusnode-discrete"),d.attr("id",function(t){return l.getElementId(t)+"-statusnode"}).attr("rx",function(){return l.layout.bounding_box_padding}).attr("ry",function(){return l.layout.bounding_box_padding}).style(h),e=function(t){return t.display_range.width+2*l.layout.bounding_box_padding},a=function(){return l.getTrackHeight()-l.layout.track_vertical_spacing},i=function(t){return t.display_range.start-l.layout.bounding_box_padding},n=function(t){return(t.track-1)*l.getTrackHeight()},l.canTransition()?d.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):d.attr("width",e).attr("height",a).attr("x",i).attr("y",n),d.exit().remove();var u=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-interval_rect").data([r],function(t){return t[l.layout.id_field]+"_interval_rect"});u.enter().append("rect").attr("class","lz-data_layer-intervals lz-interval_rect"),a=l.layout.track_height,e=function(t){return t.display_range.width},i=function(t){return t.display_range.start},n=function(t){return(t.track-1)*l.getTrackHeight()+l.layout.bounding_box_padding},s=function(t){return l.resolveScalableParameter(l.layout.color,t)},o=function(t){return l.resolveScalableParameter(l.layout.fill_opacity,t)},l.canTransition()?u.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n).attr("fill",s).attr("fill-opacity",o):u.attr("width",e).attr("height",a).attr("x",i).attr("y",n).attr("fill",s).attr("fill-opacity",o),u.exit().remove();var p=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-clickarea").data([r],function(t){return t.interval_name+"_clickarea"});p.enter().append("rect").attr("class","lz-data_layer-intervals lz-clickarea"),p.attr("id",function(t){return l.getElementId(t)+"_clickarea"}).attr("rx",function(){return l.layout.bounding_box_padding}).attr("ry",function(){return l.layout.bounding_box_padding}),e=function(t){return t.display_range.width},a=function(){return l.getTrackHeight()-l.layout.track_vertical_spacing},i=function(t){return t.display_range.start},n=function(t){return(t.track-1)*l.getTrackHeight()},l.canTransition()?p.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):p.attr("width",e).attr("height",a).attr("x",i).attr("y",n),p.exit().remove(),p.on("click",function(t){t.parent.parent.emit("element_clicked",t,!0)}.bind(this)),l.applyBehaviors(p)}),r.exit().remove(),this.previous_tracks!==this.tracks&&this.updateSplitTrackAxis(),this},this.positionTooltip=function(e){if("string"!=typeof e)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[e])throw"Unable to position tooltip: id does not point to a valid tooltip";var a,i,n,s=this.tooltips[e],o=7,r=1,l=this.getPageOrigin(),h=s.selector.node().getBoundingClientRect(),d=t.select("#"+this.getElementStatusNodeId(s.data)).node().getBBox(),u=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),p=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),c=(s.data.display_range.start+s.data.display_range.end)/2-this.layout.bounding_box_padding/2,y=Math.max(h.width/2-c,0),f=Math.max(h.width/2+c-p,0),g=l.x+c-h.width/2-f+y,_=h.width/2-o/2+f-y;h.height+r+o>u-(d.y+d.height)?(a=l.y+d.y-(h.height+r+o),i="down",n=h.height-r):(a=l.y+d.y+d.height+r+o,i="up",n=0-r-o),s.selector.style("left",g+"px").style("top",a+"px"),s.arrow||(s.arrow=s.selector.append("div").style("position","absolute")),s.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",_+"px").style("top",n+"px")},this.updateSplitTrackAxis=function(){var t=!!this.layout.track_split_legend_to_y_axis&&"y"+this.layout.track_split_legend_to_y_axis;if(this.layout.split_tracks){var e=+this.tracks||0,a=+this.layout.track_height||0,i=2*(+this.layout.bounding_box_padding||0)+(+this.layout.track_vertical_spacing||0),n=e*a+(e-1)*i;this.parent.scaleHeightToData(n),t&&this.parent.legend&&(this.parent.legend.hide(),this.parent.layout.axes[t]={render:!0,ticks:[],range:{start:n-this.layout.track_height/2,end:this.layout.track_height/2}},this.layout.legend.forEach(function(a){var i=a[this.layout.track_split_field],n=this.track_split_field_index[i];n&&("DESC"===this.layout.track_split_order&&(n=Math.abs(n-e-1)),this.parent.layout.axes[t].ticks.push({y:n,text:a.label}))}.bind(this)),this.layout.y_axis={axis:this.layout.track_split_legend_to_y_axis,floor:1,ceiling:e},this.parent.render()),this.parent_plot.positionPanels()}else t&&this.parent.legend&&(this.layout.always_hide_legend||this.parent.legend.show(),this.parent.layout.axes[t]={render:!1},this.parent.render());return this},this.toggleSplitTracks=function(){return this.layout.split_tracks=!this.layout.split_tracks,this.parent.legend&&!this.layout.always_hide_legend&&(this.parent.layout.margin.bottom=5+(this.layout.split_tracks?0:this.parent.legend.layout.height+5)),this.render(),this.updateSplitTrackAxis(),this},this}),n.DataLayers.add("line",function(e){return this.DefaultLayout={style:{fill:"none","stroke-width":"2px"},interpolate:"linear",x_axis:{field:"x"},y_axis:{field:"y",axis:1},hitarea_width:5},e=n.Layouts.merge(e,this.DefaultLayout),this.mouse_event=null,this.line=null,this.tooltip_timeout=null,n.DataLayer.apply(this,arguments),this.getMouseDisplayAndData=function(){var e={display:{x:t.mouse(this.mouse_event)[0],y:null},data:{},slope:null},a=this.layout.x_axis.field,i=this.layout.y_axis.field,n="x_scale",s="y"+this.layout.y_axis.axis+"_scale";e.data[a]=this.parent[n].invert(e.display.x);var o=t.bisector(function(t){return+t[a]}).left,r=o(this.data,e.data[a])-1,l=this.data[r],h=this.data[r+1],d=t.interpolateNumber(+l[i],+h[i]),u=+h[a]-+l[a];return e.data[i]=d(e.data[a]%u/u),e.display.y=this.parent[s](e.data[i]),this.layout.tooltip.x_precision&&(e.data[a]=e.data[a].toPrecision(this.layout.tooltip.x_precision)),this.layout.tooltip.y_precision&&(e.data[i]=e.data[i].toPrecision(this.layout.tooltip.y_precision)),e.slope=(this.parent[s](h[i])-this.parent[s](l[i]))/(this.parent[n](h[a])-this.parent[n](l[a])),e},this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=o.selector.node().getBoundingClientRect(),l=7,h=6,d=parseFloat(this.layout.style["stroke-width"])||1,u=this.getPageOrigin(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=this.getMouseDisplayAndData();if(Math.abs(y.slope)>1)y.display.x<=this.parent.layout.width/2?(a=u.x+y.display.x+d+l+d,s="left",n=-1*(l+d)):(a=u.x+y.display.x-r.width-d-l-d,s="right",n=r.width-d),y.display.y-r.height/2<=0?(e=u.y+y.display.y-1.5*l-h,i=h):y.display.y+r.height/2>=p?(e=u.y+y.display.y+l+h-r.height,i=r.height-2*l-h):(e=u.y+y.display.y-r.height/2,i=r.height/2-l);else{var f=Math.max(r.width/2-y.display.x,0),g=Math.max(r.width/2+y.display.x-c,0);a=u.x+y.display.x-r.width/2-g+f;var _=l/2,m=r.width-2.5*l;n=r.width/2-l+g-f,n=Math.min(Math.max(n,_),m),r.height+d+l>y.display.y?(e=u.y+y.display.y+d+l,s="up",i=0-d-l):(e=u.y+y.display.y-(r.height+d+l),s="down",i=r.height-d)}o.selector.style({left:a+"px",top:e+"px"}),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+s).style({left:n+"px",top:i+"px"})},this.render=function(){var e=this,a=this.parent,i=this.layout.x_axis.field,n=this.layout.y_axis.field,s="x_scale",o="y"+this.layout.y_axis.axis+"_scale",r=this.svg.group.selectAll("path.lz-data_layer-line").data([this.data]);if(this.path=r.enter().append("path").attr("class","lz-data_layer-line"),this.line=t.svg.line().x(function(t){return parseFloat(a[s](t[i]))}).y(function(t){return parseFloat(a[o](t[n]))}).interpolate(this.layout.interpolate),this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("d",this.line).style(this.layout.style):r.attr("d",this.line).style(this.layout.style),this.layout.tooltip){var l=parseFloat(this.layout.hitarea_width).toString()+"px",h=this.svg.group.selectAll("path.lz-data_layer-line-hitarea").data([this.data]);h.enter().append("path").attr("class","lz-data_layer-line-hitarea").style("stroke-width",l);var d=t.svg.line().x(function(t){return parseFloat(a[s](t[i]))}).y(function(t){return parseFloat(a[o](t[n]))}).interpolate(this.layout.interpolate);h.attr("d",d).on("mouseover",function(){clearTimeout(e.tooltip_timeout),e.mouse_event=this;var t=e.getMouseDisplayAndData();e.createTooltip(t.data)}).on("mousemove",function(){clearTimeout(e.tooltip_timeout),e.mouse_event=this;var t=e.getMouseDisplayAndData();e.updateTooltip(t.data),e.positionTooltip(e.getElementId())}).on("mouseout",function(){e.tooltip_timeout=setTimeout(function(){e.mouse_event=null,e.destroyTooltip(e.getElementId())},300)}),h.exit().remove()}r.exit().remove()},this.setElementStatus=function(t,e,a){return this.setAllElementStatus(t,a)},this.setElementStatusByFilters=function(t,e){return this.setAllElementStatus(t,e)},this.setAllElementStatus=function(t,e){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setAllElementStatus()";if("undefined"==typeof this.state[this.state_id][t])return this;"undefined"==typeof e&&(e=!0),this.global_statuses[t]=e;var a="lz-data_layer-line";return Object.keys(this.global_statuses).forEach(function(t){this.global_statuses[t]&&(a+=" lz-data_layer-line-"+t)}.bind(this)),this.path.attr("class",a),this.parent.emit("layout_changed",!0),this},this}),n.DataLayers.add("orthogonal_line",function(e){return this.DefaultLayout={style:{stroke:"#D3D3D3","stroke-width":"3px","stroke-dasharray":"10px 10px"},orientation:"horizontal",x_axis:{axis:1,decoupled:!0},y_axis:{axis:1,decoupled:!0},offset:0},e=n.Layouts.merge(e,this.DefaultLayout),["horizontal","vertical"].indexOf(e.orientation)===-1&&(e.orientation="horizontal"),this.data=[],this.line=null,n.DataLayer.apply(this,arguments),this.render=function(){var e=this.parent,a="x_scale",i="y"+this.layout.y_axis.axis+"_scale",n="x_extent",s="y"+this.layout.y_axis.axis+"_extent",o="x_range",r="y"+this.layout.y_axis.axis+"_range";"horizontal"===this.layout.orientation?this.data=[{x:e[n][0],y:this.layout.offset},{x:e[n][1],y:this.layout.offset}]:this.data=[{x:this.layout.offset,y:e[s][0]},{x:this.layout.offset,y:e[s][1]}];var l=this.svg.group.selectAll("path.lz-data_layer-line").data([this.data]);this.path=l.enter().append("path").attr("class","lz-data_layer-line"),this.line=t.svg.line().x(function(t,i){var n=parseFloat(e[a](t.x));return isNaN(n)?e[o][i]:n}).y(function(t,a){var n=parseFloat(e[i](t.y));return isNaN(n)?e[r][a]:n}).interpolate("linear"),this.canTransition()?l.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("d",this.line).style(this.layout.style):l.attr("d",this.line).style(this.layout.style),l.exit().remove()},this}),n.DataLayers.add("scatter",function(e){return this.DefaultLayout={point_size:40,point_shape:"circle",tooltip_positioning:"horizontal",color:"#888888",fill_opacity:1,y_axis:{axis:1},id_field:"id"},e=n.Layouts.merge(e,this.DefaultLayout),e.label&&isNaN(e.label.spacing)&&(e.label.spacing=4),n.DataLayer.apply(this,arguments),this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=this.resolveScalableParameter(this.layout.point_size,o.data),l=Math.sqrt(r/Math.PI),h=7,d=1,u=6,p=this.getPageOrigin(),c=this.parent.x_scale(o.data[this.layout.x_axis.field]),y="y"+this.layout.y_axis.axis+"_scale",f=this.parent[y](o.data[this.layout.y_axis.field]),g=o.selector.node().getBoundingClientRect(),_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),m=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right);if("vertical"===this.layout.tooltip_positioning){var b=Math.max(g.width/2-c,0),v=Math.max(g.width/2+c-m,0);a=p.x+c-g.width/2-v+b,s=g.width/2-h/2+v-b-l,g.height+d+h>_-(f+l)?(e=p.y+f-(l+g.height+d+h),i="down",n=g.height-d):(e=p.y+f+l+d+h,i="up",n=0-d-h)}else c<=this.parent.layout.width/2?(a=p.x+c+l+h+d,i="left",s=-1*(h+d)):(a=p.x+c-g.width-l-h-d,i="right",s=g.width-d),_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),f-g.height/2<=0?(e=p.y+f-1.5*h-u,n=u):f+g.height/2>=_?(e=p.y+f+h+u-g.height,n=g.height-2*h-u):(e=p.y+f-g.height/2,n=g.height/2-h);o.selector.style("left",a+"px").style("top",e+"px"),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",s+"px").style("top",n+"px")},this.flip_labels=function(){var e=this,a=e.resolveScalableParameter(e.layout.point_size,{}),i=e.layout.label.spacing,n=Boolean(e.layout.label.lines),s=2*i,o=e.parent.layout.width-e.parent.layout.margin.left-e.parent.layout.margin.right-2*i,r=function(t,e){var s=+t.attr("x"),o=2*i+2*Math.sqrt(a);if(n)var r=+e.attr("x2"),l=i+2*Math.sqrt(a);"start"===t.style("text-anchor")?(t.style("text-anchor","end"),t.attr("x",s-o),n&&e.attr("x2",r-l)):(t.style("text-anchor","start"),t.attr("x",s+o),n&&e.attr("x2",r+l))};e.label_texts.each(function(a,s){var l=this,h=t.select(l),d=+h.attr("x"),u=h.node().getBoundingClientRect();if(d+u.width+i>o){var p=n?t.select(e.label_lines[0][s]):null;r(h,p)}}),e.label_texts.each(function(a,o){var l=this,h=t.select(l);if("end"!==h.style("text-anchor")){var d=+h.attr("x"),u=h.node().getBoundingClientRect(),p=n?t.select(e.label_lines[0][o]):null;e.label_texts.each(function(){var e=this,a=t.select(e),n=a.node().getBoundingClientRect(),o=u.leftn.left&&u.topn.top;o&&(r(h,p),d=+h.attr("x"),d-u.width-iu.left&&d.topu.top;if(p){n=!0;var c,y=h.attr("y"),f=d.topv?(c=_-+r,_=+r,m-=c):m+u.height/2>v&&(c=m-+y,m=+y,_-=c),o.attr("y",_),h.attr("y",m)}}}})}),n){if(e.layout.label.lines){var s=e.label_texts[0];e.label_lines.attr("y2",function(e,a){var i=t.select(s[a]);return i.attr("y")})}this.seperate_iterations<150&&setTimeout(function(){this.separate_labels()}.bind(this),1)}},this.render=function(){var e=this,a="x_scale",i="y"+this.layout.y_axis.axis+"_scale";if(this.layout.label){var s=this.data.filter(function(t){if(e.layout.label.filters){var a=!0;return e.layout.label.filters.forEach(function(e){var i=new n.Data.Field(e.field).resolve(t);if(isNaN(i))a=!1;else switch(e.operator){case"<":i":i>e.value||(a=!1);break;case">=":i>=e.value||(a=!1);break;case"=":i!==e.value&&(a=!1);break;default:a=!1}}),a}return!0}),o=this;this.label_groups=this.svg.group.selectAll("g.lz-data_layer-"+this.layout.type+"-label").data(s,function(t){return t[o.layout.id_field]+"_label"}),this.label_groups.enter().append("g").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_texts&&this.label_texts.remove(),this.label_texts=this.label_groups.append("text").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_texts.text(function(t){return n.parseFields(t,e.layout.label.text||"")}).style(e.layout.label.style||{}).attr({x:function(t){var i=e.parent[a](t[e.layout.x_axis.field])+Math.sqrt(e.resolveScalableParameter(e.layout.point_size,t))+e.layout.label.spacing;return isNaN(i)&&(i=-1e3),i},y:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a},"text-anchor":function(){return"start"}}),e.layout.label.lines&&(this.label_lines&&this.label_lines.remove(),this.label_lines=this.label_groups.append("line").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_lines.style(e.layout.label.lines.style||{}).attr({x1:function(t){var i=e.parent[a](t[e.layout.x_axis.field]);return isNaN(i)&&(i=-1e3),i},y1:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a},x2:function(t){var i=e.parent[a](t[e.layout.x_axis.field])+Math.sqrt(e.resolveScalableParameter(e.layout.point_size,t))+e.layout.label.spacing/2;return isNaN(i)&&(i=-1e3),i},y2:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a}})),this.label_groups.exit().remove()}var r=this.svg.group.selectAll("path.lz-data_layer-"+this.layout.type).data(this.data,function(t){return t[this.layout.id_field]}.bind(this)),l=isNaN(this.parent.layout.height)?0:this.parent.layout.height;r.enter().append("path").attr("class","lz-data_layer-"+this.layout.type).attr("id",function(t){return this.getElementId(t)}.bind(this)).attr("transform","translate(0,"+l+")");var h=function(t){var e=this.parent[a](t[this.layout.x_axis.field]),n=this.parent[i](t[this.layout.y_axis.field]);return isNaN(e)&&(e=-1e3),isNaN(n)&&(n=-1e3),"translate("+e+","+n+")"}.bind(this),d=function(t){return this.resolveScalableParameter(this.layout.color,t)}.bind(this),u=function(t){return this.resolveScalableParameter(this.layout.fill_opacity,t)}.bind(this),p=t.svg.symbol().size(function(t){return this.resolveScalableParameter(this.layout.point_size,t)}.bind(this)).type(function(t){return this.resolveScalableParameter(this.layout.point_shape,t)}.bind(this));this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p):r.attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p),r.exit().remove(),r.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t,!0)}.bind(this)),this.applyBehaviors(r),this.layout.label&&(this.flip_labels(),this.seperate_iterations=0,this.separate_labels(),this.label_texts.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t,!0)}.bind(this)),this.applyBehaviors(this.label_texts))},this.makeLDReference=function(t){var e=null;if("undefined"==typeof t)throw"makeLDReference requires one argument of any type";e="object"==typeof t?this.layout.id_field&&"undefined"!=typeof t[this.layout.id_field]?t[this.layout.id_field].toString():"undefined"!=typeof t.id?t.id.toString():t.toString():t.toString(),this.parent_plot.applyState({ldrefvar:e})},this}),n.DataLayers.extend("scatter","category_scatter",{_prepareData:function(){var t=this.layout.x_axis.field||"x",e=this.layout.x_axis.category_field;if(!e)throw"Layout for "+this.layout.id+" must specify category_field";var a=this.data.sort(function(t,a){var i=t[e],n=a[e],s=i.toString?i.toString().toLowerCase():i,o=n.toString?n.toString().toLowerCase():n;return s===o?0:s1?function(t){for(var e=t,n=0;n1?Math.ceil(Math.log(a)/Math.LN10):Math.floor(Math.log(a)/Math.LN10),Math.abs(e)<=3?t.toFixed(3):t.toExponential(2).replace("+","").replace("e"," × 10^")}),n.TransformationFunctions.add("urlencode",function(t){return encodeURIComponent(t)}),n.TransformationFunctions.add("htmlescape",function(t){return t?(t+="",t.replace(/['"<>&`]/g,function(t){switch(t){case"'":return"'";case'"':return""";case"<":return"<";case">":return">";case"&":return"&";case"`":return"`"}})):""}),n.ScaleFunctions=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t])return"undefined"==typeof a&&"undefined"==typeof i?e[t]:e[t](a,i);throw"scale function ["+t+"] not found"}return null},t.set=function(t,a){a?e[t]=a:delete e[t]},t.add=function(a,i){if(e[a])throw"scale function already exists with name: "+a;t.set(a,i)},t.list=function(){return Object.keys(e)},t}(),n.ScaleFunctions.add("if",function(t,e){return"undefined"==typeof e||t.field_value!==e?"undefined"!=typeof t.else?t.else:null:t.then}),n.ScaleFunctions.add("numerical_bin",function(t,e){var a=t.breaks||[],i=t.values||[];if("undefined"==typeof e||null===e||isNaN(+e))return t.null_value?t.null_value:null;var n=a.reduce(function(t,a){return+e=t&&+e=e.breaks[e.breaks.length-1])return n[i.length-1];var o=null;if(i.forEach(function(t,e){e&&i[e-1]<=+a&&i[e]>=+a&&(o=e)}),null===o)return s;var r=(+a-i[o-1])/(i[o]-i[o-1]);return isFinite(r)?t.interpolate(n[o-1],n[o])(r):s}),n.Dashboard=function(t){if(!(t instanceof n.Plot||t instanceof n.Panel))throw"Unable to create dashboard, parent must be a locuszoom plot or panel";return this.parent=t,this.id=this.parent.getBaseId()+".dashboard",this.type=this.parent instanceof n.Plot?"plot":"panel",this.parent_plot="plot"===this.type?this.parent:this.parent.parent,this.selector=null,this.components=[],this.hide_timeout=null,this.persist=!1,this.initialize()},n.Dashboard.prototype.initialize=function(){ +return Array.isArray(this.parent.layout.dashboard.components)&&this.parent.layout.dashboard.components.forEach(function(t){try{var e=n.Dashboard.Components.get(t.type,t,this);this.components.push(e)}catch(t){console.warn(t)}}.bind(this)),"panel"===this.type&&(t.select(this.parent.parent.svg.node().parentNode).on("mouseover."+this.id,function(){clearTimeout(this.hide_timeout),this.selector&&"hidden"!==this.selector.style("visibility")||this.show()}.bind(this)),t.select(this.parent.parent.svg.node().parentNode).on("mouseout."+this.id,function(){clearTimeout(this.hide_timeout),this.hide_timeout=setTimeout(function(){this.hide()}.bind(this),300)}.bind(this))),this},n.Dashboard.prototype.shouldPersist=function(){if(this.persist)return!0;var t=!1;return this.components.forEach(function(e){t=t||e.shouldPersist()}),t=t||this.parent_plot.panel_boundaries.dragging||this.parent_plot.interaction.dragging,!!t},n.Dashboard.prototype.show=function(){if(!this.selector){switch(this.type){case"plot":this.selector=t.select(this.parent.svg.node().parentNode).insert("div",":first-child");break;case"panel":this.selector=t.select(this.parent.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip, .lz-dashboard-menu, .lz-curtain").classed("lz-panel-dashboard",!0)}this.selector.classed("lz-dashboard",!0).classed("lz-"+this.type+"-dashboard",!0).attr("id",this.id)}return this.components.forEach(function(t){t.show()}),this.selector.style({visibility:"visible"}),this.update()},n.Dashboard.prototype.update=function(){return this.selector?(this.components.forEach(function(t){t.update()}),this.position()):this},n.Dashboard.prototype.position=function(){if(!this.selector)return this;if("panel"===this.type){var t=this.parent.getPageOrigin(),e=(t.y+3.5).toString()+"px",a=t.x.toString()+"px",i=(this.parent.layout.width-4).toString()+"px";this.selector.style({position:"absolute",top:e,left:a,width:i})}return this.components.forEach(function(t){t.position()}),this},n.Dashboard.prototype.hide=function(){return!this.selector||this.shouldPersist()?this:(this.components.forEach(function(t){t.hide()}),this.selector.style({visibility:"hidden"}),this)},n.Dashboard.prototype.destroy=function(t){return"undefined"==typeof t&&(t=!1),this.selector?this.shouldPersist()&&!t?this:(this.components.forEach(function(t){t.destroy(!0)}),this.components=[],this.selector.remove(),this.selector=null,this):this},n.Dashboard.Component=function(t,e){return this.layout=t||{},this.layout.color||(this.layout.color="gray"),this.parent=e||null,this.parent_panel=null,this.parent_plot=null,this.parent_svg=null,this.parent instanceof n.Dashboard&&("panel"===this.parent.type?(this.parent_panel=this.parent.parent,this.parent_plot=this.parent.parent.parent,this.parent_svg=this.parent_panel):(this.parent_plot=this.parent.parent,this.parent_svg=this.parent_plot)),this.selector=null,this.button=null,this.persist=!1,this.layout.position||(this.layout.position="left"),this},n.Dashboard.Component.prototype.show=function(){if(this.parent&&this.parent.selector){if(!this.selector){var t=["start","middle","end"].indexOf(this.layout.group_position)!==-1?" lz-dashboard-group-"+this.layout.group_position:"";this.selector=this.parent.selector.append("div").attr("class","lz-dashboard-"+this.layout.position+t),this.layout.style&&this.selector.style(this.layout.style),"function"==typeof this.initialize&&this.initialize()}return this.button&&"highlighted"===this.button.status&&this.button.menu.show(),this.selector.style({visibility:"visible"}),this.update(),this.position()}},n.Dashboard.Component.prototype.update=function(){},n.Dashboard.Component.prototype.position=function(){return this.button&&this.button.menu.position(),this},n.Dashboard.Component.prototype.shouldPersist=function(){return!!this.persist||!(!this.button||!this.button.persist)},n.Dashboard.Component.prototype.hide=function(){return!this.selector||this.shouldPersist()?this:(this.button&&this.button.menu.hide(),this.selector.style({visibility:"hidden"}),this)},n.Dashboard.Component.prototype.destroy=function(t){return"undefined"==typeof t&&(t=!1),this.selector?this.shouldPersist()&&!t?this:(this.button&&this.button.menu&&this.button.menu.destroy(),this.selector.remove(),this.selector=null,this.button=null,this):this},n.Dashboard.Components=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t]){if("object"!=typeof a)throw"invalid layout argument for dashboard component ["+t+"]";return new e[t](a,i)}throw"dashboard component ["+t+"] not found"}return null},t.set=function(t,a){if(a){if("function"!=typeof a)throw"unable to set dashboard component ["+t+"], argument provided is not a function";e[t]=a,e[t].prototype=new n.Dashboard.Component}else delete e[t]},t.add=function(a,i){if(e[a])throw"dashboard component already exists with name: "+a;t.set(a,i)},t.list=function(){return Object.keys(e)},t}(),n.Dashboard.Component.Button=function(e){if(!(e instanceof n.Dashboard.Component))throw"Unable to create dashboard component button, invalid parent";this.parent=e,this.parent_panel=this.parent.parent_panel,this.parent_plot=this.parent.parent_plot,this.parent_svg=this.parent.parent_svg,this.parent_dashboard=this.parent.parent,this.selector=null,this.tag="a",this.setTag=function(t){return"undefined"!=typeof t&&(this.tag=t.toString()),this},this.html="",this.setHtml=function(t){return"undefined"!=typeof t&&(this.html=t.toString()),this},this.setText=this.setHTML,this.title="",this.setTitle=function(t){return"undefined"!=typeof t&&(this.title=t.toString()),this},this.color="gray",this.setColor=function(t){return"undefined"!=typeof t&&(["gray","red","orange","yellow","green","blue","purple"].indexOf(t)!==-1?this.color=t:this.color="gray"),this},this.style={},this.setStyle=function(t){return"undefined"!=typeof t&&(this.style=t),this},this.getClass=function(){var t=["start","middle","end"].indexOf(this.parent.layout.group_position)!==-1?" lz-dashboard-button-group-"+this.parent.layout.group_position:"";return"lz-dashboard-button lz-dashboard-button-"+this.color+(this.status?"-"+this.status:"")+t},this.persist=!1,this.permanent=!1,this.setPermanent=function(t){return t="undefined"==typeof t||Boolean(t),this.permanent=t,this.permanent&&(this.persist=!0),this},this.shouldPersist=function(){return this.permanent||this.persist},this.status="",this.setStatus=function(t){return"undefined"!=typeof t&&["","highlighted","disabled"].indexOf(t)!==-1&&(this.status=t),this.update()},this.highlight=function(t){return t="undefined"==typeof t||Boolean(t),t?this.setStatus("highlighted"):"highlighted"===this.status?this.setStatus(""):this},this.disable=function(t){return t="undefined"==typeof t||Boolean(t),t?this.setStatus("disabled"):"disabled"===this.status?this.setStatus(""):this},this.onmouseover=function(){},this.setOnMouseover=function(t){return"function"==typeof t?this.onmouseover=t:this.onmouseover=function(){},this},this.onmouseout=function(){},this.setOnMouseout=function(t){return"function"==typeof t?this.onmouseout=t:this.onmouseout=function(){},this},this.onclick=function(){},this.setOnclick=function(t){return"function"==typeof t?this.onclick=t:this.onclick=function(){},this},this.show=function(){if(this.parent)return this.selector||(this.selector=this.parent.selector.append(this.tag).attr("class",this.getClass())),this.update()},this.preUpdate=function(){return this},this.update=function(){return this.selector?(this.preUpdate(),this.selector.attr("class",this.getClass()).attr("title",this.title).style(this.style).on("mouseover","disabled"===this.status?null:this.onmouseover).on("mouseout","disabled"===this.status?null:this.onmouseout).on("click","disabled"===this.status?null:this.onclick).html(this.html),this.menu.update(),this.postUpdate(),this):this},this.postUpdate=function(){return this},this.hide=function(){return this.selector&&!this.shouldPersist()&&(this.selector.remove(),this.selector=null),this},this.menu={outer_selector:null,inner_selector:null,scroll_position:0,hidden:!0,show:function(){return this.menu.outer_selector||(this.menu.outer_selector=t.select(this.parent_plot.svg.node().parentNode).append("div").attr("class","lz-dashboard-menu lz-dashboard-menu-"+this.color).attr("id",this.parent_svg.getBaseId()+".dashboard.menu"),this.menu.inner_selector=this.menu.outer_selector.append("div").attr("class","lz-dashboard-menu-content"),this.menu.inner_selector.on("scroll",function(){this.menu.scroll_position=this.menu.inner_selector.node().scrollTop}.bind(this))),this.menu.outer_selector.style({visibility:"visible"}),this.menu.hidden=!1,this.menu.update()}.bind(this),update:function(){return this.menu.outer_selector?(this.menu.populate(),this.menu.inner_selector&&(this.menu.inner_selector.node().scrollTop=this.menu.scroll_position),this.menu.position()):this.menu}.bind(this),position:function(){if(!this.menu.outer_selector)return this.menu;this.menu.outer_selector.style({height:null});var t=3,e=20,a=14,i=this.parent_svg.getPageOrigin(),n=document.documentElement.scrollTop||document.body.scrollTop,s=this.parent_plot.getContainerOffset(),o=this.parent_dashboard.selector.node().getBoundingClientRect(),r=this.selector.node().getBoundingClientRect(),l=this.menu.outer_selector.node().getBoundingClientRect(),h=this.menu.inner_selector.node().scrollHeight,d=0,u=0;"panel"===this.parent_dashboard.type?(d=i.y+o.height+2*t,u=Math.max(i.x+this.parent_svg.layout.width-l.width-t,i.x+t)):(d=r.bottom+n+t-s.top,u=Math.max(r.left+r.width-l.width-s.left,i.x+t));var p=Math.max(this.parent_svg.layout.width-2*t-e,e),c=p,y=p-4*t,f=Math.max(this.parent_svg.layout.height-10*t-a,a),g=Math.min(h,f),_=f;return this.menu.outer_selector.style({top:d.toString()+"px",left:u.toString()+"px","max-width":c.toString()+"px","max-height":_.toString()+"px",height:g.toString()+"px"}),this.menu.inner_selector.style({"max-width":y.toString()+"px"}),this.menu.inner_selector.node().scrollTop=this.menu.scroll_position,this.menu}.bind(this),hide:function(){return this.menu.outer_selector?(this.menu.outer_selector.style({visibility:"hidden"}),this.menu.hidden=!0,this.menu):this.menu}.bind(this),destroy:function(){return this.menu.outer_selector?(this.menu.inner_selector.remove(),this.menu.outer_selector.remove(),this.menu.inner_selector=null,this.menu.outer_selector=null,this.menu):this.menu}.bind(this),populate:function(){}.bind(this),setPopulate:function(t){return"function"==typeof t?(this.menu.populate=t,this.setOnclick(function(){this.menu.hidden?(this.menu.show(),this.highlight().update(),this.persist=!0):(this.menu.hide(),this.highlight(!1).update(),this.permanent||(this.persist=!1))}.bind(this))):this.setOnclick(),this}.bind(this)}},n.Dashboard.Components.add("title",function(t){n.Dashboard.Component.apply(this,arguments),this.show=function(){return this.div_selector=this.parent.selector.append("div").attr("class","lz-dashboard-title lz-dashboard-"+this.layout.position),this.title_selector=this.div_selector.append("h3"),this.update()},this.update=function(){var e=t.title.toString();return this.layout.subtitle&&(e+=" "+this.layout.subtitle+""),this.title_selector.html(e),this}}),n.Dashboard.Components.add("dimensions",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){var e=this.parent_plot.layout.width.toString().indexOf(".")===-1?this.parent_plot.layout.width:this.parent_plot.layout.width.toFixed(2),a=this.parent_plot.layout.height.toString().indexOf(".")===-1?this.parent_plot.layout.height:this.parent_plot.layout.height.toFixed(2);return this.selector.html(e+"px × "+a+"px"),t.class&&this.selector.attr("class",t.class),t.style&&this.selector.style(t.style),this}}),n.Dashboard.Components.add("region_scale",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)||null===this.parent_plot.state.start||null===this.parent_plot.state.end?this.selector.style("display","none"):(this.selector.style("display",null),this.selector.html(n.positionIntToString(this.parent_plot.state.end-this.parent_plot.state.start,null,!0))),t.class&&this.selector.attr("class",t.class),t.style&&this.selector.style(t.style),this}}),n.Dashboard.Components.add("download",function(a){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(a.color).setHtml("Download Image").setTitle("Download image of the current plot as locuszoom.svg").setOnMouseover(function(){this.button.selector.classed("lz-dashboard-button-gray-disabled",!0).html("Preparing Image"),this.generateBase64SVG().then(function(t){this.button.selector.attr("href","data:image/svg+xml;base64,\n"+t).classed("lz-dashboard-button-gray-disabled",!1).classed("lz-dashboard-button-gray-highlighted",!0).html("Download Image")}.bind(this))}.bind(this)).setOnMouseout(function(){this.button.selector.classed("lz-dashboard-button-gray-highlighted",!1)}.bind(this)),this.button.show(),this.button.selector.attr("href-lang","image/svg+xml").attr("download","locuszoom.svg"),this)},this.css_string="";for(var i in Object.keys(document.styleSheets))if(null!==document.styleSheets[i].href&&document.styleSheets[i].href.indexOf("locuszoom.css")!==-1){n.createCORSPromise("GET",document.styleSheets[i].href).then(function(t){this.css_string=t.replace(/[\r\n]/g," ").replace(/\s+/g," "),this.css_string.indexOf("/* ! LocusZoom HTML Styles */")&&(this.css_string=this.css_string.substring(0,this.css_string.indexOf("/* ! LocusZoom HTML Styles */")))}.bind(this));break}this.generateBase64SVG=function(){return e.fcall(function(){var e=this.parent.selector.append("div").style("display","none").html(this.parent_plot.svg.node().outerHTML);e.selectAll("g.lz-curtain").remove(),e.selectAll("g.lz-mouse_guide").remove(),e.selectAll("g.tick text").each(function(){var e=10*+t.select(this).attr("dy").substring(-2).slice(0,-2);t.select(this).attr("dy",e)});var a=t.select(e.select("svg").node().parentNode).html(),i='",n=a.indexOf(">")+1;return a=a.slice(0,n)+i+a.slice(n),e.remove(),btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode("0x"+e)}))}.bind(this))}}),n.Dashboard.Components.add("remove_panel",function(e){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(e.color).setHtml("×").setTitle("Remove panel").setOnclick(function(){if(!e.suppress_confirm&&!confirm("Are you sure you want to remove this panel? This cannot be undone!"))return!1;var a=this.parent_panel;return a.dashboard.hide(!0),t.select(a.parent.svg.node().parentNode).on("mouseover."+a.getBaseId()+".dashboard",null),t.select(a.parent.svg.node().parentNode).on("mouseout."+a.getBaseId()+".dashboard",null),a.parent.removePanel(a.id)}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("move_panel_up",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){if(this.button){var e=0===this.parent_panel.layout.y_index;return this.button.disable(e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("▴").setTitle("Move panel up").setOnclick(function(){this.parent_panel.moveUp(),this.update()}.bind(this)),this.button.show(),this.update()}}),n.Dashboard.Components.add("move_panel_down",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){if(this.button){var e=this.parent_panel.layout.y_index===this.parent_plot.panel_ids_by_y_index.length-1;return this.button.disable(e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("▾").setTitle("Move panel down").setOnclick(function(){this.parent_panel.moveDown(),this.update()}.bind(this)),this.button.show(),this.update()}}),n.Dashboard.Components.add("shift_region",function(t){return n.Dashboard.Component.apply(this,arguments),isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)?(this.update=function(){},void console.warn("Unable to add shift_region dashboard component: plot state does not have region bounds")):((isNaN(t.step)||0===t.step)&&(t.step=5e4),"string"!=typeof t.button_html&&(t.button_html=t.step>0?">":"<"),"string"!=typeof t.button_title&&(t.button_title="Shift region by "+(t.step>0?"+":"-")+n.positionIntToString(Math.abs(t.step),null,!0)),void(this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){this.parent_plot.applyState({start:Math.max(this.parent_plot.state.start+t.step,1),end:this.parent_plot.state.end+t.step})}.bind(this)),this.button.show(),this)}))}),n.Dashboard.Components.add("zoom_region",function(t){return n.Dashboard.Component.apply(this,arguments),isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)?(this.update=function(){},void console.warn("Unable to add zoom_region dashboard component: plot state does not have region bounds")):((isNaN(t.step)||0===t.step)&&(t.step=.2),"string"!=typeof t.button_html&&(t.button_html=t.step>0?"z–":"z+"),"string"!=typeof t.button_title&&(t.button_title="Zoom region "+(t.step>0?"out":"in")+" by "+(100*Math.abs(t.step)).toFixed(1)+"%"),void(this.update=function(){if(this.button){var e=!0,a=this.parent_plot.state.end-this.parent_plot.state.start;return t.step>0&&!isNaN(this.parent_plot.layout.max_region_scale)&&a>=this.parent_plot.layout.max_region_scale&&(e=!1),t.step<0&&!isNaN(this.parent_plot.layout.min_region_scale)&&a<=this.parent_plot.layout.min_region_scale&&(e=!1),this.button.disable(!e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){var e=this.parent_plot.state.end-this.parent_plot.state.start,a=1+t.step,i=e*a;isNaN(this.parent_plot.layout.max_region_scale)||(i=Math.min(i,this.parent_plot.layout.max_region_scale)),isNaN(this.parent_plot.layout.min_region_scale)||(i=Math.max(i,this.parent_plot.layout.min_region_scale));var n=Math.floor((i-e)/2);this.parent_plot.applyState({start:Math.max(this.parent_plot.state.start-n,1),end:this.parent_plot.state.end+n})}.bind(this)),this.button.show(),this}))}),n.Dashboard.Components.add("menu",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title),this.button.menu.setPopulate(function(){this.button.menu.inner_selector.html(t.menu_html)}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("covariates_model",function(t){n.Dashboard.Component.apply(this,arguments),this.initialize=function(){this.parent_plot.state.model=this.parent_plot.state.model||{},this.parent_plot.state.model.covariates=this.parent_plot.state.model.covariates||[],this.parent_plot.CovariatesModel={button:this,add:function(t){var e=JSON.parse(JSON.stringify(t));"object"==typeof t&&"string"!=typeof e.html&&(e.html="function"==typeof t.toHTML?t.toHTML():t.toString());for(var a=0;a1?"covariates":"covariate";t+=" ("+this.parent_plot.state.model.covariates.length+" "+e+")"}this.button.setHtml(t).disable(!1)}.bind(this),this.button.show(),this)}}),n.Dashboard.Components.add("toggle_split_tracks",function(t){if(n.Dashboard.Component.apply(this,arguments),t.data_layer_id||(t.data_layer_id="intervals"),!this.parent_panel.data_layers[t.data_layer_id])throw"Dashboard toggle split tracks component missing valid data layer ID";this.update=function(){var e=this.parent_panel.data_layers[t.data_layer_id],a=e.layout.split_tracks?"Merge Tracks":"Split Tracks";return this.button?(this.button.setHtml(a),this.button.show(),this.parent.position(),this):(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(a).setTitle("Toggle whether tracks are split apart or merged together").setOnclick(function(){e.toggleSplitTracks(),this.scale_timeout&&clearTimeout(this.scale_timeout);var t=e.layout.transition?+e.layout.transition.duration||0:0;this.scale_timeout=setTimeout(function(){this.parent_panel.scaleHeightToData(),this.parent_plot.positionPanels()}.bind(this),t),this.update()}.bind(this)),this.update())}}),n.Dashboard.Components.add("resize_to_data",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("Resize to Data").setTitle("Automatically resize this panel to fit the data its currently showing").setOnclick(function(){this.parent_panel.scaleHeightToData(),this.update()}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("toggle_legend",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){var e=this.parent_panel.legend.layout.hidden?"Show Legend":"Hide Legend";return this.button?(this.button.setHtml(e).show(),this.parent.position(),this):(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setTitle("Show or hide the legend for this panel").setOnclick(function(){this.parent_panel.legend.layout.hidden=!this.parent_panel.legend.layout.hidden,this.parent_panel.legend.render(),this.update()}.bind(this)),this.update())}}),n.Dashboard.Components.add("data_layers",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return"string"!=typeof t.button_html&&(t.button_html="Data Layers"),"string"!=typeof t.button_title&&(t.button_title="Manipulate Data Layers (sort, dim, show/hide, etc.)"),this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){this.button.menu.populate()}.bind(this)),this.button.menu.setPopulate(function(){this.button.menu.inner_selector.html("");var e=this.button.menu.inner_selector.append("table");return this.parent_panel.data_layer_ids_by_z_index.slice().reverse().forEach(function(a,i){var s=this.parent_panel.data_layers[a],o="string"!=typeof s.layout.name?s.id:s.layout.name,r=e.append("tr");r.append("td").html(o),t.statuses.forEach(function(t){var e,a,i,o=n.DataLayer.Statuses.adjectives.indexOf(t),l=n.DataLayer.Statuses.verbs[o];s.global_statuses[t]?(e=n.DataLayer.Statuses.menu_antiverbs[o],a="un"+l+"AllElements",i="-highlighted"):(e=n.DataLayer.Statuses.verbs[o],a=l+"AllElements",i=""),r.append("td").append("a").attr("class","lz-dashboard-button lz-dashboard-button-"+this.layout.color+i).style({"margin-left":"0em"}).on("click",function(){s[a](),this.button.menu.populate()}.bind(this)).html(e)}.bind(this));var l=0===i,h=i===this.parent_panel.data_layer_ids_by_z_index.length-1,d=r.append("td");d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-start lz-dashboard-button-"+this.layout.color+(h?"-disabled":"")).style({"margin-left":"0em"}).on("click",function(){s.moveDown(),this.button.menu.populate()}.bind(this)).html("▾").attr("title","Move layer down (further back)"),d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-middle lz-dashboard-button-"+this.layout.color+(l?"-disabled":"")).style({"margin-left":"0em"}).on("click",function(){s.moveUp(),this.button.menu.populate()}.bind(this)).html("▴").attr("title","Move layer up (further front)"),d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-end lz-dashboard-button-red").style({"margin-left":"0em"}).on("click",function(){return confirm("Are you sure you want to remove the "+o+" layer? This cannot be undone!")&&s.parent.removeDataLayer(a),this.button.menu.populate()}.bind(this)).html("×").attr("title","Remove layer")}.bind(this)),this}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("display_options",function(t){"string"!=typeof t.button_html&&(t.button_html="Display options"),"string"!=typeof t.button_title&&(t.button_title="Control how plot items are displayed"),n.Dashboard.Component.apply(this,arguments);var e=t.fields_whitelist||["color","fill_opacity","label","legend","point_shape","point_size","tooltip","tooltip_positioning"],a=this.parent_panel.data_layers[t.layer_name],i=a.layout,s={};e.forEach(function(t){var e=i[t];e&&(s[t]=JSON.parse(JSON.stringify(e)))}),this._selected_item="default";var o=this;this.button=new n.Dashboard.Component.Button(o).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){o.button.menu.populate()}),this.button.menu.setPopulate(function(){var t=Math.floor(1e4*Math.random()).toString();o.button.menu.inner_selector.html("");var e=o.button.menu.inner_selector.append("table"),i=o.layout,n=function(i,n,s){var r=e.append("tr");r.append("td").append("input").attr({type:"radio",name:"color-picker-"+t,value:s}).property("checked",s===o._selected_item).on("click",function(){Object.keys(n).forEach(function(t){a.layout[t]=n[t]}),o._selected_item=s,o.parent_panel.render();var t=o.parent_panel.legend;t&&n.legend&&t.render()}),r.append("td").text(i)},r=i.default_config_display_name||"Default style";return n(r,s,"default"),i.options.forEach(function(t,e){n(t.display_name,t.display,e)}),o}),this.update=function(){return this.button.show(),this}}),n.Legend=function(t){if(!(t instanceof n.Panel))throw"Unable to create legend, parent must be a locuszoom panel";return this.parent=t,this.id=this.parent.getBaseId()+".legend",this.parent.layout.legend=n.Layouts.merge(this.parent.layout.legend||{},n.Legend.DefaultLayout),this.layout=this.parent.layout.legend,this.selector=null,this.background_rect=null,this.elements=[],this.elements_group=null,this.hidden=!1,this.render()},n.Legend.DefaultLayout={orientation:"vertical",origin:{x:0,y:0},width:10,height:10,padding:5,label_size:12,hidden:!1},n.Legend.prototype.render=function(){this.selector||(this.selector=this.parent.svg.group.append("g").attr("id",this.parent.getBaseId()+".legend").attr("class","lz-legend")),this.background_rect||(this.background_rect=this.selector.append("rect").attr("width",100).attr("height",100).attr("class","lz-legend-background")),this.elements_group||(this.elements_group=this.selector.append("g")),this.elements.forEach(function(t){t.remove()}),this.elements=[];var e=+this.layout.padding||1,a=e,i=e,n=0;this.parent.data_layer_ids_by_z_index.slice().reverse().forEach(function(s){Array.isArray(this.parent.data_layers[s].layout.legend)&&this.parent.data_layers[s].layout.legend.forEach(function(s){var o=this.elements_group.append("g").attr("transform","translate("+a+","+i+")"),r=+s.label_size||+this.layout.label_size||12,l=0,h=r/2+e/2;if(n=Math.max(n,r+e),"line"===s.shape){var d=+s.length||16,u=r/4+e/2;o.append("path").attr("class",s.class||"").attr("d","M0,"+u+"L"+d+","+u).style(s.style||{}),l=d+e}else if("rect"===s.shape){var p=+s.width||16,c=+s.height||p;o.append("rect").attr("class",s.class||"").attr("width",p).attr("height",c).attr("fill",s.color||{}).style(s.style||{}),l=p+e,n=Math.max(n,c+e)}else if(t.svg.symbolTypes.indexOf(s.shape)!==-1){var y=+s.size||40,f=Math.ceil(Math.sqrt(y/Math.PI));o.append("path").attr("class",s.class||"").attr("d",t.svg.symbol().size(y).type(s.shape)).attr("transform","translate("+f+","+(f+e/2)+")").attr("fill",s.color||{}).style(s.style||{}),l=2*f+e,h=Math.max(2*f+e/2,h),n=Math.max(n,2*f+e)}o.append("text").attr("text-anchor","left").attr("class","lz-label").attr("x",l).attr("y",h).style({"font-size":r}).text(s.label);var g=o.node().getBoundingClientRect();if("vertical"===this.layout.orientation)i+=g.height+e,n=0;else{var _=this.layout.origin.x+a+g.width;a>e&&_>this.parent.layout.width&&(i+=n,a=e,o.attr("transform","translate("+a+","+i+")")),a+=g.width+3*e}this.elements.push(o)}.bind(this))}.bind(this));var s=this.elements_group.node().getBoundingClientRect();return this.layout.width=s.width+2*this.layout.padding,this.layout.height=s.height+2*this.layout.padding,this.background_rect.attr("width",this.layout.width).attr("height",this.layout.height),this.selector.style({visibility:this.layout.hidden?"hidden":"visible"}),this.position()},n.Legend.prototype.position=function(){if(!this.selector)return this;var t=this.selector.node().getBoundingClientRect();isNaN(+this.layout.pad_from_bottom)||(this.layout.origin.y=this.parent.layout.height-t.height-+this.layout.pad_from_bottom),isNaN(+this.layout.pad_from_right)||(this.layout.origin.x=this.parent.layout.width-t.width-+this.layout.pad_from_right),this.selector.attr("transform","translate("+this.layout.origin.x+","+this.layout.origin.y+")")},n.Legend.prototype.hide=function(){this.layout.hidden=!0,this.render()},n.Legend.prototype.show=function(){this.layout.hidden=!1,this.render()},n.Data=n.Data||{},n.DataSources=function(){this.sources={}},n.DataSources.prototype.addSource=function(t,e){return console.warn("Warning: .addSource() is deprecated. Use .add() instead"),this.add(t,e)},n.DataSources.prototype.add=function(t,e){return this.set(t,e)},n.DataSources.prototype.set=function(t,e){if(Array.isArray(e)){var a=n.KnownDataSources.create.apply(null,e);a.source_id=t,this.sources[t]=a}else null!==e?(e.source_id=t,this.sources[t]=e):delete this.sources[t];return this},n.DataSources.prototype.getSource=function(t){return console.warn("Warning: .getSource() is deprecated. Use .get() instead"),this.get(t)},n.DataSources.prototype.get=function(t){return this.sources[t]},n.DataSources.prototype.removeSource=function(t){return console.warn("Warning: .removeSource() is deprecated. Use .remove() instead"),this.remove(t)},n.DataSources.prototype.remove=function(t){return this.set(t,null)},n.DataSources.prototype.fromJSON=function(t){"string"==typeof t&&(t=JSON.parse(t)); +var e=this;return Object.keys(t).forEach(function(a){e.set(a,t[a])}),e},n.DataSources.prototype.keys=function(){return Object.keys(this.sources)},n.DataSources.prototype.toJSON=function(){return this.sources},n.Data.Field=function(t){var e=/^(?:([^:]+):)?([^:|]*)(\|.+)*$/.exec(t);this.full_name=t,this.namespace=e[1]||null,this.name=e[2]||null,this.transformations=[],"string"==typeof e[3]&&e[3].length>1&&(this.transformations=e[3].substring(1).split("|"),this.transformations.forEach(function(t,e){this.transformations[e]=n.TransformationFunctions.get(t)}.bind(this))),this.applyTransformations=function(t){return this.transformations.forEach(function(e){t=e(t)}),t},this.resolve=function(t){if("undefined"==typeof t[this.full_name]){var e=null;"undefined"!=typeof t[this.namespace+":"+this.name]?e=t[this.namespace+":"+this.name]:"undefined"!=typeof t[this.name]&&(e=t[this.name]),t[this.full_name]=this.applyTransformations(e)}return t[this.full_name]}},n.Data.Requester=function(t){function a(t){var e={},a=/^(?:([^:]+):)?([^:|]*)(\|.+)*$/;return t.forEach(function(t){var i=a.exec(t),s=i[1]||"base",o=i[2],r=n.TransformationFunctions.get(i[3]);"undefined"==typeof e[s]&&(e[s]={outnames:[],fields:[],trans:[]}),e[s].outnames.push(t),e[s].fields.push(o),e[s].trans.push(r)}),e}this.getData=function(i,n){for(var s=a(n),o=Object.keys(s).map(function(e){if(!t.get(e))throw"Datasource for namespace "+e+" not found";return t.get(e).getData(i,s[e].fields,s[e].outnames,s[e].trans)}),r=e.when({header:{},body:{},discrete:{}}),l=0;l1&&(2!==e.length||e.indexOf("isrefvar")===-1))throw"LD does not know how to get all fields: "+e.join(", ")},n.Data.LDSource.prototype.findMergeFields=function(t){var e=function(t){return function(){for(var e=arguments,a=0;a0){var i=Object.keys(t.body[0]),n=e(i);a.id=a.id||n(/\bvariant\b/)||n(/\bid\b/),a.position=a.position||n(/\bposition\b/i,/\bpos\b/i),a.pvalue=a.pvalue||n(/\bpvalue\b/i,/\blog_pvalue\b/i),a._names_=i}return a},n.Data.LDSource.prototype.findRequestedFields=function(t,e){for(var a={},i=0;ii&&(i=t[s][e]*a,n=s);return n},n=t.ldrefsource||e.header.ldrefsource||1,s=this.findRequestedFields(a),o=s.ldin;if("state"===o&&(o=t.ldrefvar||e.header.ldrefvar||"best"),"best"===o){if(!e.body)throw"No association data found to find best pvalue";var r=this.findMergeFields(e);if(!r.pvalue||!r.id){var l="";throw r.id||(l+=(l.length?", ":"")+"id"),r.pvalue||(l+=(l.length?", ":"")+"pvalue"),"Unable to find necessary column(s) for merge: "+l+" (available: "+r._names_+")"}o=e.body[i(e.body,r.pvalue)][r.id]}return e.header||(e.header={}),e.header.ldrefvar=o,this.url+"results/?filter=reference eq "+n+" and chromosome2 eq '"+t.chr+"' and position2 ge "+t.start+" and position2 le "+t.end+" and variant1 eq '"+o+"'&fields=chr,pos,rsquare"},n.Data.LDSource.prototype.combineChainBody=function(t,e,a,i){var n=this.findMergeFields(e),s=this.findRequestedFields(a,i);if(!n.position)throw"Unable to find position field for merge: "+n._names_;var o=function(t,e,a,i){for(var s=0,o=0;s0&&parseFloat(this.panels[i].layout.proportional_height)>0&&(s=Math.max(s,this.panels[i].layout.min_height/this.panels[i].layout.proportional_height));if(this.layout.min_width=Math.max(n,1),this.layout.min_height=Math.max(s,1),t.select(this.svg.node().parentNode).style({"min-width":this.layout.min_width+"px","min-height":this.layout.min_height+"px"}),!isNaN(e)&&e>=0&&!isNaN(a)&&a>=0){this.layout.width=Math.max(Math.round(+e),this.layout.min_width),this.layout.height=Math.max(Math.round(+a),this.layout.min_height),this.layout.aspect_ratio=this.layout.width/this.layout.height,this.layout.responsive_resize&&(this.svg&&(this.layout.width=Math.max(this.svg.node().parentNode.getBoundingClientRect().width,this.layout.min_width)),this.layout.height=this.layout.width/this.layout.aspect_ratio,this.layout.height0)e.layout.y_index<0&&(e.layout.y_index=Math.max(this.panel_ids_by_y_index.length+e.layout.y_index,0)),this.panel_ids_by_y_index.splice(e.layout.y_index,0,e.id),this.applyPanelYIndexesToPanelLayouts();else{var a=this.panel_ids_by_y_index.push(e.id);this.panels[e.id].layout.y_index=a-1}var i=null;return this.layout.panels.forEach(function(t,a){t.id===e.id&&(i=a)}),null===i&&(i=this.layout.panels.push(this.panels[e.id].layout)-1),this.panels[e.id].layout_idx=i,this.initialized&&(this.positionPanels(),this.panels[e.id].initialize(),this.panels[e.id].reMap(),this.setDimensions(this.layout.width,this.layout.height)),this.panels[e.id]},n.Plot.prototype.clearPanelData=function(t,e){e=e||"wipe";var a;a=t?[t]:Object.keys(this.panels);var i=this;return a.forEach(function(t){i.panels[t].data_layer_ids_by_z_index.forEach(function(a){var n=i.panels[t].data_layers[a];n.destroyAllTooltips(),delete i.layout.state[t+"."+a],"reset"===e&&n.setDefaultState()})}),this},n.Plot.prototype.removePanel=function(t){if(!this.panels[t])throw"Unable to remove panel, ID not found: "+t;return this.panel_boundaries.hide(),this.clearPanelData(t),this.panels[t].loader.hide(),this.panels[t].dashboard.destroy(!0),this.panels[t].curtain.hide(),this.panels[t].svg.container&&this.panels[t].svg.container.remove(),this.layout.panels.splice(this.panels[t].layout_idx,1),delete this.panels[t],delete this.layout.state[t],this.layout.panels.forEach(function(t,e){this.panels[t.id].layout_idx=e}.bind(this)),this.panel_ids_by_y_index.splice(this.panel_ids_by_y_index.indexOf(t),1),this.applyPanelYIndexesToPanelLayouts(),this.initialized&&(this.layout.min_height=this._base_layout.min_height,this.layout.min_width=this._base_layout.min_width,this.positionPanels(),this.setDimensions(this.layout.width,this.layout.height)),this},n.Plot.prototype.positionPanels=function(){var t,e={left:0,right:0};for(t in this.panels)null===this.panels[t].layout.proportional_height&&(this.panels[t].layout.proportional_height=this.panels[t].layout.height/this.layout.height),null===this.panels[t].layout.proportional_width&&(this.panels[t].layout.proportional_width=1),this.panels[t].layout.interaction.x_linked&&(e.left=Math.max(e.left,this.panels[t].layout.margin.left),e.right=Math.max(e.right,this.panels[t].layout.margin.right));var a=this.sumProportional("height");if(!a)return this;var i=1/a;for(t in this.panels)this.panels[t].layout.proportional_height*=i;var n=0;this.panel_ids_by_y_index.forEach(function(t){if(this.panels[t].setOrigin(0,n),this.panels[t].layout.proportional_origin.x=0,n+=this.panels[t].layout.height,this.panels[t].layout.interaction.x_linked){var a=Math.max(e.left-this.panels[t].layout.margin.left,0)+Math.max(e.right-this.panels[t].layout.margin.right,0);this.panels[t].layout.width+=a,this.panels[t].layout.margin.left=e.left,this.panels[t].layout.margin.right=e.right,this.panels[t].layout.cliparea.origin.x=e.left}}.bind(this));var s=n;return this.panel_ids_by_y_index.forEach(function(t){this.panels[t].layout.proportional_origin.y=this.panels[t].layout.origin.y/s}.bind(this)),this.setDimensions(),this.panel_ids_by_y_index.forEach(function(t){this.panels[t].setDimensions(this.layout.width*this.panels[t].layout.proportional_width,this.layout.height*this.panels[t].layout.proportional_height)}.bind(this)),this},n.Plot.prototype.initialize=function(){if(this.layout.responsive_resize&&t.select(this.container).classed("lz-container-responsive",!0),this.layout.mouse_guide){var e=this.svg.append("g").attr("class","lz-mouse_guide").attr("id",this.id+".mouse_guide"),a=e.append("rect").attr("class","lz-mouse_guide-vertical").attr("x",-1),i=e.append("rect").attr("class","lz-mouse_guide-horizontal").attr("y",-1);this.mouse_guide={svg:e,vertical:a,horizontal:i}}this.curtain=n.generateCurtain.call(this),this.loader=n.generateLoader.call(this),this.panel_boundaries={parent:this,hide_timeout:null,showing:!1,dragging:!1,selectors:[],corner_selector:null,show:function(){if(!this.showing&&!this.parent.curtain.showing){this.showing=!0,this.parent.panel_ids_by_y_index.forEach(function(e,a){var i=t.select(this.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip").attr("class","lz-panel-boundary").attr("title","Resize panel");i.append("span");var n=t.behavior.drag();n.on("dragstart",function(){this.dragging=!0}.bind(this)),n.on("dragend",function(){this.dragging=!1}.bind(this)),n.on("drag",function(){var e=this.parent.panels[this.parent.panel_ids_by_y_index[a]],i=e.layout.height;e.setDimensions(e.layout.width,e.layout.height+t.event.dy);var n=e.layout.height-i,s=this.parent.layout.height+n;this.parent.panel_ids_by_y_index.forEach(function(t,e){var i=this.parent.panels[this.parent.panel_ids_by_y_index[e]];i.layout.proportional_height=i.layout.height/s,e>a&&(i.setOrigin(i.layout.origin.x,i.layout.origin.y+n),i.dashboard.position())}.bind(this)),this.parent.positionPanels(),this.position()}.bind(this)),i.call(n),this.parent.panel_boundaries.selectors.push(i)}.bind(this));var e=t.select(this.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip").attr("class","lz-panel-corner-boundary").attr("title","Resize plot");e.append("span").attr("class","lz-panel-corner-boundary-outer"),e.append("span").attr("class","lz-panel-corner-boundary-inner");var a=t.behavior.drag();a.on("dragstart",function(){this.dragging=!0}.bind(this)),a.on("dragend",function(){this.dragging=!1}.bind(this)),a.on("drag",function(){this.setDimensions(this.layout.width+t.event.dx,this.layout.height+t.event.dy)}.bind(this.parent)),e.call(a),this.parent.panel_boundaries.corner_selector=e}return this.position()},position:function(){if(!this.showing)return this;var t=this.parent.getPageOrigin();this.selectors.forEach(function(e,a){var i=this.parent.panels[this.parent.panel_ids_by_y_index[a]].getPageOrigin(),n=t.x,s=i.y+this.parent.panels[this.parent.panel_ids_by_y_index[a]].layout.height-12,o=this.parent.layout.width-1;e.style({top:s+"px",left:n+"px",width:o+"px"}),e.select("span").style({width:o+"px"})}.bind(this));var e=10,a=16;return this.corner_selector.style({top:t.y+this.parent.layout.height-e-a+"px",left:t.x+this.parent.layout.width-e-a+"px"}),this},hide:function(){return this.showing?(this.showing=!1,this.selectors.forEach(function(t){t.remove()}),this.selectors=[],this.corner_selector.remove(),this.corner_selector=null,this):this}},this.layout.panel_boundaries&&(t.select(this.svg.node().parentNode).on("mouseover."+this.id+".panel_boundaries",function(){clearTimeout(this.panel_boundaries.hide_timeout),this.panel_boundaries.show()}.bind(this)),t.select(this.svg.node().parentNode).on("mouseout."+this.id+".panel_boundaries",function(){this.panel_boundaries.hide_timeout=setTimeout(function(){this.panel_boundaries.hide()}.bind(this),300)}.bind(this))),this.dashboard=new n.Dashboard(this).show();for(var s in this.panels)this.panels[s].initialize();var o="."+this.id;if(this.layout.mouse_guide){var r=function(){this.mouse_guide.vertical.attr("x",-1),this.mouse_guide.horizontal.attr("y",-1)}.bind(this),l=function(){var e=t.mouse(this.svg.node());this.mouse_guide.vertical.attr("x",e[0]),this.mouse_guide.horizontal.attr("y",e[1])}.bind(this);this.svg.on("mouseout"+o+"-mouse_guide",r).on("touchleave"+o+"-mouse_guide",r).on("mousemove"+o+"-mouse_guide",l)}var h=function(){this.stopDrag()}.bind(this),d=function(){if(this.interaction.dragging){var e=t.mouse(this.svg.node());t.event&&t.event.preventDefault(),this.interaction.dragging.dragged_x=e[0]-this.interaction.dragging.start_x,this.interaction.dragging.dragged_y=e[1]-this.interaction.dragging.start_y,this.panels[this.interaction.panel_id].render(),this.interaction.linked_panel_ids.forEach(function(t){this.panels[t].render()}.bind(this))}}.bind(this);this.svg.on("mouseup"+o,h).on("touchend"+o,h).on("mousemove"+o,d).on("touchmove"+o,d),t.select("body").empty()||t.select("body").on("mouseup"+o,h).on("touchend"+o,h),this.initialized=!0;var u=this.svg.node().getBoundingClientRect(),p=u.width?u.width:this.layout.width,c=u.height?u.height:this.layout.height;return this.setDimensions(p,c),this},n.Plot.prototype.refresh=function(){return this.applyState()},n.Plot.prototype.subscribeToData=function(t,e,a){a=a||{};var i=a.onerror||function(t){console.log("An error occurred while acting on an external callback",t)},n=this,s=function(){try{n.lzd.getData(n.state,t).then(function(t){e(a.discrete?t.discrete:t.body)}).catch(i)}catch(t){i(t)}};return this.on("data_rendered",s),s},n.Plot.prototype.applyState=function(t){if(t=t||{},"object"!=typeof t)throw"LocusZoom.applyState only accepts an object; "+typeof t+" given";var a=JSON.parse(JSON.stringify(this.state));for(var i in t)a[i]=t[i];a=n.validateState(a,this.layout);for(i in a)this.state[i]=a[i];this.emit("data_requested"),this.remap_promises=[],this.loading_data=!0;for(var s in this.panels)this.remap_promises.push(this.panels[s].reMap());return e.all(this.remap_promises).catch(function(t){console.error(t),this.curtain.drop(t),this.loading_data=!1}.bind(this)).then(function(){this.dashboard.update(),this.panel_ids_by_y_index.forEach(function(t){var e=this.panels[t];e.dashboard.update(),e.data_layer_ids_by_z_index.forEach(function(e){var a=this.data_layers[e],i=t+"."+e;for(var n in this.state[i])this.state[i].hasOwnProperty(n)&&Array.isArray(this.state[i][n])&&this.state[i][n].forEach(function(t){try{this.setElementStatus(n,this.getElementById(t),!0)}catch(t){console.error("Unable to apply state: "+i+", "+n)}}.bind(a))}.bind(e))}.bind(this)),this.emit("layout_changed"),this.emit("data_rendered"),this.emit("state_changed",t),this.loading_data=!1}.bind(this))},n.Plot.prototype.startDrag=function(e,a){e=e||null,a=a||null;var i=null;switch(a){case"background":case"x_tick":i="x";break;case"y1_tick":i="y1";break;case"y2_tick":i="y2"}if(!(e instanceof n.Panel&&i&&this.canInteract()))return this.stopDrag();var s=t.mouse(this.svg.node());return this.interaction={panel_id:e.id,linked_panel_ids:e.getLinkedPanelIds(i),dragging:{method:a,start_x:s[0],start_y:s[1],dragged_x:0,dragged_y:0,axis:i}},this.svg.style("cursor","all-scroll"),this},n.Plot.prototype.stopDrag=function(){if(!this.interaction.dragging)return this;if("object"!=typeof this.panels[this.interaction.panel_id])return this.interaction={},this;var t=this.panels[this.interaction.panel_id],e=function(e,a,i){t.data_layer_ids_by_z_index.forEach(function(n){t.data_layers[n].layout[e+"_axis"].axis===a&&(t.data_layers[n].layout[e+"_axis"].floor=i[0],t.data_layers[n].layout[e+"_axis"].ceiling=i[1],delete t.data_layers[n].layout[e+"_axis"].lower_buffer,delete t.data_layers[n].layout[e+"_axis"].upper_buffer,delete t.data_layers[n].layout[e+"_axis"].min_extent,delete t.data_layers[n].layout[e+"_axis"].ticks)})};switch(this.interaction.dragging.method){case"background":case"x_tick":0!==this.interaction.dragging.dragged_x&&(e("x",1,t.x_extent),this.applyState({start:t.x_extent[0],end:t.x_extent[1]}));break;case"y1_tick":case"y2_tick":if(0!==this.interaction.dragging.dragged_y){var a=parseInt(this.interaction.dragging.method[1]);e("y",a,t["y"+a+"_extent"])}}return this.interaction={},this.svg.style("cursor",null),this},n.Panel=function(t,e){if("object"!=typeof t)throw"Unable to create panel, invalid layout";if(this.parent=e||null,this.parent_plot=e,"string"==typeof t.id&&t.id.length){if(this.parent&&"undefined"!=typeof this.parent.panels[t.id])throw"Cannot create panel with id ["+t.id+"]; panel with that id already exists"}else if(this.parent){var a=null,i=function(){a="p"+Math.floor(Math.random()*Math.pow(10,8)),null!=a&&"undefined"==typeof this.parent.panels[a]||(a=i())}.bind(this);t.id=a}else t.id="p"+Math.floor(Math.random()*Math.pow(10,8));return this.id=t.id,this.initialized=!1,this.layout_idx=null,this.svg={},this.layout=n.Layouts.merge(t||{},n.Panel.DefaultLayout),this.parent?(this.state=this.parent.state,this.state_id=this.id,this.state[this.state_id]=this.state[this.state_id]||{}):(this.state=null,this.state_id=null),this.data_layers={},this.data_layer_ids_by_z_index=[],this.applyDataLayerZIndexesToDataLayerLayouts=function(){this.data_layer_ids_by_z_index.forEach(function(t,e){this.data_layers[t].layout.z_index=e}.bind(this))}.bind(this),this.data_promises=[],this.x_scale=null,this.y1_scale=null,this.y2_scale=null,this.x_extent=null,this.y1_extent=null,this.y2_extent=null,this.x_ticks=[],this.y1_ticks=[], +this.y2_ticks=[],this.zoom_timeout=null,this.getBaseId=function(){return this.parent.id+"."+this.id},this.event_hooks={layout_changed:[],data_requested:[],data_rendered:[],element_clicked:[],element_selection:[]},this.on=function(t,e){if(!Array.isArray(this.event_hooks[t]))throw"Unable to register event hook, invalid event: "+t.toString();if("function"!=typeof e)throw"Unable to register event hook, invalid hook function passed";return this.event_hooks[t].push(e),e},this.off=function(t,e){var a=this.event_hooks[t];if(!Array.isArray(a))throw"Unable to remove event hook, invalid event: "+t.toString();if(void 0===e)this.event_hooks[t]=[];else{var i=a.indexOf(e);if(i===-1)throw"The specified event listener is not registered and therefore cannot be removed";a.splice(i,1)}return this},this.emit=function(t,e,a){if(a=a||!1,!Array.isArray(this.event_hooks[t]))throw"LocusZoom attempted to throw an invalid event: "+t.toString();"boolean"==typeof e&&2===arguments.length&&(a=e,e=null);var i=this.getBaseId(),n=this,s={sourceID:i,data:e||null};return this.event_hooks[t].forEach(function(t){t.call(n,s)}),a&&this.parent&&this.parent.emit(t,s),this},this.getPageOrigin=function(){var t=this.parent.getPageOrigin();return{x:t.x+this.layout.origin.x,y:t.y+this.layout.origin.y}},this.initializeLayout(),this};n.Panel.DefaultLayout={title:{text:"",style:{},x:10,y:22},y_index:null,width:0,height:0,origin:{x:0,y:null},min_width:1,min_height:1,proportional_width:null,proportional_height:null,proportional_origin:{x:0,y:null},margin:{top:0,right:0,bottom:0,left:0},background_click:"clear_selections",dashboard:{components:[]},cliparea:{height:0,width:0,origin:{x:0,y:0}},axes:{x:{},y1:{},y2:{}},legend:null,interaction:{drag_background_to_pan:!1,drag_x_ticks_to_scale:!1,drag_y1_ticks_to_scale:!1,drag_y2_ticks_to_scale:!1,scroll_to_zoom:!1,x_linked:!1,y1_linked:!1,y2_linked:!1},data_layers:[]};n.Panel.prototype.initializeLayout=function(){if(0===this.layout.width&&null===this.layout.proportional_width&&(this.layout.proportional_width=1),0===this.layout.height&&null===this.layout.proportional_height){var t=Object.keys(this.parent.panels).length;t>0?this.layout.proportional_height=1/t:this.layout.proportional_height=1}return this.setDimensions(),this.setOrigin(),this.setMargin(),this.x_range=[0,this.layout.cliparea.width],this.y1_range=[this.layout.cliparea.height,0],this.y2_range=[this.layout.cliparea.height,0],["x","y1","y2"].forEach(function(t){Object.keys(this.layout.axes[t]).length&&this.layout.axes[t].render!==!1?(this.layout.axes[t].render=!0,this.layout.axes[t].label=this.layout.axes[t].label||null,this.layout.axes[t].label_function=this.layout.axes[t].label_function||null):this.layout.axes[t].render=!1}.bind(this)),this.layout.data_layers.forEach(function(t){this.addDataLayer(t)}.bind(this)),this},n.Panel.prototype.setDimensions=function(t,e){return"undefined"!=typeof t&&"undefined"!=typeof e?!isNaN(t)&&t>=0&&!isNaN(e)&&e>=0&&(this.layout.width=Math.max(Math.round(+t),this.layout.min_width),this.layout.height=Math.max(Math.round(+e),this.layout.min_height)):(null!==this.layout.proportional_width&&(this.layout.width=Math.max(this.layout.proportional_width*this.parent.layout.width,this.layout.min_width)),null!==this.layout.proportional_height&&(this.layout.height=Math.max(this.layout.proportional_height*this.parent.layout.height,this.layout.min_height))),this.layout.cliparea.width=Math.max(this.layout.width-(this.layout.margin.left+this.layout.margin.right),0),this.layout.cliparea.height=Math.max(this.layout.height-(this.layout.margin.top+this.layout.margin.bottom),0),this.svg.clipRect&&this.svg.clipRect.attr("width",this.layout.width).attr("height",this.layout.height),this.initialized&&(this.render(),this.curtain.update(),this.loader.update(),this.dashboard.update(),this.legend&&this.legend.position()),this},n.Panel.prototype.setOrigin=function(t,e){return!isNaN(t)&&t>=0&&(this.layout.origin.x=Math.max(Math.round(+t),0)),!isNaN(e)&&e>=0&&(this.layout.origin.y=Math.max(Math.round(+e),0)),this.initialized&&this.render(),this},n.Panel.prototype.setMargin=function(t,e,a,i){var n;return!isNaN(t)&&t>=0&&(this.layout.margin.top=Math.max(Math.round(+t),0)),!isNaN(e)&&e>=0&&(this.layout.margin.right=Math.max(Math.round(+e),0)),!isNaN(a)&&a>=0&&(this.layout.margin.bottom=Math.max(Math.round(+a),0)),!isNaN(i)&&i>=0&&(this.layout.margin.left=Math.max(Math.round(+i),0)),this.layout.margin.top+this.layout.margin.bottom>this.layout.height&&(n=Math.floor((this.layout.margin.top+this.layout.margin.bottom-this.layout.height)/2),this.layout.margin.top-=n,this.layout.margin.bottom-=n),this.layout.margin.left+this.layout.margin.right>this.layout.width&&(n=Math.floor((this.layout.margin.left+this.layout.margin.right-this.layout.width)/2),this.layout.margin.left-=n,this.layout.margin.right-=n),["top","right","bottom","left"].forEach(function(t){this.layout.margin[t]=Math.max(this.layout.margin[t],0)}.bind(this)),this.layout.cliparea.width=Math.max(this.layout.width-(this.layout.margin.left+this.layout.margin.right),0),this.layout.cliparea.height=Math.max(this.layout.height-(this.layout.margin.top+this.layout.margin.bottom),0),this.layout.cliparea.origin.x=this.layout.margin.left,this.layout.cliparea.origin.y=this.layout.margin.top,this.initialized&&this.render(),this},n.Panel.prototype.setTitle=function(t){if("string"==typeof this.layout.title){var e=this.layout.title;this.layout.title={text:e,x:0,y:0,style:{}}}return"string"==typeof t?this.layout.title.text=t:"object"==typeof t&&null!==t&&(this.layout.title=n.Layouts.merge(t,this.layout.title)),this.layout.title.text.length?this.title.attr("display",null).attr("x",parseFloat(this.layout.title.x)).attr("y",parseFloat(this.layout.title.y)).style(this.layout.title.style).text(this.layout.title.text):this.title.attr("display","none"),this},n.Panel.prototype.initialize=function(){this.svg.container=this.parent.svg.append("g").attr("id",this.getBaseId()+".panel_container").attr("transform","translate("+(this.layout.origin.x||0)+","+(this.layout.origin.y||0)+")");var t=this.svg.container.append("clipPath").attr("id",this.getBaseId()+".clip");if(this.svg.clipRect=t.append("rect").attr("width",this.layout.width).attr("height",this.layout.height),this.svg.group=this.svg.container.append("g").attr("id",this.getBaseId()+".panel").attr("clip-path","url(#"+this.getBaseId()+".clip)"),this.curtain=n.generateCurtain.call(this),this.loader=n.generateLoader.call(this),this.dashboard=new n.Dashboard(this),this.inner_border=this.svg.group.append("rect").attr("class","lz-panel-background").on("click",function(){"clear_selections"===this.layout.background_click&&this.clearSelections()}.bind(this)),this.title=this.svg.group.append("text").attr("class","lz-panel-title"),"undefined"!=typeof this.layout.title&&this.setTitle(),this.svg.x_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".x_axis").attr("class","lz-x lz-axis"),this.layout.axes.x.render&&(this.svg.x_axis_label=this.svg.x_axis.append("text").attr("class","lz-x lz-axis lz-label").attr("text-anchor","middle")),this.svg.y1_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".y1_axis").attr("class","lz-y lz-y1 lz-axis"),this.layout.axes.y1.render&&(this.svg.y1_axis_label=this.svg.y1_axis.append("text").attr("class","lz-y1 lz-axis lz-label").attr("text-anchor","middle")),this.svg.y2_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".y2_axis").attr("class","lz-y lz-y2 lz-axis"),this.layout.axes.y2.render&&(this.svg.y2_axis_label=this.svg.y2_axis.append("text").attr("class","lz-y2 lz-axis lz-label").attr("text-anchor","middle")),this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].initialize()}.bind(this)),this.legend=null,this.layout.legend&&(this.legend=new n.Legend(this)),this.layout.interaction.drag_background_to_pan){var e="."+this.parent.id+"."+this.id+".interaction.drag",a=function(){this.parent.startDrag(this,"background")}.bind(this);this.svg.container.select(".lz-panel-background").on("mousedown"+e+".background",a).on("touchstart"+e+".background",a)}return this},n.Panel.prototype.resortDataLayers=function(){var e=[];this.data_layer_ids_by_z_index.forEach(function(t){e.push(this.data_layers[t].layout.z_index)}.bind(this)),this.svg.group.selectAll("g.lz-data_layer-container").data(e).sort(t.ascending),this.applyDataLayerZIndexesToDataLayerLayouts()},n.Panel.prototype.getLinkedPanelIds=function(t){t=t||null;var e=[];return["x","y1","y2"].indexOf(t)===-1?e:this.layout.interaction[t+"_linked"]?(this.parent.panel_ids_by_y_index.forEach(function(a){a!==this.id&&this.parent.panels[a].layout.interaction[t+"_linked"]&&e.push(a)}.bind(this)),e):e},n.Panel.prototype.moveUp=function(){return this.parent.panel_ids_by_y_index[this.layout.y_index-1]&&(this.parent.panel_ids_by_y_index[this.layout.y_index]=this.parent.panel_ids_by_y_index[this.layout.y_index-1],this.parent.panel_ids_by_y_index[this.layout.y_index-1]=this.id,this.parent.applyPanelYIndexesToPanelLayouts(),this.parent.positionPanels()),this},n.Panel.prototype.moveDown=function(){return this.parent.panel_ids_by_y_index[this.layout.y_index+1]&&(this.parent.panel_ids_by_y_index[this.layout.y_index]=this.parent.panel_ids_by_y_index[this.layout.y_index+1],this.parent.panel_ids_by_y_index[this.layout.y_index+1]=this.id,this.parent.applyPanelYIndexesToPanelLayouts(),this.parent.positionPanels()),this},n.Panel.prototype.addDataLayer=function(t){if("object"!=typeof t||"string"!=typeof t.id||!t.id.length)throw"Invalid data layer layout passed to LocusZoom.Panel.prototype.addDataLayer()";if("undefined"!=typeof this.data_layers[t.id])throw"Cannot create data_layer with id ["+t.id+"]; data layer with that id already exists in the panel";if("string"!=typeof t.type)throw"Invalid data layer type in layout passed to LocusZoom.Panel.prototype.addDataLayer()";"object"!=typeof t.y_axis||"undefined"!=typeof t.y_axis.axis&&[1,2].indexOf(t.y_axis.axis)!==-1||(t.y_axis.axis=1);var e=n.DataLayers.get(t.type,t,this);if(this.data_layers[e.id]=e,null!==e.layout.z_index&&!isNaN(e.layout.z_index)&&this.data_layer_ids_by_z_index.length>0)e.layout.z_index<0&&(e.layout.z_index=Math.max(this.data_layer_ids_by_z_index.length+e.layout.z_index,0)),this.data_layer_ids_by_z_index.splice(e.layout.z_index,0,e.id),this.data_layer_ids_by_z_index.forEach(function(t,e){this.data_layers[t].layout.z_index=e}.bind(this));else{var a=this.data_layer_ids_by_z_index.push(e.id);this.data_layers[e.id].layout.z_index=a-1}var i=null;return this.layout.data_layers.forEach(function(t,a){t.id===e.id&&(i=a)}),null===i&&(i=this.layout.data_layers.push(this.data_layers[e.id].layout)-1),this.data_layers[e.id].layout_idx=i,this.data_layers[e.id]},n.Panel.prototype.removeDataLayer=function(t){if(!this.data_layers[t])throw"Unable to remove data layer, ID not found: "+t;return this.data_layers[t].destroyAllTooltips(),this.data_layers[t].svg.container&&this.data_layers[t].svg.container.remove(),this.layout.data_layers.splice(this.data_layers[t].layout_idx,1),delete this.state[this.data_layers[t].state_id],delete this.data_layers[t],this.data_layer_ids_by_z_index.splice(this.data_layer_ids_by_z_index.indexOf(t),1),this.applyDataLayerZIndexesToDataLayerLayouts(),this.layout.data_layers.forEach(function(t,e){this.data_layers[t.id].layout_idx=e}.bind(this)),this},n.Panel.prototype.clearSelections=function(){return this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].setAllElementStatus("selected",!1)}.bind(this)),this},n.Panel.prototype.reMap=function(){this.emit("data_requested"),this.data_promises=[],this.curtain.hide();for(var t in this.data_layers)try{this.data_promises.push(this.data_layers[t].reMap())}catch(t){console.warn(t),this.curtain.show(t)}return e.all(this.data_promises).then(function(){this.initialized=!0,this.render(),this.emit("layout_changed",!0),this.emit("data_rendered")}.bind(this)).catch(function(t){console.warn(t),this.curtain.show(t)}.bind(this))},n.Panel.prototype.generateExtents=function(){["x","y1","y2"].forEach(function(t){this[t+"_extent"]=null}.bind(this));for(var e in this.data_layers){var a=this.data_layers[e];if(a.layout.x_axis&&!a.layout.x_axis.decoupled&&(this.x_extent=t.extent((this.x_extent||[]).concat(a.getAxisExtent("x")))),a.layout.y_axis&&!a.layout.y_axis.decoupled){var i="y"+a.layout.y_axis.axis;this[i+"_extent"]=t.extent((this[i+"_extent"]||[]).concat(a.getAxisExtent("y")))}}return this.layout.axes.x&&"state"===this.layout.axes.x.extent&&(this.x_extent=[this.state.start,this.state.end]),this},n.Panel.prototype.generateTicks=function(t){if(this.layout.axes[t].ticks){var e=this.layout.axes[t],a=e.ticks;if(Array.isArray(a))return a;if("object"==typeof a){var i=this,s={position:a.position},o=this.data_layer_ids_by_z_index.reduce(function(e,a){var n=i.data_layers[a];return e.concat(n.getTicks(t,s))},[]);return o.map(function(t){var e={};return e=n.Layouts.merge(e,a),n.Layouts.merge(e,t)})}}return this[t+"_extent"]?n.prettyTicks(this[t+"_extent"],"both"):[]},n.Panel.prototype.render=function(){this.svg.container.attr("transform","translate("+this.layout.origin.x+","+this.layout.origin.y+")"),this.svg.clipRect.attr("width",this.layout.width).attr("height",this.layout.height),this.inner_border.attr("x",this.layout.margin.left).attr("y",this.layout.margin.top).attr("width",this.layout.width-(this.layout.margin.left+this.layout.margin.right)).attr("height",this.layout.height-(this.layout.margin.top+this.layout.margin.bottom)),this.layout.inner_border&&this.inner_border.style({"stroke-width":1,stroke:this.layout.inner_border}),this.setTitle(),this.generateExtents();var e=function(t,e){var a=Math.pow(-10,e),i=Math.pow(-10,-e),n=Math.pow(10,-e),s=Math.pow(10,e);return t===1/0&&(t=s),t===-(1/0)&&(t=a),0===t&&(t=n),t>0&&(t=Math.max(Math.min(t,s),n)),t<0&&(t=Math.max(Math.min(t,i),a)),t},a={};if(this.x_extent){var i={start:0,end:this.layout.cliparea.width};this.layout.axes.x.range&&(i.start=this.layout.axes.x.range.start||i.start,i.end=this.layout.axes.x.range.end||i.end),a.x=[i.start,i.end],a.x_shifted=[i.start,i.end]}if(this.y1_extent){var n={start:this.layout.cliparea.height,end:0};this.layout.axes.y1.range&&(n.start=this.layout.axes.y1.range.start||n.start,n.end=this.layout.axes.y1.range.end||n.end),a.y1=[n.start,n.end],a.y1_shifted=[n.start,n.end]}if(this.y2_extent){var s={start:this.layout.cliparea.height,end:0};this.layout.axes.y2.range&&(s.start=this.layout.axes.y2.range.start||s.start,s.end=this.layout.axes.y2.range.end||s.end),a.y2=[s.start,s.end],a.y2_shifted=[s.start,s.end]}if(this.parent.interaction.panel_id&&(this.parent.interaction.panel_id===this.id||this.parent.interaction.linked_panel_ids.indexOf(this.id)!==-1)){var o,r=null;if(this.parent.interaction.zooming&&"function"==typeof this.x_scale){var l=Math.abs(this.x_extent[1]-this.x_extent[0]),h=Math.round(this.x_scale.invert(a.x_shifted[1]))-Math.round(this.x_scale.invert(a.x_shifted[0])),d=this.parent.interaction.zooming.scale,u=Math.floor(h*(1/d));d<1&&!isNaN(this.parent.layout.max_region_scale)?d=1/(Math.min(u,this.parent.layout.max_region_scale)/h):d>1&&!isNaN(this.parent.layout.min_region_scale)&&(d=1/(Math.max(u,this.parent.layout.min_region_scale)/h));var p=Math.floor(l*d);o=this.parent.interaction.zooming.center-this.layout.margin.left-this.layout.origin.x;var c=o/this.layout.cliparea.width,y=Math.max(Math.floor(this.x_scale.invert(a.x_shifted[0])-(p-h)*c),1);a.x_shifted=[this.x_scale(y),this.x_scale(y+p)]}else if(this.parent.interaction.dragging)switch(this.parent.interaction.dragging.method){case"background":a.x_shifted[0]=+this.parent.interaction.dragging.dragged_x,a.x_shifted[1]=this.layout.cliparea.width+this.parent.interaction.dragging.dragged_x;break;case"x_tick":t.event&&t.event.shiftKey?(a.x_shifted[0]=+this.parent.interaction.dragging.dragged_x,a.x_shifted[1]=this.layout.cliparea.width+this.parent.interaction.dragging.dragged_x):(o=this.parent.interaction.dragging.start_x-this.layout.margin.left-this.layout.origin.x,r=e(o/(o+this.parent.interaction.dragging.dragged_x),3),a.x_shifted[0]=0,a.x_shifted[1]=Math.max(this.layout.cliparea.width*(1/r),1));break;case"y1_tick":case"y2_tick":var f="y"+this.parent.interaction.dragging.method[1]+"_shifted";t.event&&t.event.shiftKey?(a[f][0]=this.layout.cliparea.height+this.parent.interaction.dragging.dragged_y,a[f][1]=+this.parent.interaction.dragging.dragged_y):(o=this.layout.cliparea.height-(this.parent.interaction.dragging.start_y-this.layout.margin.top-this.layout.origin.y),r=e(o/(o-this.parent.interaction.dragging.dragged_y),3),a[f][0]=this.layout.cliparea.height,a[f][1]=this.layout.cliparea.height-this.layout.cliparea.height*(1/r))}}if(["x","y1","y2"].forEach(function(e){this[e+"_extent"]&&(this[e+"_scale"]=t.scale.linear().domain(this[e+"_extent"]).range(a[e+"_shifted"]),this[e+"_extent"]=[this[e+"_scale"].invert(a[e][0]),this[e+"_scale"].invert(a[e][1])],this[e+"_scale"]=t.scale.linear().domain(this[e+"_extent"]).range(a[e]),this.renderAxis(e))}.bind(this)),this.layout.interaction.scroll_to_zoom){var g=function(){if(!t.event.shiftKey)return void(this.parent.canInteract(this.id)&&this.loader.show("Press [SHIFT] while scrolling to zoom").hide(1e3));if(t.event.preventDefault(),this.parent.canInteract(this.id)){var e=t.mouse(this.svg.container.node()),a=Math.max(-1,Math.min(1,t.event.wheelDelta||-t.event.detail||-t.event.deltaY));0!==a&&(this.parent.interaction={panel_id:this.id,linked_panel_ids:this.getLinkedPanelIds("x"),zooming:{scale:a<1?.9:1.1,center:e[0]}},this.render(),this.parent.interaction.linked_panel_ids.forEach(function(t){this.parent.panels[t].render()}.bind(this)),null!==this.zoom_timeout&&clearTimeout(this.zoom_timeout),this.zoom_timeout=setTimeout(function(){this.parent.interaction={},this.parent.applyState({start:this.x_extent[0],end:this.x_extent[1]})}.bind(this),500))}}.bind(this);this.zoom_listener=t.behavior.zoom(),this.svg.container.call(this.zoom_listener).on("wheel.zoom",g).on("mousewheel.zoom",g).on("DOMMouseScroll.zoom",g)}return this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].draw().render()}.bind(this)),this},n.Panel.prototype.renderAxis=function(e){if(["x","y1","y2"].indexOf(e)===-1)throw"Unable to render axis; invalid axis identifier: "+e;var a=this.layout.axes[e].render&&"function"==typeof this[e+"_scale"]&&!isNaN(this[e+"_scale"](0));if(this[e+"_axis"]&&this.svg.container.select("g.lz-axis.lz-"+e).style("display",a?null:"none"),!a)return this;var i={x:{position:"translate("+this.layout.margin.left+","+(this.layout.height-this.layout.margin.bottom)+")",orientation:"bottom",label_x:this.layout.cliparea.width/2,label_y:this.layout.axes[e].label_offset||0,label_rotate:null},y1:{position:"translate("+this.layout.margin.left+","+this.layout.margin.top+")",orientation:"left",label_x:-1*(this.layout.axes[e].label_offset||0),label_y:this.layout.cliparea.height/2,label_rotate:-90},y2:{position:"translate("+(this.layout.width-this.layout.margin.right)+","+this.layout.margin.top+")",orientation:"right",label_x:this.layout.axes[e].label_offset||0,label_y:this.layout.cliparea.height/2,label_rotate:-90}};this[e+"_ticks"]=this.generateTicks(e);var s=function(t){for(var e=0;e",">=","%","matches","filterIndexes","filterElements","verb","adjective","antiverb","setElementStatus","setElementStatusByFilters","setAllElementStatus","toggle","get_element_id_error","element_status_node_id","element_status_idx","splice","emit","status_ids","applyBehaviors","selection","event_match","executeBehaviors","requiredKeyStates","ctrl","ctrlKey","shiftKey","behavior","current_status_boolean","href","target","window","location","panel_origin","exportData","format","default_format","toLowerCase","e","jsonified","delimiter","record","draw","cliparea","reMap","lzd","getData","new_data","DataLayers","datalayers","datalayer","extend","parent_name","overrides","child","render","self","trackData","enter","exit","arrow_type","arrow_top","arrow_left","arrow_width","stroke_width","tooltip_box","data_layer_height","data_layer_width","x_center","x_scale","y_center","offset_right","offset_left","confidence_intervals","show_no_significance_line","border_radius","y_scale","sqrt","PI","ci_selection","ci_transform","ci_width","ci_height","duration","ease","points_selection","initial_y","symbol","label_font_size","label_exon_spacing","exon_height","bounding_box_padding","track_vertical_spacing","getTrackHeight","transcript_idx","tracks","gene_track_index","1","assignTracks","getLabelWidth","gene_name","font_size","temp_text","label_width","getBBox","g","gene_id","split","gene_version","transcript_id","transcripts","display_range","text_anchor","centered_margin","display_domain","invert","track","potential_track","collision_on_potential_track","placed_gene","min_start","max_end","t","exons","bboxes","boundaries","labels","strand","exon_id","clickareas","gene_bbox_id","gene_bbox","gene_center_x","chromosome_fill_colors","light","dark","chromosome_label_colors","genome_start","genome_end","chromosomes","variant_parts","variant","track_split_order","track_split_legend_to_y_axis","track_height","previous_tracks","interval_track_index","track_split_field_index","reverse","placed_interval","psuedoElement","sharedstatusnode_style","display","interval","statusnode_style","statusnodes","rects","interval_name","updateSplitTrackAxis","interval_bbox","interval_center_x","legend_axis","track_spacing","target_height","scaleHeightToData","toggleSplitTracks","interpolate","hitarea_width","mouse_event","line","tooltip_timeout","getMouseDisplayAndData","mouse","slope","x_field","y_field","bisect","bisector","datum","startDatum","endDatum","interpolateNumber","x_precision","toPrecision","y_precision","dd","min_arrow_left","max_arrow_left","path","hitarea","hitarea_line","path_class","global_status","decoupled","x_extent","y_extent","x_range","y_range","flip_labels","handle_lines","Boolean","min_x","max_x","flip","dn","dnl","dnx","text_swing","dnlx2","line_swing","label_texts","da","dax","abound","dal","label_lines","db","bbound","collision","separate_labels","seperate_iterations","alpha","again","delta","sign","adjust","new_a_y","new_b_y","min_y","max_y","label_elements","label_line","filtered_data","label_groups","x1","x2","makeLDReference","ref","applyState","ldrefvar","_prepareData","xField","sourceData","sort","ak","bk","av","bv","_generateCategoryBounds","uniqueCategories","item","category","bounds","categoryNames","_setDynamicColorScheme","colorParams","baseParams","parameters_categories_hash","every","colors","color_scale","scale","category10","category20","concat","categoryBounds","_categories","knownCategories","knownColors","xPos","diff","KnownDataSources","sources","findSourceByName","SOURCE_NAME","source","warn","source_name","newObj","params","Function","getAll","setAll","clear","TransformationFunctions","getTrans","fun","parseTrans","parseTransString","result","funs","substring","fn","ceil","toExponential","str","encodeURIComponent","s","functions","input","threshold","prev","curr","nullval","upper_idx","brk","normalized_input","isFinite","Dashboard","hide_timeout","persist","component","Components","shouldPersist","visibility","destroy","force","Component","parent_panel","parent_svg","button","menu","Button","parent_dashboard","tag","setTag","setHtml","setText","setHTML","setTitle","setColor","setStyle","getClass","permanent","setPermanent","bool","setStatus","highlight","disable","setOnMouseover","setOnMouseout","setOnclick","preUpdate","postUpdate","outer_selector","inner_selector","scroll_position","scrollTop","scrollbar_padding","menu_height_padding","page_scroll_top","document","documentElement","container_offset","getContainerOffset","dashboard_client_rect","button_client_rect","menu_client_rect","total_content_height","scrollHeight","base_max_width","container_max_width","content_max_width","base_max_height","max_height","setPopulate","menu_populate_function","div_selector","title_selector","display_width","display_height","generateBase64SVG","base64_string","css_string","stylesheet","styleSheets","fcall","outerHTML","dy","initial_html","style_def","insert_at","btoa","p1","String","fromCharCode","suppress_confirm","confirm","removePanel","is_at_top","y_index","is_at_bottom","panel_ids_by_y_index","can_zoom","current_region_scale","zoom_factor","new_region_scale","menu_html","model","covariates","CovariatesModel","element_reference","updateComponent","removeByIdx","removeAll","table","covariate","row","cov","scale_timeout","status_adj","status_idx","status_verb","at_top","at_bottom","td","removeDataLayer","allowed_fields","fields_whitelist","dataLayer","layer_name","dataLayerLayout","defaultConfig","configSlot","_selected_item","uniqueID","random","menuLayout","renderRow","display_name","display_options","row_id","field_name","defaultName","default_config_display_name","options","Legend","background_rect","elements","elements_group","label_size","line_height","label_x","label_y","path_y","symbolTypes","radius","bcr","right_x","pad_from_right","DataSources","addSource","ns","dsobj","getSource","removeSource","fromJSON","ds","toJSON","parts","full_name","applyTransformations","Requester","split_requests","requests","raw","trans","outnames","promises","when","Source","enableCache","dependentSource","parseInit","init","getCacheKey","chain","getURL","fetchRequest","getRequest","req","cacheKey","_cachedKey","_cachedResponse","preGetData","pre","resp","parseResponse","json","records","parseData","parseArraysToObjects","N","sameLength","j","parseObjectsToObjects","fieldFound","v","prepareData","constructorFun","uniqueName","getPrototypeOf","AssociationSource","unshift","analysis","LDSource","findMergeFields","exactMatch","arr","regexes","dataFields","position_field","pvalue","pvalue_field","_names_","names","nameMatch","findRequestedFields","isrefvarin","isrefvarout","ldin","ldout","findExtremeValue","pval","extremeVal","extremeIdx","refSource","ldrefsource","reqFields","refVar","columns","leftJoin","lfield","rfield","position2","tagRefVariant","refvar","idfield","outname","GeneSource","GeneConstraintSource","geneids","substr","Content-Type","constraint_fields","RecombinationRateSource","recombsource","IntervalSource","bedtracksource","StaticSource","_data","PheWASSource","build","applyPanelYIndexesToPanelLayouts","pid","remap_promises","window_onresize","event_hooks","layout_changed","data_requested","data_rendered","element_clicked","hook","context","hookToRun","bounding_client_rect","x_offset","scrollLeft","y_offset","offsetParent","offsetTop","offsetLeft","canInteract","loading_data","zooming","initializeLayout","aspect_ratio","sumProportional","total","rescaleSVG","clientRect","panel_layout","addPanel","min-width","min-height","panel_width","panel_height","setOrigin","proportional_origin","clearPanelData","panelId","mode","panelsList","dlid","layer","x_linked_margins","total_proportional_height","proportional_adjustment","calculated_plot_height","mouse_guide_svg","mouse_guide_vertical_svg","mouse_guide_horizontal_svg","vertical","horizontal","selectors","corner_selector","panel_idx","panel_resize_drag","drag","this_panel","original_panel_height","panel_height_change","new_calculated_plot_height","loop_panel_id","loop_panel_idx","loop_panel","corner_drag","dx","plot_page_origin","panel_page_origin","corner_padding","corner_size","mouseout_mouse_guide","mousemove_mouse_guide","coords","mouseup","stopDrag","mousemove","preventDefault","dragged_x","start_x","dragged_y","start_y","linked_panel_ids","client_rect","state_changes","all","catch","drop","startDrag","getLinkedPanelIds","overrideAxisLayout","axis_number","y_axis_number","generateID","applyDataLayerZIndexesToDataLayerLayouts","data_promises","y1_scale","y2_scale","y1_extent","y2_extent","x_ticks","y1_ticks","y2_ticks","zoom_timeout","plot_origin","background_click","y1_linked","y2_linked","panel_count","setMargin","y1_range","y2_range","label_function","data_layer_layout","addDataLayer","clipPath","clearSelections","x_axis_label","y1_axis","y1_axis_label","y2_axis","y2_axis_label","mousedown","ascending","generateExtents","generateTicks","baseTickConfig","combinedTicks","acc","nextLayer","itemConfig","constrain","limit_exponent","neg_min","neg_max","pos_min","pos_max","Infinity","ranges","base_x_range","x_shifted","base_y1_range","y1_shifted","base_y2_range","y2_shifted","anchor","scalar","current_extent_size","current_scaled_extent_size","potential_extent_size","new_extent_size","offset_ratio","new_x_extent_start","y_shifted","linear","domain","renderAxis","zoom_handler","wheelDelta","detail","deltaY","zoom_listener","zoom","canRender","axis_params","label_rotate","ticksAreAllNumbers","orient","tickPadding","tickValues","tickFormat","tick_selector","tick_mouseover","focus","cursor","dh","addBasicLoader","show_immediately"],"mappings":"4qBAGA,IAAAA,IACAC,QAAA,QAYAD,GAAAE,SAAA,SAAAC,EAAAC,EAAAC,GACA,GAAA,mBAAAF,GACA,KAAA,yCAGAG,GAAAC,OAAAJ,GAAAK,KAAA,GACA,IAAAC,EAkCA,OAjCAH,GAAAC,OAAAJ,GAAAO,KAAA,WAEA,GAAA,mBAAAC,MAAAC,OAAAC,GAAA,CAEA,IADA,GAAAC,GAAA,GACAR,EAAAC,OAAA,OAAAO,GAAAC,SAAAD,GACAH,MAAAK,KAAA,KAAA,OAAAF,GAMA,GAHAL,EAAA,GAAAT,GAAAiB,KAAAN,KAAAC,OAAAC,GAAAT,EAAAC,GACAI,EAAAS,UAAAP,KAAAC,OAEA,mBAAAD,MAAAC,OAAAO,SAAA,mBAAAR,MAAAC,OAAAO,QAAAC,OAAA,CACA,GAAAC,GAAArB,EAAAsB,mBAAAX,KAAAC,OAAAO,QAAAC,OACAG,QAAAC,KAAAH,GAAAI,QAAA,SAAAC,GACAjB,EAAAkB,MAAAD,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WACA3K,KAAA4L,OAAAtB,KAAA,cAAA6B,WACAtB,KAAA7K,OACAA,KAAA2K,GAAA,gBAAA,WACA3K,KAAA4L,OAAAhB,QACAC,KAAA7K,OACAA","file":"locuszoom.app.min.js","sourcesContent":["/**\n * @namespace\n */\nvar LocusZoom = {\n version: \"0.7.2\"\n};\n\n/**\n * Populate a single element with a LocusZoom plot.\n * selector can be a string for a DOM Query or a d3 selector.\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot} The newly created plot instance\n */\nLocusZoom.populate = function(selector, datasource, layout) {\n if (typeof selector == \"undefined\"){\n throw (\"LocusZoom.populate selector not defined\");\n }\n // Empty the selector of any existing content\n d3.select(selector).html(\"\");\n var plot;\n d3.select(selector).call(function(){\n // Require each containing element have an ID. If one isn't present, create one.\n if (typeof this.node().id == \"undefined\"){\n var iterator = 0;\n while (!d3.select(\"#lz-\" + iterator).empty()){ iterator++; }\n this.attr(\"id\", \"#lz-\" + iterator);\n }\n // Create the plot\n plot = new LocusZoom.Plot(this.node().id, datasource, layout);\n plot.container = this.node();\n // Detect data-region and fill in state values if present\n if (typeof this.node().dataset !== \"undefined\" && typeof this.node().dataset.region !== \"undefined\"){\n var parsed_state = LocusZoom.parsePositionQuery(this.node().dataset.region);\n Object.keys(parsed_state).forEach(function(key){\n plot.state[key] = parsed_state[key];\n });\n }\n // Add an SVG to the div and set its dimensions\n plot.svg = d3.select(\"div#\" + plot.id)\n .append(\"svg\")\n .attr(\"version\", \"1.1\")\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .attr(\"id\", plot.id + \"_svg\").attr(\"class\", \"lz-locuszoom\")\n .style(plot.layout.style);\n plot.setDimensions();\n plot.positionPanels();\n // Initialize the plot\n plot.initialize();\n // If the plot has defined data sources then trigger its first mapping based on state values\n if (typeof datasource == \"object\" && Object.keys(datasource).length){\n plot.refresh();\n }\n });\n return plot;\n};\n\n/**\n * Populate arbitrarily many elements each with a LocusZoom plot\n * using a common datasource and layout\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot[]}\n */\nLocusZoom.populateAll = function(selector, datasource, layout) {\n var plots = [];\n d3.selectAll(selector).each(function(d,i) {\n plots[i] = LocusZoom.populate(this, datasource, layout);\n });\n return plots;\n};\n\n/**\n * Convert an integer chromosome position to an SI string representation (e.g. 23423456 => \"23.42\" (Mb))\n * @param {Number} pos Position\n * @param {String} [exp] Exponent to use for the returned string, eg 6=> MB. If not specified, will attempt to guess\n * the most appropriate SI prefix based on the number provided.\n * @param {Boolean} [suffix=false] Whether or not to append a suffix (e.g. \"Mb\") to the end of the returned string\n * @returns {string}\n */\nLocusZoom.positionIntToString = function(pos, exp, suffix){\n var exp_symbols = { 0: \"\", 3: \"K\", 6: \"M\", 9: \"G\" };\n suffix = suffix || false;\n if (isNaN(exp) || exp === null){\n var log = Math.log(pos) / Math.LN10;\n exp = Math.min(Math.max(log - (log % 3), 0), 9);\n }\n var places_exp = exp - Math.floor((Math.log(pos) / Math.LN10).toFixed(exp + 3));\n var min_exp = Math.min(Math.max(exp, 0), 2);\n var places = Math.min(Math.max(places_exp, min_exp), 12);\n var ret = \"\" + (pos / Math.pow(10, exp)).toFixed(places);\n if (suffix && typeof exp_symbols[exp] !== \"undefined\"){\n ret += \" \" + exp_symbols[exp] + \"b\";\n }\n return ret;\n};\n\n/**\n * Convert an SI string chromosome position to an integer representation (e.g. \"5.8 Mb\" => 58000000)\n * @param {String} p The chromosome position\n * @returns {Number}\n */\nLocusZoom.positionStringToInt = function(p) {\n var val = p.toUpperCase();\n val = val.replace(/,/g, \"\");\n var suffixre = /([KMG])[B]*$/;\n var suffix = suffixre.exec(val);\n var mult = 1;\n if (suffix) {\n if (suffix[1]===\"M\") {\n mult = 1e6;\n } else if (suffix[1]===\"G\") {\n mult = 1e9;\n } else {\n mult = 1e3; //K\n }\n val = val.replace(suffixre,\"\");\n }\n val = Number(val) * mult;\n return val;\n};\n\n/**\n * Parse region queries into their constituent parts\n * TODO: handle genes (or send off to API)\n * @param {String} x A chromosome position query. May be any of the forms `chr:start-end`, `chr:center+offset`,\n * or `chr:pos`\n * @returns {{chr:*, start: *, end:*} | {chr:*, position:*}}\n */\nLocusZoom.parsePositionQuery = function(x) {\n var chrposoff = /^(\\w+):([\\d,.]+[kmgbKMGB]*)([-+])([\\d,.]+[kmgbKMGB]*)$/;\n var chrpos = /^(\\w+):([\\d,.]+[kmgbKMGB]*)$/;\n var match = chrposoff.exec(x);\n if (match) {\n if (match[3] === \"+\") {\n var center = LocusZoom.positionStringToInt(match[2]);\n var offset = LocusZoom.positionStringToInt(match[4]);\n return {\n chr:match[1],\n start: center - offset,\n end: center + offset\n };\n } else {\n return {\n chr: match[1],\n start: LocusZoom.positionStringToInt(match[2]),\n end: LocusZoom.positionStringToInt(match[4])\n };\n }\n }\n match = chrpos.exec(x);\n if (match) {\n return {\n chr:match[1],\n position: LocusZoom.positionStringToInt(match[2])\n };\n }\n return null;\n};\n\n/**\n * Generate a \"pretty\" set of ticks (multiples of 1, 2, or 5 on the same order of magnitude for the range)\n * Based on R's \"pretty\" function: https://github.com/wch/r-source/blob/b156e3a711967f58131e23c1b1dc1ea90e2f0c43/src/appl/pretty.c\n * @param {Number[]} range A two-item array specifying [low, high] values for the axis range\n * @param {('low'|'high'|'both'|'neither')} [clip_range='neither'] What to do if first and last generated ticks extend\n * beyond the range. Set this to \"low\", \"high\", \"both\", or \"neither\" to clip the first (low) or last (high) tick to\n * be inside the range or allow them to extend beyond.\n * e.g. \"low\" will clip the first (low) tick if it extends beyond the low end of the range but allow the\n * last (high) tick to extend beyond the range. \"both\" clips both ends, \"neither\" allows both to extend beyond.\n * @param {Number} [target_tick_count=5] The approximate number of ticks you would like to be returned; may not be exact\n * @returns {Number[]}\n */\nLocusZoom.prettyTicks = function(range, clip_range, target_tick_count){\n if (typeof target_tick_count == \"undefined\" || isNaN(parseInt(target_tick_count))){\n target_tick_count = 5;\n }\n target_tick_count = parseInt(target_tick_count);\n \n var min_n = target_tick_count / 3;\n var shrink_sml = 0.75;\n var high_u_bias = 1.5;\n var u5_bias = 0.5 + 1.5 * high_u_bias;\n \n var d = Math.abs(range[0] - range[1]);\n var c = d / target_tick_count;\n if ((Math.log(d) / Math.LN10) < -2){\n c = (Math.max(Math.abs(d)) * shrink_sml) / min_n;\n }\n \n var base = Math.pow(10, Math.floor(Math.log(c)/Math.LN10));\n var base_toFixed = 0;\n if (base < 1 && base !== 0){\n base_toFixed = Math.abs(Math.round(Math.log(base)/Math.LN10));\n }\n \n var unit = base;\n if ( ((2 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 2 * base;\n if ( ((5 * base) - c) < (u5_bias * (c - unit)) ){\n unit = 5 * base;\n if ( ((10 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 10 * base;\n }\n }\n }\n \n var ticks = [];\n var i = parseFloat( (Math.floor(range[0]/unit)*unit).toFixed(base_toFixed) );\n while (i < range[1]){\n ticks.push(i);\n i += unit;\n if (base_toFixed > 0){\n i = parseFloat(i.toFixed(base_toFixed));\n }\n }\n ticks.push(i);\n \n if (typeof clip_range == \"undefined\" || [\"low\", \"high\", \"both\", \"neither\"].indexOf(clip_range) === -1){\n clip_range = \"neither\";\n }\n if (clip_range === \"low\" || clip_range === \"both\"){\n if (ticks[0] < range[0]){ ticks = ticks.slice(1); }\n }\n if (clip_range === \"high\" || clip_range === \"both\"){\n if (ticks[ticks.length-1] > range[1]){ ticks.pop(); }\n }\n \n return ticks;\n};\n\n/**\n * Make an AJAX request and return a promise.\n * From http://www.html5rocks.com/en/tutorials/cors/\n * and with promises from https://gist.github.com/kriskowal/593076\n *\n * @param {String} method The HTTP verb\n * @param {String} url\n * @param {String} body The request body to send to the server\n * @param {Object} headers Object of custom request headers\n * @param {Number} [timeout] If provided, wait this long (in ms) before timing out\n * @returns {Promise}\n */\nLocusZoom.createCORSPromise = function (method, url, body, headers, timeout) {\n var response = Q.defer();\n var xhr = new XMLHttpRequest();\n if (\"withCredentials\" in xhr) {\n // Check if the XMLHttpRequest object has a \"withCredentials\" property.\n // \"withCredentials\" only exists on XMLHTTPRequest2 objects.\n xhr.open(method, url, true);\n } else if (typeof XDomainRequest != \"undefined\") {\n // Otherwise, check if XDomainRequest.\n // XDomainRequest only exists in IE, and is IE's way of making CORS requests.\n xhr = new XDomainRequest();\n xhr.open(method, url);\n } else {\n // Otherwise, CORS is not supported by the browser.\n xhr = null;\n }\n if (xhr) {\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200 || xhr.status === 0 ) {\n response.resolve(xhr.response);\n } else {\n response.reject(\"HTTP \" + xhr.status + \" for \" + url);\n }\n }\n };\n timeout && setTimeout(response.reject, timeout);\n body = typeof body !== \"undefined\" ? body : \"\";\n if (typeof headers !== \"undefined\"){\n for (var header in headers){\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n // Send the request\n xhr.send(body);\n } \n return response.promise;\n};\n\n/**\n * Validate a (presumed complete) plot state object against internal rules for consistency, and ensure the plot fits\n * within any constraints imposed by the layout.\n * @param {Object} new_state\n * @param {Number} new_state.start\n * @param {Number} new_state.end\n * @param {Object} layout\n * @returns {*|{}}\n */\nLocusZoom.validateState = function(new_state, layout){\n\n new_state = new_state || {};\n layout = layout || {};\n\n // If a \"chr\", \"start\", and \"end\" are present then resolve start and end\n // to numeric values that are not decimal, negative, or flipped\n var validated_region = false;\n if (typeof new_state.chr != \"undefined\" && typeof new_state.start != \"undefined\" && typeof new_state.end != \"undefined\"){\n // Determine a numeric scale and midpoint for the attempted region,\n var attempted_midpoint = null; var attempted_scale;\n new_state.start = Math.max(parseInt(new_state.start), 1);\n new_state.end = Math.max(parseInt(new_state.end), 1);\n if (isNaN(new_state.start) && isNaN(new_state.end)){\n new_state.start = 1;\n new_state.end = 1;\n attempted_midpoint = 0.5;\n attempted_scale = 0;\n } else if (isNaN(new_state.start) || isNaN(new_state.end)){\n attempted_midpoint = new_state.start || new_state.end;\n attempted_scale = 0;\n new_state.start = (isNaN(new_state.start) ? new_state.end : new_state.start);\n new_state.end = (isNaN(new_state.end) ? new_state.start : new_state.end);\n } else {\n attempted_midpoint = Math.round((new_state.start + new_state.end) / 2);\n attempted_scale = new_state.end - new_state.start;\n if (attempted_scale < 0){\n var temp = new_state.start;\n new_state.end = new_state.start;\n new_state.start = temp;\n attempted_scale = new_state.end - new_state.start;\n }\n if (attempted_midpoint < 0){\n new_state.start = 1;\n new_state.end = 1;\n attempted_scale = 0;\n }\n }\n validated_region = true;\n }\n\n // Constrain w/r/t layout-defined minimum region scale\n if (!isNaN(layout.min_region_scale) && validated_region && attempted_scale < layout.min_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.min_region_scale / 2), 1);\n new_state.end = new_state.start + layout.min_region_scale;\n }\n\n // Constrain w/r/t layout-defined maximum region scale\n if (!isNaN(layout.max_region_scale) && validated_region && attempted_scale > layout.max_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.max_region_scale / 2), 1);\n new_state.end = new_state.start + layout.max_region_scale;\n }\n\n return new_state;\n};\n\n//\n/**\n * Replace placeholders in an html string with field values defined in a data object\n * Only works on scalar values! Will ignore non-scalars.\n *\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @param {Object} data\n * @param {String} html A placeholder string in which to substitute fields. Supports several template options:\n * `{{field_name}}` is a variable placeholder for the value of `field_name` from the provided data\n * `{{#if {{field_name}} }} Conditional text {{/if}} will insert the contents of the tag only if the value exists.\n * Since this is only an existence check, **variables with a value of 0 will be evaluated as true**.\n * @returns {string}\n */\nLocusZoom.parseFields = function (data, html) {\n if (typeof data != \"object\"){\n throw (\"LocusZoom.parseFields invalid arguments: data is not an object\");\n }\n if (typeof html != \"string\"){\n throw (\"LocusZoom.parseFields invalid arguments: html is not a string\");\n }\n // `tokens` is like [token,...]\n // `token` is like {text: '...'} or {variable: 'foo|bar'} or {condition: 'foo|bar'} or {close: 'if'}\n var tokens = [];\n var regex = /\\{\\{(?:(#if )?([A-Za-z0-9_:|]+)|(\\/if))\\}\\}/;\n while (html.length > 0){\n var m = regex.exec(html);\n if (!m) { tokens.push({text: html}); html = \"\"; }\n else if (m.index !== 0) { tokens.push({text: html.slice(0, m.index)}); html = html.slice(m.index); }\n else if (m[1] === \"#if \") { tokens.push({condition: m[2]}); html = html.slice(m[0].length); }\n else if (m[2]) { tokens.push({variable: m[2]}); html = html.slice(m[0].length); }\n else if (m[3] === \"/if\") { tokens.push({close: \"if\"}); html = html.slice(m[0].length); }\n else {\n console.error(\"Error tokenizing tooltip when remaining template is \" + JSON.stringify(html) +\n \" and previous tokens are \" + JSON.stringify(tokens) +\n \" and current regex match is \" + JSON.stringify([m[1], m[2], m[3]]));\n html=html.slice(m[0].length);\n }\n }\n var astify = function() {\n var token = tokens.shift();\n if (typeof token.text !== \"undefined\" || token.variable) {\n return token;\n } else if (token.condition) {\n token.then = [];\n while(tokens.length > 0) {\n if (tokens[0].close === \"if\") { tokens.shift(); break; }\n token.then.push(astify());\n }\n return token;\n } else {\n console.error(\"Error making tooltip AST due to unknown token \" + JSON.stringify(token));\n return { text: \"\" };\n }\n };\n // `ast` is like [thing,...]\n // `thing` is like {text: \"...\"} or {variable:\"foo|bar\"} or {condition: \"foo|bar\", then:[thing,...]}\n var ast = [];\n while (tokens.length > 0) ast.push(astify());\n\n var resolve = function(variable) {\n if (!resolve.cache.hasOwnProperty(variable)) {\n resolve.cache[variable] = (new LocusZoom.Data.Field(variable)).resolve(data);\n }\n return resolve.cache[variable];\n };\n resolve.cache = {};\n var render_node = function(node) {\n if (typeof node.text !== \"undefined\") {\n return node.text;\n } else if (node.variable) {\n try {\n var value = resolve(node.variable);\n if ([\"string\",\"number\",\"boolean\"].indexOf(typeof value) !== -1) { return value; }\n if (value === null) { return \"\"; }\n } catch (error) { console.error(\"Error while processing variable \" + JSON.stringify(node.variable)); }\n return \"{{\" + node.variable + \"}}\";\n } else if (node.condition) {\n try {\n var condition = resolve(node.condition);\n if (condition || condition === 0) {\n return node.then.map(render_node).join(\"\");\n }\n } catch (error) { console.error(\"Error while processing condition \" + JSON.stringify(node.variable)); }\n return \"\";\n } else { console.error(\"Error rendering tooltip due to unknown AST node \" + JSON.stringify(node)); }\n };\n return ast.map(render_node).join(\"\");\n};\n\n/**\n * Shortcut method for getting the data bound to a tool tip.\n * @param {Element} node\n * @returns {*} The first element of data bound to the tooltip\n */\nLocusZoom.getToolTipData = function(node){\n if (typeof node != \"object\" || typeof node.parentNode == \"undefined\"){\n throw(\"Invalid node object\");\n }\n // If this node is a locuszoom tool tip then return its data\n var selector = d3.select(node);\n if (selector.classed(\"lz-data_layer-tooltip\") && typeof selector.data()[0] != \"undefined\"){\n return selector.data()[0];\n } else {\n return LocusZoom.getToolTipData(node.parentNode);\n }\n};\n\n/**\n * Shortcut method for getting a reference to the data layer that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.getToolTipDataLayer = function(node){\n var data = LocusZoom.getToolTipData(node);\n if (data.getDataLayer){ return data.getDataLayer(); }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the panel that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.getToolTipPanel = function(node){\n var data_layer = LocusZoom.getToolTipDataLayer(node);\n if (data_layer){ return data_layer.parent; }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the plot that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.getToolTipPlot = function(node){\n var panel = LocusZoom.getToolTipPanel(node);\n if (panel){ return panel.parent; }\n return null;\n};\n\n/**\n * Generate a curtain object for a plot, panel, or any other subdivision of a layout\n * The panel curtain, like the plot curtain is an HTML overlay that obscures the entire panel. It can be styled\n * arbitrarily and display arbitrary messages. It is useful for reporting error messages visually to an end user\n * when the error renders the panel unusable.\n * TODO: Improve type doc here\n * @returns {object}\n */\nLocusZoom.generateCurtain = function(){\n var curtain = {\n showing: false,\n selector: null,\n content_selector: null,\n hide_delay: null,\n\n /**\n * Generate the curtain. Any content (string) argument passed will be displayed in the curtain as raw HTML.\n * CSS (object) can be passed which will apply styles to the curtain and its content.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n show: function(content, css){\n if (!this.curtain.showing){\n this.curtain.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-curtain\").attr(\"id\", this.id + \".curtain\");\n this.curtain.content_selector = this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-content\");\n this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-dismiss\").html(\"Dismiss\")\n .on(\"click\", function(){\n this.curtain.hide();\n }.bind(this));\n this.curtain.showing = true;\n }\n return this.curtain.update(content, css);\n }.bind(this),\n\n /**\n * Update the content and css of the curtain that's currently being shown. This method also adjusts the size\n * and positioning of the curtain to ensure it still covers the entire panel with no overlap.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n update: function(content, css){\n if (!this.curtain.showing){ return this.curtain; }\n clearTimeout(this.curtain.hide_delay);\n // Apply CSS if provided\n if (typeof css == \"object\"){\n this.curtain.selector.style(css);\n }\n // Update size and position\n var page_origin = this.getPageOrigin();\n this.curtain.selector.style({\n top: page_origin.y + \"px\",\n left: page_origin.x + \"px\",\n width: this.layout.width + \"px\",\n height: this.layout.height + \"px\"\n });\n this.curtain.content_selector.style({\n \"max-width\": (this.layout.width - 40) + \"px\",\n \"max-height\": (this.layout.height - 40) + \"px\"\n });\n // Apply content if provided\n if (typeof content == \"string\"){\n this.curtain.content_selector.html(content);\n }\n return this.curtain;\n }.bind(this),\n\n /**\n * Remove the curtain\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.curtain.showing){ return this.curtain; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.curtain.hide_delay);\n this.curtain.hide_delay = setTimeout(this.curtain.hide, delay);\n return this.curtain;\n }\n // Remove curtain\n this.curtain.selector.remove();\n this.curtain.selector = null;\n this.curtain.content_selector = null;\n this.curtain.showing = false;\n return this.curtain;\n }.bind(this)\n };\n return curtain;\n};\n\n/**\n * Generate a loader object for a plot, panel, or any other subdivision of a layout\n *\n * The panel loader is a small HTML overlay that appears in the lower left corner of the panel. It cannot be styled\n * arbitrarily, but can show a custom message and show a minimalist loading bar that can be updated to specific\n * completion percentages or be animated.\n * TODO Improve type documentation\n * @returns {object}\n */\nLocusZoom.generateLoader = function(){\n var loader = {\n showing: false,\n selector: null,\n content_selector: null,\n progress_selector: null,\n cancel_selector: null,\n\n /**\n * Show a loading indicator\n * @param {string} [content='Loading...'] Loading message (displayed as raw HTML)\n */\n show: function(content){\n // Generate loader\n if (!this.loader.showing){\n this.loader.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-loader\").attr(\"id\", this.id + \".loader\");\n this.loader.content_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-content\");\n this.loader.progress_selector = this.loader.selector\n .append(\"div\").attr(\"class\", \"lz-loader-progress-container\")\n .append(\"div\").attr(\"class\", \"lz-loader-progress\");\n /* TODO: figure out how to make this cancel button work\n this.loader.cancel_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-cancel\").html(\"Cancel\")\n .on(\"click\", function(){\n this.loader.hide();\n }.bind(this));\n */\n this.loader.showing = true;\n if (typeof content == \"undefined\"){ content = \"Loading...\"; }\n }\n return this.loader.update(content);\n }.bind(this),\n\n /**\n * Update the currently displayed loader and ensure the new content is positioned correctly.\n * @param {string} content The text to display (as raw HTML). If not a string, will be ignored.\n * @param {number} [percent] A number from 1-100. If a value is specified, it will stop all animations\n * in progress.\n */\n update: function(content, percent){\n if (!this.loader.showing){ return this.loader; }\n clearTimeout(this.loader.hide_delay);\n // Apply content if provided\n if (typeof content == \"string\"){\n this.loader.content_selector.html(content);\n }\n // Update size and position\n var padding = 6; // is there a better place to store/define this?\n var page_origin = this.getPageOrigin();\n var loader_boundrect = this.loader.selector.node().getBoundingClientRect();\n this.loader.selector.style({\n top: (page_origin.y + this.layout.height - loader_boundrect.height - padding) + \"px\",\n left: (page_origin.x + padding) + \"px\"\n });\n /* Uncomment this code when a functional cancel button can be shown\n var cancel_boundrect = this.loader.cancel_selector.node().getBoundingClientRect();\n this.loader.content_selector.style({\n \"padding-right\": (cancel_boundrect.width + padding) + \"px\"\n });\n */\n // Apply percent if provided\n if (typeof percent == \"number\"){\n this.loader.progress_selector.style({\n width: (Math.min(Math.max(percent, 1), 100)) + \"%\"\n });\n }\n return this.loader;\n }.bind(this),\n\n /**\n * Adds a class to the loading bar that makes it loop infinitely in a loading animation. Useful when exact\n * percent progress is not available.\n */\n animate: function(){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", true);\n return this.loader;\n }.bind(this),\n\n /**\n * Sets the loading bar in the loader to percentage width equal to the percent (number) value passed. Percents\n * will automatically be limited to a range of 1 to 100. Will stop all animations in progress.\n */\n setPercentCompleted: function(percent){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", false);\n return this.loader.update(null, percent);\n }.bind(this),\n\n /**\n * Remove the loader\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.loader.showing){ return this.loader; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.loader.hide_delay);\n this.loader.hide_delay = setTimeout(this.loader.hide, delay);\n return this.loader;\n }\n // Remove loader\n this.loader.selector.remove();\n this.loader.selector = null;\n this.loader.content_selector = null;\n this.loader.progress_selector = null;\n this.loader.cancel_selector = null;\n this.loader.showing = false;\n return this.loader;\n }.bind(this)\n };\n return loader;\n};\n\n/**\n * Create a new subclass following classical inheritance patterns. Some registry singletons use this internally to\n * enable code reuse and customization of known LZ core functionality.\n *\n * @param {Function} parent A parent class constructor that will be extended by the child class\n * @param {Object} extra An object of additional properties and methods to add/override behavior for the child class\n * @param {Function} [new_constructor] An optional constructor function that performs additional setup. If omitted,\n * just calls the parent constructor by default. Implementer must manage super calls when overriding the constructor.\n * @returns {Function} The constructor for the new child class\n */\nLocusZoom.subclass = function(parent, extra, new_constructor) {\n if (typeof parent !== \"function\" ) {\n throw \"Parent must be a callable constructor\";\n }\n\n extra = extra || {};\n var Sub = new_constructor || function() {\n parent.apply(this, arguments);\n };\n\n Sub.prototype = Object.create(parent.prototype);\n Object.keys(extra).forEach(function(k) {\n Sub.prototype[k] = extra[k];\n });\n Sub.prototype.constructor = Sub;\n\n return Sub;\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * Manage known layouts for all parts of the LocusZoom plot\n *\n * This registry allows for layouts to be reused and customized many times on a page, using a common base pattern.\n * It handles the work of ensuring that each new instance of the layout has no shared state with other copies.\n *\n * @class\n */\nLocusZoom.Layouts = (function() {\n var obj = {};\n var layouts = {\n \"plot\": {},\n \"panel\": {},\n \"data_layer\": {},\n \"dashboard\": {},\n \"tooltip\": {}\n };\n\n /**\n * Generate a layout configuration object\n * @param {('plot'|'panel'|'data_layer'|'dashboard'|'tooltip')} type The type of layout to retrieve\n * @param {string} name Identifier of the predefined layout within the specified type\n * @param {object} [modifications] Custom properties that override default settings for this layout\n * @returns {object} A JSON-serializable object representation\n */\n obj.get = function(type, name, modifications) {\n if (typeof type != \"string\" || typeof name != \"string\") {\n throw(\"invalid arguments passed to LocusZoom.Layouts.get, requires string (layout type) and string (layout name)\");\n } else if (layouts[type][name]) {\n // Get the base layout\n var layout = LocusZoom.Layouts.merge(modifications || {}, layouts[type][name]);\n // If \"unnamespaced\" is true then strike that from the layout and return the layout without namespacing\n if (layout.unnamespaced){\n delete layout.unnamespaced;\n return JSON.parse(JSON.stringify(layout));\n }\n // Determine the default namespace for namespaced values\n var default_namespace = \"\";\n if (typeof layout.namespace == \"string\"){\n default_namespace = layout.namespace;\n } else if (typeof layout.namespace == \"object\" && Object.keys(layout.namespace).length){\n if (typeof layout.namespace.default != \"undefined\"){\n default_namespace = layout.namespace.default;\n } else {\n default_namespace = layout.namespace[Object.keys(layout.namespace)[0]].toString();\n }\n }\n default_namespace += default_namespace.length ? \":\" : \"\";\n // Apply namespaces to layout, recursively\n var applyNamespaces = function(element, namespace){\n if (namespace){\n if (typeof namespace == \"string\"){\n namespace = { default: namespace }; \n }\n } else {\n namespace = { default: \"\" };\n }\n if (typeof element == \"string\"){\n var re = /\\{\\{namespace(\\[[A-Za-z_0-9]+\\]|)\\}\\}/g;\n var match, base, key, resolved_namespace;\n var replace = [];\n while ((match = re.exec(element)) !== null){\n base = match[0];\n key = match[1].length ? match[1].replace(/(\\[|\\])/g,\"\") : null;\n resolved_namespace = default_namespace;\n if (namespace != null && typeof namespace == \"object\" && typeof namespace[key] != \"undefined\"){\n resolved_namespace = namespace[key] + (namespace[key].length ? \":\" : \"\");\n }\n replace.push({ base: base, namespace: resolved_namespace });\n }\n for (var r in replace){\n element = element.replace(replace[r].base, replace[r].namespace);\n }\n } else if (typeof element == \"object\" && element != null){\n if (typeof element.namespace != \"undefined\"){\n var merge_namespace = (typeof element.namespace == \"string\") ? { default: element.namespace } : element.namespace;\n namespace = LocusZoom.Layouts.merge(namespace, merge_namespace);\n }\n var namespaced_element, namespaced_property;\n for (var property in element) {\n if (property === \"namespace\"){ continue; }\n namespaced_element = applyNamespaces(element[property], namespace);\n namespaced_property = applyNamespaces(property, namespace);\n if (property !== namespaced_property){\n delete element[property];\n }\n element[namespaced_property] = namespaced_element;\n }\n }\n return element;\n };\n layout = applyNamespaces(layout, layout.namespace);\n // Return the layout as valid JSON only\n return JSON.parse(JSON.stringify(layout));\n } else {\n throw(\"layout type [\" + type + \"] name [\" + name + \"] not found\");\n }\n };\n\n /** @private */\n obj.set = function(type, name, layout) {\n if (typeof type != \"string\" || typeof name != \"string\" || typeof layout != \"object\"){\n throw (\"unable to set new layout; bad arguments passed to set()\");\n }\n if (!layouts[type]){\n layouts[type] = {};\n }\n if (layout){\n return (layouts[type][name] = JSON.parse(JSON.stringify(layout)));\n } else {\n delete layouts[type][name];\n return null;\n }\n };\n\n /**\n * Register a new layout definition by name.\n *\n * @param {string} type The type of layout to add. Usually, this will be one of the predefined LocusZoom types,\n * but if you pass a different name, this method will automatically create the new `type` bucket\n * @param {string} name The identifier of the newly added layout\n * @param {object} [layout] A JSON-serializable object containing configuration properties for this layout\n * @returns The JSON representation of the newly created layout\n */\n obj.add = function(type, name, layout) {\n return obj.set(type, name, layout);\n };\n\n /**\n * List all registered layouts\n * @param [type] Optionally narrow the list to only layouts of a specific type; else return all known layouts\n * @returns {*}\n */\n obj.list = function(type) {\n if (!layouts[type]){\n var list = {};\n Object.keys(layouts).forEach(function(type){\n list[type] = Object.keys(layouts[type]);\n });\n return list;\n } else {\n return Object.keys(layouts[type]);\n }\n };\n\n /**\n * A helper method used for merging two objects. If a key is present in both, takes the value from the first object\n * Values from `default_layout` will be cleanly copied over, ensuring no references or shared state.\n *\n * Frequently used for preparing custom layouts. Both objects should be JSON-serializable.\n *\n * @param {object} custom_layout An object containing configuration parameters that override or add to defaults\n * @param {object} default_layout An object containing default settings.\n * @returns The custom layout is modified in place and also returned from this method.\n */\n obj.merge = function (custom_layout, default_layout) {\n if (typeof custom_layout !== \"object\" || typeof default_layout !== \"object\"){\n throw(\"LocusZoom.Layouts.merge only accepts two layout objects; \" + (typeof custom_layout) + \", \" + (typeof default_layout) + \" given\");\n }\n for (var property in default_layout) {\n if (!default_layout.hasOwnProperty(property)){ continue; }\n // Get types for comparison. Treat nulls in the custom layout as undefined for simplicity.\n // (javascript treats nulls as \"object\" when we just want to overwrite them as if they're undefined)\n // Also separate arrays from objects as a discrete type.\n var custom_type = custom_layout[property] === null ? \"undefined\" : typeof custom_layout[property];\n var default_type = typeof default_layout[property];\n if (custom_type === \"object\" && Array.isArray(custom_layout[property])){ custom_type = \"array\"; }\n if (default_type === \"object\" && Array.isArray(default_layout[property])){ default_type = \"array\"; }\n // Unsupported property types: throw an exception\n if (custom_type === \"function\" || default_type === \"function\"){\n throw(\"LocusZoom.Layouts.merge encountered an unsupported property type\");\n }\n // Undefined custom value: pull the default value\n if (custom_type === \"undefined\"){\n custom_layout[property] = JSON.parse(JSON.stringify(default_layout[property]));\n continue;\n }\n // Both values are objects: merge recursively\n if (custom_type === \"object\" && default_type === \"object\"){\n custom_layout[property] = LocusZoom.Layouts.merge(custom_layout[property], default_layout[property]);\n continue;\n }\n }\n return custom_layout;\n };\n\n return obj;\n})();\n\n\n/**\n * Tooltip Layouts\n * @namespace LocusZoom.Layouts.tooltips\n */\n\n// TODO: Improve documentation of predefined types within layout namespaces\nLocusZoom.Layouts.add(\"tooltip\", \"standard_association\", {\n namespace: { \"assoc\": \"assoc\" },\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[assoc]}}variant}}
      \"\n + \"P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
      \"\n + \"Ref. Allele: {{{{namespace[assoc]}}ref_allele}}
      \"\n + \"Make LD Reference
      \"\n});\n\nvar covariates_model_association = LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true });\ncovariates_model_association.html += \"Condition on Variant
      \";\nLocusZoom.Layouts.add(\"tooltip\", \"covariates_model_association\", covariates_model_association);\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_genes\", {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"

      {{gene_name}}

      \"\n + \"
      Gene ID: {{gene_id}}
      \"\n + \"
      Transcript ID: {{transcript_id}}
      \"\n + \"
      \"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"
      ConstraintExpected variantsObserved variantsConst. Metric
      Synonymous{{exp_syn}}{{n_syn}}z = {{syn_z}}
      Missense{{exp_mis}}{{n_mis}}z = {{mis_z}}
      LoF{{exp_lof}}{{n_lof}}pLI = {{pLI}}
      \"\n + \"More data on ExAC\"\n});\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n closable: false,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[intervals]}}state_name}}
      {{{{namespace[intervals]}}start}}-{{{{namespace[intervals]}}end}}\"\n});\n\n/**\n * Data Layer Layouts: represent specific information from a data source\n * @namespace Layouts.data_layer\n*/\n\nLocusZoom.Layouts.add(\"data_layer\", \"significance\", {\n id: \"significance\",\n type: \"orthogonal_line\",\n orientation: \"horizontal\",\n offset: 4.522\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"recomb_rate\", {\n namespace: { \"recomb\": \"recomb\" },\n id: \"recombrate\",\n type: \"line\",\n fields: [\"{{namespace[recomb]}}position\", \"{{namespace[recomb]}}recomb_rate\"],\n z_index: 1,\n style: {\n \"stroke\": \"#0000FF\",\n \"stroke-width\": \"1.5px\"\n },\n x_axis: {\n field: \"{{namespace[recomb]}}position\"\n },\n y_axis: {\n axis: 2,\n field: \"{{namespace[recomb]}}recomb_rate\",\n floor: 0,\n ceiling: 100\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"association_pvalues\", {\n namespace: { \"assoc\": \"assoc\", \"ld\": \"ld\" },\n id: \"associationpvalues\",\n type: \"scatter\",\n point_shape: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"diamond\",\n else: \"circle\"\n }\n },\n point_size: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: 80,\n else: 40\n }\n },\n color: [\n {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"#9632b8\"\n }\n },\n {\n scale_function: \"numerical_bin\",\n field: \"{{namespace[ld]}}state\",\n parameters: {\n breaks: [0, 0.2, 0.4, 0.6, 0.8],\n values: [\"#357ebd\",\"#46b8da\",\"#5cb85c\",\"#eea236\",\"#d43f3a\"]\n }\n },\n \"#B8B8B8\"\n ],\n legend: [\n { shape: \"diamond\", color: \"#9632b8\", size: 40, label: \"LD Ref Var\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#d43f3a\", size: 40, label: \"1.0 > r² ≥ 0.8\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#eea236\", size: 40, label: \"0.8 > r² ≥ 0.6\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#5cb85c\", size: 40, label: \"0.6 > r² ≥ 0.4\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#46b8da\", size: 40, label: \"0.4 > r² ≥ 0.2\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#357ebd\", size: 40, label: \"0.2 > r² ≥ 0.0\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#B8B8B8\", size: 40, label: \"no r² data\", class: \"lz-data_layer-scatter\" }\n ],\n fields: [\"{{namespace[assoc]}}variant\", \"{{namespace[assoc]}}position\", \"{{namespace[assoc]}}log_pvalue\", \"{{namespace[assoc]}}log_pvalue|logtoscinotation\", \"{{namespace[assoc]}}ref_allele\", \"{{namespace[ld]}}state\", \"{{namespace[ld]}}isrefvar\"],\n id_field: \"{{namespace[assoc]}}variant\",\n z_index: 2,\n x_axis: {\n field: \"{{namespace[assoc]}}position\"\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[assoc]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.10,\n min_extent: [ 0, 10 ]\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"phewas_pvalues\", {\n namespace: {\"phewas\": \"phewas\"},\n id: \"phewaspvalues\",\n type: \"category_scatter\",\n point_shape: \"circle\",\n point_size: 70,\n tooltip_positioning: \"vertical\",\n id_field: \"{{namespace[phewas]}}id\",\n fields: [\"{{namespace[phewas]}}id\", \"{{namespace[phewas]}}log_pvalue\", \"{{namespace[phewas]}}trait_group\", \"{{namespace[phewas]}}trait_label\"],\n x_axis: {\n field: \"{{namespace[phewas]}}x\", // Synthetic/derived field added by `category_scatter` layer\n category_field: \"{{namespace[phewas]}}trait_group\",\n lower_buffer: 0.025,\n upper_buffer: 0.025\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[phewas]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.15\n },\n color: {\n field: \"{{namespace[phewas]}}trait_group\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [],\n values: [],\n null_value: \"#B8B8B8\"\n }\n },\n fill_opacity: 0.7,\n tooltip: {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: [\n \"Trait: {{{{namespace[phewas]}}trait_label|htmlescape}}
      \",\n \"Trait Category: {{{{namespace[phewas]}}trait_group|htmlescape}}
      \",\n \"P-value: {{{{namespace[phewas]}}log_pvalue|logtoscinotation|htmlescape}}
      \"\n ].join(\"\")\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n label: {\n text: \"{{{{namespace[phewas]}}trait_label}}\",\n spacing: 6,\n lines: {\n style: {\n \"stroke-width\": \"2px\",\n \"stroke\": \"#333333\",\n \"stroke-dasharray\": \"2px 2px\"\n }\n },\n filters: [\n {\n field: \"{{namespace[phewas]}}log_pvalue\",\n operator: \">=\",\n value: 20\n }\n ],\n style: {\n \"font-size\": \"14px\",\n \"font-weight\": \"bold\",\n \"fill\": \"#333333\"\n }\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genes\", {\n namespace: { \"gene\": \"gene\", \"constraint\": \"constraint\" },\n id: \"genes\",\n type: \"genes\",\n fields: [\"{{namespace[gene]}}gene\", \"{{namespace[constraint]}}constraint\"],\n id_field: \"gene_id\",\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_genes\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genome_legend\", {\n namespace: { \"genome\": \"genome\" },\n id: \"genome_legend\",\n type: \"genome_legend\",\n fields: [\"{{namespace[genome]}}chr\", \"{{namespace[genome]}}base_pairs\"],\n x_axis: {\n floor: 0,\n ceiling: 2881033286\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n id: \"intervals\",\n type: \"intervals\",\n fields: [\"{{namespace[intervals]}}start\",\"{{namespace[intervals]}}end\",\"{{namespace[intervals]}}state_id\",\"{{namespace[intervals]}}state_name\"],\n id_field: \"{{namespace[intervals]}}start\",\n start_field: \"{{namespace[intervals]}}start\",\n end_field: \"{{namespace[intervals]}}end\",\n track_split_field: \"{{namespace[intervals]}}state_id\",\n split_tracks: true,\n always_hide_legend: false,\n color: {\n field: \"{{namespace[intervals]}}state_id\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [1,2,3,4,5,6,7,8,9,10,11,12,13],\n values: [\"rgb(212,63,58)\", \"rgb(250,120,105)\", \"rgb(252,168,139)\", \"rgb(240,189,66)\", \"rgb(250,224,105)\", \"rgb(240,238,84)\", \"rgb(244,252,23)\", \"rgb(23,232,252)\", \"rgb(32,191,17)\", \"rgb(23,166,77)\", \"rgb(32,191,17)\", \"rgb(162,133,166)\", \"rgb(212,212,212)\"],\n null_value: \"#B8B8B8\"\n }\n },\n legend: [\n { shape: \"rect\", color: \"rgb(212,63,58)\", width: 9, label: \"Active Promoter\", \"{{namespace[intervals]}}state_id\": 1 },\n { shape: \"rect\", color: \"rgb(250,120,105)\", width: 9, label: \"Weak Promoter\", \"{{namespace[intervals]}}state_id\": 2 },\n { shape: \"rect\", color: \"rgb(252,168,139)\", width: 9, label: \"Poised Promoter\", \"{{namespace[intervals]}}state_id\": 3 },\n { shape: \"rect\", color: \"rgb(240,189,66)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 4 },\n { shape: \"rect\", color: \"rgb(250,224,105)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 5 },\n { shape: \"rect\", color: \"rgb(240,238,84)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 6 },\n { shape: \"rect\", color: \"rgb(244,252,23)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 7 },\n { shape: \"rect\", color: \"rgb(23,232,252)\", width: 9, label: \"Insulator\", \"{{namespace[intervals]}}state_id\": 8 },\n { shape: \"rect\", color: \"rgb(32,191,17)\", width: 9, label: \"Transcriptional transition\", \"{{namespace[intervals]}}state_id\": 9 },\n { shape: \"rect\", color: \"rgb(23,166,77)\", width: 9, label: \"Transcriptional elongation\", \"{{namespace[intervals]}}state_id\": 10 },\n { shape: \"rect\", color: \"rgb(136,240,129)\", width: 9, label: \"Weak transcribed\", \"{{namespace[intervals]}}state_id\": 11 },\n { shape: \"rect\", color: \"rgb(162,133,166)\", width: 9, label: \"Polycomb-repressed\", \"{{namespace[intervals]}}state_id\": 12 },\n { shape: \"rect\", color: \"rgb(212,212,212)\", width: 9, label: \"Heterochromatin / low signal\", \"{{namespace[intervals]}}state_id\": 13 }\n ],\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_intervals\", { unnamespaced: true })\n});\n\n/**\n * Dashboard Layouts: toolbar buttons etc\n * @namespace Layouts.dashboard\n */\nLocusZoom.Layouts.add(\"dashboard\", \"standard_panel\", {\n components: [\n {\n type: \"remove_panel\",\n position: \"right\",\n color: \"red\",\n group_position: \"end\"\n },\n {\n type: \"move_panel_up\",\n position: \"right\",\n group_position: \"middle\"\n },\n {\n type: \"move_panel_down\",\n position: \"right\",\n group_position: \"start\",\n style: { \"margin-left\": \"0.75em\" }\n }\n ]\n}); \n\nLocusZoom.Layouts.add(\"dashboard\", \"standard_plot\", {\n components: [\n {\n type: \"title\",\n title: \"LocusZoom\",\n subtitle: \"v\" + LocusZoom.version + \"\",\n position: \"left\"\n },\n {\n type: \"dimensions\",\n position: \"right\"\n },\n {\n type: \"region_scale\",\n position: \"right\"\n },\n {\n type: \"download\",\n position: \"right\"\n }\n ]\n});\n\nvar covariates_model_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\ncovariates_model_plot_dashboard.components.push({\n type: \"covariates_model\",\n button_html: \"Model\",\n button_title: \"Show and edit covariates currently in model\",\n position: \"left\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"covariates_model_plot\", covariates_model_plot_dashboard);\n\nvar region_nav_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 500000,\n button_html: \">>\",\n position: \"right\",\n group_position: \"end\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 50000,\n button_html: \">\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: 0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: -0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -50000,\n button_html: \"<\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -500000,\n button_html: \"<<\",\n position: \"right\",\n group_position: \"start\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"region_nav_plot\", region_nav_plot_dashboard);\n\n/**\n * Panel Layouts\n * @namespace Layouts.panel\n */\n\nLocusZoom.Layouts.add(\"panel\", \"association\", {\n id: \"association\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 200,\n proportional_width: 1,\n margin: { top: 35, right: 50, bottom: 40, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_legend\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n },\n y2: {\n label: \"Recombination Rate (cM/Mb)\",\n label_offset: 40\n }\n },\n legend: {\n orientation: \"vertical\",\n origin: { x: 55, y: 40 },\n hidden: true\n },\n interaction: {\n drag_background_to_pan: true,\n drag_x_ticks_to_scale: true,\n drag_y1_ticks_to_scale: true,\n drag_y2_ticks_to_scale: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"recomb_rate\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"association_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genes\", {\n id: \"genes\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 112.5,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 20, left: 50 },\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"resize_to_data\",\n position: \"right\"\n });\n return l;\n })(), \n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genes\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"phewas\", {\n id: \"phewas\",\n width: 800,\n height: 300,\n min_width: 800,\n min_height: 300,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 120, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n axes: {\n x: {\n ticks: { // Object based config (shared defaults; allow layers to specify ticks)\n style: {\n \"font-weight\": \"bold\",\n \"font-size\": \"11px\",\n \"text-anchor\": \"start\"\n },\n transform: \"rotate(50)\",\n position: \"left\" // Special param recognized by `category_scatter` layers\n }\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"phewas_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genome_legend\", {\n id: \"genome_legend\",\n width: 800,\n height: 50,\n origin: { x: 0, y: 300 },\n min_width: 800,\n min_height: 50,\n proportional_width: 1,\n margin: { top: 0, right: 50, bottom: 35, left: 50 },\n axes: {\n x: {\n label: \"Genomic Position (number denotes chromosome)\",\n label_offset: 35,\n ticks: [\n {\n x: 124625310,\n text: \"1\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 370850307,\n text: \"2\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 591461209,\n text: \"3\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 786049562,\n text: \"4\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 972084330,\n text: \"5\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1148099493,\n text: \"6\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1313226358,\n text: \"7\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1465977701,\n text: \"8\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1609766427,\n text: \"9\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1748140516,\n text: \"10\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1883411148,\n text: \"11\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2017840353,\n text: \"12\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2142351240,\n text: \"13\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2253610949,\n text: \"14\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2358551415,\n text: \"15\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2454994487,\n text: \"16\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2540769469,\n text: \"17\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2620405698,\n text: \"18\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2689008813,\n text: \"19\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2750086065,\n text: \"20\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2805663772,\n text: \"21\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2855381003,\n text: \"22\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n }\n ]\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genome_legend\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"intervals\", {\n id: \"intervals\",\n width: 1000,\n height: 50,\n min_width: 500,\n min_height: 50,\n margin: { top: 25, right: 150, bottom: 5, left: 50 },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_split_tracks\",\n data_layer_id: \"intervals\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n legend: {\n hidden: true,\n orientation: \"horizontal\",\n origin: { x: 50, y: 0 },\n pad_from_bottom: 5\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"intervals\", { unnamespaced: true })\n ]\n});\n\n\n/**\n * Plot Layouts\n * @namespace Layouts.plot\n */\n\nLocusZoom.Layouts.add(\"plot\", \"standard_association\", {\n state: {},\n width: 800,\n height: 450,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, proportional_height: 0.5 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, proportional_height: 0.5 })\n ]\n});\n\n// Shortcut to \"StandardLayout\" for backward compatibility\nLocusZoom.StandardLayout = LocusZoom.Layouts.get(\"plot\", \"standard_association\");\n\nLocusZoom.Layouts.add(\"plot\", \"standard_phewas\", {\n width: 800,\n height: 600,\n min_width: 800,\n min_height: 600,\n responsive_resize: true,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true } ),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"phewas\", { unnamespaced: true, proportional_height: 0.45 }),\n LocusZoom.Layouts.get(\"panel\", \"genome_legend\", { unnamespaced: true, proportional_height: 0.1 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", {\n unnamespaced: true, proportional_height: 0.45,\n margin: { bottom: 40 },\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n }\n }\n })\n ],\n mouse_guide: false\n});\n\nLocusZoom.Layouts.add(\"plot\", \"interval_association\", {\n state: {},\n width: 800,\n height: 550,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, width: 800, proportional_height: (225/570) }),\n LocusZoom.Layouts.get(\"panel\", \"intervals\", { unnamespaced: true, proportional_height: (120/570) }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, width: 800, proportional_height: (225/570) })\n ]\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A data layer is an abstract class representing a data set and its graphical representation within a panel\n * @public\n * @class\n * @param {Object} layout A JSON-serializable object describing the layout for this layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n*/\nLocusZoom.DataLayer = function(layout, parent) {\n /** @member {Boolean} */\n this.initialized = false;\n /** @member {Number} */\n this.layout_idx = null;\n\n /** @member {String} */\n this.id = null;\n /** @member {LocusZoom.Panel} */\n this.parent = parent || null;\n /**\n * @member {{group: d3.selection, container: d3.selection, clipRect: d3.selection}}\n */\n this.svg = {};\n\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n if (typeof parent != \"undefined\" && parent instanceof LocusZoom.Panel){ this.parent_plot = parent.parent; }\n\n /** @member {Object} */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.DataLayer.DefaultLayout);\n if (this.layout.id){ this.id = this.layout.id; }\n\n // Ensure any axes defined in the layout have an explicit axis number (default: 1)\n if (this.layout.x_axis !== {} && typeof this.layout.x_axis.axis !== \"number\"){ this.layout.x_axis.axis = 1; }\n if (this.layout.y_axis !== {} && typeof this.layout.y_axis.axis !== \"number\"){ this.layout.y_axis.axis = 1; }\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original data layer state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n /** @member {Object} */\n this.state = {};\n /** @member {String} */\n this.state_id = null;\n\n this.setDefaultState();\n\n // Initialize parameters for storing data and tool tips\n /** @member {Array} */\n this.data = [];\n if (this.layout.tooltip){\n /** @member {Object} */\n this.tooltips = {};\n }\n\n // Initialize flags for tracking global statuses\n this.global_statuses = {\n \"highlighted\": false,\n \"selected\": false,\n \"faded\": false,\n \"hidden\": false\n };\n \n return this;\n\n};\n\n/**\n * Instruct this datalayer to begin tracking additional fields from data sources (does not guarantee that such a field actually exists)\n *\n * Custom plots can use this to dynamically extend datalayer functionality after the plot is drawn\n *\n * (since removing core fields may break layer functionality, there is presently no hook for the inverse behavior)\n * @param fieldName\n * @param namespace\n * @param {String|String[]} transformations The name (or array of names) of transformations to apply to this field\n * @returns {String} The raw string added to the fields array\n */\nLocusZoom.DataLayer.prototype.addField = function(fieldName, namespace, transformations) {\n if (!fieldName || !namespace) {\n throw \"Must specify field name and namespace to use when adding field\";\n }\n var fieldString = namespace + \":\" + fieldName;\n if (transformations) {\n fieldString += \"|\";\n if (typeof transformations === \"string\") {\n fieldString += transformations;\n } else if (Array.isArray(transformations)) {\n fieldString += transformations.join(\"|\");\n } else {\n throw \"Must provide transformations as either a string or array of strings\";\n }\n }\n var fields = this.layout.fields;\n if (fields.indexOf(fieldString) === -1) {\n fields.push(fieldString);\n }\n return fieldString;\n};\n\n/**\n * Define default state that should get tracked during the lifetime of this layer.\n *\n * In some special custom usages, it may be useful to completely reset a panel (eg \"click for\n * genome region\" links), plotting new data that invalidates any previously tracked state. This hook makes it\n * possible to reset without destroying the panel entirely. It is used by `Plot.clearPanelData`.\n */\nLocusZoom.DataLayer.prototype.setDefaultState = function() {\n // Define state parameters specific to this data layer\n if (this.parent){\n this.state = this.parent.state;\n this.state_id = this.parent.id + \".\" + this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n this.state[this.state_id][status] = this.state[this.state_id][status] || [];\n }.bind(this));\n }\n};\n\n/**\n * A basic description of keys expected in a layout. Not intended to be directly used or modified by an end user.\n * @protected\n * @type {{type: string, fields: Array, x_axis: {}, y_axis: {}}}\n */\nLocusZoom.DataLayer.DefaultLayout = {\n type: \"\",\n fields: [],\n x_axis: {},\n y_axis: {}\n};\n\n/**\n * Available statuses that individual elements can have. Each status is described by\n * a verb/antiverb and an adjective. Verbs and antiverbs are used to generate data layer\n * methods for updating the status on one or more elements. Adjectives are used in class\n * names and applied or removed from elements to have a visual representation of the status,\n * as well as used as keys in the state for tracking which elements are in which status(es)\n * @static\n * @type {{verbs: String[], adjectives: String[], menu_antiverbs: String[]}}\n */\nLocusZoom.DataLayer.Statuses = {\n verbs: [\"highlight\", \"select\", \"fade\", \"hide\"],\n adjectives: [\"highlighted\", \"selected\", \"faded\", \"hidden\"],\n menu_antiverbs: [\"unhighlight\", \"deselect\", \"unfade\", \"show\"]\n};\n\n/**\n * Get the fully qualified identifier for the data layer, prefixed by any parent or container elements\n *\n * @returns {string} A dot-delimited string of the format ..\n */\nLocusZoom.DataLayer.prototype.getBaseId = function(){\n return this.parent_plot.id + \".\" + this.parent.id + \".\" + this.id;\n};\n\n/**\n * Determine the pixel height of data-bound objects represented inside this data layer. (excluding elements such as axes)\n *\n * May be used by operations that resize the data layer to fit available data\n *\n * @public\n * @returns {number}\n */\nLocusZoom.DataLayer.prototype.getAbsoluteDataHeight = function(){\n var dataBCR = this.svg.group.node().getBoundingClientRect();\n return dataBCR.height;\n};\n\n/**\n * Whether transitions can be applied to this data layer\n * @returns {boolean}\n */\nLocusZoom.DataLayer.prototype.canTransition = function(){\n if (!this.layout.transition){ return false; }\n return !(this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.panel_id);\n};\n\n/**\n * Fetch the fully qualified ID to be associated with a specific visual element, based on the data to which that\n * element is bound. In general this element ID will be unique, allowing it to be addressed directly via selectors.\n * @param {String|Object} element\n * @returns {String}\n */\nLocusZoom.DataLayer.prototype.getElementId = function(element){\n var element_id = \"element\";\n if (typeof element == \"string\"){\n element_id = element;\n } else if (typeof element == \"object\"){\n var id_field = this.layout.id_field || \"id\";\n if (typeof element[id_field] == \"undefined\"){\n throw(\"Unable to generate element ID\");\n }\n element_id = element[id_field].toString().replace(/\\W/g,\"\");\n }\n return (this.getBaseId() + \"-\" + element_id).replace(/(:|\\.|\\[|\\]|,)/g, \"_\");\n};\n\n/**\n * Fetch an ID that may bind a data element to a separate visual node for displaying status\n * Examples of this might be seperate visual nodes to show select/highlight statuses, or\n * even a common/shared node to show status across many elements in a set.\n * Abstract method. It should be overridden by data layers that implement seperate status\n * nodes specifically to the use case of the data layer type.\n * @param {String|Object} element\n * @returns {String|null}\n */\nLocusZoom.DataLayer.prototype.getElementStatusNodeId = function(element){\n return null;\n};\n\n/**\n * Returns a reference to the underlying data associated with a single visual element in the data layer, as\n * referenced by the unique identifier for the element\n\n * @param {String} id The unique identifier for the element, as defined by `getElementId`\n * @returns {Object|null} The data bound to that element\n */\nLocusZoom.DataLayer.prototype.getElementById = function(id){\n var selector = d3.select(\"#\" + id.replace(/(:|\\.|\\[|\\]|,)/g, \"\\\\$1\"));\n if (!selector.empty() && selector.data() && selector.data().length){\n return selector.data()[0];\n } else {\n return null;\n }\n};\n\n/**\n * Basic method to apply arbitrary methods and properties to data elements.\n * This is called on all data immediately after being fetched.\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyDataMethods = function(){\n this.data.forEach(function(d, i){\n // Basic toHTML() method - return the stringified value in the id_field, if defined.\n this.data[i].toHTML = function(){\n var id_field = this.layout.id_field || \"id\";\n var html = \"\";\n if (this.data[i][id_field]){ html = this.data[i][id_field].toString(); }\n return html;\n }.bind(this);\n // getDataLayer() method - return a reference to the data layer\n this.data[i].getDataLayer = function(){\n return this;\n }.bind(this);\n // deselect() method - shortcut method to deselect the element\n this.data[i].deselect = function(){\n var data_layer = this.getDataLayer();\n data_layer.unselectElement(this);\n };\n }.bind(this));\n this.applyCustomDataMethods();\n return this;\n};\n\n/**\n * Hook that allows custom datalayers to apply additional methods and properties to data elements as needed\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyCustomDataMethods = function(){\n return this;\n};\n\n/**\n * Initialize a data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.initialize = function(){\n\n // Append a container group element to house the main data layer group element and the clip path\n this.svg.container = this.parent.svg.group.append(\"g\")\n .attr(\"class\", \"lz-data_layer-container\")\n .attr(\"id\", this.getBaseId() + \".data_layer_container\");\n \n // Append clip path to the container element\n this.svg.clipRect = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\")\n .append(\"rect\");\n \n // Append svg group for rendering all data layer elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".data_layer\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n return this;\n\n};\n\n/**\n * Move a data layer up relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveUp = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Move a data layer down relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveDown = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Apply scaling functions to an element or parameter as needed, based on its layout and the element's data\n * If the layout parameter is already a primitive type, simply return the value as given\n * @param {Array|Number|String|Object} layout\n * @param {*} data The value to be used with the filter\n * @returns {*} The transformed value\n */\nLocusZoom.DataLayer.prototype.resolveScalableParameter = function(layout, data){\n var ret = null;\n if (Array.isArray(layout)){\n var idx = 0;\n while (ret === null && idx < layout.length){\n ret = this.resolveScalableParameter(layout[idx], data);\n idx++;\n }\n } else {\n switch (typeof layout){\n case \"number\":\n case \"string\":\n ret = layout;\n break;\n case \"object\":\n if (layout.scale_function){\n if(layout.field) {\n var f = new LocusZoom.Data.Field(layout.field);\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, f.resolve(data));\n } else {\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, data);\n }\n }\n break;\n }\n }\n return ret;\n};\n\n/**\n * Generate dimension extent function based on layout parameters\n * @param {('x'|'y')} dimension\n */\nLocusZoom.DataLayer.prototype.getAxisExtent = function(dimension){\n\n if ([\"x\", \"y\"].indexOf(dimension) === -1){\n throw(\"Invalid dimension identifier passed to LocusZoom.DataLayer.getAxisExtent()\");\n }\n\n var axis_name = dimension + \"_axis\";\n var axis_layout = this.layout[axis_name];\n\n // If a floor AND a ceiling are explicitly defined then just return that extent and be done\n if (!isNaN(axis_layout.floor) && !isNaN(axis_layout.ceiling)){\n return [+axis_layout.floor, +axis_layout.ceiling];\n }\n\n // If a field is defined for the axis and the data layer has data then generate the extent from the data set\n var data_extent = [];\n if (axis_layout.field && this.data) {\n if (!this.data.length) {\n // If data has been fetched (but no points in region), enforce the min_extent (with no buffers,\n // because we don't need padding around an empty screen)\n data_extent = axis_layout.min_extent || [];\n return data_extent;\n } else {\n data_extent = d3.extent(this.data, function (d) {\n var f = new LocusZoom.Data.Field(axis_layout.field);\n return +f.resolve(d);\n });\n\n // Apply upper/lower buffers, if applicable\n var original_extent_span = data_extent[1] - data_extent[0];\n if (!isNaN(axis_layout.lower_buffer)) {\n data_extent[0] -= original_extent_span * axis_layout.lower_buffer;\n }\n if (!isNaN(axis_layout.upper_buffer)) {\n data_extent[1] += original_extent_span * axis_layout.upper_buffer;\n }\n\n if (typeof axis_layout.min_extent == \"object\") {\n // The data should span at least the range specified by min_extent, an array with [low, high]\n var range_min = axis_layout.min_extent[0];\n var range_max = axis_layout.min_extent[1];\n if (!isNaN(range_min) && !isNaN(range_max)) {\n data_extent[0] = Math.min(data_extent[0], range_min);\n }\n if (!isNaN(range_max)) {\n data_extent[1] = Math.max(data_extent[1], range_max);\n }\n }\n // If specified, floor and ceiling will override the actual data range\n return [\n isNaN(axis_layout.floor) ? data_extent[0] : axis_layout.floor,\n isNaN(axis_layout.ceiling) ? data_extent[1] : axis_layout.ceiling\n ];\n }\n }\n\n // If this is for the x axis and no extent could be generated yet but state has a defined start and end\n // then default to using the state-defined region as the extent\n if (dimension === \"x\" && !isNaN(this.state.start) && !isNaN(this.state.end)) {\n return [this.state.start, this.state.end];\n }\n\n // No conditions met for generating a valid extent, return an empty array\n return [];\n\n};\n\n/**\n * Allow this data layer to tell the panel what axis ticks it thinks it will require. The panel may choose whether\n * to use some, all, or none of these when rendering, either alone or in conjunction with other data layers.\n *\n * This method is a stub and should be overridden in data layers that need to specify custom behavior.\n *\n * @param {('x'|'y')} dimension\n * @param {Object} [config] Additional parameters for the panel to specify how it wants ticks to be drawn. The names\n * and meanings of these parameters may vary between different data layers.\n * @returns {Object[]}\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.DataLayer.prototype.getTicks = function (dimension, config) {\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw(\"Invalid dimension identifier\");\n }\n return [];\n};\n\n/**\n * Generate a tool tip for a given element\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.createTooltip = function(d, id){\n if (typeof this.layout.tooltip != \"object\"){\n throw (\"DataLayer [\" + this.id + \"] layout does not define a tooltip\");\n }\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n if (this.tooltips[id]){\n this.positionTooltip(id);\n return;\n }\n this.tooltips[id] = {\n data: d,\n arrow: null,\n selector: d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-data_layer-tooltip\")\n .attr(\"id\", id + \"-tooltip\")\n };\n this.updateTooltip(d);\n return this;\n};\n\n/**\n * Update a tool tip (generate its inner HTML)\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.updateTooltip = function(d, id){\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n // Empty the tooltip of all HTML (including its arrow!)\n this.tooltips[id].selector.html(\"\");\n this.tooltips[id].arrow = null;\n // Set the new HTML\n if (this.layout.tooltip.html){\n this.tooltips[id].selector.html(LocusZoom.parseFields(d, this.layout.tooltip.html));\n }\n // If the layout allows tool tips on this data layer to be closable then add the close button\n // and add padding to the tooltip to accommodate it\n if (this.layout.tooltip.closable){\n this.tooltips[id].selector.insert(\"button\", \":first-child\")\n .attr(\"class\", \"lz-tooltip-close-button\")\n .attr(\"title\", \"Close\")\n .text(\"×\")\n .on(\"click\", function(){\n this.destroyTooltip(id);\n }.bind(this));\n }\n // Apply data directly to the tool tip for easier retrieval by custom UI elements inside the tool tip\n this.tooltips[id].selector.data([d]);\n // Reposition and draw a new arrow\n this.positionTooltip(id);\n return this;\n};\n\n/**\n * Destroy tool tip - remove the tool tip element from the DOM and delete the tool tip's record on the data layer\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyTooltip = function(d, id){\n if (typeof d == \"string\"){\n id = d;\n } else if (typeof id == \"undefined\"){\n id = this.getElementId(d);\n }\n if (this.tooltips[id]){\n if (typeof this.tooltips[id].selector == \"object\"){\n this.tooltips[id].selector.remove();\n }\n delete this.tooltips[id];\n }\n return this;\n};\n\n/**\n * Loop through and destroy all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyAllTooltips = function(){\n for (var id in this.tooltips){\n this.destroyTooltip(id);\n }\n return this;\n};\n\n//\n/**\n * Position tool tip - naïve function to place a tool tip to the lower right of the current mouse element\n * Most data layers reimplement this method to position tool tips specifically for the data they display\n * @param {String} id The identifier of the tooltip to position\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n // Position the div itself\n this.tooltips[id].selector\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY) + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!this.tooltips[id].arrow){\n this.tooltips[id].arrow = this.tooltips[id].selector.append(\"div\")\n .style(\"position\", \"absolute\")\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_top_left\");\n }\n this.tooltips[id].arrow\n .style(\"left\", \"-1px\")\n .style(\"top\", \"-1px\");\n return this;\n};\n\n/**\n * Loop through and position all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionAllTooltips = function(){\n for (var id in this.tooltips){\n this.positionTooltip(id);\n }\n return this;\n};\n\n/**\n * Show or hide a tool tip by ID depending on directives in the layout and state values relative to the ID\n * @param {String|Object} element The element associated with the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.showOrHideTooltip = function(element){\n \n if (typeof this.layout.tooltip != \"object\"){ return; }\n var id = this.getElementId(element);\n\n var resolveStatus = function(statuses, directive, operator){\n var status = null;\n if (typeof statuses != \"object\" || statuses === null){ return null; }\n if (Array.isArray(directive)){\n if (typeof operator == \"undefined\"){ operator = \"and\"; }\n if (directive.length === 1){\n status = statuses[directive[0]];\n } else {\n status = directive.reduce(function(previousValue, currentValue) {\n if (operator === \"and\"){\n return statuses[previousValue] && statuses[currentValue];\n } else if (operator === \"or\"){\n return statuses[previousValue] || statuses[currentValue];\n }\n return null;\n });\n }\n } else if (typeof directive == \"object\"){\n var sub_status;\n for (var sub_operator in directive){\n sub_status = resolveStatus(statuses, directive[sub_operator], sub_operator);\n if (status === null){\n status = sub_status;\n } else if (operator === \"and\"){\n status = status && sub_status;\n } else if (operator === \"or\"){\n status = status || sub_status;\n }\n }\n }\n return status;\n };\n\n var show_directive = {};\n if (typeof this.layout.tooltip.show == \"string\"){\n show_directive = { and: [ this.layout.tooltip.show ] };\n } else if (typeof this.layout.tooltip.show == \"object\"){\n show_directive = this.layout.tooltip.show;\n }\n\n var hide_directive = {};\n if (typeof this.layout.tooltip.hide == \"string\"){\n hide_directive = { and: [ this.layout.tooltip.hide ] };\n } else if (typeof this.layout.tooltip.hide == \"object\"){\n hide_directive = this.layout.tooltip.hide;\n }\n\n var statuses = {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n var antistatus = \"un\" + status;\n statuses[status] = this.state[this.state_id][status].indexOf(id) !== -1;\n statuses[antistatus] = !statuses[status];\n }.bind(this));\n\n var show_resolved = resolveStatus(statuses, show_directive);\n var hide_resolved = resolveStatus(statuses, hide_directive);\n\n // Only show tooltip if the resolved logic explicitly shows and explicitly not hides the tool tip\n // Otherwise ensure tooltip does not exist\n if (show_resolved && !hide_resolved){\n this.createTooltip(element);\n } else {\n this.destroyTooltip(element);\n }\n\n return this;\n \n};\n\n/**\n * Find the elements (or indices) that match any of a set of provided filters\n * @protected\n * @param {Array[]} filters A list of filter entries: [field, value] (for equivalence testing) or\n * [field, operator, value] for other operators\n * @param {('indexes'|'elements')} [return_type='indexes'] Specify whether to return either the indices of the matching\n * elements, or references to the elements themselves\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filter = function(filters, return_type){\n if (typeof return_type == \"undefined\" || [\"indexes\",\"elements\"].indexOf(return_type) === -1){\n return_type = \"indexes\";\n }\n if (!Array.isArray(filters)){ return []; }\n var test = function(element, filter){\n var operators = {\n \"=\": function(a,b){ return a === b; },\n \"<\": function(a,b){ return a < b; },\n \"<=\": function(a,b){ return a <= b; },\n \">\": function(a,b){ return a > b; },\n \">=\": function(a,b){ return a >= b; },\n \"%\": function(a,b){ return a % b; }\n };\n if (!Array.isArray(filter)){ return false; }\n if (filter.length === 2){\n return element[filter[0]] === filter[1];\n } else if (filter.length === 3 && operators[filter[1]]){\n return operators[filter[1]](element[filter[0]], filter[2]);\n } else {\n return false;\n }\n };\n var matches = [];\n this.data.forEach(function(element, idx){\n var match = true;\n filters.forEach(function(filter){\n if (!test(element, filter)){ match = false; }\n });\n if (match){ matches.push(return_type === \"indexes\" ? idx : element); }\n });\n return matches;\n};\n\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterIndexes = function(filters){ return this.filter(filters, \"indexes\"); };\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterElements = function(filters){ return this.filter(filters, \"elements\"); };\n\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset a single element's status\n // TODO: Improve documentation for dynamically generated methods/properties\n LocusZoom.DataLayer.prototype[verb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, true, exclusive);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, false, exclusive);\n return this;\n };\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.DataLayer.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.DataLayer.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.DataLayer.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n/**\n * Toggle a status (e.g. highlighted, selected, identified) on an element\n * @param {String} status\n * @param {String|Object} element\n * @param {Boolean} toggle\n * @param {Boolean} exclusive\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatus = function(status, element, toggle, exclusive){\n \n // Sanity checks\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatus()\");\n }\n if (typeof element == \"undefined\"){\n throw(\"Invalid element passed to DataLayer.setElementStatus()\");\n }\n if (typeof toggle == \"undefined\"){\n toggle = true;\n }\n\n // Get an ID for the element or return having changed nothing\n try {\n var element_id = this.getElementId(element);\n } catch (get_element_id_error){\n return this;\n }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Set/unset the proper status class on the appropriate DOM element(s)\n d3.select(\"#\" + element_id).classed(\"lz-data_layer-\" + this.layout.type + \"-\" + status, toggle);\n var element_status_node_id = this.getElementStatusNodeId(element);\n if (element_status_node_id !== null){\n d3.select(\"#\" + element_status_node_id).classed(\"lz-data_layer-\" + this.layout.type + \"-statusnode-\" + status, toggle);\n }\n \n // Track element ID in the proper status state array\n var element_status_idx = this.state[this.state_id][status].indexOf(element_id);\n if (toggle && element_status_idx === -1){\n this.state[this.state_id][status].push(element_id);\n }\n if (!toggle && element_status_idx !== -1){\n this.state[this.state_id][status].splice(element_status_idx, 1);\n }\n \n // Trigger tool tip show/hide logic\n this.showOrHideTooltip(element);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\");\n this.parent_plot.emit(\"layout_changed\");\n\n return this;\n \n};\n\n/**\n * Toggle a status on elements in the data layer based on a set of filters\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatusByFilters()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; } else { toggle = !!toggle; }\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n if (!Array.isArray(filters)){ filters = []; }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Apply statuses\n this.filterElements(filters).forEach(function(element){\n this.setElementStatus(status, element, toggle);\n }.bind(this));\n \n return this;\n};\n\n/**\n * Toggle a status on all elements in the data layer\n * @param {String} status\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setAllElementStatus = function(status, toggle){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Apply statuses\n if (toggle){\n this.data.forEach(function(element){\n this.setElementStatus(status, element, true);\n }.bind(this));\n } else {\n var status_ids = this.state[this.state_id][status].slice();\n status_ids.forEach(function(id){\n var element = this.getElementById(id);\n if (typeof element == \"object\" && element !== null){\n this.setElementStatus(status, element, false);\n }\n }.bind(this));\n this.state[this.state_id][status] = [];\n }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n return this;\n};\n\n/**\n * Apply all layout-defined behaviors to a selection of elements with event handlers\n * @param {d3.selection} selection\n */\nLocusZoom.DataLayer.prototype.applyBehaviors = function(selection){\n if (typeof this.layout.behaviors != \"object\"){ return; }\n Object.keys(this.layout.behaviors).forEach(function(directive){\n var event_match = /(click|mouseover|mouseout)/.exec(directive);\n if (!event_match){ return; }\n selection.on(event_match[0] + \".\" + directive, this.executeBehaviors(directive, this.layout.behaviors[directive]));\n }.bind(this));\n};\n\n/**\n * Generate a function that executes an arbitrary list of behaviors on an element during an event\n * @param {String} directive The name of the event, as described in layout.behaviors for this datalayer\n * @param {Object} behaviors An object describing the behavior to attach to this single element\n * @param {string} behaviors.action The name of the action that would trigger this behavior (eg click, mouseover, etc)\n * @param {string} behaviors.status What status to apply to the element when this behavior is triggered (highlighted,\n * selected, etc)\n * @param {string} [behaviors.exclusive] Whether triggering the event for this element should unset the relevant status\n * for all other elements. Useful for, eg, click events that exclusively highlight one thing.\n * @returns {function(this:LocusZoom.DataLayer)} Return a function that handles the event in context with the behavior\n * and the element- can be attached as an event listener\n */\nLocusZoom.DataLayer.prototype.executeBehaviors = function(directive, behaviors) {\n\n // Determine the required state of control and shift keys during the event\n var requiredKeyStates = {\n \"ctrl\": (directive.indexOf(\"ctrl\") !== -1),\n \"shift\": (directive.indexOf(\"shift\") !== -1)\n };\n\n return function(element){\n\n // Do nothing if the required control and shift key presses (or lack thereof) doesn't match the event\n if (requiredKeyStates.ctrl !== !!d3.event.ctrlKey || requiredKeyStates.shift !== !!d3.event.shiftKey){ return; }\n\n // Loop through behaviors making each one go in succession\n behaviors.forEach(function(behavior){\n \n // Route first by the action, if defined\n if (typeof behavior != \"object\" || behavior === null){ return; }\n \n switch (behavior.action){\n \n // Set a status (set to true regardless of current status, optionally with exclusivity)\n case \"set\":\n this.setElementStatus(behavior.status, element, true, behavior.exclusive);\n break;\n \n // Unset a status (set to false regardless of current status, optionally with exclusivity)\n case \"unset\":\n this.setElementStatus(behavior.status, element, false, behavior.exclusive);\n break;\n \n // Toggle a status\n case \"toggle\":\n var current_status_boolean = (this.state[this.state_id][behavior.status].indexOf(this.getElementId(element)) !== -1);\n var exclusive = behavior.exclusive && !current_status_boolean;\n this.setElementStatus(behavior.status, element, !current_status_boolean, exclusive);\n break;\n \n // Link to a dynamic URL\n case \"link\":\n if (typeof behavior.href == \"string\"){\n var url = LocusZoom.parseFields(element, behavior.href);\n if (typeof behavior.target == \"string\"){\n window.open(url, behavior.target);\n } else {\n window.location.href = url;\n }\n }\n break;\n \n // Action not defined, just return\n default:\n break;\n \n }\n \n return;\n \n }.bind(this));\n\n }.bind(this);\n\n};\n\n/**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\nLocusZoom.DataLayer.prototype.getPageOrigin = function(){\n var panel_origin = this.parent.getPageOrigin();\n return {\n x: panel_origin.x + this.parent.layout.margin.left,\n y: panel_origin.y + this.parent.layout.margin.top\n };\n};\n\n/**\n * Get a data layer's current underlying data in a standard format (e.g. JSON or CSV)\n * @param {('csv'|'tsv'|'json')} format How to export the data\n * @returns {*}\n */\nLocusZoom.DataLayer.prototype.exportData = function(format){\n var default_format = \"json\";\n format = format || default_format;\n format = (typeof format == \"string\" ? format.toLowerCase() : default_format);\n if ([\"json\",\"csv\",\"tsv\"].indexOf(format) === -1){ format = default_format; }\n var ret;\n switch (format){\n case \"json\":\n try {\n ret = JSON.stringify(this.data);\n } catch (e){\n ret = null;\n console.error(\"Unable to export JSON data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n case \"tsv\":\n case \"csv\":\n try {\n var jsonified = JSON.parse(JSON.stringify(this.data));\n if (typeof jsonified != \"object\"){\n ret = jsonified.toString();\n } else if (!Array.isArray(jsonified)){\n ret = \"Object\";\n } else {\n var delimiter = (format === \"tsv\") ? \"\\t\" : \",\";\n var header = this.layout.fields.map(function(header){\n return JSON.stringify(header);\n }).join(delimiter) + \"\\n\";\n ret = header + jsonified.map(function(record){\n return this.layout.fields.map(function(field){\n if (typeof record[field] == \"undefined\"){\n return JSON.stringify(null);\n } else if (typeof record[field] == \"object\" && record[field] !== null){\n return Array.isArray(record[field]) ? \"\\\"[Array(\" + record[field].length + \")]\\\"\" : \"\\\"[Object]\\\"\";\n } else {\n return JSON.stringify(record[field]);\n }\n }).join(delimiter);\n }.bind(this)).join(\"\\n\");\n }\n } catch (e){\n ret = null;\n console.error(\"Unable to export CSV data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n }\n return ret;\n};\n\n/**\n * Position the datalayer and all tooltips\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.draw = function(){\n this.svg.container.attr(\"transform\", \"translate(\" + this.parent.layout.cliparea.origin.x + \",\" + this.parent.layout.cliparea.origin.y + \")\");\n this.svg.clipRect\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.parent.layout.cliparea.height);\n this.positionAllTooltips();\n return this;\n};\n\n\n/**\n * Re-Map a data layer to reflect changes in the state of a plot (such as viewing region/ chromosome range)\n * @return {Promise}\n */\nLocusZoom.DataLayer.prototype.reMap = function(){\n\n this.destroyAllTooltips(); // hack - only non-visible tooltips should be destroyed\n // and then recreated if returning to visibility\n\n // Fetch new data\n var promise = this.parent_plot.lzd.getData(this.state, this.layout.fields); //,\"ld:best\"\n promise.then(function(new_data){\n this.data = new_data.body;\n this.applyDataMethods();\n this.initialized = true;\n }.bind(this));\n\n return promise;\n\n};\n\n\n/**\n * The central registry of known data layer definitions (which may be stored in separate files due to length)\n * @namespace\n */\nLocusZoom.DataLayers = (function() {\n var obj = {};\n var datalayers = {};\n /**\n * @name LocusZoom.DataLayers.get\n * @param {String} name The name of the datalayer\n * @param {Object} layout The configuration object for this data layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n * @returns {LocusZoom.DataLayer}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (datalayers[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for data layer [\" + name + \"]\");\n } else {\n return new datalayers[name](layout, parent);\n }\n } else {\n throw(\"data layer [\" + name + \"] not found\");\n }\n };\n\n /**\n * @name LocusZoom.DataLayers.set\n * @protected\n * @param {String} name\n * @param {Function} datalayer Constructor for the datalayer\n */\n obj.set = function(name, datalayer) {\n if (datalayer) {\n if (typeof datalayer != \"function\"){\n throw(\"unable to set data layer [\" + name + \"], argument provided is not a function\");\n } else {\n datalayers[name] = datalayer;\n datalayers[name].prototype = new LocusZoom.DataLayer();\n }\n } else {\n delete datalayers[name];\n }\n };\n\n /**\n * Add a new type of datalayer to the registry of known layer types\n * @name LocusZoom.DataLayers.add\n * @param {String} name The name of the data layer to register\n * @param {Function} datalayer\n */\n obj.add = function(name, datalayer) {\n if (datalayers[name]) {\n throw(\"data layer already exists with name: \" + name);\n } else {\n obj.set(name, datalayer);\n }\n };\n\n /**\n * Register a new datalayer that inherits and extends basic behaviors from a known datalayer\n * @param {String} parent_name The name of the parent data layer whose behavior is to be extended\n * @param {String} name The name of the new datalayer to register\n * @param {Object} [overrides] Object of properties and methods to combine with the prototype of the parent datalayer\n * @returns {Function} The constructor for the new child class\n */\n obj.extend = function(parent_name, name, overrides) {\n // TODO: Consider exposing additional constructor argument, if there is a use case for very granular extension\n overrides = overrides || {};\n\n var parent = datalayers[parent_name];\n if (!parent) {\n throw \"Attempted to subclass an unknown or unregistered datalayer type\";\n }\n if (typeof overrides !== \"object\") {\n throw \"Must specify an object of properties and methods\";\n }\n var child = LocusZoom.subclass(parent, overrides);\n // Bypass .set() because we want a layer of inheritance below `DataLayer`\n datalayers[name] = child;\n return child;\n };\n\n /**\n * List the names of all known datalayers\n * @name LocusZoom.DataLayers.list\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(datalayers);\n };\n\n return obj;\n})();\n","\"use strict\";\n\n/**\n * Create a single continuous 2D track that provides information about each datapoint\n *\n * For example, this can be used to color by membership in a group, alongside information in other panels\n *\n * @class LocusZoom.DataLayers.annotation_track\n * @augments LocusZoom.DataLayer\n * @param {Object} layout\n * @param {Object|String} [layout.color]\n * @param {Array[]} An array of filter entries specifying which points to draw annotations for.\n * See `LocusZoom.DataLayer.filter` for details\n */\nLocusZoom.DataLayers.add(\"annotation_track\", function(layout) {\n // In the future we may add additional options for controlling marker size/ shape, based on user feedback\n this.DefaultLayout = {\n color: \"#000000\",\n filters: []\n };\n\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n if (!Array.isArray(layout.filters)) {\n throw \"Annotation track must specify array of filters for selecting points to annotate\";\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n this.render = function() {\n var self = this;\n // Only render points that currently satisfy all provided filter conditions.\n var trackData = this.filter(this.layout.filters, \"elements\");\n\n var selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-\" + self.layout.type)\n .data(trackData, function(d) { return d[self.layout.id_field]; });\n\n // Add new elements as needed\n selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function (d){ return self.getElementId(d); });\n // Update the set of elements to reflect new data\n selection\n .attr(\"x\", function (d) { return self.parent[\"x_scale\"](d[self.layout.x_axis.field]); })\n .attr(\"width\", 1) // TODO autocalc width of track? Based on datarange / pixel width presumably\n .attr(\"height\", self.parent.layout.height)\n .attr(\"fill\", function(d){ return self.resolveScalableParameter(self.layout.color, d); });\n // Remove unused elements\n selection.exit().remove();\n\n // Set up tooltips and mouse interaction\n this.applyBehaviors(selection);\n };\n\n // Reimplement the positionTooltip() method to be annotation-specific\n this.positionTooltip = function(id) {\n if (typeof id != \"string\") {\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]) {\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var offset = stroke_width / 2;\n var page_origin = this.getPageOrigin();\n\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_center = data_layer_height / 2;\n\n // Tooltip should be horizontally centered above the point to be annotated. (or below if space is limited)\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width) + offset_left - offset_right - offset;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - y_center) {\n top = page_origin.y + y_center - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow) {\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n return this;\n});\n","\"use strict\";\n\n/*********************\n Forest Data Layer\n Implements a standard forest plot\n*/\n\nLocusZoom.DataLayers.add(\"forest\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"square\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 2\n },\n id_field: \"id\",\n confidence_intervals: {\n start_field: \"ci_start\",\n end_field: \"ci_end\"\n },\n show_no_significance_line: true\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be forest-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n var offset = Math.sqrt(point_size / Math.PI);\n var left, arrow_type, arrow_left;\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var top, arrow_top;\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n } \n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Implement the main render function\n this.render = function(){\n\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate confidence interval paths if fields are defined\n if (this.layout.confidence_intervals\n && this.layout.fields.indexOf(this.layout.confidence_intervals.start_field) !== -1\n && this.layout.fields.indexOf(this.layout.confidence_intervals.end_field) !== -1){\n // Generate a selection for all forest plot confidence intervals\n var ci_selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-forest.lz-data_layer-forest-ci\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n // Create confidence interval rect elements\n ci_selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-ci\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_ci\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + (isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height) + \")\");\n // Apply position and size parameters using transition if necessary\n var ci_transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n var ci_width = function(d){\n return this.parent[x_scale](d[this.layout.confidence_intervals.end_field])\n - this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n }.bind(this);\n var ci_height = 1;\n if (this.canTransition()){\n ci_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n } else {\n ci_selection\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n }\n // Remove old elements as needed\n ci_selection.exit().remove();\n }\n \n // Generate a selection for all forest plot points\n var points_selection = this.svg.group\n .selectAll(\"path.lz-data_layer-forest.lz-data_layer-forest-point\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n points_selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-point\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_point\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n if (this.canTransition()){\n points_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n points_selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n points_selection.exit().remove();\n\n // Apply default event emitters to selection\n points_selection.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element);\n this.parent_plot.emit(\"element_clicked\", element);\n }.bind(this));\n \n // Apply behaviors to points\n this.applyBehaviors(points_selection);\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Genes Data Layer\n * Implements a data layer that will render gene tracks\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"genes\", function(layout){\n /**\n * Define a default layout for this DataLayer type and merge it with the passed argument\n * @protected\n * @member {Object}\n * */\n this.DefaultLayout = {\n label_font_size: 12,\n label_exon_spacing: 4,\n exon_height: 16,\n bounding_box_padding: 6,\n track_vertical_spacing: 10,\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Generate a statusnode ID for a given element\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n return this.getElementId(element) + \"-statusnode\";\n };\n\n /**\n * Helper function to sum layout values to derive total height for a single gene track\n * @returns {number}\n */\n this.getTrackHeight = function(){\n return 2 * this.layout.bounding_box_padding\n + this.layout.label_font_size\n + this.layout.label_exon_spacing\n + this.layout.exon_height\n + this.layout.track_vertical_spacing;\n };\n\n /**\n * A gene may have arbitrarily many transcripts, but this data layer isn't set up to render them yet.\n * Stash a transcript_idx to point to the first transcript and use that for all transcript refs.\n * @member {number}\n * @type {number}\n */\n this.transcript_idx = 0;\n\n /**\n * An internal counter for the number of tracks in the data layer. Used as an internal counter for looping\n * over positions / assignments\n * @protected\n * @member {number}\n */\n this.tracks = 1;\n\n /**\n * Store information about genes in dataset, in a hash indexed by track number: {track_number: [gene_indices]}\n * @member {Object.}\n */\n this.gene_track_index = { 1: [] };\n\n /**\n * Ensure that genes in overlapping chromosome regions are positioned so that parts of different genes do not\n * overlap in the view. A track is a row used to vertically separate overlapping genes.\n * @returns {LocusZoom.DataLayer}\n */\n this.assignTracks = function(){\n /**\n * Function to get the width in pixels of a label given the text and layout attributes\n * TODO: Move to outer scope?\n * @param {String} gene_name\n * @param {number|string} font_size\n * @returns {number}\n */\n this.getLabelWidth = function(gene_name, font_size){\n try {\n var temp_text = this.svg.group.append(\"text\")\n .attr(\"x\", 0).attr(\"y\", 0).attr(\"class\", \"lz-data_layer-genes lz-label\")\n .style(\"font-size\", font_size)\n .text(gene_name + \"→\");\n var label_width = temp_text.node().getBBox().width;\n temp_text.remove();\n return label_width;\n } catch (e){\n return 0;\n }\n };\n\n // Reinitialize some metadata\n this.tracks = 1;\n this.gene_track_index = { 1: [] };\n\n this.data.map(function(d, g){\n\n // If necessary, split combined gene id / version fields into discrete fields.\n // NOTE: this may be an issue with CSG's genes data source that may eventually be solved upstream.\n if (this.data[g].gene_id && this.data[g].gene_id.indexOf(\".\")){\n var split = this.data[g].gene_id.split(\".\");\n this.data[g].gene_id = split[0];\n this.data[g].gene_version = split[1];\n }\n\n // Stash the transcript ID on the parent gene\n this.data[g].transcript_id = this.data[g].transcripts[this.transcript_idx].transcript_id;\n\n // Determine display range start and end, based on minimum allowable gene display width, bounded by what we can see\n // (range: values in terms of pixels on the screen)\n this.data[g].display_range = {\n start: this.parent.x_scale(Math.max(d.start, this.state.start)),\n end: this.parent.x_scale(Math.min(d.end, this.state.end))\n };\n this.data[g].display_range.label_width = this.getLabelWidth(this.data[g].gene_name, this.layout.label_font_size);\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n // Determine label text anchor (default to middle)\n this.data[g].display_range.text_anchor = \"middle\";\n if (this.data[g].display_range.width < this.data[g].display_range.label_width){\n if (d.start < this.state.start){\n this.data[g].display_range.end = this.data[g].display_range.start\n + this.data[g].display_range.label_width\n + this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"start\";\n } else if (d.end > this.state.end){\n this.data[g].display_range.start = this.data[g].display_range.end\n - this.data[g].display_range.label_width\n - this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n var centered_margin = ((this.data[g].display_range.label_width - this.data[g].display_range.width) / 2)\n + this.layout.label_font_size;\n if ((this.data[g].display_range.start - centered_margin) < this.parent.x_scale(this.state.start)){\n this.data[g].display_range.start = this.parent.x_scale(this.state.start);\n this.data[g].display_range.end = this.data[g].display_range.start + this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"start\";\n } else if ((this.data[g].display_range.end + centered_margin) > this.parent.x_scale(this.state.end)) {\n this.data[g].display_range.end = this.parent.x_scale(this.state.end);\n this.data[g].display_range.start = this.data[g].display_range.end - this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n this.data[g].display_range.start -= centered_margin;\n this.data[g].display_range.end += centered_margin;\n }\n }\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n }\n // Add bounding box padding to the calculated display range start, end, and width\n this.data[g].display_range.start -= this.layout.bounding_box_padding;\n this.data[g].display_range.end += this.layout.bounding_box_padding;\n this.data[g].display_range.width += 2 * this.layout.bounding_box_padding;\n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[g].display_domain = {\n start: this.parent.x_scale.invert(this.data[g].display_range.start),\n end: this.parent.x_scale.invert(this.data[g].display_range.end)\n };\n this.data[g].display_domain.width = this.data[g].display_domain.end - this.data[g].display_domain.start;\n\n // Using display range/domain data generated above cast each gene to tracks such that none overlap\n this.data[g].track = null;\n var potential_track = 1;\n while (this.data[g].track === null){\n var collision_on_potential_track = false;\n this.gene_track_index[potential_track].map(function(placed_gene){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_gene.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_gene.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_gene.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[g]));\n if (!collision_on_potential_track){\n this.data[g].track = potential_track;\n this.gene_track_index[potential_track].push(this.data[g]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.gene_track_index[potential_track] = [];\n }\n }\n }\n\n // Stash parent references on all genes, trascripts, and exons\n this.data[g].parent = this;\n this.data[g].transcripts.map(function(d, t){\n this.data[g].transcripts[t].parent = this.data[g];\n this.data[g].transcripts[t].exons.map(function(d, e){\n this.data[g].transcripts[t].exons[e].parent = this.data[g].transcripts[t];\n }.bind(this));\n }.bind(this));\n\n }.bind(this));\n return this;\n };\n\n /**\n * Main render function\n */\n this.render = function(){\n\n this.assignTracks();\n\n var width, height, x, y;\n\n // Render gene groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-genes\")\n .data(this.data, function(d){ return d.gene_name; });\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-genes\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(gene){\n\n var data_layer = gene.parent;\n\n // Render gene bounding boxes (status nodes to show selected/highlighted)\n var bboxes = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-data_layer-genes-statusnode\")\n .data([gene], function(d){ return data_layer.getElementStatusNodeId(d); });\n\n bboxes.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-data_layer-genes-statusnode\");\n \n bboxes\n .attr(\"id\", function(d){\n return data_layer.getElementStatusNodeId(d);\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n bboxes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n bboxes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n bboxes.exit().remove();\n\n // Render gene boundaries\n var boundaries = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-boundary\")\n .data([gene], function(d){ return d.gene_name + \"_boundary\"; });\n\n boundaries.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-boundary\");\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return 1; // TODO: scale dynamically?\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing\n + (Math.max(data_layer.layout.exon_height, 3) / 2);\n };\n if (data_layer.canTransition()){\n boundaries\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n boundaries\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n \n boundaries.exit().remove();\n\n // Render gene labels\n var labels = d3.select(this).selectAll(\"text.lz-data_layer-genes.lz-label\")\n .data([gene], function(d){ return d.gene_name + \"_label\"; });\n\n labels.enter().append(\"text\")\n .attr(\"class\", \"lz-data_layer-genes lz-label\");\n\n labels\n .attr(\"text-anchor\", function(d){\n return d.display_range.text_anchor;\n })\n .text(function(d){\n return (d.strand === \"+\") ? d.gene_name + \"→\" : \"←\" + d.gene_name;\n })\n .style(\"font-size\", gene.parent.layout.label_font_size);\n\n x = function(d){\n if (d.display_range.text_anchor === \"middle\"){\n return d.display_range.start + (d.display_range.width / 2);\n } else if (d.display_range.text_anchor === \"start\"){\n return d.display_range.start + data_layer.layout.bounding_box_padding;\n } else if (d.display_range.text_anchor === \"end\"){\n return d.display_range.end - data_layer.layout.bounding_box_padding;\n }\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size;\n };\n if (data_layer.canTransition()){\n labels\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"x\", x).attr(\"y\", y);\n } else {\n labels\n .attr(\"x\", x).attr(\"y\", y);\n }\n\n labels.exit().remove();\n\n // Render exon rects (first transcript only, for now)\n var exons = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-exon\")\n .data(gene.transcripts[gene.parent.transcript_idx].exons, function(d){ return d.exon_id; });\n \n exons.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-exon\");\n \n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return data_layer.layout.exon_height;\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(){\n return ((gene.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing;\n };\n if (data_layer.canTransition()){\n exons\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n exons\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n exons.exit().remove();\n\n // Render gene click area\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-clickarea\")\n .data([gene], function(d){ return d.gene_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click.event_emitter\", function(element){\n element.parent.parent.emit(\"element_clicked\", element);\n element.parent.parent_plot.emit(\"element_clicked\", element);\n });\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n };\n\n /**\n * Reimplement the positionTooltip() method to be gene-specific\n * @param {String} id\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var gene_bbox_id = this.getElementStatusNodeId(tooltip.data);\n var gene_bbox = d3.select(\"#\" + gene_bbox_id).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the gene that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var gene_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - gene_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + gene_center_x - data_layer_width, 0);\n var left = page_origin.x + gene_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the gene unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (gene_bbox.y + gene_bbox.height)){\n top = page_origin.y + gene_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + gene_bbox.y + gene_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Genome Legend Data Layer\n Implements a data layer that will render a genome legend\n*/\n\n// Build a custom data layer for a genome legend\nLocusZoom.DataLayers.add(\"genome_legend\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n chromosome_fill_colors: {\n light: \"rgb(155, 155, 188)\",\n dark: \"rgb(95, 95, 128)\"\n },\n chromosome_label_colors: {\n light: \"rgb(120, 120, 186)\",\n dark: \"rgb(0, 0, 66)\"\n }\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Implement the main render function\n this.render = function(){\n\n // Iterate over data to generate genome-wide start/end values for each chromosome\n var position = 0;\n this.data.forEach(function(d, i){\n this.data[i].genome_start = position;\n this.data[i].genome_end = position + d[\"genome:base_pairs\"];\n position += d[\"genome:base_pairs\"];\n }.bind(this));\n\n var chromosomes = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend\")\n .data(this.data, function(d){ return d[\"genome:chr\"]; });\n\n // Create chromosome elements, apply class\n chromosomes.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend\");\n\n // Position and fill chromosome rects\n var data_layer = this;\n var panel = this.parent;\n\n chromosomes\n .attr(\"fill\", function(d){ return (d[\"genome:chr\"] % 2 ? data_layer.layout.chromosome_fill_colors.light : data_layer.layout.chromosome_fill_colors.dark); })\n .attr(\"x\", function(d){ return panel.x_scale(d.genome_start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d[\"genome:base_pairs\"]); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n // Remove old elements as needed\n chromosomes.exit().remove();\n\n // Parse current state variant into a position\n // Assumes that variant string is of the format 10:123352136_C/T or 10:123352136\n var variant_parts = /([^:]+):(\\d+)(?:_.*)?/.exec(this.state.variant);\n if (!variant_parts) {\n throw(\"Genome legend cannot understand the specified variant position\");\n }\n var chr = variant_parts[1];\n var offset = variant_parts[2];\n // TODO: How does this handle representation of X or Y chromosomes?\n position = +this.data[chr-1].genome_start + +offset;\n\n // Render the position\n var region = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend-marker\")\n .data([{ start: position, end: position + 1 }]);\n\n region.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend-marker\");\n\n region\n .transition()\n .duration(500)\n .style({\n \"fill\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke-width\": \"3px\"\n })\n .attr(\"x\", function(d){ return panel.x_scale(d.start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d.end - d.start); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n region.exit().remove();\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/**\n * Intervals Data Layer\n * Implements a data layer that will render interval annotation tracks (intervals must provide start and end values)\n * @class LocusZoom.DataLayers.intervals\n * @augments LocusZoom.DataLayer\n */\nLocusZoom.DataLayers.add(\"intervals\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n start_field: \"start\",\n end_field: \"end\",\n track_split_field: \"state_id\",\n track_split_order: \"DESC\",\n track_split_legend_to_y_axis: 2,\n split_tracks: true,\n track_height: 15,\n track_vertical_spacing: 3,\n bounding_box_padding: 2,\n always_hide_legend: false,\n color: \"#B8B8B8\",\n fill_opacity: 1\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n \n /**\n * To define shared highlighting on the track split field define the status node id override\n * to generate an ID common to the track when we're actively splitting data out to separate tracks\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n if (this.layout.split_tracks){\n return (this.getBaseId() + \"-statusnode-\" + element[this.layout.track_split_field]).replace(/[:.[\\],]/g, \"_\");\n }\n return this.getElementId(element) + \"-statusnode\";\n }.bind(this);\n \n // Helper function to sum layout values to derive total height for a single interval track\n this.getTrackHeight = function(){\n return this.layout.track_height\n + this.layout.track_vertical_spacing\n + (2 * this.layout.bounding_box_padding);\n };\n\n this.tracks = 1;\n this.previous_tracks = 1;\n \n // track-number-indexed object with arrays of interval indexes in the dataset\n this.interval_track_index = { 1: [] };\n\n // After we've loaded interval data interpret it to assign\n // each to a track so that they do not overlap in the view\n this.assignTracks = function(){\n\n // Reinitialize some metadata\n this.previous_tracks = this.tracks;\n this.tracks = 0;\n this.interval_track_index = { 1: [] };\n this.track_split_field_index = {};\n \n // If splitting tracks by a field's value then do a first pass determine\n // a value/track mapping that preserves the order of possible values\n if (this.layout.track_split_field && this.layout.split_tracks){\n this.data.map(function(d){\n this.track_split_field_index[d[this.layout.track_split_field]] = null;\n }.bind(this));\n var index = Object.keys(this.track_split_field_index);\n if (this.layout.track_split_order === \"DESC\"){ index.reverse(); }\n index.forEach(function(val){\n this.track_split_field_index[val] = this.tracks + 1;\n this.interval_track_index[this.tracks + 1] = [];\n this.tracks++;\n }.bind(this));\n }\n\n this.data.map(function(d, i){\n\n // Stash a parent reference on the interval\n this.data[i].parent = this;\n\n // Determine display range start and end, based on minimum allowable interval display width,\n // bounded by what we can see (range: values in terms of pixels on the screen)\n this.data[i].display_range = {\n start: this.parent.x_scale(Math.max(d[this.layout.start_field], this.state.start)),\n end: this.parent.x_scale(Math.min(d[this.layout.end_field], this.state.end))\n };\n this.data[i].display_range.width = this.data[i].display_range.end - this.data[i].display_range.start;\n \n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[i].display_domain = {\n start: this.parent.x_scale.invert(this.data[i].display_range.start),\n end: this.parent.x_scale.invert(this.data[i].display_range.end)\n };\n this.data[i].display_domain.width = this.data[i].display_domain.end - this.data[i].display_domain.start;\n\n // If splitting to tracks based on the value of the designated track split field\n // then don't bother with collision detection (intervals will be grouped on tracks\n // solely by the value of track_split_field)\n if (this.layout.track_split_field && this.layout.split_tracks){\n var val = this.data[i][this.layout.track_split_field];\n this.data[i].track = this.track_split_field_index[val];\n this.interval_track_index[this.data[i].track].push(i);\n } else {\n // If not splitting to tracks based on a field value then do so based on collision\n // detection (as how it's done for genes). Use display range/domain data generated\n // above and cast each interval to tracks such that none overlap\n this.tracks = 1;\n this.data[i].track = null;\n var potential_track = 1;\n while (this.data[i].track === null){\n var collision_on_potential_track = false;\n this.interval_track_index[potential_track].map(function(placed_interval){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_interval.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_interval.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_interval.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[i]));\n if (!collision_on_potential_track){\n this.data[i].track = potential_track;\n this.interval_track_index[potential_track].push(this.data[i]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.interval_track_index[potential_track] = [];\n }\n }\n }\n\n }\n\n }.bind(this));\n\n return this;\n };\n\n // Implement the main render function\n this.render = function(){\n\n this.assignTracks();\n\n // Remove any shared highlight nodes and re-render them if we're splitting on tracks\n // At most there will only be dozen or so nodes here (one per track) and each time\n // we render data we may have new tracks, so wiping/redrawing all is reasonable.\n this.svg.group.selectAll(\".lz-data_layer-intervals-statusnode.lz-data_layer-intervals-shared\").remove();\n Object.keys(this.track_split_field_index).forEach(function(key){\n // Make a psuedo-element so that we can generate an id for the shared node\n var psuedoElement = {};\n psuedoElement[this.layout.track_split_field] = key;\n // Insert the shared node\n var sharedstatusnode_style = {display: (this.layout.split_tracks ? null : \"none\")};\n this.svg.group.insert(\"rect\", \":first-child\")\n .attr(\"id\", this.getElementStatusNodeId(psuedoElement))\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-shared\")\n .attr(\"rx\", this.layout.bounding_box_padding).attr(\"ry\", this.layout.bounding_box_padding)\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.getTrackHeight() - this.layout.track_vertical_spacing)\n .attr(\"x\", 0)\n .attr(\"y\", (this.track_split_field_index[key]-1) * this.getTrackHeight())\n .style(sharedstatusnode_style);\n }.bind(this));\n\n var width, height, x, y, fill, fill_opacity;\n \n // Render interval groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-intervals\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-intervals\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(interval){\n\n var data_layer = interval.parent;\n\n // Render interval status nodes (displayed behind intervals to show highlight\n // without needing to modify interval display element(s))\n var statusnode_style = {display: (data_layer.layout.split_tracks ? \"none\" : null)};\n var statusnodes = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-data_layer-intervals-statusnode.lz-data_layer-intervals-statusnode-discrete\")\n .data([interval], function(d){ return data_layer.getElementId(d) + \"-statusnode\"; });\n statusnodes.enter().insert(\"rect\", \":first-child\")\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-statusnode-discrete\");\n statusnodes\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"-statusnode\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .style(statusnode_style);\n width = function(d){\n return d.display_range.width + (2 * data_layer.layout.bounding_box_padding);\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start - data_layer.layout.bounding_box_padding;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n statusnodes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n statusnodes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n statusnodes.exit().remove();\n\n // Render primary interval rects\n var rects = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-interval_rect\")\n .data([interval], function(d){ return d[data_layer.layout.id_field] + \"_interval_rect\"; });\n\n rects.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-interval_rect\");\n\n height = data_layer.layout.track_height;\n width = function(d){\n return d.display_range.width;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding;\n };\n fill = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.color, d);\n };\n fill_opacity = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.fill_opacity, d);\n };\n \n \n if (data_layer.canTransition()){\n rects\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n } else {\n rects\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n }\n \n rects.exit().remove();\n\n // Render interval click areas\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-clickarea\")\n .data([interval], function(d){ return d.interval_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click\", function(element){\n element.parent.parent.emit(\"element_clicked\", element);\n element.parent.parent_plot.emit(\"element_clicked\", element);\n }.bind(this));\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Update the legend axis if the number of ticks changed\n if (this.previous_tracks !== this.tracks){\n this.updateSplitTrackAxis();\n }\n\n return this;\n\n };\n \n // Reimplement the positionTooltip() method to be interval-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var interval_bbox = d3.select(\"#\" + this.getElementStatusNodeId(tooltip.data)).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the interval that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var interval_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - interval_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + interval_center_x - data_layer_width, 0);\n var left = page_origin.x + interval_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the interval unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (interval_bbox.y + interval_bbox.height)){\n top = page_origin.y + interval_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + interval_bbox.y + interval_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Redraw split track axis or hide it, and show/hide the legend, as determined\n // by current layout parameters and data\n this.updateSplitTrackAxis = function(){\n var legend_axis = this.layout.track_split_legend_to_y_axis ? \"y\" + this.layout.track_split_legend_to_y_axis : false;\n if (this.layout.split_tracks){\n var tracks = +this.tracks || 0;\n var track_height = +this.layout.track_height || 0;\n var track_spacing = 2 * (+this.layout.bounding_box_padding || 0) + (+this.layout.track_vertical_spacing || 0);\n var target_height = (tracks * track_height) + ((tracks - 1) * track_spacing);\n this.parent.scaleHeightToData(target_height);\n if (legend_axis && this.parent.legend){\n this.parent.legend.hide(); \n this.parent.layout.axes[legend_axis] = {\n render: true,\n ticks: [],\n range: {\n start: (target_height - (this.layout.track_height/2)),\n end: (this.layout.track_height/2)\n }\n };\n this.layout.legend.forEach(function(element){\n var key = element[this.layout.track_split_field];\n var track = this.track_split_field_index[key];\n if (track){\n if (this.layout.track_split_order === \"DESC\"){\n track = Math.abs(track - tracks - 1);\n }\n this.parent.layout.axes[legend_axis].ticks.push({\n y: track,\n text: element.label\n });\n }\n }.bind(this));\n this.layout.y_axis = {\n axis: this.layout.track_split_legend_to_y_axis,\n floor: 1,\n ceiling: tracks\n };\n this.parent.render();\n }\n this.parent_plot.positionPanels();\n } else {\n if (legend_axis && this.parent.legend){\n if (!this.layout.always_hide_legend){ this.parent.legend.show(); }\n this.parent.layout.axes[legend_axis] = { render: false };\n this.parent.render();\n }\n }\n return this;\n };\n\n // Method to not only toggle the split tracks boolean but also update\n // necessary display values to animate a complete merge/split\n this.toggleSplitTracks = function(){\n this.layout.split_tracks = !this.layout.split_tracks;\n if (this.parent.legend && !this.layout.always_hide_legend){\n this.parent.layout.margin.bottom = 5 + (this.layout.split_tracks ? 0 : this.parent.legend.layout.height + 5);\n }\n this.render();\n this.updateSplitTrackAxis();\n return this;\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Line Data Layer\n * Implements a standard line plot\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n /** @member {Object} */\n this.DefaultLayout = {\n style: {\n fill: \"none\",\n \"stroke-width\": \"2px\"\n },\n interpolate: \"linear\",\n x_axis: { field: \"x\" },\n y_axis: { field: \"y\", axis: 1 },\n hitarea_width: 5\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Var for storing mouse events for use in tool tip positioning\n /** @member {String} */\n this.mouse_event = null;\n\n /**\n * Var for storing the generated line function itself\n * @member {d3.svg.line}\n * */\n this.line = null;\n\n /**\n * The timeout identifier returned by setTimeout\n * @member {Number}\n */\n this.tooltip_timeout = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n\n /**\n * Helper function to get display and data objects representing\n * the x/y coordinates of the current mouse event with respect to the line in terms of the display\n * and the interpolated values of the x/y fields with respect to the line\n * @returns {{display: {x: *, y: null}, data: {}, slope: null}}\n */\n this.getMouseDisplayAndData = function(){\n var ret = {\n display: {\n x: d3.mouse(this.mouse_event)[0],\n y: null\n },\n data: {},\n slope: null\n };\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n ret.data[x_field] = this.parent[x_scale].invert(ret.display.x);\n var bisect = d3.bisector(function(datum) { return +datum[x_field]; }).left;\n var index = bisect(this.data, ret.data[x_field]) - 1;\n var startDatum = this.data[index];\n var endDatum = this.data[index + 1];\n var interpolate = d3.interpolateNumber(+startDatum[y_field], +endDatum[y_field]);\n var range = +endDatum[x_field] - +startDatum[x_field];\n ret.data[y_field] = interpolate((ret.data[x_field] % range) / range);\n ret.display.y = this.parent[y_scale](ret.data[y_field]);\n if (this.layout.tooltip.x_precision){\n ret.data[x_field] = ret.data[x_field].toPrecision(this.layout.tooltip.x_precision);\n }\n if (this.layout.tooltip.y_precision){\n ret.data[y_field] = ret.data[y_field].toPrecision(this.layout.tooltip.y_precision);\n }\n ret.slope = (this.parent[y_scale](endDatum[y_field]) - this.parent[y_scale](startDatum[y_field]))\n / (this.parent[x_scale](endDatum[x_field]) - this.parent[x_scale](startDatum[x_field]));\n return ret;\n };\n\n /**\n * Reimplement the positionTooltip() method to be line-specific\n * @param {String} id Identify the tooltip to be positioned\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var arrow_width = 7; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var stroke_width = parseFloat(this.layout.style[\"stroke-width\"]) || 1;\n var page_origin = this.getPageOrigin();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n var top, left, arrow_top, arrow_left, arrow_type;\n\n // Determine x/y coordinates for display and data\n var dd = this.getMouseDisplayAndData();\n\n // If the absolute value of the slope of the line at this point is above 1 (including Infinity)\n // then position the tool tip left/right. Otherwise position top/bottom.\n if (Math.abs(dd.slope) > 1){\n\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (dd.display.x <= this.parent.layout.width / 2){\n left = page_origin.x + dd.display.x + stroke_width + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + dd.display.x - tooltip_box.width - stroke_width - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n if (dd.display.y - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + dd.display.y - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (dd.display.y + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + dd.display.y + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + dd.display.y - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n\n } else {\n\n // Position horizontally: attempt to center on the mouse's x coordinate\n // pad to either side if bumping up against the edge of the data layer\n var offset_right = Math.max((tooltip_box.width / 2) - dd.display.x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + dd.display.x - data_layer_width, 0);\n left = page_origin.x + dd.display.x - (tooltip_box.width / 2) - offset_left + offset_right;\n var min_arrow_left = arrow_width / 2;\n var max_arrow_left = tooltip_box.width - (2.5 * arrow_width);\n arrow_left = (tooltip_box.width / 2) - arrow_width + offset_left - offset_right;\n arrow_left = Math.min(Math.max(arrow_left, min_arrow_left), max_arrow_left);\n\n // Position vertically above the line unless there's insufficient space\n if (tooltip_box.height + stroke_width + arrow_width > dd.display.y){\n top = page_origin.y + dd.display.y + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n } else {\n top = page_origin.y + dd.display.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n }\n }\n\n // Apply positions to the main div\n tooltip.selector.style({ left: left + \"px\", top: top + \"px\" });\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style({ \"left\": arrow_left + \"px\", top: arrow_top + \"px\" });\n\n };\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var data_layer = this;\n var panel = this.parent;\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Apply tooltip, etc\n if (this.layout.tooltip){\n // Generate an overlaying transparent \"hit area\" line for more intuitive mouse events\n var hitarea_width = parseFloat(this.layout.hitarea_width).toString() + \"px\";\n var hitarea = this.svg.group\n .selectAll(\"path.lz-data_layer-line-hitarea\")\n .data([this.data]);\n hitarea.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line-hitarea\")\n .style(\"stroke-width\", hitarea_width);\n var hitarea_line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n hitarea\n .attr(\"d\", hitarea_line)\n .on(\"mouseover\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.createTooltip(dd.data);\n })\n .on(\"mousemove\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.updateTooltip(dd.data);\n data_layer.positionTooltip(data_layer.getElementId());\n })\n .on(\"mouseout\", function(){\n data_layer.tooltip_timeout = setTimeout(function(){\n data_layer.mouse_event = null;\n data_layer.destroyTooltip(data_layer.getElementId());\n }, 300);\n });\n hitarea.exit().remove();\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n /**\n * Redefine setElementStatus family of methods as line data layers will only ever have a single path element\n * @param {String} status A member of `LocusZoom.DataLayer.Statuses.adjectives`\n * @param {String|Object} element\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\n this.setElementStatus = function(status, element, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setElementStatusByFilters = function(status, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setAllElementStatus = function(status, toggle){\n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n // Apply class to path based on global status flags\n var path_class = \"lz-data_layer-line\";\n Object.keys(this.global_statuses).forEach(function(global_status){\n if (this.global_statuses[global_status]){ path_class += \" lz-data_layer-line-\" + global_status; }\n }.bind(this));\n this.path.attr(\"class\", path_class);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\");\n this.parent_plot.emit(\"layout_changed\");\n \n return this;\n };\n\n return this;\n\n});\n\n\n/***************************\n * Orthogonal Line Data Layer\n * Implements a horizontal or vertical line given an orientation and an offset in the layout\n * Does not require a data source\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"orthogonal_line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n style: {\n \"stroke\": \"#D3D3D3\",\n \"stroke-width\": \"3px\",\n \"stroke-dasharray\": \"10px 10px\"\n },\n orientation: \"horizontal\",\n x_axis: {\n axis: 1,\n decoupled: true\n },\n y_axis: {\n axis: 1,\n decoupled: true\n },\n offset: 0\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Require that orientation be \"horizontal\" or \"vertical\" only\n if ([\"horizontal\",\"vertical\"].indexOf(layout.orientation) === -1){\n layout.orientation = \"horizontal\";\n }\n\n // Vars for storing the data generated line\n /** @member {Array} */\n this.data = [];\n /** @member {d3.svg.line} */\n this.line = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var panel = this.parent;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n var x_extent = \"x_extent\";\n var y_extent = \"y\" + this.layout.y_axis.axis + \"_extent\";\n var x_range = \"x_range\";\n var y_range = \"y\" + this.layout.y_axis.axis + \"_range\";\n\n // Generate data using extents depending on orientation\n if (this.layout.orientation === \"horizontal\"){\n this.data = [\n { x: panel[x_extent][0], y: this.layout.offset },\n { x: panel[x_extent][1], y: this.layout.offset }\n ];\n } else {\n this.data = [\n { x: this.layout.offset, y: panel[y_extent][0] },\n { x: this.layout.offset, y: panel[y_extent][1] }\n ];\n }\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d, i) {\n var x = parseFloat(panel[x_scale](d[\"x\"]));\n return isNaN(x) ? panel[x_range][i] : x;\n })\n .y(function(d, i) {\n var y = parseFloat(panel[y_scale](d[\"y\"]));\n return isNaN(y) ? panel[y_range][i] : y;\n })\n .interpolate(\"linear\");\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Scatter Data Layer\n Implements a standard scatter plot\n*/\n\nLocusZoom.DataLayers.add(\"scatter\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"circle\",\n tooltip_positioning: \"horizontal\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 1\n },\n id_field: \"id\"\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Extra default for layout spacing\n // Not in default layout since that would make the label attribute always present\n if (layout.label && isNaN(layout.label.spacing)){\n layout.label.spacing = 4;\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be scatter-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var offset = Math.sqrt(point_size / Math.PI);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n if (this.layout.tooltip_positioning === \"vertical\"){\n // Position horizontally centered above the point\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right - offset;\n // Position vertically above the point unless there's insufficient space, then go below\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (y_center + offset)){\n top = page_origin.y + y_center - (offset + tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + offset + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n } else {\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Function to flip labels from being anchored at the start of the text to the end\n // Both to keep labels from running outside the data layer and also as a first\n // pass on recursive separation\n this.flip_labels = function(){\n var data_layer = this;\n var point_size = data_layer.resolveScalableParameter(data_layer.layout.point_size, {});\n var spacing = data_layer.layout.label.spacing;\n var handle_lines = Boolean(data_layer.layout.label.lines);\n var min_x = 2 * spacing;\n var max_x = data_layer.parent.layout.width - data_layer.parent.layout.margin.left - data_layer.parent.layout.margin.right - (2 * spacing);\n var flip = function(dn, dnl){\n var dnx = +dn.attr(\"x\");\n var text_swing = (2 * spacing) + (2 * Math.sqrt(point_size));\n if (handle_lines){\n var dnlx2 = +dnl.attr(\"x2\");\n var line_swing = spacing + (2 * Math.sqrt(point_size));\n }\n if (dn.style(\"text-anchor\") === \"start\"){\n dn.style(\"text-anchor\", \"end\");\n dn.attr(\"x\", dnx - text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 - line_swing); }\n } else {\n dn.style(\"text-anchor\", \"start\");\n dn.attr(\"x\", dnx + text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 + line_swing); }\n }\n };\n // Flip any going over the right edge from the right side to the left side\n // (all labels start on the right side)\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n if (dax + abound.width + spacing > max_x){\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n flip(da, dal);\n }\n });\n // Second pass to flip any others that haven't flipped yet if they collide with another label\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n if (da.style(\"text-anchor\") === \"end\") return;\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n data_layer.label_texts.each(function () {\n var b = this;\n var db = d3.select(b);\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (collision){\n flip(da, dal);\n // Double check that this flip didn't push the label past min_x. If it did, immediately flip back.\n dax = +da.attr(\"x\");\n if (dax - abound.width - spacing < min_x){\n flip(da, dal);\n }\n }\n return;\n });\n });\n };\n\n // Recursive function to space labels apart immediately after initial render\n // Adapted from thudfactor's fiddle here: https://jsfiddle.net/thudfactor/HdwTH/\n // TODO: Make labels also aware of data elements\n this.separate_labels = function(){\n this.seperate_iterations++;\n var data_layer = this;\n var alpha = 0.5;\n var spacing = this.layout.label.spacing;\n var again = false;\n data_layer.label_texts.each(function () {\n var a = this;\n var da = d3.select(a);\n var y1 = da.attr(\"y\");\n data_layer.label_texts.each(function () {\n var b = this;\n // a & b are the same element and don't collide.\n if (a === b) return;\n var db = d3.select(b);\n // a & b are on opposite sides of the chart and\n // don't collide\n if (da.attr(\"text-anchor\") !== db.attr(\"text-anchor\")) return;\n // Determine if the bounding rects for the two text elements collide\n var abound = da.node().getBoundingClientRect();\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (!collision) return;\n again = true;\n // If the labels collide, we'll push each\n // of the two labels up and down a little bit.\n var y2 = db.attr(\"y\");\n var sign = abound.top < bbound.top ? 1 : -1;\n var adjust = sign * alpha;\n var new_a_y = +y1 - adjust;\n var new_b_y = +y2 + adjust;\n // Keep new values from extending outside the data layer\n var min_y = 2 * spacing;\n var max_y = data_layer.parent.layout.height - data_layer.parent.layout.margin.top - data_layer.parent.layout.margin.bottom - (2 * spacing);\n var delta;\n if (new_a_y - (abound.height/2) < min_y){\n delta = +y1 - new_a_y;\n new_a_y = +y1;\n new_b_y += delta;\n } else if (new_b_y - (bbound.height/2) < min_y){\n delta = +y2 - new_b_y;\n new_b_y = +y2;\n new_a_y += delta;\n }\n if (new_a_y + (abound.height/2) > max_y){\n delta = new_a_y - +y1;\n new_a_y = +y1;\n new_b_y -= delta;\n } else if (new_b_y + (bbound.height/2) > max_y){\n delta = new_b_y - +y2;\n new_b_y = +y2;\n new_a_y -= delta;\n }\n da.attr(\"y\",new_a_y);\n db.attr(\"y\",new_b_y);\n });\n });\n if (again) {\n // Adjust lines to follow the labels\n if (data_layer.layout.label.lines){\n var label_elements = data_layer.label_texts[0];\n data_layer.label_lines.attr(\"y2\",function(d,i) {\n var label_line = d3.select(label_elements[i]);\n return label_line.attr(\"y\");\n });\n }\n // After ~150 iterations we're probably beyond diminising returns, so stop recursing\n if (this.seperate_iterations < 150){\n setTimeout(function(){\n this.separate_labels();\n }.bind(this), 1);\n }\n }\n };\n\n // Implement the main render function\n this.render = function(){\n\n var data_layer = this;\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate labels first (if defined)\n if (this.layout.label){\n // Apply filters to generate a filtered data set\n var filtered_data = this.data.filter(function(d){\n if (!data_layer.layout.label.filters){\n return true;\n } else {\n // Start by assuming a match, run through all filters to test if not a match on any one\n var match = true;\n data_layer.layout.label.filters.forEach(function(filter){\n var field_value = (new LocusZoom.Data.Field(filter.field)).resolve(d);\n if (isNaN(field_value)){\n match = false;\n } else {\n switch (filter.operator){\n case \"<\":\n if (!(field_value < filter.value)){ match = false; }\n break;\n case \"<=\":\n if (!(field_value <= filter.value)){ match = false; }\n break;\n case \">\":\n if (!(field_value > filter.value)){ match = false; }\n break;\n case \">=\":\n if (!(field_value >= filter.value)){ match = false; }\n break;\n case \"=\":\n if (!(field_value === filter.value)){ match = false; }\n break;\n default:\n // If we got here the operator is not valid, so the filter should fail\n match = false;\n break;\n }\n }\n });\n return match;\n }\n });\n // Render label groups\n var self = this;\n this.label_groups = this.svg.group\n .selectAll(\"g.lz-data_layer-\" + this.layout.type + \"-label\")\n .data(filtered_data, function(d){ return d[self.layout.id_field] + \"_label\"; });\n this.label_groups.enter()\n .append(\"g\")\n .attr(\"class\", \"lz-data_layer-\"+ this.layout.type + \"-label\");\n // Render label texts\n if (this.label_texts){ this.label_texts.remove(); }\n this.label_texts = this.label_groups.append(\"text\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_texts\n .text(function(d){\n return LocusZoom.parseFields(d, data_layer.layout.label.text || \"\");\n })\n .style(data_layer.layout.label.style || {})\n .attr({\n \"x\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + data_layer.layout.label.spacing;\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"text-anchor\": function(){\n return \"start\";\n }\n });\n // Render label lines\n if (data_layer.layout.label.lines){\n if (this.label_lines){ this.label_lines.remove(); }\n this.label_lines = this.label_groups.append(\"line\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_lines\n .style(data_layer.layout.label.lines.style || {})\n .attr({\n \"x1\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field]);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y1\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"x2\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + (data_layer.layout.label.spacing/2);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y2\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n }\n });\n }\n // Remove labels when they're no longer in the filtered data set\n this.label_groups.exit().remove();\n }\n \n // Generate main scatter data elements\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-\" + this.layout.type)\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Apply default event emitters to selection\n selection.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element);\n this.parent_plot.emit(\"element_clicked\", element);\n }.bind(this));\n \n // Apply mouse behaviors\n this.applyBehaviors(selection);\n \n // Apply method to keep labels from overlapping each other\n if (this.layout.label){\n this.flip_labels();\n this.seperate_iterations = 0;\n this.separate_labels();\n // Apply default event emitters to selection\n this.label_texts.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element);\n this.parent_plot.emit(\"element_clicked\", element);\n }.bind(this));\n // Extend mouse behaviors to labels\n this.applyBehaviors(this.label_texts);\n }\n \n };\n\n // Method to set a passed element as the LD reference in the plot-level state\n this.makeLDReference = function(element){\n var ref = null;\n if (typeof element == \"undefined\"){\n throw(\"makeLDReference requires one argument of any type\");\n } else if (typeof element == \"object\"){\n if (this.layout.id_field && typeof element[this.layout.id_field] != \"undefined\"){\n ref = element[this.layout.id_field].toString();\n } else if (typeof element[\"id\"] != \"undefined\"){\n ref = element[\"id\"].toString();\n } else {\n ref = element.toString();\n }\n } else {\n ref = element.toString();\n }\n this.parent_plot.applyState({ ldrefvar: ref });\n };\n \n return this;\n\n});\n\n/**\n * A scatter plot in which the x-axis represents categories, rather than individual positions.\n * For example, this can be used by PheWAS plots to show related groups. This plot allows the categories to be\n * determined dynamically when data is first loaded.\n *\n * @class LocusZoom.DataLayers.category_scatter\n * @augments LocusZoom.DataLayers.scatter\n */\nLocusZoom.DataLayers.extend(\"scatter\", \"category_scatter\", {\n /**\n * This plot layer makes certain assumptions about the data passed in. Transform the raw array of records from\n * the datasource to prepare it for plotting, as follows:\n * 1. The scatter plot assumes that all records are given in sequence (pre-grouped by `category_field`)\n * 2. It assumes that all records have an x coordinate for individual plotting\n * @private\n */\n _prepareData: function() {\n var xField = this.layout.x_axis.field || \"x\";\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n if (!category_field) {\n throw \"Layout for \" + this.layout.id + \" must specify category_field\";\n }\n // Sort the data so that things in the same category are adjacent (case-insensitive by specified field)\n var sourceData = this.data\n .sort(function(a, b) {\n var ak = a[category_field];\n var bk = b[category_field];\n var av = ak.toString ? ak.toString().toLowerCase() : ak;\n var bv = bk.toString ? bk.toString().toLowerCase() : bk;\n return (av === bv) ? 0 : (av < bv ? -1 : 1);});\n sourceData.forEach(function(d, i){\n // Implementation detail: Scatter plot requires specifying an x-axis value, and most datasources do not\n // specify plotting positions. If a point is missing this field, fill in a synthetic value.\n d[xField] = d[xField] || i;\n });\n return sourceData;\n },\n\n /**\n * Identify the unique categories on the plot, and update the layout with an appropriate color scheme.\n * Also identify the min and max x value associated with the category, which will be used to generate ticks\n * @private\n * @returns {Object.} Series of entries used to build category name ticks {category_name: [min_x, max_x]}\n */\n _generateCategoryBounds: function() {\n // TODO: API may return null values in category_field; should we add placeholder category label?\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n var xField = this.layout.x_axis.field || \"x\";\n var uniqueCategories = {};\n this.data.forEach(function(item) {\n var category = item[category_field];\n var x = item[xField];\n var bounds = uniqueCategories[category] || [x, x];\n uniqueCategories[category] = [Math.min(bounds[0], x), Math.max(bounds[1], x)];\n });\n\n var categoryNames = Object.keys(uniqueCategories);\n this._setDynamicColorScheme(categoryNames);\n\n return uniqueCategories;\n },\n\n /**\n * Automatically define a color scheme for the layer based on data returned from the server.\n * If part of the color scheme has been specified, it will fill in remaining missing information.\n *\n * There are three scenarios:\n * 1. The layout does not specify either category names or (color) values. Dynamically build both based on\n * the data and update the layout.\n * 2. The layout specifies colors, but not categories. Use that exact color information provided, and dynamically\n * determine what categories are present in the data. (cycle through the available colors, reusing if there\n * are a lot of categories)\n * 3. The layout specifies exactly what colors and categories to use (and they match the data!). This is useful to\n * specify an explicit mapping between color scheme and category names, when you want to be sure that the\n * plot matches a standard color scheme.\n * (If the layout specifies categories that do not match the data, the user specified categories will be ignored)\n *\n * This method will only act if the layout defines a `categorical_bin` scale function for coloring. It may be\n * overridden in a subclass to suit other types of coloring methods.\n *\n * @param {String[]} categoryNames\n * @private\n */\n _setDynamicColorScheme: function(categoryNames) {\n var colorParams = this.layout.color.parameters;\n var baseParams = this._base_layout.color.parameters;\n\n // If the layout does not use a supported coloring scheme, or is already complete, this method should do nothing\n if (this.layout.color.scale_function !== \"categorical_bin\") {\n throw \"This layer requires that coloring be specified as a `categorical_bin`\";\n }\n\n if (baseParams.categories.length && baseParams.values.length) {\n // If there are preset category/color combos, make sure that they apply to the actual dataset\n var parameters_categories_hash = {};\n baseParams.categories.forEach(function (category) { parameters_categories_hash[category] = 1; });\n if (categoryNames.every(function (name) { return parameters_categories_hash.hasOwnProperty(name); })) {\n // The layout doesn't have to specify categories in order, but make sure they are all there\n colorParams.categories = baseParams.categories;\n } else {\n colorParams.categories = categoryNames;\n }\n } else {\n colorParams.categories = categoryNames;\n }\n // Prefer user-specified colors if provided. Make sure that there are enough colors for all the categories.\n var colors;\n if (baseParams.values.length) {\n colors = baseParams.values;\n } else {\n var color_scale = categoryNames.length <= 10 ? d3.scale.category10 : d3.scale.category20;\n colors = color_scale().range();\n }\n while (colors.length < categoryNames.length) { colors = colors.concat(colors); }\n colors = colors.slice(0, categoryNames.length); // List of hex values, should be of same length as categories array\n colorParams.values = colors;\n },\n\n /**\n *\n * @param dimension\n * @param {Object} [config] Parameters that customize how ticks are calculated (not style)\n * @param {('left'|'center'|'right')} [config.position='left'] Align ticks with the center or edge of category\n * @returns {Array}\n */\n getTicks: function(dimension, config) { // Overrides parent method\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw \"Invalid dimension identifier\";\n }\n var position = config.position || \"left\";\n if ([\"left\", \"center\", \"right\"].indexOf(position) === -1) {\n throw \"Invalid tick position\";\n }\n\n var categoryBounds = this._categories;\n if (!categoryBounds || !Object.keys(categoryBounds).length) {\n return [];\n }\n\n if (dimension === \"y\") {\n return [];\n }\n\n if (dimension === \"x\") {\n // If colors have been defined by this layer, use them to make tick colors match scatterplot point colors\n var knownCategories = this.layout.color.parameters.categories || [];\n var knownColors = this.layout.color.parameters.values || [];\n\n return Object.keys(categoryBounds).map(function (category, index) {\n var bounds = categoryBounds[category];\n var xPos;\n\n switch(position) {\n case \"left\":\n xPos = bounds[0];\n break;\n case \"center\":\n // Center tick under one or many elements as appropriate\n var diff = bounds[1] - bounds[0];\n xPos = bounds[0] + (diff !== 0 ? diff : bounds[0]) / 2;\n break;\n case \"right\":\n xPos = bounds[1];\n break;\n }\n return {\n x: xPos,\n text: category,\n style: {\n \"fill\": knownColors[knownCategories.indexOf(category)] || \"#000000\"\n }\n };\n });\n }\n },\n\n applyCustomDataMethods: function() {\n this.data = this._prepareData();\n /**\n * Define category names and extents (boundaries) for plotting. TODO: properties in constructor\n * @member {Object.} Category names and extents, in the form {category_name: [min_x, max_x]}\n */\n this._categories = this._generateCategoryBounds();\n return this;\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n *\n * LocusZoom has various singleton objects that are used for registering functions or classes.\n * These objects provide safe, standard methods to redefine or delete existing functions/classes\n * as well as define new custom functions/classes to be used in a plot.\n *\n * @namespace Singletons\n */\n\n\n/*\n * The Collection of \"Known\" Data Sources. This registry is used internally by the `DataSources` class\n * @class\n * @static\n */\nLocusZoom.KnownDataSources = (function() {\n /** @lends LocusZoom.KnownDataSources */\n var obj = {};\n /* @member {function[]} */\n var sources = [];\n\n var findSourceByName = function(x) {\n for(var i=0; i 1) {\n return function(x) {\n var val = x;\n for(var i = 0; i 1){\n log = Math.ceil(Math.log(x) / Math.LN10);\n } else {\n log = Math.floor(Math.log(x) / Math.LN10);\n }\n if (Math.abs(log) <= 3){\n return x.toFixed(3);\n } else {\n return x.toExponential(2).replace(\"+\", \"\").replace(\"e\", \" × 10^\");\n }\n});\n\n/**\n * URL-encode the provided text, eg for constructing hyperlinks\n * @function urlencode\n * @param {String} str\n */\nLocusZoom.TransformationFunctions.add(\"urlencode\", function(str) {\n return encodeURIComponent(str);\n});\n\n/**\n * HTML-escape user entered values for use in constructed HTML fragments\n *\n * For example, this filter can be used on tooltips with custom HTML display\n * @function htmlescape\n * @param {String} str HTML-escape the provided value\n */\nLocusZoom.TransformationFunctions.add(\"htmlescape\", function(str) {\n if ( !str ) {\n return \"\";\n }\n str = str + \"\";\n\n return str.replace( /['\"<>&`]/g, function( s ) {\n switch ( s ) {\n case \"'\":\n return \"'\";\n case \"\\\"\":\n return \""\";\n case \"<\":\n return \"<\";\n case \">\":\n return \">\";\n case \"&\":\n return \"&\";\n case \"`\":\n return \"`\";\n }\n });\n});\n\n/**\n * Singleton for accessing/storing functions that will convert arbitrary data points to values in a given scale\n * Useful for anything that needs to scale discretely with data (e.g. color, point size, etc.)\n *\n * A Scale Function can be thought of as a modifier to a layout directive that adds extra logic to how a piece of data\n * can be resolved to a value.\n *\n * All scale functions must accept an object of parameters and a value to process.\n * @class\n * @static\n */\nLocusZoom.ScaleFunctions = (function() {\n /** @lends LocusZoom.ScaleFunctions */\n var obj = {};\n var functions = {};\n\n /**\n * Find a scale function and return it. If parameters and values are passed, calls the function directly; otherwise\n * returns a callable.\n * @param {String} name\n * @param {Object} [parameters] Configuration parameters specific to the specified scale function\n * @param {*} [value] The value to operate on\n * @returns {*}\n */\n obj.get = function(name, parameters, value) {\n if (!name) {\n return null;\n } else if (functions[name]) {\n if (typeof parameters === \"undefined\" && typeof value === \"undefined\"){\n return functions[name];\n } else {\n return functions[name](parameters, value);\n }\n } else {\n throw(\"scale function [\" + name + \"] not found\");\n }\n };\n\n /**\n * @protected\n * @param {String} name The name of the function to set/unset\n * @param {Function} [fn] The function to register. If blank, removes this function name from the registry.\n */\n obj.set = function(name, fn) {\n if (fn) {\n functions[name] = fn;\n } else {\n delete functions[name];\n }\n };\n\n /**\n * Add a new scale function to the registry\n * @param {String} name The name of the scale function\n * @param {function} fn A scale function that accepts two parameters: an object of configuration and a value\n */\n obj.add = function(name, fn) {\n if (functions[name]) {\n throw(\"scale function already exists with name: \" + name);\n } else {\n obj.set(name, fn);\n }\n };\n\n /**\n * List the names of all registered scale functions\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(functions);\n };\n\n return obj;\n})();\n\n/**\n * Basic conditional function to evaluate the value of the input field and return based on equality.\n * @param {Object} parameters\n * @param {*} parameters.field_value The value against which to test the input value.\n * @param {*} parameters.then The value to return if the input value matches the field value\n * @param {*} parameters.else The value to return if the input value does not match the field value. Optional. If not\n * defined this scale function will return null (or value of null_value parameter, if defined) when input value fails\n * to match field_value.\n * @param {*} input value\n */\nLocusZoom.ScaleFunctions.add(\"if\", function(parameters, input){\n if (typeof input == \"undefined\" || parameters.field_value !== input){\n if (typeof parameters.else != \"undefined\"){\n return parameters.else;\n } else {\n return null;\n }\n } else {\n return parameters.then;\n }\n});\n\n/**\n * Function to sort numerical values into bins based on numerical break points. Will only operate on numbers and\n * return null (or value of null_value parameter, if defined) if provided a non-numeric input value. Parameters:\n * @function numerical_bin\n * @param {Object} parameters\n * @param {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter. If the input value is greater than or equal to break n and less than\n * or equal to break n+1 (or break n+1 doesn't exist) then returned value is the nth entry in the values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against break points. Must be of\n * equal length to breaks parameter. Each entry n represents the value to return if the input value is greater than\n * or equal to break n and less than or equal to break n+1 (or break n+1 doesn't exist).\n * @param {*} null_value\n * @param {*} input value\n * @returns\n */\nLocusZoom.ScaleFunctions.add(\"numerical_bin\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){\n return (parameters.null_value ? parameters.null_value : null);\n }\n var threshold = breaks.reduce(function(prev, curr){\n if (+input < prev || (+input >= prev && +input < curr)){\n return prev;\n } else {\n return curr;\n }\n });\n return values[breaks.indexOf(threshold)];\n});\n\n/**\n * Function to sort values of any type into bins based on direct equality testing with a list of categories.\n * Will return null if provided an input value that does not match to a listed category.\n * @function categorical_bin\n * @param {Object} parameters\n * @param {Array} parameters.categories Array of values against which to evaluate the input value. Must be of equal\n * length to values parameter. If the input value is equal to category n then returned value is the nth entry in the\n * values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against categories. Must be of equal\n * length to categories parameter. Each entry n represents the value to return if the input value is equal to the nth\n * value in the categories parameter.\n * @param {*} parameters.null_value Value to return if the input value fails to match to any categories. Optional.\n */\nLocusZoom.ScaleFunctions.add(\"categorical_bin\", function(parameters, value){\n if (typeof value == \"undefined\" || parameters.categories.indexOf(value) === -1){\n return (parameters.null_value ? parameters.null_value : null); \n } else {\n return parameters.values[parameters.categories.indexOf(value)];\n }\n});\n\n/**\n * Function for continuous interpolation of numerical values along a gradient with arbitrarily many break points.\n * @function interpolate\n * @parameters {Object} parameters\n * @parameters {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter and contain at least two elements. Input value will be evaluated for\n * relative position between two break points n and n+1 and the returned value will be interpolated at a relative\n * position between values n and n+1.\n * @parameters {*[]} parameters.values Array of values to interpolate and return given evaluations against break\n * points. Must be of equal length to breaks parameter and contain at least two elements. Each entry n represents\n * the value to return if the input value matches the nth entry in breaks exactly. Note that this scale function\n * uses d3.interpolate to provide for effective interpolation of many different value types, including numbers,\n * colors, shapes, etc.\n * @parameters {*} parameters.null_value\n */\nLocusZoom.ScaleFunctions.add(\"interpolate\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n var nullval = (parameters.null_value ? parameters.null_value : null);\n if (breaks.length < 2 || breaks.length !== values.length){ return nullval; }\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){ return nullval; }\n if (+input <= parameters.breaks[0]){\n return values[0];\n } else if (+input >= parameters.breaks[parameters.breaks.length-1]){\n return values[breaks.length-1];\n } else {\n var upper_idx = null;\n breaks.forEach(function(brk, idx){\n if (!idx){ return; }\n if (breaks[idx-1] <= +input && breaks[idx] >= +input){ upper_idx = idx; }\n });\n if (upper_idx === null){ return nullval; }\n var normalized_input = (+input - breaks[upper_idx-1]) / (breaks[upper_idx] - breaks[upper_idx-1]);\n if (!isFinite(normalized_input)){ return nullval; }\n return d3.interpolate(values[upper_idx-1], values[upper_idx])(normalized_input);\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A Dashboard is an HTML element used for presenting arbitrary user interface components. Dashboards are anchored\n * to either the entire Plot or to individual Panels.\n *\n * Each dashboard is an HTML-based (read: not SVG) collection of components used to display information or provide\n * user interface. Dashboards can exist on entire plots, where their visibility is permanent and vertically adjacent\n * to the plot, or on individual panels, where their visibility is tied to a behavior (e.g. a mouseover) and is as\n * an overlay.\n * @class\n */\nLocusZoom.Dashboard = function(parent){\n // parent must be a locuszoom plot or panel\n if (!(parent instanceof LocusZoom.Plot) && !(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create dashboard, parent must be a locuszoom plot or panel\";\n }\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".dashboard\";\n /** @member {('plot'|'panel')} */\n this.type = (this.parent instanceof LocusZoom.Plot) ? \"plot\" : \"panel\";\n /** @member {LocusZoom.Plot} */\n this.parent_plot = this.type === \"plot\" ? this.parent : this.parent.parent;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {LocusZoom.Dashboard.Component[]} */\n this.components = [];\n /**\n * The timer identifier as returned by setTimeout\n * @member {Number}\n */\n this.hide_timeout = null;\n /**\n * Whether to hide the dashboard. Can be overridden by a child component. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n\n // TODO: Return value from constructor function?\n return this.initialize();\n};\n\n/**\n * Prepare the dashboard for first use: generate all component instances for this dashboard, based on the provided\n * layout of the parent. Connects event listeners and shows/hides as appropriate.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.initialize = function() {\n // Parse layout to generate component instances\n if (Array.isArray(this.parent.layout.dashboard.components)){\n this.parent.layout.dashboard.components.forEach(function(layout){\n try {\n var component = LocusZoom.Dashboard.Components.get(layout.type, layout, this);\n this.components.push(component);\n } catch (e) {\n console.warn(e);\n }\n }.bind(this));\n }\n\n // Add mouseover event handlers to show/hide panel dashboard\n if (this.type === \"panel\"){\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseover.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n if (!this.selector || this.selector.style(\"visibility\") === \"hidden\"){ this.show(); }\n }.bind(this));\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseout.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n this.hide_timeout = setTimeout(function(){ this.hide(); }.bind(this), 300);\n }.bind(this));\n }\n\n return this;\n\n};\n\n/**\n * Whether to persist the dashboard. Returns true if at least one component should persist, or if the panel is engaged\n * in an active drag event.\n * @returns {boolean}\n */\nLocusZoom.Dashboard.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n var persist = false;\n // Persist if at least one component should also persist\n this.components.forEach(function(component){\n persist = persist || component.shouldPersist();\n });\n // Persist if in a parent drag event\n persist = persist || (this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.dragging);\n return !!persist;\n};\n\n/**\n * Make the dashboard appear. If it doesn't exist yet create it, including creating/positioning all components within,\n * and make sure it is set to be visible.\n */\nLocusZoom.Dashboard.prototype.show = function(){\n if (!this.selector){\n switch (this.type){\n case \"plot\":\n this.selector = d3.select(this.parent.svg.node().parentNode)\n .insert(\"div\",\":first-child\");\n break;\n case \"panel\":\n this.selector = d3.select(this.parent.parent.svg.node().parentNode)\n .insert(\"div\", \".lz-data_layer-tooltip, .lz-dashboard-menu, .lz-curtain\").classed(\"lz-panel-dashboard\", true);\n break;\n }\n this.selector.classed(\"lz-dashboard\", true).classed(\"lz-\"+this.type+\"-dashboard\", true).attr(\"id\", this.id);\n }\n this.components.forEach(function(component){ component.show(); });\n this.selector.style({ visibility: \"visible\" });\n return this.update();\n};\n\n/**\n * Update the dashboard and rerender all child components. This can be called whenever plot state changes.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.update = function(){\n if (!this.selector){ return this; }\n this.components.forEach(function(component){ component.update(); });\n return this.position();\n};\n\n/**\n * Position the dashboard (and child components) within the panel\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.position = function(){\n if (!this.selector){ return this; }\n // Position the dashboard itself (panel only)\n if (this.type === \"panel\"){\n var page_origin = this.parent.getPageOrigin();\n var top = (page_origin.y + 3.5).toString() + \"px\";\n var left = page_origin.x.toString() + \"px\";\n var width = (this.parent.layout.width - 4).toString() + \"px\";\n this.selector.style({ position: \"absolute\", top: top, left: left, width: width });\n }\n // Recursively position components\n this.components.forEach(function(component){ component.position(); });\n return this;\n};\n\n/**\n * Hide the dashboard (make invisible but do not destroy). Will do nothing if `shouldPersist` returns true.\n *\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n this.components.forEach(function(component){ component.hide(); });\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n\n/**\n * Completely remove dashboard and all child components. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n this.components.forEach(function(component){ component.destroy(true); });\n this.components = [];\n this.selector.remove();\n this.selector = null;\n return this;\n};\n\n/**\n *\n * A dashboard component is an empty div rendered on a dashboard that can display custom\n * html of user interface elements. LocusZoom.Dashboard.Components is a singleton used to\n * define and manage an extendable collection of dashboard components.\n * (e.g. by LocusZoom.Dashboard.Components.add())\n * @class\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @param {('left'|'right')} [layout.position='left'] Whether to float the component left or right.\n * @param {('start'|'middle'|'end')} [layout.group_position] Buttons can optionally be gathered into a visually\n * distinctive group whose elements are closer together. If a button is identified as the start or end of a group,\n * it will be drawn with rounded corners and an extra margin of spacing from any button not part of the group.\n * For example, the region_nav_plot dashboard is a defined as a group.\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple'} [layout.color='gray'] Color scheme for the\n * component. Applies to buttons and menus.\n * @param {LocusZoom.Dashboard} parent The dashboard that contains this component\n*/\nLocusZoom.Dashboard.Component = function(layout, parent) {\n /** @member {Object} */\n this.layout = layout || {};\n if (!this.layout.color){ this.layout.color = \"gray\"; }\n\n /** @member {LocusZoom.Dashboard|*} */\n this.parent = parent || null;\n /**\n * Some dashboards are attached to a panel, rather than directly to a plot\n * @member {LocusZoom.Panel|null}\n */\n this.parent_panel = null;\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n /**\n * This is a reference to either the panel or the plot, depending on what the dashboard is\n * tied to. Useful when absolutely positioning dashboard components relative to their SVG anchor.\n * @member {LocusZoom.Plot|LocusZoom.Panel}\n */\n this.parent_svg = null;\n if (this.parent instanceof LocusZoom.Dashboard){\n // TODO: when is the immediate parent *not* a dashboard?\n if (this.parent.type === \"panel\"){\n this.parent_panel = this.parent.parent;\n this.parent_plot = this.parent.parent.parent;\n this.parent_svg = this.parent_panel;\n } else {\n this.parent_plot = this.parent.parent;\n this.parent_svg = this.parent_plot;\n }\n }\n /** @member {d3.selection} */\n this.selector = null;\n /**\n * If this is an interactive component, it will contain a button or menu instance that handles the interactivity.\n * There is a 1-to-1 relationship of dashboard component to button\n * @member {null|LocusZoom.Dashboard.Component.Button}\n */\n this.button = null;\n /**\n * If any single component is marked persistent, it will bubble up to prevent automatic hide behavior on a\n * component's parent dashboard. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n if (!this.layout.position){ this.layout.position = \"left\"; }\n\n // TODO: Return value in constructor\n return this;\n};\n/**\n * Perform all rendering of component, including toggling visibility to true. Will initialize and create SVG element\n * if necessary, as well as updating with new data and performing layout actions.\n */\nLocusZoom.Dashboard.Component.prototype.show = function(){\n if (!this.parent || !this.parent.selector){ return; }\n if (!this.selector){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.layout.group_position) !== -1 ? \" lz-dashboard-group-\" + this.layout.group_position : \"\");\n this.selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-\" + this.layout.position + group_position);\n if (this.layout.style){ this.selector.style(this.layout.style); }\n if (typeof this.initialize == \"function\"){ this.initialize(); }\n }\n if (this.button && this.button.status === \"highlighted\"){ this.button.menu.show(); }\n this.selector.style({ visibility: \"visible\" });\n this.update();\n return this.position();\n};\n/**\n * Update the dashboard component with any new data or plot state as appropriate. This method performs all\n * necessary rendering steps.\n */\nLocusZoom.Dashboard.Component.prototype.update = function(){ /* stub */ };\n/**\n * Place the component correctly in the plot\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.position = function(){\n if (this.button){ this.button.menu.position(); }\n return this;\n};\n/**\n * Determine whether the component should persist (will bubble up to parent dashboard)\n * @returns {boolean}\n */\nLocusZoom.Dashboard.Component.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n if (this.button && this.button.persist){ return true; }\n return false;\n};\n/**\n * Toggle visibility to hidden, unless marked as persistent\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n if (this.button){ this.button.menu.hide(); }\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n/**\n * Completely remove component and button. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.Component.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n if (this.button && this.button.menu){ this.button.menu.destroy(); }\n this.selector.remove();\n this.selector = null;\n this.button = null;\n return this;\n};\n\n/**\n * Singleton registry of all known components\n * @class\n * @static\n */\nLocusZoom.Dashboard.Components = (function() {\n /** @lends LocusZoom.Dashboard.Components */\n var obj = {};\n var components = {};\n\n /**\n * Create a new component instance by name\n * @param {String} name The string identifier of the desired component\n * @param {Object} layout The layout to use to create the component\n * @param {LocusZoom.Dashboard} parent The containing dashboard to use when creating the component\n * @returns {LocusZoom.Dashboard.Component}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (components[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for dashboard component [\" + name + \"]\");\n } else {\n return new components[name](layout, parent);\n }\n } else {\n throw(\"dashboard component [\" + name + \"] not found\");\n }\n };\n /**\n * Add a new component constructor to the registry and ensure that it extends the correct parent class\n * @protected\n * @param name\n * @param component\n */\n obj.set = function(name, component) {\n if (component) {\n if (typeof component != \"function\"){\n throw(\"unable to set dashboard component [\" + name + \"], argument provided is not a function\");\n } else {\n components[name] = component;\n components[name].prototype = new LocusZoom.Dashboard.Component();\n }\n } else {\n delete components[name];\n }\n };\n\n /**\n * Register a new component constructor by name\n * @param {String} name\n * @param {function} component The component constructor\n */\n obj.add = function(name, component) {\n if (components[name]) {\n throw(\"dashboard component already exists with name: \" + name);\n } else {\n obj.set(name, component);\n }\n };\n\n /**\n * List the names of all registered components\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(components);\n };\n\n return obj;\n})();\n\n/**\n * Plots and panels may have a \"dashboard\" element suited for showing HTML components that may be interactive.\n * When components need to incorporate a generic button, or additionally a button that generates a menu, this\n * class provides much of the necessary framework.\n * @class\n * @param {LocusZoom.Dashboard.Component} parent\n */\nLocusZoom.Dashboard.Component.Button = function(parent) { \n \n if (!(parent instanceof LocusZoom.Dashboard.Component)){\n throw \"Unable to create dashboard component button, invalid parent\";\n }\n /** @member {LocusZoom.Dashboard.Component} */\n this.parent = parent;\n /** @member {LocusZoom.Dashboard.Panel} */\n this.parent_panel = this.parent.parent_panel;\n /** @member {LocusZoom.Dashboard.Plot} */\n this.parent_plot = this.parent.parent_plot;\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent_svg = this.parent.parent_svg;\n\n /** @member {LocusZoom.Dashboard|null|*} */\n this.parent_dashboard = this.parent.parent;\n /** @member {d3.selection} */\n this.selector = null;\n\n /**\n * Tag to use for the button (default: a)\n * @member {String}\n */\n this.tag = \"a\";\n\n /**\n * TODO This method does not appear to be used anywhere\n * @param {String} tag\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTag = function(tag){\n if (typeof tag != \"undefined\"){ this.tag = tag.toString(); }\n return this;\n };\n\n /**\n * HTML for the button to show.\n * @protected\n * @member {String}\n */\n this.html = \"\";\n /**\n * Specify the HTML content of this button.\n * WARNING: The string provided will be inserted into the document as raw markup; XSS mitigation is the\n * responsibility of each button implementation.\n * @param {String} html\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setHtml = function(html){\n if (typeof html != \"undefined\"){ this.html = html.toString(); }\n return this;\n };\n /**\n * @deprecated since 0.5.6; use setHTML instead\n */\n this.setText = this.setHTML;\n\n /**\n * Mouseover title text for the button to show\n * @protected\n * @member {String}\n */\n this.title = \"\";\n /**\n * Set the mouseover title text for the button (if any)\n * @param {String} title Simple text to display\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTitle = function(title){\n if (typeof title != \"undefined\"){ this.title = title.toString(); }\n return this;\n };\n\n /**\n * Color of the button\n * @member {String}\n */\n this.color = \"gray\";\n\n /**\n * Set the color associated with this button\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple')} color Any selection not in the preset list\n * will be replaced with gray.\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setColor = function(color){\n if (typeof color != \"undefined\"){\n if ([\"gray\", \"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"purple\"].indexOf(color) !== -1){ this.color = color; }\n else { this.color = \"gray\"; }\n }\n return this;\n };\n\n /**\n * Hash of arbitrary button styles to apply as {name: value} entries\n * @protected\n * @member {Object}\n */\n this.style = {};\n /**\n * Set a collection of custom styles to be used by the button\n * @param {Object} style Hash of {name:value} entries\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setStyle = function(style){\n if (typeof style != \"undefined\"){ this.style = style; }\n return this;\n };\n\n //\n /**\n * Method to generate a CSS class string\n * @returns {string}\n */\n this.getClass = function(){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.parent.layout.group_position) !== -1 ? \" lz-dashboard-button-group-\" + this.parent.layout.group_position : \"\");\n return \"lz-dashboard-button lz-dashboard-button-\" + this.color + (this.status ? \"-\" + this.status : \"\") + group_position;\n };\n\n // Permanence\n /**\n * Track internal state on whether to keep showing the button/ menu contents at the moment\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n /**\n * Configuration when defining a button: track whether this component should be allowed to keep open\n * menu/button contents in response to certain events\n * @protected\n * @member {Boolean}\n */\n this.permanent = false;\n /**\n * Allow code to change whether the button is allowed to be `permanent`\n * @param {boolean} bool\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setPermanent = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n this.permanent = bool;\n if (this.permanent){ this.persist = true; }\n return this;\n };\n /**\n * Determine whether the button/menu contents should persist in response to a specific event\n * @returns {Boolean}\n */\n this.shouldPersist = function(){\n return this.permanent || this.persist;\n };\n\n /**\n * Button status (highlighted / disabled/ etc)\n * @protected\n * @member {String}\n */\n this.status = \"\";\n /**\n * Change button state\n * @param {('highlighted'|'disabled'|'')} status\n */\n this.setStatus = function(status){\n if (typeof status != \"undefined\" && [\"\", \"highlighted\", \"disabled\"].indexOf(status) !== -1){ this.status = status; }\n return this.update();\n };\n /**\n * Toggle whether the button is highlighted\n * @param {boolean} bool If provided, explicitly set highlighted state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.highlight = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"highlighted\"); }\n else if (this.status === \"highlighted\"){ return this.setStatus(\"\"); }\n return this;\n };\n /**\n * Toggle whether the button is disabled\n * @param {boolean} bool If provided, explicitly set disabled state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.disable = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"disabled\"); }\n else if (this.status === \"disabled\"){ return this.setStatus(\"\"); }\n return this;\n };\n\n // Mouse events\n /** @member {function} */\n this.onmouseover = function(){};\n this.setOnMouseover = function(onmouseover){\n if (typeof onmouseover == \"function\"){ this.onmouseover = onmouseover; }\n else { this.onmouseover = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onmouseout = function(){};\n this.setOnMouseout = function(onmouseout){\n if (typeof onmouseout == \"function\"){ this.onmouseout = onmouseout; }\n else { this.onmouseout = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onclick = function(){};\n this.setOnclick = function(onclick){\n if (typeof onclick == \"function\"){ this.onclick = onclick; }\n else { this.onclick = function(){}; }\n return this;\n };\n \n // Primary behavior functions\n /**\n * Show the button, including creating DOM elements if necessary for first render\n */\n this.show = function(){\n if (!this.parent){ return; }\n if (!this.selector){\n this.selector = this.parent.selector.append(this.tag).attr(\"class\", this.getClass());\n }\n return this.update();\n };\n /**\n * Hook for any actions or state cleanup to be performed before rerendering\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.preUpdate = function(){ return this; };\n /**\n * Update button state and contents, and fully rerender\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.update = function(){\n if (!this.selector){ return this; }\n this.preUpdate();\n this.selector\n .attr(\"class\", this.getClass())\n .attr(\"title\", this.title).style(this.style)\n .on(\"mouseover\", (this.status === \"disabled\") ? null : this.onmouseover)\n .on(\"mouseout\", (this.status === \"disabled\") ? null : this.onmouseout)\n .on(\"click\", (this.status === \"disabled\") ? null : this.onclick)\n .html(this.html);\n this.menu.update();\n this.postUpdate();\n return this;\n };\n /**\n * Hook for any behavior to be added/changed after the button has been re-rendered\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.postUpdate = function(){ return this; };\n /**\n * Hide the button by removing it from the DOM (may be overridden by current persistence setting)\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.hide = function(){\n if (this.selector && !this.shouldPersist()){\n this.selector.remove();\n this.selector = null;\n }\n return this;\n }; \n\n /**\n * Button Menu Object\n * The menu is an HTML overlay that can appear below a button. It can contain arbitrary HTML and\n * has logic to be automatically positioned and sized to behave more or less like a dropdown menu.\n * @member {Object}\n */\n this.menu = {\n outer_selector: null,\n inner_selector: null,\n scroll_position: 0,\n hidden: true,\n /**\n * Show the button menu, including setting up any DOM elements needed for first rendering\n */\n show: function(){\n if (!this.menu.outer_selector){\n this.menu.outer_selector = d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu lz-dashboard-menu-\" + this.color)\n .attr(\"id\", this.parent_svg.getBaseId() + \".dashboard.menu\");\n this.menu.inner_selector = this.menu.outer_selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu-content\");\n this.menu.inner_selector.on(\"scroll\", function(){\n this.menu.scroll_position = this.menu.inner_selector.node().scrollTop;\n }.bind(this));\n }\n this.menu.outer_selector.style({ visibility: \"visible\" });\n this.menu.hidden = false;\n return this.menu.update();\n }.bind(this),\n /**\n * Update the rendering of the menu\n */\n update: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.populate(); // This function is stubbed for all buttons by default and custom implemented in component definition\n if (this.menu.inner_selector){ this.menu.inner_selector.node().scrollTop = this.menu.scroll_position; }\n return this.menu.position();\n }.bind(this),\n position: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n // Unset any explicitly defined outer selector height so that menus dynamically shrink if content is removed\n this.menu.outer_selector.style({ height: null });\n var padding = 3;\n var scrollbar_padding = 20;\n var menu_height_padding = 14; // 14: 2x 6px padding, 2x 1px border\n var page_origin = this.parent_svg.getPageOrigin();\n var page_scroll_top = document.documentElement.scrollTop || document.body.scrollTop;\n var container_offset = this.parent_plot.getContainerOffset();\n var dashboard_client_rect = this.parent_dashboard.selector.node().getBoundingClientRect();\n var button_client_rect = this.selector.node().getBoundingClientRect();\n var menu_client_rect = this.menu.outer_selector.node().getBoundingClientRect();\n var total_content_height = this.menu.inner_selector.node().scrollHeight;\n var top = 0; var left = 0;\n if (this.parent_dashboard.type === \"panel\"){\n top = (page_origin.y + dashboard_client_rect.height + (2 * padding));\n left = Math.max(page_origin.x + this.parent_svg.layout.width - menu_client_rect.width - padding, page_origin.x + padding);\n } else {\n top = button_client_rect.bottom + page_scroll_top + padding - container_offset.top;\n left = Math.max(button_client_rect.left + button_client_rect.width - menu_client_rect.width - container_offset.left, page_origin.x + padding);\n }\n var base_max_width = Math.max(this.parent_svg.layout.width - (2 * padding) - scrollbar_padding, scrollbar_padding);\n var container_max_width = base_max_width;\n var content_max_width = (base_max_width - (4 * padding));\n var base_max_height = Math.max(this.parent_svg.layout.height - (10 * padding) - menu_height_padding, menu_height_padding);\n var height = Math.min(total_content_height, base_max_height);\n var max_height = base_max_height;\n this.menu.outer_selector.style({\n \"top\": top.toString() + \"px\",\n \"left\": left.toString() + \"px\",\n \"max-width\": container_max_width.toString() + \"px\",\n \"max-height\": max_height.toString() + \"px\",\n \"height\": height.toString() + \"px\"\n });\n this.menu.inner_selector.style({ \"max-width\": content_max_width.toString() + \"px\" });\n this.menu.inner_selector.node().scrollTop = this.menu.scroll_position;\n return this.menu;\n }.bind(this),\n hide: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.outer_selector.style({ visibility: \"hidden\" });\n this.menu.hidden = true;\n return this.menu;\n }.bind(this),\n destroy: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.inner_selector.remove();\n this.menu.outer_selector.remove();\n this.menu.inner_selector = null;\n this.menu.outer_selector = null;\n return this.menu;\n }.bind(this),\n /**\n * Internal method definition\n * By convention populate() does nothing and should be reimplemented with each dashboard button definition\n * Reimplement by way of Dashboard.Component.Button.menu.setPopulate to define the populate method and hook\n * up standard menu click-toggle behavior prototype.\n * @protected\n */\n populate: function(){ /* stub */ }.bind(this),\n /**\n * Define how the menu is populated with items, and set up click and display properties as appropriate\n * @public\n */\n setPopulate: function(menu_populate_function){\n if (typeof menu_populate_function == \"function\"){\n this.menu.populate = menu_populate_function;\n this.setOnclick(function(){\n if (this.menu.hidden){\n this.menu.show();\n this.highlight().update();\n this.persist = true;\n } else {\n this.menu.hide();\n this.highlight(false).update();\n if (!this.permanent){ this.persist = false; }\n }\n }.bind(this));\n } else {\n this.setOnclick();\n }\n return this;\n }.bind(this)\n };\n\n};\n\n/**\n * Renders arbitrary text with title formatting\n * @class LocusZoom.Dashboard.Components.title\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.title Text to render\n */\nLocusZoom.Dashboard.Components.add(\"title\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.show = function(){\n this.div_selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-title lz-dashboard-\" + this.layout.position);\n this.title_selector = this.div_selector.append(\"h3\");\n return this.update();\n };\n this.update = function(){\n var title = layout.title.toString();\n if (this.layout.subtitle){ title += \" \" + this.layout.subtitle + \"\"; }\n this.title_selector.html(title);\n return this;\n };\n});\n\n/**\n * Renders text to display the current dimensions of the plot. Automatically updated as plot dimensions change\n * @class LocusZoom.Dashboard.Components.dimensions\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"dimensions\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var display_width = this.parent_plot.layout.width.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.width : this.parent_plot.layout.width.toFixed(2);\n var display_height = this.parent_plot.layout.height.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.height : this.parent_plot.layout.height.toFixed(2);\n this.selector.html(display_width + \"px × \" + display_height + \"px\");\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Display the current scale of the genome region displayed in the plot, as defined by the difference between\n * `state.end` and `state.start`.\n * @class LocusZoom.Dashboard.Components.region_scale\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"region_scale\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (!isNaN(this.parent_plot.state.start) && !isNaN(this.parent_plot.state.end)\n && this.parent_plot.state.start !== null && this.parent_plot.state.end !== null){\n this.selector.style(\"display\", null);\n this.selector.html(LocusZoom.positionIntToString(this.parent_plot.state.end - this.parent_plot.state.start, null, true));\n } else {\n this.selector.style(\"display\", \"none\");\n }\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Button to export current plot to an SVG image\n * @class LocusZoom.Dashboard.Components.download\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"download\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Download Image\").setTitle(\"Download image of the current plot as locuszoom.svg\")\n .setOnMouseover(function() {\n this.button.selector\n .classed(\"lz-dashboard-button-gray-disabled\", true)\n .html(\"Preparing Image\");\n this.generateBase64SVG().then(function(base64_string){\n this.button.selector\n .attr(\"href\", \"data:image/svg+xml;base64,\\n\" + base64_string)\n .classed(\"lz-dashboard-button-gray-disabled\", false)\n .classed(\"lz-dashboard-button-gray-highlighted\", true)\n .html(\"Download Image\");\n }.bind(this));\n }.bind(this))\n .setOnMouseout(function() {\n this.button.selector.classed(\"lz-dashboard-button-gray-highlighted\", false);\n }.bind(this));\n this.button.show();\n this.button.selector.attr(\"href-lang\", \"image/svg+xml\").attr(\"download\", \"locuszoom.svg\");\n return this;\n };\n this.css_string = \"\";\n for (var stylesheet in Object.keys(document.styleSheets)){\n if ( document.styleSheets[stylesheet].href !== null\n && document.styleSheets[stylesheet].href.indexOf(\"locuszoom.css\") !== -1){\n LocusZoom.createCORSPromise(\"GET\", document.styleSheets[stylesheet].href)\n .then(function(response){\n this.css_string = response.replace(/[\\r\\n]/g,\" \").replace(/\\s+/g,\" \");\n if (this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\")){\n this.css_string = this.css_string.substring(0, this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\"));\n }\n }.bind(this));\n break;\n }\n } \n this.generateBase64SVG = function(){\n return Q.fcall(function () {\n // Insert a hidden div, clone the node into that so we can modify it with d3\n var container = this.parent.selector.append(\"div\").style(\"display\", \"none\")\n .html(this.parent_plot.svg.node().outerHTML);\n // Remove unnecessary elements\n container.selectAll(\"g.lz-curtain\").remove();\n container.selectAll(\"g.lz-mouse_guide\").remove();\n // Convert units on axis tick dy attributes from ems to pixels\n container.selectAll(\"g.tick text\").each(function(){\n var dy = +(d3.select(this).attr(\"dy\").substring(-2).slice(0,-2))*10;\n d3.select(this).attr(\"dy\", dy);\n });\n // Pull the svg into a string and add the contents of the locuszoom stylesheet\n // Don't add this with d3 because it will escape the CDATA declaration incorrectly\n var initial_html = d3.select(container.select(\"svg\").node().parentNode).html();\n var style_def = \"\";\n var insert_at = initial_html.indexOf(\">\") + 1;\n initial_html = initial_html.slice(0,insert_at) + style_def + initial_html.slice(insert_at);\n // Delete the container node\n container.remove();\n // Base64-encode the string and return it\n return btoa(encodeURIComponent(initial_html).replace(/%([0-9A-F]{2})/g, function(match, p1) {\n return String.fromCharCode(\"0x\" + p1);\n }));\n }.bind(this));\n };\n});\n\n/**\n * Button to remove panel from plot.\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.remove_panel\n * @augments LocusZoom.Dashboard.Component\n * @param {Boolean} [layout.suppress_confirm=false] If true, removes the panel without prompting user for confirmation\n */\nLocusZoom.Dashboard.Components.add(\"remove_panel\", function(layout) {\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function() {\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"×\").setTitle(\"Remove panel\")\n .setOnclick(function(){\n if (!layout.suppress_confirm && !confirm(\"Are you sure you want to remove this panel? This cannot be undone!\")){\n return false;\n }\n var panel = this.parent_panel;\n panel.dashboard.hide(true);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseover.\" + panel.getBaseId() + \".dashboard\", null);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseout.\" + panel.getBaseId() + \".dashboard\", null);\n return panel.parent.removePanel(panel.id);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to move panel up relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_up\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_up\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_top = (this.parent_panel.layout.y_index === 0);\n this.button.disable(is_at_top);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▴\").setTitle(\"Move panel up\")\n .setOnclick(function(){\n this.parent_panel.moveUp();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to move panel down relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_down\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_down\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_bottom = (this.parent_panel.layout.y_index === this.parent_plot.panel_ids_by_y_index.length-1);\n this.button.disable(is_at_bottom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▾\").setTitle(\"Move panel down\")\n .setOnclick(function(){\n this.parent_panel.moveDown();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to shift plot region forwards or back by a `step` increment provided in the layout\n * @class LocusZoom.Dashboard.Components.shift_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=50000] The stepsize to change the region by\n * @param {string} [layout.button_html]\n * @param {string} [layout.button_title]\n */\nLocusZoom.Dashboard.Components.add(\"shift_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add shift_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 50000; }\n if (typeof layout.button_html !== \"string\"){ layout.button_html = layout.step > 0 ? \">\" : \"<\"; }\n if (typeof layout.button_title !== \"string\"){\n layout.button_title = \"Shift region by \" + (layout.step > 0 ? \"+\" : \"-\") + LocusZoom.positionIntToString(Math.abs(layout.step),null,true);\n }\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start + layout.step, 1),\n end: this.parent_plot.state.end + layout.step\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Zoom in or out on the plot, centered on the middle of the plot region, by the specified amount\n * @class LocusZoom.Dashboard.Components.zoom_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=0.2] The amount to zoom in by (where 1 indicates 100%)\n */\nLocusZoom.Dashboard.Components.add(\"zoom_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add zoom_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 0.2; }\n if (typeof layout.button_html != \"string\"){ layout.button_html = layout.step > 0 ? \"z–\" : \"z+\"; }\n if (typeof layout.button_title != \"string\"){\n layout.button_title = \"Zoom region \" + (layout.step > 0 ? \"out\" : \"in\") + \" by \" + (Math.abs(layout.step)*100).toFixed(1) + \"%\";\n }\n this.update = function(){\n if (this.button){\n var can_zoom = true;\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n if (layout.step > 0 && !isNaN(this.parent_plot.layout.max_region_scale) && current_region_scale >= this.parent_plot.layout.max_region_scale){\n can_zoom = false;\n }\n if (layout.step < 0 && !isNaN(this.parent_plot.layout.min_region_scale) && current_region_scale <= this.parent_plot.layout.min_region_scale){\n can_zoom = false;\n }\n this.button.disable(!can_zoom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n var zoom_factor = 1 + layout.step;\n var new_region_scale = current_region_scale * zoom_factor;\n if (!isNaN(this.parent_plot.layout.max_region_scale)){\n new_region_scale = Math.min(new_region_scale, this.parent_plot.layout.max_region_scale);\n }\n if (!isNaN(this.parent_plot.layout.min_region_scale)){\n new_region_scale = Math.max(new_region_scale, this.parent_plot.layout.min_region_scale);\n }\n var delta = Math.floor((new_region_scale - current_region_scale) / 2);\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start - delta, 1),\n end: this.parent_plot.state.end + delta\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Renders button with arbitrary text that, when clicked, shows a dropdown containing arbitrary HTML\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @class LocusZoom.Dashboard.Components.menu\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n * @param {string} layout.menu_html The HTML content of the dropdown menu\n */\nLocusZoom.Dashboard.Components.add(\"menu\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title);\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(layout.menu_html);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Special button/menu to allow model building by tracking individual covariants. Will track a list of covariate\n * objects and store them in the special `model.covariates` field of plot `state`.\n * @class LocusZoom.Dashboard.Components.covariates_model\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n */\nLocusZoom.Dashboard.Components.add(\"covariates_model\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.initialize = function(){\n // Initialize state.model.covariates\n this.parent_plot.state.model = this.parent_plot.state.model || {};\n this.parent_plot.state.model.covariates = this.parent_plot.state.model.covariates || [];\n // Create an object at the plot level for easy access to interface methods in custom client-side JS\n /**\n * When a covariates model dashboard element is present, create (one) object at the plot level that exposes\n * component data and state for custom interactions with other plot elements.\n * @class LocusZoom.Plot.CovariatesModel\n */\n this.parent_plot.CovariatesModel = {\n /** @member {LocusZoom.Dashboard.Component.Button} */\n button: this,\n /**\n * Add an element to the model and show a representation of it in the dashboard component menu. If the\n * element is already part of the model, do nothing (to avoid adding duplicates).\n * When plot state is changed, this will automatically trigger requests for new data accordingly.\n * @param {string|object} element_reference Can be any value that can be put through JSON.stringify()\n * to create a serialized representation of itself.\n */\n add: function(element_reference){\n var element = JSON.parse(JSON.stringify(element_reference));\n if (typeof element_reference == \"object\" && typeof element.html != \"string\"){\n element.html = ( (typeof element_reference.toHTML == \"function\") ? element_reference.toHTML() : element_reference.toString());\n }\n // Check if the element is already in the model covariates array and return if it is.\n for (var i = 0; i < this.state.model.covariates.length; i++) {\n if (JSON.stringify(this.state.model.covariates[i]) === JSON.stringify(element)) {\n return this;\n }\n }\n this.state.model.covariates.push(element);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Remove an element from `state.model.covariates` (and from the dashboard component menu's\n * representation of the state model). When plot state is changed, this will automatically trigger\n * requests for new data accordingly.\n * @param {number} idx Array index of the element, in the `state.model.covariates array`.\n */\n removeByIdx: function(idx){\n if (typeof this.state.model.covariates[idx] == \"undefined\"){\n throw(\"Unable to remove model covariate, invalid index: \" + idx.toString());\n }\n this.state.model.covariates.splice(idx, 1);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Empty the `state.model.covariates` array (and dashboard component menu representation thereof) of all\n * elements. When plot state is changed, this will automatically trigger requests for new data accordingly\n */\n removeAll: function(){\n this.state.model.covariates = [];\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Manually trigger the update methods on the dashboard component's button and menu elements to force\n * display of most up-to-date content. Can be used to force the dashboard to reflect changes made, eg if\n * modifying `state.model.covariates` directly instead of via `plot.CovariatesModel`\n */\n updateComponent: function(){\n this.button.update();\n this.button.menu.update();\n }.bind(this)\n };\n }.bind(this);\n\n this.update = function(){\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n var selector = this.button.menu.inner_selector;\n selector.html(\"\");\n // General model HTML representation\n if (typeof this.parent_plot.state.model.html != \"undefined\"){\n selector.append(\"div\").html(this.parent_plot.state.model.html);\n }\n // Model covariates table\n if (!this.parent_plot.state.model.covariates.length){\n selector.append(\"i\").html(\"no covariates in model\");\n } else {\n selector.append(\"h5\").html(\"Model Covariates (\" + this.parent_plot.state.model.covariates.length + \")\");\n var table = selector.append(\"table\");\n this.parent_plot.state.model.covariates.forEach(function(covariate, idx){\n var html = ( (typeof covariate == \"object\" && typeof covariate.html == \"string\") ? covariate.html : covariate.toString() );\n var row = table.append(\"tr\");\n row.append(\"td\").append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeByIdx(idx);\n }.bind(this))\n .html(\"×\");\n row.append(\"td\").html(html);\n }.bind(this));\n selector.append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"4px\" }).html(\"× Remove All Covariates\")\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeAll();\n }.bind(this));\n }\n }.bind(this));\n\n this.button.preUpdate = function(){\n var html = \"Model\";\n if (this.parent_plot.state.model.covariates.length){\n var cov = this.parent_plot.state.model.covariates.length > 1 ? \"covariates\" : \"covariate\";\n html += \" (\" + this.parent_plot.state.model.covariates.length + \" \" + cov + \")\";\n }\n this.button.setHtml(html).disable(false);\n }.bind(this);\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Button to toggle split tracks\n * @class LocusZoom.Dashboard.Components.toggle_split_tracks\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_split_tracks\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (!layout.data_layer_id){ layout.data_layer_id = \"intervals\"; }\n if (!this.parent_panel.data_layers[layout.data_layer_id]){\n throw (\"Dashboard toggle split tracks component missing valid data layer ID\");\n }\n this.update = function(){\n var data_layer = this.parent_panel.data_layers[layout.data_layer_id];\n var html = data_layer.layout.split_tracks ? \"Merge Tracks\" : \"Split Tracks\";\n if (this.button){\n this.button.setHtml(html);\n this.button.show();\n this.parent.position();\n return this;\n } else {\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(html)\n .setTitle(\"Toggle whether tracks are split apart or merged together\")\n .setOnclick(function(){\n data_layer.toggleSplitTracks();\n if (this.scale_timeout){ clearTimeout(this.scale_timeout); }\n var timeout = data_layer.layout.transition ? +data_layer.layout.transition.duration || 0 : 0;\n this.scale_timeout = setTimeout(function(){\n this.parent_panel.scaleHeightToData();\n this.parent_plot.positionPanels();\n }.bind(this), timeout);\n this.update();\n }.bind(this));\n return this.update();\n }\n };\n});\n\n/**\n * Button to resize panel height to fit available data (eg when showing a list of tracks)\n * @class LocusZoom.Dashboard.Components.resize_to_data\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"resize_to_data\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Resize to Data\")\n .setTitle(\"Automatically resize this panel to fit the data its currently showing\")\n .setOnclick(function(){\n this.parent_panel.scaleHeightToData();\n this.update();\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to toggle legend\n * @class LocusZoom.Dashboard.Components.toggle_legend\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_legend\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var html = this.parent_panel.legend.layout.hidden ? \"Show Legend\" : \"Hide Legend\";\n if (this.button){\n this.button.setHtml(html).show();\n this.parent.position();\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color)\n .setTitle(\"Show or hide the legend for this panel\")\n .setOnclick(function(){\n this.parent_panel.legend.layout.hidden = !this.parent_panel.legend.layout.hidden;\n this.parent_panel.legend.render();\n this.update();\n }.bind(this));\n return this.update();\n };\n});\n\n/**\n * Menu for manipulating multiple data layers in a single panel: show/hide, change order, etc.\n * @class LocusZoom.Dashboard.Components.data_layers\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"data_layers\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.update = function(){\n\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Data Layers\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Manipulate Data Layers (sort, dim, show/hide, etc.)\"; }\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(\"\");\n var table = this.button.menu.inner_selector.append(\"table\");\n this.parent_panel.data_layer_ids_by_z_index.slice().reverse().forEach(function(id, idx){\n var data_layer = this.parent_panel.data_layers[id];\n var name = (typeof data_layer.layout.name != \"string\") ? data_layer.id : data_layer.layout.name;\n var row = table.append(\"tr\");\n // Layer name\n row.append(\"td\").html(name);\n // Status toggle buttons\n layout.statuses.forEach(function(status_adj){\n var status_idx = LocusZoom.DataLayer.Statuses.adjectives.indexOf(status_adj);\n var status_verb = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n var html, onclick, highlight;\n if (data_layer.global_statuses[status_adj]){\n html = LocusZoom.DataLayer.Statuses.menu_antiverbs[status_idx];\n onclick = \"un\" + status_verb + \"AllElements\";\n highlight = \"-highlighted\";\n } else {\n html = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n onclick = status_verb + \"AllElements\";\n highlight = \"\";\n }\n row.append(\"td\").append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color + highlight)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer[onclick](); this.button.menu.populate(); }.bind(this))\n .html(html);\n }.bind(this));\n // Sort layer buttons\n var at_top = (idx === 0);\n var at_bottom = (idx === (this.parent_panel.data_layer_ids_by_z_index.length - 1));\n var td = row.append(\"td\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-start lz-dashboard-button-\" + this.layout.color + (at_bottom ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveDown(); this.button.menu.populate(); }.bind(this))\n .html(\"▾\").attr(\"title\", \"Move layer down (further back)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-middle lz-dashboard-button-\" + this.layout.color + (at_top ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveUp(); this.button.menu.populate(); }.bind(this))\n .html(\"▴\").attr(\"title\", \"Move layer up (further front)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-end lz-dashboard-button-red\")\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n if (confirm(\"Are you sure you want to remove the \" + name + \" layer? This cannot be undone!\")){\n data_layer.parent.removeDataLayer(id);\n }\n return this.button.menu.populate();\n }.bind(this))\n .html(\"×\").attr(\"title\", \"Remove layer\");\n }.bind(this));\n return this;\n }.bind(this));\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Dropdown menu allowing the user to choose between different display options for a single specific data layer\n * within a panel.\n *\n * This allows controlling how points on a datalayer can be displayed- any display options supported via the layout for the target datalayer. This includes point\n * size/shape, coloring, etc.\n *\n * This button intentionally limits display options it can control to those available on common plot types.\n * Although the list of options it sets can be overridden (to control very special custom plot types), this\n * capability should be used sparingly if at all.\n *\n * @class LocusZoom.Dashboard.Components.display_options\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {String} [layout.button_html=\"Display options\"] Text to display on the toolbar button\n * @param {String} [layout.button_title=\"Control how plot items are displayed\"] Hover text for the toolbar button\n * @param {string} layout.layer_name Specify the datalayer that this button should affect\n * @param {string} [layout.default_config_display_name] Store the default configuration for this datalayer\n * configuration, and show a button to revert to the \"default\" (listing the human-readable display name provided)\n * @param {Array} [layout.fields_whitelist='see code'] The list of presentation fields that this button can control.\n * This can be overridden if this button needs to be used on a custom layer type with special options.\n * @typedef {{display_name: string, display: Object}} DisplayOptionsButtonConfigField\n * @param {DisplayOptionsButtonConfigField[]} layout.options Specify a label and set of layout directives associated\n * with this `display` option. Display field should include all changes to datalayer presentation options.\n */\nLocusZoom.Dashboard.Components.add(\"display_options\", function (layout) {\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Display options\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Control how plot items are displayed\"; }\n\n // Call parent constructor\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n // List of layout fields that this button is allowed to control. This ensures that we don't override any other\n // information (like plot height etc) while changing point rendering\n var allowed_fields = layout.fields_whitelist || [\"color\", \"fill_opacity\", \"label\", \"legend\",\n \"point_shape\", \"point_size\", \"tooltip\", \"tooltip_positioning\"];\n\n var dataLayer = this.parent_panel.data_layers[layout.layer_name];\n var dataLayerLayout = dataLayer.layout;\n\n // Store default configuration for the layer as a clean deep copy, so we may revert later\n var defaultConfig = {};\n allowed_fields.forEach(function(name) {\n var configSlot = dataLayerLayout[name];\n if (configSlot) {\n defaultConfig[name] = JSON.parse(JSON.stringify(configSlot));\n }\n });\n\n /**\n * Which item in the menu is currently selected. (track for rerendering menu)\n * @member {String}\n * @private\n */\n this._selected_item = \"default\";\n\n // Define the button + menu that provides the real functionality for this dashboard component\n var self = this;\n this.button = new LocusZoom.Dashboard.Component.Button(self)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function () {\n self.button.menu.populate();\n });\n this.button.menu.setPopulate(function () {\n // Multiple copies of this button might be used on a single LZ page; append unique IDs where needed\n var uniqueID = Math.floor(Math.random() * 1e4).toString();\n\n self.button.menu.inner_selector.html(\"\");\n var table = self.button.menu.inner_selector.append(\"table\");\n\n var menuLayout = self.layout;\n\n var renderRow = function(display_name, display_options, row_id) { // Helper method\n var row = table.append(\"tr\");\n row.append(\"td\")\n .append(\"input\")\n .attr({type: \"radio\", name: \"color-picker-\" + uniqueID, value: row_id})\n .property(\"checked\", (row_id === self._selected_item))\n .on(\"click\", function () {\n Object.keys(display_options).forEach(function(field_name) {\n dataLayer.layout[field_name] = display_options[field_name];\n });\n self._selected_item = row_id;\n self.parent_panel.render();\n var legend = self.parent_panel.legend;\n if (legend && display_options.legend) {\n // Update the legend only if necessary\n legend.render();\n }\n });\n row.append(\"td\").text(display_name);\n };\n // Render the \"display options\" menu: default and special custom options\n var defaultName = menuLayout.default_config_display_name || \"Default style\";\n renderRow(defaultName, defaultConfig, \"default\");\n menuLayout.options.forEach(function (item, index) {\n renderRow(item.display_name, item.display, index);\n });\n return self;\n });\n\n this.update = function () {\n this.button.show();\n return this;\n };\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * An SVG object used to display contextual information about a panel.\n * Panel layouts determine basic features of a legend - its position in the panel, orientation, title, etc.\n * Layouts of child data layers of the panel determine the actual content of the legend.\n *\n * @class\n * @param {LocusZoom.Panel} parent\n*/\nLocusZoom.Legend = function(parent){\n if (!(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create legend, parent must be a locuszoom panel\";\n }\n /** @member {LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".legend\";\n\n this.parent.layout.legend = LocusZoom.Layouts.merge(this.parent.layout.legend || {}, LocusZoom.Legend.DefaultLayout);\n /** @member {Object} */\n this.layout = this.parent.layout.legend;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {d3.selection} */\n this.background_rect = null;\n /** @member {d3.selection[]} */\n this.elements = [];\n /**\n * SVG selector for the group containing all elements in the legend\n * @protected\n * @member {d3.selection|null}\n */\n this.elements_group = null;\n\n /**\n * TODO: Not sure if this property is used; the external-facing methods are setting `layout.hidden` instead. Tentatively mark deprecated.\n * @deprecated\n * @protected\n * @member {Boolean}\n */\n this.hidden = false;\n\n // TODO Revisit constructor return value; see https://stackoverflow.com/a/3350364/1422268\n return this.render();\n};\n\n/**\n * The default layout used by legends (used internally)\n * @protected\n * @member {Object}\n */\nLocusZoom.Legend.DefaultLayout = {\n orientation: \"vertical\",\n origin: { x: 0, y: 0 },\n width: 10,\n height: 10,\n padding: 5,\n label_size: 12,\n hidden: false\n};\n\n/**\n * Render the legend in the parent panel\n */\nLocusZoom.Legend.prototype.render = function(){\n\n // Get a legend group selector if not yet defined\n if (!this.selector){\n this.selector = this.parent.svg.group.append(\"g\")\n .attr(\"id\", this.parent.getBaseId() + \".legend\").attr(\"class\", \"lz-legend\");\n }\n\n // Get a legend background rect selector if not yet defined\n if (!this.background_rect){\n this.background_rect = this.selector.append(\"rect\")\n .attr(\"width\", 100).attr(\"height\", 100).attr(\"class\", \"lz-legend-background\");\n }\n\n // Get a legend elements group selector if not yet defined\n if (!this.elements_group){\n this.elements_group = this.selector.append(\"g\");\n }\n\n // Remove all elements from the document and re-render from scratch\n this.elements.forEach(function(element){\n element.remove();\n });\n this.elements = [];\n\n // Gather all elements from data layers in order (top to bottom) and render them\n var padding = +this.layout.padding || 1;\n var x = padding;\n var y = padding;\n var line_height = 0;\n this.parent.data_layer_ids_by_z_index.slice().reverse().forEach(function(id){\n if (Array.isArray(this.parent.data_layers[id].layout.legend)){\n this.parent.data_layers[id].layout.legend.forEach(function(element){\n var selector = this.elements_group.append(\"g\")\n .attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n var label_size = +element.label_size || +this.layout.label_size || 12;\n var label_x = 0;\n var label_y = (label_size/2) + (padding/2);\n line_height = Math.max(line_height, label_size + padding);\n // Draw the legend element symbol (line, rect, shape, etc)\n if (element.shape === \"line\"){\n // Line symbol\n var length = +element.length || 16;\n var path_y = (label_size/4) + (padding/2);\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", \"M0,\" + path_y + \"L\" + length + \",\" + path_y)\n .style(element.style || {});\n label_x = length + padding;\n } else if (element.shape === \"rect\"){\n // Rect symbol\n var width = +element.width || 16;\n var height = +element.height || width;\n selector.append(\"rect\").attr(\"class\", element.class || \"\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = width + padding;\n line_height = Math.max(line_height, height + padding);\n } else if (d3.svg.symbolTypes.indexOf(element.shape) !== -1) {\n // Shape symbol (circle, diamond, etc.)\n var size = +element.size || 40;\n var radius = Math.ceil(Math.sqrt(size/Math.PI));\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", d3.svg.symbol().size(size).type(element.shape))\n .attr(\"transform\", \"translate(\" + radius + \",\" + (radius+(padding/2)) + \")\")\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = (2*radius) + padding;\n label_y = Math.max((2*radius)+(padding/2), label_y);\n line_height = Math.max(line_height, (2*radius) + padding);\n }\n // Draw the legend element label\n selector.append(\"text\").attr(\"text-anchor\", \"left\").attr(\"class\", \"lz-label\")\n .attr(\"x\", label_x).attr(\"y\", label_y).style({\"font-size\": label_size}).text(element.label);\n // Position the legend element group based on legend layout orientation\n var bcr = selector.node().getBoundingClientRect();\n if (this.layout.orientation === \"vertical\"){\n y += bcr.height + padding;\n line_height = 0;\n } else {\n // Ensure this element does not exceed the panel width\n // (E.g. drop to the next line if it does, but only if it's not the only element on this line)\n var right_x = this.layout.origin.x + x + bcr.width;\n if (x > padding && right_x > this.parent.layout.width){\n y += line_height;\n x = padding;\n selector.attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n }\n x += bcr.width + (3*padding);\n }\n // Store the element\n this.elements.push(selector);\n }.bind(this));\n }\n }.bind(this));\n\n // Scale the background rect to the elements in the legend\n var bcr = this.elements_group.node().getBoundingClientRect();\n this.layout.width = bcr.width + (2*this.layout.padding);\n this.layout.height = bcr.height + (2*this.layout.padding);\n this.background_rect\n .attr(\"width\", this.layout.width)\n .attr(\"height\", this.layout.height);\n\n // Set the visibility on the legend from the \"hidden\" flag\n // TODO: `show()` and `hide()` call a full rerender; might be able to make this more lightweight?\n this.selector.style({ visibility: this.layout.hidden ? \"hidden\" : \"visible\" });\n\n // TODO: Annotate return type and make consistent\n return this.position();\n};\n\n/**\n * Place the legend in position relative to the panel, as specified in the layout configuration\n * @returns {LocusZoom.Legend | null}\n * TODO: should this always be chainable?\n */\nLocusZoom.Legend.prototype.position = function(){\n if (!this.selector){ return this; }\n var bcr = this.selector.node().getBoundingClientRect();\n if (!isNaN(+this.layout.pad_from_bottom)){\n this.layout.origin.y = this.parent.layout.height - bcr.height - +this.layout.pad_from_bottom;\n }\n if (!isNaN(+this.layout.pad_from_right)){\n this.layout.origin.x = this.parent.layout.width - bcr.width - +this.layout.pad_from_right;\n }\n this.selector.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n};\n\n/**\n * Hide the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.hide = function(){\n this.layout.hidden = true;\n this.render();\n};\n\n/**\n * Show the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.show = function(){\n this.layout.hidden = false;\n this.render();\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * LocusZoom functionality used for data parsing and retrieval\n * @namespace\n * @public\n */\nLocusZoom.Data = LocusZoom.Data || {};\n\n/**\n * Create and coordinate an ensemble of (namespaced) data source instances\n * @public\n * @class\n */\nLocusZoom.DataSources = function() {\n /** @member {Object.} */\n this.sources = {};\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.addSource = function(ns, x) {\n console.warn(\"Warning: .addSource() is deprecated. Use .add() instead\");\n return this.add(ns, x);\n};\n\n/**\n * Add a (namespaced) datasource to the plot\n * @public\n * @param {String} ns A namespace used for fields from this data source\n * @param {LocusZoom.Data.Source|Array|null} x An instantiated datasource, or an array of arguments that can be used to\n * create a known datasource type.\n */\nLocusZoom.DataSources.prototype.add = function(ns, x) {\n return this.set(ns, x);\n};\n\n/** @protected */\nLocusZoom.DataSources.prototype.set = function(ns, x) {\n if (Array.isArray(x)) {\n var dsobj = LocusZoom.KnownDataSources.create.apply(null, x);\n this.sources[ns] = dsobj;\n } else {\n if (x !== null) {\n this.sources[ns] = x;\n } else {\n delete this.sources[ns];\n }\n }\n return this;\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.getSource = function(ns) {\n console.warn(\"Warning: .getSource() is deprecated. Use .get() instead\");\n return this.get(ns);\n};\n\n/**\n * Return the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n * @returns {LocusZoom.Data.Source}\n */\nLocusZoom.DataSources.prototype.get = function(ns) {\n return this.sources[ns];\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.removeSource = function(ns) {\n console.warn(\"Warning: .removeSource() is deprecated. Use .remove() instead\");\n return this.remove(ns);\n};\n\n/**\n * Remove the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n */\nLocusZoom.DataSources.prototype.remove = function(ns) {\n return this.set(ns, null);\n};\n\n/**\n * Populate a list of datasources specified as a JSON object\n * @public\n * @param {String|Object} x An object or JSON representation containing {ns: configArray} entries\n * @returns {LocusZoom.DataSources}\n */\nLocusZoom.DataSources.prototype.fromJSON = function(x) {\n if (typeof x === \"string\") {\n x = JSON.parse(x);\n }\n var ds = this;\n Object.keys(x).forEach(function(ns) {\n ds.set(ns, x[ns]);\n });\n return ds;\n};\n\n/**\n * Return the names of all currently recognized datasources\n * @public\n * @returns {Array}\n */\nLocusZoom.DataSources.prototype.keys = function() {\n return Object.keys(this.sources);\n};\n\n/**\n * Datasources can be instantiated from a JSON object instead of code. This represents existing sources in that format.\n * For example, this can be helpful when sharing plots, or to share settings with others when debugging\n * @public\n */\nLocusZoom.DataSources.prototype.toJSON = function() {\n return this.sources;\n};\n\n/**\n * Represents an addressable unit of data from a namespaced datasource, subject to specified value transformations.\n *\n * When used by a data layer, fields will automatically be re-fetched from the appropriate data source whenever the\n * state of a plot fetches, eg pan or zoom operations that would affect what data is displayed.\n *\n * @public\n * @class\n * @param {String} field A string representing the namespace of the datasource, the name of the desired field to fetch\n * from that datasource, and arbitrarily many transformations to apply to the value. The namespace and\n * transformation(s) are optional and information is delimited according to the general syntax\n * `[namespace:]name[|transformation][|transformation]`. For example, `association:pvalue|neglog10`\n */\nLocusZoom.Data.Field = function(field){\n \n var parts = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/.exec(field);\n /** @member {String} */\n this.full_name = field;\n /** @member {String} */\n this.namespace = parts[1] || null;\n /** @member {String} */\n this.name = parts[2] || null;\n /** @member {Array} */\n this.transformations = [];\n \n if (typeof parts[3] == \"string\" && parts[3].length > 1){\n this.transformations = parts[3].substring(1).split(\"|\");\n this.transformations.forEach(function(transform, i){\n this.transformations[i] = LocusZoom.TransformationFunctions.get(transform);\n }.bind(this));\n }\n\n this.applyTransformations = function(val){\n this.transformations.forEach(function(transform){\n val = transform(val);\n });\n return val;\n };\n\n // Resolve the field for a given data element.\n // First look for a full match with transformations already applied by the data requester.\n // Otherwise prefer a namespace match and fall back to just a name match, applying transformations on the fly.\n this.resolve = function(d){\n if (typeof d[this.full_name] == \"undefined\"){\n var val = null;\n if (typeof (d[this.namespace+\":\"+this.name]) != \"undefined\"){ val = d[this.namespace+\":\"+this.name]; }\n else if (typeof d[this.name] != \"undefined\"){ val = d[this.name]; }\n d[this.full_name] = this.applyTransformations(val);\n }\n return d[this.full_name];\n };\n \n};\n\n/**\n * The Requester manages fetching of data across multiple data sources. It is used internally by LocusZoom data layers.\n * It passes state information and ensures that data is formatted in the manner expected by the plot.\n *\n * It is also responsible for constructing a \"chain\" of dependent requests, by requesting each datasource\n * sequentially in the order specified in the datalayer `fields` array. Data sources are only chained within a\n * data layer, and only if that layer requests more than one kind of data source.\n * @param {LocusZoom.DataSources} sources An object of {ns: LocusZoom.Data.Source} instances\n * @class\n */\nLocusZoom.Data.Requester = function(sources) {\n\n function split_requests(fields) {\n // Given a fields array, return an object specifying what datasource names the data layer should make requests\n // to, and how to handle the returned data\n var requests = {};\n // Regular expression finds namespace:field|trans\n var re = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/;\n fields.forEach(function(raw) {\n var parts = re.exec(raw);\n var ns = parts[1] || \"base\";\n var field = parts[2];\n var trans = LocusZoom.TransformationFunctions.get(parts[3]);\n if (typeof requests[ns] ==\"undefined\") {\n requests[ns] = {outnames:[], fields:[], trans:[]};\n }\n requests[ns].outnames.push(raw);\n requests[ns].fields.push(field);\n requests[ns].trans.push(trans);\n });\n return requests;\n }\n\n /**\n * Fetch data, and create a chain that only connects two data sources if they depend on each other\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields The list of data fields specified in the `layout` for a specific data layer\n * @returns {Promise}\n */\n this.getData = function(state, fields) {\n var requests = split_requests(fields);\n // Create an array of functions that, when called, will trigger the request to the specified datasource\n var promises = Object.keys(requests).map(function(key) {\n if (!sources.get(key)) {\n throw(\"Datasource for namespace \" + key + \" not found\");\n }\n return sources.get(key).getData(state, requests[key].fields, \n requests[key].outnames, requests[key].trans);\n });\n //assume the fields are requested in dependent order\n //TODO: better manage dependencies\n var ret = Q.when({header:{}, body:{}});\n for(var i=0; i < promises.length; i++) {\n // If a single datalayer uses multiple sources, perform the next request when the previous one completes\n ret = ret.then(promises[i]);\n }\n return ret;\n };\n};\n\n/**\n * Base class for LocusZoom data sources\n * This can be extended with .extend() to create custom data sources\n * @class\n * @public\n */\nLocusZoom.Data.Source = function() {\n /**\n * Whether this source should enable caching\n * @member {Boolean}\n */\n this.enableCache = true;\n /**\n * Whether this data source type is dependent on previous requests- for example, the LD source cannot annotate\n * association data if no data was found for that region.\n * @member {boolean}\n */\n this.dependentSource = false;\n};\n\n/**\n * A default constructor that can be used when creating new data sources\n * @param {String|Object} init Basic configuration- either a url, or a config object\n * @param {String} [init.url] The datasource URL\n * @param {String} [init.params] Initial config params for the datasource\n */\nLocusZoom.Data.Source.prototype.parseInit = function(init) {\n if (typeof init === \"string\") {\n /** @member {String} */\n this.url = init;\n /** @member {String} */\n this.params = {};\n } else {\n this.url = init.url;\n this.params = init.params || {};\n }\n if (!this.url) {\n throw(\"Source not initialized with required URL\");\n }\n\n};\n\n/**\n * Fetch the internal string used to represent this data when cache is used\n * @protected\n * @param state\n * @param chain\n * @param fields\n * @returns {String|undefined}\n */\nLocusZoom.Data.Source.prototype.getCacheKey = function(state, chain, fields) {\n var url = this.getURL && this.getURL(state, chain, fields);\n return url;\n};\n\n/**\n * Fetch data from a remote location\n * @protected\n * @param {Object} state The state of the parent plot\n * @param chain\n * @param fields\n */\nLocusZoom.Data.Source.prototype.fetchRequest = function(state, chain, fields) {\n var url = this.getURL(state, chain, fields);\n return LocusZoom.createCORSPromise(\"GET\", url); \n};\n// TODO: move this.getURL stub into parent class and add documentation; parent should not check for methods known only to children\n\n\n/**\n * TODO Rename to handleRequest (to disambiguate from, say HTTP get requests) and update wiki docs and other references\n * @protected\n */\nLocusZoom.Data.Source.prototype.getRequest = function(state, chain, fields) {\n var req;\n var cacheKey = this.getCacheKey(state, chain, fields);\n if (this.enableCache && typeof(cacheKey) !== \"undefined\" && cacheKey === this._cachedKey) {\n req = Q.when(this._cachedResponse);\n } else {\n req = this.fetchRequest(state, chain, fields);\n if (this.enableCache) {\n req = req.then(function(x) {\n this._cachedKey = cacheKey;\n return this._cachedResponse = x;\n }.bind(this));\n }\n }\n return req;\n};\n\n/**\n * Fetch the data from the specified data source, and format it in a way that can be used by the consuming plot\n * @protected\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the \"namespace\" prefix) TODO: Clarify how this fieldname maps to raw datasource output, and how it differs from outnames\n * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the\n * originally requested field name, including the namespace. This must be an array with the same length as `fields`\n * @param {Function[]} trans The collection of transformation functions to be run on selected fields.\n * This must be an array with the same length as `fields`\n * @returns {function(this:LocusZoom.Data.Source)} A callable operation that can be used as part of the data chain\n */\nLocusZoom.Data.Source.prototype.getData = function(state, fields, outnames, trans) {\n if (this.preGetData) {\n var pre = this.preGetData(state, fields, outnames, trans);\n if(this.pre) {\n state = pre.state || state;\n fields = pre.fields || fields;\n outnames = pre.outnames || outnames;\n trans = pre.trans || trans;\n }\n }\n\n var self = this;\n return function (chain) {\n if (self.dependentSource && chain && chain.body && !chain.body.length) {\n // A \"dependent\" source should not attempt to fire a request if there is no data for it to act on.\n // Therefore, it should simply return the previous data chain.\n return Q.when(chain);\n }\n\n return self.getRequest(state, chain, fields).then(function(resp) {\n return self.parseResponse(resp, chain, fields, outnames, trans);\n });\n };\n};\n\n/**\n * Parse response data. Return an object containing \"header\" (metadata or request parameters) and \"body\"\n * (data to be used for plotting). The response from this request is combined with responses from all other requests\n * in the chain.\n * @public\n * @param {String|Object} resp The raw data associated with the response\n * @param {Object} chain The combined parsed response data from this and all other requests made in the chain\n * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the \"namespace\" prefix) TODO: Clarify how this fieldname maps to raw datasource output, and how it differs from outnames\n * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the\n * originally requested field name, including the namespace. This must be an array with the same length as `fields`\n * @param {Function[]} trans The collection of transformation functions to be run on selected fields.\n * This must be an array with the same length as `fields`\n * @returns {{header: ({}|*), body: {}}}\n */\nLocusZoom.Data.Source.prototype.parseResponse = function(resp, chain, fields, outnames, trans) {\n var json = typeof resp == \"string\" ? JSON.parse(resp) : resp;\n var records = this.parseData(json.data || json, fields, outnames, trans);\n return {header: chain.header || {}, body: records};\n};\n/**\n * Some API endpoints return an object containing several arrays, representing columns of data. Each array should have\n * the same length, and a given array index corresponds to a single row.\n *\n * This gathers column data into an array of objects, each one representing the combined data for a given record.\n * See `parseData` for usage\n *\n * @protected\n * @param {Object} x A response payload object\n * @param {Array} fields\n * @param {Array} outnames\n * @param {Array} trans\n * @returns {Object[]}\n */\nLocusZoom.Data.Source.prototype.parseArraysToObjects = function(x, fields, outnames, trans) {\n //intended for an object of arrays\n //{\"id\":[1,2], \"val\":[5,10]}\n var records = [];\n fields.forEach(function(f, i) {\n if (!(f in x)) {throw \"field \" + f + \" not found in response for \" + outnames[i];}\n });\n // Safeguard: check that arrays are of same length\n var keys = Object.keys(x);\n var N = x[keys[0]].length;\n var sameLength = keys.every(function(key) {\n var item = x[key];\n return item.length === N;\n });\n if (!sameLength) {\n throw this.constructor.SOURCE_NAME + \" expects a response in which all arrays of data are the same length\";\n }\n\n for(var i = 0; i < N; i++) {\n var record = {};\n for(var j=0; j1) {\n if (fields.length!==2 || fields.indexOf(\"isrefvar\")===-1) {\n throw(\"LD does not know how to get all fields: \" + fields.join(\", \"));\n }\n }\n};\n\nLocusZoom.Data.LDSource.prototype.findMergeFields = function(chain) {\n // since LD may be shared across sources with different namespaces\n // we use regex to find columns to join on rather than \n // requiring exact matches\n var exactMatch = function(arr) {return function() {\n var regexes = arguments;\n for(var i=0; i0) {\n var names = Object.keys(chain.body[0]);\n var nameMatch = exactMatch(names);\n dataFields.id = dataFields.id || nameMatch(/\\bvariant\\b/) || nameMatch(/\\bid\\b/);\n dataFields.position = dataFields.position || nameMatch(/\\bposition\\b/i, /\\bpos\\b/i);\n dataFields.pvalue = dataFields.pvalue || nameMatch(/\\bpvalue\\b/i, /\\blog_pvalue\\b/i);\n dataFields._names_ = names;\n }\n return dataFields;\n};\n\nLocusZoom.Data.LDSource.prototype.findRequestedFields = function(fields, outnames) {\n var obj = {};\n for(var i=0; i extremeVal) {\n extremeVal = x[i][pval] * sign;\n extremeIdx = i;\n }\n }\n return extremeIdx;\n };\n\n var refSource = state.ldrefsource || chain.header.ldrefsource || 1;\n var reqFields = this.findRequestedFields(fields);\n var refVar = reqFields.ldin;\n if (refVar === \"state\") {\n refVar = state.ldrefvar || chain.header.ldrefvar || \"best\";\n }\n if (refVar === \"best\") {\n if (!chain.body) {\n throw(\"No association data found to find best pvalue\");\n }\n var keys = this.findMergeFields(chain);\n if (!keys.pvalue || !keys.id) {\n var columns = \"\";\n if (!keys.id){ columns += (columns.length ? \", \" : \"\") + \"id\"; }\n if (!keys.pvalue){ columns += (columns.length ? \", \" : \"\") + \"pvalue\"; }\n throw(\"Unable to find necessary column(s) for merge: \" + columns + \" (available: \" + keys._names_ + \")\");\n }\n refVar = chain.body[findExtremeValue(chain.body, keys.pvalue)][keys.id];\n }\n if (!chain.header) {chain.header = {};}\n chain.header.ldrefvar = refVar;\n return this.url + \"results/?filter=reference eq \" + refSource + \n \" and chromosome2 eq '\" + state.chr + \"'\" + \n \" and position2 ge \" + state.start + \n \" and position2 le \" + state.end + \n \" and variant1 eq '\" + refVar + \"'\" + \n \"&fields=chr,pos,rsquare\";\n};\n\nLocusZoom.Data.LDSource.prototype.parseResponse = function(resp, chain, fields, outnames) {\n var json = JSON.parse(resp);\n var keys = this.findMergeFields(chain);\n var reqFields = this.findRequestedFields(fields, outnames);\n if (!keys.position) {\n throw(\"Unable to find position field for merge: \" + keys._names_);\n }\n var leftJoin = function(left, right, lfield, rfield) {\n var i=0, j=0;\n while (i < left.length && j < right.position2.length) {\n if (left[i][keys.position] === right.position2[j]) {\n left[i][lfield] = right[rfield][j];\n i++;\n j++;\n } else if (left[i][keys.position] < right.position2[j]) {\n i++;\n } else {\n j++;\n }\n }\n };\n var tagRefVariant = function(data, refvar, idfield, outname) {\n for(var i=0; i} */\n this.panels = {};\n /**\n * TODO: This is currently used by external classes that manipulate the parent and may indicate room for a helper method in the api to coordinate boilerplate\n * @protected\n * @member {String[]}\n */\n this.panel_ids_by_y_index = [];\n\n /**\n * Notify each child panel of the plot of changes in panel ordering/ arrangement\n */\n this.applyPanelYIndexesToPanelLayouts = function(){\n this.panel_ids_by_y_index.forEach(function(pid, idx){\n this.panels[pid].layout.y_index = idx;\n }.bind(this));\n };\n\n /**\n * Get the qualified ID pathname for the plot\n * @returns {String}\n */\n this.getBaseId = function(){\n return this.id;\n };\n\n /**\n * Track update operations (reMap) performed on all child panels, and notify the parent plot when complete\n * TODO: Reconsider whether we need to be tracking this as global state outside of context of specific operations\n * @protected\n * @member {Promise[]}\n */\n this.remap_promises = [];\n\n if (typeof layout == \"undefined\"){\n /**\n * The layout is a serializable object used to describe the composition of the Plot\n * If no layout was passed, use the Standard Association Layout\n * Otherwise merge whatever was passed with the Default Layout\n * TODO: Review description; we *always* merge with default layout?\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge({}, LocusZoom.Layouts.get(\"plot\", \"standard_association\"));\n } else {\n this.layout = layout;\n }\n LocusZoom.Layouts.merge(this.layout, LocusZoom.Plot.DefaultLayout);\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original plot state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n\n /**\n * Create a shortcut to the state in the layout on the Plot. Tracking in the layout allows the plot to be created\n * with initial state/setup.\n *\n * Tracks state of the plot, eg start and end position\n * @member {Object}\n */\n this.state = this.layout.state;\n\n /** @member {LocusZoom.Data.Requester} */\n this.lzd = new LocusZoom.Data.Requester(datasource);\n\n /**\n * Window.onresize listener (responsive layouts only)\n * TODO: .on appears to return a selection, not a listener? Check logic here\n * https://github.com/d3/d3-selection/blob/00b904b9bcec4dfaf154ae0bbc777b1fc1d7bc08/test/selection/on-test.js#L11\n * @deprecated\n * @member {d3.selection}\n */\n this.window_onresize = null;\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": []\n };\n /**\n * There are several events that a LocusZoom plot can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following plot-level events are currently supported:\n * - `layout_changed` - context: plot - Any aspect of the plot's layout (including dimensions or state) has changed.\n * - `data_requested` - context: plot - A request for new data from any data source used in the plot has been made.\n * - `data_rendered` - context: plot - Data from a request has been received and rendered in the plot.\n * - `element_clicked` - context: element - A data element in any of the plot's data layers has been clicked.\n *\n * To register a hook for any of these events use `plot.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * plot itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event\n * @param {function} hook\n * @returns {LocusZoom.Plot}\n */\n this.on = function(event, hook){\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n * @protected\n * @param {string} event A known event name\n * @param {*} context Controls function execution context (value of `this` for the hook to be fired)\n * @returns {LocusZoom.Plot}\n */\n this.emit = function(event, context){\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n context = context || this;\n this.event_hooks[event].forEach(function(hookToRun) {\n hookToRun.call(context);\n });\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the plot's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the plot\n * @returns {{x: Number, y: Number, width: Number, height: Number}}\n */\n this.getPageOrigin = function(){\n var bounding_client_rect = this.svg.node().getBoundingClientRect();\n var x_offset = document.documentElement.scrollLeft || document.body.scrollLeft;\n var y_offset = document.documentElement.scrollTop || document.body.scrollTop;\n var container = this.svg.node();\n while (container.parentNode !== null){\n container = container.parentNode;\n if (container !== document && d3.select(container).style(\"position\") !== \"static\"){\n x_offset = -1 * container.getBoundingClientRect().left;\n y_offset = -1 * container.getBoundingClientRect().top;\n break;\n }\n }\n return {\n x: x_offset + bounding_client_rect.left,\n y: y_offset + bounding_client_rect.top,\n width: bounding_client_rect.width,\n height: bounding_client_rect.height\n };\n };\n\n /**\n * Get the top and left offset values for the plot's container element (the div that was populated)\n * @returns {{top: number, left: number}}\n */\n this.getContainerOffset = function(){\n var offset = { top: 0, left: 0 };\n var container = this.container.offsetParent || null;\n while (container !== null){\n offset.top += container.offsetTop;\n offset.left += container.offsetLeft;\n container = container.offsetParent || null;\n }\n return offset;\n };\n\n //\n /**\n * Event information describing interaction (e.g. panning and zooming) is stored on the plot\n * TODO: Add/ document details of interaction structure as we expand\n * @member {{panel_id: String, linked_panel_ids: Array, x_linked: *, dragging: *, zooming: *}}\n * @returns {LocusZoom.Plot}\n */\n this.interaction = {};\n\n /**\n * Track whether the target panel can respond to mouse interaction events\n * @param {String} panel_id\n * @returns {boolean}\n */\n this.canInteract = function(panel_id){\n panel_id = panel_id || null;\n if (panel_id){\n return ((typeof this.interaction.panel_id == \"undefined\" || this.interaction.panel_id === panel_id) && !this.loading_data);\n } else {\n return !(this.interaction.dragging || this.interaction.zooming || this.loading_data);\n }\n };\n\n // Initialize the layout\n this.initializeLayout();\n // TODO: Possibly superfluous return from constructor\n return this;\n};\n\n/**\n * Default/ expected configuration parameters for basic plotting; most plots will override\n *\n * @protected\n * @static\n * @type {Object}\n */\nLocusZoom.Plot.DefaultLayout = {\n state: {},\n width: 1,\n height: 1,\n min_width: 1,\n min_height: 1,\n responsive_resize: false,\n aspect_ratio: 1,\n panels: [],\n dashboard: {\n components: []\n },\n panel_boundaries: true,\n mouse_guide: true\n};\n\n/**\n * Helper method to sum the proportional dimensions of panels, a value that's checked often as panels are added/removed\n * @param {('Height'|'Width')} dimension\n * @returns {number}\n */\nLocusZoom.Plot.prototype.sumProportional = function(dimension){\n if (dimension !== \"height\" && dimension !== \"width\"){\n throw (\"Bad dimension value passed to LocusZoom.Plot.prototype.sumProportional\");\n }\n var total = 0;\n for (var id in this.panels){\n // Ensure every panel contributing to the sum has a non-zero proportional dimension\n if (!this.panels[id].layout[\"proportional_\" + dimension]){\n this.panels[id].layout[\"proportional_\" + dimension] = 1 / Object.keys(this.panels).length;\n }\n total += this.panels[id].layout[\"proportional_\" + dimension];\n }\n return total;\n};\n\n/**\n * Resize the plot to fit the bounding container\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.rescaleSVG = function(){\n var clientRect = this.svg.node().getBoundingClientRect();\n this.setDimensions(clientRect.width, clientRect.height);\n return this;\n};\n\n/**\n * Prepare the plot for first use by performing parameter validation, setting up panels, and calculating dimensions\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initializeLayout = function(){\n\n // Sanity check layout values\n // TODO: Find a way to generally abstract this, maybe into an object that models allowed layout values?\n if (isNaN(this.layout.width) || this.layout.width <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.height) || this.layout.height <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.aspect_ratio) || this.layout.aspect_ratio <= 0){\n throw (\"Plot layout parameter `aspect_ratio` must be a positive number\");\n }\n\n // If this is a responsive layout then set a namespaced/unique onresize event listener on the window\n if (this.layout.responsive_resize){\n this.window_onresize = d3.select(window).on(\"resize.lz-\"+this.id, function(){\n this.rescaleSVG();\n }.bind(this));\n // Forcing one additional setDimensions() call after the page is loaded clears up\n // any disagreements between the initial layout and the loaded responsive container's size\n d3.select(window).on(\"load.lz-\"+this.id, function(){\n this.setDimensions();\n }.bind(this));\n }\n\n // Add panels\n this.layout.panels.forEach(function(panel_layout){\n this.addPanel(panel_layout);\n }.bind(this));\n\n return this;\n};\n\n/**\n * Set the dimensions for a plot, and ensure that panels are sized and positioned correctly.\n *\n * If dimensions are provided, resizes each panel proportionally to match the new plot dimensions. Otherwise,\n * calculates the appropriate plot dimensions based on all panels.\n * @param {Number} [width] If provided and larger than minimum size, set plot to this width\n * @param {Number} [height] If provided and larger than minimum size, set plot to this height\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.setDimensions = function(width, height){\n\n var id;\n\n // Update minimum allowable width and height by aggregating minimums from panels, then apply minimums to containing element.\n var min_width = parseFloat(this.layout.min_width) || 0;\n var min_height = parseFloat(this.layout.min_height) || 0;\n for (id in this.panels){\n min_width = Math.max(min_width, this.panels[id].layout.min_width);\n if (parseFloat(this.panels[id].layout.min_height) > 0 && parseFloat(this.panels[id].layout.proportional_height) > 0){\n min_height = Math.max(min_height, (this.panels[id].layout.min_height / this.panels[id].layout.proportional_height));\n }\n }\n this.layout.min_width = Math.max(min_width, 1);\n this.layout.min_height = Math.max(min_height, 1);\n d3.select(this.svg.node().parentNode).style({\n \"min-width\": this.layout.min_width + \"px\",\n \"min-height\": this.layout.min_height + \"px\"\n });\n\n // If width and height arguments were passed then adjust them against plot minimums if necessary.\n // Then resize the plot and proportionally resize panels to fit inside the new plot dimensions.\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n // Override discrete values if resizing responsively\n if (this.layout.responsive_resize){\n if (this.svg){\n this.layout.width = Math.max(this.svg.node().parentNode.getBoundingClientRect().width, this.layout.min_width);\n }\n this.layout.height = this.layout.width / this.layout.aspect_ratio;\n if (this.layout.height < this.layout.min_height){\n this.layout.height = this.layout.min_height;\n this.layout.width = this.layout.height * this.layout.aspect_ratio;\n }\n }\n // Resize/reposition panels to fit, update proportional origins if necessary\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel_width = this.layout.width;\n var panel_height = this.panels[panel_id].layout.proportional_height * this.layout.height;\n this.panels[panel_id].setDimensions(panel_width, panel_height);\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n this.panels[panel_id].layout.proportional_origin.y = y_offset / this.layout.height;\n y_offset += panel_height;\n this.panels[panel_id].dashboard.update();\n }.bind(this));\n }\n\n // If width and height arguments were NOT passed (and panels exist) then determine the plot dimensions\n // by making it conform to panel dimensions, assuming panels are already positioned correctly.\n else if (Object.keys(this.panels).length) {\n this.layout.width = 0;\n this.layout.height = 0;\n for (id in this.panels){\n this.layout.width = Math.max(this.panels[id].layout.width, this.layout.width);\n this.layout.height += this.panels[id].layout.height;\n }\n this.layout.width = Math.max(this.layout.width, this.layout.min_width);\n this.layout.height = Math.max(this.layout.height, this.layout.min_height);\n }\n\n // Keep aspect ratio in agreement with dimensions\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n\n // Apply layout width and height as discrete values or viewbox values\n if (this.svg !== null){\n if (this.layout.responsive_resize){\n this.svg\n .attr(\"viewBox\", \"0 0 \" + this.layout.width + \" \" + this.layout.height)\n .attr(\"preserveAspectRatio\", \"xMinYMin meet\");\n } else {\n this.svg.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n }\n\n // If the plot has been initialized then trigger some necessary render functions\n if (this.initialized){\n this.panel_boundaries.position();\n this.dashboard.update();\n this.curtain.update();\n this.loader.update();\n }\n\n return this.emit(\"layout_changed\");\n};\n\n/**\n * Create a new panel from a layout, and handle the work of initializing and placing the panel on the plot\n * @param {Object} layout\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Plot.prototype.addPanel = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\"){\n throw \"Invalid panel layout passed to LocusZoom.Plot.prototype.addPanel()\";\n }\n\n // Create the Panel and set its parent\n var panel = new LocusZoom.Panel(layout, this);\n\n // Store the Panel on the Plot\n this.panels[panel.id] = panel;\n\n // If a discrete y_index was set in the layout then adjust other panel y_index values to accommodate this one\n if (panel.layout.y_index !== null && !isNaN(panel.layout.y_index)\n && this.panel_ids_by_y_index.length > 0){\n // Negative y_index values should count backwards from the end, so convert negatives to appropriate values here\n if (panel.layout.y_index < 0){\n panel.layout.y_index = Math.max(this.panel_ids_by_y_index.length + panel.layout.y_index, 0);\n }\n this.panel_ids_by_y_index.splice(panel.layout.y_index, 0, panel.id);\n this.applyPanelYIndexesToPanelLayouts();\n } else {\n var length = this.panel_ids_by_y_index.push(panel.id);\n this.panels[panel.id].layout.y_index = length - 1;\n }\n\n // Determine if this panel was already in the layout.panels array.\n // If it wasn't, add it. Either way store the layout.panels array index on the panel.\n var layout_idx = null;\n this.layout.panels.forEach(function(panel_layout, idx){\n if (panel_layout.id === panel.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.panels.push(this.panels[panel.id].layout) - 1;\n }\n this.panels[panel.id].layout_idx = layout_idx;\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n this.positionPanels();\n // Initialize and load data into the new panel\n this.panels[panel.id].initialize();\n this.panels[panel.id].reMap();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this.panels[panel.id];\n};\n\n\n/**\n * Clear all state, tooltips, and other persisted data associated with one (or all) panel(s) in the plot\n *\n * This is useful when reloading an existing plot with new data, eg \"click for genome region\" links.\n * This is a utility method for custom usage. It is not fired automatically during normal rerender of existing panels\n * @param {String} [panelId] If provided, clear state for only this panel. Otherwise, clear state for all panels.\n * @param {('wipe'|'reset')} [mode='wipe'] Optionally specify how state should be cleared. `wipe` deletes all data\n * and is useful for when the panel is being removed; `reset` is best when the panel will be reused in place.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.clearPanelData = function(panelId, mode) {\n mode = mode || \"wipe\";\n\n // TODO: Add unit tests for this method\n var panelsList;\n if (panelId) {\n panelsList = [panelId];\n } else {\n panelsList = Object.keys(this.panels);\n }\n var self = this;\n panelsList.forEach(function(pid) {\n self.panels[pid].data_layer_ids_by_z_index.forEach(function(dlid){\n var layer = self.panels[pid].data_layers[dlid];\n layer.destroyAllTooltips();\n\n delete self.layout.state[pid + \".\" + dlid];\n if(mode === \"reset\") {\n layer.setDefaultState();\n }\n });\n });\n return this;\n};\n\n/**\n * Remove the panel from the plot, and clear any state, tooltips, or other visual elements belonging to nested content\n * @param {String} id\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.removePanel = function(id){\n if (!this.panels[id]){\n throw (\"Unable to remove panel, ID not found: \" + id);\n }\n\n // Hide all panel boundaries\n this.panel_boundaries.hide();\n\n // Destroy all tooltips and state vars for all data layers on the panel\n this.clearPanelData(id);\n\n // Remove all panel-level HTML overlay elements\n this.panels[id].loader.hide();\n this.panels[id].dashboard.destroy(true);\n this.panels[id].curtain.hide();\n\n // Remove the svg container for the panel if it exists\n if (this.panels[id].svg.container){\n this.panels[id].svg.container.remove();\n }\n\n // Delete the panel and its presence in the plot layout and state\n this.layout.panels.splice(this.panels[id].layout_idx, 1);\n delete this.panels[id];\n delete this.layout.state[id];\n\n // Update layout_idx values for all remaining panels\n this.layout.panels.forEach(function(panel_layout, idx){\n this.panels[panel_layout.id].layout_idx = idx;\n }.bind(this));\n\n // Remove the panel id from the y_index array\n this.panel_ids_by_y_index.splice(this.panel_ids_by_y_index.indexOf(id), 1);\n this.applyPanelYIndexesToPanelLayouts();\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n // Allow the plot to shrink when panels are removed, by forcing it to recalculate min dimensions from scratch\n this.layout.min_height = this._base_layout.min_height;\n this.layout.min_width = this._base_layout.min_width;\n\n this.positionPanels();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this;\n};\n\n\n/**\n * Automatically position panels based on panel positioning rules and values.\n * Keep panels from overlapping vertically by adjusting origins, and keep the sum of proportional heights at 1.\n *\n * TODO: This logic currently only supports dynamic positioning of panels to prevent overlap in a VERTICAL orientation.\n * Some framework exists for positioning panels in horizontal orientations as well (width, proportional_width, origin.x, etc.)\n * but the logic for keeping these user-definable values straight approaches the complexity of a 2D box-packing algorithm.\n * That's complexity we don't need right now, and may not ever need, so it's on hiatus until a use case materializes.\n */\nLocusZoom.Plot.prototype.positionPanels = function(){\n\n var id;\n\n // We want to enforce that all x-linked panels have consistent horizontal margins\n // (to ensure that aligned items stay aligned despite inconsistent initial layout parameters)\n // NOTE: This assumes panels have consistent widths already. That should probably be enforced too!\n var x_linked_margins = { left: 0, right: 0 };\n\n // Proportional heights for newly added panels default to null unless explicitly set, so determine appropriate\n // proportional heights for all panels with a null value from discretely set dimensions.\n // Likewise handle default nulls for proportional widths, but instead just force a value of 1 (full width)\n for (id in this.panels){\n if (this.panels[id].layout.proportional_height === null){\n this.panels[id].layout.proportional_height = this.panels[id].layout.height / this.layout.height;\n }\n if (this.panels[id].layout.proportional_width === null){\n this.panels[id].layout.proportional_width = 1;\n }\n if (this.panels[id].layout.interaction.x_linked){\n x_linked_margins.left = Math.max(x_linked_margins.left, this.panels[id].layout.margin.left);\n x_linked_margins.right = Math.max(x_linked_margins.right, this.panels[id].layout.margin.right);\n }\n }\n\n // Sum the proportional heights and then adjust all proportionally so that the sum is exactly 1\n var total_proportional_height = this.sumProportional(\"height\");\n if (!total_proportional_height){\n return this;\n }\n var proportional_adjustment = 1 / total_proportional_height;\n for (id in this.panels){\n this.panels[id].layout.proportional_height *= proportional_adjustment;\n }\n\n // Update origins on all panels without changing plot-level dimensions yet\n // Also apply x-linked margins to x-linked panels, updating widths as needed\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n y_offset += this.panels[panel_id].layout.height;\n if (this.panels[panel_id].layout.interaction.x_linked){\n var delta = Math.max(x_linked_margins.left - this.panels[panel_id].layout.margin.left, 0)\n + Math.max(x_linked_margins.right - this.panels[panel_id].layout.margin.right, 0);\n this.panels[panel_id].layout.width += delta;\n this.panels[panel_id].layout.margin.left = x_linked_margins.left;\n this.panels[panel_id].layout.margin.right = x_linked_margins.right;\n this.panels[panel_id].layout.cliparea.origin.x = x_linked_margins.left;\n }\n }.bind(this));\n var calculated_plot_height = y_offset;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].layout.proportional_origin.y = this.panels[panel_id].layout.origin.y / calculated_plot_height;\n }.bind(this));\n\n // Update dimensions on the plot to accommodate repositioned panels\n this.setDimensions();\n\n // Set dimensions on all panels using newly set plot-level dimensions and panel-level proportional dimensions\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setDimensions(this.layout.width * this.panels[panel_id].layout.proportional_width,\n this.layout.height * this.panels[panel_id].layout.proportional_height);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Prepare the first rendering of the plot. This includes initializing the individual panels, but also creates shared\n * elements such as mouse events, panel guides/boundaries, and loader/curtain.\n *\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initialize = function(){\n\n // Ensure proper responsive class is present on the containing node if called for\n if (this.layout.responsive_resize){\n d3.select(this.container).classed(\"lz-container-responsive\", true);\n }\n\n // Create an element/layer for containing mouse guides\n if (this.layout.mouse_guide) {\n var mouse_guide_svg = this.svg.append(\"g\")\n .attr(\"class\", \"lz-mouse_guide\").attr(\"id\", this.id + \".mouse_guide\");\n var mouse_guide_vertical_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-vertical\").attr(\"x\",-1);\n var mouse_guide_horizontal_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-horizontal\").attr(\"y\",-1);\n this.mouse_guide = {\n svg: mouse_guide_svg,\n vertical: mouse_guide_vertical_svg,\n horizontal: mouse_guide_horizontal_svg\n };\n }\n\n // Add curtain and loader prototpyes to the plot\n this.curtain = LocusZoom.generateCurtain.call(this);\n this.loader = LocusZoom.generateLoader.call(this);\n\n // Create the panel_boundaries object with show/position/hide methods\n this.panel_boundaries = {\n parent: this,\n hide_timeout: null,\n showing: false,\n dragging: false,\n selectors: [],\n corner_selector: null,\n show: function(){\n // Generate panel boundaries\n if (!this.showing && !this.parent.curtain.showing){\n this.showing = true;\n // Loop through all panels to create a horizontal boundary for each\n this.parent.panel_ids_by_y_index.forEach(function(panel_id, panel_idx){\n var selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-boundary\")\n .attr(\"title\", \"Resize panel\");\n selector.append(\"span\");\n var panel_resize_drag = d3.behavior.drag();\n panel_resize_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n panel_resize_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n panel_resize_drag.on(\"drag\", function(){\n // First set the dimensions on the panel we're resizing\n var this_panel = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]];\n var original_panel_height = this_panel.layout.height;\n this_panel.setDimensions(this_panel.layout.width, this_panel.layout.height + d3.event.dy);\n var panel_height_change = this_panel.layout.height - original_panel_height;\n var new_calculated_plot_height = this.parent.layout.height + panel_height_change;\n // Next loop through all panels.\n // Update proportional dimensions for all panels including the one we've resized using discrete heights.\n // Reposition panels with a greater y-index than this panel to their appropriate new origin.\n this.parent.panel_ids_by_y_index.forEach(function(loop_panel_id, loop_panel_idx){\n var loop_panel = this.parent.panels[this.parent.panel_ids_by_y_index[loop_panel_idx]];\n loop_panel.layout.proportional_height = loop_panel.layout.height / new_calculated_plot_height;\n if (loop_panel_idx > panel_idx){\n loop_panel.setOrigin(loop_panel.layout.origin.x, loop_panel.layout.origin.y + panel_height_change);\n loop_panel.dashboard.position();\n }\n }.bind(this));\n // Reset dimensions on the entire plot and reposition panel boundaries\n this.parent.positionPanels();\n this.position();\n }.bind(this));\n selector.call(panel_resize_drag);\n this.parent.panel_boundaries.selectors.push(selector);\n }.bind(this));\n // Create a corner boundary / resize element on the bottom-most panel that resizes the entire plot\n var corner_selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-corner-boundary\")\n .attr(\"title\", \"Resize plot\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-outer\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-inner\");\n var corner_drag = d3.behavior.drag();\n corner_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n corner_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n corner_drag.on(\"drag\", function(){\n this.setDimensions(this.layout.width + d3.event.dx, this.layout.height + d3.event.dy);\n }.bind(this.parent));\n corner_selector.call(corner_drag);\n this.parent.panel_boundaries.corner_selector = corner_selector;\n }\n return this.position();\n },\n position: function(){\n if (!this.showing){ return this; }\n // Position panel boundaries\n var plot_page_origin = this.parent.getPageOrigin();\n this.selectors.forEach(function(selector, panel_idx){\n var panel_page_origin = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].getPageOrigin();\n var left = plot_page_origin.x;\n var top = panel_page_origin.y + this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].layout.height - 12;\n var width = this.parent.layout.width - 1;\n selector.style({\n top: top + \"px\",\n left: left + \"px\",\n width: width + \"px\"\n });\n selector.select(\"span\").style({\n width: width + \"px\"\n });\n }.bind(this));\n // Position corner selector\n var corner_padding = 10;\n var corner_size = 16;\n this.corner_selector.style({\n top: (plot_page_origin.y + this.parent.layout.height - corner_padding - corner_size) + \"px\",\n left: (plot_page_origin.x + this.parent.layout.width - corner_padding - corner_size) + \"px\"\n });\n return this;\n },\n hide: function(){\n if (!this.showing){ return this; }\n this.showing = false;\n // Remove panel boundaries\n this.selectors.forEach(function(selector){ selector.remove(); });\n this.selectors = [];\n // Remove corner boundary\n this.corner_selector.remove();\n this.corner_selector = null;\n return this;\n }\n };\n\n // Show panel boundaries stipulated by the layout (basic toggle, only show on mouse over plot)\n if (this.layout.panel_boundaries){\n d3.select(this.svg.node().parentNode).on(\"mouseover.\" + this.id + \".panel_boundaries\", function(){\n clearTimeout(this.panel_boundaries.hide_timeout);\n this.panel_boundaries.show();\n }.bind(this));\n d3.select(this.svg.node().parentNode).on(\"mouseout.\" + this.id + \".panel_boundaries\", function(){\n this.panel_boundaries.hide_timeout = setTimeout(function(){\n this.panel_boundaries.hide();\n }.bind(this), 300);\n }.bind(this));\n }\n\n // Create the dashboard object and immediately show it\n this.dashboard = new LocusZoom.Dashboard(this).show();\n\n // Initialize all panels\n for (var id in this.panels){\n this.panels[id].initialize();\n }\n\n // Define plot-level mouse events\n var namespace = \".\" + this.id;\n if (this.layout.mouse_guide) {\n var mouseout_mouse_guide = function(){\n this.mouse_guide.vertical.attr(\"x\", -1);\n this.mouse_guide.horizontal.attr(\"y\", -1);\n }.bind(this);\n var mousemove_mouse_guide = function(){\n var coords = d3.mouse(this.svg.node());\n this.mouse_guide.vertical.attr(\"x\", coords[0]);\n this.mouse_guide.horizontal.attr(\"y\", coords[1]);\n }.bind(this);\n this.svg\n .on(\"mouseout\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"touchleave\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"mousemove\" + namespace + \"-mouse_guide\", mousemove_mouse_guide);\n }\n var mouseup = function(){\n this.stopDrag();\n }.bind(this);\n var mousemove = function(){\n if (this.interaction.dragging){\n var coords = d3.mouse(this.svg.node());\n if (d3.event){ d3.event.preventDefault(); }\n this.interaction.dragging.dragged_x = coords[0] - this.interaction.dragging.start_x;\n this.interaction.dragging.dragged_y = coords[1] - this.interaction.dragging.start_y;\n this.panels[this.interaction.panel_id].render();\n this.interaction.linked_panel_ids.forEach(function(panel_id){\n this.panels[panel_id].render();\n }.bind(this));\n }\n }.bind(this);\n this.svg\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup)\n .on(\"mousemove\" + namespace, mousemove)\n .on(\"touchmove\" + namespace, mousemove);\n\n // Add an extra namespaced mouseup handler to the containing body, if there is one\n // This helps to stop interaction events gracefully when dragging outside of the plot element\n if (!d3.select(\"body\").empty()){\n d3.select(\"body\")\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup);\n }\n\n this.initialized = true;\n\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n var client_rect = this.svg.node().getBoundingClientRect();\n var width = client_rect.width ? client_rect.width : this.layout.width;\n var height = client_rect.height ? client_rect.height : this.layout.height;\n this.setDimensions(width, height);\n\n return this;\n\n};\n\n/**\n * Refresh (or fetch) a plot's data from sources, regardless of whether position or state has changed\n * @returns {Promise}\n */\nLocusZoom.Plot.prototype.refresh = function(){\n return this.applyState();\n};\n\n/**\n * Update state values and trigger a pull for fresh data on all data sources for all data layers\n * @param state_changes\n * @returns {Promise} A promise that resolves when all data fetch and update operations are complete\n */\nLocusZoom.Plot.prototype.applyState = function(state_changes){\n\n state_changes = state_changes || {};\n if (typeof state_changes != \"object\"){\n throw(\"LocusZoom.applyState only accepts an object; \" + (typeof state_changes) + \" given\");\n }\n\n // First make a copy of the current (old) state to work with\n var new_state = JSON.parse(JSON.stringify(this.state));\n\n // Apply changes by top-level property to the new state\n for (var property in state_changes) {\n new_state[property] = state_changes[property];\n }\n\n // Validate the new state (may do nothing, may do a lot, depends on how the user has things set up)\n new_state = LocusZoom.validateState(new_state, this.layout);\n\n // Apply new state to the actual state\n for (property in new_state) {\n this.state[property] = new_state[property];\n }\n\n // Generate requests for all panels given new state\n this.emit(\"data_requested\");\n this.remap_promises = [];\n this.loading_data = true;\n for (var id in this.panels){\n this.remap_promises.push(this.panels[id].reMap());\n }\n\n return Q.all(this.remap_promises)\n .catch(function(error){\n console.error(error);\n this.curtain.drop(error);\n this.loading_data = false;\n }.bind(this))\n .then(function(){\n // TODO: Check logic here; in some promise implementations, this would cause the error to be considered handled, and \"then\" would always fire. (may or may not be desired behavior)\n // Update dashboard / components\n this.dashboard.update();\n\n // Apply panel-level state values\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel = this.panels[panel_id];\n panel.dashboard.update();\n // Apply data-layer-level state values\n panel.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n var data_layer = this.data_layers[data_layer_id];\n var state_id = panel_id + \".\" + data_layer_id;\n for (var property in this.state[state_id]){\n if (!this.state[state_id].hasOwnProperty(property)){ continue; }\n if (Array.isArray(this.state[state_id][property])){\n this.state[state_id][property].forEach(function(element_id){\n try {\n this.setElementStatus(property, this.getElementById(element_id), true);\n } catch (e){\n console.error(\"Unable to apply state: \" + state_id + \", \" + property);\n }\n }.bind(data_layer));\n }\n }\n }.bind(panel));\n }.bind(this));\n\n // Emit events\n this.emit(\"layout_changed\");\n this.emit(\"data_rendered\");\n\n this.loading_data = false;\n\n }.bind(this));\n};\n\n/**\n * Register interactions along the specified axis, provided that the target panel allows interaction.\n *\n * @param {LocusZoom.Panel} panel\n * @param {('x_tick'|'y1_tick'|'y2_tick')} method The direction (axis) along which dragging is being performed.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.startDrag = function(panel, method){\n\n panel = panel || null;\n method = method || null;\n\n var axis = null;\n switch (method){\n case \"background\":\n case \"x_tick\":\n axis = \"x\";\n break;\n case \"y1_tick\":\n axis = \"y1\";\n break;\n case \"y2_tick\":\n axis = \"y2\";\n break;\n }\n\n if (!(panel instanceof LocusZoom.Panel) || !axis || !this.canInteract()){ return this.stopDrag(); }\n\n var coords = d3.mouse(this.svg.node());\n this.interaction = {\n panel_id: panel.id,\n linked_panel_ids: panel.getLinkedPanelIds(axis),\n dragging: {\n method: method,\n start_x: coords[0],\n start_y: coords[1],\n dragged_x: 0,\n dragged_y: 0,\n axis: axis\n }\n };\n\n this.svg.style(\"cursor\", \"all-scroll\");\n\n return this;\n\n};\n\n/**\n * Process drag interactions across the target panel and synchronize plot state across other panels in sync;\n * clear the event when complete\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.stopDrag = function(){\n\n if (!this.interaction.dragging){ return this; }\n\n if (typeof this.panels[this.interaction.panel_id] != \"object\"){\n this.interaction = {};\n return this;\n }\n var panel = this.panels[this.interaction.panel_id];\n\n // Helper function to find the appropriate axis layouts on child data layers\n // Once found, apply the extent as floor/ceiling and remove all other directives\n // This forces all associated axes to conform to the extent generated by a drag action\n var overrideAxisLayout = function(axis, axis_number, extent){\n panel.data_layer_ids_by_z_index.forEach(function(id){\n if (panel.data_layers[id].layout[axis+\"_axis\"].axis === axis_number){\n panel.data_layers[id].layout[axis+\"_axis\"].floor = extent[0];\n panel.data_layers[id].layout[axis+\"_axis\"].ceiling = extent[1];\n delete panel.data_layers[id].layout[axis+\"_axis\"].lower_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].upper_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].min_extent;\n delete panel.data_layers[id].layout[axis+\"_axis\"].ticks;\n }\n });\n };\n\n switch(this.interaction.dragging.method){\n case \"background\":\n case \"x_tick\":\n if (this.interaction.dragging.dragged_x !== 0){\n overrideAxisLayout(\"x\", 1, panel.x_extent);\n this.applyState({ start: panel.x_extent[0], end: panel.x_extent[1] });\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n if (this.interaction.dragging.dragged_y !== 0){\n // TODO: Hardcoded assumption of only two possible axes with single-digit #s (switch/case)\n var y_axis_number = parseInt(this.interaction.dragging.method[1]);\n overrideAxisLayout(\"y\", y_axis_number, panel[\"y\"+y_axis_number+\"_extent\"]);\n }\n break;\n }\n\n this.interaction = {};\n this.svg.style(\"cursor\", null);\n\n return this;\n\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A panel is an abstract class representing a subdivision of the LocusZoom stage\n * to display a distinct data representation as a collection of data layers.\n * @class\n * @param {Object} layout\n * @param {LocusZoom.Plot|null} parent\n*/\nLocusZoom.Panel = function(layout, parent) {\n\n if (typeof layout !== \"object\"){\n throw \"Unable to create panel, invalid layout\";\n }\n\n /** @member {LocusZoom.Plot|null} */\n this.parent = parent || null;\n /** @member {LocusZoom.Plot|null} */\n this.parent_plot = parent;\n\n // Ensure a valid ID is present. If there is no valid ID then generate one\n if (typeof layout.id !== \"string\" || !layout.id.length){\n if (!this.parent){\n layout.id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n } else {\n var id = null;\n var generateID = function(){\n id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n if (id == null || typeof this.parent.panels[id] != \"undefined\"){\n id = generateID();\n }\n }.bind(this);\n layout.id = id;\n }\n } else if (this.parent) {\n if (typeof this.parent.panels[layout.id] !== \"undefined\"){\n throw \"Cannot create panel with id [\" + layout.id + \"]; panel with that id already exists\";\n }\n }\n /** @member {String} */\n this.id = layout.id;\n\n /** @member {Boolean} */\n this.initialized = false;\n /**\n * The index of this panel in the parent plot's `layout.panels`\n * @member {number}\n * */\n this.layout_idx = null;\n /** @member {Object} */\n this.svg = {};\n\n /**\n * A JSON-serializable object used to describe the composition of the Panel\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.Panel.DefaultLayout);\n\n // Define state parameters specific to this panel\n if (this.parent){\n /** @member {Object} */\n this.state = this.parent.state;\n\n /** @member {String} */\n this.state_id = this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n } else {\n this.state = null;\n this.state_id = null;\n }\n\n /** @member {Object} */\n this.data_layers = {};\n /** @member {String[]} */\n this.data_layer_ids_by_z_index = [];\n\n /** @protected */\n this.applyDataLayerZIndexesToDataLayerLayouts = function(){\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n }.bind(this);\n\n /**\n * Track data requests in progress\n * @member {Promise[]}\n * @protected\n */\n this.data_promises = [];\n\n /** @member {d3.scale} */\n this.x_scale = null;\n /** @member {d3.scale} */\n this.y1_scale = null;\n /** @member {d3.scale} */\n this.y2_scale = null;\n\n /** @member {d3.extent} */\n this.x_extent = null;\n /** @member {d3.extent} */\n this.y1_extent = null;\n /** @member {d3.extent} */\n this.y2_extent = null;\n\n /** @member {Number[]} */\n this.x_ticks = [];\n /** @member {Number[]} */\n this.y1_ticks = [];\n /** @member {Number[]} */\n this.y2_ticks = [];\n\n /**\n * A timeout ID as returned by setTimeout\n * @protected\n * @member {number}\n */\n this.zoom_timeout = null;\n\n /** @returns {string} */\n this.getBaseId = function(){\n return this.parent.id + \".\" + this.id;\n };\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": []\n };\n /**\n * There are several events that a LocusZoom panel can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following panel-level events are currently supported:\n * - `layout_changed` - context: panel - Any aspect of the panel's layout (including dimensions or state) has changed.\n * - `data_requested` - context: panel - A request for new data from any data source used in the panel has been made.\n * - `data_rendered` - context: panel - Data from a request has been received and rendered in the panel.\n * - `element_clicked` - context: element - A data element in any of the panel's data layers has been clicked.\n *\n * To register a hook for any of these events use `panel.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * panel itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event\n * @param {function} hook\n * @returns {LocusZoom.Panel}\n */\n this.on = function(event, hook){\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n * @protected\n * @param {string} event A known event name\n * @param {*} context Controls function execution context (value of `this` for the hook to be fired)\n * @returns {LocusZoom.Panel}\n */\n this.emit = function(event, context){\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n context = context || this;\n this.event_hooks[event].forEach(function(hookToRun) {\n hookToRun.call(context);\n });\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\n this.getPageOrigin = function(){\n var plot_origin = this.parent.getPageOrigin();\n return {\n x: plot_origin.x + this.layout.origin.x,\n y: plot_origin.y + this.layout.origin.y\n };\n };\n\n // Initialize the layout\n this.initializeLayout();\n\n return this;\n\n};\n\n/**\n * Default panel layout\n * @static\n * @type {Object}\n */\nLocusZoom.Panel.DefaultLayout = {\n title: { text: \"\", style: {}, x: 10, y: 22 },\n y_index: null,\n width: 0,\n height: 0,\n origin: { x: 0, y: null },\n min_width: 1,\n min_height: 1,\n proportional_width: null,\n proportional_height: null,\n proportional_origin: { x: 0, y: null },\n margin: { top: 0, right: 0, bottom: 0, left: 0 },\n background_click: \"clear_selections\",\n dashboard: {\n components: []\n },\n cliparea: {\n height: 0,\n width: 0,\n origin: { x: 0, y: 0 }\n },\n axes: { // These are the only axes supported!!\n x: {},\n y1: {},\n y2: {}\n },\n legend: null,\n interaction: {\n drag_background_to_pan: false,\n drag_x_ticks_to_scale: false,\n drag_y1_ticks_to_scale: false,\n drag_y2_ticks_to_scale: false,\n scroll_to_zoom: false,\n x_linked: false,\n y1_linked: false,\n y2_linked: false\n },\n data_layers: []\n};\n\n/**\n * Prepare the panel for first use by performing parameter validation, creating axes, setting default dimensions,\n * and preparing / positioning data layers as appropriate.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initializeLayout = function(){\n\n // If the layout is missing BOTH width and proportional width then set the proportional width to 1.\n // This will default the panel to taking up the full width of the plot.\n if (this.layout.width === 0 && this.layout.proportional_width === null){\n this.layout.proportional_width = 1;\n }\n\n // If the layout is missing BOTH height and proportional height then set the proportional height to\n // an equal share of the plot's current height.\n if (this.layout.height === 0 && this.layout.proportional_height === null){\n var panel_count = Object.keys(this.parent.panels).length;\n if (panel_count > 0){\n this.layout.proportional_height = (1 / panel_count);\n } else {\n this.layout.proportional_height = 1;\n }\n }\n\n // Set panel dimensions, origin, and margin\n this.setDimensions();\n this.setOrigin();\n this.setMargin();\n\n // Set ranges\n // TODO: Define stub values in constructor\n this.x_range = [0, this.layout.cliparea.width];\n this.y1_range = [this.layout.cliparea.height, 0];\n this.y2_range = [this.layout.cliparea.height, 0];\n\n // Initialize panel axes\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!Object.keys(this.layout.axes[axis]).length || this.layout.axes[axis].render ===false){\n // The default layout sets the axis to an empty object, so set its render boolean here\n this.layout.axes[axis].render = false;\n } else {\n this.layout.axes[axis].render = true;\n this.layout.axes[axis].label = this.layout.axes[axis].label || null;\n this.layout.axes[axis].label_function = this.layout.axes[axis].label_function || null;\n }\n }.bind(this));\n\n // Add data layers (which define x and y extents)\n this.layout.data_layers.forEach(function(data_layer_layout){\n this.addDataLayer(data_layer_layout);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Set the dimensions for the panel. If passed with no arguments will calculate optimal size based on layout\n * directives and the available area within the plot. If passed discrete width (number) and height (number) will\n * attempt to resize the panel to them, but may be limited by minimum dimensions defined on the plot or panel.\n *\n * @public\n * @param {number} [width]\n * @param {number} [height]\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setDimensions = function(width, height){\n if (typeof width != \"undefined\" && typeof height != \"undefined\"){\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n }\n } else {\n if (this.layout.proportional_width !== null){\n this.layout.width = Math.max(this.layout.proportional_width * this.parent.layout.width, this.layout.min_width);\n }\n if (this.layout.proportional_height !== null){\n this.layout.height = Math.max(this.layout.proportional_height * this.parent.layout.height, this.layout.min_height);\n }\n }\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n if (this.svg.clipRect){\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n if (this.initialized){\n this.render();\n this.curtain.update();\n this.loader.update();\n this.dashboard.update();\n if (this.legend){ this.legend.position(); }\n }\n return this;\n};\n\n/**\n * Set panel origin on the plot, and re-render as appropriate\n *\n * @public\n * @param {number} x\n * @param {number} y\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setOrigin = function(x, y){\n if (!isNaN(x) && x >= 0){ this.layout.origin.x = Math.max(Math.round(+x), 0); }\n if (!isNaN(y) && y >= 0){ this.layout.origin.y = Math.max(Math.round(+y), 0); }\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set margins around this panel\n * @public\n * @param {number} top\n * @param {number} right\n * @param {number} bottom\n * @param {number} left\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setMargin = function(top, right, bottom, left){\n var extra;\n if (!isNaN(top) && top >= 0){ this.layout.margin.top = Math.max(Math.round(+top), 0); }\n if (!isNaN(right) && right >= 0){ this.layout.margin.right = Math.max(Math.round(+right), 0); }\n if (!isNaN(bottom) && bottom >= 0){ this.layout.margin.bottom = Math.max(Math.round(+bottom), 0); }\n if (!isNaN(left) && left >= 0){ this.layout.margin.left = Math.max(Math.round(+left), 0); }\n if (this.layout.margin.top + this.layout.margin.bottom > this.layout.height){\n extra = Math.floor(((this.layout.margin.top + this.layout.margin.bottom) - this.layout.height) / 2);\n this.layout.margin.top -= extra;\n this.layout.margin.bottom -= extra;\n }\n if (this.layout.margin.left + this.layout.margin.right > this.layout.width){\n extra = Math.floor(((this.layout.margin.left + this.layout.margin.right) - this.layout.width) / 2);\n this.layout.margin.left -= extra;\n this.layout.margin.right -= extra;\n }\n [\"top\", \"right\", \"bottom\", \"left\"].forEach(function(m){\n this.layout.margin[m] = Math.max(this.layout.margin[m], 0);\n }.bind(this));\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n this.layout.cliparea.origin.x = this.layout.margin.left;\n this.layout.cliparea.origin.y = this.layout.margin.top;\n\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set the title for the panel. If passed an object, will merge the object with the existing layout configuration, so\n * that all or only some of the title layout object's parameters can be customized. If passed null, false, or an empty\n * string, the title DOM element will be set to display: none.\n *\n * @param {string|object|null} title The title text, or an object with additional configuration\n * @param {string} title.text Text to display. Since titles are rendered as SVG text, HTML and newlines will not be rendered.\n * @param {number} title.x X-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n * @param {number} title.y Y-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n NOTE: SVG y values go from the top down, so the SVG origin of (0,0) is in the top left corner.\n * @param {object} title.style CSS styles object to be applied to the title's DOM element.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setTitle = function(title){\n if (typeof this.layout.title == \"string\"){\n var text = this.layout.title;\n this.layout.title = { text: text, x: 0, y: 0, style: {} };\n }\n if (typeof title == \"string\"){\n this.layout.title.text = title;\n } else if (typeof title == \"object\" && title !== null){\n this.layout.title = LocusZoom.Layouts.merge(title, this.layout.title);\n }\n if (this.layout.title.text.length){\n this.title.attr(\"display\", null)\n .attr(\"x\", parseFloat(this.layout.title.x))\n .attr(\"y\", parseFloat(this.layout.title.y))\n .style(this.layout.title.style)\n .text(this.layout.title.text);\n } else {\n this.title.attr(\"display\", \"none\");\n }\n return this;\n};\n\n\n/**\n * Prepare the first rendering of the panel. This includes drawing the individual data layers, but also creates shared\n * elements such as axes, title, and loader/curtain.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initialize = function(){\n\n // Append a container group element to house the main panel group element and the clip path\n // Position with initial layout parameters\n this.svg.container = this.parent.svg.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel_container\")\n .attr(\"transform\", \"translate(\" + (this.layout.origin.x || 0) + \",\" + (this.layout.origin.y || 0) + \")\");\n\n // Append clip path to the parent svg element, size with initial layout parameters\n var clipPath = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\");\n this.svg.clipRect = clipPath.append(\"rect\")\n .attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Append svg group for rendering all panel child elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n // Add curtain and loader prototypes to the panel\n /** @member {Object} */\n this.curtain = LocusZoom.generateCurtain.call(this);\n /** @member {Object} */\n this.loader = LocusZoom.generateLoader.call(this);\n\n /**\n * Create the dashboard object and hang components on it as defined by panel layout\n * @member {LocusZoom.Dashboard}\n */\n this.dashboard = new LocusZoom.Dashboard(this);\n\n // Inner border\n this.inner_border = this.svg.group.append(\"rect\")\n .attr(\"class\", \"lz-panel-background\")\n .on(\"click\", function(){\n if (this.layout.background_click === \"clear_selections\"){ this.clearSelections(); }\n }.bind(this));\n\n // Add the title\n /** @member {Element} */\n this.title = this.svg.group.append(\"text\").attr(\"class\", \"lz-panel-title\");\n if (typeof this.layout.title != \"undefined\"){ this.setTitle(); }\n\n // Initialize Axes\n this.svg.x_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".x_axis\").attr(\"class\", \"lz-x lz-axis\");\n if (this.layout.axes.x.render){\n this.svg.x_axis_label = this.svg.x_axis.append(\"text\")\n .attr(\"class\", \"lz-x lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y1_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y1_axis\").attr(\"class\", \"lz-y lz-y1 lz-axis\");\n if (this.layout.axes.y1.render){\n this.svg.y1_axis_label = this.svg.y1_axis.append(\"text\")\n .attr(\"class\", \"lz-y1 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y2_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y2_axis\").attr(\"class\", \"lz-y lz-y2 lz-axis\");\n if (this.layout.axes.y2.render){\n this.svg.y2_axis_label = this.svg.y2_axis.append(\"text\")\n .attr(\"class\", \"lz-y2 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n\n // Initialize child Data Layers\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].initialize();\n }.bind(this));\n\n /**\n * Legend object, as defined by panel layout and child data layer layouts\n * @member {LocusZoom.Legend}\n * */\n this.legend = null;\n if (this.layout.legend){\n this.legend = new LocusZoom.Legend(this);\n }\n\n // Establish panel background drag interaction mousedown event handler (on the panel background)\n if (this.layout.interaction.drag_background_to_pan){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var mousedown = function(){\n this.parent.startDrag(this, \"background\");\n }.bind(this);\n this.svg.container.select(\".lz-panel-background\")\n .on(\"mousedown\" + namespace + \".background\", mousedown)\n .on(\"touchstart\" + namespace + \".background\", mousedown);\n }\n\n return this;\n\n};\n\n/**\n * Refresh the sort order of all data layers (called by data layer moveUp and moveDown methods)\n */\nLocusZoom.Panel.prototype.resortDataLayers = function(){\n var sort = [];\n this.data_layer_ids_by_z_index.forEach(function(id){\n sort.push(this.data_layers[id].layout.z_index);\n }.bind(this));\n this.svg.group.selectAll(\"g.lz-data_layer-container\").data(sort).sort(d3.ascending);\n this.applyDataLayerZIndexesToDataLayerLayouts();\n};\n\n/**\n * Get an array of panel IDs that are axis-linked to this panel\n * @param {('x'|'y1'|'y2')} axis\n * @returns {Array}\n */\nLocusZoom.Panel.prototype.getLinkedPanelIds = function(axis){\n axis = axis || null;\n var linked_panel_ids = [];\n if ([\"x\",\"y1\",\"y2\"].indexOf(axis) === -1){ return linked_panel_ids; }\n if (!this.layout.interaction[axis + \"_linked\"]){ return linked_panel_ids; }\n this.parent.panel_ids_by_y_index.forEach(function(panel_id){\n if (panel_id !== this.id && this.parent.panels[panel_id].layout.interaction[axis + \"_linked\"]){\n linked_panel_ids.push(panel_id);\n }\n }.bind(this));\n return linked_panel_ids;\n};\n\n/**\n * Move a panel up relative to others by y-index\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveUp = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index - 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index - 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index - 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Move a panel down (y-axis) relative to others in the plot\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveDown = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index + 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index + 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index + 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Create a new data layer from a provided layout object. Should have the keys specified in `DefaultLayout`\n * Will automatically add at the top (depth/z-index) of the panel unless explicitly directed differently\n * in the layout provided.\n * @param {object} layout\n * @returns {*}\n */\nLocusZoom.Panel.prototype.addDataLayer = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\" || typeof layout.id !== \"string\" || !layout.id.length){\n throw \"Invalid data layer layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n if (typeof this.data_layers[layout.id] !== \"undefined\"){\n throw \"Cannot create data_layer with id [\" + layout.id + \"]; data layer with that id already exists in the panel\";\n }\n if (typeof layout.type !== \"string\"){\n throw \"Invalid data layer type in layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n\n // If the layout defines a y axis make sure the axis number is set and is 1 or 2 (default to 1)\n if (typeof layout.y_axis == \"object\" && (typeof layout.y_axis.axis == \"undefined\" || [1,2].indexOf(layout.y_axis.axis) === -1)){\n layout.y_axis.axis = 1;\n }\n\n // Create the Data Layer\n var data_layer = LocusZoom.DataLayers.get(layout.type, layout, this);\n\n // Store the Data Layer on the Panel\n this.data_layers[data_layer.id] = data_layer;\n\n // If a discrete z_index was set in the layout then adjust other data layer z_index values to accommodate this one\n if (data_layer.layout.z_index !== null && !isNaN(data_layer.layout.z_index)\n && this.data_layer_ids_by_z_index.length > 0){\n // Negative z_index values should count backwards from the end, so convert negatives to appropriate values here\n if (data_layer.layout.z_index < 0){\n data_layer.layout.z_index = Math.max(this.data_layer_ids_by_z_index.length + data_layer.layout.z_index, 0);\n }\n this.data_layer_ids_by_z_index.splice(data_layer.layout.z_index, 0, data_layer.id);\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n } else {\n var length = this.data_layer_ids_by_z_index.push(data_layer.id);\n this.data_layers[data_layer.id].layout.z_index = length - 1;\n }\n\n // Determine if this data layer was already in the layout.data_layers array.\n // If it wasn't, add it. Either way store the layout.data_layers array index on the data_layer.\n var layout_idx = null;\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n if (data_layer_layout.id === data_layer.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.data_layers.push(this.data_layers[data_layer.id].layout) - 1;\n }\n this.data_layers[data_layer.id].layout_idx = layout_idx;\n\n return this.data_layers[data_layer.id];\n};\n\n/**\n * Remove a data layer by id\n * @param {string} id\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.removeDataLayer = function(id){\n if (!this.data_layers[id]){\n throw (\"Unable to remove data layer, ID not found: \" + id);\n }\n\n // Destroy all tooltips for the data layer\n this.data_layers[id].destroyAllTooltips();\n\n // Remove the svg container for the data layer if it exists\n if (this.data_layers[id].svg.container){\n this.data_layers[id].svg.container.remove();\n }\n\n // Delete the data layer and its presence in the panel layout and state\n this.layout.data_layers.splice(this.data_layers[id].layout_idx, 1);\n delete this.state[this.data_layers[id].state_id];\n delete this.data_layers[id];\n\n // Remove the data_layer id from the z_index array\n this.data_layer_ids_by_z_index.splice(this.data_layer_ids_by_z_index.indexOf(id), 1);\n\n // Update layout_idx and layout.z_index values for all remaining data_layers\n this.applyDataLayerZIndexesToDataLayerLayouts();\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n this.data_layers[data_layer_layout.id].layout_idx = idx;\n }.bind(this));\n\n return this;\n};\n\n/**\n * Clear all selections on all data layers\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.clearSelections = function(){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(\"selected\", false);\n }.bind(this));\n return this;\n};\n\n/**\n * When the parent plot changes state, adjust the panel accordingly. For example, this may include fetching new data\n * from the API as the viewing region changes\n * @returns {Promise}\n */\nLocusZoom.Panel.prototype.reMap = function(){\n this.emit(\"data_requested\");\n this.data_promises = [];\n\n // Remove any previous error messages before attempting to load new data\n this.curtain.hide();\n // Trigger reMap on each Data Layer\n for (var id in this.data_layers){\n try {\n this.data_promises.push(this.data_layers[id].reMap());\n } catch (error) {\n console.warn(error);\n this.curtain.show(error);\n }\n }\n // When all finished trigger a render\n return Q.all(this.data_promises)\n .then(function(){\n this.initialized = true;\n this.render();\n this.emit(\"layout_changed\");\n this.parent.emit(\"layout_changed\");\n this.emit(\"data_rendered\");\n }.bind(this))\n .catch(function(error){\n console.warn(error);\n this.curtain.show(error);\n }.bind(this));\n};\n\n/**\n * Iterate over data layers to generate panel axis extents\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.generateExtents = function(){\n\n // Reset extents\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n this[axis + \"_extent\"] = null;\n }.bind(this));\n\n // Loop through the data layers\n for (var id in this.data_layers){\n\n var data_layer = this.data_layers[id];\n\n // If defined and not decoupled, merge the x extent of the data layer with the panel's x extent\n if (data_layer.layout.x_axis && !data_layer.layout.x_axis.decoupled){\n this.x_extent = d3.extent((this.x_extent || []).concat(data_layer.getAxisExtent(\"x\")));\n }\n\n // If defined and not decoupled, merge the y extent of the data layer with the panel's appropriate y extent\n if (data_layer.layout.y_axis && !data_layer.layout.y_axis.decoupled){\n var y_axis = \"y\" + data_layer.layout.y_axis.axis;\n this[y_axis+\"_extent\"] = d3.extent((this[y_axis+\"_extent\"] || []).concat(data_layer.getAxisExtent(\"y\")));\n }\n\n }\n\n // Override x_extent from state if explicitly defined to do so\n if (this.layout.axes.x && this.layout.axes.x.extent === \"state\"){\n this.x_extent = [ this.state.start, this.state.end ];\n }\n\n return this;\n\n};\n\n/**\n * Generate an array of ticks for an axis. These ticks are generated in one of three ways (highest wins):\n * 1. An array of specific tick marks\n * 2. Query each data layer for what ticks are appropriate, and allow a panel-level tick configuration parameter\n * object to override the layer's default presentation settings\n * 3. Generate generic tick marks based on the extent of the data\n * @param {('x'|'y1'|'y2')} axis The string identifier of the axis\n * @returns {Number[]|Object[]} TODO: number format?\n * An array of numbers: interpreted as an array of axis value offsets for positioning.\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.Panel.prototype.generateTicks = function(axis){\n\n // Parse an explicit 'ticks' attribute in the axis layout\n if (this.layout.axes[axis].ticks){\n var layout = this.layout.axes[axis];\n\n var baseTickConfig = layout.ticks;\n if (Array.isArray(baseTickConfig)){\n // Array of specific ticks hard-coded into a panel will override any ticks that an individual layer might specify\n return baseTickConfig;\n }\n\n if (typeof baseTickConfig === \"object\") {\n // If the layout specifies base configuration for ticks- but without specific positions- then ask each\n // data layer to report the tick marks that it thinks it needs\n // TODO: Few layers currently need to specify custom ticks (which is ok!). But if it becomes common, consider adding mechanisms to deduplicate ticks across layers\n var self = this;\n\n // Pass any layer-specific customizations for how ticks are calculated. (styles are overridden separately)\n var config = { position: baseTickConfig.position };\n\n var combinedTicks = this.data_layer_ids_by_z_index.reduce(function(acc, data_layer_id) {\n var nextLayer = self.data_layers[data_layer_id];\n return acc.concat(nextLayer.getTicks(axis, config));\n }, []);\n\n return combinedTicks.map(function(item) {\n // The layer makes suggestions, but tick configuration params specified on the panel take precedence\n var itemConfig = {};\n itemConfig = LocusZoom.Layouts.merge(itemConfig, baseTickConfig);\n return LocusZoom.Layouts.merge(itemConfig, item);\n });\n }\n }\n\n // If no other configuration is provided, attempt to generate ticks from the extent\n if (this[axis + \"_extent\"]) {\n return LocusZoom.prettyTicks(this[axis + \"_extent\"], \"both\");\n }\n return [];\n};\n\n/**\n * Update rendering of this panel whenever an event triggers a redraw. Assumes that the panel has already been\n * prepared the first time via `initialize`\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.render = function(){\n\n // Position the panel container\n this.svg.container.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n\n // Set size on the clip rect\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Set and position the inner border, style if necessary\n this.inner_border\n .attr(\"x\", this.layout.margin.left).attr(\"y\", this.layout.margin.top)\n .attr(\"width\", this.layout.width - (this.layout.margin.left + this.layout.margin.right))\n .attr(\"height\", this.layout.height - (this.layout.margin.top + this.layout.margin.bottom));\n if (this.layout.inner_border){\n this.inner_border.style({ \"stroke-width\": 1, \"stroke\": this.layout.inner_border });\n }\n\n // Set/update panel title if necessary\n this.setTitle();\n\n // Regenerate all extents\n this.generateExtents();\n\n // Helper function to constrain any procedurally generated vectors (e.g. ranges, extents)\n // Constraints applied here keep vectors from going to infinity or beyond a definable power of ten\n var constrain = function(value, limit_exponent){\n var neg_min = Math.pow(-10, limit_exponent);\n var neg_max = Math.pow(-10, -limit_exponent);\n var pos_min = Math.pow(10, -limit_exponent);\n var pos_max = Math.pow(10, limit_exponent);\n if (value === Infinity){ value = pos_max; }\n if (value === -Infinity){ value = neg_min; }\n if (value === 0){ value = pos_min; }\n if (value > 0){ value = Math.max(Math.min(value, pos_max), pos_min); }\n if (value < 0){ value = Math.max(Math.min(value, neg_max), neg_min); }\n return value;\n };\n\n // Define default and shifted ranges for all axes\n var ranges = {};\n if (this.x_extent){\n var base_x_range = { start: 0, end: this.layout.cliparea.width };\n if (this.layout.axes.x.range){\n base_x_range.start = this.layout.axes.x.range.start || base_x_range.start;\n base_x_range.end = this.layout.axes.x.range.end || base_x_range.end;\n }\n ranges.x = [base_x_range.start, base_x_range.end];\n ranges.x_shifted = [base_x_range.start, base_x_range.end];\n }\n if (this.y1_extent){\n var base_y1_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y1.range){\n base_y1_range.start = this.layout.axes.y1.range.start || base_y1_range.start;\n base_y1_range.end = this.layout.axes.y1.range.end || base_y1_range.end;\n }\n ranges.y1 = [base_y1_range.start, base_y1_range.end];\n ranges.y1_shifted = [base_y1_range.start, base_y1_range.end];\n }\n if (this.y2_extent){\n var base_y2_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y2.range){\n base_y2_range.start = this.layout.axes.y2.range.start || base_y2_range.start;\n base_y2_range.end = this.layout.axes.y2.range.end || base_y2_range.end;\n }\n ranges.y2 = [base_y2_range.start, base_y2_range.end];\n ranges.y2_shifted = [base_y2_range.start, base_y2_range.end];\n }\n\n // Shift ranges based on any drag or zoom interactions currently underway\n if (this.parent.interaction.panel_id && (this.parent.interaction.panel_id === this.id || this.parent.interaction.linked_panel_ids.indexOf(this.id) !== -1)){\n var anchor, scalar = null;\n if (this.parent.interaction.zooming && typeof this.x_scale == \"function\"){\n var current_extent_size = Math.abs(this.x_extent[1] - this.x_extent[0]);\n var current_scaled_extent_size = Math.round(this.x_scale.invert(ranges.x_shifted[1])) - Math.round(this.x_scale.invert(ranges.x_shifted[0]));\n var zoom_factor = this.parent.interaction.zooming.scale;\n var potential_extent_size = Math.floor(current_scaled_extent_size * (1 / zoom_factor));\n if (zoom_factor < 1 && !isNaN(this.parent.layout.max_region_scale)){\n zoom_factor = 1 /(Math.min(potential_extent_size, this.parent.layout.max_region_scale) / current_scaled_extent_size);\n } else if (zoom_factor > 1 && !isNaN(this.parent.layout.min_region_scale)){\n zoom_factor = 1 / (Math.max(potential_extent_size, this.parent.layout.min_region_scale) / current_scaled_extent_size);\n }\n var new_extent_size = Math.floor(current_extent_size * zoom_factor);\n anchor = this.parent.interaction.zooming.center - this.layout.margin.left - this.layout.origin.x;\n var offset_ratio = anchor / this.layout.cliparea.width;\n var new_x_extent_start = Math.max(Math.floor(this.x_scale.invert(ranges.x_shifted[0]) - ((new_extent_size - current_scaled_extent_size) * offset_ratio)), 1);\n ranges.x_shifted = [ this.x_scale(new_x_extent_start), this.x_scale(new_x_extent_start + new_extent_size) ];\n } else if (this.parent.interaction.dragging){\n switch (this.parent.interaction.dragging.method){\n case \"background\":\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n break;\n case \"x_tick\":\n if (d3.event && d3.event.shiftKey){\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n } else {\n anchor = this.parent.interaction.dragging.start_x - this.layout.margin.left - this.layout.origin.x;\n scalar = constrain(anchor / (anchor + this.parent.interaction.dragging.dragged_x), 3);\n ranges.x_shifted[0] = 0;\n ranges.x_shifted[1] = Math.max(this.layout.cliparea.width * (1 / scalar), 1);\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n var y_shifted = \"y\" + this.parent.interaction.dragging.method[1] + \"_shifted\";\n if (d3.event && d3.event.shiftKey){\n ranges[y_shifted][0] = this.layout.cliparea.height + this.parent.interaction.dragging.dragged_y;\n ranges[y_shifted][1] = +this.parent.interaction.dragging.dragged_y;\n } else {\n anchor = this.layout.cliparea.height - (this.parent.interaction.dragging.start_y - this.layout.margin.top - this.layout.origin.y);\n scalar = constrain(anchor / (anchor - this.parent.interaction.dragging.dragged_y), 3);\n ranges[y_shifted][0] = this.layout.cliparea.height;\n ranges[y_shifted][1] = this.layout.cliparea.height - (this.layout.cliparea.height * (1 / scalar));\n }\n }\n }\n }\n\n // Generate scales and ticks for all axes, then render them\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!this[axis + \"_extent\"]){ return; }\n\n // Base Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"])\n .range(ranges[axis + \"_shifted\"]);\n\n // Shift the extent\n this[axis + \"_extent\"] = [\n this[axis + \"_scale\"].invert(ranges[axis][0]),\n this[axis + \"_scale\"].invert(ranges[axis][1])\n ];\n\n // Finalize Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"]).range(ranges[axis]);\n\n // Render axis (and generate ticks as needed)\n this.renderAxis(axis);\n }.bind(this));\n\n // Establish mousewheel zoom event handers on the panel (namespacing not passed through by d3, so not used here)\n if (this.layout.interaction.scroll_to_zoom){\n var zoom_handler = function(){\n // Look for a shift key press while scrolling to execute.\n // If not present, gracefully raise a notification and allow conventional scrolling\n if (!d3.event.shiftKey){\n if (this.parent.canInteract(this.id)){\n this.loader.show(\"Press [SHIFT] while scrolling to zoom\").hide(1000);\n }\n return;\n }\n d3.event.preventDefault();\n if (!this.parent.canInteract(this.id)){ return; }\n var coords = d3.mouse(this.svg.container.node());\n var delta = Math.max(-1, Math.min(1, (d3.event.wheelDelta || -d3.event.detail || -d3.event.deltaY)));\n if (delta === 0){ return; }\n this.parent.interaction = {\n panel_id: this.id,\n linked_panel_ids: this.getLinkedPanelIds(\"x\"),\n zooming: {\n scale: (delta < 1) ? 0.9 : 1.1,\n center: coords[0]\n }\n };\n this.render();\n this.parent.interaction.linked_panel_ids.forEach(function(panel_id){\n this.parent.panels[panel_id].render();\n }.bind(this));\n if (this.zoom_timeout !== null){ clearTimeout(this.zoom_timeout); }\n this.zoom_timeout = setTimeout(function(){\n this.parent.interaction = {};\n this.parent.applyState({ start: this.x_extent[0], end: this.x_extent[1] });\n }.bind(this), 500);\n }.bind(this);\n this.zoom_listener = d3.behavior.zoom();\n this.svg.container.call(this.zoom_listener)\n .on(\"wheel.zoom\", zoom_handler)\n .on(\"mousewheel.zoom\", zoom_handler)\n .on(\"DOMMouseScroll.zoom\", zoom_handler);\n }\n\n // Render data layers in order by z-index\n this.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n this.data_layers[data_layer_id].draw().render();\n }.bind(this));\n\n return this;\n};\n\n\n/**\n * Render ticks for a particular axis\n * @param {('x'|'y1'|'y2')} axis The identifier of the axes\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.renderAxis = function(axis){\n\n if ([\"x\", \"y1\", \"y2\"].indexOf(axis) === -1){\n throw(\"Unable to render axis; invalid axis identifier: \" + axis);\n }\n\n var canRender = this.layout.axes[axis].render\n && typeof this[axis + \"_scale\"] == \"function\"\n && !isNaN(this[axis + \"_scale\"](0));\n\n // If the axis has already been rendered then check if we can/can't render it\n // Make sure the axis element is shown/hidden to suit\n if (this[axis+\"_axis\"]){\n this.svg.container.select(\"g.lz-axis.lz-\"+axis).style(\"display\", canRender ? null : \"none\");\n }\n\n if (!canRender){ return this; }\n\n // Axis-specific values to plug in where needed\n var axis_params = {\n x: {\n position: \"translate(\" + this.layout.margin.left + \",\" + (this.layout.height - this.layout.margin.bottom) + \")\",\n orientation: \"bottom\",\n label_x: this.layout.cliparea.width / 2,\n label_y: (this.layout.axes[axis].label_offset || 0),\n label_rotate: null\n },\n y1: {\n position: \"translate(\" + this.layout.margin.left + \",\" + this.layout.margin.top + \")\",\n orientation: \"left\",\n label_x: -1 * (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n },\n y2: {\n position: \"translate(\" + (this.layout.width - this.layout.margin.right) + \",\" + this.layout.margin.top + \")\",\n orientation: \"right\",\n label_x: (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n }\n };\n\n // Generate Ticks\n this[axis + \"_ticks\"] = this.generateTicks(axis);\n\n // Determine if the ticks are all numbers (d3-automated tick rendering) or not (manual tick rendering)\n var ticksAreAllNumbers = (function(ticks){\n for (var i = 0; i < ticks.length; i++){\n if (isNaN(ticks[i])){\n return false;\n }\n }\n return true;\n })(this[axis+\"_ticks\"]);\n\n // Initialize the axis; set scale and orientation\n this[axis+\"_axis\"] = d3.svg.axis().scale(this[axis+\"_scale\"]).orient(axis_params[axis].orientation).tickPadding(3);\n\n // Set tick values and format\n if (ticksAreAllNumbers){\n this[axis+\"_axis\"].tickValues(this[axis+\"_ticks\"]);\n if (this.layout.axes[axis].tick_format === \"region\"){\n this[axis+\"_axis\"].tickFormat(function(d) { return LocusZoom.positionIntToString(d, 6); });\n }\n } else {\n var ticks = this[axis+\"_ticks\"].map(function(t){\n return(t[axis.substr(0,1)]);\n });\n this[axis+\"_axis\"].tickValues(ticks)\n .tickFormat(function(t, i) { return this[axis+\"_ticks\"][i].text; }.bind(this));\n }\n\n // Position the axis in the SVG and apply the axis construct\n this.svg[axis+\"_axis\"]\n .attr(\"transform\", axis_params[axis].position)\n .call(this[axis+\"_axis\"]);\n\n // If necessary manually apply styles and transforms to ticks as specified by the layout\n if (!ticksAreAllNumbers){\n var tick_selector = d3.selectAll(\"g#\" + this.getBaseId().replace(\".\",\"\\\\.\") + \"\\\\.\" + axis + \"_axis g.tick\");\n var panel = this;\n tick_selector.each(function(d, i){\n var selector = d3.select(this).select(\"text\");\n if (panel[axis+\"_ticks\"][i].style){\n selector.style(panel[axis+\"_ticks\"][i].style);\n }\n if (panel[axis+\"_ticks\"][i].transform){\n selector.attr(\"transform\", panel[axis+\"_ticks\"][i].transform);\n }\n });\n }\n\n // Render the axis label if necessary\n var label = this.layout.axes[axis].label || null;\n if (label !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"x\", axis_params[axis].label_x).attr(\"y\", axis_params[axis].label_y)\n .text(LocusZoom.parseFields(this.state, label));\n if (axis_params[axis].label_rotate !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"transform\", \"rotate(\" + axis_params[axis].label_rotate + \" \" + axis_params[axis].label_x + \",\" + axis_params[axis].label_y + \")\");\n }\n }\n\n // Attach interactive handlers to ticks as needed\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (this.layout.interaction[\"drag_\" + axis + \"_ticks_to_scale\"]){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var tick_mouseover = function(){\n if (typeof d3.select(this).node().focus == \"function\"){ d3.select(this).node().focus(); }\n var cursor = (axis === \"x\") ? \"ew-resize\" : \"ns-resize\";\n if (d3.event && d3.event.shiftKey){ cursor = \"move\"; }\n d3.select(this)\n .style({\"font-weight\": \"bold\", \"cursor\": cursor})\n .on(\"keydown\" + namespace, tick_mouseover)\n .on(\"keyup\" + namespace, tick_mouseover);\n };\n this.svg.container.selectAll(\".lz-axis.lz-\" + axis + \" .tick text\")\n .attr(\"tabindex\", 0) // necessary to make the tick focusable so keypress events can be captured\n .on(\"mouseover\" + namespace, tick_mouseover)\n .on(\"mouseout\" + namespace, function(){\n d3.select(this).style({\"font-weight\": \"normal\"});\n d3.select(this).on(\"keydown\" + namespace, null).on(\"keyup\" + namespace, null);\n })\n .on(\"mousedown\" + namespace, function(){\n this.parent.startDrag(this, axis + \"_tick\");\n }.bind(this));\n }\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Force the height of this panel to the largest absolute height of the data in\n * all child data layers (if not null for any child data layers)\n * @param {number} [target_height] A target height, which will be used in situations when the expected height can be\n * pre-calculated (eg when the layers are transitioning)\n */\nLocusZoom.Panel.prototype.scaleHeightToData = function(target_height){\n target_height = +target_height || null;\n if (target_height === null){\n this.data_layer_ids_by_z_index.forEach(function(id){\n var dh = this.data_layers[id].getAbsoluteDataHeight();\n if (+dh){\n if (target_height === null){ target_height = +dh; }\n else { target_height = Math.max(target_height, +dh); }\n }\n }.bind(this));\n }\n if (+target_height){\n target_height += +this.layout.margin.top + +this.layout.margin.bottom;\n this.setDimensions(this.layout.width, target_height);\n this.parent.setDimensions();\n this.parent.panel_ids_by_y_index.forEach(function(id){\n this.parent.panels[id].layout.proportional_height = null;\n }.bind(this));\n this.parent.positionPanels();\n }\n};\n\n/**\n * Methods to set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n */\nLocusZoom.Panel.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setElementStatusByFilters(status, toggle, filters, exclusive);\n }.bind(this));\n};\n/**\n * Set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n */\nLocusZoom.Panel.prototype.setAllElementStatus = function(status, toggle){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(status, toggle);\n }.bind(this));\n};\n// TODO: Capture documentation for dynamically generated methods\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.Panel.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.Panel.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.Panel.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.Panel.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n\n/**\n * Add a \"basic\" loader to a panel\n * This method is just a shortcut for adding the most commonly used type of loading indicator, which appears when\n * data is requested, animates (e.g. shows an infinitely cycling progress bar as opposed to one that loads from\n * 0-100% based on actual load progress), and disappears when new data is loaded and rendered.\n *\n *\n * @param {Boolean} show_immediately\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.addBasicLoader = function(show_immediately){\n if (typeof show_immediately != \"undefined\"){ show_immediately = true; }\n if (show_immediately){\n this.loader.show(\"Loading...\").animate();\n }\n this.on(\"data_requested\", function(){\n this.loader.show(\"Loading...\").animate();\n }.bind(this));\n this.on(\"data_rendered\", function(){\n this.loader.hide();\n }.bind(this));\n return this;\n};\n"]} \ No newline at end of file +{"version":3,"sources":["locuszoom.app.min.js","LocusZoom.js","Layouts.js","DataLayer.js","annotation_track.js","forest.js","genes.js","genome_legend.js","intervals.js","line.js","scatter.js","Singletons.js","Dashboard.js","Legend.js","Data.js","Plot.js","Panel.js"],"names":["root","factory","define","amd","d3","Q","LocusZoom","module","exports","require","this","semanticVersionIsOk","minimum_version","current_version","minimum_version_array","split","current_version_array","version_is_ok","forEach","d","i","minimum_d3_version","version","populate","selector","datasource","layout","select","html","plot","call","node","id","iterator","empty","attr","Plot","container","dataset","region","parsed_state","parsePositionQuery","Object","keys","key","state","svg","append","style","setDimensions","positionPanels","initialize","length","refresh","populateAll","plots","selectAll","each","positionIntToString","pos","exp","suffix","exp_symbols","0","3","6","9","isNaN","log","Math","LN10","min","max","places_exp","floor","toFixed","min_exp","places","ret","pow","positionStringToInt","p","val","toUpperCase","replace","suffixre","exec","mult","Number","x","chrposoff","chrpos","match","center","offset","chr","start","end","position","prettyTicks","range","clip_range","target_tick_count","parseInt","min_n","shrink_sml","high_u_bias","u5_bias","abs","c","base","base_toFixed","round","unit","ticks","parseFloat","push","indexOf","slice","pop","createCORSPromise","method","url","body","headers","timeout","response","defer","xhr","XMLHttpRequest","open","XDomainRequest","onreadystatechange","readyState","status","resolve","reject","setTimeout","header","setRequestHeader","send","promise","validateState","new_state","validated_region","attempted_scale","attempted_midpoint","temp","min_region_scale","max_region_scale","parseFields","data","tokens","regex","m","index","text","condition","variable","close","console","error","JSON","stringify","astify","token","shift","then","ast","cache","hasOwnProperty","Data","Field","render_node","value","map","join","getToolTipData","parentNode","classed","getToolTipDataLayer","getDataLayer","getToolTipPanel","data_layer","parent","getToolTipPlot","panel","generateCurtain","curtain","showing","content_selector","hide_delay","show","content","css","parent_plot","insert","on","hide","bind","update","clearTimeout","page_origin","getPageOrigin","top","y","left","width","height","max-width","max-height","delay","remove","generateLoader","loader","progress_selector","cancel_selector","percent","padding","loader_boundrect","getBoundingClientRect","animate","setPercentCompleted","subclass","extra","Sub","constructor","apply","arguments","prototype","create","k","ext","Layouts","obj","layouts","dashboard","tooltip","get","type","name","modifications","merge","unnamespaced","parse","default_namespace","namespace","default","toString","applyNamespaces","element","resolved_namespace","re","r","merge_namespace","namespaced_element","namespaced_property","property","set","add","list","custom_layout","default_layout","custom_type","default_type","Array","isArray","assoc","closable","or","and","covariates_model_association","intervals","orientation","recomb","fields","z_index","stroke","stroke-width","x_axis","field","y_axis","axis","ceiling","ld","point_shape","scale_function","parameters","field_value","else","point_size","color","breaks","values","legend","shape","size","label","class","id_field","upper_buffer","min_extent","behaviors","onmouseover","action","onmouseout","onclick","exclusive","onshiftclick","phewas","tooltip_positioning","category_field","lower_buffer","categories","null_value","fill_opacity","spacing","lines","stroke-dasharray","filters","operator","font-size","font-weight","fill","gene","constraint","genome","start_field","end_field","track_split_field","split_tracks","always_hide_legend","{{namespace[intervals]}}state_id","components","group_position","margin-left","title","subtitle","covariates_model_plot_dashboard","button_html","button_title","region_nav_plot_dashboard","step","min_width","min_height","proportional_width","margin","right","bottom","inner_border","l","axes","label_offset","tick_format","extent","y1","y2","origin","hidden","interaction","drag_background_to_pan","drag_x_ticks_to_scale","drag_y1_ticks_to_scale","drag_y2_ticks_to_scale","scroll_to_zoom","x_linked","data_layers","text-anchor","transform","data_layer_id","pad_from_bottom","responsive_resize","panels","proportional_height","StandardLayout","mouse_guide","DataLayer","initialized","layout_idx","Panel","DefaultLayout","_base_layout","state_id","setDefaultState","tooltips","global_statuses","highlighted","selected","faded","addField","fieldName","transformations","fieldString","Statuses","adjectives","verbs","menu_antiverbs","getBaseId","getAbsoluteDataHeight","dataBCR","group","canTransition","transition","panel_boundaries","dragging","panel_id","getElementId","element_id","getElementStatusNodeId","getElementById","applyDataMethods","toHTML","deselect","unselectElement","applyCustomDataMethods","clipRect","moveUp","data_layer_ids_by_z_index","resortDataLayers","moveDown","resolveScalableParameter","idx","f","ScaleFunctions","getAxisExtent","dimension","axis_name","axis_layout","data_extent","original_extent_span","range_min","range_max","getTicks","config","createTooltip","positionTooltip","arrow","updateTooltip","destroyTooltip","destroyAllTooltips","event","pageX","pageY","positionAllTooltips","showOrHideTooltip","resolveStatus","statuses","directive","reduce","previousValue","currentValue","sub_status","sub_operator","show_directive","hide_directive","antistatus","show_resolved","hide_resolved","filter","return_type","test","operators","=","a","b","<","<=",">",">=","%","matches","filterIndexes","filterElements","verb","adjective","antiverb","setElementStatus","setElementStatusByFilters","setAllElementStatus","toggle","get_element_id_error","element_status_node_id","element_status_idx","splice","emit","active","status_ids","applyBehaviors","selection","event_match","executeBehaviors","requiredKeyStates","ctrl","ctrlKey","shiftKey","behavior","current_status_boolean","href","target","window","location","panel_origin","exportData","format","default_format","toLowerCase","e","jsonified","delimiter","record","draw","cliparea","reMap","lzd","getData","new_data","DataLayers","datalayers","datalayer","extend","parent_name","overrides","child","render","self","trackData","enter","exit","arrow_type","arrow_top","arrow_left","arrow_width","stroke_width","tooltip_box","data_layer_height","data_layer_width","x_center","x_scale","y_center","offset_right","offset_left","confidence_intervals","show_no_significance_line","border_radius","y_scale","sqrt","PI","ci_selection","ci_transform","ci_width","ci_height","duration","ease","points_selection","initial_y","symbol","element_data","label_font_size","label_exon_spacing","exon_height","bounding_box_padding","track_vertical_spacing","getTrackHeight","transcript_idx","tracks","gene_track_index","1","assignTracks","getLabelWidth","gene_name","font_size","temp_text","label_width","getBBox","g","gene_id","gene_version","transcript_id","transcripts","display_range","text_anchor","centered_margin","display_domain","invert","track","potential_track","collision_on_potential_track","placed_gene","min_start","max_end","t","exons","bboxes","boundary_fill","boundary_stroke","boundaries","labels","strand","exon_fill","exon_stroke","exon_id","clickareas","gene_bbox_id","gene_bbox","gene_center_x","chromosome_fill_colors","light","dark","chromosome_label_colors","genome_start","genome_end","chromosomes","variant_parts","variant","track_split_order","track_split_legend_to_y_axis","track_height","previous_tracks","interval_track_index","track_split_field_index","reverse","placed_interval","psuedoElement","sharedstatusnode_style","display","interval","statusnode_style","statusnodes","rects","interval_name","updateSplitTrackAxis","interval_bbox","interval_center_x","legend_axis","track_spacing","target_height","scaleHeightToData","toggleSplitTracks","interpolate","hitarea_width","mouse_event","line","tooltip_timeout","getMouseDisplayAndData","mouse","slope","x_field","y_field","bisect","bisector","datum","startDatum","endDatum","interpolateNumber","x_precision","toPrecision","y_precision","dd","min_arrow_left","max_arrow_left","path","hitarea","hitarea_line","path_class","global_status","decoupled","x_extent","y_extent","x_range","y_range","flip_labels","handle_lines","Boolean","min_x","max_x","flip","dn","dnl","dnx","text_swing","dnlx2","line_swing","label_texts","da","dax","abound","dal","label_lines","db","bbound","collision","separate_labels","seperate_iterations","alpha","again","delta","sign","adjust","new_a_y","new_b_y","min_y","max_y","label_elements","label_line","filtered_data","label_groups","x1","x2","makeLDReference","ref","applyState","ldrefvar","_prepareData","xField","sourceData","sort","ak","bk","av","bv","_generateCategoryBounds","uniqueCategories","item","category","bounds","categoryNames","_setDynamicColorScheme","colorParams","baseParams","parameters_categories_hash","every","colors","color_scale","scale","category10","category20","concat","categoryBounds","_categories","knownCategories","knownColors","xPos","diff","KnownDataSources","sources","findSourceByName","SOURCE_NAME","source","warn","source_name","newObj","params","Function","getAll","setAll","clear","TransformationFunctions","getTrans","fun","parseTrans","parseTransString","result","funs","substring","fn","ceil","toExponential","str","encodeURIComponent","s","functions","input","threshold","prev","curr","nullval","upper_idx","brk","normalized_input","isFinite","Dashboard","hide_timeout","persist","component","Components","shouldPersist","visibility","destroy","force","Component","parent_panel","parent_svg","button","menu","Button","parent_dashboard","tag","setTag","setHtml","setText","setHTML","setTitle","setColor","setStyle","getClass","permanent","setPermanent","bool","setStatus","highlight","disable","setOnMouseover","setOnMouseout","setOnclick","preUpdate","postUpdate","outer_selector","inner_selector","scroll_position","scrollTop","scrollbar_padding","menu_height_padding","page_scroll_top","document","documentElement","container_offset","getContainerOffset","dashboard_client_rect","button_client_rect","menu_client_rect","total_content_height","scrollHeight","base_max_width","container_max_width","content_max_width","base_max_height","max_height","setPopulate","menu_populate_function","div_selector","title_selector","display_width","display_height","generateBase64SVG","base64_string","css_string","stylesheet","styleSheets","fcall","outerHTML","dy","initial_html","style_def","insert_at","btoa","p1","String","fromCharCode","suppress_confirm","confirm","removePanel","is_at_top","y_index","is_at_bottom","panel_ids_by_y_index","can_zoom","current_region_scale","zoom_factor","new_region_scale","menu_html","model","covariates","CovariatesModel","element_reference","updateComponent","removeByIdx","removeAll","table","covariate","row","cov","scale_timeout","status_adj","status_idx","status_verb","at_top","at_bottom","td","removeDataLayer","allowed_fields","fields_whitelist","dataLayer","layer_name","dataLayerLayout","defaultConfig","configSlot","_selected_item","uniqueID","random","menuLayout","renderRow","display_name","display_options","row_id","field_name","defaultName","default_config_display_name","options","Legend","background_rect","elements","elements_group","label_size","line_height","label_x","label_y","path_y","symbolTypes","radius","bcr","right_x","pad_from_right","DataSources","addSource","ns","dsobj","source_id","getSource","removeSource","fromJSON","ds","toJSON","parts","full_name","applyTransformations","Requester","split_requests","requests","raw","trans","outnames","request_handles","when","discrete","Source","enableCache","dependentSource","parseInit","init","getCacheKey","chain","getURL","fetchRequest","getRequest","req","cacheKey","_cachedKey","_cachedResponse","preGetData","pre","resp","parseResponse","normalizeResponse","N","sameLength","records","j","prepareData","annotateData","extractFields","fieldFound","output_record","v","combineChainBody","json","standardized","one_source_body","new_body","parseArraysToObjects","standard","parseObjectsToObjects","parseData","constructorFun","uniqueName","getPrototypeOf","AssociationSource","unshift","analysis","LDSource","findMergeFields","exactMatch","arr","regexes","dataFields","position_field","pvalue","pvalue_field","_names_","names","nameMatch","findRequestedFields","isrefvarin","isrefvarout","ldin","ldout","findExtremeValue","pval","extremeVal","extremeIdx","refSource","ldrefsource","reqFields","refVar","columns","leftJoin","lfield","rfield","position2","tagRefVariant","refvar","idfield","outname","GeneSource","GeneConstraintSource","geneids","substr","Content-Type","constraint_fields","RecombinationRateSource","recombsource","IntervalSource","bedtracksource","StaticSource","_data","PheWASSource","build","ConnectorSource","_source_name_mapping","specified_ids","REQUIRED_SOURCES","chain_source_id","applyPanelYIndexesToPanelLayouts","pid","remap_promises","window_onresize","event_hooks","layout_changed","data_requested","data_rendered","element_clicked","element_selection","state_changed","hook","off","theseHooks","undefined","hookMatch","eventData","sourceID","hookToRun","eventContext","bounding_client_rect","x_offset","scrollLeft","y_offset","offsetParent","offsetTop","offsetLeft","canInteract","loading_data","zooming","initializeLayout","aspect_ratio","sumProportional","total","rescaleSVG","clientRect","panel_layout","addPanel","min-width","min-height","panel_width","panel_height","setOrigin","proportional_origin","clearPanelData","panelId","mode","panelsList","dlid","layer","x_linked_margins","total_proportional_height","proportional_adjustment","calculated_plot_height","mouse_guide_svg","mouse_guide_vertical_svg","mouse_guide_horizontal_svg","vertical","horizontal","selectors","corner_selector","panel_idx","panel_resize_drag","drag","this_panel","original_panel_height","panel_height_change","new_calculated_plot_height","loop_panel_id","loop_panel_idx","loop_panel","corner_drag","dx","plot_page_origin","panel_page_origin","corner_padding","corner_size","mouseout_mouse_guide","mousemove_mouse_guide","coords","mouseup","stopDrag","mousemove","preventDefault","dragged_x","start_x","dragged_y","start_y","linked_panel_ids","client_rect","subscribeToData","success_callback","opts","error_callback","onerror","err","listener","catch","state_changes","all","drop","startDrag","getLinkedPanelIds","overrideAxisLayout","axis_number","y_axis_number","generateID","applyDataLayerZIndexesToDataLayerLayouts","data_promises","y1_scale","y2_scale","y1_extent","y2_extent","x_ticks","y1_ticks","y2_ticks","zoom_timeout","bubble","plot_origin","background_click","y1_linked","y2_linked","panel_count","setMargin","y1_range","y2_range","label_function","data_layer_layout","addDataLayer","clipPath","clearSelections","x_axis_label","y1_axis","y1_axis_label","y2_axis","y2_axis_label","mousedown","ascending","generateExtents","generateTicks","baseTickConfig","combinedTicks","acc","nextLayer","itemConfig","constrain","limit_exponent","neg_min","neg_max","pos_min","pos_max","Infinity","ranges","base_x_range","x_shifted","base_y1_range","y1_shifted","base_y2_range","y2_shifted","anchor","scalar","current_extent_size","current_scaled_extent_size","potential_extent_size","new_extent_size","offset_ratio","new_x_extent_start","y_shifted","linear","domain","renderAxis","zoom_handler","wheelDelta","detail","deltaY","zoom_listener","zoom","canRender","axis_params","label_rotate","ticksAreAllNumbers","orient","tickPadding","tickValues","tickFormat","tick_selector","tick_mouseover","focus","cursor","dh","addBasicLoader","show_immediately","plugin_loading_error"],"mappings":"8qBAAC,SAAUA,EAAMC,GACS,kBAAXC,SAAyBA,OAAOC,IACvCD,QACI,KACA,KACD,SAAUE,EAAIC,GAEb,MAAOL,GAAKM,UAAYL,EAAQG,EAAIC,KAEf,gBAAXE,SAAuBA,OAAOC,QAE5CD,OAAOC,QAAUR,EAAKM,UAAYL,EAAQQ,QAAQ,MAAOA,QAAQ,MAGjET,EAAKM,UAAYL,EAAQD,EAAKI,GAAIJ,EAAKK,IAE7CK,KAAM,SAAUN,EAAIC,GAClB,GAAIM,GAAsB,SAAUC,EAAiBC,GAEjD,GAAIA,GAAmBD,EACnB,OAAO,CAGX,IAAIE,GAAwBF,EAAgBG,MAAM,KAC9CC,EAAwBH,EAAgBE,MAAM,KAC9CE,GAAgB,CAMpB,OALAH,GAAsBI,QAAQ,SAAUC,EAAGC,IAClCH,IAAkBD,EAAsBI,IAAMN,EAAsBM,KACrEH,GAAgB,KAGjBA,EAEX,KAEI,GAAII,GAAqB,OACzB,IAAiB,gBAANjB,GACP,KAAM,yCAEV,KAAKO,EAAoBU,EAAoBjB,EAAGkB,SAC5C,KAAM,2EAA6ED,EAAqB,sBAAwBjB,EAAGkB,QAAU,IAGjJ,IAAgB,kBAALjB,GACP,KAAM,wCCzClB,I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* Populate a single element with a LocusZoom plot.\n * selector can be a string for a DOM Query or a d3 selector.\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot} The newly created plot instance\n */\nLocusZoom.populate = function(selector, datasource, layout) {\n if (typeof selector == \"undefined\"){\n throw (\"LocusZoom.populate selector not defined\");\n }\n // Empty the selector of any existing content\n d3.select(selector).html(\"\");\n var plot;\n d3.select(selector).call(function(){\n // Require each containing element have an ID. If one isn't present, create one.\n if (typeof this.node().id == \"undefined\"){\n var iterator = 0;\n while (!d3.select(\"#lz-\" + iterator).empty()){ iterator++; }\n this.attr(\"id\", \"#lz-\" + iterator);\n }\n // Create the plot\n plot = new LocusZoom.Plot(this.node().id, datasource, layout);\n plot.container = this.node();\n // Detect data-region and fill in state values if present\n if (typeof this.node().dataset !== \"undefined\" && typeof this.node().dataset.region !== \"undefined\"){\n var parsed_state = LocusZoom.parsePositionQuery(this.node().dataset.region);\n Object.keys(parsed_state).forEach(function(key){\n plot.state[key] = parsed_state[key];\n });\n }\n // Add an SVG to the div and set its dimensions\n plot.svg = d3.select(\"div#\" + plot.id)\n .append(\"svg\")\n .attr(\"version\", \"1.1\")\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .attr(\"id\", plot.id + \"_svg\").attr(\"class\", \"lz-locuszoom\")\n .style(plot.layout.style);\n plot.setDimensions();\n plot.positionPanels();\n // Initialize the plot\n plot.initialize();\n // If the plot has defined data sources then trigger its first mapping based on state values\n if (typeof datasource == \"object\" && Object.keys(datasource).length){\n plot.refresh();\n }\n });\n return plot;\n};\n\n/**\n * Populate arbitrarily many elements each with a LocusZoom plot\n * using a common datasource and layout\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot[]}\n */\nLocusZoom.populateAll = function(selector, datasource, layout) {\n var plots = [];\n d3.selectAll(selector).each(function(d,i) {\n plots[i] = LocusZoom.populate(this, datasource, layout);\n });\n return plots;\n};\n\n/**\n * Convert an integer chromosome position to an SI string representation (e.g. 23423456 => \"23.42\" (Mb))\n * @param {Number} pos Position\n * @param {String} [exp] Exponent to use for the returned string, eg 6=> MB. If not specified, will attempt to guess\n * the most appropriate SI prefix based on the number provided.\n * @param {Boolean} [suffix=false] Whether or not to append a suffix (e.g. \"Mb\") to the end of the returned string\n * @returns {string}\n */\nLocusZoom.positionIntToString = function(pos, exp, suffix){\n var exp_symbols = { 0: \"\", 3: \"K\", 6: \"M\", 9: \"G\" };\n suffix = suffix || false;\n if (isNaN(exp) || exp === null){\n var log = Math.log(pos) / Math.LN10;\n exp = Math.min(Math.max(log - (log % 3), 0), 9);\n }\n var places_exp = exp - Math.floor((Math.log(pos) / Math.LN10).toFixed(exp + 3));\n var min_exp = Math.min(Math.max(exp, 0), 2);\n var places = Math.min(Math.max(places_exp, min_exp), 12);\n var ret = \"\" + (pos / Math.pow(10, exp)).toFixed(places);\n if (suffix && typeof exp_symbols[exp] !== \"undefined\"){\n ret += \" \" + exp_symbols[exp] + \"b\";\n }\n return ret;\n};\n\n/**\n * Convert an SI string chromosome position to an integer representation (e.g. \"5.8 Mb\" => 58000000)\n * @param {String} p The chromosome position\n * @returns {Number}\n */\nLocusZoom.positionStringToInt = function(p) {\n var val = p.toUpperCase();\n val = val.replace(/,/g, \"\");\n var suffixre = /([KMG])[B]*$/;\n var suffix = suffixre.exec(val);\n var mult = 1;\n if (suffix) {\n if (suffix[1]===\"M\") {\n mult = 1e6;\n } else if (suffix[1]===\"G\") {\n mult = 1e9;\n } else {\n mult = 1e3; //K\n }\n val = val.replace(suffixre,\"\");\n }\n val = Number(val) * mult;\n return val;\n};\n\n/**\n * Parse region queries into their constituent parts\n * TODO: handle genes (or send off to API)\n * @param {String} x A chromosome position query. May be any of the forms `chr:start-end`, `chr:center+offset`,\n * or `chr:pos`\n * @returns {{chr:*, start: *, end:*} | {chr:*, position:*}}\n */\nLocusZoom.parsePositionQuery = function(x) {\n var chrposoff = /^(\\w+):([\\d,.]+[kmgbKMGB]*)([-+])([\\d,.]+[kmgbKMGB]*)$/;\n var chrpos = /^(\\w+):([\\d,.]+[kmgbKMGB]*)$/;\n var match = chrposoff.exec(x);\n if (match) {\n if (match[3] === \"+\") {\n var center = LocusZoom.positionStringToInt(match[2]);\n var offset = LocusZoom.positionStringToInt(match[4]);\n return {\n chr:match[1],\n start: center - offset,\n end: center + offset\n };\n } else {\n return {\n chr: match[1],\n start: LocusZoom.positionStringToInt(match[2]),\n end: LocusZoom.positionStringToInt(match[4])\n };\n }\n }\n match = chrpos.exec(x);\n if (match) {\n return {\n chr:match[1],\n position: LocusZoom.positionStringToInt(match[2])\n };\n }\n return null;\n};\n\n/**\n * Generate a \"pretty\" set of ticks (multiples of 1, 2, or 5 on the same order of magnitude for the range)\n * Based on R's \"pretty\" function: https://github.com/wch/r-source/blob/b156e3a711967f58131e23c1b1dc1ea90e2f0c43/src/appl/pretty.c\n * @param {Number[]} range A two-item array specifying [low, high] values for the axis range\n * @param {('low'|'high'|'both'|'neither')} [clip_range='neither'] What to do if first and last generated ticks extend\n * beyond the range. Set this to \"low\", \"high\", \"both\", or \"neither\" to clip the first (low) or last (high) tick to\n * be inside the range or allow them to extend beyond.\n * e.g. \"low\" will clip the first (low) tick if it extends beyond the low end of the range but allow the\n * last (high) tick to extend beyond the range. \"both\" clips both ends, \"neither\" allows both to extend beyond.\n * @param {Number} [target_tick_count=5] The approximate number of ticks you would like to be returned; may not be exact\n * @returns {Number[]}\n */\nLocusZoom.prettyTicks = function(range, clip_range, target_tick_count){\n if (typeof target_tick_count == \"undefined\" || isNaN(parseInt(target_tick_count))){\n target_tick_count = 5;\n }\n target_tick_count = parseInt(target_tick_count);\n \n var min_n = target_tick_count / 3;\n var shrink_sml = 0.75;\n var high_u_bias = 1.5;\n var u5_bias = 0.5 + 1.5 * high_u_bias;\n \n var d = Math.abs(range[0] - range[1]);\n var c = d / target_tick_count;\n if ((Math.log(d) / Math.LN10) < -2){\n c = (Math.max(Math.abs(d)) * shrink_sml) / min_n;\n }\n \n var base = Math.pow(10, Math.floor(Math.log(c)/Math.LN10));\n var base_toFixed = 0;\n if (base < 1 && base !== 0){\n base_toFixed = Math.abs(Math.round(Math.log(base)/Math.LN10));\n }\n \n var unit = base;\n if ( ((2 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 2 * base;\n if ( ((5 * base) - c) < (u5_bias * (c - unit)) ){\n unit = 5 * base;\n if ( ((10 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 10 * base;\n }\n }\n }\n \n var ticks = [];\n var i = parseFloat( (Math.floor(range[0]/unit)*unit).toFixed(base_toFixed) );\n while (i < range[1]){\n ticks.push(i);\n i += unit;\n if (base_toFixed > 0){\n i = parseFloat(i.toFixed(base_toFixed));\n }\n }\n ticks.push(i);\n \n if (typeof clip_range == \"undefined\" || [\"low\", \"high\", \"both\", \"neither\"].indexOf(clip_range) === -1){\n clip_range = \"neither\";\n }\n if (clip_range === \"low\" || clip_range === \"both\"){\n if (ticks[0] < range[0]){ ticks = ticks.slice(1); }\n }\n if (clip_range === \"high\" || clip_range === \"both\"){\n if (ticks[ticks.length-1] > range[1]){ ticks.pop(); }\n }\n \n return ticks;\n};\n\n/**\n * Make an AJAX request and return a promise.\n * From http://www.html5rocks.com/en/tutorials/cors/\n * and with promises from https://gist.github.com/kriskowal/593076\n *\n * @param {String} method The HTTP verb\n * @param {String} url\n * @param {String} body The request body to send to the server\n * @param {Object} headers Object of custom request headers\n * @param {Number} [timeout] If provided, wait this long (in ms) before timing out\n * @returns {Promise}\n */\nLocusZoom.createCORSPromise = function (method, url, body, headers, timeout) {\n var response = Q.defer();\n var xhr = new XMLHttpRequest();\n if (\"withCredentials\" in xhr) {\n // Check if the XMLHttpRequest object has a \"withCredentials\" property.\n // \"withCredentials\" only exists on XMLHTTPRequest2 objects.\n xhr.open(method, url, true);\n } else if (typeof XDomainRequest != \"undefined\") {\n // Otherwise, check if XDomainRequest.\n // XDomainRequest only exists in IE, and is IE's way of making CORS requests.\n xhr = new XDomainRequest();\n xhr.open(method, url);\n } else {\n // Otherwise, CORS is not supported by the browser.\n xhr = null;\n }\n if (xhr) {\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200 || xhr.status === 0 ) {\n response.resolve(xhr.response);\n } else {\n response.reject(\"HTTP \" + xhr.status + \" for \" + url);\n }\n }\n };\n timeout && setTimeout(response.reject, timeout);\n body = typeof body !== \"undefined\" ? body : \"\";\n if (typeof headers !== \"undefined\"){\n for (var header in headers){\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n // Send the request\n xhr.send(body);\n } \n return response.promise;\n};\n\n/**\n * Validate a (presumed complete) plot state object against internal rules for consistency, and ensure the plot fits\n * within any constraints imposed by the layout.\n * @param {Object} new_state\n * @param {Number} new_state.start\n * @param {Number} new_state.end\n * @param {Object} layout\n * @returns {*|{}}\n */\nLocusZoom.validateState = function(new_state, layout){\n\n new_state = new_state || {};\n layout = layout || {};\n\n // If a \"chr\", \"start\", and \"end\" are present then resolve start and end\n // to numeric values that are not decimal, negative, or flipped\n var validated_region = false;\n if (typeof new_state.chr != \"undefined\" && typeof new_state.start != \"undefined\" && typeof new_state.end != \"undefined\"){\n // Determine a numeric scale and midpoint for the attempted region,\n var attempted_midpoint = null; var attempted_scale;\n new_state.start = Math.max(parseInt(new_state.start), 1);\n new_state.end = Math.max(parseInt(new_state.end), 1);\n if (isNaN(new_state.start) && isNaN(new_state.end)){\n new_state.start = 1;\n new_state.end = 1;\n attempted_midpoint = 0.5;\n attempted_scale = 0;\n } else if (isNaN(new_state.start) || isNaN(new_state.end)){\n attempted_midpoint = new_state.start || new_state.end;\n attempted_scale = 0;\n new_state.start = (isNaN(new_state.start) ? new_state.end : new_state.start);\n new_state.end = (isNaN(new_state.end) ? new_state.start : new_state.end);\n } else {\n attempted_midpoint = Math.round((new_state.start + new_state.end) / 2);\n attempted_scale = new_state.end - new_state.start;\n if (attempted_scale < 0){\n var temp = new_state.start;\n new_state.end = new_state.start;\n new_state.start = temp;\n attempted_scale = new_state.end - new_state.start;\n }\n if (attempted_midpoint < 0){\n new_state.start = 1;\n new_state.end = 1;\n attempted_scale = 0;\n }\n }\n validated_region = true;\n }\n\n // Constrain w/r/t layout-defined minimum region scale\n if (!isNaN(layout.min_region_scale) && validated_region && attempted_scale < layout.min_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.min_region_scale / 2), 1);\n new_state.end = new_state.start + layout.min_region_scale;\n }\n\n // Constrain w/r/t layout-defined maximum region scale\n if (!isNaN(layout.max_region_scale) && validated_region && attempted_scale > layout.max_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.max_region_scale / 2), 1);\n new_state.end = new_state.start + layout.max_region_scale;\n }\n\n return new_state;\n};\n\n//\n/**\n * Replace placeholders in an html string with field values defined in a data object\n * Only works on scalar values! Will ignore non-scalars.\n *\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @param {Object} data\n * @param {String} html A placeholder string in which to substitute fields. Supports several template options:\n * `{{field_name}}` is a variable placeholder for the value of `field_name` from the provided data\n * `{{#if {{field_name}} }} Conditional text {{/if}} will insert the contents of the tag only if the value exists.\n * Since this is only an existence check, **variables with a value of 0 will be evaluated as true**.\n * @returns {string}\n */\nLocusZoom.parseFields = function (data, html) {\n if (typeof data != \"object\"){\n throw (\"LocusZoom.parseFields invalid arguments: data is not an object\");\n }\n if (typeof html != \"string\"){\n throw (\"LocusZoom.parseFields invalid arguments: html is not a string\");\n }\n // `tokens` is like [token,...]\n // `token` is like {text: '...'} or {variable: 'foo|bar'} or {condition: 'foo|bar'} or {close: 'if'}\n var tokens = [];\n var regex = /\\{\\{(?:(#if )?([A-Za-z0-9_:|]+)|(\\/if))\\}\\}/;\n while (html.length > 0){\n var m = regex.exec(html);\n if (!m) { tokens.push({text: html}); html = \"\"; }\n else if (m.index !== 0) { tokens.push({text: html.slice(0, m.index)}); html = html.slice(m.index); }\n else if (m[1] === \"#if \") { tokens.push({condition: m[2]}); html = html.slice(m[0].length); }\n else if (m[2]) { tokens.push({variable: m[2]}); html = html.slice(m[0].length); }\n else if (m[3] === \"/if\") { tokens.push({close: \"if\"}); html = html.slice(m[0].length); }\n else {\n console.error(\"Error tokenizing tooltip when remaining template is \" + JSON.stringify(html) +\n \" and previous tokens are \" + JSON.stringify(tokens) +\n \" and current regex match is \" + JSON.stringify([m[1], m[2], m[3]]));\n html=html.slice(m[0].length);\n }\n }\n var astify = function() {\n var token = tokens.shift();\n if (typeof token.text !== \"undefined\" || token.variable) {\n return token;\n } else if (token.condition) {\n token.then = [];\n while(tokens.length > 0) {\n if (tokens[0].close === \"if\") { tokens.shift(); break; }\n token.then.push(astify());\n }\n return token;\n } else {\n console.error(\"Error making tooltip AST due to unknown token \" + JSON.stringify(token));\n return { text: \"\" };\n }\n };\n // `ast` is like [thing,...]\n // `thing` is like {text: \"...\"} or {variable:\"foo|bar\"} or {condition: \"foo|bar\", then:[thing,...]}\n var ast = [];\n while (tokens.length > 0) ast.push(astify());\n\n var resolve = function(variable) {\n if (!resolve.cache.hasOwnProperty(variable)) {\n resolve.cache[variable] = (new LocusZoom.Data.Field(variable)).resolve(data);\n }\n return resolve.cache[variable];\n };\n resolve.cache = {};\n var render_node = function(node) {\n if (typeof node.text !== \"undefined\") {\n return node.text;\n } else if (node.variable) {\n try {\n var value = resolve(node.variable);\n if ([\"string\",\"number\",\"boolean\"].indexOf(typeof value) !== -1) { return value; }\n if (value === null) { return \"\"; }\n } catch (error) { console.error(\"Error while processing variable \" + JSON.stringify(node.variable)); }\n return \"{{\" + node.variable + \"}}\";\n } else if (node.condition) {\n try {\n var condition = resolve(node.condition);\n if (condition || condition === 0) {\n return node.then.map(render_node).join(\"\");\n }\n } catch (error) { console.error(\"Error while processing condition \" + JSON.stringify(node.variable)); }\n return \"\";\n } else { console.error(\"Error rendering tooltip due to unknown AST node \" + JSON.stringify(node)); }\n };\n return ast.map(render_node).join(\"\");\n};\n\n/**\n * Shortcut method for getting the data bound to a tool tip.\n * @param {Element} node\n * @returns {*} The first element of data bound to the tooltip\n */\nLocusZoom.getToolTipData = function(node){\n if (typeof node != \"object\" || typeof node.parentNode == \"undefined\"){\n throw(\"Invalid node object\");\n }\n // If this node is a locuszoom tool tip then return its data\n var selector = d3.select(node);\n if (selector.classed(\"lz-data_layer-tooltip\") && typeof selector.data()[0] != \"undefined\"){\n return selector.data()[0];\n } else {\n return LocusZoom.getToolTipData(node.parentNode);\n }\n};\n\n/**\n * Shortcut method for getting a reference to the data layer that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.getToolTipDataLayer = function(node){\n var data = LocusZoom.getToolTipData(node);\n if (data.getDataLayer){ return data.getDataLayer(); }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the panel that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.getToolTipPanel = function(node){\n var data_layer = LocusZoom.getToolTipDataLayer(node);\n if (data_layer){ return data_layer.parent; }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the plot that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.getToolTipPlot = function(node){\n var panel = LocusZoom.getToolTipPanel(node);\n if (panel){ return panel.parent; }\n return null;\n};\n\n/**\n * Generate a curtain object for a plot, panel, or any other subdivision of a layout\n * The panel curtain, like the plot curtain is an HTML overlay that obscures the entire panel. It can be styled\n * arbitrarily and display arbitrary messages. It is useful for reporting error messages visually to an end user\n * when the error renders the panel unusable.\n * TODO: Improve type doc here\n * @returns {object}\n */\nLocusZoom.generateCurtain = function(){\n var curtain = {\n showing: false,\n selector: null,\n content_selector: null,\n hide_delay: null,\n\n /**\n * Generate the curtain. Any content (string) argument passed will be displayed in the curtain as raw HTML.\n * CSS (object) can be passed which will apply styles to the curtain and its content.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n show: function(content, css){\n if (!this.curtain.showing){\n this.curtain.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-curtain\").attr(\"id\", this.id + \".curtain\");\n this.curtain.content_selector = this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-content\");\n this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-dismiss\").html(\"Dismiss\")\n .on(\"click\", function(){\n this.curtain.hide();\n }.bind(this));\n this.curtain.showing = true;\n }\n return this.curtain.update(content, css);\n }.bind(this),\n\n /**\n * Update the content and css of the curtain that's currently being shown. This method also adjusts the size\n * and positioning of the curtain to ensure it still covers the entire panel with no overlap.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n update: function(content, css){\n if (!this.curtain.showing){ return this.curtain; }\n clearTimeout(this.curtain.hide_delay);\n // Apply CSS if provided\n if (typeof css == \"object\"){\n this.curtain.selector.style(css);\n }\n // Update size and position\n var page_origin = this.getPageOrigin();\n this.curtain.selector.style({\n top: page_origin.y + \"px\",\n left: page_origin.x + \"px\",\n width: this.layout.width + \"px\",\n height: this.layout.height + \"px\"\n });\n this.curtain.content_selector.style({\n \"max-width\": (this.layout.width - 40) + \"px\",\n \"max-height\": (this.layout.height - 40) + \"px\"\n });\n // Apply content if provided\n if (typeof content == \"string\"){\n this.curtain.content_selector.html(content);\n }\n return this.curtain;\n }.bind(this),\n\n /**\n * Remove the curtain\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.curtain.showing){ return this.curtain; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.curtain.hide_delay);\n this.curtain.hide_delay = setTimeout(this.curtain.hide, delay);\n return this.curtain;\n }\n // Remove curtain\n this.curtain.selector.remove();\n this.curtain.selector = null;\n this.curtain.content_selector = null;\n this.curtain.showing = false;\n return this.curtain;\n }.bind(this)\n };\n return curtain;\n};\n\n/**\n * Generate a loader object for a plot, panel, or any other subdivision of a layout\n *\n * The panel loader is a small HTML overlay that appears in the lower left corner of the panel. It cannot be styled\n * arbitrarily, but can show a custom message and show a minimalist loading bar that can be updated to specific\n * completion percentages or be animated.\n * TODO Improve type documentation\n * @returns {object}\n */\nLocusZoom.generateLoader = function(){\n var loader = {\n showing: false,\n selector: null,\n content_selector: null,\n progress_selector: null,\n cancel_selector: null,\n\n /**\n * Show a loading indicator\n * @param {string} [content='Loading...'] Loading message (displayed as raw HTML)\n */\n show: function(content){\n // Generate loader\n if (!this.loader.showing){\n this.loader.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-loader\").attr(\"id\", this.id + \".loader\");\n this.loader.content_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-content\");\n this.loader.progress_selector = this.loader.selector\n .append(\"div\").attr(\"class\", \"lz-loader-progress-container\")\n .append(\"div\").attr(\"class\", \"lz-loader-progress\");\n /* TODO: figure out how to make this cancel button work\n this.loader.cancel_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-cancel\").html(\"Cancel\")\n .on(\"click\", function(){\n this.loader.hide();\n }.bind(this));\n */\n this.loader.showing = true;\n if (typeof content == \"undefined\"){ content = \"Loading...\"; }\n }\n return this.loader.update(content);\n }.bind(this),\n\n /**\n * Update the currently displayed loader and ensure the new content is positioned correctly.\n * @param {string} content The text to display (as raw HTML). If not a string, will be ignored.\n * @param {number} [percent] A number from 1-100. If a value is specified, it will stop all animations\n * in progress.\n */\n update: function(content, percent){\n if (!this.loader.showing){ return this.loader; }\n clearTimeout(this.loader.hide_delay);\n // Apply content if provided\n if (typeof content == \"string\"){\n this.loader.content_selector.html(content);\n }\n // Update size and position\n var padding = 6; // is there a better place to store/define this?\n var page_origin = this.getPageOrigin();\n var loader_boundrect = this.loader.selector.node().getBoundingClientRect();\n this.loader.selector.style({\n top: (page_origin.y + this.layout.height - loader_boundrect.height - padding) + \"px\",\n left: (page_origin.x + padding) + \"px\"\n });\n /* Uncomment this code when a functional cancel button can be shown\n var cancel_boundrect = this.loader.cancel_selector.node().getBoundingClientRect();\n this.loader.content_selector.style({\n \"padding-right\": (cancel_boundrect.width + padding) + \"px\"\n });\n */\n // Apply percent if provided\n if (typeof percent == \"number\"){\n this.loader.progress_selector.style({\n width: (Math.min(Math.max(percent, 1), 100)) + \"%\"\n });\n }\n return this.loader;\n }.bind(this),\n\n /**\n * Adds a class to the loading bar that makes it loop infinitely in a loading animation. Useful when exact\n * percent progress is not available.\n */\n animate: function(){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", true);\n return this.loader;\n }.bind(this),\n\n /**\n * Sets the loading bar in the loader to percentage width equal to the percent (number) value passed. Percents\n * will automatically be limited to a range of 1 to 100. Will stop all animations in progress.\n */\n setPercentCompleted: function(percent){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", false);\n return this.loader.update(null, percent);\n }.bind(this),\n\n /**\n * Remove the loader\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.loader.showing){ return this.loader; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.loader.hide_delay);\n this.loader.hide_delay = setTimeout(this.loader.hide, delay);\n return this.loader;\n }\n // Remove loader\n this.loader.selector.remove();\n this.loader.selector = null;\n this.loader.content_selector = null;\n this.loader.progress_selector = null;\n this.loader.cancel_selector = null;\n this.loader.showing = false;\n return this.loader;\n }.bind(this)\n };\n return loader;\n};\n\n/**\n * Create a new subclass following classical inheritance patterns. Some registry singletons use this internally to\n * enable code reuse and customization of known LZ core functionality.\n *\n * @param {Function} parent A parent class constructor that will be extended by the child class\n * @param {Object} extra An object of additional properties and methods to add/override behavior for the child class.\n * The special \"constructor\" property can be used to specify a custom constructor, or it will call parent by default.\n * Implementer must manage super calls when overriding the constructor.\n * @returns {Function} The constructor for the new child class\n */\nLocusZoom.subclass = function(parent, extra) {\n if (typeof parent !== \"function\" ) {\n throw \"Parent must be a callable constructor\";\n }\n\n extra = extra || {};\n var Sub = extra.hasOwnProperty(\"constructor\") ? extra.constructor : function() {\n parent.apply(this, arguments);\n };\n\n Sub.prototype = Object.create(parent.prototype);\n Object.keys(extra).forEach(function(k) {\n Sub.prototype[k] = extra[k];\n });\n return Sub;\n};\n\n\n/**\n * LocusZoom optional extensions will live under this namespace.\n *\n * Extension code is not part of the core LocusZoom app.js bundle.\n * @namespace\n * @public\n */\nLocusZoom.ext = {};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * Manage known layouts for all parts of the LocusZoom plot\n *\n * This registry allows for layouts to be reused and customized many times on a page, using a common base pattern.\n * It handles the work of ensuring that each new instance of the layout has no shared state with other copies.\n *\n * @class\n */\nLocusZoom.Layouts = (function() {\n var obj = {};\n var layouts = {\n \"plot\": {},\n \"panel\": {},\n \"data_layer\": {},\n \"dashboard\": {},\n \"tooltip\": {}\n };\n\n /**\n * Generate a layout configuration object\n * @param {('plot'|'panel'|'data_layer'|'dashboard'|'tooltip')} type The type of layout to retrieve\n * @param {string} name Identifier of the predefined layout within the specified type\n * @param {object} [modifications] Custom properties that override default settings for this layout\n * @returns {object} A JSON-serializable object representation\n */\n obj.get = function(type, name, modifications) {\n if (typeof type != \"string\" || typeof name != \"string\") {\n throw(\"invalid arguments passed to LocusZoom.Layouts.get, requires string (layout type) and string (layout name)\");\n } else if (layouts[type][name]) {\n // Get the base layout\n var layout = LocusZoom.Layouts.merge(modifications || {}, layouts[type][name]);\n // If \"unnamespaced\" is true then strike that from the layout and return the layout without namespacing\n if (layout.unnamespaced){\n delete layout.unnamespaced;\n return JSON.parse(JSON.stringify(layout));\n }\n // Determine the default namespace for namespaced values\n var default_namespace = \"\";\n if (typeof layout.namespace == \"string\"){\n default_namespace = layout.namespace;\n } else if (typeof layout.namespace == \"object\" && Object.keys(layout.namespace).length){\n if (typeof layout.namespace.default != \"undefined\"){\n default_namespace = layout.namespace.default;\n } else {\n default_namespace = layout.namespace[Object.keys(layout.namespace)[0]].toString();\n }\n }\n default_namespace += default_namespace.length ? \":\" : \"\";\n // Apply namespaces to layout, recursively\n var applyNamespaces = function(element, namespace){\n if (namespace){\n if (typeof namespace == \"string\"){\n namespace = { default: namespace }; \n }\n } else {\n namespace = { default: \"\" };\n }\n if (typeof element == \"string\"){\n var re = /\\{\\{namespace(\\[[A-Za-z_0-9]+\\]|)\\}\\}/g;\n var match, base, key, resolved_namespace;\n var replace = [];\n while ((match = re.exec(element)) !== null){\n base = match[0];\n key = match[1].length ? match[1].replace(/(\\[|\\])/g,\"\") : null;\n resolved_namespace = default_namespace;\n if (namespace != null && typeof namespace == \"object\" && typeof namespace[key] != \"undefined\"){\n resolved_namespace = namespace[key] + (namespace[key].length ? \":\" : \"\");\n }\n replace.push({ base: base, namespace: resolved_namespace });\n }\n for (var r in replace){\n element = element.replace(replace[r].base, replace[r].namespace);\n }\n } else if (typeof element == \"object\" && element != null){\n if (typeof element.namespace != \"undefined\"){\n var merge_namespace = (typeof element.namespace == \"string\") ? { default: element.namespace } : element.namespace;\n namespace = LocusZoom.Layouts.merge(namespace, merge_namespace);\n }\n var namespaced_element, namespaced_property;\n for (var property in element) {\n if (property === \"namespace\"){ continue; }\n namespaced_element = applyNamespaces(element[property], namespace);\n namespaced_property = applyNamespaces(property, namespace);\n if (property !== namespaced_property){\n delete element[property];\n }\n element[namespaced_property] = namespaced_element;\n }\n }\n return element;\n };\n layout = applyNamespaces(layout, layout.namespace);\n // Return the layout as valid JSON only\n return JSON.parse(JSON.stringify(layout));\n } else {\n throw(\"layout type [\" + type + \"] name [\" + name + \"] not found\");\n }\n };\n\n /** @private */\n obj.set = function(type, name, layout) {\n if (typeof type != \"string\" || typeof name != \"string\" || typeof layout != \"object\"){\n throw (\"unable to set new layout; bad arguments passed to set()\");\n }\n if (!layouts[type]){\n layouts[type] = {};\n }\n if (layout){\n return (layouts[type][name] = JSON.parse(JSON.stringify(layout)));\n } else {\n delete layouts[type][name];\n return null;\n }\n };\n\n /**\n * Register a new layout definition by name.\n *\n * @param {string} type The type of layout to add. Usually, this will be one of the predefined LocusZoom types,\n * but if you pass a different name, this method will automatically create the new `type` bucket\n * @param {string} name The identifier of the newly added layout\n * @param {object} [layout] A JSON-serializable object containing configuration properties for this layout\n * @returns The JSON representation of the newly created layout\n */\n obj.add = function(type, name, layout) {\n return obj.set(type, name, layout);\n };\n\n /**\n * List all registered layouts\n * @param [type] Optionally narrow the list to only layouts of a specific type; else return all known layouts\n * @returns {*}\n */\n obj.list = function(type) {\n if (!layouts[type]){\n var list = {};\n Object.keys(layouts).forEach(function(type){\n list[type] = Object.keys(layouts[type]);\n });\n return list;\n } else {\n return Object.keys(layouts[type]);\n }\n };\n\n /**\n * A helper method used for merging two objects. If a key is present in both, takes the value from the first object\n * Values from `default_layout` will be cleanly copied over, ensuring no references or shared state.\n *\n * Frequently used for preparing custom layouts. Both objects should be JSON-serializable.\n *\n * @param {object} custom_layout An object containing configuration parameters that override or add to defaults\n * @param {object} default_layout An object containing default settings.\n * @returns The custom layout is modified in place and also returned from this method.\n */\n obj.merge = function (custom_layout, default_layout) {\n if (typeof custom_layout !== \"object\" || typeof default_layout !== \"object\"){\n throw(\"LocusZoom.Layouts.merge only accepts two layout objects; \" + (typeof custom_layout) + \", \" + (typeof default_layout) + \" given\");\n }\n for (var property in default_layout) {\n if (!default_layout.hasOwnProperty(property)){ continue; }\n // Get types for comparison. Treat nulls in the custom layout as undefined for simplicity.\n // (javascript treats nulls as \"object\" when we just want to overwrite them as if they're undefined)\n // Also separate arrays from objects as a discrete type.\n var custom_type = custom_layout[property] === null ? \"undefined\" : typeof custom_layout[property];\n var default_type = typeof default_layout[property];\n if (custom_type === \"object\" && Array.isArray(custom_layout[property])){ custom_type = \"array\"; }\n if (default_type === \"object\" && Array.isArray(default_layout[property])){ default_type = \"array\"; }\n // Unsupported property types: throw an exception\n if (custom_type === \"function\" || default_type === \"function\"){\n throw(\"LocusZoom.Layouts.merge encountered an unsupported property type\");\n }\n // Undefined custom value: pull the default value\n if (custom_type === \"undefined\"){\n custom_layout[property] = JSON.parse(JSON.stringify(default_layout[property]));\n continue;\n }\n // Both values are objects: merge recursively\n if (custom_type === \"object\" && default_type === \"object\"){\n custom_layout[property] = LocusZoom.Layouts.merge(custom_layout[property], default_layout[property]);\n continue;\n }\n }\n return custom_layout;\n };\n\n return obj;\n})();\n\n\n/**\n * Tooltip Layouts\n * @namespace LocusZoom.Layouts.tooltips\n */\n\n// TODO: Improve documentation of predefined types within layout namespaces\nLocusZoom.Layouts.add(\"tooltip\", \"standard_association\", {\n namespace: { \"assoc\": \"assoc\" },\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[assoc]}}variant}}
      \"\n + \"P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
      \"\n + \"Ref. Allele: {{{{namespace[assoc]}}ref_allele}}
      \"\n + \"Make LD Reference
      \"\n});\n\nvar covariates_model_association = LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true });\ncovariates_model_association.html += \"Condition on Variant
      \";\nLocusZoom.Layouts.add(\"tooltip\", \"covariates_model_association\", covariates_model_association);\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_genes\", {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"

      {{gene_name}}

      \"\n + \"
      Gene ID: {{gene_id}}
      \"\n + \"
      Transcript ID: {{transcript_id}}
      \"\n + \"
      \"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"
      ConstraintExpected variantsObserved variantsConst. Metric
      Synonymous{{exp_syn}}{{n_syn}}z = {{syn_z}}
      Missense{{exp_mis}}{{n_mis}}z = {{mis_z}}
      LoF{{exp_lof}}{{n_lof}}pLI = {{pLI}}
      \"\n + \"More data on ExAC\"\n});\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n closable: false,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[intervals]}}state_name}}
      {{{{namespace[intervals]}}start}}-{{{{namespace[intervals]}}end}}\"\n});\n\n/**\n * Data Layer Layouts: represent specific information from a data source\n * @namespace Layouts.data_layer\n*/\n\nLocusZoom.Layouts.add(\"data_layer\", \"significance\", {\n id: \"significance\",\n type: \"orthogonal_line\",\n orientation: \"horizontal\",\n offset: 4.522\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"recomb_rate\", {\n namespace: { \"recomb\": \"recomb\" },\n id: \"recombrate\",\n type: \"line\",\n fields: [\"{{namespace[recomb]}}position\", \"{{namespace[recomb]}}recomb_rate\"],\n z_index: 1,\n style: {\n \"stroke\": \"#0000FF\",\n \"stroke-width\": \"1.5px\"\n },\n x_axis: {\n field: \"{{namespace[recomb]}}position\"\n },\n y_axis: {\n axis: 2,\n field: \"{{namespace[recomb]}}recomb_rate\",\n floor: 0,\n ceiling: 100\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"association_pvalues\", {\n namespace: { \"assoc\": \"assoc\", \"ld\": \"ld\" },\n id: \"associationpvalues\",\n type: \"scatter\",\n point_shape: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"diamond\",\n else: \"circle\"\n }\n },\n point_size: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: 80,\n else: 40\n }\n },\n color: [\n {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"#9632b8\"\n }\n },\n {\n scale_function: \"numerical_bin\",\n field: \"{{namespace[ld]}}state\",\n parameters: {\n breaks: [0, 0.2, 0.4, 0.6, 0.8],\n values: [\"#357ebd\",\"#46b8da\",\"#5cb85c\",\"#eea236\",\"#d43f3a\"]\n }\n },\n \"#B8B8B8\"\n ],\n legend: [\n { shape: \"diamond\", color: \"#9632b8\", size: 40, label: \"LD Ref Var\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#d43f3a\", size: 40, label: \"1.0 > r² ≥ 0.8\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#eea236\", size: 40, label: \"0.8 > r² ≥ 0.6\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#5cb85c\", size: 40, label: \"0.6 > r² ≥ 0.4\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#46b8da\", size: 40, label: \"0.4 > r² ≥ 0.2\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#357ebd\", size: 40, label: \"0.2 > r² ≥ 0.0\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#B8B8B8\", size: 40, label: \"no r² data\", class: \"lz-data_layer-scatter\" }\n ],\n fields: [\"{{namespace[assoc]}}variant\", \"{{namespace[assoc]}}position\", \"{{namespace[assoc]}}log_pvalue\", \"{{namespace[assoc]}}log_pvalue|logtoscinotation\", \"{{namespace[assoc]}}ref_allele\", \"{{namespace[ld]}}state\", \"{{namespace[ld]}}isrefvar\"],\n id_field: \"{{namespace[assoc]}}variant\",\n z_index: 2,\n x_axis: {\n field: \"{{namespace[assoc]}}position\"\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[assoc]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.10,\n min_extent: [ 0, 10 ]\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"phewas_pvalues\", {\n namespace: {\"phewas\": \"phewas\"},\n id: \"phewaspvalues\",\n type: \"category_scatter\",\n point_shape: \"circle\",\n point_size: 70,\n tooltip_positioning: \"vertical\",\n id_field: \"{{namespace[phewas]}}id\",\n fields: [\"{{namespace[phewas]}}id\", \"{{namespace[phewas]}}log_pvalue\", \"{{namespace[phewas]}}trait_group\", \"{{namespace[phewas]}}trait_label\"],\n x_axis: {\n field: \"{{namespace[phewas]}}x\", // Synthetic/derived field added by `category_scatter` layer\n category_field: \"{{namespace[phewas]}}trait_group\",\n lower_buffer: 0.025,\n upper_buffer: 0.025\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[phewas]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.15\n },\n color: {\n field: \"{{namespace[phewas]}}trait_group\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [],\n values: [],\n null_value: \"#B8B8B8\"\n }\n },\n fill_opacity: 0.7,\n tooltip: {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: [\n \"Trait: {{{{namespace[phewas]}}trait_label|htmlescape}}
      \",\n \"Trait Category: {{{{namespace[phewas]}}trait_group|htmlescape}}
      \",\n \"P-value: {{{{namespace[phewas]}}log_pvalue|logtoscinotation|htmlescape}}
      \"\n ].join(\"\")\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n label: {\n text: \"{{{{namespace[phewas]}}trait_label}}\",\n spacing: 6,\n lines: {\n style: {\n \"stroke-width\": \"2px\",\n \"stroke\": \"#333333\",\n \"stroke-dasharray\": \"2px 2px\"\n }\n },\n filters: [\n {\n field: \"{{namespace[phewas]}}log_pvalue\",\n operator: \">=\",\n value: 20\n }\n ],\n style: {\n \"font-size\": \"14px\",\n \"font-weight\": \"bold\",\n \"fill\": \"#333333\"\n }\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genes\", {\n namespace: { \"gene\": \"gene\", \"constraint\": \"constraint\" },\n id: \"genes\",\n type: \"genes\",\n fields: [\"{{namespace[gene]}}all\", \"{{namespace[constraint]}}all\"],\n id_field: \"gene_id\",\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_genes\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genome_legend\", {\n namespace: { \"genome\": \"genome\" },\n id: \"genome_legend\",\n type: \"genome_legend\",\n fields: [\"{{namespace[genome]}}chr\", \"{{namespace[genome]}}base_pairs\"],\n x_axis: {\n floor: 0,\n ceiling: 2881033286\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n id: \"intervals\",\n type: \"intervals\",\n fields: [\"{{namespace[intervals]}}start\",\"{{namespace[intervals]}}end\",\"{{namespace[intervals]}}state_id\",\"{{namespace[intervals]}}state_name\"],\n id_field: \"{{namespace[intervals]}}start\",\n start_field: \"{{namespace[intervals]}}start\",\n end_field: \"{{namespace[intervals]}}end\",\n track_split_field: \"{{namespace[intervals]}}state_id\",\n split_tracks: true,\n always_hide_legend: false,\n color: {\n field: \"{{namespace[intervals]}}state_id\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [1,2,3,4,5,6,7,8,9,10,11,12,13],\n values: [\"rgb(212,63,58)\", \"rgb(250,120,105)\", \"rgb(252,168,139)\", \"rgb(240,189,66)\", \"rgb(250,224,105)\", \"rgb(240,238,84)\", \"rgb(244,252,23)\", \"rgb(23,232,252)\", \"rgb(32,191,17)\", \"rgb(23,166,77)\", \"rgb(32,191,17)\", \"rgb(162,133,166)\", \"rgb(212,212,212)\"],\n null_value: \"#B8B8B8\"\n }\n },\n legend: [\n { shape: \"rect\", color: \"rgb(212,63,58)\", width: 9, label: \"Active Promoter\", \"{{namespace[intervals]}}state_id\": 1 },\n { shape: \"rect\", color: \"rgb(250,120,105)\", width: 9, label: \"Weak Promoter\", \"{{namespace[intervals]}}state_id\": 2 },\n { shape: \"rect\", color: \"rgb(252,168,139)\", width: 9, label: \"Poised Promoter\", \"{{namespace[intervals]}}state_id\": 3 },\n { shape: \"rect\", color: \"rgb(240,189,66)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 4 },\n { shape: \"rect\", color: \"rgb(250,224,105)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 5 },\n { shape: \"rect\", color: \"rgb(240,238,84)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 6 },\n { shape: \"rect\", color: \"rgb(244,252,23)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 7 },\n { shape: \"rect\", color: \"rgb(23,232,252)\", width: 9, label: \"Insulator\", \"{{namespace[intervals]}}state_id\": 8 },\n { shape: \"rect\", color: \"rgb(32,191,17)\", width: 9, label: \"Transcriptional transition\", \"{{namespace[intervals]}}state_id\": 9 },\n { shape: \"rect\", color: \"rgb(23,166,77)\", width: 9, label: \"Transcriptional elongation\", \"{{namespace[intervals]}}state_id\": 10 },\n { shape: \"rect\", color: \"rgb(136,240,129)\", width: 9, label: \"Weak transcribed\", \"{{namespace[intervals]}}state_id\": 11 },\n { shape: \"rect\", color: \"rgb(162,133,166)\", width: 9, label: \"Polycomb-repressed\", \"{{namespace[intervals]}}state_id\": 12 },\n { shape: \"rect\", color: \"rgb(212,212,212)\", width: 9, label: \"Heterochromatin / low signal\", \"{{namespace[intervals]}}state_id\": 13 }\n ],\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_intervals\", { unnamespaced: true })\n});\n\n/**\n * Dashboard Layouts: toolbar buttons etc\n * @namespace Layouts.dashboard\n */\nLocusZoom.Layouts.add(\"dashboard\", \"standard_panel\", {\n components: [\n {\n type: \"remove_panel\",\n position: \"right\",\n color: \"red\",\n group_position: \"end\"\n },\n {\n type: \"move_panel_up\",\n position: \"right\",\n group_position: \"middle\"\n },\n {\n type: \"move_panel_down\",\n position: \"right\",\n group_position: \"start\",\n style: { \"margin-left\": \"0.75em\" }\n }\n ]\n}); \n\nLocusZoom.Layouts.add(\"dashboard\", \"standard_plot\", {\n components: [\n {\n type: \"title\",\n title: \"LocusZoom\",\n subtitle: \"v\" + LocusZoom.version + \"\",\n position: \"left\"\n },\n {\n type: \"dimensions\",\n position: \"right\"\n },\n {\n type: \"region_scale\",\n position: \"right\"\n },\n {\n type: \"download\",\n position: \"right\"\n }\n ]\n});\n\nvar covariates_model_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\ncovariates_model_plot_dashboard.components.push({\n type: \"covariates_model\",\n button_html: \"Model\",\n button_title: \"Show and edit covariates currently in model\",\n position: \"left\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"covariates_model_plot\", covariates_model_plot_dashboard);\n\nvar region_nav_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 500000,\n button_html: \">>\",\n position: \"right\",\n group_position: \"end\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 50000,\n button_html: \">\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: 0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: -0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -50000,\n button_html: \"<\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -500000,\n button_html: \"<<\",\n position: \"right\",\n group_position: \"start\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"region_nav_plot\", region_nav_plot_dashboard);\n\n/**\n * Panel Layouts\n * @namespace Layouts.panel\n */\n\nLocusZoom.Layouts.add(\"panel\", \"association\", {\n id: \"association\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 200,\n proportional_width: 1,\n margin: { top: 35, right: 50, bottom: 40, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_legend\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n },\n y2: {\n label: \"Recombination Rate (cM/Mb)\",\n label_offset: 40\n }\n },\n legend: {\n orientation: \"vertical\",\n origin: { x: 55, y: 40 },\n hidden: true\n },\n interaction: {\n drag_background_to_pan: true,\n drag_x_ticks_to_scale: true,\n drag_y1_ticks_to_scale: true,\n drag_y2_ticks_to_scale: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"recomb_rate\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"association_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genes\", {\n id: \"genes\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 112.5,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 20, left: 50 },\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"resize_to_data\",\n position: \"right\"\n });\n return l;\n })(), \n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genes\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"phewas\", {\n id: \"phewas\",\n width: 800,\n height: 300,\n min_width: 800,\n min_height: 300,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 120, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n axes: {\n x: {\n ticks: { // Object based config (shared defaults; allow layers to specify ticks)\n style: {\n \"font-weight\": \"bold\",\n \"font-size\": \"11px\",\n \"text-anchor\": \"start\"\n },\n transform: \"rotate(50)\",\n position: \"left\" // Special param recognized by `category_scatter` layers\n }\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"phewas_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genome_legend\", {\n id: \"genome_legend\",\n width: 800,\n height: 50,\n origin: { x: 0, y: 300 },\n min_width: 800,\n min_height: 50,\n proportional_width: 1,\n margin: { top: 0, right: 50, bottom: 35, left: 50 },\n axes: {\n x: {\n label: \"Genomic Position (number denotes chromosome)\",\n label_offset: 35,\n ticks: [\n {\n x: 124625310,\n text: \"1\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 370850307,\n text: \"2\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 591461209,\n text: \"3\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 786049562,\n text: \"4\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 972084330,\n text: \"5\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1148099493,\n text: \"6\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1313226358,\n text: \"7\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1465977701,\n text: \"8\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1609766427,\n text: \"9\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1748140516,\n text: \"10\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1883411148,\n text: \"11\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2017840353,\n text: \"12\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2142351240,\n text: \"13\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2253610949,\n text: \"14\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2358551415,\n text: \"15\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2454994487,\n text: \"16\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2540769469,\n text: \"17\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2620405698,\n text: \"18\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2689008813,\n text: \"19\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2750086065,\n text: \"20\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2805663772,\n text: \"21\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2855381003,\n text: \"22\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n }\n ]\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genome_legend\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"intervals\", {\n id: \"intervals\",\n width: 1000,\n height: 50,\n min_width: 500,\n min_height: 50,\n margin: { top: 25, right: 150, bottom: 5, left: 50 },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_split_tracks\",\n data_layer_id: \"intervals\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n legend: {\n hidden: true,\n orientation: \"horizontal\",\n origin: { x: 50, y: 0 },\n pad_from_bottom: 5\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"intervals\", { unnamespaced: true })\n ]\n});\n\n\n/**\n * Plot Layouts\n * @namespace Layouts.plot\n */\n\nLocusZoom.Layouts.add(\"plot\", \"standard_association\", {\n state: {},\n width: 800,\n height: 450,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, proportional_height: 0.5 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, proportional_height: 0.5 })\n ]\n});\n\n// Shortcut to \"StandardLayout\" for backward compatibility\nLocusZoom.StandardLayout = LocusZoom.Layouts.get(\"plot\", \"standard_association\");\n\nLocusZoom.Layouts.add(\"plot\", \"standard_phewas\", {\n width: 800,\n height: 600,\n min_width: 800,\n min_height: 600,\n responsive_resize: true,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true } ),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"phewas\", { unnamespaced: true, proportional_height: 0.45 }),\n LocusZoom.Layouts.get(\"panel\", \"genome_legend\", { unnamespaced: true, proportional_height: 0.1 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", {\n unnamespaced: true, proportional_height: 0.45,\n margin: { bottom: 40 },\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n }\n }\n })\n ],\n mouse_guide: false\n});\n\nLocusZoom.Layouts.add(\"plot\", \"interval_association\", {\n state: {},\n width: 800,\n height: 550,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, width: 800, proportional_height: (225/570) }),\n LocusZoom.Layouts.get(\"panel\", \"intervals\", { unnamespaced: true, proportional_height: (120/570) }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, width: 800, proportional_height: (225/570) })\n ]\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A data layer is an abstract class representing a data set and its graphical representation within a panel\n * @public\n * @class\n * @param {Object} layout A JSON-serializable object describing the layout for this layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n*/\nLocusZoom.DataLayer = function(layout, parent) {\n /** @member {Boolean} */\n this.initialized = false;\n /** @member {Number} */\n this.layout_idx = null;\n\n /** @member {String} */\n this.id = null;\n /** @member {LocusZoom.Panel} */\n this.parent = parent || null;\n /**\n * @member {{group: d3.selection, container: d3.selection, clipRect: d3.selection}}\n */\n this.svg = {};\n\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n if (typeof parent != \"undefined\" && parent instanceof LocusZoom.Panel){ this.parent_plot = parent.parent; }\n\n /** @member {Object} */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.DataLayer.DefaultLayout);\n if (this.layout.id){ this.id = this.layout.id; }\n\n // Ensure any axes defined in the layout have an explicit axis number (default: 1)\n if (this.layout.x_axis !== {} && typeof this.layout.x_axis.axis !== \"number\"){ this.layout.x_axis.axis = 1; }\n if (this.layout.y_axis !== {} && typeof this.layout.y_axis.axis !== \"number\"){ this.layout.y_axis.axis = 1; }\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original data layer state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n /** @member {Object} */\n this.state = {};\n /** @member {String} */\n this.state_id = null;\n\n this.setDefaultState();\n\n // Initialize parameters for storing data and tool tips\n /** @member {Array} */\n this.data = [];\n if (this.layout.tooltip){\n /** @member {Object} */\n this.tooltips = {};\n }\n\n // Initialize flags for tracking global statuses\n this.global_statuses = {\n \"highlighted\": false,\n \"selected\": false,\n \"faded\": false,\n \"hidden\": false\n };\n \n return this;\n\n};\n\n/**\n * Instruct this datalayer to begin tracking additional fields from data sources (does not guarantee that such a field actually exists)\n *\n * Custom plots can use this to dynamically extend datalayer functionality after the plot is drawn\n *\n * (since removing core fields may break layer functionality, there is presently no hook for the inverse behavior)\n * @param fieldName\n * @param namespace\n * @param {String|String[]} transformations The name (or array of names) of transformations to apply to this field\n * @returns {String} The raw string added to the fields array\n */\nLocusZoom.DataLayer.prototype.addField = function(fieldName, namespace, transformations) {\n if (!fieldName || !namespace) {\n throw \"Must specify field name and namespace to use when adding field\";\n }\n var fieldString = namespace + \":\" + fieldName;\n if (transformations) {\n fieldString += \"|\";\n if (typeof transformations === \"string\") {\n fieldString += transformations;\n } else if (Array.isArray(transformations)) {\n fieldString += transformations.join(\"|\");\n } else {\n throw \"Must provide transformations as either a string or array of strings\";\n }\n }\n var fields = this.layout.fields;\n if (fields.indexOf(fieldString) === -1) {\n fields.push(fieldString);\n }\n return fieldString;\n};\n\n/**\n * Define default state that should get tracked during the lifetime of this layer.\n *\n * In some special custom usages, it may be useful to completely reset a panel (eg \"click for\n * genome region\" links), plotting new data that invalidates any previously tracked state. This hook makes it\n * possible to reset without destroying the panel entirely. It is used by `Plot.clearPanelData`.\n */\nLocusZoom.DataLayer.prototype.setDefaultState = function() {\n // Define state parameters specific to this data layer. Within plot state, this will live under a key\n // `panel_name.layer_name`.\n if (this.parent){\n this.state = this.parent.state;\n this.state_id = this.parent.id + \".\" + this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n this.state[this.state_id][status] = this.state[this.state_id][status] || [];\n }.bind(this));\n }\n};\n\n/**\n * A basic description of keys expected in a layout. Not intended to be directly used or modified by an end user.\n * @protected\n * @type {{type: string, fields: Array, x_axis: {}, y_axis: {}}}\n */\nLocusZoom.DataLayer.DefaultLayout = {\n type: \"\",\n fields: [],\n x_axis: {},\n y_axis: {}\n};\n\n/**\n * Available statuses that individual elements can have. Each status is described by\n * a verb/antiverb and an adjective. Verbs and antiverbs are used to generate data layer\n * methods for updating the status on one or more elements. Adjectives are used in class\n * names and applied or removed from elements to have a visual representation of the status,\n * as well as used as keys in the state for tracking which elements are in which status(es)\n * @static\n * @type {{verbs: String[], adjectives: String[], menu_antiverbs: String[]}}\n */\nLocusZoom.DataLayer.Statuses = {\n verbs: [\"highlight\", \"select\", \"fade\", \"hide\"],\n adjectives: [\"highlighted\", \"selected\", \"faded\", \"hidden\"],\n menu_antiverbs: [\"unhighlight\", \"deselect\", \"unfade\", \"show\"]\n};\n\n/**\n * Get the fully qualified identifier for the data layer, prefixed by any parent or container elements\n *\n * @returns {string} A dot-delimited string of the format ..\n */\nLocusZoom.DataLayer.prototype.getBaseId = function(){\n return this.parent_plot.id + \".\" + this.parent.id + \".\" + this.id;\n};\n\n/**\n * Determine the pixel height of data-bound objects represented inside this data layer. (excluding elements such as axes)\n *\n * May be used by operations that resize the data layer to fit available data\n *\n * @public\n * @returns {number}\n */\nLocusZoom.DataLayer.prototype.getAbsoluteDataHeight = function(){\n var dataBCR = this.svg.group.node().getBoundingClientRect();\n return dataBCR.height;\n};\n\n/**\n * Whether transitions can be applied to this data layer\n * @returns {boolean}\n */\nLocusZoom.DataLayer.prototype.canTransition = function(){\n if (!this.layout.transition){ return false; }\n return !(this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.panel_id);\n};\n\n/**\n * Fetch the fully qualified ID to be associated with a specific visual element, based on the data to which that\n * element is bound. In general this element ID will be unique, allowing it to be addressed directly via selectors.\n * @param {String|Object} element\n * @returns {String}\n */\nLocusZoom.DataLayer.prototype.getElementId = function(element){\n var element_id = \"element\";\n if (typeof element == \"string\"){\n element_id = element;\n } else if (typeof element == \"object\"){\n var id_field = this.layout.id_field || \"id\";\n if (typeof element[id_field] == \"undefined\"){\n throw(\"Unable to generate element ID\");\n }\n element_id = element[id_field].toString().replace(/\\W/g,\"\");\n }\n return (this.getBaseId() + \"-\" + element_id).replace(/(:|\\.|\\[|\\]|,)/g, \"_\");\n};\n\n/**\n * Fetch an ID that may bind a data element to a separate visual node for displaying status\n * Examples of this might be seperate visual nodes to show select/highlight statuses, or\n * even a common/shared node to show status across many elements in a set.\n * Abstract method. It should be overridden by data layers that implement seperate status\n * nodes specifically to the use case of the data layer type.\n * @param {String|Object} element\n * @returns {String|null}\n */\nLocusZoom.DataLayer.prototype.getElementStatusNodeId = function(element){\n return null;\n};\n\n/**\n * Returns a reference to the underlying data associated with a single visual element in the data layer, as\n * referenced by the unique identifier for the element\n\n * @param {String} id The unique identifier for the element, as defined by `getElementId`\n * @returns {Object|null} The data bound to that element\n */\nLocusZoom.DataLayer.prototype.getElementById = function(id){\n var selector = d3.select(\"#\" + id.replace(/(:|\\.|\\[|\\]|,)/g, \"\\\\$1\"));\n if (!selector.empty() && selector.data() && selector.data().length){\n return selector.data()[0];\n } else {\n return null;\n }\n};\n\n/**\n * Basic method to apply arbitrary methods and properties to data elements.\n * This is called on all data immediately after being fetched.\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyDataMethods = function(){\n this.data.forEach(function(d, i){\n // Basic toHTML() method - return the stringified value in the id_field, if defined.\n this.data[i].toHTML = function(){\n var id_field = this.layout.id_field || \"id\";\n var html = \"\";\n if (this.data[i][id_field]){ html = this.data[i][id_field].toString(); }\n return html;\n }.bind(this);\n // getDataLayer() method - return a reference to the data layer\n this.data[i].getDataLayer = function(){\n return this;\n }.bind(this);\n // deselect() method - shortcut method to deselect the element\n this.data[i].deselect = function(){\n var data_layer = this.getDataLayer();\n data_layer.unselectElement(this);\n };\n }.bind(this));\n this.applyCustomDataMethods();\n return this;\n};\n\n/**\n * Hook that allows custom datalayers to apply additional methods and properties to data elements as needed\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyCustomDataMethods = function(){\n return this;\n};\n\n/**\n * Initialize a data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.initialize = function(){\n\n // Append a container group element to house the main data layer group element and the clip path\n this.svg.container = this.parent.svg.group.append(\"g\")\n .attr(\"class\", \"lz-data_layer-container\")\n .attr(\"id\", this.getBaseId() + \".data_layer_container\");\n \n // Append clip path to the container element\n this.svg.clipRect = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\")\n .append(\"rect\");\n \n // Append svg group for rendering all data layer elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".data_layer\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n return this;\n\n};\n\n/**\n * Move a data layer up relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveUp = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Move a data layer down relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveDown = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Apply scaling functions to an element or parameter as needed, based on its layout and the element's data\n * If the layout parameter is already a primitive type, simply return the value as given\n * @param {Array|Number|String|Object} layout\n * @param {*} data The value to be used with the filter\n * @returns {*} The transformed value\n */\nLocusZoom.DataLayer.prototype.resolveScalableParameter = function(layout, data){\n var ret = null;\n if (Array.isArray(layout)){\n var idx = 0;\n while (ret === null && idx < layout.length){\n ret = this.resolveScalableParameter(layout[idx], data);\n idx++;\n }\n } else {\n switch (typeof layout){\n case \"number\":\n case \"string\":\n ret = layout;\n break;\n case \"object\":\n if (layout.scale_function){\n if(layout.field) {\n var f = new LocusZoom.Data.Field(layout.field);\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, f.resolve(data));\n } else {\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, data);\n }\n }\n break;\n }\n }\n return ret;\n};\n\n/**\n * Generate dimension extent function based on layout parameters\n * @param {('x'|'y')} dimension\n */\nLocusZoom.DataLayer.prototype.getAxisExtent = function(dimension){\n\n if ([\"x\", \"y\"].indexOf(dimension) === -1){\n throw(\"Invalid dimension identifier passed to LocusZoom.DataLayer.getAxisExtent()\");\n }\n\n var axis_name = dimension + \"_axis\";\n var axis_layout = this.layout[axis_name];\n\n // If a floor AND a ceiling are explicitly defined then just return that extent and be done\n if (!isNaN(axis_layout.floor) && !isNaN(axis_layout.ceiling)){\n return [+axis_layout.floor, +axis_layout.ceiling];\n }\n\n // If a field is defined for the axis and the data layer has data then generate the extent from the data set\n var data_extent = [];\n if (axis_layout.field && this.data) {\n if (!this.data.length) {\n // If data has been fetched (but no points in region), enforce the min_extent (with no buffers,\n // because we don't need padding around an empty screen)\n data_extent = axis_layout.min_extent || [];\n return data_extent;\n } else {\n data_extent = d3.extent(this.data, function (d) {\n var f = new LocusZoom.Data.Field(axis_layout.field);\n return +f.resolve(d);\n });\n\n // Apply upper/lower buffers, if applicable\n var original_extent_span = data_extent[1] - data_extent[0];\n if (!isNaN(axis_layout.lower_buffer)) {\n data_extent[0] -= original_extent_span * axis_layout.lower_buffer;\n }\n if (!isNaN(axis_layout.upper_buffer)) {\n data_extent[1] += original_extent_span * axis_layout.upper_buffer;\n }\n\n if (typeof axis_layout.min_extent == \"object\") {\n // The data should span at least the range specified by min_extent, an array with [low, high]\n var range_min = axis_layout.min_extent[0];\n var range_max = axis_layout.min_extent[1];\n if (!isNaN(range_min) && !isNaN(range_max)) {\n data_extent[0] = Math.min(data_extent[0], range_min);\n }\n if (!isNaN(range_max)) {\n data_extent[1] = Math.max(data_extent[1], range_max);\n }\n }\n // If specified, floor and ceiling will override the actual data range\n return [\n isNaN(axis_layout.floor) ? data_extent[0] : axis_layout.floor,\n isNaN(axis_layout.ceiling) ? data_extent[1] : axis_layout.ceiling\n ];\n }\n }\n\n // If this is for the x axis and no extent could be generated yet but state has a defined start and end\n // then default to using the state-defined region as the extent\n if (dimension === \"x\" && !isNaN(this.state.start) && !isNaN(this.state.end)) {\n return [this.state.start, this.state.end];\n }\n\n // No conditions met for generating a valid extent, return an empty array\n return [];\n\n};\n\n/**\n * Allow this data layer to tell the panel what axis ticks it thinks it will require. The panel may choose whether\n * to use some, all, or none of these when rendering, either alone or in conjunction with other data layers.\n *\n * This method is a stub and should be overridden in data layers that need to specify custom behavior.\n *\n * @param {('x'|'y')} dimension\n * @param {Object} [config] Additional parameters for the panel to specify how it wants ticks to be drawn. The names\n * and meanings of these parameters may vary between different data layers.\n * @returns {Object[]}\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.DataLayer.prototype.getTicks = function (dimension, config) {\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw(\"Invalid dimension identifier\");\n }\n return [];\n};\n\n/**\n * Generate a tool tip for a given element\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.createTooltip = function(d, id){\n if (typeof this.layout.tooltip != \"object\"){\n throw (\"DataLayer [\" + this.id + \"] layout does not define a tooltip\");\n }\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n if (this.tooltips[id]){\n this.positionTooltip(id);\n return;\n }\n this.tooltips[id] = {\n data: d,\n arrow: null,\n selector: d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-data_layer-tooltip\")\n .attr(\"id\", id + \"-tooltip\")\n };\n this.updateTooltip(d);\n return this;\n};\n\n/**\n * Update a tool tip (generate its inner HTML)\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.updateTooltip = function(d, id){\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n // Empty the tooltip of all HTML (including its arrow!)\n this.tooltips[id].selector.html(\"\");\n this.tooltips[id].arrow = null;\n // Set the new HTML\n if (this.layout.tooltip.html){\n this.tooltips[id].selector.html(LocusZoom.parseFields(d, this.layout.tooltip.html));\n }\n // If the layout allows tool tips on this data layer to be closable then add the close button\n // and add padding to the tooltip to accommodate it\n if (this.layout.tooltip.closable){\n this.tooltips[id].selector.insert(\"button\", \":first-child\")\n .attr(\"class\", \"lz-tooltip-close-button\")\n .attr(\"title\", \"Close\")\n .text(\"×\")\n .on(\"click\", function(){\n this.destroyTooltip(id);\n }.bind(this));\n }\n // Apply data directly to the tool tip for easier retrieval by custom UI elements inside the tool tip\n this.tooltips[id].selector.data([d]);\n // Reposition and draw a new arrow\n this.positionTooltip(id);\n return this;\n};\n\n/**\n * Destroy tool tip - remove the tool tip element from the DOM and delete the tool tip's record on the data layer\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyTooltip = function(d, id){\n if (typeof d == \"string\"){\n id = d;\n } else if (typeof id == \"undefined\"){\n id = this.getElementId(d);\n }\n if (this.tooltips[id]){\n if (typeof this.tooltips[id].selector == \"object\"){\n this.tooltips[id].selector.remove();\n }\n delete this.tooltips[id];\n }\n return this;\n};\n\n/**\n * Loop through and destroy all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyAllTooltips = function(){\n for (var id in this.tooltips){\n this.destroyTooltip(id);\n }\n return this;\n};\n\n//\n/**\n * Position tool tip - naïve function to place a tool tip to the lower right of the current mouse element\n * Most data layers reimplement this method to position tool tips specifically for the data they display\n * @param {String} id The identifier of the tooltip to position\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n // Position the div itself\n this.tooltips[id].selector\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY) + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!this.tooltips[id].arrow){\n this.tooltips[id].arrow = this.tooltips[id].selector.append(\"div\")\n .style(\"position\", \"absolute\")\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_top_left\");\n }\n this.tooltips[id].arrow\n .style(\"left\", \"-1px\")\n .style(\"top\", \"-1px\");\n return this;\n};\n\n/**\n * Loop through and position all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionAllTooltips = function(){\n for (var id in this.tooltips){\n this.positionTooltip(id);\n }\n return this;\n};\n\n/**\n * Show or hide a tool tip by ID depending on directives in the layout and state values relative to the ID\n * @param {String|Object} element The element associated with the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.showOrHideTooltip = function(element){\n \n if (typeof this.layout.tooltip != \"object\"){ return; }\n var id = this.getElementId(element);\n\n var resolveStatus = function(statuses, directive, operator){\n var status = null;\n if (typeof statuses != \"object\" || statuses === null){ return null; }\n if (Array.isArray(directive)){\n if (typeof operator == \"undefined\"){ operator = \"and\"; }\n if (directive.length === 1){\n status = statuses[directive[0]];\n } else {\n status = directive.reduce(function(previousValue, currentValue) {\n if (operator === \"and\"){\n return statuses[previousValue] && statuses[currentValue];\n } else if (operator === \"or\"){\n return statuses[previousValue] || statuses[currentValue];\n }\n return null;\n });\n }\n } else if (typeof directive == \"object\"){\n var sub_status;\n for (var sub_operator in directive){\n sub_status = resolveStatus(statuses, directive[sub_operator], sub_operator);\n if (status === null){\n status = sub_status;\n } else if (operator === \"and\"){\n status = status && sub_status;\n } else if (operator === \"or\"){\n status = status || sub_status;\n }\n }\n }\n return status;\n };\n\n var show_directive = {};\n if (typeof this.layout.tooltip.show == \"string\"){\n show_directive = { and: [ this.layout.tooltip.show ] };\n } else if (typeof this.layout.tooltip.show == \"object\"){\n show_directive = this.layout.tooltip.show;\n }\n\n var hide_directive = {};\n if (typeof this.layout.tooltip.hide == \"string\"){\n hide_directive = { and: [ this.layout.tooltip.hide ] };\n } else if (typeof this.layout.tooltip.hide == \"object\"){\n hide_directive = this.layout.tooltip.hide;\n }\n\n var statuses = {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n var antistatus = \"un\" + status;\n statuses[status] = this.state[this.state_id][status].indexOf(id) !== -1;\n statuses[antistatus] = !statuses[status];\n }.bind(this));\n\n var show_resolved = resolveStatus(statuses, show_directive);\n var hide_resolved = resolveStatus(statuses, hide_directive);\n\n // Only show tooltip if the resolved logic explicitly shows and explicitly not hides the tool tip\n // Otherwise ensure tooltip does not exist\n if (show_resolved && !hide_resolved){\n this.createTooltip(element);\n } else {\n this.destroyTooltip(element);\n }\n\n return this;\n \n};\n\n/**\n * Find the elements (or indices) that match any of a set of provided filters\n * @protected\n * @param {Array[]} filters A list of filter entries: [field, value] (for equivalence testing) or\n * [field, operator, value] for other operators\n * @param {('indexes'|'elements')} [return_type='indexes'] Specify whether to return either the indices of the matching\n * elements, or references to the elements themselves\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filter = function(filters, return_type){\n if (typeof return_type == \"undefined\" || [\"indexes\",\"elements\"].indexOf(return_type) === -1){\n return_type = \"indexes\";\n }\n if (!Array.isArray(filters)){ return []; }\n var test = function(element, filter){\n var operators = {\n \"=\": function(a,b){ return a === b; },\n \"<\": function(a,b){ return a < b; },\n \"<=\": function(a,b){ return a <= b; },\n \">\": function(a,b){ return a > b; },\n \">=\": function(a,b){ return a >= b; },\n \"%\": function(a,b){ return a % b; }\n };\n if (!Array.isArray(filter)){ return false; }\n if (filter.length === 2){\n return element[filter[0]] === filter[1];\n } else if (filter.length === 3 && operators[filter[1]]){\n return operators[filter[1]](element[filter[0]], filter[2]);\n } else {\n return false;\n }\n };\n var matches = [];\n this.data.forEach(function(element, idx){\n var match = true;\n filters.forEach(function(filter){\n if (!test(element, filter)){ match = false; }\n });\n if (match){ matches.push(return_type === \"indexes\" ? idx : element); }\n });\n return matches;\n};\n\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterIndexes = function(filters){ return this.filter(filters, \"indexes\"); };\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterElements = function(filters){ return this.filter(filters, \"elements\"); };\n\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset a single element's status\n // TODO: Improve documentation for dynamically generated methods/properties\n LocusZoom.DataLayer.prototype[verb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, true, exclusive);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, false, exclusive);\n return this;\n };\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.DataLayer.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.DataLayer.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.DataLayer.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n/**\n * Toggle a status (e.g. highlighted, selected, identified) on an element\n * @param {String} status The name of a recognized status to be added/removed on an appropriate element\n * @param {String|Object} element The data bound to the element of interest\n * @param {Boolean} toggle True to add the status (and associated CSS styles); false to remove it\n * @param {Boolean} exclusive Whether to only allow a state for a single element at a time\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatus = function(status, element, toggle, exclusive){\n // Sanity checks\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatus()\");\n }\n if (typeof element == \"undefined\"){\n throw(\"Invalid element passed to DataLayer.setElementStatus()\");\n }\n if (typeof toggle == \"undefined\"){\n toggle = true;\n }\n\n // Get an ID for the element or return having changed nothing\n try {\n var element_id = this.getElementId(element);\n } catch (get_element_id_error){\n return this;\n }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Set/unset the proper status class on the appropriate DOM element(s)\n d3.select(\"#\" + element_id).classed(\"lz-data_layer-\" + this.layout.type + \"-\" + status, toggle);\n var element_status_node_id = this.getElementStatusNodeId(element);\n if (element_status_node_id !== null){\n d3.select(\"#\" + element_status_node_id).classed(\"lz-data_layer-\" + this.layout.type + \"-statusnode-\" + status, toggle);\n }\n \n // Track element ID in the proper status state array\n var element_status_idx = this.state[this.state_id][status].indexOf(element_id);\n if (toggle && element_status_idx === -1){\n this.state[this.state_id][status].push(element_id);\n }\n if (!toggle && element_status_idx !== -1){\n this.state[this.state_id][status].splice(element_status_idx, 1);\n }\n \n // Trigger tool tip show/hide logic\n this.showOrHideTooltip(element);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n if (status === \"selected\") {\n // Notify parents that a given element has been interacted with. For now, we will only notify on\n // \"selected\" type events, which is (usually) a toggle-able state. If elements are exclusive, two selection\n // events will be sent in short order as the previously selected element has to be de-selected first\n this.parent.emit(\"element_selection\", { element: element, active: toggle }, true);\n }\n return this;\n \n};\n\n/**\n * Toggle a status on elements in the data layer based on a set of filters\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatusByFilters()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; } else { toggle = !!toggle; }\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n if (!Array.isArray(filters)){ filters = []; }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Apply statuses\n this.filterElements(filters).forEach(function(element){\n this.setElementStatus(status, element, toggle);\n }.bind(this));\n \n return this;\n};\n\n/**\n * Toggle a status on all elements in the data layer\n * @param {String} status\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setAllElementStatus = function(status, toggle){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Apply statuses\n if (toggle){\n this.data.forEach(function(element){\n this.setElementStatus(status, element, true);\n }.bind(this));\n } else {\n var status_ids = this.state[this.state_id][status].slice();\n status_ids.forEach(function(id){\n var element = this.getElementById(id);\n if (typeof element == \"object\" && element !== null){\n this.setElementStatus(status, element, false);\n }\n }.bind(this));\n this.state[this.state_id][status] = [];\n }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n return this;\n};\n\n/**\n * Apply all layout-defined behaviors (DOM event handlers) to a selection of elements\n * @param {d3.selection} selection\n */\nLocusZoom.DataLayer.prototype.applyBehaviors = function(selection){\n if (typeof this.layout.behaviors != \"object\"){ return; }\n Object.keys(this.layout.behaviors).forEach(function(directive){\n var event_match = /(click|mouseover|mouseout)/.exec(directive);\n if (!event_match){ return; }\n selection.on(event_match[0] + \".\" + directive, this.executeBehaviors(directive, this.layout.behaviors[directive]));\n }.bind(this));\n};\n\n/**\n * Generate a function that executes an arbitrary list of behaviors on an element during an event\n * @param {String} directive The name of the event, as described in layout.behaviors for this datalayer\n * @param {Object} behaviors An object describing the behavior to attach to this single element\n * @param {string} behaviors.action The name of the action that would trigger this behavior (eg click, mouseover, etc)\n * @param {string} behaviors.status What status to apply to the element when this behavior is triggered (highlighted,\n * selected, etc)\n * @param {string} [behaviors.exclusive] Whether triggering the event for this element should unset the relevant status\n * for all other elements. Useful for, eg, click events that exclusively highlight one thing.\n * @returns {function(this:LocusZoom.DataLayer)} Return a function that handles the event in context with the behavior\n * and the element- can be attached as an event listener\n */\nLocusZoom.DataLayer.prototype.executeBehaviors = function(directive, behaviors) {\n\n // Determine the required state of control and shift keys during the event\n var requiredKeyStates = {\n \"ctrl\": (directive.indexOf(\"ctrl\") !== -1),\n \"shift\": (directive.indexOf(\"shift\") !== -1)\n };\n\n return function(element){\n\n // Do nothing if the required control and shift key presses (or lack thereof) doesn't match the event\n if (requiredKeyStates.ctrl !== !!d3.event.ctrlKey || requiredKeyStates.shift !== !!d3.event.shiftKey){ return; }\n\n // Loop through behaviors making each one go in succession\n behaviors.forEach(function(behavior){\n \n // Route first by the action, if defined\n if (typeof behavior != \"object\" || behavior === null){ return; }\n \n switch (behavior.action){\n \n // Set a status (set to true regardless of current status, optionally with exclusivity)\n case \"set\":\n this.setElementStatus(behavior.status, element, true, behavior.exclusive);\n break;\n \n // Unset a status (set to false regardless of current status, optionally with exclusivity)\n case \"unset\":\n this.setElementStatus(behavior.status, element, false, behavior.exclusive);\n break;\n \n // Toggle a status\n case \"toggle\":\n var current_status_boolean = (this.state[this.state_id][behavior.status].indexOf(this.getElementId(element)) !== -1);\n var exclusive = behavior.exclusive && !current_status_boolean;\n this.setElementStatus(behavior.status, element, !current_status_boolean, exclusive);\n break;\n \n // Link to a dynamic URL\n case \"link\":\n if (typeof behavior.href == \"string\"){\n var url = LocusZoom.parseFields(element, behavior.href);\n if (typeof behavior.target == \"string\"){\n window.open(url, behavior.target);\n } else {\n window.location.href = url;\n }\n }\n break;\n \n // Action not defined, just return\n default:\n break;\n \n }\n \n return;\n \n }.bind(this));\n\n }.bind(this);\n\n};\n\n/**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\nLocusZoom.DataLayer.prototype.getPageOrigin = function(){\n var panel_origin = this.parent.getPageOrigin();\n return {\n x: panel_origin.x + this.parent.layout.margin.left,\n y: panel_origin.y + this.parent.layout.margin.top\n };\n};\n\n/**\n * Get a data layer's current underlying data in a standard format (e.g. JSON or CSV)\n * @param {('csv'|'tsv'|'json')} format How to export the data\n * @returns {*}\n */\nLocusZoom.DataLayer.prototype.exportData = function(format){\n var default_format = \"json\";\n format = format || default_format;\n format = (typeof format == \"string\" ? format.toLowerCase() : default_format);\n if ([\"json\",\"csv\",\"tsv\"].indexOf(format) === -1){ format = default_format; }\n var ret;\n switch (format){\n case \"json\":\n try {\n ret = JSON.stringify(this.data);\n } catch (e){\n ret = null;\n console.error(\"Unable to export JSON data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n case \"tsv\":\n case \"csv\":\n try {\n var jsonified = JSON.parse(JSON.stringify(this.data));\n if (typeof jsonified != \"object\"){\n ret = jsonified.toString();\n } else if (!Array.isArray(jsonified)){\n ret = \"Object\";\n } else {\n var delimiter = (format === \"tsv\") ? \"\\t\" : \",\";\n var header = this.layout.fields.map(function(header){\n return JSON.stringify(header);\n }).join(delimiter) + \"\\n\";\n ret = header + jsonified.map(function(record){\n return this.layout.fields.map(function(field){\n if (typeof record[field] == \"undefined\"){\n return JSON.stringify(null);\n } else if (typeof record[field] == \"object\" && record[field] !== null){\n return Array.isArray(record[field]) ? \"\\\"[Array(\" + record[field].length + \")]\\\"\" : \"\\\"[Object]\\\"\";\n } else {\n return JSON.stringify(record[field]);\n }\n }).join(delimiter);\n }.bind(this)).join(\"\\n\");\n }\n } catch (e){\n ret = null;\n console.error(\"Unable to export CSV data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n }\n return ret;\n};\n\n/**\n * Position the datalayer and all tooltips\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.draw = function(){\n this.svg.container.attr(\"transform\", \"translate(\" + this.parent.layout.cliparea.origin.x + \",\" + this.parent.layout.cliparea.origin.y + \")\");\n this.svg.clipRect\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.parent.layout.cliparea.height);\n this.positionAllTooltips();\n return this;\n};\n\n\n/**\n * Re-Map a data layer to reflect changes in the state of a plot (such as viewing region/ chromosome range)\n * @return {Promise}\n */\nLocusZoom.DataLayer.prototype.reMap = function(){\n\n this.destroyAllTooltips(); // hack - only non-visible tooltips should be destroyed\n // and then recreated if returning to visibility\n\n // Fetch new data. Datalayers are only given access to the final consolidated data from the chain (not headers or raw payloads)\n var promise = this.parent_plot.lzd.getData(this.state, this.layout.fields);\n promise.then(function(new_data) {\n this.data = new_data.body;\n this.applyDataMethods();\n this.initialized = true;\n }.bind(this));\n\n return promise;\n};\n\n\n/**\n * The central registry of known data layer definitions (which may be stored in separate files due to length)\n * @namespace\n */\nLocusZoom.DataLayers = (function() {\n var obj = {};\n var datalayers = {};\n /**\n * @name LocusZoom.DataLayers.get\n * @param {String} name The name of the datalayer\n * @param {Object} layout The configuration object for this data layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n * @returns {LocusZoom.DataLayer}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (datalayers[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for data layer [\" + name + \"]\");\n } else {\n return new datalayers[name](layout, parent);\n }\n } else {\n throw(\"data layer [\" + name + \"] not found\");\n }\n };\n\n /**\n * @name LocusZoom.DataLayers.set\n * @protected\n * @param {String} name\n * @param {Function} datalayer Constructor for the datalayer\n */\n obj.set = function(name, datalayer) {\n if (datalayer) {\n if (typeof datalayer != \"function\"){\n throw(\"unable to set data layer [\" + name + \"], argument provided is not a function\");\n } else {\n datalayers[name] = datalayer;\n datalayers[name].prototype = new LocusZoom.DataLayer();\n }\n } else {\n delete datalayers[name];\n }\n };\n\n /**\n * Add a new type of datalayer to the registry of known layer types\n * @name LocusZoom.DataLayers.add\n * @param {String} name The name of the data layer to register\n * @param {Function} datalayer\n */\n obj.add = function(name, datalayer) {\n if (datalayers[name]) {\n throw(\"data layer already exists with name: \" + name);\n } else {\n obj.set(name, datalayer);\n }\n };\n\n /**\n * Register a new datalayer that inherits and extends basic behaviors from a known datalayer\n * @param {String} parent_name The name of the parent data layer whose behavior is to be extended\n * @param {String} name The name of the new datalayer to register\n * @param {Object} [overrides] Object of properties and methods to combine with the prototype of the parent datalayer\n * @returns {Function} The constructor for the new child class\n */\n obj.extend = function(parent_name, name, overrides) {\n // TODO: Consider exposing additional constructor argument, if there is a use case for very granular extension\n overrides = overrides || {};\n\n var parent = datalayers[parent_name];\n if (!parent) {\n throw \"Attempted to subclass an unknown or unregistered datalayer type\";\n }\n if (typeof overrides !== \"object\") {\n throw \"Must specify an object of properties and methods\";\n }\n var child = LocusZoom.subclass(parent, overrides);\n // Bypass .set() because we want a layer of inheritance below `DataLayer`\n datalayers[name] = child;\n return child;\n };\n\n /**\n * List the names of all known datalayers\n * @name LocusZoom.DataLayers.list\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(datalayers);\n };\n\n return obj;\n})();\n","\"use strict\";\n\n/**\n * Create a single continuous 2D track that provides information about each datapoint\n *\n * For example, this can be used to color by membership in a group, alongside information in other panels\n *\n * @class LocusZoom.DataLayers.annotation_track\n * @augments LocusZoom.DataLayer\n * @param {Object} layout\n * @param {Object|String} [layout.color]\n * @param {Array[]} An array of filter entries specifying which points to draw annotations for.\n * See `LocusZoom.DataLayer.filter` for details\n */\nLocusZoom.DataLayers.add(\"annotation_track\", function(layout) {\n // In the future we may add additional options for controlling marker size/ shape, based on user feedback\n this.DefaultLayout = {\n color: \"#000000\",\n filters: []\n };\n\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n if (!Array.isArray(layout.filters)) {\n throw \"Annotation track must specify array of filters for selecting points to annotate\";\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n this.render = function() {\n var self = this;\n // Only render points that currently satisfy all provided filter conditions.\n var trackData = this.filter(this.layout.filters, \"elements\");\n\n var selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-\" + self.layout.type)\n .data(trackData, function(d) { return d[self.layout.id_field]; });\n\n // Add new elements as needed\n selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function (d){ return self.getElementId(d); });\n // Update the set of elements to reflect new data\n selection\n .attr(\"x\", function (d) { return self.parent[\"x_scale\"](d[self.layout.x_axis.field]); })\n .attr(\"width\", 1) // TODO autocalc width of track? Based on datarange / pixel width presumably\n .attr(\"height\", self.parent.layout.height)\n .attr(\"fill\", function(d){ return self.resolveScalableParameter(self.layout.color, d); });\n // Remove unused elements\n selection.exit().remove();\n\n // Set up tooltips and mouse interaction\n this.applyBehaviors(selection);\n };\n\n // Reimplement the positionTooltip() method to be annotation-specific\n this.positionTooltip = function(id) {\n if (typeof id != \"string\") {\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]) {\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var offset = stroke_width / 2;\n var page_origin = this.getPageOrigin();\n\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_center = data_layer_height / 2;\n\n // Tooltip should be horizontally centered above the point to be annotated. (or below if space is limited)\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width) + offset_left - offset_right - offset;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - y_center) {\n top = page_origin.y + y_center - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow) {\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n return this;\n});\n","\"use strict\";\n\n/*********************\n Forest Data Layer\n Implements a standard forest plot\n*/\n\nLocusZoom.DataLayers.add(\"forest\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"square\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 2\n },\n id_field: \"id\",\n confidence_intervals: {\n start_field: \"ci_start\",\n end_field: \"ci_end\"\n },\n show_no_significance_line: true\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be forest-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n var offset = Math.sqrt(point_size / Math.PI);\n var left, arrow_type, arrow_left;\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var top, arrow_top;\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n } \n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Implement the main render function\n this.render = function(){\n\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate confidence interval paths if fields are defined\n if (this.layout.confidence_intervals\n && this.layout.fields.indexOf(this.layout.confidence_intervals.start_field) !== -1\n && this.layout.fields.indexOf(this.layout.confidence_intervals.end_field) !== -1){\n // Generate a selection for all forest plot confidence intervals\n var ci_selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-forest.lz-data_layer-forest-ci\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n // Create confidence interval rect elements\n ci_selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-ci\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_ci\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + (isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height) + \")\");\n // Apply position and size parameters using transition if necessary\n var ci_transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n var ci_width = function(d){\n return this.parent[x_scale](d[this.layout.confidence_intervals.end_field])\n - this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n }.bind(this);\n var ci_height = 1;\n if (this.canTransition()){\n ci_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n } else {\n ci_selection\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n }\n // Remove old elements as needed\n ci_selection.exit().remove();\n }\n \n // Generate a selection for all forest plot points\n var points_selection = this.svg.group\n .selectAll(\"path.lz-data_layer-forest.lz-data_layer-forest-point\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n points_selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-point\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_point\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n if (this.canTransition()){\n points_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n points_selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n points_selection.exit().remove();\n\n // Apply default event emitters to selection\n points_selection.on(\"click.event_emitter\", function(element_data){\n this.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n \n // Apply behaviors to points\n this.applyBehaviors(points_selection);\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Genes Data Layer\n * Implements a data layer that will render gene tracks\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"genes\", function(layout){\n /**\n * Define a default layout for this DataLayer type and merge it with the passed argument\n * @protected\n * @member {Object}\n * */\n this.DefaultLayout = {\n // Optionally specify different fill and stroke properties\n stroke: \"rgb(54, 54, 150)\",\n color: \"#363696\",\n label_font_size: 12,\n label_exon_spacing: 4,\n exon_height: 16,\n bounding_box_padding: 6,\n track_vertical_spacing: 10\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Generate a statusnode ID for a given element\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n return this.getElementId(element) + \"-statusnode\";\n };\n\n /**\n * Helper function to sum layout values to derive total height for a single gene track\n * @returns {number}\n */\n this.getTrackHeight = function(){\n return 2 * this.layout.bounding_box_padding\n + this.layout.label_font_size\n + this.layout.label_exon_spacing\n + this.layout.exon_height\n + this.layout.track_vertical_spacing;\n };\n\n /**\n * A gene may have arbitrarily many transcripts, but this data layer isn't set up to render them yet.\n * Stash a transcript_idx to point to the first transcript and use that for all transcript refs.\n * @member {number}\n * @type {number}\n */\n this.transcript_idx = 0;\n\n /**\n * An internal counter for the number of tracks in the data layer. Used as an internal counter for looping\n * over positions / assignments\n * @protected\n * @member {number}\n */\n this.tracks = 1;\n\n /**\n * Store information about genes in dataset, in a hash indexed by track number: {track_number: [gene_indices]}\n * @member {Object.}\n */\n this.gene_track_index = { 1: [] };\n\n /**\n * Ensure that genes in overlapping chromosome regions are positioned so that parts of different genes do not\n * overlap in the view. A track is a row used to vertically separate overlapping genes.\n * @returns {LocusZoom.DataLayer}\n */\n this.assignTracks = function(){\n /**\n * Function to get the width in pixels of a label given the text and layout attributes\n * TODO: Move to outer scope?\n * @param {String} gene_name\n * @param {number|string} font_size\n * @returns {number}\n */\n this.getLabelWidth = function(gene_name, font_size){\n try {\n var temp_text = this.svg.group.append(\"text\")\n .attr(\"x\", 0).attr(\"y\", 0).attr(\"class\", \"lz-data_layer-genes lz-label\")\n .style(\"font-size\", font_size)\n .text(gene_name + \"→\");\n var label_width = temp_text.node().getBBox().width;\n temp_text.remove();\n return label_width;\n } catch (e){\n return 0;\n }\n };\n\n // Reinitialize some metadata\n this.tracks = 1;\n this.gene_track_index = { 1: [] };\n\n this.data.map(function(d, g){\n\n // If necessary, split combined gene id / version fields into discrete fields.\n // NOTE: this may be an issue with CSG's genes data source that may eventually be solved upstream.\n if (this.data[g].gene_id && this.data[g].gene_id.indexOf(\".\")){\n var split = this.data[g].gene_id.split(\".\");\n this.data[g].gene_id = split[0];\n this.data[g].gene_version = split[1];\n }\n\n // Stash the transcript ID on the parent gene\n this.data[g].transcript_id = this.data[g].transcripts[this.transcript_idx].transcript_id;\n\n // Determine display range start and end, based on minimum allowable gene display width, bounded by what we can see\n // (range: values in terms of pixels on the screen)\n this.data[g].display_range = {\n start: this.parent.x_scale(Math.max(d.start, this.state.start)),\n end: this.parent.x_scale(Math.min(d.end, this.state.end))\n };\n this.data[g].display_range.label_width = this.getLabelWidth(this.data[g].gene_name, this.layout.label_font_size);\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n // Determine label text anchor (default to middle)\n this.data[g].display_range.text_anchor = \"middle\";\n if (this.data[g].display_range.width < this.data[g].display_range.label_width){\n if (d.start < this.state.start){\n this.data[g].display_range.end = this.data[g].display_range.start\n + this.data[g].display_range.label_width\n + this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"start\";\n } else if (d.end > this.state.end){\n this.data[g].display_range.start = this.data[g].display_range.end\n - this.data[g].display_range.label_width\n - this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n var centered_margin = ((this.data[g].display_range.label_width - this.data[g].display_range.width) / 2)\n + this.layout.label_font_size;\n if ((this.data[g].display_range.start - centered_margin) < this.parent.x_scale(this.state.start)){\n this.data[g].display_range.start = this.parent.x_scale(this.state.start);\n this.data[g].display_range.end = this.data[g].display_range.start + this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"start\";\n } else if ((this.data[g].display_range.end + centered_margin) > this.parent.x_scale(this.state.end)) {\n this.data[g].display_range.end = this.parent.x_scale(this.state.end);\n this.data[g].display_range.start = this.data[g].display_range.end - this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n this.data[g].display_range.start -= centered_margin;\n this.data[g].display_range.end += centered_margin;\n }\n }\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n }\n // Add bounding box padding to the calculated display range start, end, and width\n this.data[g].display_range.start -= this.layout.bounding_box_padding;\n this.data[g].display_range.end += this.layout.bounding_box_padding;\n this.data[g].display_range.width += 2 * this.layout.bounding_box_padding;\n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[g].display_domain = {\n start: this.parent.x_scale.invert(this.data[g].display_range.start),\n end: this.parent.x_scale.invert(this.data[g].display_range.end)\n };\n this.data[g].display_domain.width = this.data[g].display_domain.end - this.data[g].display_domain.start;\n\n // Using display range/domain data generated above cast each gene to tracks such that none overlap\n this.data[g].track = null;\n var potential_track = 1;\n while (this.data[g].track === null){\n var collision_on_potential_track = false;\n this.gene_track_index[potential_track].map(function(placed_gene){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_gene.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_gene.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_gene.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[g]));\n if (!collision_on_potential_track){\n this.data[g].track = potential_track;\n this.gene_track_index[potential_track].push(this.data[g]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.gene_track_index[potential_track] = [];\n }\n }\n }\n\n // Stash parent references on all genes, trascripts, and exons\n this.data[g].parent = this;\n this.data[g].transcripts.map(function(d, t){\n this.data[g].transcripts[t].parent = this.data[g];\n this.data[g].transcripts[t].exons.map(function(d, e){\n this.data[g].transcripts[t].exons[e].parent = this.data[g].transcripts[t];\n }.bind(this));\n }.bind(this));\n\n }.bind(this));\n return this;\n };\n\n /**\n * Main render function\n */\n this.render = function(){\n\n var self = this;\n this.assignTracks();\n\n var width, height, x, y;\n\n // Render gene groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-genes\")\n .data(this.data, function(d){ return d.gene_name; });\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-genes\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(gene){\n\n var data_layer = gene.parent;\n\n // Render gene bounding boxes (status nodes to show selected/highlighted)\n var bboxes = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-data_layer-genes-statusnode\")\n .data([gene], function(d){ return data_layer.getElementStatusNodeId(d); });\n\n bboxes.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-data_layer-genes-statusnode\");\n \n bboxes\n .attr(\"id\", function(d){\n return data_layer.getElementStatusNodeId(d);\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n bboxes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n bboxes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n bboxes.exit().remove();\n\n // Render gene boundaries\n var boundary_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d); };\n var boundary_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d); };\n var boundaries = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-boundary\")\n .data([gene], function(d){ return d.gene_name + \"_boundary\"; })\n .style({ fill: boundary_fill, stroke: boundary_stroke });\n\n boundaries.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-boundary\");\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return 1; // TODO: scale dynamically?\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing\n + (Math.max(data_layer.layout.exon_height, 3) / 2);\n };\n if (data_layer.canTransition()){\n boundaries\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n boundaries\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n \n boundaries.exit().remove();\n\n // Render gene labels\n var labels = d3.select(this).selectAll(\"text.lz-data_layer-genes.lz-label\")\n .data([gene], function(d){ return d.gene_name + \"_label\"; });\n\n labels.enter().append(\"text\")\n .attr(\"class\", \"lz-data_layer-genes lz-label\");\n\n labels\n .attr(\"text-anchor\", function(d){\n return d.display_range.text_anchor;\n })\n .text(function(d){\n return (d.strand === \"+\") ? d.gene_name + \"→\" : \"←\" + d.gene_name;\n })\n .style(\"font-size\", gene.parent.layout.label_font_size);\n\n x = function(d){\n if (d.display_range.text_anchor === \"middle\"){\n return d.display_range.start + (d.display_range.width / 2);\n } else if (d.display_range.text_anchor === \"start\"){\n return d.display_range.start + data_layer.layout.bounding_box_padding;\n } else if (d.display_range.text_anchor === \"end\"){\n return d.display_range.end - data_layer.layout.bounding_box_padding;\n }\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size;\n };\n if (data_layer.canTransition()){\n labels\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"x\", x).attr(\"y\", y);\n } else {\n labels\n .attr(\"x\", x).attr(\"y\", y);\n }\n\n labels.exit().remove();\n\n // Render exon rects (first transcript only, for now)\n // Exons: by default color on gene properties for consistency with the gene boundary track- hence color uses d.parent.parent\n var exon_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d.parent.parent); };\n var exon_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d.parent.parent); };\n\n var exons = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-exon\")\n .data(gene.transcripts[gene.parent.transcript_idx].exons, function(d){ return d.exon_id; });\n\n exons.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-exon\");\n\n exons\n .style({ fill: exon_fill, stroke: exon_stroke });\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return data_layer.layout.exon_height;\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(){\n return ((gene.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing;\n };\n if (data_layer.canTransition()){\n exons\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n exons\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n exons.exit().remove();\n\n // Render gene click area\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-clickarea\")\n .data([gene], function(d){ return d.gene_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click.event_emitter\", function(element){\n element.parent.parent.emit(\"element_clicked\", element, true);\n });\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n };\n\n /**\n * Reimplement the positionTooltip() method to be gene-specific\n * @param {String} id\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var gene_bbox_id = this.getElementStatusNodeId(tooltip.data);\n var gene_bbox = d3.select(\"#\" + gene_bbox_id).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the gene that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var gene_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - gene_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + gene_center_x - data_layer_width, 0);\n var left = page_origin.x + gene_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the gene unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (gene_bbox.y + gene_bbox.height)){\n top = page_origin.y + gene_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + gene_bbox.y + gene_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Genome Legend Data Layer\n Implements a data layer that will render a genome legend\n*/\n\n// Build a custom data layer for a genome legend\nLocusZoom.DataLayers.add(\"genome_legend\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n chromosome_fill_colors: {\n light: \"rgb(155, 155, 188)\",\n dark: \"rgb(95, 95, 128)\"\n },\n chromosome_label_colors: {\n light: \"rgb(120, 120, 186)\",\n dark: \"rgb(0, 0, 66)\"\n }\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Implement the main render function\n this.render = function(){\n\n // Iterate over data to generate genome-wide start/end values for each chromosome\n var position = 0;\n this.data.forEach(function(d, i){\n this.data[i].genome_start = position;\n this.data[i].genome_end = position + d[\"genome:base_pairs\"];\n position += d[\"genome:base_pairs\"];\n }.bind(this));\n\n var chromosomes = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend\")\n .data(this.data, function(d){ return d[\"genome:chr\"]; });\n\n // Create chromosome elements, apply class\n chromosomes.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend\");\n\n // Position and fill chromosome rects\n var data_layer = this;\n var panel = this.parent;\n\n chromosomes\n .attr(\"fill\", function(d){ return (d[\"genome:chr\"] % 2 ? data_layer.layout.chromosome_fill_colors.light : data_layer.layout.chromosome_fill_colors.dark); })\n .attr(\"x\", function(d){ return panel.x_scale(d.genome_start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d[\"genome:base_pairs\"]); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n // Remove old elements as needed\n chromosomes.exit().remove();\n\n // Parse current state variant into a position\n // Assumes that variant string is of the format 10:123352136_C/T or 10:123352136\n var variant_parts = /([^:]+):(\\d+)(?:_.*)?/.exec(this.state.variant);\n if (!variant_parts) {\n throw(\"Genome legend cannot understand the specified variant position\");\n }\n var chr = variant_parts[1];\n var offset = variant_parts[2];\n // TODO: How does this handle representation of X or Y chromosomes?\n position = +this.data[chr-1].genome_start + +offset;\n\n // Render the position\n var region = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend-marker\")\n .data([{ start: position, end: position + 1 }]);\n\n region.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend-marker\");\n\n region\n .transition()\n .duration(500)\n .style({\n \"fill\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke-width\": \"3px\"\n })\n .attr(\"x\", function(d){ return panel.x_scale(d.start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d.end - d.start); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n region.exit().remove();\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/**\n * Intervals Data Layer\n * Implements a data layer that will render interval annotation tracks (intervals must provide start and end values)\n * @class LocusZoom.DataLayers.intervals\n * @augments LocusZoom.DataLayer\n */\nLocusZoom.DataLayers.add(\"intervals\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n start_field: \"start\",\n end_field: \"end\",\n track_split_field: \"state_id\",\n track_split_order: \"DESC\",\n track_split_legend_to_y_axis: 2,\n split_tracks: true,\n track_height: 15,\n track_vertical_spacing: 3,\n bounding_box_padding: 2,\n always_hide_legend: false,\n color: \"#B8B8B8\",\n fill_opacity: 1\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n \n /**\n * To define shared highlighting on the track split field define the status node id override\n * to generate an ID common to the track when we're actively splitting data out to separate tracks\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n if (this.layout.split_tracks){\n return (this.getBaseId() + \"-statusnode-\" + element[this.layout.track_split_field]).replace(/[:.[\\],]/g, \"_\");\n }\n return this.getElementId(element) + \"-statusnode\";\n }.bind(this);\n \n // Helper function to sum layout values to derive total height for a single interval track\n this.getTrackHeight = function(){\n return this.layout.track_height\n + this.layout.track_vertical_spacing\n + (2 * this.layout.bounding_box_padding);\n };\n\n this.tracks = 1;\n this.previous_tracks = 1;\n \n // track-number-indexed object with arrays of interval indexes in the dataset\n this.interval_track_index = { 1: [] };\n\n // After we've loaded interval data interpret it to assign\n // each to a track so that they do not overlap in the view\n this.assignTracks = function(){\n\n // Reinitialize some metadata\n this.previous_tracks = this.tracks;\n this.tracks = 0;\n this.interval_track_index = { 1: [] };\n this.track_split_field_index = {};\n \n // If splitting tracks by a field's value then do a first pass determine\n // a value/track mapping that preserves the order of possible values\n if (this.layout.track_split_field && this.layout.split_tracks){\n this.data.map(function(d){\n this.track_split_field_index[d[this.layout.track_split_field]] = null;\n }.bind(this));\n var index = Object.keys(this.track_split_field_index);\n if (this.layout.track_split_order === \"DESC\"){ index.reverse(); }\n index.forEach(function(val){\n this.track_split_field_index[val] = this.tracks + 1;\n this.interval_track_index[this.tracks + 1] = [];\n this.tracks++;\n }.bind(this));\n }\n\n this.data.map(function(d, i){\n\n // Stash a parent reference on the interval\n this.data[i].parent = this;\n\n // Determine display range start and end, based on minimum allowable interval display width,\n // bounded by what we can see (range: values in terms of pixels on the screen)\n this.data[i].display_range = {\n start: this.parent.x_scale(Math.max(d[this.layout.start_field], this.state.start)),\n end: this.parent.x_scale(Math.min(d[this.layout.end_field], this.state.end))\n };\n this.data[i].display_range.width = this.data[i].display_range.end - this.data[i].display_range.start;\n \n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[i].display_domain = {\n start: this.parent.x_scale.invert(this.data[i].display_range.start),\n end: this.parent.x_scale.invert(this.data[i].display_range.end)\n };\n this.data[i].display_domain.width = this.data[i].display_domain.end - this.data[i].display_domain.start;\n\n // If splitting to tracks based on the value of the designated track split field\n // then don't bother with collision detection (intervals will be grouped on tracks\n // solely by the value of track_split_field)\n if (this.layout.track_split_field && this.layout.split_tracks){\n var val = this.data[i][this.layout.track_split_field];\n this.data[i].track = this.track_split_field_index[val];\n this.interval_track_index[this.data[i].track].push(i);\n } else {\n // If not splitting to tracks based on a field value then do so based on collision\n // detection (as how it's done for genes). Use display range/domain data generated\n // above and cast each interval to tracks such that none overlap\n this.tracks = 1;\n this.data[i].track = null;\n var potential_track = 1;\n while (this.data[i].track === null){\n var collision_on_potential_track = false;\n this.interval_track_index[potential_track].map(function(placed_interval){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_interval.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_interval.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_interval.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[i]));\n if (!collision_on_potential_track){\n this.data[i].track = potential_track;\n this.interval_track_index[potential_track].push(this.data[i]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.interval_track_index[potential_track] = [];\n }\n }\n }\n\n }\n\n }.bind(this));\n\n return this;\n };\n\n // Implement the main render function\n this.render = function(){\n\n this.assignTracks();\n\n // Remove any shared highlight nodes and re-render them if we're splitting on tracks\n // At most there will only be dozen or so nodes here (one per track) and each time\n // we render data we may have new tracks, so wiping/redrawing all is reasonable.\n this.svg.group.selectAll(\".lz-data_layer-intervals-statusnode.lz-data_layer-intervals-shared\").remove();\n Object.keys(this.track_split_field_index).forEach(function(key){\n // Make a psuedo-element so that we can generate an id for the shared node\n var psuedoElement = {};\n psuedoElement[this.layout.track_split_field] = key;\n // Insert the shared node\n var sharedstatusnode_style = {display: (this.layout.split_tracks ? null : \"none\")};\n this.svg.group.insert(\"rect\", \":first-child\")\n .attr(\"id\", this.getElementStatusNodeId(psuedoElement))\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-shared\")\n .attr(\"rx\", this.layout.bounding_box_padding).attr(\"ry\", this.layout.bounding_box_padding)\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.getTrackHeight() - this.layout.track_vertical_spacing)\n .attr(\"x\", 0)\n .attr(\"y\", (this.track_split_field_index[key]-1) * this.getTrackHeight())\n .style(sharedstatusnode_style);\n }.bind(this));\n\n var width, height, x, y, fill, fill_opacity;\n \n // Render interval groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-intervals\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-intervals\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(interval){\n\n var data_layer = interval.parent;\n\n // Render interval status nodes (displayed behind intervals to show highlight\n // without needing to modify interval display element(s))\n var statusnode_style = {display: (data_layer.layout.split_tracks ? \"none\" : null)};\n var statusnodes = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-data_layer-intervals-statusnode.lz-data_layer-intervals-statusnode-discrete\")\n .data([interval], function(d){ return data_layer.getElementId(d) + \"-statusnode\"; });\n statusnodes.enter().insert(\"rect\", \":first-child\")\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-statusnode-discrete\");\n statusnodes\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"-statusnode\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .style(statusnode_style);\n width = function(d){\n return d.display_range.width + (2 * data_layer.layout.bounding_box_padding);\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start - data_layer.layout.bounding_box_padding;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n statusnodes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n statusnodes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n statusnodes.exit().remove();\n\n // Render primary interval rects\n var rects = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-interval_rect\")\n .data([interval], function(d){ return d[data_layer.layout.id_field] + \"_interval_rect\"; });\n\n rects.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-interval_rect\");\n\n height = data_layer.layout.track_height;\n width = function(d){\n return d.display_range.width;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding;\n };\n fill = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.color, d);\n };\n fill_opacity = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.fill_opacity, d);\n };\n \n \n if (data_layer.canTransition()){\n rects\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n } else {\n rects\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n }\n \n rects.exit().remove();\n\n // Render interval click areas\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-clickarea\")\n .data([interval], function(d){ return d.interval_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click\", function(element_data){\n element_data.parent.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Update the legend axis if the number of ticks changed\n if (this.previous_tracks !== this.tracks){\n this.updateSplitTrackAxis();\n }\n\n return this;\n\n };\n \n // Reimplement the positionTooltip() method to be interval-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var interval_bbox = d3.select(\"#\" + this.getElementStatusNodeId(tooltip.data)).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the interval that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var interval_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - interval_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + interval_center_x - data_layer_width, 0);\n var left = page_origin.x + interval_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the interval unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (interval_bbox.y + interval_bbox.height)){\n top = page_origin.y + interval_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + interval_bbox.y + interval_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Redraw split track axis or hide it, and show/hide the legend, as determined\n // by current layout parameters and data\n this.updateSplitTrackAxis = function(){\n var legend_axis = this.layout.track_split_legend_to_y_axis ? \"y\" + this.layout.track_split_legend_to_y_axis : false;\n if (this.layout.split_tracks){\n var tracks = +this.tracks || 0;\n var track_height = +this.layout.track_height || 0;\n var track_spacing = 2 * (+this.layout.bounding_box_padding || 0) + (+this.layout.track_vertical_spacing || 0);\n var target_height = (tracks * track_height) + ((tracks - 1) * track_spacing);\n this.parent.scaleHeightToData(target_height);\n if (legend_axis && this.parent.legend){\n this.parent.legend.hide(); \n this.parent.layout.axes[legend_axis] = {\n render: true,\n ticks: [],\n range: {\n start: (target_height - (this.layout.track_height/2)),\n end: (this.layout.track_height/2)\n }\n };\n this.layout.legend.forEach(function(element){\n var key = element[this.layout.track_split_field];\n var track = this.track_split_field_index[key];\n if (track){\n if (this.layout.track_split_order === \"DESC\"){\n track = Math.abs(track - tracks - 1);\n }\n this.parent.layout.axes[legend_axis].ticks.push({\n y: track,\n text: element.label\n });\n }\n }.bind(this));\n this.layout.y_axis = {\n axis: this.layout.track_split_legend_to_y_axis,\n floor: 1,\n ceiling: tracks\n };\n this.parent.render();\n }\n this.parent_plot.positionPanels();\n } else {\n if (legend_axis && this.parent.legend){\n if (!this.layout.always_hide_legend){ this.parent.legend.show(); }\n this.parent.layout.axes[legend_axis] = { render: false };\n this.parent.render();\n }\n }\n return this;\n };\n\n // Method to not only toggle the split tracks boolean but also update\n // necessary display values to animate a complete merge/split\n this.toggleSplitTracks = function(){\n this.layout.split_tracks = !this.layout.split_tracks;\n if (this.parent.legend && !this.layout.always_hide_legend){\n this.parent.layout.margin.bottom = 5 + (this.layout.split_tracks ? 0 : this.parent.legend.layout.height + 5);\n }\n this.render();\n this.updateSplitTrackAxis();\n return this;\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Line Data Layer\n * Implements a standard line plot\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n /** @member {Object} */\n this.DefaultLayout = {\n style: {\n fill: \"none\",\n \"stroke-width\": \"2px\"\n },\n interpolate: \"linear\",\n x_axis: { field: \"x\" },\n y_axis: { field: \"y\", axis: 1 },\n hitarea_width: 5\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Var for storing mouse events for use in tool tip positioning\n /** @member {String} */\n this.mouse_event = null;\n\n /**\n * Var for storing the generated line function itself\n * @member {d3.svg.line}\n * */\n this.line = null;\n\n /**\n * The timeout identifier returned by setTimeout\n * @member {Number}\n */\n this.tooltip_timeout = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n\n /**\n * Helper function to get display and data objects representing\n * the x/y coordinates of the current mouse event with respect to the line in terms of the display\n * and the interpolated values of the x/y fields with respect to the line\n * @returns {{display: {x: *, y: null}, data: {}, slope: null}}\n */\n this.getMouseDisplayAndData = function(){\n var ret = {\n display: {\n x: d3.mouse(this.mouse_event)[0],\n y: null\n },\n data: {},\n slope: null\n };\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n ret.data[x_field] = this.parent[x_scale].invert(ret.display.x);\n var bisect = d3.bisector(function(datum) { return +datum[x_field]; }).left;\n var index = bisect(this.data, ret.data[x_field]) - 1;\n var startDatum = this.data[index];\n var endDatum = this.data[index + 1];\n var interpolate = d3.interpolateNumber(+startDatum[y_field], +endDatum[y_field]);\n var range = +endDatum[x_field] - +startDatum[x_field];\n ret.data[y_field] = interpolate((ret.data[x_field] % range) / range);\n ret.display.y = this.parent[y_scale](ret.data[y_field]);\n if (this.layout.tooltip.x_precision){\n ret.data[x_field] = ret.data[x_field].toPrecision(this.layout.tooltip.x_precision);\n }\n if (this.layout.tooltip.y_precision){\n ret.data[y_field] = ret.data[y_field].toPrecision(this.layout.tooltip.y_precision);\n }\n ret.slope = (this.parent[y_scale](endDatum[y_field]) - this.parent[y_scale](startDatum[y_field]))\n / (this.parent[x_scale](endDatum[x_field]) - this.parent[x_scale](startDatum[x_field]));\n return ret;\n };\n\n /**\n * Reimplement the positionTooltip() method to be line-specific\n * @param {String} id Identify the tooltip to be positioned\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var arrow_width = 7; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var stroke_width = parseFloat(this.layout.style[\"stroke-width\"]) || 1;\n var page_origin = this.getPageOrigin();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n var top, left, arrow_top, arrow_left, arrow_type;\n\n // Determine x/y coordinates for display and data\n var dd = this.getMouseDisplayAndData();\n\n // If the absolute value of the slope of the line at this point is above 1 (including Infinity)\n // then position the tool tip left/right. Otherwise position top/bottom.\n if (Math.abs(dd.slope) > 1){\n\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (dd.display.x <= this.parent.layout.width / 2){\n left = page_origin.x + dd.display.x + stroke_width + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + dd.display.x - tooltip_box.width - stroke_width - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n if (dd.display.y - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + dd.display.y - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (dd.display.y + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + dd.display.y + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + dd.display.y - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n\n } else {\n\n // Position horizontally: attempt to center on the mouse's x coordinate\n // pad to either side if bumping up against the edge of the data layer\n var offset_right = Math.max((tooltip_box.width / 2) - dd.display.x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + dd.display.x - data_layer_width, 0);\n left = page_origin.x + dd.display.x - (tooltip_box.width / 2) - offset_left + offset_right;\n var min_arrow_left = arrow_width / 2;\n var max_arrow_left = tooltip_box.width - (2.5 * arrow_width);\n arrow_left = (tooltip_box.width / 2) - arrow_width + offset_left - offset_right;\n arrow_left = Math.min(Math.max(arrow_left, min_arrow_left), max_arrow_left);\n\n // Position vertically above the line unless there's insufficient space\n if (tooltip_box.height + stroke_width + arrow_width > dd.display.y){\n top = page_origin.y + dd.display.y + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n } else {\n top = page_origin.y + dd.display.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n }\n }\n\n // Apply positions to the main div\n tooltip.selector.style({ left: left + \"px\", top: top + \"px\" });\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style({ \"left\": arrow_left + \"px\", top: arrow_top + \"px\" });\n\n };\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var data_layer = this;\n var panel = this.parent;\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Apply tooltip, etc\n if (this.layout.tooltip){\n // Generate an overlaying transparent \"hit area\" line for more intuitive mouse events\n var hitarea_width = parseFloat(this.layout.hitarea_width).toString() + \"px\";\n var hitarea = this.svg.group\n .selectAll(\"path.lz-data_layer-line-hitarea\")\n .data([this.data]);\n hitarea.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line-hitarea\")\n .style(\"stroke-width\", hitarea_width);\n var hitarea_line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n hitarea\n .attr(\"d\", hitarea_line)\n .on(\"mouseover\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.createTooltip(dd.data);\n })\n .on(\"mousemove\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.updateTooltip(dd.data);\n data_layer.positionTooltip(data_layer.getElementId());\n })\n .on(\"mouseout\", function(){\n data_layer.tooltip_timeout = setTimeout(function(){\n data_layer.mouse_event = null;\n data_layer.destroyTooltip(data_layer.getElementId());\n }, 300);\n });\n hitarea.exit().remove();\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n /**\n * Redefine setElementStatus family of methods as line data layers will only ever have a single path element\n * @param {String} status A member of `LocusZoom.DataLayer.Statuses.adjectives`\n * @param {String|Object} element\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\n this.setElementStatus = function(status, element, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setElementStatusByFilters = function(status, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setAllElementStatus = function(status, toggle){\n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n // Apply class to path based on global status flags\n var path_class = \"lz-data_layer-line\";\n Object.keys(this.global_statuses).forEach(function(global_status){\n if (this.global_statuses[global_status]){ path_class += \" lz-data_layer-line-\" + global_status; }\n }.bind(this));\n this.path.attr(\"class\", path_class);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n return this;\n };\n\n return this;\n\n});\n\n\n/***************************\n * Orthogonal Line Data Layer\n * Implements a horizontal or vertical line given an orientation and an offset in the layout\n * Does not require a data source\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"orthogonal_line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n style: {\n \"stroke\": \"#D3D3D3\",\n \"stroke-width\": \"3px\",\n \"stroke-dasharray\": \"10px 10px\"\n },\n orientation: \"horizontal\",\n x_axis: {\n axis: 1,\n decoupled: true\n },\n y_axis: {\n axis: 1,\n decoupled: true\n },\n offset: 0\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Require that orientation be \"horizontal\" or \"vertical\" only\n if ([\"horizontal\",\"vertical\"].indexOf(layout.orientation) === -1){\n layout.orientation = \"horizontal\";\n }\n\n // Vars for storing the data generated line\n /** @member {Array} */\n this.data = [];\n /** @member {d3.svg.line} */\n this.line = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var panel = this.parent;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n var x_extent = \"x_extent\";\n var y_extent = \"y\" + this.layout.y_axis.axis + \"_extent\";\n var x_range = \"x_range\";\n var y_range = \"y\" + this.layout.y_axis.axis + \"_range\";\n\n // Generate data using extents depending on orientation\n if (this.layout.orientation === \"horizontal\"){\n this.data = [\n { x: panel[x_extent][0], y: this.layout.offset },\n { x: panel[x_extent][1], y: this.layout.offset }\n ];\n } else {\n this.data = [\n { x: this.layout.offset, y: panel[y_extent][0] },\n { x: this.layout.offset, y: panel[y_extent][1] }\n ];\n }\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d, i) {\n var x = parseFloat(panel[x_scale](d[\"x\"]));\n return isNaN(x) ? panel[x_range][i] : x;\n })\n .y(function(d, i) {\n var y = parseFloat(panel[y_scale](d[\"y\"]));\n return isNaN(y) ? panel[y_range][i] : y;\n })\n .interpolate(\"linear\");\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Scatter Data Layer\n Implements a standard scatter plot\n*/\n\nLocusZoom.DataLayers.add(\"scatter\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"circle\",\n tooltip_positioning: \"horizontal\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 1\n },\n id_field: \"id\"\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Extra default for layout spacing\n // Not in default layout since that would make the label attribute always present\n if (layout.label && isNaN(layout.label.spacing)){\n layout.label.spacing = 4;\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be scatter-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var offset = Math.sqrt(point_size / Math.PI);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n if (this.layout.tooltip_positioning === \"vertical\"){\n // Position horizontally centered above the point\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right - offset;\n // Position vertically above the point unless there's insufficient space, then go below\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (y_center + offset)){\n top = page_origin.y + y_center - (offset + tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + offset + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n } else {\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Function to flip labels from being anchored at the start of the text to the end\n // Both to keep labels from running outside the data layer and also as a first\n // pass on recursive separation\n this.flip_labels = function(){\n var data_layer = this;\n var point_size = data_layer.resolveScalableParameter(data_layer.layout.point_size, {});\n var spacing = data_layer.layout.label.spacing;\n var handle_lines = Boolean(data_layer.layout.label.lines);\n var min_x = 2 * spacing;\n var max_x = data_layer.parent.layout.width - data_layer.parent.layout.margin.left - data_layer.parent.layout.margin.right - (2 * spacing);\n var flip = function(dn, dnl){\n var dnx = +dn.attr(\"x\");\n var text_swing = (2 * spacing) + (2 * Math.sqrt(point_size));\n if (handle_lines){\n var dnlx2 = +dnl.attr(\"x2\");\n var line_swing = spacing + (2 * Math.sqrt(point_size));\n }\n if (dn.style(\"text-anchor\") === \"start\"){\n dn.style(\"text-anchor\", \"end\");\n dn.attr(\"x\", dnx - text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 - line_swing); }\n } else {\n dn.style(\"text-anchor\", \"start\");\n dn.attr(\"x\", dnx + text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 + line_swing); }\n }\n };\n // Flip any going over the right edge from the right side to the left side\n // (all labels start on the right side)\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n if (dax + abound.width + spacing > max_x){\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n flip(da, dal);\n }\n });\n // Second pass to flip any others that haven't flipped yet if they collide with another label\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n if (da.style(\"text-anchor\") === \"end\") return;\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n data_layer.label_texts.each(function () {\n var b = this;\n var db = d3.select(b);\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (collision){\n flip(da, dal);\n // Double check that this flip didn't push the label past min_x. If it did, immediately flip back.\n dax = +da.attr(\"x\");\n if (dax - abound.width - spacing < min_x){\n flip(da, dal);\n }\n }\n return;\n });\n });\n };\n\n // Recursive function to space labels apart immediately after initial render\n // Adapted from thudfactor's fiddle here: https://jsfiddle.net/thudfactor/HdwTH/\n // TODO: Make labels also aware of data elements\n this.separate_labels = function(){\n this.seperate_iterations++;\n var data_layer = this;\n var alpha = 0.5;\n var spacing = this.layout.label.spacing;\n var again = false;\n data_layer.label_texts.each(function () {\n var a = this;\n var da = d3.select(a);\n var y1 = da.attr(\"y\");\n data_layer.label_texts.each(function () {\n var b = this;\n // a & b are the same element and don't collide.\n if (a === b) return;\n var db = d3.select(b);\n // a & b are on opposite sides of the chart and\n // don't collide\n if (da.attr(\"text-anchor\") !== db.attr(\"text-anchor\")) return;\n // Determine if the bounding rects for the two text elements collide\n var abound = da.node().getBoundingClientRect();\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (!collision) return;\n again = true;\n // If the labels collide, we'll push each\n // of the two labels up and down a little bit.\n var y2 = db.attr(\"y\");\n var sign = abound.top < bbound.top ? 1 : -1;\n var adjust = sign * alpha;\n var new_a_y = +y1 - adjust;\n var new_b_y = +y2 + adjust;\n // Keep new values from extending outside the data layer\n var min_y = 2 * spacing;\n var max_y = data_layer.parent.layout.height - data_layer.parent.layout.margin.top - data_layer.parent.layout.margin.bottom - (2 * spacing);\n var delta;\n if (new_a_y - (abound.height/2) < min_y){\n delta = +y1 - new_a_y;\n new_a_y = +y1;\n new_b_y += delta;\n } else if (new_b_y - (bbound.height/2) < min_y){\n delta = +y2 - new_b_y;\n new_b_y = +y2;\n new_a_y += delta;\n }\n if (new_a_y + (abound.height/2) > max_y){\n delta = new_a_y - +y1;\n new_a_y = +y1;\n new_b_y -= delta;\n } else if (new_b_y + (bbound.height/2) > max_y){\n delta = new_b_y - +y2;\n new_b_y = +y2;\n new_a_y -= delta;\n }\n da.attr(\"y\",new_a_y);\n db.attr(\"y\",new_b_y);\n });\n });\n if (again) {\n // Adjust lines to follow the labels\n if (data_layer.layout.label.lines){\n var label_elements = data_layer.label_texts[0];\n data_layer.label_lines.attr(\"y2\",function(d,i) {\n var label_line = d3.select(label_elements[i]);\n return label_line.attr(\"y\");\n });\n }\n // After ~150 iterations we're probably beyond diminising returns, so stop recursing\n if (this.seperate_iterations < 150){\n setTimeout(function(){\n this.separate_labels();\n }.bind(this), 1);\n }\n }\n };\n\n // Implement the main render function\n this.render = function(){\n\n var data_layer = this;\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate labels first (if defined)\n if (this.layout.label){\n // Apply filters to generate a filtered data set\n var filtered_data = this.data.filter(function(d){\n if (!data_layer.layout.label.filters){\n return true;\n } else {\n // Start by assuming a match, run through all filters to test if not a match on any one\n var match = true;\n data_layer.layout.label.filters.forEach(function(filter){\n var field_value = (new LocusZoom.Data.Field(filter.field)).resolve(d);\n if (isNaN(field_value)){\n match = false;\n } else {\n switch (filter.operator){\n case \"<\":\n if (!(field_value < filter.value)){ match = false; }\n break;\n case \"<=\":\n if (!(field_value <= filter.value)){ match = false; }\n break;\n case \">\":\n if (!(field_value > filter.value)){ match = false; }\n break;\n case \">=\":\n if (!(field_value >= filter.value)){ match = false; }\n break;\n case \"=\":\n if (!(field_value === filter.value)){ match = false; }\n break;\n default:\n // If we got here the operator is not valid, so the filter should fail\n match = false;\n break;\n }\n }\n });\n return match;\n }\n });\n // Render label groups\n var self = this;\n this.label_groups = this.svg.group\n .selectAll(\"g.lz-data_layer-\" + this.layout.type + \"-label\")\n .data(filtered_data, function(d){ return d[self.layout.id_field] + \"_label\"; });\n this.label_groups.enter()\n .append(\"g\")\n .attr(\"class\", \"lz-data_layer-\"+ this.layout.type + \"-label\");\n // Render label texts\n if (this.label_texts){ this.label_texts.remove(); }\n this.label_texts = this.label_groups.append(\"text\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_texts\n .text(function(d){\n return LocusZoom.parseFields(d, data_layer.layout.label.text || \"\");\n })\n .style(data_layer.layout.label.style || {})\n .attr({\n \"x\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + data_layer.layout.label.spacing;\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"text-anchor\": function(){\n return \"start\";\n }\n });\n // Render label lines\n if (data_layer.layout.label.lines){\n if (this.label_lines){ this.label_lines.remove(); }\n this.label_lines = this.label_groups.append(\"line\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_lines\n .style(data_layer.layout.label.lines.style || {})\n .attr({\n \"x1\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field]);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y1\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"x2\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + (data_layer.layout.label.spacing/2);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y2\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n }\n });\n }\n // Remove labels when they're no longer in the filtered data set\n this.label_groups.exit().remove();\n }\n \n // Generate main scatter data elements\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-\" + this.layout.type)\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Apply default event emitters to selection\n selection.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n \n // Apply mouse behaviors\n this.applyBehaviors(selection);\n \n // Apply method to keep labels from overlapping each other\n if (this.layout.label){\n this.flip_labels();\n this.seperate_iterations = 0;\n this.separate_labels();\n // Apply default event emitters to selection\n this.label_texts.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n // Extend mouse behaviors to labels\n this.applyBehaviors(this.label_texts);\n }\n \n };\n\n // Method to set a passed element as the LD reference in the plot-level state\n this.makeLDReference = function(element){\n var ref = null;\n if (typeof element == \"undefined\"){\n throw(\"makeLDReference requires one argument of any type\");\n } else if (typeof element == \"object\"){\n if (this.layout.id_field && typeof element[this.layout.id_field] != \"undefined\"){\n ref = element[this.layout.id_field].toString();\n } else if (typeof element[\"id\"] != \"undefined\"){\n ref = element[\"id\"].toString();\n } else {\n ref = element.toString();\n }\n } else {\n ref = element.toString();\n }\n this.parent_plot.applyState({ ldrefvar: ref });\n };\n \n return this;\n\n});\n\n/**\n * A scatter plot in which the x-axis represents categories, rather than individual positions.\n * For example, this can be used by PheWAS plots to show related groups. This plot allows the categories to be\n * determined dynamically when data is first loaded.\n *\n * @class LocusZoom.DataLayers.category_scatter\n * @augments LocusZoom.DataLayers.scatter\n */\nLocusZoom.DataLayers.extend(\"scatter\", \"category_scatter\", {\n /**\n * This plot layer makes certain assumptions about the data passed in. Transform the raw array of records from\n * the datasource to prepare it for plotting, as follows:\n * 1. The scatter plot assumes that all records are given in sequence (pre-grouped by `category_field`)\n * 2. It assumes that all records have an x coordinate for individual plotting\n * @private\n */\n _prepareData: function() {\n var xField = this.layout.x_axis.field || \"x\";\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n if (!category_field) {\n throw \"Layout for \" + this.layout.id + \" must specify category_field\";\n }\n // Sort the data so that things in the same category are adjacent (case-insensitive by specified field)\n var sourceData = this.data\n .sort(function(a, b) {\n var ak = a[category_field];\n var bk = b[category_field];\n var av = ak.toString ? ak.toString().toLowerCase() : ak;\n var bv = bk.toString ? bk.toString().toLowerCase() : bk;\n return (av === bv) ? 0 : (av < bv ? -1 : 1);});\n sourceData.forEach(function(d, i){\n // Implementation detail: Scatter plot requires specifying an x-axis value, and most datasources do not\n // specify plotting positions. If a point is missing this field, fill in a synthetic value.\n d[xField] = d[xField] || i;\n });\n return sourceData;\n },\n\n /**\n * Identify the unique categories on the plot, and update the layout with an appropriate color scheme.\n * Also identify the min and max x value associated with the category, which will be used to generate ticks\n * @private\n * @returns {Object.} Series of entries used to build category name ticks {category_name: [min_x, max_x]}\n */\n _generateCategoryBounds: function() {\n // TODO: API may return null values in category_field; should we add placeholder category label?\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n var xField = this.layout.x_axis.field || \"x\";\n var uniqueCategories = {};\n this.data.forEach(function(item) {\n var category = item[category_field];\n var x = item[xField];\n var bounds = uniqueCategories[category] || [x, x];\n uniqueCategories[category] = [Math.min(bounds[0], x), Math.max(bounds[1], x)];\n });\n\n var categoryNames = Object.keys(uniqueCategories);\n this._setDynamicColorScheme(categoryNames);\n\n return uniqueCategories;\n },\n\n /**\n * Automatically define a color scheme for the layer based on data returned from the server.\n * If part of the color scheme has been specified, it will fill in remaining missing information.\n *\n * There are three scenarios:\n * 1. The layout does not specify either category names or (color) values. Dynamically build both based on\n * the data and update the layout.\n * 2. The layout specifies colors, but not categories. Use that exact color information provided, and dynamically\n * determine what categories are present in the data. (cycle through the available colors, reusing if there\n * are a lot of categories)\n * 3. The layout specifies exactly what colors and categories to use (and they match the data!). This is useful to\n * specify an explicit mapping between color scheme and category names, when you want to be sure that the\n * plot matches a standard color scheme.\n * (If the layout specifies categories that do not match the data, the user specified categories will be ignored)\n *\n * This method will only act if the layout defines a `categorical_bin` scale function for coloring. It may be\n * overridden in a subclass to suit other types of coloring methods.\n *\n * @param {String[]} categoryNames\n * @private\n */\n _setDynamicColorScheme: function(categoryNames) {\n var colorParams = this.layout.color.parameters;\n var baseParams = this._base_layout.color.parameters;\n\n // If the layout does not use a supported coloring scheme, or is already complete, this method should do nothing\n if (this.layout.color.scale_function !== \"categorical_bin\") {\n throw \"This layer requires that coloring be specified as a `categorical_bin`\";\n }\n\n if (baseParams.categories.length && baseParams.values.length) {\n // If there are preset category/color combos, make sure that they apply to the actual dataset\n var parameters_categories_hash = {};\n baseParams.categories.forEach(function (category) { parameters_categories_hash[category] = 1; });\n if (categoryNames.every(function (name) { return parameters_categories_hash.hasOwnProperty(name); })) {\n // The layout doesn't have to specify categories in order, but make sure they are all there\n colorParams.categories = baseParams.categories;\n } else {\n colorParams.categories = categoryNames;\n }\n } else {\n colorParams.categories = categoryNames;\n }\n // Prefer user-specified colors if provided. Make sure that there are enough colors for all the categories.\n var colors;\n if (baseParams.values.length) {\n colors = baseParams.values;\n } else {\n var color_scale = categoryNames.length <= 10 ? d3.scale.category10 : d3.scale.category20;\n colors = color_scale().range();\n }\n while (colors.length < categoryNames.length) { colors = colors.concat(colors); }\n colors = colors.slice(0, categoryNames.length); // List of hex values, should be of same length as categories array\n colorParams.values = colors;\n },\n\n /**\n *\n * @param dimension\n * @param {Object} [config] Parameters that customize how ticks are calculated (not style)\n * @param {('left'|'center'|'right')} [config.position='left'] Align ticks with the center or edge of category\n * @returns {Array}\n */\n getTicks: function(dimension, config) { // Overrides parent method\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw \"Invalid dimension identifier\";\n }\n var position = config.position || \"left\";\n if ([\"left\", \"center\", \"right\"].indexOf(position) === -1) {\n throw \"Invalid tick position\";\n }\n\n var categoryBounds = this._categories;\n if (!categoryBounds || !Object.keys(categoryBounds).length) {\n return [];\n }\n\n if (dimension === \"y\") {\n return [];\n }\n\n if (dimension === \"x\") {\n // If colors have been defined by this layer, use them to make tick colors match scatterplot point colors\n var knownCategories = this.layout.color.parameters.categories || [];\n var knownColors = this.layout.color.parameters.values || [];\n\n return Object.keys(categoryBounds).map(function (category, index) {\n var bounds = categoryBounds[category];\n var xPos;\n\n switch(position) {\n case \"left\":\n xPos = bounds[0];\n break;\n case \"center\":\n // Center tick under one or many elements as appropriate\n var diff = bounds[1] - bounds[0];\n xPos = bounds[0] + (diff !== 0 ? diff : bounds[0]) / 2;\n break;\n case \"right\":\n xPos = bounds[1];\n break;\n }\n return {\n x: xPos,\n text: category,\n style: {\n \"fill\": knownColors[knownCategories.indexOf(category)] || \"#000000\"\n }\n };\n });\n }\n },\n\n applyCustomDataMethods: function() {\n this.data = this._prepareData();\n /**\n * Define category names and extents (boundaries) for plotting. TODO: properties in constructor\n * @member {Object.} Category names and extents, in the form {category_name: [min_x, max_x]}\n */\n this._categories = this._generateCategoryBounds();\n return this;\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n *\n * LocusZoom has various singleton objects that are used for registering functions or classes.\n * These objects provide safe, standard methods to redefine or delete existing functions/classes\n * as well as define new custom functions/classes to be used in a plot.\n *\n * @namespace Singletons\n */\n\n\n/*\n * The Collection of \"Known\" Data Sources. This registry is used internally by the `DataSources` class\n * @class\n * @static\n */\nLocusZoom.KnownDataSources = (function() {\n /** @lends LocusZoom.KnownDataSources */\n var obj = {};\n /* @member {function[]} */\n var sources = [];\n\n var findSourceByName = function(x) {\n for(var i=0; i 1) {\n return function(x) {\n var val = x;\n for(var i = 0; i 1) {\n log = Math.ceil(Math.log(abs) / Math.LN10);\n } else { // 0...1\n log = Math.floor(Math.log(abs) / Math.LN10);\n }\n if (Math.abs(log) <= 3){\n return x.toFixed(3);\n } else {\n return x.toExponential(2).replace(\"+\", \"\").replace(\"e\", \" × 10^\");\n }\n});\n\n/**\n * URL-encode the provided text, eg for constructing hyperlinks\n * @function urlencode\n * @param {String} str\n */\nLocusZoom.TransformationFunctions.add(\"urlencode\", function(str) {\n return encodeURIComponent(str);\n});\n\n/**\n * HTML-escape user entered values for use in constructed HTML fragments\n *\n * For example, this filter can be used on tooltips with custom HTML display\n * @function htmlescape\n * @param {String} str HTML-escape the provided value\n */\nLocusZoom.TransformationFunctions.add(\"htmlescape\", function(str) {\n if ( !str ) {\n return \"\";\n }\n str = str + \"\";\n\n return str.replace( /['\"<>&`]/g, function( s ) {\n switch ( s ) {\n case \"'\":\n return \"'\";\n case \"\\\"\":\n return \""\";\n case \"<\":\n return \"<\";\n case \">\":\n return \">\";\n case \"&\":\n return \"&\";\n case \"`\":\n return \"`\";\n }\n });\n});\n\n/**\n * Singleton for accessing/storing functions that will convert arbitrary data points to values in a given scale\n * Useful for anything that needs to scale discretely with data (e.g. color, point size, etc.)\n *\n * A Scale Function can be thought of as a modifier to a layout directive that adds extra logic to how a piece of data\n * can be resolved to a value.\n *\n * All scale functions must accept an object of parameters and a value to process.\n * @class\n * @static\n */\nLocusZoom.ScaleFunctions = (function() {\n /** @lends LocusZoom.ScaleFunctions */\n var obj = {};\n var functions = {};\n\n /**\n * Find a scale function and return it. If parameters and values are passed, calls the function directly; otherwise\n * returns a callable.\n * @param {String} name\n * @param {Object} [parameters] Configuration parameters specific to the specified scale function\n * @param {*} [value] The value to operate on\n * @returns {*}\n */\n obj.get = function(name, parameters, value) {\n if (!name) {\n return null;\n } else if (functions[name]) {\n if (typeof parameters === \"undefined\" && typeof value === \"undefined\"){\n return functions[name];\n } else {\n return functions[name](parameters, value);\n }\n } else {\n throw(\"scale function [\" + name + \"] not found\");\n }\n };\n\n /**\n * @protected\n * @param {String} name The name of the function to set/unset\n * @param {Function} [fn] The function to register. If blank, removes this function name from the registry.\n */\n obj.set = function(name, fn) {\n if (fn) {\n functions[name] = fn;\n } else {\n delete functions[name];\n }\n };\n\n /**\n * Add a new scale function to the registry\n * @param {String} name The name of the scale function\n * @param {function} fn A scale function that accepts two parameters: an object of configuration and a value\n */\n obj.add = function(name, fn) {\n if (functions[name]) {\n throw(\"scale function already exists with name: \" + name);\n } else {\n obj.set(name, fn);\n }\n };\n\n /**\n * List the names of all registered scale functions\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(functions);\n };\n\n return obj;\n})();\n\n/**\n * Basic conditional function to evaluate the value of the input field and return based on equality.\n * @param {Object} parameters\n * @param {*} parameters.field_value The value against which to test the input value.\n * @param {*} parameters.then The value to return if the input value matches the field value\n * @param {*} parameters.else The value to return if the input value does not match the field value. Optional. If not\n * defined this scale function will return null (or value of null_value parameter, if defined) when input value fails\n * to match field_value.\n * @param {*} input value\n */\nLocusZoom.ScaleFunctions.add(\"if\", function(parameters, input){\n if (typeof input == \"undefined\" || parameters.field_value !== input){\n if (typeof parameters.else != \"undefined\"){\n return parameters.else;\n } else {\n return null;\n }\n } else {\n return parameters.then;\n }\n});\n\n/**\n * Function to sort numerical values into bins based on numerical break points. Will only operate on numbers and\n * return null (or value of null_value parameter, if defined) if provided a non-numeric input value. Parameters:\n * @function numerical_bin\n * @param {Object} parameters\n * @param {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter. If the input value is greater than or equal to break n and less than\n * or equal to break n+1 (or break n+1 doesn't exist) then returned value is the nth entry in the values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against break points. Must be of\n * equal length to breaks parameter. Each entry n represents the value to return if the input value is greater than\n * or equal to break n and less than or equal to break n+1 (or break n+1 doesn't exist).\n * @param {*} null_value\n * @param {*} input value\n * @returns\n */\nLocusZoom.ScaleFunctions.add(\"numerical_bin\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){\n return (parameters.null_value ? parameters.null_value : null);\n }\n var threshold = breaks.reduce(function(prev, curr){\n if (+input < prev || (+input >= prev && +input < curr)){\n return prev;\n } else {\n return curr;\n }\n });\n return values[breaks.indexOf(threshold)];\n});\n\n/**\n * Function to sort values of any type into bins based on direct equality testing with a list of categories.\n * Will return null if provided an input value that does not match to a listed category.\n * @function categorical_bin\n * @param {Object} parameters\n * @param {Array} parameters.categories Array of values against which to evaluate the input value. Must be of equal\n * length to values parameter. If the input value is equal to category n then returned value is the nth entry in the\n * values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against categories. Must be of equal\n * length to categories parameter. Each entry n represents the value to return if the input value is equal to the nth\n * value in the categories parameter.\n * @param {*} parameters.null_value Value to return if the input value fails to match to any categories. Optional.\n */\nLocusZoom.ScaleFunctions.add(\"categorical_bin\", function(parameters, value){\n if (typeof value == \"undefined\" || parameters.categories.indexOf(value) === -1){\n return (parameters.null_value ? parameters.null_value : null); \n } else {\n return parameters.values[parameters.categories.indexOf(value)];\n }\n});\n\n/**\n * Function for continuous interpolation of numerical values along a gradient with arbitrarily many break points.\n * @function interpolate\n * @parameters {Object} parameters\n * @parameters {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter and contain at least two elements. Input value will be evaluated for\n * relative position between two break points n and n+1 and the returned value will be interpolated at a relative\n * position between values n and n+1.\n * @parameters {*[]} parameters.values Array of values to interpolate and return given evaluations against break\n * points. Must be of equal length to breaks parameter and contain at least two elements. Each entry n represents\n * the value to return if the input value matches the nth entry in breaks exactly. Note that this scale function\n * uses d3.interpolate to provide for effective interpolation of many different value types, including numbers,\n * colors, shapes, etc.\n * @parameters {*} parameters.null_value\n */\nLocusZoom.ScaleFunctions.add(\"interpolate\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n var nullval = (parameters.null_value ? parameters.null_value : null);\n if (breaks.length < 2 || breaks.length !== values.length){ return nullval; }\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){ return nullval; }\n if (+input <= parameters.breaks[0]){\n return values[0];\n } else if (+input >= parameters.breaks[parameters.breaks.length-1]){\n return values[breaks.length-1];\n } else {\n var upper_idx = null;\n breaks.forEach(function(brk, idx){\n if (!idx){ return; }\n if (breaks[idx-1] <= +input && breaks[idx] >= +input){ upper_idx = idx; }\n });\n if (upper_idx === null){ return nullval; }\n var normalized_input = (+input - breaks[upper_idx-1]) / (breaks[upper_idx] - breaks[upper_idx-1]);\n if (!isFinite(normalized_input)){ return nullval; }\n return d3.interpolate(values[upper_idx-1], values[upper_idx])(normalized_input);\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A Dashboard is an HTML element used for presenting arbitrary user interface components. Dashboards are anchored\n * to either the entire Plot or to individual Panels.\n *\n * Each dashboard is an HTML-based (read: not SVG) collection of components used to display information or provide\n * user interface. Dashboards can exist on entire plots, where their visibility is permanent and vertically adjacent\n * to the plot, or on individual panels, where their visibility is tied to a behavior (e.g. a mouseover) and is as\n * an overlay.\n * @class\n */\nLocusZoom.Dashboard = function(parent){\n // parent must be a locuszoom plot or panel\n if (!(parent instanceof LocusZoom.Plot) && !(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create dashboard, parent must be a locuszoom plot or panel\";\n }\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".dashboard\";\n /** @member {('plot'|'panel')} */\n this.type = (this.parent instanceof LocusZoom.Plot) ? \"plot\" : \"panel\";\n /** @member {LocusZoom.Plot} */\n this.parent_plot = this.type === \"plot\" ? this.parent : this.parent.parent;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {LocusZoom.Dashboard.Component[]} */\n this.components = [];\n /**\n * The timer identifier as returned by setTimeout\n * @member {Number}\n */\n this.hide_timeout = null;\n /**\n * Whether to hide the dashboard. Can be overridden by a child component. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n\n // TODO: Return value from constructor function?\n return this.initialize();\n};\n\n/**\n * Prepare the dashboard for first use: generate all component instances for this dashboard, based on the provided\n * layout of the parent. Connects event listeners and shows/hides as appropriate.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.initialize = function() {\n // Parse layout to generate component instances\n if (Array.isArray(this.parent.layout.dashboard.components)){\n this.parent.layout.dashboard.components.forEach(function(layout){\n try {\n var component = LocusZoom.Dashboard.Components.get(layout.type, layout, this);\n this.components.push(component);\n } catch (e) {\n console.warn(e);\n }\n }.bind(this));\n }\n\n // Add mouseover event handlers to show/hide panel dashboard\n if (this.type === \"panel\"){\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseover.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n if (!this.selector || this.selector.style(\"visibility\") === \"hidden\"){ this.show(); }\n }.bind(this));\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseout.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n this.hide_timeout = setTimeout(function(){ this.hide(); }.bind(this), 300);\n }.bind(this));\n }\n\n return this;\n\n};\n\n/**\n * Whether to persist the dashboard. Returns true if at least one component should persist, or if the panel is engaged\n * in an active drag event.\n * @returns {boolean}\n */\nLocusZoom.Dashboard.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n var persist = false;\n // Persist if at least one component should also persist\n this.components.forEach(function(component){\n persist = persist || component.shouldPersist();\n });\n // Persist if in a parent drag event\n persist = persist || (this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.dragging);\n return !!persist;\n};\n\n/**\n * Make the dashboard appear. If it doesn't exist yet create it, including creating/positioning all components within,\n * and make sure it is set to be visible.\n */\nLocusZoom.Dashboard.prototype.show = function(){\n if (!this.selector){\n switch (this.type){\n case \"plot\":\n this.selector = d3.select(this.parent.svg.node().parentNode)\n .insert(\"div\",\":first-child\");\n break;\n case \"panel\":\n this.selector = d3.select(this.parent.parent.svg.node().parentNode)\n .insert(\"div\", \".lz-data_layer-tooltip, .lz-dashboard-menu, .lz-curtain\").classed(\"lz-panel-dashboard\", true);\n break;\n }\n this.selector.classed(\"lz-dashboard\", true).classed(\"lz-\"+this.type+\"-dashboard\", true).attr(\"id\", this.id);\n }\n this.components.forEach(function(component){ component.show(); });\n this.selector.style({ visibility: \"visible\" });\n return this.update();\n};\n\n/**\n * Update the dashboard and rerender all child components. This can be called whenever plot state changes.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.update = function(){\n if (!this.selector){ return this; }\n this.components.forEach(function(component){ component.update(); });\n return this.position();\n};\n\n/**\n * Position the dashboard (and child components) within the panel\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.position = function(){\n if (!this.selector){ return this; }\n // Position the dashboard itself (panel only)\n if (this.type === \"panel\"){\n var page_origin = this.parent.getPageOrigin();\n var top = (page_origin.y + 3.5).toString() + \"px\";\n var left = page_origin.x.toString() + \"px\";\n var width = (this.parent.layout.width - 4).toString() + \"px\";\n this.selector.style({ position: \"absolute\", top: top, left: left, width: width });\n }\n // Recursively position components\n this.components.forEach(function(component){ component.position(); });\n return this;\n};\n\n/**\n * Hide the dashboard (make invisible but do not destroy). Will do nothing if `shouldPersist` returns true.\n *\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n this.components.forEach(function(component){ component.hide(); });\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n\n/**\n * Completely remove dashboard and all child components. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n this.components.forEach(function(component){ component.destroy(true); });\n this.components = [];\n this.selector.remove();\n this.selector = null;\n return this;\n};\n\n/**\n *\n * A dashboard component is an empty div rendered on a dashboard that can display custom\n * html of user interface elements. LocusZoom.Dashboard.Components is a singleton used to\n * define and manage an extendable collection of dashboard components.\n * (e.g. by LocusZoom.Dashboard.Components.add())\n * @class\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @param {('left'|'right')} [layout.position='left'] Whether to float the component left or right.\n * @param {('start'|'middle'|'end')} [layout.group_position] Buttons can optionally be gathered into a visually\n * distinctive group whose elements are closer together. If a button is identified as the start or end of a group,\n * it will be drawn with rounded corners and an extra margin of spacing from any button not part of the group.\n * For example, the region_nav_plot dashboard is a defined as a group.\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple'} [layout.color='gray'] Color scheme for the\n * component. Applies to buttons and menus.\n * @param {LocusZoom.Dashboard} parent The dashboard that contains this component\n*/\nLocusZoom.Dashboard.Component = function(layout, parent) {\n /** @member {Object} */\n this.layout = layout || {};\n if (!this.layout.color){ this.layout.color = \"gray\"; }\n\n /** @member {LocusZoom.Dashboard|*} */\n this.parent = parent || null;\n /**\n * Some dashboards are attached to a panel, rather than directly to a plot\n * @member {LocusZoom.Panel|null}\n */\n this.parent_panel = null;\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n /**\n * This is a reference to either the panel or the plot, depending on what the dashboard is\n * tied to. Useful when absolutely positioning dashboard components relative to their SVG anchor.\n * @member {LocusZoom.Plot|LocusZoom.Panel}\n */\n this.parent_svg = null;\n if (this.parent instanceof LocusZoom.Dashboard){\n // TODO: when is the immediate parent *not* a dashboard?\n if (this.parent.type === \"panel\"){\n this.parent_panel = this.parent.parent;\n this.parent_plot = this.parent.parent.parent;\n this.parent_svg = this.parent_panel;\n } else {\n this.parent_plot = this.parent.parent;\n this.parent_svg = this.parent_plot;\n }\n }\n /** @member {d3.selection} */\n this.selector = null;\n /**\n * If this is an interactive component, it will contain a button or menu instance that handles the interactivity.\n * There is a 1-to-1 relationship of dashboard component to button\n * @member {null|LocusZoom.Dashboard.Component.Button}\n */\n this.button = null;\n /**\n * If any single component is marked persistent, it will bubble up to prevent automatic hide behavior on a\n * component's parent dashboard. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n if (!this.layout.position){ this.layout.position = \"left\"; }\n\n // TODO: Return value in constructor\n return this;\n};\n/**\n * Perform all rendering of component, including toggling visibility to true. Will initialize and create SVG element\n * if necessary, as well as updating with new data and performing layout actions.\n */\nLocusZoom.Dashboard.Component.prototype.show = function(){\n if (!this.parent || !this.parent.selector){ return; }\n if (!this.selector){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.layout.group_position) !== -1 ? \" lz-dashboard-group-\" + this.layout.group_position : \"\");\n this.selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-\" + this.layout.position + group_position);\n if (this.layout.style){ this.selector.style(this.layout.style); }\n if (typeof this.initialize == \"function\"){ this.initialize(); }\n }\n if (this.button && this.button.status === \"highlighted\"){ this.button.menu.show(); }\n this.selector.style({ visibility: \"visible\" });\n this.update();\n return this.position();\n};\n/**\n * Update the dashboard component with any new data or plot state as appropriate. This method performs all\n * necessary rendering steps.\n */\nLocusZoom.Dashboard.Component.prototype.update = function(){ /* stub */ };\n/**\n * Place the component correctly in the plot\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.position = function(){\n if (this.button){ this.button.menu.position(); }\n return this;\n};\n/**\n * Determine whether the component should persist (will bubble up to parent dashboard)\n * @returns {boolean}\n */\nLocusZoom.Dashboard.Component.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n if (this.button && this.button.persist){ return true; }\n return false;\n};\n/**\n * Toggle visibility to hidden, unless marked as persistent\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n if (this.button){ this.button.menu.hide(); }\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n/**\n * Completely remove component and button. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.Component.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n if (this.button && this.button.menu){ this.button.menu.destroy(); }\n this.selector.remove();\n this.selector = null;\n this.button = null;\n return this;\n};\n\n/**\n * Singleton registry of all known components\n * @class\n * @static\n */\nLocusZoom.Dashboard.Components = (function() {\n /** @lends LocusZoom.Dashboard.Components */\n var obj = {};\n var components = {};\n\n /**\n * Create a new component instance by name\n * @param {String} name The string identifier of the desired component\n * @param {Object} layout The layout to use to create the component\n * @param {LocusZoom.Dashboard} parent The containing dashboard to use when creating the component\n * @returns {LocusZoom.Dashboard.Component}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (components[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for dashboard component [\" + name + \"]\");\n } else {\n return new components[name](layout, parent);\n }\n } else {\n throw(\"dashboard component [\" + name + \"] not found\");\n }\n };\n /**\n * Add a new component constructor to the registry and ensure that it extends the correct parent class\n * @protected\n * @param name\n * @param component\n */\n obj.set = function(name, component) {\n if (component) {\n if (typeof component != \"function\"){\n throw(\"unable to set dashboard component [\" + name + \"], argument provided is not a function\");\n } else {\n components[name] = component;\n components[name].prototype = new LocusZoom.Dashboard.Component();\n }\n } else {\n delete components[name];\n }\n };\n\n /**\n * Register a new component constructor by name\n * @param {String} name\n * @param {function} component The component constructor\n */\n obj.add = function(name, component) {\n if (components[name]) {\n throw(\"dashboard component already exists with name: \" + name);\n } else {\n obj.set(name, component);\n }\n };\n\n /**\n * List the names of all registered components\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(components);\n };\n\n return obj;\n})();\n\n/**\n * Plots and panels may have a \"dashboard\" element suited for showing HTML components that may be interactive.\n * When components need to incorporate a generic button, or additionally a button that generates a menu, this\n * class provides much of the necessary framework.\n * @class\n * @param {LocusZoom.Dashboard.Component} parent\n */\nLocusZoom.Dashboard.Component.Button = function(parent) { \n \n if (!(parent instanceof LocusZoom.Dashboard.Component)){\n throw \"Unable to create dashboard component button, invalid parent\";\n }\n /** @member {LocusZoom.Dashboard.Component} */\n this.parent = parent;\n /** @member {LocusZoom.Dashboard.Panel} */\n this.parent_panel = this.parent.parent_panel;\n /** @member {LocusZoom.Dashboard.Plot} */\n this.parent_plot = this.parent.parent_plot;\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent_svg = this.parent.parent_svg;\n\n /** @member {LocusZoom.Dashboard|null|*} */\n this.parent_dashboard = this.parent.parent;\n /** @member {d3.selection} */\n this.selector = null;\n\n /**\n * Tag to use for the button (default: a)\n * @member {String}\n */\n this.tag = \"a\";\n\n /**\n * TODO This method does not appear to be used anywhere\n * @param {String} tag\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTag = function(tag){\n if (typeof tag != \"undefined\"){ this.tag = tag.toString(); }\n return this;\n };\n\n /**\n * HTML for the button to show.\n * @protected\n * @member {String}\n */\n this.html = \"\";\n /**\n * Specify the HTML content of this button.\n * WARNING: The string provided will be inserted into the document as raw markup; XSS mitigation is the\n * responsibility of each button implementation.\n * @param {String} html\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setHtml = function(html){\n if (typeof html != \"undefined\"){ this.html = html.toString(); }\n return this;\n };\n /**\n * @deprecated since 0.5.6; use setHTML instead\n */\n this.setText = this.setHTML;\n\n /**\n * Mouseover title text for the button to show\n * @protected\n * @member {String}\n */\n this.title = \"\";\n /**\n * Set the mouseover title text for the button (if any)\n * @param {String} title Simple text to display\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTitle = function(title){\n if (typeof title != \"undefined\"){ this.title = title.toString(); }\n return this;\n };\n\n /**\n * Color of the button\n * @member {String}\n */\n this.color = \"gray\";\n\n /**\n * Set the color associated with this button\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple')} color Any selection not in the preset list\n * will be replaced with gray.\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setColor = function(color){\n if (typeof color != \"undefined\"){\n if ([\"gray\", \"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"purple\"].indexOf(color) !== -1){ this.color = color; }\n else { this.color = \"gray\"; }\n }\n return this;\n };\n\n /**\n * Hash of arbitrary button styles to apply as {name: value} entries\n * @protected\n * @member {Object}\n */\n this.style = {};\n /**\n * Set a collection of custom styles to be used by the button\n * @param {Object} style Hash of {name:value} entries\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setStyle = function(style){\n if (typeof style != \"undefined\"){ this.style = style; }\n return this;\n };\n\n //\n /**\n * Method to generate a CSS class string\n * @returns {string}\n */\n this.getClass = function(){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.parent.layout.group_position) !== -1 ? \" lz-dashboard-button-group-\" + this.parent.layout.group_position : \"\");\n return \"lz-dashboard-button lz-dashboard-button-\" + this.color + (this.status ? \"-\" + this.status : \"\") + group_position;\n };\n\n // Permanence\n /**\n * Track internal state on whether to keep showing the button/ menu contents at the moment\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n /**\n * Configuration when defining a button: track whether this component should be allowed to keep open\n * menu/button contents in response to certain events\n * @protected\n * @member {Boolean}\n */\n this.permanent = false;\n /**\n * Allow code to change whether the button is allowed to be `permanent`\n * @param {boolean} bool\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setPermanent = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n this.permanent = bool;\n if (this.permanent){ this.persist = true; }\n return this;\n };\n /**\n * Determine whether the button/menu contents should persist in response to a specific event\n * @returns {Boolean}\n */\n this.shouldPersist = function(){\n return this.permanent || this.persist;\n };\n\n /**\n * Button status (highlighted / disabled/ etc)\n * @protected\n * @member {String}\n */\n this.status = \"\";\n /**\n * Change button state\n * @param {('highlighted'|'disabled'|'')} status\n */\n this.setStatus = function(status){\n if (typeof status != \"undefined\" && [\"\", \"highlighted\", \"disabled\"].indexOf(status) !== -1){ this.status = status; }\n return this.update();\n };\n /**\n * Toggle whether the button is highlighted\n * @param {boolean} bool If provided, explicitly set highlighted state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.highlight = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"highlighted\"); }\n else if (this.status === \"highlighted\"){ return this.setStatus(\"\"); }\n return this;\n };\n /**\n * Toggle whether the button is disabled\n * @param {boolean} bool If provided, explicitly set disabled state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.disable = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"disabled\"); }\n else if (this.status === \"disabled\"){ return this.setStatus(\"\"); }\n return this;\n };\n\n // Mouse events\n /** @member {function} */\n this.onmouseover = function(){};\n this.setOnMouseover = function(onmouseover){\n if (typeof onmouseover == \"function\"){ this.onmouseover = onmouseover; }\n else { this.onmouseover = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onmouseout = function(){};\n this.setOnMouseout = function(onmouseout){\n if (typeof onmouseout == \"function\"){ this.onmouseout = onmouseout; }\n else { this.onmouseout = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onclick = function(){};\n this.setOnclick = function(onclick){\n if (typeof onclick == \"function\"){ this.onclick = onclick; }\n else { this.onclick = function(){}; }\n return this;\n };\n \n // Primary behavior functions\n /**\n * Show the button, including creating DOM elements if necessary for first render\n */\n this.show = function(){\n if (!this.parent){ return; }\n if (!this.selector){\n this.selector = this.parent.selector.append(this.tag).attr(\"class\", this.getClass());\n }\n return this.update();\n };\n /**\n * Hook for any actions or state cleanup to be performed before rerendering\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.preUpdate = function(){ return this; };\n /**\n * Update button state and contents, and fully rerender\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.update = function(){\n if (!this.selector){ return this; }\n this.preUpdate();\n this.selector\n .attr(\"class\", this.getClass())\n .attr(\"title\", this.title).style(this.style)\n .on(\"mouseover\", (this.status === \"disabled\") ? null : this.onmouseover)\n .on(\"mouseout\", (this.status === \"disabled\") ? null : this.onmouseout)\n .on(\"click\", (this.status === \"disabled\") ? null : this.onclick)\n .html(this.html);\n this.menu.update();\n this.postUpdate();\n return this;\n };\n /**\n * Hook for any behavior to be added/changed after the button has been re-rendered\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.postUpdate = function(){ return this; };\n /**\n * Hide the button by removing it from the DOM (may be overridden by current persistence setting)\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.hide = function(){\n if (this.selector && !this.shouldPersist()){\n this.selector.remove();\n this.selector = null;\n }\n return this;\n }; \n\n /**\n * Button Menu Object\n * The menu is an HTML overlay that can appear below a button. It can contain arbitrary HTML and\n * has logic to be automatically positioned and sized to behave more or less like a dropdown menu.\n * @member {Object}\n */\n this.menu = {\n outer_selector: null,\n inner_selector: null,\n scroll_position: 0,\n hidden: true,\n /**\n * Show the button menu, including setting up any DOM elements needed for first rendering\n */\n show: function(){\n if (!this.menu.outer_selector){\n this.menu.outer_selector = d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu lz-dashboard-menu-\" + this.color)\n .attr(\"id\", this.parent_svg.getBaseId() + \".dashboard.menu\");\n this.menu.inner_selector = this.menu.outer_selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu-content\");\n this.menu.inner_selector.on(\"scroll\", function(){\n this.menu.scroll_position = this.menu.inner_selector.node().scrollTop;\n }.bind(this));\n }\n this.menu.outer_selector.style({ visibility: \"visible\" });\n this.menu.hidden = false;\n return this.menu.update();\n }.bind(this),\n /**\n * Update the rendering of the menu\n */\n update: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.populate(); // This function is stubbed for all buttons by default and custom implemented in component definition\n if (this.menu.inner_selector){ this.menu.inner_selector.node().scrollTop = this.menu.scroll_position; }\n return this.menu.position();\n }.bind(this),\n position: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n // Unset any explicitly defined outer selector height so that menus dynamically shrink if content is removed\n this.menu.outer_selector.style({ height: null });\n var padding = 3;\n var scrollbar_padding = 20;\n var menu_height_padding = 14; // 14: 2x 6px padding, 2x 1px border\n var page_origin = this.parent_svg.getPageOrigin();\n var page_scroll_top = document.documentElement.scrollTop || document.body.scrollTop;\n var container_offset = this.parent_plot.getContainerOffset();\n var dashboard_client_rect = this.parent_dashboard.selector.node().getBoundingClientRect();\n var button_client_rect = this.selector.node().getBoundingClientRect();\n var menu_client_rect = this.menu.outer_selector.node().getBoundingClientRect();\n var total_content_height = this.menu.inner_selector.node().scrollHeight;\n var top = 0; var left = 0;\n if (this.parent_dashboard.type === \"panel\"){\n top = (page_origin.y + dashboard_client_rect.height + (2 * padding));\n left = Math.max(page_origin.x + this.parent_svg.layout.width - menu_client_rect.width - padding, page_origin.x + padding);\n } else {\n top = button_client_rect.bottom + page_scroll_top + padding - container_offset.top;\n left = Math.max(button_client_rect.left + button_client_rect.width - menu_client_rect.width - container_offset.left, page_origin.x + padding);\n }\n var base_max_width = Math.max(this.parent_svg.layout.width - (2 * padding) - scrollbar_padding, scrollbar_padding);\n var container_max_width = base_max_width;\n var content_max_width = (base_max_width - (4 * padding));\n var base_max_height = Math.max(this.parent_svg.layout.height - (10 * padding) - menu_height_padding, menu_height_padding);\n var height = Math.min(total_content_height, base_max_height);\n var max_height = base_max_height;\n this.menu.outer_selector.style({\n \"top\": top.toString() + \"px\",\n \"left\": left.toString() + \"px\",\n \"max-width\": container_max_width.toString() + \"px\",\n \"max-height\": max_height.toString() + \"px\",\n \"height\": height.toString() + \"px\"\n });\n this.menu.inner_selector.style({ \"max-width\": content_max_width.toString() + \"px\" });\n this.menu.inner_selector.node().scrollTop = this.menu.scroll_position;\n return this.menu;\n }.bind(this),\n hide: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.outer_selector.style({ visibility: \"hidden\" });\n this.menu.hidden = true;\n return this.menu;\n }.bind(this),\n destroy: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.inner_selector.remove();\n this.menu.outer_selector.remove();\n this.menu.inner_selector = null;\n this.menu.outer_selector = null;\n return this.menu;\n }.bind(this),\n /**\n * Internal method definition\n * By convention populate() does nothing and should be reimplemented with each dashboard button definition\n * Reimplement by way of Dashboard.Component.Button.menu.setPopulate to define the populate method and hook\n * up standard menu click-toggle behavior prototype.\n * @protected\n */\n populate: function(){ /* stub */ }.bind(this),\n /**\n * Define how the menu is populated with items, and set up click and display properties as appropriate\n * @public\n */\n setPopulate: function(menu_populate_function){\n if (typeof menu_populate_function == \"function\"){\n this.menu.populate = menu_populate_function;\n this.setOnclick(function(){\n if (this.menu.hidden){\n this.menu.show();\n this.highlight().update();\n this.persist = true;\n } else {\n this.menu.hide();\n this.highlight(false).update();\n if (!this.permanent){ this.persist = false; }\n }\n }.bind(this));\n } else {\n this.setOnclick();\n }\n return this;\n }.bind(this)\n };\n\n};\n\n/**\n * Renders arbitrary text with title formatting\n * @class LocusZoom.Dashboard.Components.title\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.title Text to render\n */\nLocusZoom.Dashboard.Components.add(\"title\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.show = function(){\n this.div_selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-title lz-dashboard-\" + this.layout.position);\n this.title_selector = this.div_selector.append(\"h3\");\n return this.update();\n };\n this.update = function(){\n var title = layout.title.toString();\n if (this.layout.subtitle){ title += \" \" + this.layout.subtitle + \"\"; }\n this.title_selector.html(title);\n return this;\n };\n});\n\n/**\n * Renders text to display the current dimensions of the plot. Automatically updated as plot dimensions change\n * @class LocusZoom.Dashboard.Components.dimensions\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"dimensions\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var display_width = this.parent_plot.layout.width.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.width : this.parent_plot.layout.width.toFixed(2);\n var display_height = this.parent_plot.layout.height.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.height : this.parent_plot.layout.height.toFixed(2);\n this.selector.html(display_width + \"px × \" + display_height + \"px\");\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Display the current scale of the genome region displayed in the plot, as defined by the difference between\n * `state.end` and `state.start`.\n * @class LocusZoom.Dashboard.Components.region_scale\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"region_scale\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (!isNaN(this.parent_plot.state.start) && !isNaN(this.parent_plot.state.end)\n && this.parent_plot.state.start !== null && this.parent_plot.state.end !== null){\n this.selector.style(\"display\", null);\n this.selector.html(LocusZoom.positionIntToString(this.parent_plot.state.end - this.parent_plot.state.start, null, true));\n } else {\n this.selector.style(\"display\", \"none\");\n }\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Button to export current plot to an SVG image\n * @class LocusZoom.Dashboard.Components.download\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"download\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Download Image\").setTitle(\"Download image of the current plot as locuszoom.svg\")\n .setOnMouseover(function() {\n this.button.selector\n .classed(\"lz-dashboard-button-gray-disabled\", true)\n .html(\"Preparing Image\");\n this.generateBase64SVG().then(function(base64_string){\n this.button.selector\n .attr(\"href\", \"data:image/svg+xml;base64,\\n\" + base64_string)\n .classed(\"lz-dashboard-button-gray-disabled\", false)\n .classed(\"lz-dashboard-button-gray-highlighted\", true)\n .html(\"Download Image\");\n }.bind(this));\n }.bind(this))\n .setOnMouseout(function() {\n this.button.selector.classed(\"lz-dashboard-button-gray-highlighted\", false);\n }.bind(this));\n this.button.show();\n this.button.selector.attr(\"href-lang\", \"image/svg+xml\").attr(\"download\", \"locuszoom.svg\");\n return this;\n };\n this.css_string = \"\";\n for (var stylesheet in Object.keys(document.styleSheets)){\n if ( document.styleSheets[stylesheet].href !== null\n && document.styleSheets[stylesheet].href.indexOf(\"locuszoom.css\") !== -1){\n // TODO: \"Download image\" button will render the image incorrectly if the stylesheet has been renamed or concatenated\n LocusZoom.createCORSPromise(\"GET\", document.styleSheets[stylesheet].href)\n .then(function(response){\n this.css_string = response.replace(/[\\r\\n]/g,\" \").replace(/\\s+/g,\" \");\n if (this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\")){\n this.css_string = this.css_string.substring(0, this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\"));\n }\n }.bind(this));\n break;\n }\n } \n this.generateBase64SVG = function(){\n return Q.fcall(function () {\n // Insert a hidden div, clone the node into that so we can modify it with d3\n var container = this.parent.selector.append(\"div\").style(\"display\", \"none\")\n .html(this.parent_plot.svg.node().outerHTML);\n // Remove unnecessary elements\n container.selectAll(\"g.lz-curtain\").remove();\n container.selectAll(\"g.lz-mouse_guide\").remove();\n // Convert units on axis tick dy attributes from ems to pixels\n container.selectAll(\"g.tick text\").each(function(){\n var dy = +(d3.select(this).attr(\"dy\").substring(-2).slice(0,-2))*10;\n d3.select(this).attr(\"dy\", dy);\n });\n // Pull the svg into a string and add the contents of the locuszoom stylesheet\n // Don't add this with d3 because it will escape the CDATA declaration incorrectly\n var initial_html = d3.select(container.select(\"svg\").node().parentNode).html();\n var style_def = \"\";\n var insert_at = initial_html.indexOf(\">\") + 1;\n initial_html = initial_html.slice(0,insert_at) + style_def + initial_html.slice(insert_at);\n // Delete the container node\n container.remove();\n // Base64-encode the string and return it\n return btoa(encodeURIComponent(initial_html).replace(/%([0-9A-F]{2})/g, function(match, p1) {\n return String.fromCharCode(\"0x\" + p1);\n }));\n }.bind(this));\n };\n});\n\n/**\n * Button to remove panel from plot.\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.remove_panel\n * @augments LocusZoom.Dashboard.Component\n * @param {Boolean} [layout.suppress_confirm=false] If true, removes the panel without prompting user for confirmation\n */\nLocusZoom.Dashboard.Components.add(\"remove_panel\", function(layout) {\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function() {\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"×\").setTitle(\"Remove panel\")\n .setOnclick(function(){\n if (!layout.suppress_confirm && !confirm(\"Are you sure you want to remove this panel? This cannot be undone!\")){\n return false;\n }\n var panel = this.parent_panel;\n panel.dashboard.hide(true);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseover.\" + panel.getBaseId() + \".dashboard\", null);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseout.\" + panel.getBaseId() + \".dashboard\", null);\n return panel.parent.removePanel(panel.id);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to move panel up relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_up\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_up\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_top = (this.parent_panel.layout.y_index === 0);\n this.button.disable(is_at_top);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▴\").setTitle(\"Move panel up\")\n .setOnclick(function(){\n this.parent_panel.moveUp();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to move panel down relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_down\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_down\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_bottom = (this.parent_panel.layout.y_index === this.parent_plot.panel_ids_by_y_index.length-1);\n this.button.disable(is_at_bottom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▾\").setTitle(\"Move panel down\")\n .setOnclick(function(){\n this.parent_panel.moveDown();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to shift plot region forwards or back by a `step` increment provided in the layout\n * @class LocusZoom.Dashboard.Components.shift_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=50000] The stepsize to change the region by\n * @param {string} [layout.button_html]\n * @param {string} [layout.button_title]\n */\nLocusZoom.Dashboard.Components.add(\"shift_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add shift_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 50000; }\n if (typeof layout.button_html !== \"string\"){ layout.button_html = layout.step > 0 ? \">\" : \"<\"; }\n if (typeof layout.button_title !== \"string\"){\n layout.button_title = \"Shift region by \" + (layout.step > 0 ? \"+\" : \"-\") + LocusZoom.positionIntToString(Math.abs(layout.step),null,true);\n }\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start + layout.step, 1),\n end: this.parent_plot.state.end + layout.step\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Zoom in or out on the plot, centered on the middle of the plot region, by the specified amount\n * @class LocusZoom.Dashboard.Components.zoom_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=0.2] The amount to zoom in by (where 1 indicates 100%)\n */\nLocusZoom.Dashboard.Components.add(\"zoom_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add zoom_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 0.2; }\n if (typeof layout.button_html != \"string\"){ layout.button_html = layout.step > 0 ? \"z–\" : \"z+\"; }\n if (typeof layout.button_title != \"string\"){\n layout.button_title = \"Zoom region \" + (layout.step > 0 ? \"out\" : \"in\") + \" by \" + (Math.abs(layout.step)*100).toFixed(1) + \"%\";\n }\n this.update = function(){\n if (this.button){\n var can_zoom = true;\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n if (layout.step > 0 && !isNaN(this.parent_plot.layout.max_region_scale) && current_region_scale >= this.parent_plot.layout.max_region_scale){\n can_zoom = false;\n }\n if (layout.step < 0 && !isNaN(this.parent_plot.layout.min_region_scale) && current_region_scale <= this.parent_plot.layout.min_region_scale){\n can_zoom = false;\n }\n this.button.disable(!can_zoom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n var zoom_factor = 1 + layout.step;\n var new_region_scale = current_region_scale * zoom_factor;\n if (!isNaN(this.parent_plot.layout.max_region_scale)){\n new_region_scale = Math.min(new_region_scale, this.parent_plot.layout.max_region_scale);\n }\n if (!isNaN(this.parent_plot.layout.min_region_scale)){\n new_region_scale = Math.max(new_region_scale, this.parent_plot.layout.min_region_scale);\n }\n var delta = Math.floor((new_region_scale - current_region_scale) / 2);\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start - delta, 1),\n end: this.parent_plot.state.end + delta\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Renders button with arbitrary text that, when clicked, shows a dropdown containing arbitrary HTML\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @class LocusZoom.Dashboard.Components.menu\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n * @param {string} layout.menu_html The HTML content of the dropdown menu\n */\nLocusZoom.Dashboard.Components.add(\"menu\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title);\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(layout.menu_html);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Special button/menu to allow model building by tracking individual covariants. Will track a list of covariate\n * objects and store them in the special `model.covariates` field of plot `state`.\n * @class LocusZoom.Dashboard.Components.covariates_model\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n */\nLocusZoom.Dashboard.Components.add(\"covariates_model\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.initialize = function(){\n // Initialize state.model.covariates\n this.parent_plot.state.model = this.parent_plot.state.model || {};\n this.parent_plot.state.model.covariates = this.parent_plot.state.model.covariates || [];\n // Create an object at the plot level for easy access to interface methods in custom client-side JS\n /**\n * When a covariates model dashboard element is present, create (one) object at the plot level that exposes\n * component data and state for custom interactions with other plot elements.\n * @class LocusZoom.Plot.CovariatesModel\n */\n this.parent_plot.CovariatesModel = {\n /** @member {LocusZoom.Dashboard.Component.Button} */\n button: this,\n /**\n * Add an element to the model and show a representation of it in the dashboard component menu. If the\n * element is already part of the model, do nothing (to avoid adding duplicates).\n * When plot state is changed, this will automatically trigger requests for new data accordingly.\n * @param {string|object} element_reference Can be any value that can be put through JSON.stringify()\n * to create a serialized representation of itself.\n */\n add: function(element_reference){\n var element = JSON.parse(JSON.stringify(element_reference));\n if (typeof element_reference == \"object\" && typeof element.html != \"string\"){\n element.html = ( (typeof element_reference.toHTML == \"function\") ? element_reference.toHTML() : element_reference.toString());\n }\n // Check if the element is already in the model covariates array and return if it is.\n for (var i = 0; i < this.state.model.covariates.length; i++) {\n if (JSON.stringify(this.state.model.covariates[i]) === JSON.stringify(element)) {\n return this;\n }\n }\n this.state.model.covariates.push(element);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Remove an element from `state.model.covariates` (and from the dashboard component menu's\n * representation of the state model). When plot state is changed, this will automatically trigger\n * requests for new data accordingly.\n * @param {number} idx Array index of the element, in the `state.model.covariates array`.\n */\n removeByIdx: function(idx){\n if (typeof this.state.model.covariates[idx] == \"undefined\"){\n throw(\"Unable to remove model covariate, invalid index: \" + idx.toString());\n }\n this.state.model.covariates.splice(idx, 1);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Empty the `state.model.covariates` array (and dashboard component menu representation thereof) of all\n * elements. When plot state is changed, this will automatically trigger requests for new data accordingly\n */\n removeAll: function(){\n this.state.model.covariates = [];\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Manually trigger the update methods on the dashboard component's button and menu elements to force\n * display of most up-to-date content. Can be used to force the dashboard to reflect changes made, eg if\n * modifying `state.model.covariates` directly instead of via `plot.CovariatesModel`\n */\n updateComponent: function(){\n this.button.update();\n this.button.menu.update();\n }.bind(this)\n };\n }.bind(this);\n\n this.update = function(){\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n var selector = this.button.menu.inner_selector;\n selector.html(\"\");\n // General model HTML representation\n if (typeof this.parent_plot.state.model.html != \"undefined\"){\n selector.append(\"div\").html(this.parent_plot.state.model.html);\n }\n // Model covariates table\n if (!this.parent_plot.state.model.covariates.length){\n selector.append(\"i\").html(\"no covariates in model\");\n } else {\n selector.append(\"h5\").html(\"Model Covariates (\" + this.parent_plot.state.model.covariates.length + \")\");\n var table = selector.append(\"table\");\n this.parent_plot.state.model.covariates.forEach(function(covariate, idx){\n var html = ( (typeof covariate == \"object\" && typeof covariate.html == \"string\") ? covariate.html : covariate.toString() );\n var row = table.append(\"tr\");\n row.append(\"td\").append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeByIdx(idx);\n }.bind(this))\n .html(\"×\");\n row.append(\"td\").html(html);\n }.bind(this));\n selector.append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"4px\" }).html(\"× Remove All Covariates\")\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeAll();\n }.bind(this));\n }\n }.bind(this));\n\n this.button.preUpdate = function(){\n var html = \"Model\";\n if (this.parent_plot.state.model.covariates.length){\n var cov = this.parent_plot.state.model.covariates.length > 1 ? \"covariates\" : \"covariate\";\n html += \" (\" + this.parent_plot.state.model.covariates.length + \" \" + cov + \")\";\n }\n this.button.setHtml(html).disable(false);\n }.bind(this);\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Button to toggle split tracks\n * @class LocusZoom.Dashboard.Components.toggle_split_tracks\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_split_tracks\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (!layout.data_layer_id){ layout.data_layer_id = \"intervals\"; }\n if (!this.parent_panel.data_layers[layout.data_layer_id]){\n throw (\"Dashboard toggle split tracks component missing valid data layer ID\");\n }\n this.update = function(){\n var data_layer = this.parent_panel.data_layers[layout.data_layer_id];\n var html = data_layer.layout.split_tracks ? \"Merge Tracks\" : \"Split Tracks\";\n if (this.button){\n this.button.setHtml(html);\n this.button.show();\n this.parent.position();\n return this;\n } else {\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(html)\n .setTitle(\"Toggle whether tracks are split apart or merged together\")\n .setOnclick(function(){\n data_layer.toggleSplitTracks();\n if (this.scale_timeout){ clearTimeout(this.scale_timeout); }\n var timeout = data_layer.layout.transition ? +data_layer.layout.transition.duration || 0 : 0;\n this.scale_timeout = setTimeout(function(){\n this.parent_panel.scaleHeightToData();\n this.parent_plot.positionPanels();\n }.bind(this), timeout);\n this.update();\n }.bind(this));\n return this.update();\n }\n };\n});\n\n/**\n * Button to resize panel height to fit available data (eg when showing a list of tracks)\n * @class LocusZoom.Dashboard.Components.resize_to_data\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"resize_to_data\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Resize to Data\")\n .setTitle(\"Automatically resize this panel to fit the data its currently showing\")\n .setOnclick(function(){\n this.parent_panel.scaleHeightToData();\n this.update();\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to toggle legend\n * @class LocusZoom.Dashboard.Components.toggle_legend\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_legend\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var html = this.parent_panel.legend.layout.hidden ? \"Show Legend\" : \"Hide Legend\";\n if (this.button){\n this.button.setHtml(html).show();\n this.parent.position();\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color)\n .setTitle(\"Show or hide the legend for this panel\")\n .setOnclick(function(){\n this.parent_panel.legend.layout.hidden = !this.parent_panel.legend.layout.hidden;\n this.parent_panel.legend.render();\n this.update();\n }.bind(this));\n return this.update();\n };\n});\n\n/**\n * Menu for manipulating multiple data layers in a single panel: show/hide, change order, etc.\n * @class LocusZoom.Dashboard.Components.data_layers\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"data_layers\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.update = function(){\n\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Data Layers\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Manipulate Data Layers (sort, dim, show/hide, etc.)\"; }\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(\"\");\n var table = this.button.menu.inner_selector.append(\"table\");\n this.parent_panel.data_layer_ids_by_z_index.slice().reverse().forEach(function(id, idx){\n var data_layer = this.parent_panel.data_layers[id];\n var name = (typeof data_layer.layout.name != \"string\") ? data_layer.id : data_layer.layout.name;\n var row = table.append(\"tr\");\n // Layer name\n row.append(\"td\").html(name);\n // Status toggle buttons\n layout.statuses.forEach(function(status_adj){\n var status_idx = LocusZoom.DataLayer.Statuses.adjectives.indexOf(status_adj);\n var status_verb = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n var html, onclick, highlight;\n if (data_layer.global_statuses[status_adj]){\n html = LocusZoom.DataLayer.Statuses.menu_antiverbs[status_idx];\n onclick = \"un\" + status_verb + \"AllElements\";\n highlight = \"-highlighted\";\n } else {\n html = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n onclick = status_verb + \"AllElements\";\n highlight = \"\";\n }\n row.append(\"td\").append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color + highlight)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer[onclick](); this.button.menu.populate(); }.bind(this))\n .html(html);\n }.bind(this));\n // Sort layer buttons\n var at_top = (idx === 0);\n var at_bottom = (idx === (this.parent_panel.data_layer_ids_by_z_index.length - 1));\n var td = row.append(\"td\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-start lz-dashboard-button-\" + this.layout.color + (at_bottom ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveDown(); this.button.menu.populate(); }.bind(this))\n .html(\"▾\").attr(\"title\", \"Move layer down (further back)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-middle lz-dashboard-button-\" + this.layout.color + (at_top ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveUp(); this.button.menu.populate(); }.bind(this))\n .html(\"▴\").attr(\"title\", \"Move layer up (further front)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-end lz-dashboard-button-red\")\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n if (confirm(\"Are you sure you want to remove the \" + name + \" layer? This cannot be undone!\")){\n data_layer.parent.removeDataLayer(id);\n }\n return this.button.menu.populate();\n }.bind(this))\n .html(\"×\").attr(\"title\", \"Remove layer\");\n }.bind(this));\n return this;\n }.bind(this));\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Dropdown menu allowing the user to choose between different display options for a single specific data layer\n * within a panel.\n *\n * This allows controlling how points on a datalayer can be displayed- any display options supported via the layout for the target datalayer. This includes point\n * size/shape, coloring, etc.\n *\n * This button intentionally limits display options it can control to those available on common plot types.\n * Although the list of options it sets can be overridden (to control very special custom plot types), this\n * capability should be used sparingly if at all.\n *\n * @class LocusZoom.Dashboard.Components.display_options\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {String} [layout.button_html=\"Display options\"] Text to display on the toolbar button\n * @param {String} [layout.button_title=\"Control how plot items are displayed\"] Hover text for the toolbar button\n * @param {string} layout.layer_name Specify the datalayer that this button should affect\n * @param {string} [layout.default_config_display_name] Store the default configuration for this datalayer\n * configuration, and show a button to revert to the \"default\" (listing the human-readable display name provided)\n * @param {Array} [layout.fields_whitelist='see code'] The list of presentation fields that this button can control.\n * This can be overridden if this button needs to be used on a custom layer type with special options.\n * @typedef {{display_name: string, display: Object}} DisplayOptionsButtonConfigField\n * @param {DisplayOptionsButtonConfigField[]} layout.options Specify a label and set of layout directives associated\n * with this `display` option. Display field should include all changes to datalayer presentation options.\n */\nLocusZoom.Dashboard.Components.add(\"display_options\", function (layout) {\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Display options\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Control how plot items are displayed\"; }\n\n // Call parent constructor\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n // List of layout fields that this button is allowed to control. This ensures that we don't override any other\n // information (like plot height etc) while changing point rendering\n var allowed_fields = layout.fields_whitelist || [\"color\", \"fill_opacity\", \"label\", \"legend\",\n \"point_shape\", \"point_size\", \"tooltip\", \"tooltip_positioning\"];\n\n var dataLayer = this.parent_panel.data_layers[layout.layer_name];\n var dataLayerLayout = dataLayer.layout;\n\n // Store default configuration for the layer as a clean deep copy, so we may revert later\n var defaultConfig = {};\n allowed_fields.forEach(function(name) {\n var configSlot = dataLayerLayout[name];\n if (configSlot) {\n defaultConfig[name] = JSON.parse(JSON.stringify(configSlot));\n }\n });\n\n /**\n * Which item in the menu is currently selected. (track for rerendering menu)\n * @member {String}\n * @private\n */\n this._selected_item = \"default\";\n\n // Define the button + menu that provides the real functionality for this dashboard component\n var self = this;\n this.button = new LocusZoom.Dashboard.Component.Button(self)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function () {\n self.button.menu.populate();\n });\n this.button.menu.setPopulate(function () {\n // Multiple copies of this button might be used on a single LZ page; append unique IDs where needed\n var uniqueID = Math.floor(Math.random() * 1e4).toString();\n\n self.button.menu.inner_selector.html(\"\");\n var table = self.button.menu.inner_selector.append(\"table\");\n\n var menuLayout = self.layout;\n\n var renderRow = function(display_name, display_options, row_id) { // Helper method\n var row = table.append(\"tr\");\n row.append(\"td\")\n .append(\"input\")\n .attr({type: \"radio\", name: \"color-picker-\" + uniqueID, value: row_id})\n .property(\"checked\", (row_id === self._selected_item))\n .on(\"click\", function () {\n Object.keys(display_options).forEach(function(field_name) {\n dataLayer.layout[field_name] = display_options[field_name];\n });\n self._selected_item = row_id;\n self.parent_panel.render();\n var legend = self.parent_panel.legend;\n if (legend && display_options.legend) {\n // Update the legend only if necessary\n legend.render();\n }\n });\n row.append(\"td\").text(display_name);\n };\n // Render the \"display options\" menu: default and special custom options\n var defaultName = menuLayout.default_config_display_name || \"Default style\";\n renderRow(defaultName, defaultConfig, \"default\");\n menuLayout.options.forEach(function (item, index) {\n renderRow(item.display_name, item.display, index);\n });\n return self;\n });\n\n this.update = function () {\n this.button.show();\n return this;\n };\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * An SVG object used to display contextual information about a panel.\n * Panel layouts determine basic features of a legend - its position in the panel, orientation, title, etc.\n * Layouts of child data layers of the panel determine the actual content of the legend.\n *\n * @class\n * @param {LocusZoom.Panel} parent\n*/\nLocusZoom.Legend = function(parent){\n if (!(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create legend, parent must be a locuszoom panel\";\n }\n /** @member {LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".legend\";\n\n this.parent.layout.legend = LocusZoom.Layouts.merge(this.parent.layout.legend || {}, LocusZoom.Legend.DefaultLayout);\n /** @member {Object} */\n this.layout = this.parent.layout.legend;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {d3.selection} */\n this.background_rect = null;\n /** @member {d3.selection[]} */\n this.elements = [];\n /**\n * SVG selector for the group containing all elements in the legend\n * @protected\n * @member {d3.selection|null}\n */\n this.elements_group = null;\n\n /**\n * TODO: Not sure if this property is used; the external-facing methods are setting `layout.hidden` instead. Tentatively mark deprecated.\n * @deprecated\n * @protected\n * @member {Boolean}\n */\n this.hidden = false;\n\n // TODO Revisit constructor return value; see https://stackoverflow.com/a/3350364/1422268\n return this.render();\n};\n\n/**\n * The default layout used by legends (used internally)\n * @protected\n * @member {Object}\n */\nLocusZoom.Legend.DefaultLayout = {\n orientation: \"vertical\",\n origin: { x: 0, y: 0 },\n width: 10,\n height: 10,\n padding: 5,\n label_size: 12,\n hidden: false\n};\n\n/**\n * Render the legend in the parent panel\n */\nLocusZoom.Legend.prototype.render = function(){\n\n // Get a legend group selector if not yet defined\n if (!this.selector){\n this.selector = this.parent.svg.group.append(\"g\")\n .attr(\"id\", this.parent.getBaseId() + \".legend\").attr(\"class\", \"lz-legend\");\n }\n\n // Get a legend background rect selector if not yet defined\n if (!this.background_rect){\n this.background_rect = this.selector.append(\"rect\")\n .attr(\"width\", 100).attr(\"height\", 100).attr(\"class\", \"lz-legend-background\");\n }\n\n // Get a legend elements group selector if not yet defined\n if (!this.elements_group){\n this.elements_group = this.selector.append(\"g\");\n }\n\n // Remove all elements from the document and re-render from scratch\n this.elements.forEach(function(element){\n element.remove();\n });\n this.elements = [];\n\n // Gather all elements from data layers in order (top to bottom) and render them\n var padding = +this.layout.padding || 1;\n var x = padding;\n var y = padding;\n var line_height = 0;\n this.parent.data_layer_ids_by_z_index.slice().reverse().forEach(function(id){\n if (Array.isArray(this.parent.data_layers[id].layout.legend)){\n this.parent.data_layers[id].layout.legend.forEach(function(element){\n var selector = this.elements_group.append(\"g\")\n .attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n var label_size = +element.label_size || +this.layout.label_size || 12;\n var label_x = 0;\n var label_y = (label_size/2) + (padding/2);\n line_height = Math.max(line_height, label_size + padding);\n // Draw the legend element symbol (line, rect, shape, etc)\n if (element.shape === \"line\"){\n // Line symbol\n var length = +element.length || 16;\n var path_y = (label_size/4) + (padding/2);\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", \"M0,\" + path_y + \"L\" + length + \",\" + path_y)\n .style(element.style || {});\n label_x = length + padding;\n } else if (element.shape === \"rect\"){\n // Rect symbol\n var width = +element.width || 16;\n var height = +element.height || width;\n selector.append(\"rect\").attr(\"class\", element.class || \"\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = width + padding;\n line_height = Math.max(line_height, height + padding);\n } else if (d3.svg.symbolTypes.indexOf(element.shape) !== -1) {\n // Shape symbol (circle, diamond, etc.)\n var size = +element.size || 40;\n var radius = Math.ceil(Math.sqrt(size/Math.PI));\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", d3.svg.symbol().size(size).type(element.shape))\n .attr(\"transform\", \"translate(\" + radius + \",\" + (radius+(padding/2)) + \")\")\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = (2*radius) + padding;\n label_y = Math.max((2*radius)+(padding/2), label_y);\n line_height = Math.max(line_height, (2*radius) + padding);\n }\n // Draw the legend element label\n selector.append(\"text\").attr(\"text-anchor\", \"left\").attr(\"class\", \"lz-label\")\n .attr(\"x\", label_x).attr(\"y\", label_y).style({\"font-size\": label_size}).text(element.label);\n // Position the legend element group based on legend layout orientation\n var bcr = selector.node().getBoundingClientRect();\n if (this.layout.orientation === \"vertical\"){\n y += bcr.height + padding;\n line_height = 0;\n } else {\n // Ensure this element does not exceed the panel width\n // (E.g. drop to the next line if it does, but only if it's not the only element on this line)\n var right_x = this.layout.origin.x + x + bcr.width;\n if (x > padding && right_x > this.parent.layout.width){\n y += line_height;\n x = padding;\n selector.attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n }\n x += bcr.width + (3*padding);\n }\n // Store the element\n this.elements.push(selector);\n }.bind(this));\n }\n }.bind(this));\n\n // Scale the background rect to the elements in the legend\n var bcr = this.elements_group.node().getBoundingClientRect();\n this.layout.width = bcr.width + (2*this.layout.padding);\n this.layout.height = bcr.height + (2*this.layout.padding);\n this.background_rect\n .attr(\"width\", this.layout.width)\n .attr(\"height\", this.layout.height);\n\n // Set the visibility on the legend from the \"hidden\" flag\n // TODO: `show()` and `hide()` call a full rerender; might be able to make this more lightweight?\n this.selector.style({ visibility: this.layout.hidden ? \"hidden\" : \"visible\" });\n\n // TODO: Annotate return type and make consistent\n return this.position();\n};\n\n/**\n * Place the legend in position relative to the panel, as specified in the layout configuration\n * @returns {LocusZoom.Legend | null}\n * TODO: should this always be chainable?\n */\nLocusZoom.Legend.prototype.position = function(){\n if (!this.selector){ return this; }\n var bcr = this.selector.node().getBoundingClientRect();\n if (!isNaN(+this.layout.pad_from_bottom)){\n this.layout.origin.y = this.parent.layout.height - bcr.height - +this.layout.pad_from_bottom;\n }\n if (!isNaN(+this.layout.pad_from_right)){\n this.layout.origin.x = this.parent.layout.width - bcr.width - +this.layout.pad_from_right;\n }\n this.selector.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n};\n\n/**\n * Hide the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.hide = function(){\n this.layout.hidden = true;\n this.render();\n};\n\n/**\n * Show the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.show = function(){\n this.layout.hidden = false;\n this.render();\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * LocusZoom functionality used for data parsing and retrieval\n * @namespace\n * @public\n */\nLocusZoom.Data = LocusZoom.Data || {};\n\n/**\n * Create and coordinate an ensemble of (namespaced) data source instances\n * @public\n * @class\n */\nLocusZoom.DataSources = function() {\n /** @member {Object.} */\n this.sources = {};\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.addSource = function(ns, x) {\n console.warn(\"Warning: .addSource() is deprecated. Use .add() instead\");\n return this.add(ns, x);\n};\n\n/**\n * Add a (namespaced) datasource to the plot\n * @public\n * @param {String} ns A namespace used for fields from this data source\n * @param {LocusZoom.Data.Source|Array|null} x An instantiated datasource, or an array of arguments that can be used to\n * create a known datasource type.\n */\nLocusZoom.DataSources.prototype.add = function(ns, x) {\n return this.set(ns, x);\n};\n\n/** @protected */\nLocusZoom.DataSources.prototype.set = function(ns, x) {\n if (Array.isArray(x)) {\n // If passed array of source name and options, make the source\n var dsobj = LocusZoom.KnownDataSources.create.apply(null, x);\n // Each datasource in the chain should be aware of its assigned namespace\n dsobj.source_id = ns;\n this.sources[ns] = dsobj;\n } else {\n // If passed the already-created source object\n if (x !== null) {\n x.source_id = ns;\n this.sources[ns] = x;\n } else {\n delete this.sources[ns];\n }\n }\n return this;\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.getSource = function(ns) {\n console.warn(\"Warning: .getSource() is deprecated. Use .get() instead\");\n return this.get(ns);\n};\n\n/**\n * Return the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n * @returns {LocusZoom.Data.Source}\n */\nLocusZoom.DataSources.prototype.get = function(ns) {\n return this.sources[ns];\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.removeSource = function(ns) {\n console.warn(\"Warning: .removeSource() is deprecated. Use .remove() instead\");\n return this.remove(ns);\n};\n\n/**\n * Remove the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n */\nLocusZoom.DataSources.prototype.remove = function(ns) {\n return this.set(ns, null);\n};\n\n/**\n * Populate a list of datasources specified as a JSON object\n * @public\n * @param {String|Object} x An object or JSON representation containing {ns: configArray} entries\n * @returns {LocusZoom.DataSources}\n */\nLocusZoom.DataSources.prototype.fromJSON = function(x) {\n if (typeof x === \"string\") {\n x = JSON.parse(x);\n }\n var ds = this;\n Object.keys(x).forEach(function(ns) {\n ds.set(ns, x[ns]);\n });\n return ds;\n};\n\n/**\n * Return the names of all currently recognized datasources\n * @public\n * @returns {Array}\n */\nLocusZoom.DataSources.prototype.keys = function() {\n return Object.keys(this.sources);\n};\n\n/**\n * Datasources can be instantiated from a JSON object instead of code. This represents existing sources in that format.\n * For example, this can be helpful when sharing plots, or to share settings with others when debugging\n * @public\n */\nLocusZoom.DataSources.prototype.toJSON = function() {\n return this.sources;\n};\n\n/**\n * Represents an addressable unit of data from a namespaced datasource, subject to specified value transformations.\n *\n * When used by a data layer, fields will automatically be re-fetched from the appropriate data source whenever the\n * state of a plot fetches, eg pan or zoom operations that would affect what data is displayed.\n *\n * @public\n * @class\n * @param {String} field A string representing the namespace of the datasource, the name of the desired field to fetch\n * from that datasource, and arbitrarily many transformations to apply to the value. The namespace and\n * transformation(s) are optional and information is delimited according to the general syntax\n * `[namespace:]name[|transformation][|transformation]`. For example, `association:pvalue|neglog10`\n */\nLocusZoom.Data.Field = function(field){\n \n var parts = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/.exec(field);\n /** @member {String} */\n this.full_name = field;\n /** @member {String} */\n this.namespace = parts[1] || null;\n /** @member {String} */\n this.name = parts[2] || null;\n /** @member {Array} */\n this.transformations = [];\n \n if (typeof parts[3] == \"string\" && parts[3].length > 1){\n this.transformations = parts[3].substring(1).split(\"|\");\n this.transformations.forEach(function(transform, i){\n this.transformations[i] = LocusZoom.TransformationFunctions.get(transform);\n }.bind(this));\n }\n\n this.applyTransformations = function(val){\n this.transformations.forEach(function(transform){\n val = transform(val);\n });\n return val;\n };\n\n // Resolve the field for a given data element.\n // First look for a full match with transformations already applied by the data requester.\n // Otherwise prefer a namespace match and fall back to just a name match, applying transformations on the fly.\n this.resolve = function(d){\n if (typeof d[this.full_name] == \"undefined\"){\n var val = null;\n if (typeof (d[this.namespace+\":\"+this.name]) != \"undefined\"){ val = d[this.namespace+\":\"+this.name]; }\n else if (typeof d[this.name] != \"undefined\"){ val = d[this.name]; }\n d[this.full_name] = this.applyTransformations(val);\n }\n return d[this.full_name];\n };\n \n};\n\n/**\n * The Requester manages fetching of data across multiple data sources. It is used internally by LocusZoom data layers.\n * It passes state information and ensures that data is formatted in the manner expected by the plot.\n *\n * It is also responsible for constructing a \"chain\" of dependent requests, by requesting each datasource\n * sequentially in the order specified in the datalayer `fields` array. Data sources are only chained within a\n * data layer, and only if that layer requests more than one kind of data source.\n * @param {LocusZoom.DataSources} sources An object of {ns: LocusZoom.Data.Source} instances\n * @class\n */\nLocusZoom.Data.Requester = function(sources) {\n\n function split_requests(fields) {\n // Given a fields array, return an object specifying what datasource names the data layer should make requests\n // to, and how to handle the returned data\n var requests = {};\n // Regular expression finds namespace:field|trans\n var re = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/;\n fields.forEach(function(raw) {\n var parts = re.exec(raw);\n var ns = parts[1] || \"base\";\n var field = parts[2];\n var trans = LocusZoom.TransformationFunctions.get(parts[3]);\n if (typeof requests[ns] ==\"undefined\") {\n requests[ns] = {outnames:[], fields:[], trans:[]};\n }\n requests[ns].outnames.push(raw);\n requests[ns].fields.push(field);\n requests[ns].trans.push(trans);\n });\n return requests;\n }\n\n /**\n * Fetch data, and create a chain that only connects two data sources if they depend on each other\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields The list of data fields specified in the `layout` for a specific data layer\n * @returns {Promise}\n */\n this.getData = function(state, fields) {\n var requests = split_requests(fields);\n // Create an array of functions that, when called, will trigger the request to the specified datasource\n var request_handles = Object.keys(requests).map(function(key) {\n if (!sources.get(key)) {\n throw(\"Datasource for namespace \" + key + \" not found\");\n }\n return sources.get(key).getData(state, requests[key].fields, \n requests[key].outnames, requests[key].trans);\n });\n //assume the fields are requested in dependent order\n //TODO: better manage dependencies\n var ret = Q.when({header:{}, body:{}, discrete: {}});\n for(var i=0; i < request_handles.length; i++) {\n // If a single datalayer uses multiple sources, perform the next request when the previous one completes\n ret = ret.then(request_handles[i]);\n }\n return ret;\n };\n};\n\n/**\n * Base class for LocusZoom data sources\n * This can be extended with .extend() to create custom data sources\n * @class\n * @public\n */\nLocusZoom.Data.Source = function() {\n /**\n * Whether this source should enable caching\n * @member {Boolean}\n */\n this.enableCache = true;\n /**\n * Whether this data source type is dependent on previous requests- for example, the LD source cannot annotate\n * association data if no data was found for that region.\n * @member {boolean}\n */\n this.dependentSource = false;\n};\n\n/**\n * A default constructor that can be used when creating new data sources\n * @param {String|Object} init Basic configuration- either a url, or a config object\n * @param {String} [init.url] The datasource URL\n * @param {String} [init.params] Initial config params for the datasource\n */\nLocusZoom.Data.Source.prototype.parseInit = function(init) {\n if (typeof init === \"string\") {\n /** @member {String} */\n this.url = init;\n /** @member {String} */\n this.params = {};\n } else {\n this.url = init.url;\n this.params = init.params || {};\n }\n if (!this.url) {\n throw(\"Source not initialized with required URL\");\n }\n\n};\n\n/**\n * A unique identifier that indicates whether cached data is valid for this request\n * @protected\n * @param state\n * @param chain\n * @param fields\n * @returns {String|undefined}\n */\nLocusZoom.Data.Source.prototype.getCacheKey = function(state, chain, fields) {\n return this.getURL && this.getURL(state, chain, fields);\n};\n\n/**\n * Stub: build the URL for any requests made by this source.\n */\nLocusZoom.Data.Source.prototype.getURL = function(state, chain, fields) { return this.url; };\n\n/**\n * Perform a network request to fetch data for this source\n * @protected\n * @param {Object} state The state of the parent plot\n * @param chain\n * @param fields\n */\nLocusZoom.Data.Source.prototype.fetchRequest = function(state, chain, fields) {\n var url = this.getURL(state, chain, fields);\n return LocusZoom.createCORSPromise(\"GET\", url); \n};\n\n/**\n * Gets the data for just this source, typically via a network request (caching where possible)\n * @protected\n */\nLocusZoom.Data.Source.prototype.getRequest = function(state, chain, fields) {\n var req;\n var cacheKey = this.getCacheKey(state, chain, fields);\n if (this.enableCache && typeof(cacheKey) !== \"undefined\" && cacheKey === this._cachedKey) {\n req = Q.when(this._cachedResponse);\n } else {\n req = this.fetchRequest(state, chain, fields);\n if (this.enableCache) {\n req = req.then(function(x) {\n this._cachedKey = cacheKey;\n return this._cachedResponse = x;\n }.bind(this));\n }\n }\n return req;\n};\n\n/**\n * Fetch the data from the specified data source, and apply transformations requested by an external consumer.\n * This is the public-facing datasource method that will most commonly be called by external code.\n *\n * @public\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the \"namespace\" prefix)\n * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the\n * originally requested field name, including the namespace. This must be an array with the same length as `fields`\n * @param {Function[]} trans The collection of transformation functions to be run on selected fields.\n * This must be an array with the same length as `fields`\n * @returns {function} A callable operation that can be used as part of the data chain\n */\nLocusZoom.Data.Source.prototype.getData = function(state, fields, outnames, trans) {\n if (this.preGetData) {\n var pre = this.preGetData(state, fields, outnames, trans);\n if(this.pre) {\n state = pre.state || state;\n fields = pre.fields || fields;\n outnames = pre.outnames || outnames;\n trans = pre.trans || trans;\n }\n }\n\n var self = this;\n return function (chain) {\n if (self.dependentSource && chain && chain.body && !chain.body.length) {\n // A \"dependent\" source should not attempt to fire a request if there is no data for it to act on.\n // Therefore, it should simply return the previous data chain.\n return Q.when(chain);\n }\n\n return self.getRequest(state, chain, fields).then(function(resp) {\n return self.parseResponse(resp, chain, fields, outnames, trans);\n });\n };\n};\n\n/**\n * Ensure the server response is in a canonical form, an array of one object per record. [ {field: oneval} ].\n * If the server response contains columns, reformats the response from {column1: [], column2: []} to the above.\n *\n * Does not apply namespacing or transformations.\n *\n * May be overridden by data sources that inherently return more complex payloads, or that exist to annotate other\n * sources.\n *\n * @param {Object[]|Object} data The original parsed server response\n * @protected\n */\nLocusZoom.Data.Source.prototype.normalizeResponse = function (data) {\n if (Array.isArray(data)) {\n // Already in the desired form\n return data;\n }\n\n // Otherwise, assume the server response is an object representing columns of data.\n // Each array should have the same length (verify), and a given array index corresponds to a single row.\n var keys = Object.keys(data);\n var N = data[keys[0]].length;\n var sameLength = keys.every(function(key) {\n var item = data[key];\n return item.length === N;\n });\n if (!sameLength) {\n throw this.constructor.SOURCE_NAME + \" expects a response in which all arrays of data are the same length\";\n }\n\n // Go down the rows, and create an object for each record\n var records = [];\n var fields = Object.keys(data);\n for(var i = 0; i < N; i++) {\n var record = {};\n for(var j = 0; j < fields.length; j++) {\n record[fields[j]] = data[fields[j]][i];\n }\n records.push(record);\n }\n return records;\n};\n\n/** @deprecated */\nLocusZoom.Data.Source.prototype.prepareData = function (records) {\n console.warn(\"Warning: .prepareData() is deprecated. Use .annotateData() instead\");\n return this.annotateData(records);\n};\n\n/**\n * Hook to post-process the data returned by this source with new, additional behavior.\n * (eg cleaning up API values or performing complex calculations on the returned data)\n *\n * @param {Object[]} records The parsed data from the source (eg standardized api response)\n * @param {Object} chain The data chain object. For example, chain.headers may provide useful annotation metadata\n * @returns {Object[]|Promise} The modified set of records\n */\nLocusZoom.Data.Source.prototype.annotateData = function(records, chain) {\n // Default behavior: no transformations\n return records;\n};\n\n/**\n * Clean up the server records for use by datalayers: extract only certain fields, with the specified names.\n * Apply per-field transformations as appropriate.\n *\n * This hook can be overridden, eg to create a source that always returns all records and ignores the \"fields\" array.\n * This is particularly common for sources at the end of a chain- many \"dependent\" sources do not allow\n * cherry-picking individual fields, in which case by **convention** the fields array specifies \"last_source_name:all\"\n *\n * @param {Object[]} data One record object per element\n * @param {String[]} fields The names of fields to extract (as named in the source data). Eg \"afield\"\n * @param {String[]} outnames How to represent the source fields in the output. Eg \"namespace:afield|atransform\"\n * @param {function[]} trans An array of transformation functions (if any). One function per data element, or null.\n * @protected\n */\nLocusZoom.Data.Source.prototype.extractFields = function (data, fields, outnames, trans) {\n //intended for an array of objects\n // [ {\"id\":1, \"val\":5}, {\"id\":2, \"val\":10}]\n // Since a number of sources exist that do not obey this format, we will provide a convenient pass-through\n if (!Array.isArray(data)) {\n return data;\n }\n\n var fieldFound = [];\n for (var k=0; k1) {\n if (fields.length!==2 || fields.indexOf(\"isrefvar\")===-1) {\n throw(\"LD does not know how to get all fields: \" + fields.join(\", \"));\n }\n }\n};\n\nLocusZoom.Data.LDSource.prototype.findMergeFields = function(chain) {\n // since LD may be shared across sources with different namespaces\n // we use regex to find columns to join on rather than \n // requiring exact matches\n var exactMatch = function(arr) {return function() {\n var regexes = arguments;\n for(var i=0; i0) {\n var names = Object.keys(chain.body[0]);\n var nameMatch = exactMatch(names);\n dataFields.id = dataFields.id || nameMatch(/\\bvariant\\b/) || nameMatch(/\\bid\\b/);\n dataFields.position = dataFields.position || nameMatch(/\\bposition\\b/i, /\\bpos\\b/i);\n dataFields.pvalue = dataFields.pvalue || nameMatch(/\\bpvalue\\b/i, /\\blog_pvalue\\b/i);\n dataFields._names_ = names;\n }\n return dataFields;\n};\n\nLocusZoom.Data.LDSource.prototype.findRequestedFields = function(fields, outnames) {\n var obj = {};\n for(var i=0; i extremeVal) {\n extremeVal = x[i][pval] * sign;\n extremeIdx = i;\n }\n }\n return extremeIdx;\n };\n\n var refSource = state.ldrefsource || chain.header.ldrefsource || 1;\n var reqFields = this.findRequestedFields(fields);\n var refVar = reqFields.ldin;\n if (refVar === \"state\") {\n refVar = state.ldrefvar || chain.header.ldrefvar || \"best\";\n }\n if (refVar === \"best\") {\n if (!chain.body) {\n throw(\"No association data found to find best pvalue\");\n }\n var keys = this.findMergeFields(chain);\n if (!keys.pvalue || !keys.id) {\n var columns = \"\";\n if (!keys.id){ columns += (columns.length ? \", \" : \"\") + \"id\"; }\n if (!keys.pvalue){ columns += (columns.length ? \", \" : \"\") + \"pvalue\"; }\n throw(\"Unable to find necessary column(s) for merge: \" + columns + \" (available: \" + keys._names_ + \")\");\n }\n refVar = chain.body[findExtremeValue(chain.body, keys.pvalue)][keys.id];\n }\n if (!chain.header) {chain.header = {};}\n chain.header.ldrefvar = refVar;\n return this.url + \"results/?filter=reference eq \" + refSource + \n \" and chromosome2 eq '\" + state.chr + \"'\" + \n \" and position2 ge \" + state.start + \n \" and position2 le \" + state.end + \n \" and variant1 eq '\" + refVar + \"'\" + \n \"&fields=chr,pos,rsquare\";\n};\n\nLocusZoom.Data.LDSource.prototype.combineChainBody = function (data, chain, fields, outnames) {\n var keys = this.findMergeFields(chain);\n var reqFields = this.findRequestedFields(fields, outnames);\n if (!keys.position) {\n throw(\"Unable to find position field for merge: \" + keys._names_);\n }\n var leftJoin = function(left, right, lfield, rfield) {\n var i=0, j=0;\n while (i < left.length && j < right.position2.length) {\n if (left[i][keys.position] === right.position2[j]) {\n left[i][lfield] = right[rfield][j];\n i++;\n j++;\n } else if (left[i][keys.position] < right.position2[j]) {\n i++;\n } else {\n j++;\n }\n }\n };\n var tagRefVariant = function(data, refvar, idfield, outname) {\n for(var i=0; i} */\n this.panels = {};\n /**\n * TODO: This is currently used by external classes that manipulate the parent and may indicate room for a helper method in the api to coordinate boilerplate\n * @protected\n * @member {String[]}\n */\n this.panel_ids_by_y_index = [];\n\n /**\n * Notify each child panel of the plot of changes in panel ordering/ arrangement\n */\n this.applyPanelYIndexesToPanelLayouts = function(){\n this.panel_ids_by_y_index.forEach(function(pid, idx){\n this.panels[pid].layout.y_index = idx;\n }.bind(this));\n };\n\n /**\n * Get the qualified ID pathname for the plot\n * @returns {String}\n */\n this.getBaseId = function(){\n return this.id;\n };\n\n /**\n * Track update operations (reMap) performed on all child panels, and notify the parent plot when complete\n * TODO: Reconsider whether we need to be tracking this as global state outside of context of specific operations\n * @protected\n * @member {Promise[]}\n */\n this.remap_promises = [];\n\n if (typeof layout == \"undefined\"){\n /**\n * The layout is a serializable object used to describe the composition of the Plot\n * If no layout was passed, use the Standard Association Layout\n * Otherwise merge whatever was passed with the Default Layout\n * TODO: Review description; we *always* merge with default layout?\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge({}, LocusZoom.Layouts.get(\"plot\", \"standard_association\"));\n } else {\n this.layout = layout;\n }\n LocusZoom.Layouts.merge(this.layout, LocusZoom.Plot.DefaultLayout);\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original plot state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n\n /**\n * Create a shortcut to the state in the layout on the Plot. Tracking in the layout allows the plot to be created\n * with initial state/setup.\n *\n * Tracks state of the plot, eg start and end position\n * @member {Object}\n */\n this.state = this.layout.state;\n\n /** @member {LocusZoom.Data.Requester} */\n this.lzd = new LocusZoom.Data.Requester(datasource);\n\n /**\n * Window.onresize listener (responsive layouts only)\n * TODO: .on appears to return a selection, not a listener? Check logic here\n * https://github.com/d3/d3-selection/blob/00b904b9bcec4dfaf154ae0bbc777b1fc1d7bc08/test/selection/on-test.js#L11\n * @deprecated\n * @member {d3.selection}\n */\n this.window_onresize = null;\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": [],\n \"state_changed\": [] // Only triggered when a state change causes rerender\n };\n\n /**\n * @callback eventCallback\n * @param {object} eventData A description of the event\n * @param {String|null} eventData.sourceID The unique identifier (eg plot or parent name) of the element that\n * triggered the event. Will be automatically filled in if not explicitly provided.\n * @param {Object|null} eventData.context Any additional information to be passed to the callback, eg the data\n * associated with a clicked plot element\n */\n\n /**\n * There are several events that a LocusZoom plot can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following plot-level events are currently supported:\n * - `layout_changed` - context: plot - Any aspect of the plot's layout (including dimensions or state) has changed.\n * - `data_requested` - context: plot - A request for new data from any data source used in the plot has been made.\n * - `data_rendered` - context: plot - Data from a request has been received and rendered in the plot.\n * - `element_clicked` - context: plot - A data element in any of the plot's data layers has been clicked.\n * - `element_selection` - context: plot - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `plot.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * plot itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Plot}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n * @param {string} event A known event name\n * @param {*} eventData Data or event description that will be passed to the event listener\n * @returns {LocusZoom.Plot}\n */\n this.emit = function(event, eventData) {\n // TODO: there are small differences between the emit implementation between plots and panels. In the future,\n // DRY this code via mixins, and make sure to keep the interfaces compatible when refactoring.\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n var sourceID = this.getBaseId();\n var self = this;\n this.event_hooks[event].forEach(function(hookToRun) {\n var eventContext;\n if (eventData && eventData.sourceID) {\n // If we detect that an event originated elsewhere (via bubbling or externally), preserve the context\n // when re-emitting the event to plot-level listeners\n eventContext = eventData;\n } else {\n eventContext = {sourceID: sourceID, data: eventData || null};\n }\n // By default, any handlers fired here (either directly, or bubbled) will see the plot as the\n // value of `this`. If a bound function is registered as a handler, the previously bound `this` will\n // override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the plot's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the plot\n * @returns {{x: Number, y: Number, width: Number, height: Number}}\n */\n this.getPageOrigin = function(){\n var bounding_client_rect = this.svg.node().getBoundingClientRect();\n var x_offset = document.documentElement.scrollLeft || document.body.scrollLeft;\n var y_offset = document.documentElement.scrollTop || document.body.scrollTop;\n var container = this.svg.node();\n while (container.parentNode !== null){\n container = container.parentNode;\n if (container !== document && d3.select(container).style(\"position\") !== \"static\"){\n x_offset = -1 * container.getBoundingClientRect().left;\n y_offset = -1 * container.getBoundingClientRect().top;\n break;\n }\n }\n return {\n x: x_offset + bounding_client_rect.left,\n y: y_offset + bounding_client_rect.top,\n width: bounding_client_rect.width,\n height: bounding_client_rect.height\n };\n };\n\n /**\n * Get the top and left offset values for the plot's container element (the div that was populated)\n * @returns {{top: number, left: number}}\n */\n this.getContainerOffset = function(){\n var offset = { top: 0, left: 0 };\n var container = this.container.offsetParent || null;\n while (container !== null){\n offset.top += container.offsetTop;\n offset.left += container.offsetLeft;\n container = container.offsetParent || null;\n }\n return offset;\n };\n\n //\n /**\n * Event information describing interaction (e.g. panning and zooming) is stored on the plot\n * TODO: Add/ document details of interaction structure as we expand\n * @member {{panel_id: String, linked_panel_ids: Array, x_linked: *, dragging: *, zooming: *}}\n * @returns {LocusZoom.Plot}\n */\n this.interaction = {};\n\n /**\n * Track whether the target panel can respond to mouse interaction events\n * @param {String} panel_id\n * @returns {boolean}\n */\n this.canInteract = function(panel_id){\n panel_id = panel_id || null;\n if (panel_id){\n return ((typeof this.interaction.panel_id == \"undefined\" || this.interaction.panel_id === panel_id) && !this.loading_data);\n } else {\n return !(this.interaction.dragging || this.interaction.zooming || this.loading_data);\n }\n };\n\n // Initialize the layout\n this.initializeLayout();\n // TODO: Possibly superfluous return from constructor\n return this;\n};\n\n/**\n * Default/ expected configuration parameters for basic plotting; most plots will override\n *\n * @protected\n * @static\n * @type {Object}\n */\nLocusZoom.Plot.DefaultLayout = {\n state: {},\n width: 1,\n height: 1,\n min_width: 1,\n min_height: 1,\n responsive_resize: false,\n aspect_ratio: 1,\n panels: [],\n dashboard: {\n components: []\n },\n panel_boundaries: true,\n mouse_guide: true\n};\n\n/**\n * Helper method to sum the proportional dimensions of panels, a value that's checked often as panels are added/removed\n * @param {('Height'|'Width')} dimension\n * @returns {number}\n */\nLocusZoom.Plot.prototype.sumProportional = function(dimension){\n if (dimension !== \"height\" && dimension !== \"width\"){\n throw (\"Bad dimension value passed to LocusZoom.Plot.prototype.sumProportional\");\n }\n var total = 0;\n for (var id in this.panels){\n // Ensure every panel contributing to the sum has a non-zero proportional dimension\n if (!this.panels[id].layout[\"proportional_\" + dimension]){\n this.panels[id].layout[\"proportional_\" + dimension] = 1 / Object.keys(this.panels).length;\n }\n total += this.panels[id].layout[\"proportional_\" + dimension];\n }\n return total;\n};\n\n/**\n * Resize the plot to fit the bounding container\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.rescaleSVG = function(){\n var clientRect = this.svg.node().getBoundingClientRect();\n this.setDimensions(clientRect.width, clientRect.height);\n return this;\n};\n\n/**\n * Prepare the plot for first use by performing parameter validation, setting up panels, and calculating dimensions\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initializeLayout = function(){\n\n // Sanity check layout values\n // TODO: Find a way to generally abstract this, maybe into an object that models allowed layout values?\n if (isNaN(this.layout.width) || this.layout.width <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.height) || this.layout.height <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.aspect_ratio) || this.layout.aspect_ratio <= 0){\n throw (\"Plot layout parameter `aspect_ratio` must be a positive number\");\n }\n\n // If this is a responsive layout then set a namespaced/unique onresize event listener on the window\n if (this.layout.responsive_resize){\n this.window_onresize = d3.select(window).on(\"resize.lz-\"+this.id, function(){\n this.rescaleSVG();\n }.bind(this));\n // Forcing one additional setDimensions() call after the page is loaded clears up\n // any disagreements between the initial layout and the loaded responsive container's size\n d3.select(window).on(\"load.lz-\"+this.id, function(){\n this.setDimensions();\n }.bind(this));\n }\n\n // Add panels\n this.layout.panels.forEach(function(panel_layout){\n this.addPanel(panel_layout);\n }.bind(this));\n\n return this;\n};\n\n/**\n * Set the dimensions for a plot, and ensure that panels are sized and positioned correctly.\n *\n * If dimensions are provided, resizes each panel proportionally to match the new plot dimensions. Otherwise,\n * calculates the appropriate plot dimensions based on all panels.\n * @param {Number} [width] If provided and larger than minimum size, set plot to this width\n * @param {Number} [height] If provided and larger than minimum size, set plot to this height\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.setDimensions = function(width, height){\n\n var id;\n\n // Update minimum allowable width and height by aggregating minimums from panels, then apply minimums to containing element.\n var min_width = parseFloat(this.layout.min_width) || 0;\n var min_height = parseFloat(this.layout.min_height) || 0;\n for (id in this.panels){\n min_width = Math.max(min_width, this.panels[id].layout.min_width);\n if (parseFloat(this.panels[id].layout.min_height) > 0 && parseFloat(this.panels[id].layout.proportional_height) > 0){\n min_height = Math.max(min_height, (this.panels[id].layout.min_height / this.panels[id].layout.proportional_height));\n }\n }\n this.layout.min_width = Math.max(min_width, 1);\n this.layout.min_height = Math.max(min_height, 1);\n d3.select(this.svg.node().parentNode).style({\n \"min-width\": this.layout.min_width + \"px\",\n \"min-height\": this.layout.min_height + \"px\"\n });\n\n // If width and height arguments were passed then adjust them against plot minimums if necessary.\n // Then resize the plot and proportionally resize panels to fit inside the new plot dimensions.\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n // Override discrete values if resizing responsively\n if (this.layout.responsive_resize){\n if (this.svg){\n this.layout.width = Math.max(this.svg.node().parentNode.getBoundingClientRect().width, this.layout.min_width);\n }\n this.layout.height = this.layout.width / this.layout.aspect_ratio;\n if (this.layout.height < this.layout.min_height){\n this.layout.height = this.layout.min_height;\n this.layout.width = this.layout.height * this.layout.aspect_ratio;\n }\n }\n // Resize/reposition panels to fit, update proportional origins if necessary\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel_width = this.layout.width;\n var panel_height = this.panels[panel_id].layout.proportional_height * this.layout.height;\n this.panels[panel_id].setDimensions(panel_width, panel_height);\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n this.panels[panel_id].layout.proportional_origin.y = y_offset / this.layout.height;\n y_offset += panel_height;\n this.panels[panel_id].dashboard.update();\n }.bind(this));\n }\n\n // If width and height arguments were NOT passed (and panels exist) then determine the plot dimensions\n // by making it conform to panel dimensions, assuming panels are already positioned correctly.\n else if (Object.keys(this.panels).length) {\n this.layout.width = 0;\n this.layout.height = 0;\n for (id in this.panels){\n this.layout.width = Math.max(this.panels[id].layout.width, this.layout.width);\n this.layout.height += this.panels[id].layout.height;\n }\n this.layout.width = Math.max(this.layout.width, this.layout.min_width);\n this.layout.height = Math.max(this.layout.height, this.layout.min_height);\n }\n\n // Keep aspect ratio in agreement with dimensions\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n\n // Apply layout width and height as discrete values or viewbox values\n if (this.svg !== null){\n if (this.layout.responsive_resize){\n this.svg\n .attr(\"viewBox\", \"0 0 \" + this.layout.width + \" \" + this.layout.height)\n .attr(\"preserveAspectRatio\", \"xMinYMin meet\");\n } else {\n this.svg.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n }\n\n // If the plot has been initialized then trigger some necessary render functions\n if (this.initialized){\n this.panel_boundaries.position();\n this.dashboard.update();\n this.curtain.update();\n this.loader.update();\n }\n\n return this.emit(\"layout_changed\");\n};\n\n/**\n * Create a new panel from a layout, and handle the work of initializing and placing the panel on the plot\n * @param {Object} layout\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Plot.prototype.addPanel = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\"){\n throw \"Invalid panel layout passed to LocusZoom.Plot.prototype.addPanel()\";\n }\n\n // Create the Panel and set its parent\n var panel = new LocusZoom.Panel(layout, this);\n\n // Store the Panel on the Plot\n this.panels[panel.id] = panel;\n\n // If a discrete y_index was set in the layout then adjust other panel y_index values to accommodate this one\n if (panel.layout.y_index !== null && !isNaN(panel.layout.y_index)\n && this.panel_ids_by_y_index.length > 0){\n // Negative y_index values should count backwards from the end, so convert negatives to appropriate values here\n if (panel.layout.y_index < 0){\n panel.layout.y_index = Math.max(this.panel_ids_by_y_index.length + panel.layout.y_index, 0);\n }\n this.panel_ids_by_y_index.splice(panel.layout.y_index, 0, panel.id);\n this.applyPanelYIndexesToPanelLayouts();\n } else {\n var length = this.panel_ids_by_y_index.push(panel.id);\n this.panels[panel.id].layout.y_index = length - 1;\n }\n\n // Determine if this panel was already in the layout.panels array.\n // If it wasn't, add it. Either way store the layout.panels array index on the panel.\n var layout_idx = null;\n this.layout.panels.forEach(function(panel_layout, idx){\n if (panel_layout.id === panel.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.panels.push(this.panels[panel.id].layout) - 1;\n }\n this.panels[panel.id].layout_idx = layout_idx;\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n this.positionPanels();\n // Initialize and load data into the new panel\n this.panels[panel.id].initialize();\n this.panels[panel.id].reMap();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this.panels[panel.id];\n};\n\n\n/**\n * Clear all state, tooltips, and other persisted data associated with one (or all) panel(s) in the plot\n *\n * This is useful when reloading an existing plot with new data, eg \"click for genome region\" links.\n * This is a utility method for custom usage. It is not fired automatically during normal rerender of existing panels\n * @param {String} [panelId] If provided, clear state for only this panel. Otherwise, clear state for all panels.\n * @param {('wipe'|'reset')} [mode='wipe'] Optionally specify how state should be cleared. `wipe` deletes all data\n * and is useful for when the panel is being removed; `reset` is best when the panel will be reused in place.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.clearPanelData = function(panelId, mode) {\n mode = mode || \"wipe\";\n\n // TODO: Add unit tests for this method\n var panelsList;\n if (panelId) {\n panelsList = [panelId];\n } else {\n panelsList = Object.keys(this.panels);\n }\n var self = this;\n panelsList.forEach(function(pid) {\n self.panels[pid].data_layer_ids_by_z_index.forEach(function(dlid){\n var layer = self.panels[pid].data_layers[dlid];\n layer.destroyAllTooltips();\n\n delete self.layout.state[pid + \".\" + dlid];\n if(mode === \"reset\") {\n layer.setDefaultState();\n }\n });\n });\n return this;\n};\n\n/**\n * Remove the panel from the plot, and clear any state, tooltips, or other visual elements belonging to nested content\n * @param {String} id\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.removePanel = function(id){\n if (!this.panels[id]){\n throw (\"Unable to remove panel, ID not found: \" + id);\n }\n\n // Hide all panel boundaries\n this.panel_boundaries.hide();\n\n // Destroy all tooltips and state vars for all data layers on the panel\n this.clearPanelData(id);\n\n // Remove all panel-level HTML overlay elements\n this.panels[id].loader.hide();\n this.panels[id].dashboard.destroy(true);\n this.panels[id].curtain.hide();\n\n // Remove the svg container for the panel if it exists\n if (this.panels[id].svg.container){\n this.panels[id].svg.container.remove();\n }\n\n // Delete the panel and its presence in the plot layout and state\n this.layout.panels.splice(this.panels[id].layout_idx, 1);\n delete this.panels[id];\n delete this.layout.state[id];\n\n // Update layout_idx values for all remaining panels\n this.layout.panels.forEach(function(panel_layout, idx){\n this.panels[panel_layout.id].layout_idx = idx;\n }.bind(this));\n\n // Remove the panel id from the y_index array\n this.panel_ids_by_y_index.splice(this.panel_ids_by_y_index.indexOf(id), 1);\n this.applyPanelYIndexesToPanelLayouts();\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n // Allow the plot to shrink when panels are removed, by forcing it to recalculate min dimensions from scratch\n this.layout.min_height = this._base_layout.min_height;\n this.layout.min_width = this._base_layout.min_width;\n\n this.positionPanels();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this;\n};\n\n\n/**\n * Automatically position panels based on panel positioning rules and values.\n * Keep panels from overlapping vertically by adjusting origins, and keep the sum of proportional heights at 1.\n *\n * TODO: This logic currently only supports dynamic positioning of panels to prevent overlap in a VERTICAL orientation.\n * Some framework exists for positioning panels in horizontal orientations as well (width, proportional_width, origin.x, etc.)\n * but the logic for keeping these user-definable values straight approaches the complexity of a 2D box-packing algorithm.\n * That's complexity we don't need right now, and may not ever need, so it's on hiatus until a use case materializes.\n */\nLocusZoom.Plot.prototype.positionPanels = function(){\n\n var id;\n\n // We want to enforce that all x-linked panels have consistent horizontal margins\n // (to ensure that aligned items stay aligned despite inconsistent initial layout parameters)\n // NOTE: This assumes panels have consistent widths already. That should probably be enforced too!\n var x_linked_margins = { left: 0, right: 0 };\n\n // Proportional heights for newly added panels default to null unless explicitly set, so determine appropriate\n // proportional heights for all panels with a null value from discretely set dimensions.\n // Likewise handle default nulls for proportional widths, but instead just force a value of 1 (full width)\n for (id in this.panels){\n if (this.panels[id].layout.proportional_height === null){\n this.panels[id].layout.proportional_height = this.panels[id].layout.height / this.layout.height;\n }\n if (this.panels[id].layout.proportional_width === null){\n this.panels[id].layout.proportional_width = 1;\n }\n if (this.panels[id].layout.interaction.x_linked){\n x_linked_margins.left = Math.max(x_linked_margins.left, this.panels[id].layout.margin.left);\n x_linked_margins.right = Math.max(x_linked_margins.right, this.panels[id].layout.margin.right);\n }\n }\n\n // Sum the proportional heights and then adjust all proportionally so that the sum is exactly 1\n var total_proportional_height = this.sumProportional(\"height\");\n if (!total_proportional_height){\n return this;\n }\n var proportional_adjustment = 1 / total_proportional_height;\n for (id in this.panels){\n this.panels[id].layout.proportional_height *= proportional_adjustment;\n }\n\n // Update origins on all panels without changing plot-level dimensions yet\n // Also apply x-linked margins to x-linked panels, updating widths as needed\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n y_offset += this.panels[panel_id].layout.height;\n if (this.panels[panel_id].layout.interaction.x_linked){\n var delta = Math.max(x_linked_margins.left - this.panels[panel_id].layout.margin.left, 0)\n + Math.max(x_linked_margins.right - this.panels[panel_id].layout.margin.right, 0);\n this.panels[panel_id].layout.width += delta;\n this.panels[panel_id].layout.margin.left = x_linked_margins.left;\n this.panels[panel_id].layout.margin.right = x_linked_margins.right;\n this.panels[panel_id].layout.cliparea.origin.x = x_linked_margins.left;\n }\n }.bind(this));\n var calculated_plot_height = y_offset;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].layout.proportional_origin.y = this.panels[panel_id].layout.origin.y / calculated_plot_height;\n }.bind(this));\n\n // Update dimensions on the plot to accommodate repositioned panels\n this.setDimensions();\n\n // Set dimensions on all panels using newly set plot-level dimensions and panel-level proportional dimensions\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setDimensions(this.layout.width * this.panels[panel_id].layout.proportional_width,\n this.layout.height * this.panels[panel_id].layout.proportional_height);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Prepare the first rendering of the plot. This includes initializing the individual panels, but also creates shared\n * elements such as mouse events, panel guides/boundaries, and loader/curtain.\n *\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initialize = function(){\n\n // Ensure proper responsive class is present on the containing node if called for\n if (this.layout.responsive_resize){\n d3.select(this.container).classed(\"lz-container-responsive\", true);\n }\n\n // Create an element/layer for containing mouse guides\n if (this.layout.mouse_guide) {\n var mouse_guide_svg = this.svg.append(\"g\")\n .attr(\"class\", \"lz-mouse_guide\").attr(\"id\", this.id + \".mouse_guide\");\n var mouse_guide_vertical_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-vertical\").attr(\"x\",-1);\n var mouse_guide_horizontal_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-horizontal\").attr(\"y\",-1);\n this.mouse_guide = {\n svg: mouse_guide_svg,\n vertical: mouse_guide_vertical_svg,\n horizontal: mouse_guide_horizontal_svg\n };\n }\n\n // Add curtain and loader prototpyes to the plot\n this.curtain = LocusZoom.generateCurtain.call(this);\n this.loader = LocusZoom.generateLoader.call(this);\n\n // Create the panel_boundaries object with show/position/hide methods\n this.panel_boundaries = {\n parent: this,\n hide_timeout: null,\n showing: false,\n dragging: false,\n selectors: [],\n corner_selector: null,\n show: function(){\n // Generate panel boundaries\n if (!this.showing && !this.parent.curtain.showing){\n this.showing = true;\n // Loop through all panels to create a horizontal boundary for each\n this.parent.panel_ids_by_y_index.forEach(function(panel_id, panel_idx){\n var selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-boundary\")\n .attr(\"title\", \"Resize panel\");\n selector.append(\"span\");\n var panel_resize_drag = d3.behavior.drag();\n panel_resize_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n panel_resize_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n panel_resize_drag.on(\"drag\", function(){\n // First set the dimensions on the panel we're resizing\n var this_panel = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]];\n var original_panel_height = this_panel.layout.height;\n this_panel.setDimensions(this_panel.layout.width, this_panel.layout.height + d3.event.dy);\n var panel_height_change = this_panel.layout.height - original_panel_height;\n var new_calculated_plot_height = this.parent.layout.height + panel_height_change;\n // Next loop through all panels.\n // Update proportional dimensions for all panels including the one we've resized using discrete heights.\n // Reposition panels with a greater y-index than this panel to their appropriate new origin.\n this.parent.panel_ids_by_y_index.forEach(function(loop_panel_id, loop_panel_idx){\n var loop_panel = this.parent.panels[this.parent.panel_ids_by_y_index[loop_panel_idx]];\n loop_panel.layout.proportional_height = loop_panel.layout.height / new_calculated_plot_height;\n if (loop_panel_idx > panel_idx){\n loop_panel.setOrigin(loop_panel.layout.origin.x, loop_panel.layout.origin.y + panel_height_change);\n loop_panel.dashboard.position();\n }\n }.bind(this));\n // Reset dimensions on the entire plot and reposition panel boundaries\n this.parent.positionPanels();\n this.position();\n }.bind(this));\n selector.call(panel_resize_drag);\n this.parent.panel_boundaries.selectors.push(selector);\n }.bind(this));\n // Create a corner boundary / resize element on the bottom-most panel that resizes the entire plot\n var corner_selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-corner-boundary\")\n .attr(\"title\", \"Resize plot\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-outer\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-inner\");\n var corner_drag = d3.behavior.drag();\n corner_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n corner_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n corner_drag.on(\"drag\", function(){\n this.setDimensions(this.layout.width + d3.event.dx, this.layout.height + d3.event.dy);\n }.bind(this.parent));\n corner_selector.call(corner_drag);\n this.parent.panel_boundaries.corner_selector = corner_selector;\n }\n return this.position();\n },\n position: function(){\n if (!this.showing){ return this; }\n // Position panel boundaries\n var plot_page_origin = this.parent.getPageOrigin();\n this.selectors.forEach(function(selector, panel_idx){\n var panel_page_origin = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].getPageOrigin();\n var left = plot_page_origin.x;\n var top = panel_page_origin.y + this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].layout.height - 12;\n var width = this.parent.layout.width - 1;\n selector.style({\n top: top + \"px\",\n left: left + \"px\",\n width: width + \"px\"\n });\n selector.select(\"span\").style({\n width: width + \"px\"\n });\n }.bind(this));\n // Position corner selector\n var corner_padding = 10;\n var corner_size = 16;\n this.corner_selector.style({\n top: (plot_page_origin.y + this.parent.layout.height - corner_padding - corner_size) + \"px\",\n left: (plot_page_origin.x + this.parent.layout.width - corner_padding - corner_size) + \"px\"\n });\n return this;\n },\n hide: function(){\n if (!this.showing){ return this; }\n this.showing = false;\n // Remove panel boundaries\n this.selectors.forEach(function(selector){ selector.remove(); });\n this.selectors = [];\n // Remove corner boundary\n this.corner_selector.remove();\n this.corner_selector = null;\n return this;\n }\n };\n\n // Show panel boundaries stipulated by the layout (basic toggle, only show on mouse over plot)\n if (this.layout.panel_boundaries){\n d3.select(this.svg.node().parentNode).on(\"mouseover.\" + this.id + \".panel_boundaries\", function(){\n clearTimeout(this.panel_boundaries.hide_timeout);\n this.panel_boundaries.show();\n }.bind(this));\n d3.select(this.svg.node().parentNode).on(\"mouseout.\" + this.id + \".panel_boundaries\", function(){\n this.panel_boundaries.hide_timeout = setTimeout(function(){\n this.panel_boundaries.hide();\n }.bind(this), 300);\n }.bind(this));\n }\n\n // Create the dashboard object and immediately show it\n this.dashboard = new LocusZoom.Dashboard(this).show();\n\n // Initialize all panels\n for (var id in this.panels){\n this.panels[id].initialize();\n }\n\n // Define plot-level mouse events\n var namespace = \".\" + this.id;\n if (this.layout.mouse_guide) {\n var mouseout_mouse_guide = function(){\n this.mouse_guide.vertical.attr(\"x\", -1);\n this.mouse_guide.horizontal.attr(\"y\", -1);\n }.bind(this);\n var mousemove_mouse_guide = function(){\n var coords = d3.mouse(this.svg.node());\n this.mouse_guide.vertical.attr(\"x\", coords[0]);\n this.mouse_guide.horizontal.attr(\"y\", coords[1]);\n }.bind(this);\n this.svg\n .on(\"mouseout\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"touchleave\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"mousemove\" + namespace + \"-mouse_guide\", mousemove_mouse_guide);\n }\n var mouseup = function(){\n this.stopDrag();\n }.bind(this);\n var mousemove = function(){\n if (this.interaction.dragging){\n var coords = d3.mouse(this.svg.node());\n if (d3.event){ d3.event.preventDefault(); }\n this.interaction.dragging.dragged_x = coords[0] - this.interaction.dragging.start_x;\n this.interaction.dragging.dragged_y = coords[1] - this.interaction.dragging.start_y;\n this.panels[this.interaction.panel_id].render();\n this.interaction.linked_panel_ids.forEach(function(panel_id){\n this.panels[panel_id].render();\n }.bind(this));\n }\n }.bind(this);\n this.svg\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup)\n .on(\"mousemove\" + namespace, mousemove)\n .on(\"touchmove\" + namespace, mousemove);\n\n // Add an extra namespaced mouseup handler to the containing body, if there is one\n // This helps to stop interaction events gracefully when dragging outside of the plot element\n if (!d3.select(\"body\").empty()){\n d3.select(\"body\")\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup);\n }\n\n this.initialized = true;\n\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n var client_rect = this.svg.node().getBoundingClientRect();\n var width = client_rect.width ? client_rect.width : this.layout.width;\n var height = client_rect.height ? client_rect.height : this.layout.height;\n this.setDimensions(width, height);\n\n return this;\n\n};\n\n/**\n * Refresh (or fetch) a plot's data from sources, regardless of whether position or state has changed\n * @returns {Promise}\n */\nLocusZoom.Plot.prototype.refresh = function(){\n return this.applyState();\n};\n\n\n/**\n * A user-defined callback function that can receive (and potentially act on) new plot data.\n * @callback externalDataCallback\n * @param {Object} new_data The body resulting from a data request. This represents the same information that would be passed to\n * a data layer making an equivalent request.\n */\n\n/**\n * A user-defined callback function that can respond to errors received during a previous operation\n * @callback externalErrorCallback\n * @param err A representation of the error that occurred\n */\n\n/**\n * Allow newly fetched data to be made available outside the LocusZoom plot. For example, a callback could be\n * registered to draw an HTML table of top GWAS hits, and update that table whenever the plot region changes.\n *\n * This is a convenience method for external hooks. It registers an event listener and returns parsed data,\n * using the same fields syntax and underlying methods as data layers.\n *\n * @param {String[]} fields An array of field names and transforms, in the same syntax used by a data layer.\n * Different data sources should be prefixed by the source name.\n * @param {externalDataCallback} success_callback Used defined function that is automatically called any time that\n * new data is received by the plot.\n * @param {Object} [opts] Options\n * @param {externalErrorCallback} [opts.onerror] User defined function that is automatically called if a problem\n * occurs during the data request or subsequent callback operations\n * @param {boolean} [opts.discrete=false] Normally the callback will subscribe to the combined body from the chain,\n * which may not be in a format that matches what the external callback wants to do. If discrete=true, returns the\n * uncombined record info\n * @return {function} The newly created event listener, to allow for later cleanup/removal\n */\nLocusZoom.Plot.prototype.subscribeToData = function(fields, success_callback, opts) {\n opts = opts || {};\n\n // Register an event listener that is notified whenever new data has been rendered\n var error_callback = opts.onerror || function(err) {\n console.log(\"An error occurred while acting on an external callback\", err);\n };\n var self = this;\n\n var listener = function() {\n try {\n self.lzd.getData(self.state, fields)\n .then(function (new_data) {\n success_callback(opts.discrete ? new_data.discrete : new_data.body);\n }).catch(error_callback);\n } catch (error) {\n // In certain cases, errors are thrown before a promise can be generated, and LZ error display seems to rely on these errors bubbling up\n error_callback(error);\n }\n };\n this.on(\"data_rendered\", listener);\n return listener;\n};\n\n/**\n * Update state values and trigger a pull for fresh data on all data sources for all data layers\n * @param state_changes\n * @returns {Promise} A promise that resolves when all data fetch and update operations are complete\n */\nLocusZoom.Plot.prototype.applyState = function(state_changes){\n state_changes = state_changes || {};\n if (typeof state_changes != \"object\"){\n throw(\"LocusZoom.applyState only accepts an object; \" + (typeof state_changes) + \" given\");\n }\n\n // First make a copy of the current (old) state to work with\n var new_state = JSON.parse(JSON.stringify(this.state));\n\n // Apply changes by top-level property to the new state\n for (var property in state_changes) {\n new_state[property] = state_changes[property];\n }\n\n // Validate the new state (may do nothing, may do a lot, depends on how the user has things set up)\n new_state = LocusZoom.validateState(new_state, this.layout);\n\n // Apply new state to the actual state\n for (property in new_state) {\n this.state[property] = new_state[property];\n }\n\n // Generate requests for all panels given new state\n this.emit(\"data_requested\");\n this.remap_promises = [];\n this.loading_data = true;\n for (var id in this.panels){\n this.remap_promises.push(this.panels[id].reMap());\n }\n\n return Q.all(this.remap_promises)\n .catch(function(error){\n console.error(error);\n this.curtain.drop(error);\n this.loading_data = false;\n }.bind(this))\n .then(function(){\n // TODO: Check logic here; in some promise implementations, this would cause the error to be considered handled, and \"then\" would always fire. (may or may not be desired behavior)\n // Update dashboard / components\n this.dashboard.update();\n\n // Apply panel-level state values\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel = this.panels[panel_id];\n panel.dashboard.update();\n // Apply data-layer-level state values\n panel.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n var data_layer = this.data_layers[data_layer_id];\n var state_id = panel_id + \".\" + data_layer_id;\n for (var property in this.state[state_id]){\n if (!this.state[state_id].hasOwnProperty(property)){ continue; }\n if (Array.isArray(this.state[state_id][property])){\n this.state[state_id][property].forEach(function(element_id){\n try {\n this.setElementStatus(property, this.getElementById(element_id), true);\n } catch (e){\n console.error(\"Unable to apply state: \" + state_id + \", \" + property);\n }\n }.bind(data_layer));\n }\n }\n }.bind(panel));\n }.bind(this));\n\n // Emit events\n this.emit(\"layout_changed\");\n this.emit(\"data_rendered\");\n this.emit(\"state_changed\", state_changes);\n\n this.loading_data = false;\n\n }.bind(this));\n};\n\n/**\n * Register interactions along the specified axis, provided that the target panel allows interaction.\n *\n * @param {LocusZoom.Panel} panel\n * @param {('x_tick'|'y1_tick'|'y2_tick')} method The direction (axis) along which dragging is being performed.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.startDrag = function(panel, method){\n\n panel = panel || null;\n method = method || null;\n\n var axis = null;\n switch (method){\n case \"background\":\n case \"x_tick\":\n axis = \"x\";\n break;\n case \"y1_tick\":\n axis = \"y1\";\n break;\n case \"y2_tick\":\n axis = \"y2\";\n break;\n }\n\n if (!(panel instanceof LocusZoom.Panel) || !axis || !this.canInteract()){ return this.stopDrag(); }\n\n var coords = d3.mouse(this.svg.node());\n this.interaction = {\n panel_id: panel.id,\n linked_panel_ids: panel.getLinkedPanelIds(axis),\n dragging: {\n method: method,\n start_x: coords[0],\n start_y: coords[1],\n dragged_x: 0,\n dragged_y: 0,\n axis: axis\n }\n };\n\n this.svg.style(\"cursor\", \"all-scroll\");\n\n return this;\n\n};\n\n/**\n * Process drag interactions across the target panel and synchronize plot state across other panels in sync;\n * clear the event when complete\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.stopDrag = function(){\n\n if (!this.interaction.dragging){ return this; }\n\n if (typeof this.panels[this.interaction.panel_id] != \"object\"){\n this.interaction = {};\n return this;\n }\n var panel = this.panels[this.interaction.panel_id];\n\n // Helper function to find the appropriate axis layouts on child data layers\n // Once found, apply the extent as floor/ceiling and remove all other directives\n // This forces all associated axes to conform to the extent generated by a drag action\n var overrideAxisLayout = function(axis, axis_number, extent){\n panel.data_layer_ids_by_z_index.forEach(function(id){\n if (panel.data_layers[id].layout[axis+\"_axis\"].axis === axis_number){\n panel.data_layers[id].layout[axis+\"_axis\"].floor = extent[0];\n panel.data_layers[id].layout[axis+\"_axis\"].ceiling = extent[1];\n delete panel.data_layers[id].layout[axis+\"_axis\"].lower_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].upper_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].min_extent;\n delete panel.data_layers[id].layout[axis+\"_axis\"].ticks;\n }\n });\n };\n\n switch(this.interaction.dragging.method){\n case \"background\":\n case \"x_tick\":\n if (this.interaction.dragging.dragged_x !== 0){\n overrideAxisLayout(\"x\", 1, panel.x_extent);\n this.applyState({ start: panel.x_extent[0], end: panel.x_extent[1] });\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n if (this.interaction.dragging.dragged_y !== 0){\n // TODO: Hardcoded assumption of only two possible axes with single-digit #s (switch/case)\n var y_axis_number = parseInt(this.interaction.dragging.method[1]);\n overrideAxisLayout(\"y\", y_axis_number, panel[\"y\"+y_axis_number+\"_extent\"]);\n }\n break;\n }\n\n this.interaction = {};\n this.svg.style(\"cursor\", null);\n\n return this;\n\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A panel is an abstract class representing a subdivision of the LocusZoom stage\n * to display a distinct data representation as a collection of data layers.\n * @class\n * @param {Object} layout\n * @param {LocusZoom.Plot|null} parent\n*/\nLocusZoom.Panel = function(layout, parent) {\n\n if (typeof layout !== \"object\"){\n throw \"Unable to create panel, invalid layout\";\n }\n\n /** @member {LocusZoom.Plot|null} */\n this.parent = parent || null;\n /** @member {LocusZoom.Plot|null} */\n this.parent_plot = parent;\n\n // Ensure a valid ID is present. If there is no valid ID then generate one\n if (typeof layout.id !== \"string\" || !layout.id.length){\n if (!this.parent){\n layout.id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n } else {\n var id = null;\n var generateID = function(){\n id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n if (id == null || typeof this.parent.panels[id] != \"undefined\"){\n id = generateID();\n }\n }.bind(this);\n layout.id = id;\n }\n } else if (this.parent) {\n if (typeof this.parent.panels[layout.id] !== \"undefined\"){\n throw \"Cannot create panel with id [\" + layout.id + \"]; panel with that id already exists\";\n }\n }\n /** @member {String} */\n this.id = layout.id;\n\n /** @member {Boolean} */\n this.initialized = false;\n /**\n * The index of this panel in the parent plot's `layout.panels`\n * @member {number}\n * */\n this.layout_idx = null;\n /** @member {Object} */\n this.svg = {};\n\n /**\n * A JSON-serializable object used to describe the composition of the Panel\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.Panel.DefaultLayout);\n\n // Define state parameters specific to this panel\n if (this.parent){\n /** @member {Object} */\n this.state = this.parent.state;\n\n /** @member {String} */\n this.state_id = this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n } else {\n this.state = null;\n this.state_id = null;\n }\n\n /** @member {Object} */\n this.data_layers = {};\n /** @member {String[]} */\n this.data_layer_ids_by_z_index = [];\n\n /** @protected */\n this.applyDataLayerZIndexesToDataLayerLayouts = function(){\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n }.bind(this);\n\n /**\n * Track data requests in progress\n * @member {Promise[]}\n * @protected\n */\n this.data_promises = [];\n\n /** @member {d3.scale} */\n this.x_scale = null;\n /** @member {d3.scale} */\n this.y1_scale = null;\n /** @member {d3.scale} */\n this.y2_scale = null;\n\n /** @member {d3.extent} */\n this.x_extent = null;\n /** @member {d3.extent} */\n this.y1_extent = null;\n /** @member {d3.extent} */\n this.y2_extent = null;\n\n /** @member {Number[]} */\n this.x_ticks = [];\n /** @member {Number[]} */\n this.y1_ticks = [];\n /** @member {Number[]} */\n this.y2_ticks = [];\n\n /**\n * A timeout ID as returned by setTimeout\n * @protected\n * @member {number}\n */\n this.zoom_timeout = null;\n\n /** @returns {string} */\n this.getBaseId = function(){\n return this.parent.id + \".\" + this.id;\n };\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": []\n };\n /**\n * There are several events that a LocusZoom panel can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following panel-level events are currently supported:\n * - `layout_changed` - context: panel - Any aspect of the panel's layout (including dimensions or state) has changed.\n * - `data_requested` - context: panel - A request for new data from any data source used in the panel has been made.\n * - `data_rendered` - context: panel - Data from a request has been received and rendered in the panel.\n * - `element_clicked` - context: panel - A data element in any of the panel's data layers has been clicked.\n * - `element_selection` - context: panel - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `panel.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * panel itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of the event (as defined in `event_hooks`)\n * @param {function} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n // TODO: Dry plot and panel event code into a shared mixin\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Panel}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n *\n * There is a shorter overloaded form of this method: if the event does not have any data, the second\n * argument can be a boolean to control bubbling\n *\n * @param {string} event A known event name\n * @param {*} [eventData] Data or event description that will be passed to the event listener\n * @param {boolean} [bubble=false] Whether to bubble the event to the parent\n * @returns {LocusZoom.Panel}\n */\n this.emit = function(event, eventData, bubble) {\n bubble = bubble || false;\n\n // TODO: DRY this with the parent plot implementation. Ensure interfaces remain compatible.\n // TODO: Improve documentation for overloaded method signature (JSDoc may have trouble here)\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n if (typeof eventData === \"boolean\" && arguments.length === 2) {\n // Overloaded method signature: emit(event, bubble)\n bubble = eventData;\n eventData = null;\n }\n var sourceID = this.getBaseId();\n var self = this;\n var eventContext = {sourceID: sourceID, data: eventData || null};\n this.event_hooks[event].forEach(function(hookToRun) {\n // By default, any handlers fired here will see the panel as the value of `this`. If a bound function is\n // registered as a handler, the previously bound `this` will override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n if (bubble && this.parent) {\n this.parent.emit(event, eventContext);\n }\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\n this.getPageOrigin = function(){\n var plot_origin = this.parent.getPageOrigin();\n return {\n x: plot_origin.x + this.layout.origin.x,\n y: plot_origin.y + this.layout.origin.y\n };\n };\n\n // Initialize the layout\n this.initializeLayout();\n\n return this;\n\n};\n\n/**\n * Default panel layout\n * @static\n * @type {Object}\n */\nLocusZoom.Panel.DefaultLayout = {\n title: { text: \"\", style: {}, x: 10, y: 22 },\n y_index: null,\n width: 0,\n height: 0,\n origin: { x: 0, y: null },\n min_width: 1,\n min_height: 1,\n proportional_width: null,\n proportional_height: null,\n proportional_origin: { x: 0, y: null },\n margin: { top: 0, right: 0, bottom: 0, left: 0 },\n background_click: \"clear_selections\",\n dashboard: {\n components: []\n },\n cliparea: {\n height: 0,\n width: 0,\n origin: { x: 0, y: 0 }\n },\n axes: { // These are the only axes supported!!\n x: {},\n y1: {},\n y2: {}\n },\n legend: null,\n interaction: {\n drag_background_to_pan: false,\n drag_x_ticks_to_scale: false,\n drag_y1_ticks_to_scale: false,\n drag_y2_ticks_to_scale: false,\n scroll_to_zoom: false,\n x_linked: false,\n y1_linked: false,\n y2_linked: false\n },\n data_layers: []\n};\n\n/**\n * Prepare the panel for first use by performing parameter validation, creating axes, setting default dimensions,\n * and preparing / positioning data layers as appropriate.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initializeLayout = function(){\n\n // If the layout is missing BOTH width and proportional width then set the proportional width to 1.\n // This will default the panel to taking up the full width of the plot.\n if (this.layout.width === 0 && this.layout.proportional_width === null){\n this.layout.proportional_width = 1;\n }\n\n // If the layout is missing BOTH height and proportional height then set the proportional height to\n // an equal share of the plot's current height.\n if (this.layout.height === 0 && this.layout.proportional_height === null){\n var panel_count = Object.keys(this.parent.panels).length;\n if (panel_count > 0){\n this.layout.proportional_height = (1 / panel_count);\n } else {\n this.layout.proportional_height = 1;\n }\n }\n\n // Set panel dimensions, origin, and margin\n this.setDimensions();\n this.setOrigin();\n this.setMargin();\n\n // Set ranges\n // TODO: Define stub values in constructor\n this.x_range = [0, this.layout.cliparea.width];\n this.y1_range = [this.layout.cliparea.height, 0];\n this.y2_range = [this.layout.cliparea.height, 0];\n\n // Initialize panel axes\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!Object.keys(this.layout.axes[axis]).length || this.layout.axes[axis].render ===false){\n // The default layout sets the axis to an empty object, so set its render boolean here\n this.layout.axes[axis].render = false;\n } else {\n this.layout.axes[axis].render = true;\n this.layout.axes[axis].label = this.layout.axes[axis].label || null;\n this.layout.axes[axis].label_function = this.layout.axes[axis].label_function || null;\n }\n }.bind(this));\n\n // Add data layers (which define x and y extents)\n this.layout.data_layers.forEach(function(data_layer_layout){\n this.addDataLayer(data_layer_layout);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Set the dimensions for the panel. If passed with no arguments will calculate optimal size based on layout\n * directives and the available area within the plot. If passed discrete width (number) and height (number) will\n * attempt to resize the panel to them, but may be limited by minimum dimensions defined on the plot or panel.\n *\n * @public\n * @param {number} [width]\n * @param {number} [height]\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setDimensions = function(width, height){\n if (typeof width != \"undefined\" && typeof height != \"undefined\"){\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n }\n } else {\n if (this.layout.proportional_width !== null){\n this.layout.width = Math.max(this.layout.proportional_width * this.parent.layout.width, this.layout.min_width);\n }\n if (this.layout.proportional_height !== null){\n this.layout.height = Math.max(this.layout.proportional_height * this.parent.layout.height, this.layout.min_height);\n }\n }\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n if (this.svg.clipRect){\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n if (this.initialized){\n this.render();\n this.curtain.update();\n this.loader.update();\n this.dashboard.update();\n if (this.legend){ this.legend.position(); }\n }\n return this;\n};\n\n/**\n * Set panel origin on the plot, and re-render as appropriate\n *\n * @public\n * @param {number} x\n * @param {number} y\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setOrigin = function(x, y){\n if (!isNaN(x) && x >= 0){ this.layout.origin.x = Math.max(Math.round(+x), 0); }\n if (!isNaN(y) && y >= 0){ this.layout.origin.y = Math.max(Math.round(+y), 0); }\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set margins around this panel\n * @public\n * @param {number} top\n * @param {number} right\n * @param {number} bottom\n * @param {number} left\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setMargin = function(top, right, bottom, left){\n var extra;\n if (!isNaN(top) && top >= 0){ this.layout.margin.top = Math.max(Math.round(+top), 0); }\n if (!isNaN(right) && right >= 0){ this.layout.margin.right = Math.max(Math.round(+right), 0); }\n if (!isNaN(bottom) && bottom >= 0){ this.layout.margin.bottom = Math.max(Math.round(+bottom), 0); }\n if (!isNaN(left) && left >= 0){ this.layout.margin.left = Math.max(Math.round(+left), 0); }\n if (this.layout.margin.top + this.layout.margin.bottom > this.layout.height){\n extra = Math.floor(((this.layout.margin.top + this.layout.margin.bottom) - this.layout.height) / 2);\n this.layout.margin.top -= extra;\n this.layout.margin.bottom -= extra;\n }\n if (this.layout.margin.left + this.layout.margin.right > this.layout.width){\n extra = Math.floor(((this.layout.margin.left + this.layout.margin.right) - this.layout.width) / 2);\n this.layout.margin.left -= extra;\n this.layout.margin.right -= extra;\n }\n [\"top\", \"right\", \"bottom\", \"left\"].forEach(function(m){\n this.layout.margin[m] = Math.max(this.layout.margin[m], 0);\n }.bind(this));\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n this.layout.cliparea.origin.x = this.layout.margin.left;\n this.layout.cliparea.origin.y = this.layout.margin.top;\n\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set the title for the panel. If passed an object, will merge the object with the existing layout configuration, so\n * that all or only some of the title layout object's parameters can be customized. If passed null, false, or an empty\n * string, the title DOM element will be set to display: none.\n *\n * @param {string|object|null} title The title text, or an object with additional configuration\n * @param {string} title.text Text to display. Since titles are rendered as SVG text, HTML and newlines will not be rendered.\n * @param {number} title.x X-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n * @param {number} title.y Y-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n NOTE: SVG y values go from the top down, so the SVG origin of (0,0) is in the top left corner.\n * @param {object} title.style CSS styles object to be applied to the title's DOM element.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setTitle = function(title){\n if (typeof this.layout.title == \"string\"){\n var text = this.layout.title;\n this.layout.title = { text: text, x: 0, y: 0, style: {} };\n }\n if (typeof title == \"string\"){\n this.layout.title.text = title;\n } else if (typeof title == \"object\" && title !== null){\n this.layout.title = LocusZoom.Layouts.merge(title, this.layout.title);\n }\n if (this.layout.title.text.length){\n this.title.attr(\"display\", null)\n .attr(\"x\", parseFloat(this.layout.title.x))\n .attr(\"y\", parseFloat(this.layout.title.y))\n .style(this.layout.title.style)\n .text(this.layout.title.text);\n } else {\n this.title.attr(\"display\", \"none\");\n }\n return this;\n};\n\n\n/**\n * Prepare the first rendering of the panel. This includes drawing the individual data layers, but also creates shared\n * elements such as axes, title, and loader/curtain.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initialize = function(){\n\n // Append a container group element to house the main panel group element and the clip path\n // Position with initial layout parameters\n this.svg.container = this.parent.svg.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel_container\")\n .attr(\"transform\", \"translate(\" + (this.layout.origin.x || 0) + \",\" + (this.layout.origin.y || 0) + \")\");\n\n // Append clip path to the parent svg element, size with initial layout parameters\n var clipPath = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\");\n this.svg.clipRect = clipPath.append(\"rect\")\n .attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Append svg group for rendering all panel child elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n // Add curtain and loader prototypes to the panel\n /** @member {Object} */\n this.curtain = LocusZoom.generateCurtain.call(this);\n /** @member {Object} */\n this.loader = LocusZoom.generateLoader.call(this);\n\n /**\n * Create the dashboard object and hang components on it as defined by panel layout\n * @member {LocusZoom.Dashboard}\n */\n this.dashboard = new LocusZoom.Dashboard(this);\n\n // Inner border\n this.inner_border = this.svg.group.append(\"rect\")\n .attr(\"class\", \"lz-panel-background\")\n .on(\"click\", function(){\n if (this.layout.background_click === \"clear_selections\"){ this.clearSelections(); }\n }.bind(this));\n\n // Add the title\n /** @member {Element} */\n this.title = this.svg.group.append(\"text\").attr(\"class\", \"lz-panel-title\");\n if (typeof this.layout.title != \"undefined\"){ this.setTitle(); }\n\n // Initialize Axes\n this.svg.x_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".x_axis\").attr(\"class\", \"lz-x lz-axis\");\n if (this.layout.axes.x.render){\n this.svg.x_axis_label = this.svg.x_axis.append(\"text\")\n .attr(\"class\", \"lz-x lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y1_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y1_axis\").attr(\"class\", \"lz-y lz-y1 lz-axis\");\n if (this.layout.axes.y1.render){\n this.svg.y1_axis_label = this.svg.y1_axis.append(\"text\")\n .attr(\"class\", \"lz-y1 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y2_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y2_axis\").attr(\"class\", \"lz-y lz-y2 lz-axis\");\n if (this.layout.axes.y2.render){\n this.svg.y2_axis_label = this.svg.y2_axis.append(\"text\")\n .attr(\"class\", \"lz-y2 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n\n // Initialize child Data Layers\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].initialize();\n }.bind(this));\n\n /**\n * Legend object, as defined by panel layout and child data layer layouts\n * @member {LocusZoom.Legend}\n * */\n this.legend = null;\n if (this.layout.legend){\n this.legend = new LocusZoom.Legend(this);\n }\n\n // Establish panel background drag interaction mousedown event handler (on the panel background)\n if (this.layout.interaction.drag_background_to_pan){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var mousedown = function(){\n this.parent.startDrag(this, \"background\");\n }.bind(this);\n this.svg.container.select(\".lz-panel-background\")\n .on(\"mousedown\" + namespace + \".background\", mousedown)\n .on(\"touchstart\" + namespace + \".background\", mousedown);\n }\n\n return this;\n\n};\n\n/**\n * Refresh the sort order of all data layers (called by data layer moveUp and moveDown methods)\n */\nLocusZoom.Panel.prototype.resortDataLayers = function(){\n var sort = [];\n this.data_layer_ids_by_z_index.forEach(function(id){\n sort.push(this.data_layers[id].layout.z_index);\n }.bind(this));\n this.svg.group.selectAll(\"g.lz-data_layer-container\").data(sort).sort(d3.ascending);\n this.applyDataLayerZIndexesToDataLayerLayouts();\n};\n\n/**\n * Get an array of panel IDs that are axis-linked to this panel\n * @param {('x'|'y1'|'y2')} axis\n * @returns {Array}\n */\nLocusZoom.Panel.prototype.getLinkedPanelIds = function(axis){\n axis = axis || null;\n var linked_panel_ids = [];\n if ([\"x\",\"y1\",\"y2\"].indexOf(axis) === -1){ return linked_panel_ids; }\n if (!this.layout.interaction[axis + \"_linked\"]){ return linked_panel_ids; }\n this.parent.panel_ids_by_y_index.forEach(function(panel_id){\n if (panel_id !== this.id && this.parent.panels[panel_id].layout.interaction[axis + \"_linked\"]){\n linked_panel_ids.push(panel_id);\n }\n }.bind(this));\n return linked_panel_ids;\n};\n\n/**\n * Move a panel up relative to others by y-index\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveUp = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index - 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index - 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index - 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Move a panel down (y-axis) relative to others in the plot\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveDown = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index + 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index + 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index + 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Create a new data layer from a provided layout object. Should have the keys specified in `DefaultLayout`\n * Will automatically add at the top (depth/z-index) of the panel unless explicitly directed differently\n * in the layout provided.\n * @param {object} layout\n * @returns {*}\n */\nLocusZoom.Panel.prototype.addDataLayer = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\" || typeof layout.id !== \"string\" || !layout.id.length){\n throw \"Invalid data layer layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n if (typeof this.data_layers[layout.id] !== \"undefined\"){\n throw \"Cannot create data_layer with id [\" + layout.id + \"]; data layer with that id already exists in the panel\";\n }\n if (typeof layout.type !== \"string\"){\n throw \"Invalid data layer type in layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n\n // If the layout defines a y axis make sure the axis number is set and is 1 or 2 (default to 1)\n if (typeof layout.y_axis == \"object\" && (typeof layout.y_axis.axis == \"undefined\" || [1,2].indexOf(layout.y_axis.axis) === -1)){\n layout.y_axis.axis = 1;\n }\n\n // Create the Data Layer\n var data_layer = LocusZoom.DataLayers.get(layout.type, layout, this);\n\n // Store the Data Layer on the Panel\n this.data_layers[data_layer.id] = data_layer;\n\n // If a discrete z_index was set in the layout then adjust other data layer z_index values to accommodate this one\n if (data_layer.layout.z_index !== null && !isNaN(data_layer.layout.z_index)\n && this.data_layer_ids_by_z_index.length > 0){\n // Negative z_index values should count backwards from the end, so convert negatives to appropriate values here\n if (data_layer.layout.z_index < 0){\n data_layer.layout.z_index = Math.max(this.data_layer_ids_by_z_index.length + data_layer.layout.z_index, 0);\n }\n this.data_layer_ids_by_z_index.splice(data_layer.layout.z_index, 0, data_layer.id);\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n } else {\n var length = this.data_layer_ids_by_z_index.push(data_layer.id);\n this.data_layers[data_layer.id].layout.z_index = length - 1;\n }\n\n // Determine if this data layer was already in the layout.data_layers array.\n // If it wasn't, add it. Either way store the layout.data_layers array index on the data_layer.\n var layout_idx = null;\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n if (data_layer_layout.id === data_layer.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.data_layers.push(this.data_layers[data_layer.id].layout) - 1;\n }\n this.data_layers[data_layer.id].layout_idx = layout_idx;\n\n return this.data_layers[data_layer.id];\n};\n\n/**\n * Remove a data layer by id\n * @param {string} id\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.removeDataLayer = function(id){\n if (!this.data_layers[id]){\n throw (\"Unable to remove data layer, ID not found: \" + id);\n }\n\n // Destroy all tooltips for the data layer\n this.data_layers[id].destroyAllTooltips();\n\n // Remove the svg container for the data layer if it exists\n if (this.data_layers[id].svg.container){\n this.data_layers[id].svg.container.remove();\n }\n\n // Delete the data layer and its presence in the panel layout and state\n this.layout.data_layers.splice(this.data_layers[id].layout_idx, 1);\n delete this.state[this.data_layers[id].state_id];\n delete this.data_layers[id];\n\n // Remove the data_layer id from the z_index array\n this.data_layer_ids_by_z_index.splice(this.data_layer_ids_by_z_index.indexOf(id), 1);\n\n // Update layout_idx and layout.z_index values for all remaining data_layers\n this.applyDataLayerZIndexesToDataLayerLayouts();\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n this.data_layers[data_layer_layout.id].layout_idx = idx;\n }.bind(this));\n\n return this;\n};\n\n/**\n * Clear all selections on all data layers\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.clearSelections = function(){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(\"selected\", false);\n }.bind(this));\n return this;\n};\n\n/**\n * When the parent plot changes state, adjust the panel accordingly. For example, this may include fetching new data\n * from the API as the viewing region changes\n * @returns {Promise}\n */\nLocusZoom.Panel.prototype.reMap = function(){\n this.emit(\"data_requested\");\n this.data_promises = [];\n\n // Remove any previous error messages before attempting to load new data\n this.curtain.hide();\n // Trigger reMap on each Data Layer\n for (var id in this.data_layers){\n try {\n this.data_promises.push(this.data_layers[id].reMap());\n } catch (error) {\n console.warn(error);\n this.curtain.show(error);\n }\n }\n // When all finished trigger a render\n return Q.all(this.data_promises)\n .then(function(){\n this.initialized = true;\n this.render();\n this.emit(\"layout_changed\", true);\n this.emit(\"data_rendered\");\n }.bind(this))\n .catch(function(error){\n console.warn(error);\n this.curtain.show(error);\n }.bind(this));\n};\n\n/**\n * Iterate over data layers to generate panel axis extents\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.generateExtents = function(){\n\n // Reset extents\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n this[axis + \"_extent\"] = null;\n }.bind(this));\n\n // Loop through the data layers\n for (var id in this.data_layers){\n\n var data_layer = this.data_layers[id];\n\n // If defined and not decoupled, merge the x extent of the data layer with the panel's x extent\n if (data_layer.layout.x_axis && !data_layer.layout.x_axis.decoupled){\n this.x_extent = d3.extent((this.x_extent || []).concat(data_layer.getAxisExtent(\"x\")));\n }\n\n // If defined and not decoupled, merge the y extent of the data layer with the panel's appropriate y extent\n if (data_layer.layout.y_axis && !data_layer.layout.y_axis.decoupled){\n var y_axis = \"y\" + data_layer.layout.y_axis.axis;\n this[y_axis+\"_extent\"] = d3.extent((this[y_axis+\"_extent\"] || []).concat(data_layer.getAxisExtent(\"y\")));\n }\n\n }\n\n // Override x_extent from state if explicitly defined to do so\n if (this.layout.axes.x && this.layout.axes.x.extent === \"state\"){\n this.x_extent = [ this.state.start, this.state.end ];\n }\n\n return this;\n\n};\n\n/**\n * Generate an array of ticks for an axis. These ticks are generated in one of three ways (highest wins):\n * 1. An array of specific tick marks\n * 2. Query each data layer for what ticks are appropriate, and allow a panel-level tick configuration parameter\n * object to override the layer's default presentation settings\n * 3. Generate generic tick marks based on the extent of the data\n * @param {('x'|'y1'|'y2')} axis The string identifier of the axis\n * @returns {Number[]|Object[]} TODO: number format?\n * An array of numbers: interpreted as an array of axis value offsets for positioning.\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.Panel.prototype.generateTicks = function(axis){\n\n // Parse an explicit 'ticks' attribute in the axis layout\n if (this.layout.axes[axis].ticks){\n var layout = this.layout.axes[axis];\n\n var baseTickConfig = layout.ticks;\n if (Array.isArray(baseTickConfig)){\n // Array of specific ticks hard-coded into a panel will override any ticks that an individual layer might specify\n return baseTickConfig;\n }\n\n if (typeof baseTickConfig === \"object\") {\n // If the layout specifies base configuration for ticks- but without specific positions- then ask each\n // data layer to report the tick marks that it thinks it needs\n // TODO: Few layers currently need to specify custom ticks (which is ok!). But if it becomes common, consider adding mechanisms to deduplicate ticks across layers\n var self = this;\n\n // Pass any layer-specific customizations for how ticks are calculated. (styles are overridden separately)\n var config = { position: baseTickConfig.position };\n\n var combinedTicks = this.data_layer_ids_by_z_index.reduce(function(acc, data_layer_id) {\n var nextLayer = self.data_layers[data_layer_id];\n return acc.concat(nextLayer.getTicks(axis, config));\n }, []);\n\n return combinedTicks.map(function(item) {\n // The layer makes suggestions, but tick configuration params specified on the panel take precedence\n var itemConfig = {};\n itemConfig = LocusZoom.Layouts.merge(itemConfig, baseTickConfig);\n return LocusZoom.Layouts.merge(itemConfig, item);\n });\n }\n }\n\n // If no other configuration is provided, attempt to generate ticks from the extent\n if (this[axis + \"_extent\"]) {\n return LocusZoom.prettyTicks(this[axis + \"_extent\"], \"both\");\n }\n return [];\n};\n\n/**\n * Update rendering of this panel whenever an event triggers a redraw. Assumes that the panel has already been\n * prepared the first time via `initialize`\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.render = function(){\n\n // Position the panel container\n this.svg.container.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n\n // Set size on the clip rect\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Set and position the inner border, style if necessary\n this.inner_border\n .attr(\"x\", this.layout.margin.left).attr(\"y\", this.layout.margin.top)\n .attr(\"width\", this.layout.width - (this.layout.margin.left + this.layout.margin.right))\n .attr(\"height\", this.layout.height - (this.layout.margin.top + this.layout.margin.bottom));\n if (this.layout.inner_border){\n this.inner_border.style({ \"stroke-width\": 1, \"stroke\": this.layout.inner_border });\n }\n\n // Set/update panel title if necessary\n this.setTitle();\n\n // Regenerate all extents\n this.generateExtents();\n\n // Helper function to constrain any procedurally generated vectors (e.g. ranges, extents)\n // Constraints applied here keep vectors from going to infinity or beyond a definable power of ten\n var constrain = function(value, limit_exponent){\n var neg_min = Math.pow(-10, limit_exponent);\n var neg_max = Math.pow(-10, -limit_exponent);\n var pos_min = Math.pow(10, -limit_exponent);\n var pos_max = Math.pow(10, limit_exponent);\n if (value === Infinity){ value = pos_max; }\n if (value === -Infinity){ value = neg_min; }\n if (value === 0){ value = pos_min; }\n if (value > 0){ value = Math.max(Math.min(value, pos_max), pos_min); }\n if (value < 0){ value = Math.max(Math.min(value, neg_max), neg_min); }\n return value;\n };\n\n // Define default and shifted ranges for all axes\n var ranges = {};\n if (this.x_extent){\n var base_x_range = { start: 0, end: this.layout.cliparea.width };\n if (this.layout.axes.x.range){\n base_x_range.start = this.layout.axes.x.range.start || base_x_range.start;\n base_x_range.end = this.layout.axes.x.range.end || base_x_range.end;\n }\n ranges.x = [base_x_range.start, base_x_range.end];\n ranges.x_shifted = [base_x_range.start, base_x_range.end];\n }\n if (this.y1_extent){\n var base_y1_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y1.range){\n base_y1_range.start = this.layout.axes.y1.range.start || base_y1_range.start;\n base_y1_range.end = this.layout.axes.y1.range.end || base_y1_range.end;\n }\n ranges.y1 = [base_y1_range.start, base_y1_range.end];\n ranges.y1_shifted = [base_y1_range.start, base_y1_range.end];\n }\n if (this.y2_extent){\n var base_y2_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y2.range){\n base_y2_range.start = this.layout.axes.y2.range.start || base_y2_range.start;\n base_y2_range.end = this.layout.axes.y2.range.end || base_y2_range.end;\n }\n ranges.y2 = [base_y2_range.start, base_y2_range.end];\n ranges.y2_shifted = [base_y2_range.start, base_y2_range.end];\n }\n\n // Shift ranges based on any drag or zoom interactions currently underway\n if (this.parent.interaction.panel_id && (this.parent.interaction.panel_id === this.id || this.parent.interaction.linked_panel_ids.indexOf(this.id) !== -1)){\n var anchor, scalar = null;\n if (this.parent.interaction.zooming && typeof this.x_scale == \"function\"){\n var current_extent_size = Math.abs(this.x_extent[1] - this.x_extent[0]);\n var current_scaled_extent_size = Math.round(this.x_scale.invert(ranges.x_shifted[1])) - Math.round(this.x_scale.invert(ranges.x_shifted[0]));\n var zoom_factor = this.parent.interaction.zooming.scale;\n var potential_extent_size = Math.floor(current_scaled_extent_size * (1 / zoom_factor));\n if (zoom_factor < 1 && !isNaN(this.parent.layout.max_region_scale)){\n zoom_factor = 1 /(Math.min(potential_extent_size, this.parent.layout.max_region_scale) / current_scaled_extent_size);\n } else if (zoom_factor > 1 && !isNaN(this.parent.layout.min_region_scale)){\n zoom_factor = 1 / (Math.max(potential_extent_size, this.parent.layout.min_region_scale) / current_scaled_extent_size);\n }\n var new_extent_size = Math.floor(current_extent_size * zoom_factor);\n anchor = this.parent.interaction.zooming.center - this.layout.margin.left - this.layout.origin.x;\n var offset_ratio = anchor / this.layout.cliparea.width;\n var new_x_extent_start = Math.max(Math.floor(this.x_scale.invert(ranges.x_shifted[0]) - ((new_extent_size - current_scaled_extent_size) * offset_ratio)), 1);\n ranges.x_shifted = [ this.x_scale(new_x_extent_start), this.x_scale(new_x_extent_start + new_extent_size) ];\n } else if (this.parent.interaction.dragging){\n switch (this.parent.interaction.dragging.method){\n case \"background\":\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n break;\n case \"x_tick\":\n if (d3.event && d3.event.shiftKey){\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n } else {\n anchor = this.parent.interaction.dragging.start_x - this.layout.margin.left - this.layout.origin.x;\n scalar = constrain(anchor / (anchor + this.parent.interaction.dragging.dragged_x), 3);\n ranges.x_shifted[0] = 0;\n ranges.x_shifted[1] = Math.max(this.layout.cliparea.width * (1 / scalar), 1);\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n var y_shifted = \"y\" + this.parent.interaction.dragging.method[1] + \"_shifted\";\n if (d3.event && d3.event.shiftKey){\n ranges[y_shifted][0] = this.layout.cliparea.height + this.parent.interaction.dragging.dragged_y;\n ranges[y_shifted][1] = +this.parent.interaction.dragging.dragged_y;\n } else {\n anchor = this.layout.cliparea.height - (this.parent.interaction.dragging.start_y - this.layout.margin.top - this.layout.origin.y);\n scalar = constrain(anchor / (anchor - this.parent.interaction.dragging.dragged_y), 3);\n ranges[y_shifted][0] = this.layout.cliparea.height;\n ranges[y_shifted][1] = this.layout.cliparea.height - (this.layout.cliparea.height * (1 / scalar));\n }\n }\n }\n }\n\n // Generate scales and ticks for all axes, then render them\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!this[axis + \"_extent\"]){ return; }\n\n // Base Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"])\n .range(ranges[axis + \"_shifted\"]);\n\n // Shift the extent\n this[axis + \"_extent\"] = [\n this[axis + \"_scale\"].invert(ranges[axis][0]),\n this[axis + \"_scale\"].invert(ranges[axis][1])\n ];\n\n // Finalize Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"]).range(ranges[axis]);\n\n // Render axis (and generate ticks as needed)\n this.renderAxis(axis);\n }.bind(this));\n\n // Establish mousewheel zoom event handers on the panel (namespacing not passed through by d3, so not used here)\n if (this.layout.interaction.scroll_to_zoom){\n var zoom_handler = function(){\n // Look for a shift key press while scrolling to execute.\n // If not present, gracefully raise a notification and allow conventional scrolling\n if (!d3.event.shiftKey){\n if (this.parent.canInteract(this.id)){\n this.loader.show(\"Press [SHIFT] while scrolling to zoom\").hide(1000);\n }\n return;\n }\n d3.event.preventDefault();\n if (!this.parent.canInteract(this.id)){ return; }\n var coords = d3.mouse(this.svg.container.node());\n var delta = Math.max(-1, Math.min(1, (d3.event.wheelDelta || -d3.event.detail || -d3.event.deltaY)));\n if (delta === 0){ return; }\n this.parent.interaction = {\n panel_id: this.id,\n linked_panel_ids: this.getLinkedPanelIds(\"x\"),\n zooming: {\n scale: (delta < 1) ? 0.9 : 1.1,\n center: coords[0]\n }\n };\n this.render();\n this.parent.interaction.linked_panel_ids.forEach(function(panel_id){\n this.parent.panels[panel_id].render();\n }.bind(this));\n if (this.zoom_timeout !== null){ clearTimeout(this.zoom_timeout); }\n this.zoom_timeout = setTimeout(function(){\n this.parent.interaction = {};\n this.parent.applyState({ start: this.x_extent[0], end: this.x_extent[1] });\n }.bind(this), 500);\n }.bind(this);\n this.zoom_listener = d3.behavior.zoom();\n this.svg.container.call(this.zoom_listener)\n .on(\"wheel.zoom\", zoom_handler)\n .on(\"mousewheel.zoom\", zoom_handler)\n .on(\"DOMMouseScroll.zoom\", zoom_handler);\n }\n\n // Render data layers in order by z-index\n this.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n this.data_layers[data_layer_id].draw().render();\n }.bind(this));\n\n return this;\n};\n\n\n/**\n * Render ticks for a particular axis\n * @param {('x'|'y1'|'y2')} axis The identifier of the axes\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.renderAxis = function(axis){\n\n if ([\"x\", \"y1\", \"y2\"].indexOf(axis) === -1){\n throw(\"Unable to render axis; invalid axis identifier: \" + axis);\n }\n\n var canRender = this.layout.axes[axis].render\n && typeof this[axis + \"_scale\"] == \"function\"\n && !isNaN(this[axis + \"_scale\"](0));\n\n // If the axis has already been rendered then check if we can/can't render it\n // Make sure the axis element is shown/hidden to suit\n if (this[axis+\"_axis\"]){\n this.svg.container.select(\"g.lz-axis.lz-\"+axis).style(\"display\", canRender ? null : \"none\");\n }\n\n if (!canRender){ return this; }\n\n // Axis-specific values to plug in where needed\n var axis_params = {\n x: {\n position: \"translate(\" + this.layout.margin.left + \",\" + (this.layout.height - this.layout.margin.bottom) + \")\",\n orientation: \"bottom\",\n label_x: this.layout.cliparea.width / 2,\n label_y: (this.layout.axes[axis].label_offset || 0),\n label_rotate: null\n },\n y1: {\n position: \"translate(\" + this.layout.margin.left + \",\" + this.layout.margin.top + \")\",\n orientation: \"left\",\n label_x: -1 * (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n },\n y2: {\n position: \"translate(\" + (this.layout.width - this.layout.margin.right) + \",\" + this.layout.margin.top + \")\",\n orientation: \"right\",\n label_x: (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n }\n };\n\n // Generate Ticks\n this[axis + \"_ticks\"] = this.generateTicks(axis);\n\n // Determine if the ticks are all numbers (d3-automated tick rendering) or not (manual tick rendering)\n var ticksAreAllNumbers = (function(ticks){\n for (var i = 0; i < ticks.length; i++){\n if (isNaN(ticks[i])){\n return false;\n }\n }\n return true;\n })(this[axis+\"_ticks\"]);\n\n // Initialize the axis; set scale and orientation\n this[axis+\"_axis\"] = d3.svg.axis().scale(this[axis+\"_scale\"]).orient(axis_params[axis].orientation).tickPadding(3);\n\n // Set tick values and format\n if (ticksAreAllNumbers){\n this[axis+\"_axis\"].tickValues(this[axis+\"_ticks\"]);\n if (this.layout.axes[axis].tick_format === \"region\"){\n this[axis+\"_axis\"].tickFormat(function(d) { return LocusZoom.positionIntToString(d, 6); });\n }\n } else {\n var ticks = this[axis+\"_ticks\"].map(function(t){\n return(t[axis.substr(0,1)]);\n });\n this[axis+\"_axis\"].tickValues(ticks)\n .tickFormat(function(t, i) { return this[axis+\"_ticks\"][i].text; }.bind(this));\n }\n\n // Position the axis in the SVG and apply the axis construct\n this.svg[axis+\"_axis\"]\n .attr(\"transform\", axis_params[axis].position)\n .call(this[axis+\"_axis\"]);\n\n // If necessary manually apply styles and transforms to ticks as specified by the layout\n if (!ticksAreAllNumbers){\n var tick_selector = d3.selectAll(\"g#\" + this.getBaseId().replace(\".\",\"\\\\.\") + \"\\\\.\" + axis + \"_axis g.tick\");\n var panel = this;\n tick_selector.each(function(d, i){\n var selector = d3.select(this).select(\"text\");\n if (panel[axis+\"_ticks\"][i].style){\n selector.style(panel[axis+\"_ticks\"][i].style);\n }\n if (panel[axis+\"_ticks\"][i].transform){\n selector.attr(\"transform\", panel[axis+\"_ticks\"][i].transform);\n }\n });\n }\n\n // Render the axis label if necessary\n var label = this.layout.axes[axis].label || null;\n if (label !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"x\", axis_params[axis].label_x).attr(\"y\", axis_params[axis].label_y)\n .text(LocusZoom.parseFields(this.state, label));\n if (axis_params[axis].label_rotate !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"transform\", \"rotate(\" + axis_params[axis].label_rotate + \" \" + axis_params[axis].label_x + \",\" + axis_params[axis].label_y + \")\");\n }\n }\n\n // Attach interactive handlers to ticks as needed\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (this.layout.interaction[\"drag_\" + axis + \"_ticks_to_scale\"]){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var tick_mouseover = function(){\n if (typeof d3.select(this).node().focus == \"function\"){ d3.select(this).node().focus(); }\n var cursor = (axis === \"x\") ? \"ew-resize\" : \"ns-resize\";\n if (d3.event && d3.event.shiftKey){ cursor = \"move\"; }\n d3.select(this)\n .style({\"font-weight\": \"bold\", \"cursor\": cursor})\n .on(\"keydown\" + namespace, tick_mouseover)\n .on(\"keyup\" + namespace, tick_mouseover);\n };\n this.svg.container.selectAll(\".lz-axis.lz-\" + axis + \" .tick text\")\n .attr(\"tabindex\", 0) // necessary to make the tick focusable so keypress events can be captured\n .on(\"mouseover\" + namespace, tick_mouseover)\n .on(\"mouseout\" + namespace, function(){\n d3.select(this).style({\"font-weight\": \"normal\"});\n d3.select(this).on(\"keydown\" + namespace, null).on(\"keyup\" + namespace, null);\n })\n .on(\"mousedown\" + namespace, function(){\n this.parent.startDrag(this, axis + \"_tick\");\n }.bind(this));\n }\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Force the height of this panel to the largest absolute height of the data in\n * all child data layers (if not null for any child data layers)\n * @param {number} [target_height] A target height, which will be used in situations when the expected height can be\n * pre-calculated (eg when the layers are transitioning)\n */\nLocusZoom.Panel.prototype.scaleHeightToData = function(target_height){\n target_height = +target_height || null;\n if (target_height === null){\n this.data_layer_ids_by_z_index.forEach(function(id){\n var dh = this.data_layers[id].getAbsoluteDataHeight();\n if (+dh){\n if (target_height === null){ target_height = +dh; }\n else { target_height = Math.max(target_height, +dh); }\n }\n }.bind(this));\n }\n if (+target_height){\n target_height += +this.layout.margin.top + +this.layout.margin.bottom;\n this.setDimensions(this.layout.width, target_height);\n this.parent.setDimensions();\n this.parent.panel_ids_by_y_index.forEach(function(id){\n this.parent.panels[id].layout.proportional_height = null;\n }.bind(this));\n this.parent.positionPanels();\n }\n};\n\n/**\n * Methods to set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n */\nLocusZoom.Panel.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setElementStatusByFilters(status, toggle, filters, exclusive);\n }.bind(this));\n};\n/**\n * Set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n */\nLocusZoom.Panel.prototype.setAllElementStatus = function(status, toggle){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(status, toggle);\n }.bind(this));\n};\n// TODO: Capture documentation for dynamically generated methods\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.Panel.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.Panel.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.Panel.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.Panel.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n\n/**\n * Add a \"basic\" loader to a panel\n * This method is just a shortcut for adding the most commonly used type of loading indicator, which appears when\n * data is requested, animates (e.g. shows an infinitely cycling progress bar as opposed to one that loads from\n * 0-100% based on actual load progress), and disappears when new data is loaded and rendered.\n *\n *\n * @param {Boolean} show_immediately\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.addBasicLoader = function(show_immediately){\n if (typeof show_immediately != \"undefined\"){ show_immediately = true; }\n if (show_immediately){\n this.loader.show(\"Loading...\").animate();\n }\n this.on(\"data_requested\", function(){\n this.loader.show(\"Loading...\").animate();\n }.bind(this));\n this.on(\"data_rendered\", function(){\n this.loader.hide();\n }.bind(this));\n return this;\n};\n"]} \ No newline at end of file diff --git a/dist/locuszoom.css b/dist/locuszoom.css index 8018c848..a21196a6 100644 --- a/dist/locuszoom.css +++ b/dist/locuszoom.css @@ -109,15 +109,11 @@ svg.lz-locuszoom { stroke-opacity: 1; stroke-width: 1px; } svg.lz-locuszoom rect.lz-data_layer-genes.lz-boundary { - stroke: #363696; stroke-opacity: 1; - stroke-width: 1px; - fill: #000099; } + stroke-width: 1px; } svg.lz-locuszoom rect.lz-data_layer-genes.lz-exon { - stroke: #363696; stroke-opacity: 1; - stroke-width: 1px; - fill: #000099; } + stroke-width: 1px; } svg.lz-locuszoom g.lz-data_layer-intervals-faded { opacity: 0.1; } svg.lz-locuszoom g.lz-data_layer-intervals-hidden { diff --git a/examples/aggregation_tests.html b/examples/aggregation_tests.html new file mode 100644 index 00000000..244f1c8e --- /dev/null +++ b/examples/aggregation_tests.html @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LocusZoom.js ~ Aggregation Tests + + + + + + +
      + +
      +

      LocusZoom.js

      + +

      Aggregation Tests Demonstration

      +
      < return home
      + +
      + +

      + This page demonstrates a mechanism for performing custom aggregation tests interactively, in the web browser. + The user can compare several different hypotheses, with contextual visualization to help summarize and interpret + the results. +

      + +

      + Calculation functionality is provided by raremetal.js. +

      +
      +
      + +
      +

      Build your analysis

      +

      + Specify the mask(s) and type(s) of aggregation test to run, for all genes in a specified plot region. Use + CTRL-click to select more than one mask or test. +

      +
      +
      Loading...
      + +
      +
      + + + +
      +

      References

      +
        +
      • + Feng, S., Liu, D., Zhan, X., Wing, M. K., & Abecasis, G. R. (2014). RAREMETAL: fast and powerful meta-analysis for rare variants. Bioinformatics, 30(19), 2828-2829. (link) +
      • +
      • + Liu, D. J., Peloso, G. M., Zhan, X., Holmen, O. L., Zawistowski, M., Feng, S. et al. (2014). Meta-analysis of gene-level tests for rare variant association. Nat Genet, 46(2), 200-204. (link) +
      • +
      +
      + + +
      + + + + diff --git a/examples/aggregation_tests.png b/examples/aggregation_tests.png new file mode 100644 index 0000000000000000000000000000000000000000..3522a87572085f5c5a97edafc500949c5d491019 GIT binary patch literal 6542 zcma)>cT`hd+Qo0^h;#v^DnyWufb=dcD4^1$1yB&A1?fFVRge}$K$-{&5@`ZbLs5BY z(xvw*9i;bshj(Vpnwd3!e2bK|ZjyV?J?A`o|DMgudpa7F7nm)4kyTTZ z?OxAimICgjFP}`3B$9u8R#sLH<)ka3*`GguE^&y>&+jg^)lEG~61E6O7DZH4 zR6MHjTw{)mjC}1ND=RB^y3?0`%*?{_Y@=Q zrlu5VG+u%$n4U+cVSJp8ot-_h!%<>(sO0fwQERf#hWuYjOKF*zFYxg2Kn-i774dK0 zgr`cPzO}bg^yTVS@K(Hg2eHX|>PJ^KlZ--?l$1mb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UVZG~kHR;k*AG z%l4)yLh`;l??6%uYKc7P?CcDjb#_?(DFybYuzleI}-xkn>5JO5}oGT5Zf%{D zKL%{B3^j=)Cy$_Hd7_7MauPf@F|dey(^dWUVId)e&{Z)p`kOaz<{vvx)(Ns55+-D1 z#DJXd?*V+AYQC$jO$l=u{$ev$?ZIDxn(UOE^iKe70XRM{Ss&dDaOsBC7+~e$Yz^v# z`T0+VLm64q%(kTht+MLkG++4{Ou~-(#7^5O& sVke$sX|i5%(tle!wYW}tb{bC@jGNF-%zm&6{&NB$)O1t}RV;)559v-_D*ylh literal 0 HcmV?d00001 diff --git a/examples/data/aggregation_masks.json b/examples/data/aggregation_masks.json new file mode 100644 index 00000000..e6c3f6ee --- /dev/null +++ b/examples/data/aggregation_masks.json @@ -0,0 +1,22 @@ +{ + "data": [ + { + "dataset": 42, + "analysis": "Demonstration data", + "masks": [ + { + "id": "PTV-NSSTRICT-NSBROAD-AF01", + "description": "PTV & strict & broad & MAF < 0.01", + "groupType": "gene", + "identifier": "ENSEMBL" + }, + { + "id": "PTV-MISSENSE-AF01", + "description": "PTV & missense & MAF < 0.01", + "groupType": "gene", + "identifier": "ENSEMBL" + } + ] + } + ] +} diff --git a/examples/data/scorecov.json b/examples/data/scorecov.json new file mode 100644 index 00000000..f5a6ba0b --- /dev/null +++ b/examples/data/scorecov.json @@ -0,0 +1,331 @@ +{ + "data": { + "variants": [ + { + "variant": "15:58471357_G/A", + "score": 0.124413, + "altFreq": 5.41712e-05, + "pvalue": 0.900989 + }, + { + "variant": "15:59064420_C/T", + "score": 0.727357, + "altFreq": 0.000216685, + "pvalue": 0.716058 + }, + { + "variant": "15:59102517_A/G", + "score": -0.0690145, + "altFreq": 5.41712e-05, + "pvalue": 0.944979 + }, + { + "variant": "15:59144148_C/A", + "score": -0.212575, + "altFreq": 5.41712e-05, + "pvalue": 0.83166 + }, + { + "variant": "15:58834122_C/T", + "score": 1.78855, + "altFreq": 0.000433369, + "pvalue": 0.527008 + }, + { + "variant": "15:58834143_G/A", + "score": 39.5782, + "altFreq": 0.00341278, + "pvalue": 5.64033e-07 + }, + { + "variant": "15:58837989_G/A", + "score": -0.87731, + "altFreq": 0.000108342, + "pvalue": 0.53501 + }, + { + "variant": "15:58840562_G/A", + "score": 4.04614, + "altFreq": 0.000162514, + "pvalue": 0.0194777 + }, + { + "variant": "15:58840706_G/A", + "score": -0.75007, + "altFreq": 5.41712e-05, + "pvalue": 0.453219 + }, + { + "variant": "15:59172276_T/A", + "score": -1.11237, + "altFreq": 0.00379198, + "pvalue": 0.893836 + }, + { + "variant": "15:59189414_C/A", + "score": 0.148281, + "altFreq": 0.000270856, + "pvalue": 0.947118 + }, + { + "variant": "15:59205822_C/T", + "score": -0.18929, + "altFreq": 5.41712e-05, + "pvalue": 0.849868 + }, + { + "variant": "15:58471357_G/A", + "score": 0.124413, + "altFreq": 5.41712e-05, + "pvalue": 0.900989 + }, + { + "variant": "15:59064420_C/T", + "score": 0.727357, + "altFreq": 0.000216685, + "pvalue": 0.716058 + }, + { + "variant": "15:59102517_A/G", + "score": -0.0690145, + "altFreq": 5.41712e-05, + "pvalue": 0.944979 + }, + { + "variant": "15:58834122_C/T", + "score": 1.78855, + "altFreq": 0.000433369, + "pvalue": 0.527008 + }, + { + "variant": "15:58834143_G/A", + "score": 39.5782, + "altFreq": 0.00341278, + "pvalue": 5.64033e-07 + }, + { + "variant": "15:58837989_G/A", + "score": -0.87731, + "altFreq": 0.000108342, + "pvalue": 0.53501 + }, + { + "variant": "15:58840562_G/A", + "score": 4.04614, + "altFreq": 0.000162514, + "pvalue": 0.0194777 + }, + { + "variant": "15:58840706_G/A", + "score": -0.75007, + "altFreq": 5.41712e-05, + "pvalue": 0.453219 + }, + { + "variant": "15:58855748_C/T", + "score": 146.723, + "altFreq": 0.0135428, + "pvalue": 1.49563e-20 + }, + { + "variant": "15:59172276_T/A", + "score": -1.11237, + "altFreq": 0.00379198, + "pvalue": 0.893836 + }, + { + "variant": "15:59189414_C/A", + "score": 0.148281, + "altFreq": 0.000270856, + "pvalue": 0.947118 + }, + { + "variant": "15:59205822_C/T", + "score": -0.18929, + "altFreq": 5.41712e-05, + "pvalue": 0.849868 + } + ], + "groups": [ + { + "nSamples": 9230, + "sigmaSquared": 0.999972, + "variants": [ + "15:58471357_G/A" + ], + "covariance": [ + 0.000108345 + ], + "group": "ENSG00000103569", + "groupType": "gene", + "mask": "PTV-MISSENSE-AF01", + "groupLabel": "AQP9" + }, + { + "nSamples": 9230, + "sigmaSquared": 0.999972, + "variants": [ + "15:59064420_C/T", + "15:59102517_A/G", + "15:59144148_C/A" + ], + "covariance": [ + 0.000433241, + -4.69587e-08, + -4.69587e-08, + 0.000108345, + -1.17397e-08, + 0.000108345 + ], + "group": "ENSG00000128923", + "groupType": "gene", + "mask": "PTV-MISSENSE-AF01", + "groupLabel": "FAM63B" + }, + { + "nSamples": 9230, + "sigmaSquared": 0.999972, + "variants": [ + "15:58834122_C/T", + "15:58834143_G/A", + "15:58837989_G/A", + "15:58840562_G/A", + "15:58840706_G/A" + ], + "covariance": [ + 0.000866106, + -5.91679e-06, + -1.87835e-07, + -2.81752e-07, + -9.39174e-08, + 0.00677991, + -1.4792e-06, + -2.2188e-06, + -7.39599e-07, + 0.000216667, + -7.0438e-08, + -2.34793e-08, + 0.000324966, + -3.5219e-08, + 0.000108345 + ], + "group": "ENSG00000166035", + "groupType": "gene", + "mask": "PTV-MISSENSE-AF01", + "groupLabel": "LIPC" + }, + { + "nSamples": 9230, + "sigmaSquared": 0.999972, + "variants": [ + "15:59172276_T/A", + "15:59189414_C/A", + "15:59205822_C/T" + ], + "covariance": [ + 0.00752748, + -4.10888e-06, + -8.21777e-07, + 0.000541492, + -5.86984e-08, + 0.000108345 + ], + "group": "ENSG00000137776", + "groupType": "gene", + "mask": "PTV-MISSENSE-AF01", + "groupLabel": "SLTM" + }, + { + "nSamples": 9230, + "sigmaSquared": 0.999972, + "variants": [ + "15:58471357_G/A" + ], + "covariance": [ + 0.000108345 + ], + "group": "ENSG00000103569", + "groupType": "gene", + "mask": "PTV-NSSTRICT-NSBROAD-AF01", + "groupLabel": "AQP9" + }, + { + "nSamples": 9230, + "sigmaSquared": 0.999972, + "variants": [ + "15:59064420_C/T", + "15:59102517_A/G" + ], + "covariance": [ + 0.000433241, + -4.69587e-08, + 0.000108345 + ], + "group": "ENSG00000128923", + "groupType": "gene", + "mask": "PTV-NSSTRICT-NSBROAD-AF01", + "groupLabel": "FAM63B" + }, + { + "nSamples": 9230, + "sigmaSquared": 0.999972, + "variants": [ + "15:58834122_C/T", + "15:58834143_G/A", + "15:58837989_G/A", + "15:58840562_G/A", + "15:58840706_G/A", + "15:58855748_C/T" + ], + "covariance": [ + 0.000866106, + -5.91679e-06, + -1.87835e-07, + -2.81752e-07, + -9.39174e-08, + -2.34793e-05, + 0.00677991, + -1.4792e-06, + -2.2188e-06, + -7.39599e-07, + -7.65426e-05, + 0.000216667, + -7.0438e-08, + -2.34793e-08, + -5.86984e-06, + 0.000324966, + -3.5219e-08, + -8.80475e-06, + 0.000108345, + -2.93492e-06, + 0.0270057 + ], + "group": "ENSG00000166035", + "groupType": "gene", + "mask": "PTV-NSSTRICT-NSBROAD-AF01", + "groupLabel": "LIPC" + }, + { + "nSamples": 9230, + "sigmaSquared": 0.999972, + "variants": [ + "15:59172276_T/A", + "15:59189414_C/A", + "15:59205822_C/T" + ], + "covariance": [ + 0.00752748, + -4.10888e-06, + -8.21777e-07, + 0.000541492, + -5.86984e-08, + 0.000108345 + ], + "group": "ENSG00000137776", + "groupType": "gene", + "mask": "PTV-NSSTRICT-NSBROAD-AF01", + "groupLabel": "SLTM" + } + ] + } +} diff --git a/examples/js/aggregation-test-helpers.js b/examples/js/aggregation-test-helpers.js new file mode 100644 index 00000000..9c2d479d --- /dev/null +++ b/examples/js/aggregation-test-helpers.js @@ -0,0 +1,170 @@ +"use strict"; +/* global raremetal, Q */ + +/* + * LocusZoom extensions used to calculate and render aggregation test results. Because these calculations depend on an + * external library, the special data sources are defined here, rather than in LocusZoom core code. + */ + +/** + * Data Source that calculates gene or region-based tests based on provided data + * It will rarely be used by itself, but rather using a connector that attaches the results to data from + * another source (like genes). Using a separate connector allows us to add caching and run this front-end + * calculation only once, while using it in many different places + * @public + * @class + * @augments LocusZoom.Data.Source + */ +LocusZoom.Data.AggregationTestSource = LocusZoom.Data.Source.extend(function (init) { + this.parseInit(init); +}, "AggregationTestSourceLZ"); + +LocusZoom.Data.AggregationTestSource.prototype.getURL = function (state, chain, fields) { + // Unlike most sources, calculations may require access to plot state data even after the initial request + // This example source REQUIRES that the external UI widget would store the needed test definitions in a plot state + // field called `aggregation_tests` (an object {masks: [], calcs: {}) + // TODO: In the future, getURL will need to account for the specific masks selected by an external widget (when requesting covar data) + var required_info = state.aggregation_tests || {}; + + if (!chain.header) {chain.header = {};} + chain.header.aggregation_calcs = required_info.calcs || {}; + chain.header.aggregation_masks = required_info.masks || []; + return this.url; +}; + +LocusZoom.Data.AggregationTestSource.prototype.annotateData = function (records, chain) { + // Operate on the calculated results. The result of this method will be added to chain.discrete + + // In a page using live API data, the UI would only request the masks it needs from the API. + // But in our demos, sometimes boilerplate JSON has more masks than the UI asked for. Limit what calcs we run (by + // type, and to the set of groups requested by the user) + records.groups = records.groups.filter(function(item) {return item.groupType === "gene"; }); + + var parsed = raremetal.helpers.parsePortalJSON(records); + var groups = parsed[0]; + var variants = parsed[1]; + + groups = groups.byMask(chain.header.aggregation_masks); + + var calcs = chain.header.aggregation_calcs; + + if (!calcs || Object.keys(calcs).length === 0) { + // If no calcs have been requested, then return a dummy placeholder immediately + return { variants: [], groups: [], results: [] }; + } + var runner = new raremetal.helpers.PortalTestRunner(groups, variants, calcs); + var res = runner.toJSON(); + return res.data; +}; + +LocusZoom.Data.AggregationTestSource.prototype.normalizeResponse = function(data) { return data; }; + +LocusZoom.Data.AggregationTestSource.prototype.combineChainBody = function (records, chain) { + // aggregation tests are a bit unique, in that the data is rarely used directly- instead it is used to annotate many + // other layers in different ways. The calculated result has been added to `chain.discrete`, but will not be returned + // as part of the response body built up by the chain + return chain.body; +}; + + +/** + * A custom data source that reformats existing association data, rather than requesting new data from the server. + * In this case, aggregation test calculations have already made data about variants available, and that data only + * needs to be reformatted to work with the association data layer. + * + * @public + * @class + * @augments LocusZoom.Data.Source + */ +LocusZoom.KnownDataSources.extend("AssociationLZ", "AssocFromAggregationLZ", { + parseInit: function (init) { + if (!init || !init.from) { + throw "Must specify the name of the source that contains association data"; + } + this.params = init.params || {}; + this._from = init.from; + }, + + getRequest: function (state, chain, fields) { + // Does not actually make a request. Just pick off the specific bundle of data from a known payload structure. + if (chain.discrete && !chain.discrete[this._from]) { + throw self.constructor.SOURCE_NAME + " cannot be used before loading required data for: " + this._from; + } + // Copy the data so that mutations (like sorting) don't affect the original + return Q.when(JSON.parse(JSON.stringify(chain.discrete[this._from]["variants"]))); + }, + + normalizeResponse: function (data) { + // The payload structure of the association source is slightly different than the one required by association + // plots. For example, we need to parse variant names and convert to log_pvalue + var REGEX_EPACTS = new RegExp("(?:chr)?(.+):(\\d+)_?(\\w+)?/?([^_]+)?_?(.*)?"); // match API variant strings + return data.map(function(one_variant) { + var match = one_variant.variant.match(REGEX_EPACTS); + return { + variant: one_variant.variant, + chromosome: match[1], + position: +match[2], + ref_allele: match[3], + ref_allele_freq: 1 - one_variant.altFreq, + log_pvalue: -Math.log10(one_variant.pvalue) + }; + }).sort(function (a, b) { + a = a.variant; + b = b.variant; + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + // names must be equal + return 0; + } + }); + } +}); + + + +/** + * A sample connector that aligns calculated aggregation test data with corresponding gene information. Returns a body + * suitable for use with the genes datalayer. + * + * To use this source, one must specify a fields array that calls first the genes source, then a dummy field from + * this source. The output will be to transparently add several new fields to the genes data. + * @public + * @class + * @augments LocusZoom.Data.Source + */ +LocusZoom.KnownDataSources.extend("ConnectorSource", "GeneAggregationConnectorLZ", { + REQUIRED_SOURCES: ["gene_ns", "aggregation_ns"], + combineChainBody: function (data, chain) { + // The genes layer receives all results, and displays only the best pvalue for each gene + + // Tie the calculated group-test results to genes with a matching name + var aggregation_source_id = this._source_name_mapping["aggregation_ns"]; + var gene_source_id = this._source_name_mapping["gene_ns"]; + // This connector assumes that genes are the main body of records from the chain, and that aggregation tests are + // a standalone source that has not acted on genes data yet + var aggregationData = chain.discrete[aggregation_source_id]; + var genesData = chain.discrete[gene_source_id]; + + var groupedAggregation = {}; // Group together all tests done on that gene- any mask, any test + + aggregationData.groups.forEach(function(result) { + if (!groupedAggregation.hasOwnProperty(result.group)) { + groupedAggregation[result.group] = []; + } + groupedAggregation[result.group].push(result.pvalue); + }); + + // Annotate any genes that have test results + genesData.forEach(function (gene) { + var gene_id = gene.gene_id.split(".")[0]; + var tests = groupedAggregation[gene_id]; + if (tests) { + gene.aggregation_best_pvalue = Math.min.apply(null, tests); + } + }); + return genesData; + } +}); diff --git a/examples/js/aggregation-tests-example-page.js b/examples/js/aggregation-tests-example-page.js new file mode 100644 index 00000000..9ed1431b --- /dev/null +++ b/examples/js/aggregation-tests-example-page.js @@ -0,0 +1,498 @@ +/** + Custom code used to demonstrate interactive page widget features in the aggregation test visualization example + */ +"use strict"; + +/* global $, raremetal */ +/* eslint-disable no-unused-vars */ + + +var Observable = function () { // Allow UI elements to monitor changes in a variable + // Very simplified observable: a() to get value, a(val) to set, a.subscribe(fn) to add handlers + var _subscribers = []; + var current_value; + var handle_value = function (value) { + if (value === undefined) { return current_value; } + if(current_value !== value) { + current_value = value; + _subscribers.forEach(function(handler) { + try { + handler(value); + } catch (error) { + console.error(error); + } + }); + } + }; + handle_value.subscribe = function (handler) { _subscribers.push(handler); }; + return handle_value; +}; + +// Make a custom layout object +function customizePlotLayout (layout) { + // Customize an existing plot layout with the data for aggregation tests + // Customize layout: + // 1. The association panel must pull from aggregation tests in order to draw on that data + // 2. Genes layer must pull from the aggregation source + the aggregation_genes connector if we want to color + // the gene track by aggregation test results + + var assocLayout = layout.panels[0].data_layers[2]; + assocLayout.fields.unshift("aggregation: all"); + + var genesLayout = layout.panels[1].data_layers[0]; + genesLayout.namespace["aggregation"] = "aggregation"; + genesLayout.namespace["aggregation_genes"] = "aggregation_genes"; + genesLayout.fields.push("aggregation:all", "aggregation_genes:all"); + var colorConfig = [ + { + scale_function: "if", + field: "aggregation_best_pvalue", + parameters: { + field_value: null, + then: "#B8B8B8" + } + }, + { + scale_function: "numerical_bin", + field: "aggregation_best_pvalue", + parameters: { // Default significance threshold is based on 20k human protein coding genes + breaks: [0, 0.05 / 20000], + values: ["#d43f3a", "#357ebd"] + } + } + ]; + genesLayout.color = colorConfig; + genesLayout.stroke = colorConfig; + + // The demo does not have real covariance data, and therefore only works on a narrow plot region. Lock all panels + // to prevent scrolling + layout.panels.forEach(function(panel_layout) { + panel_layout.interaction = { + drag_background_to_pan: false, + drag_x_ticks_to_scale: false, + drag_y1_ticks_to_scale: false, + drag_y2_ticks_to_scale: false, + scroll_to_zoom: false, + x_linked: false + }; + }); + return layout; +} + +function _formatSciNotation (cell, params) { + // Tabulator cell formatter using sci notation + var value = cell.getValue(); + return LocusZoom.TransformationFunctions.get("scinotation")(value); +} + +// Controllers for page widgets + +/** + * A minimal method of defining aggregation tests in the absence of a UI framework. Proof of concept, ONLY- not intended + * for production use. (generating HTML via jquery is rather ugly, but it keeps the examples relatively portable) + * @class + * @param {string|object} selector A jquery selector or element name specifying where to draw the widget + * @param {String[]} mask_names What masks are allowed + * @param {String[]} [aggregation_names] What tests are recognized. + */ +var AggregationTestBuilder = LocusZoom.subclass(function() {}, { + constructor: function(selector, mask_names, aggregation_names) { + // Store the options used to populate the dropdown + this._mask_names = mask_names; + this._aggregation_types = aggregation_names || [ // Defaults (correspond to hard-coded serialization logic) + ["burden", "Burden"], + ["skat", "SKAT"] + ]; + + if (typeof selector === "string") { + selector = $(selector); + } + + selector.html(""); + this._container = selector; + this._aggregation_spec_list_container = $("
      ").appendTo(selector); + + // Make sure that at least one set of test-description input elements appears on first render + this.addControls(); + this._status_div = $("
      ").css("color", "red;").appendTo(selector); + }, + + addControls: function() { + // Build these fragments once and reuse + var _mask_choices = this.__render_selection("mask_choice", this._mask_names); // Assume this comes from an API / remote source + var _calc_choices = this.__render_checkboxes("calc_choice", this._aggregation_types); + + this._aggregation_spec_list_container.append(this.__form_row("Select mask(s)", _mask_choices)); + this._aggregation_spec_list_container.append(this.__form_row("Select test(s)", _calc_choices)); + }, + + // Display a (styled) status message to the user. Default styling is an error message. + setStatus: function (message, css) { + css = css || { color: "red" }; + this._status_div + .text(message || "") + .css(css); + }, + + __form_row: function (label_text, controls_el) { + var row = $("
      ", {class: "row"}); + var label = $("
      ", {class: "two columns"}).css("font-weight", "bold").text(label_text); + var content = $("
      ", {class: "ten columns"}); + content.append(controls_el); + row.append(label, content); + return row; + }, + + /** + * + * @param {String} name The name of the select menu + * @param {String[]} options An array where each element specifies [value, displayName] + * @private + */ + __render_selection: function (name, options) { + var htmlescape = LocusZoom.TransformationFunctions.get("htmlescape"); + var element = $("", { name: name, size: 5 }).prop("multiple", true).css("height", "auto"); + + options = options.slice(); + + options.forEach(function(option) { + var value; + var displayName; + if (Array.isArray(option)) { // Optionally specify a second, human readable name + value = option[0]; + displayName = option[1]; + } else { + value = displayName = option; + } + var choice = $("" , { value: htmlescape(value) }).text(displayName); + element.append(choice); + }); + return element; + }, + + /** + * + * @param {String} name The name attribute for all checkboxes in this group + * @param {String[]} options An array where each element specifies [value, displayName] + * @return {Element} + * @private + */ + __render_checkboxes: function(name, options) { + var htmlescape = LocusZoom.TransformationFunctions.get("htmlescape"); + var element = $("
      "); + + options = options.slice(); + options.forEach(function(option) { + var value; + var displayName; + if (Array.isArray(option)) { // Optionally specify a second, human readable name + value = option[0]; + displayName = option[1]; + } else { + value = displayName = option; + } + var wrapper = $("").css("display", "inline"); + var control = $("", { type: "checkbox", name: name, value: htmlescape(value) }); + var label = $("", { class: "label-body"}).text(displayName); + + wrapper.append(control, label); + element.append(wrapper); + }); + return element; + }, + + /** + * Must select at least one item from each box + * @returns {boolean} + */ + validate: function(calcs, masks) { + // all test names unique across tests + all fields filled in + calcs = calcs || this.getCalcs(); + masks = masks || this.getMasks(); + return calcs.length && masks.length; + }, + + getMasks: function() { + var masks = this._aggregation_spec_list_container.find("[name='mask_choice']").find(":selected"); + return masks.map(function() { return this.value; }).get(); + }, + + getCalcs: function() { + var masks = this._aggregation_spec_list_container.find("[name='calc_choice']:checked"); + return masks.map(function() { return this.value; }).get(); + } +}); + +/** + * Define shared functionality for all tables, providing helper methods to control the tabulator + * table library + * @class + */ +var GenericTabulatorTableController = LocusZoom.subclass(function() {}, { + /** + * + * @param {string|Object} selector A selector string for the table container + * @param {object} table_config An object specifying the tabulator layout for this table + */ + constructor: function(selector, table_config) { + if (typeof selector === "string") { + selector = $(selector); + } + this.selector = selector; + this._table_config = table_config; + + this.selector.tabulator(this._table_config); + }, + + /** + * Callback that takes in data and renders an HTML table to a hardcoded document location + * @param {object} data + */ + _tableUpdateData: function (data) { + this.selector.tabulator("setData", data); + }, + + /** + * Stub. Override this method to transform the data in ways specific to this table. + * @param data + * @returns {*} + */ + prepareData: function (data) { return data; }, + + renderData: function(data) { + data = this.prepareData(data); + this._tableUpdateData(data); + }, + + tableSetFilter: function (column, value) { + this.selector.tabulator("setFilter", column, "=", value); + }, + + tableClearFilter: function (column, value) { + if (typeof value !== "undefined") { + this.selector.tabulator("removeFilter", column, "=", value); + } else { + this.selector.tabulator("clearFilter"); + } + + }, + + tableDownloadData: function(filename, format) { + format = format || "csv"; + this.selector.tabulator("download", format, filename); + } +}); + +var AggregationTableController = LocusZoom.subclass(GenericTabulatorTableController, { + prepareData: function (data) { + return data.groups.data; // Render function only needs a part of the "computed results" JSON it is given + } +}); + +var VariantsTableController = LocusZoom.subclass(GenericTabulatorTableController, {}); + +/** + * Creates the plot and tables. This function contains references to specific DOM elements on one HTML page. + * @param {Observable|function} label_store Observable used to label the selected group + * @param {Object} [context=window] A reference to the widgets will be added here, allowing them to be accessed + * outside the function later (eg for debugging purposes) + */ +function createDisplayWidgets(label_store, context) { + context = context || window; + + // Determine if we're online, based on browser state or presence of an optional query parameter + var online = !(typeof navigator !== "undefined" && !navigator.onLine); + if (window.location.search.indexOf("offline") !== -1) { + online = false; + } + + // Specify the data sources to use, then build the plot + var apiBase = "//portaldev.sph.umich.edu/api/v1/"; + var data_sources = new LocusZoom.DataSources() + .add("aggregation", ["AggregationTestSourceLZ", {url: "data/scorecov.json"}]) + .add("assoc", ["AssocFromAggregationLZ", { // Use a special source that restructures already-fetched data + from: "aggregation", + params: { id_field: "variant" } + }]) + .add("ld", ["LDLZ", {url: apiBase + "pair/LD/"}]) + .add("gene", ["GeneLZ", {url: apiBase + "annotation/genes/", params: {source: 2}}]) + .add("aggregation_genes", ["GeneAggregationConnectorLZ", {sources: {aggregation_ns: "aggregation", gene_ns: "gene"}}]) + .add("recomb", ["RecombLZ", {url: apiBase + "annotation/recomb/results/", params: {source: 15}}]) + .add("constraint", ["GeneConstraintLZ", {url: "http://exac.broadinstitute.org/api/constraint"}]); // FIXME: use https when exac fixed + + var initialState = {chr: 15, start: 58384122, end: 59305748}; + var layout = LocusZoom.Layouts.get("plot", "standard_association", {state: initialState}); + layout = customizePlotLayout(layout); + + var plot = LocusZoom.populate("#lz-plot", data_sources, layout); + + var TABLE_SELECTOR_AGGREGATION = "#results-table-aggregation"; + var TABLE_SELECTOR_VARIANTS = "#results-table-variants"; + + var aggregationTable = new AggregationTableController(TABLE_SELECTOR_AGGREGATION, { + index: "id", + height: 300, + layout: "fitColumns", + layoutColumnsOnNewData: true, + rowSelected: function(row) { + label_store(row.row.data); // Tabulator doesn't allow changing options after creation + }, + rowDeselected: function () { + label_store(null); + }, + columns: [ + { + title: "Gene", field: "group", formatter: "link", + // TODO: exac gives timeouts if we use https + formatterParams: { urlPrefix: "http://exac.broadinstitute.org/gene/", labelField: "group_display_name" } + }, + { title: "Mask", field: "mask", headerFilter: true }, + { title: "# Variants", field: "variant_count" }, + { title: "Test type", field: "test", headerFilter: true }, + { title: "p-value", field: "pvalue", formatter: _formatSciNotation, sorter: "number" }, + { title: "Statistic", field: "stat", formatter: _formatSciNotation, sorter: "number", visible: false } + ], + placeholder: "No Data Available", + initialSort: [ + { column: "pvalue", dir: "asc" } + ], + selectable: 1, + selectablePersistence: false + }); + + var variantsTable = new VariantsTableController(TABLE_SELECTOR_VARIANTS, { + height: 300, + layout: "fitColumns", + layoutColumnsOnNewData: true, + index: "id", + columns: [ + { title: "Variant", field: "variant" }, + { title: "p-value", field: "pvalue", formatter: _formatSciNotation, sorter: "number" }, + { title: "Alt allele frequency", field: "altFreq", formatter: _formatSciNotation, sorter: "number" } + ], + placeholder: "No Data Available", + initialSort: [ + { column: "variant", dir: "asc" } + ] + }); + + //////////////////////////////// + // Make certain symbols available later in outer scope, eg for debugging + context.data_sources = data_sources; + context.plot = plot; + + context.aggregationTable = aggregationTable; + context.variantsTable = variantsTable; +} + +/** + * Connect a very specific set of widgets together to drive the user experience for this page. + * + * Because many things are clickable, this consists of several small pieces. The key concepts are: + * 1. Allow the plot to tell us when aggregation test results are available. + * 2. Take that data and update a table + * 3. If something important gets clicked, update parts of the view that depend on it + * 4. Have a well-defined way to coordinate many widgets that depend on a common value + * @param plot + * @param aggregationTable + * @param variantsTable + * @param {Observable} resultStorage Observable that holds calculation results + * @param {Observable} labelStorage Observable used to label the selected group + */ +function setupWidgetListeners(plot, aggregationTable, variantsTable, resultStorage, labelStorage) { + plot.on("element_selection", function(eventData) { + // Trigger the aggregation test table to filter (or unfilter) if a specific gene on the genes panel is clicked + if (eventData["sourceID"] !== "lz-plot.genes") { + return; + } + + var gene_column_name = "group"; + var selected_gene = eventData["data"]["element"]["gene_id"]; + selected_gene = selected_gene.split(".")[0]; // Ignore ensemble version on gene ids + + if (eventData["data"]["active"]) { + aggregationTable.tableSetFilter(gene_column_name, selected_gene); + $("#label-no-group-selected").hide(); + $("#label-current-group-selected").show().text(selected_gene); + } else { + $("#label-no-group-selected").show(); + $("#label-current-group-selected").hide(); + aggregationTable.tableClearFilter(gene_column_name, selected_gene); + } + }.bind(this)); + + plot.subscribeToData( + ["aggregation:all", "gene:all"], + function (data) { + // chain.discrete provides distinct data from each source + var gene_source_data = data.gene; + var agg_source_data = data.aggregation; + + var results = agg_source_data.results; + + // Aggregation calcs return very complex data. Parse it here, once, into reusable helper objects. + var parsed = raremetal.helpers.parsePortalJSON(agg_source_data); + var groups = parsed[0]; + var variants = parsed[1]; + + ///////// + // Post-process this data with any annotations required by data tables on this page + + // The aggregation results use the unique ENSEMBL ID for a gene. The gene source tells us how to connect + // that to a human-friendly gene name (as displayed in the LZ plot) + var _genes_lookup = {}; + gene_source_data.forEach(function(gene) { + var gene_id = gene.gene_id.split(".")[0]; // Ignore ensembl version on gene ids + _genes_lookup[gene_id] = gene.gene_name; + }); + groups.data.forEach(function(one_result) { + var this_group = groups.getOne(one_result.mask, one_result.group); + // Add synthetic fields that are not part of the raw calculation results + one_result.group_display_name = _genes_lookup[one_result.group] || one_result.group; + one_result.variant_count = this_group.variants.length; + }); + + // When new data has been received (and post-processed), pass it on to any UI elements that use that data + resultStorage({ + groups: groups, + variants: variants + }); + }, + { discrete: true } + ); + + // When results are updated, make sure we are not "drilling down" into a calculation that no longer exists + resultStorage.subscribe(aggregationTable.renderData.bind(aggregationTable)); + resultStorage.subscribe(labelStorage.bind(null, null)); // just wipe the labels + plot.on("element_selection", labelStorage.bind(null, null)); + + // The UI is based on "drilling down" to explore results. If a user selects a group, display stuff + labelStorage.subscribe(function (data) { // User-friendly label + var text = ""; + if (data) { + text = data.mask + " / " + data.group_display_name; + } + $("#label-mask-selected").text(text); + }); + labelStorage.subscribe(function (data) { // Update the "show me what variants are in a selected group" table + var calcs = resultStorage(); + if (!data || !calcs) { // If no analysis is selected, no analysis should be shown + variantsTable.renderData([]); + return; + } + // When a group is selected, draw a variants table with information about that group. + var one_group = calcs.groups.getOne(data.mask, data.group); + var variant_data = calcs.variants.getGroupVariants(one_group.variants); + variantsTable.renderData(variant_data); + }); + + ////////////////////////////////////////////////////////////// + // Generic UI controls: what to do when buttons are clicked + $("#download-aggregation").on("click", function() { + aggregationTable.tableDownloadData("aggregation-data.csv", "csv"); + }); + + $("#download-variants").on("click", function() { + variantsTable.tableDownloadData("variants-data.csv", "csv"); + }); +} diff --git a/index.html b/index.html index ef8efdcd..45a391f8 100644 --- a/index.html +++ b/index.html @@ -172,6 +172,15 @@
      Credible Sets
      + +
      From e3fd66a47a79939f1b5c619ba2251593a284dd67 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 26 Jun 2018 11:56:29 -0400 Subject: [PATCH 17/19] Simplify default dashboard Remove "region scale" and "pixel dimensions" widgets from default assoc plot layout --- assets/js/app/Layouts.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/assets/js/app/Layouts.js b/assets/js/app/Layouts.js index bca39f6f..18e61b84 100644 --- a/assets/js/app/Layouts.js +++ b/assets/js/app/Layouts.js @@ -550,14 +550,6 @@ LocusZoom.Layouts.add("dashboard", "standard_plot", { subtitle: "v" + LocusZoom.version + "", position: "left" }, - { - type: "dimensions", - position: "right" - }, - { - type: "region_scale", - position: "right" - }, { type: "download", position: "right" From 0520fdc6d2489acea5153af633c7fbeb8135efe5 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 26 Jun 2018 12:00:02 -0400 Subject: [PATCH 18/19] Minor demo polish --- examples/phewas_scatter.html | 5 ++++- index.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/phewas_scatter.html b/examples/phewas_scatter.html index b5ecfd34..22c68b61 100644 --- a/examples/phewas_scatter.html +++ b/examples/phewas_scatter.html @@ -49,7 +49,10 @@

      LocusZoom.js

      -

      PheWAS Demonstration

      +

      PheWAS Demonstration

      +
      < return home
      + +

      A PheWAS visualization displays association p-values between a given genetic variant and multiple phenotypes. diff --git a/index.html b/index.html index 45a391f8..7f3ce613 100644 --- a/index.html +++ b/index.html @@ -185,7 +185,7 @@

      Aggregation Tests
      From fdbcb0d3e6f354f7d4a77349e1a4db24928341f6 Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Tue, 26 Jun 2018 14:06:11 -0400 Subject: [PATCH 19/19] Bump version to 0.8.0 --- dist/locuszoom.app.js | 8 -------- dist/locuszoom.app.js.map | 2 +- dist/locuszoom.app.min.js | 12 ++++++------ dist/locuszoom.app.min.js.map | 2 +- index.html | 10 +++++----- package.json | 2 +- 6 files changed, 14 insertions(+), 22 deletions(-) diff --git a/dist/locuszoom.app.js b/dist/locuszoom.app.js index 8ef1d1da..cee7e4d6 100644 --- a/dist/locuszoom.app.js +++ b/dist/locuszoom.app.js @@ -1568,14 +1568,6 @@ subtitle: 'v' + LocusZoom.version + '', position: 'left' }, - { - type: 'dimensions', - position: 'right' - }, - { - type: 'region_scale', - position: 'right' - }, { type: 'download', position: 'right' diff --git a/dist/locuszoom.app.js.map b/dist/locuszoom.app.js.map index 9fde4f5d..ed695b28 100644 --- a/dist/locuszoom.app.js.map +++ b/dist/locuszoom.app.js.map @@ -1 +1 @@ -{"version":3,"sources":["LocusZoom.js","Layouts.js","DataLayer.js","annotation_track.js","forest.js","genes.js","genome_legend.js","intervals.js","line.js","scatter.js","Singletons.js","Dashboard.js","Legend.js","Data.js","Plot.js","Panel.js"],"names":["LocusZoom","version","populate","selector","datasource","layout","d3","select","html","plot","call","node","id","iterator","empty","attr","Plot","container","dataset","region","parsed_state","parsePositionQuery","Object","keys","forEach","key","state","svg","append","style","setDimensions","positionPanels","initialize","length","refresh","populateAll","plots","selectAll","each","d","i","positionIntToString","pos","exp","suffix","exp_symbols","isNaN","log","Math","LN10","min","max","places_exp","floor","toFixed","min_exp","places","ret","pow","positionStringToInt","p","val","toUpperCase","replace","suffixre","exec","mult","Number","x","chrposoff","chrpos","match","center","offset","chr","start","end","position","prettyTicks","range","clip_range","target_tick_count","parseInt","min_n","shrink_sml","high_u_bias","u5_bias","abs","c","base","base_toFixed","round","unit","ticks","parseFloat","push","indexOf","slice","pop","createCORSPromise","method","url","body","headers","timeout","response","Q","defer","xhr","XMLHttpRequest","open","XDomainRequest","onreadystatechange","readyState","status","resolve","reject","setTimeout","header","setRequestHeader","send","promise","validateState","new_state","validated_region","attempted_midpoint","attempted_scale","temp","min_region_scale","max_region_scale","parseFields","data","tokens","regex","m","text","index","condition","variable","close","console","error","JSON","stringify","astify","token","shift","then","ast","cache","hasOwnProperty","Data","Field","render_node","value","map","join","getToolTipData","parentNode","classed","getToolTipDataLayer","getDataLayer","getToolTipPanel","data_layer","parent","getToolTipPlot","panel","generateCurtain","curtain","showing","content_selector","hide_delay","show","content","css","parent_plot","insert","on","hide","bind","update","clearTimeout","page_origin","getPageOrigin","top","y","left","width","height","delay","remove","generateLoader","loader","progress_selector","cancel_selector","percent","padding","loader_boundrect","getBoundingClientRect","animate","setPercentCompleted","subclass","extra","Sub","constructor","apply","arguments","prototype","create","k","ext","Layouts","obj","layouts","get","type","name","modifications","merge","unnamespaced","parse","default_namespace","namespace","default","toString","applyNamespaces","element","re","resolved_namespace","r","merge_namespace","namespaced_element","namespaced_property","property","set","add","list","custom_layout","default_layout","custom_type","default_type","Array","isArray","closable","or","and","covariates_model_association","orientation","fields","z_index","x_axis","field","y_axis","axis","ceiling","point_shape","scale_function","parameters","field_value","else","point_size","color","breaks","values","legend","shape","size","label","class","id_field","upper_buffer","min_extent","behaviors","onmouseover","action","onmouseout","onclick","exclusive","onshiftclick","tooltip","tooltip_positioning","category_field","lower_buffer","categories","null_value","fill_opacity","spacing","lines","filters","operator","start_field","end_field","track_split_field","split_tracks","always_hide_legend","components","group_position","title","subtitle","covariates_model_plot_dashboard","button_html","button_title","region_nav_plot_dashboard","step","min_width","min_height","proportional_width","margin","right","bottom","inner_border","dashboard","l","axes","label_offset","tick_format","extent","y1","y2","origin","hidden","interaction","drag_background_to_pan","drag_x_ticks_to_scale","drag_y1_ticks_to_scale","drag_y2_ticks_to_scale","scroll_to_zoom","x_linked","data_layers","transform","data_layer_id","pad_from_bottom","responsive_resize","panels","proportional_height","StandardLayout","mouse_guide","DataLayer","initialized","layout_idx","Panel","DefaultLayout","_base_layout","state_id","setDefaultState","tooltips","global_statuses","addField","fieldName","transformations","fieldString","Statuses","adjectives","verbs","menu_antiverbs","getBaseId","getAbsoluteDataHeight","dataBCR","group","canTransition","transition","panel_boundaries","dragging","panel_id","getElementId","element_id","getElementStatusNodeId","getElementById","applyDataMethods","toHTML","deselect","unselectElement","applyCustomDataMethods","clipRect","moveUp","data_layer_ids_by_z_index","resortDataLayers","moveDown","resolveScalableParameter","idx","f","ScaleFunctions","getAxisExtent","dimension","axis_name","axis_layout","data_extent","original_extent_span","range_min","range_max","getTicks","config","createTooltip","positionTooltip","arrow","updateTooltip","destroyTooltip","destroyAllTooltips","event","pageX","pageY","positionAllTooltips","showOrHideTooltip","resolveStatus","statuses","directive","reduce","previousValue","currentValue","sub_status","sub_operator","show_directive","hide_directive","antistatus","show_resolved","hide_resolved","filter","return_type","test","operators","a","b","matches","filterIndexes","filterElements","verb","adjective","antiverb","setElementStatus","setElementStatusByFilters","setAllElementStatus","toggle","get_element_id_error","element_status_node_id","element_status_idx","splice","emit","active","status_ids","applyBehaviors","selection","event_match","executeBehaviors","requiredKeyStates","ctrl","ctrlKey","shiftKey","behavior","current_status_boolean","href","target","window","location","panel_origin","exportData","format","default_format","toLowerCase","e","jsonified","delimiter","record","draw","cliparea","reMap","lzd","getData","new_data","DataLayers","datalayers","datalayer","extend","parent_name","overrides","child","render","self","trackData","enter","exit","arrow_type","arrow_top","arrow_left","arrow_width","stroke_width","tooltip_box","data_layer_height","data_layer_width","x_center","x_scale","y_center","offset_right","offset_left","confidence_intervals","show_no_significance_line","border_radius","y_scale","sqrt","PI","ci_selection","ci_transform","ci_width","ci_height","duration","ease","points_selection","initial_y","fill","symbol","element_data","stroke","label_font_size","label_exon_spacing","exon_height","bounding_box_padding","track_vertical_spacing","getTrackHeight","transcript_idx","tracks","gene_track_index","assignTracks","getLabelWidth","gene_name","font_size","temp_text","label_width","getBBox","g","gene_id","split","gene_version","transcript_id","transcripts","display_range","text_anchor","centered_margin","display_domain","invert","track","potential_track","collision_on_potential_track","placed_gene","min_start","max_end","t","exons","gene","bboxes","boundary_fill","boundary_stroke","boundaries","labels","strand","exon_fill","exon_stroke","exon_id","clickareas","gene_bbox_id","gene_bbox","gene_center_x","chromosome_fill_colors","light","dark","chromosome_label_colors","genome_start","genome_end","chromosomes","variant_parts","variant","track_split_order","track_split_legend_to_y_axis","track_height","previous_tracks","interval_track_index","track_split_field_index","reverse","placed_interval","psuedoElement","sharedstatusnode_style","display","interval","statusnode_style","statusnodes","rects","interval_name","updateSplitTrackAxis","interval_bbox","interval_center_x","legend_axis","track_spacing","target_height","scaleHeightToData","toggleSplitTracks","interpolate","hitarea_width","mouse_event","line","tooltip_timeout","getMouseDisplayAndData","mouse","slope","x_field","y_field","bisect","bisector","datum","startDatum","endDatum","interpolateNumber","x_precision","toPrecision","y_precision","dd","min_arrow_left","max_arrow_left","path","hitarea","hitarea_line","path_class","global_status","decoupled","x_extent","y_extent","x_range","y_range","flip_labels","handle_lines","Boolean","min_x","max_x","flip","dn","dnl","dnx","text_swing","dnlx2","line_swing","label_texts","da","dax","abound","dal","label_lines","db","bbound","collision","separate_labels","seperate_iterations","alpha","again","sign","adjust","new_a_y","new_b_y","min_y","max_y","delta","label_elements","label_line","filtered_data","label_groups","makeLDReference","ref","applyState","ldrefvar","_prepareData","xField","sourceData","sort","ak","bk","av","bv","_generateCategoryBounds","uniqueCategories","item","category","bounds","categoryNames","_setDynamicColorScheme","colorParams","baseParams","parameters_categories_hash","every","colors","color_scale","scale","category10","category20","concat","categoryBounds","_categories","knownCategories","knownColors","xPos","diff","KnownDataSources","sources","findSourceByName","SOURCE_NAME","source","warn","source_name","newObj","params","Function","getAll","setAll","clear","TransformationFunctions","getTrans","fun","parseTrans","parseTransString","funs","result","substring","fn","ceil","toExponential","str","encodeURIComponent","s","functions","input","threshold","prev","curr","nullval","upper_idx","brk","normalized_input","isFinite","Dashboard","hide_timeout","persist","component","Components","shouldPersist","visibility","destroy","force","Component","parent_panel","parent_svg","button","menu","Button","parent_dashboard","tag","setTag","setHtml","setText","setHTML","setTitle","setColor","setStyle","getClass","permanent","setPermanent","bool","setStatus","highlight","disable","setOnMouseover","setOnMouseout","setOnclick","preUpdate","postUpdate","outer_selector","inner_selector","scroll_position","scrollTop","scrollbar_padding","menu_height_padding","page_scroll_top","document","documentElement","container_offset","getContainerOffset","dashboard_client_rect","button_client_rect","menu_client_rect","total_content_height","scrollHeight","base_max_width","container_max_width","content_max_width","base_max_height","max_height","setPopulate","menu_populate_function","div_selector","title_selector","display_width","display_height","generateBase64SVG","base64_string","css_string","stylesheet","styleSheets","fcall","outerHTML","dy","initial_html","style_def","insert_at","btoa","p1","String","fromCharCode","suppress_confirm","confirm","removePanel","is_at_top","y_index","is_at_bottom","panel_ids_by_y_index","can_zoom","current_region_scale","zoom_factor","new_region_scale","menu_html","model","covariates","CovariatesModel","element_reference","updateComponent","removeByIdx","removeAll","table","covariate","row","cov","scale_timeout","status_adj","status_idx","status_verb","at_top","at_bottom","td","removeDataLayer","allowed_fields","fields_whitelist","dataLayer","layer_name","dataLayerLayout","defaultConfig","configSlot","_selected_item","uniqueID","random","menuLayout","renderRow","display_name","display_options","row_id","field_name","defaultName","default_config_display_name","options","Legend","background_rect","elements","elements_group","label_size","line_height","label_x","label_y","path_y","symbolTypes","radius","bcr","right_x","pad_from_right","DataSources","addSource","ns","dsobj","source_id","getSource","removeSource","fromJSON","ds","toJSON","parts","full_name","applyTransformations","Requester","split_requests","requests","raw","trans","outnames","request_handles","when","discrete","Source","enableCache","dependentSource","parseInit","init","getCacheKey","chain","getURL","fetchRequest","getRequest","req","cacheKey","_cachedKey","_cachedResponse","preGetData","pre","resp","parseResponse","normalizeResponse","N","sameLength","records","j","prepareData","annotateData","extractFields","fieldFound","output_record","v","combineChainBody","json","standardized","one_source_body","new_body","parseArraysToObjects","standard","parseObjectsToObjects","parseData","constructorFun","uniqueName","getPrototypeOf","AssociationSource","unshift","analysis","LDSource","findMergeFields","exactMatch","arr","regexes","dataFields","position_field","pvalue","pvalue_field","_names_","names","nameMatch","findRequestedFields","isrefvarin","isrefvarout","ldin","ldout","findExtremeValue","pval","extremeVal","extremeIdx","refSource","ldrefsource","reqFields","refVar","columns","leftJoin","lfield","rfield","position2","tagRefVariant","refvar","idfield","outname","GeneSource","GeneConstraintSource","geneids","substr","constraint_fields","RecombinationRateSource","recombsource","IntervalSource","bedtracksource","StaticSource","_data","PheWASSource","build","ConnectorSource","_source_name_mapping","specified_ids","REQUIRED_SOURCES","chain_source_id","applyPanelYIndexesToPanelLayouts","pid","remap_promises","window_onresize","event_hooks","hook","off","theseHooks","undefined","hookMatch","eventData","sourceID","hookToRun","eventContext","bounding_client_rect","x_offset","scrollLeft","y_offset","offsetParent","offsetTop","offsetLeft","canInteract","loading_data","zooming","initializeLayout","aspect_ratio","sumProportional","total","rescaleSVG","clientRect","panel_layout","addPanel","panel_width","panel_height","setOrigin","proportional_origin","clearPanelData","panelId","mode","panelsList","dlid","layer","x_linked_margins","total_proportional_height","proportional_adjustment","calculated_plot_height","mouse_guide_svg","mouse_guide_vertical_svg","mouse_guide_horizontal_svg","vertical","horizontal","selectors","corner_selector","panel_idx","panel_resize_drag","drag","this_panel","original_panel_height","panel_height_change","new_calculated_plot_height","loop_panel_id","loop_panel_idx","loop_panel","corner_drag","dx","plot_page_origin","panel_page_origin","corner_padding","corner_size","mouseout_mouse_guide","mousemove_mouse_guide","coords","mouseup","stopDrag","mousemove","preventDefault","dragged_x","start_x","dragged_y","start_y","linked_panel_ids","client_rect","subscribeToData","success_callback","opts","error_callback","onerror","err","listener","catch","state_changes","all","drop","startDrag","getLinkedPanelIds","overrideAxisLayout","axis_number","y_axis_number","generateID","applyDataLayerZIndexesToDataLayerLayouts","data_promises","y1_scale","y2_scale","y1_extent","y2_extent","x_ticks","y1_ticks","y2_ticks","zoom_timeout","bubble","plot_origin","background_click","y1_linked","y2_linked","panel_count","setMargin","y1_range","y2_range","label_function","data_layer_layout","addDataLayer","clipPath","clearSelections","x_axis_label","y1_axis","y1_axis_label","y2_axis","y2_axis_label","mousedown","ascending","generateExtents","generateTicks","baseTickConfig","combinedTicks","acc","nextLayer","itemConfig","constrain","limit_exponent","neg_min","neg_max","pos_min","pos_max","Infinity","ranges","base_x_range","x_shifted","base_y1_range","y1_shifted","base_y2_range","y2_shifted","anchor","scalar","current_extent_size","current_scaled_extent_size","potential_extent_size","new_extent_size","offset_ratio","new_x_extent_start","y_shifted","linear","domain","renderAxis","zoom_handler","wheelDelta","detail","deltaY","zoom_listener","zoom","canRender","axis_params","label_rotate","ticksAreAllNumbers","orient","tickPadding","tickValues","tickFormat","tick_selector","tick_mouseover","focus","cursor","dh","addBasicLoader","show_immediately"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAGA,IAAAA,SAAA,GAAA,EACAC,OAAA,EAAA,OADA,EAAA,C;QAaA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAAD,SAAA,CAAAE,QAAA,GAAA,UAAAC,QAAA,EAAAC,UAAA,EAAAC,MAAA,EAAA;AAAA,YACA,IAAA,OAAAF,QAAA,IAAA,WAAA,EAAA;AAAA,gBACA,MAAA,yCAAA,CADA;AAAA,aADA;AAAA,YAKA;AAAA,YAAAG,EAAA,CAAAC,MAAA,CAAAJ,QAAA,EAAAK,IAAA,CAAA,EAAA,EALA;AAAA,YAMA,IAAAC,IAAA,CANA;AAAA,YAOAH,EAAA,CAAAC,MAAA,CAAAJ,QAAA,EAAAO,IAAA,CAAA,YAAA;AAAA,gBAEA;AAAA,oBAAA,OAAA,KAAAC,IAAA,GAAAC,EAAA,IAAA,WAAA,EAAA;AAAA,oBACA,IAAAC,QAAA,GAAA,CAAA,CADA;AAAA,oBAEA,OAAA,CAAAP,EAAA,CAAAC,MAAA,CAAA,SAAAM,QAAA,EAAAC,KAAA,EAAA,EAAA;AA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":["/**\n * @namespace\n */\nvar LocusZoom = {\n version: \"0.8.0\"\n};\n\n/**\n * Populate a single element with a LocusZoom plot.\n * selector can be a string for a DOM Query or a d3 selector.\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot} The newly created plot instance\n */\nLocusZoom.populate = function(selector, datasource, layout) {\n if (typeof selector == \"undefined\"){\n throw (\"LocusZoom.populate selector not defined\");\n }\n // Empty the selector of any existing content\n d3.select(selector).html(\"\");\n var plot;\n d3.select(selector).call(function(){\n // Require each containing element have an ID. If one isn't present, create one.\n if (typeof this.node().id == \"undefined\"){\n var iterator = 0;\n while (!d3.select(\"#lz-\" + iterator).empty()){ iterator++; }\n this.attr(\"id\", \"#lz-\" + iterator);\n }\n // Create the plot\n plot = new LocusZoom.Plot(this.node().id, datasource, layout);\n plot.container = this.node();\n // Detect data-region and fill in state values if present\n if (typeof this.node().dataset !== \"undefined\" && typeof this.node().dataset.region !== \"undefined\"){\n var parsed_state = LocusZoom.parsePositionQuery(this.node().dataset.region);\n Object.keys(parsed_state).forEach(function(key){\n plot.state[key] = parsed_state[key];\n });\n }\n // Add an SVG to the div and set its dimensions\n plot.svg = d3.select(\"div#\" + plot.id)\n .append(\"svg\")\n .attr(\"version\", \"1.1\")\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .attr(\"id\", plot.id + \"_svg\").attr(\"class\", \"lz-locuszoom\")\n .style(plot.layout.style);\n plot.setDimensions();\n plot.positionPanels();\n // Initialize the plot\n plot.initialize();\n // If the plot has defined data sources then trigger its first mapping based on state values\n if (typeof datasource == \"object\" && Object.keys(datasource).length){\n plot.refresh();\n }\n });\n return plot;\n};\n\n/**\n * Populate arbitrarily many elements each with a LocusZoom plot\n * using a common datasource and layout\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot[]}\n */\nLocusZoom.populateAll = function(selector, datasource, layout) {\n var plots = [];\n d3.selectAll(selector).each(function(d,i) {\n plots[i] = LocusZoom.populate(this, datasource, layout);\n });\n return plots;\n};\n\n/**\n * Convert an integer chromosome position to an SI string representation (e.g. 23423456 => \"23.42\" (Mb))\n * @param {Number} pos Position\n * @param {String} [exp] Exponent to use for the returned string, eg 6=> MB. If not specified, will attempt to guess\n * the most appropriate SI prefix based on the number provided.\n * @param {Boolean} [suffix=false] Whether or not to append a suffix (e.g. \"Mb\") to the end of the returned string\n * @returns {string}\n */\nLocusZoom.positionIntToString = function(pos, exp, suffix){\n var exp_symbols = { 0: \"\", 3: \"K\", 6: \"M\", 9: \"G\" };\n suffix = suffix || false;\n if (isNaN(exp) || exp === null){\n var log = Math.log(pos) / Math.LN10;\n exp = Math.min(Math.max(log - (log % 3), 0), 9);\n }\n var places_exp = exp - Math.floor((Math.log(pos) / Math.LN10).toFixed(exp + 3));\n var min_exp = Math.min(Math.max(exp, 0), 2);\n var places = Math.min(Math.max(places_exp, min_exp), 12);\n var ret = \"\" + (pos / Math.pow(10, exp)).toFixed(places);\n if (suffix && typeof exp_symbols[exp] !== \"undefined\"){\n ret += \" \" + exp_symbols[exp] + \"b\";\n }\n return ret;\n};\n\n/**\n * Convert an SI string chromosome position to an integer representation (e.g. \"5.8 Mb\" => 58000000)\n * @param {String} p The chromosome position\n * @returns {Number}\n */\nLocusZoom.positionStringToInt = function(p) {\n var val = p.toUpperCase();\n val = val.replace(/,/g, \"\");\n var suffixre = /([KMG])[B]*$/;\n var suffix = suffixre.exec(val);\n var mult = 1;\n if (suffix) {\n if (suffix[1]===\"M\") {\n mult = 1e6;\n } else if (suffix[1]===\"G\") {\n mult = 1e9;\n } else {\n mult = 1e3; //K\n }\n val = val.replace(suffixre,\"\");\n }\n val = Number(val) * mult;\n return val;\n};\n\n/**\n * Parse region queries into their constituent parts\n * TODO: handle genes (or send off to API)\n * @param {String} x A chromosome position query. May be any of the forms `chr:start-end`, `chr:center+offset`,\n * or `chr:pos`\n * @returns {{chr:*, start: *, end:*} | {chr:*, position:*}}\n */\nLocusZoom.parsePositionQuery = function(x) {\n var chrposoff = /^(\\w+):([\\d,.]+[kmgbKMGB]*)([-+])([\\d,.]+[kmgbKMGB]*)$/;\n var chrpos = /^(\\w+):([\\d,.]+[kmgbKMGB]*)$/;\n var match = chrposoff.exec(x);\n if (match) {\n if (match[3] === \"+\") {\n var center = LocusZoom.positionStringToInt(match[2]);\n var offset = LocusZoom.positionStringToInt(match[4]);\n return {\n chr:match[1],\n start: center - offset,\n end: center + offset\n };\n } else {\n return {\n chr: match[1],\n start: LocusZoom.positionStringToInt(match[2]),\n end: LocusZoom.positionStringToInt(match[4])\n };\n }\n }\n match = chrpos.exec(x);\n if (match) {\n return {\n chr:match[1],\n position: LocusZoom.positionStringToInt(match[2])\n };\n }\n return null;\n};\n\n/**\n * Generate a \"pretty\" set of ticks (multiples of 1, 2, or 5 on the same order of magnitude for the range)\n * Based on R's \"pretty\" function: https://github.com/wch/r-source/blob/b156e3a711967f58131e23c1b1dc1ea90e2f0c43/src/appl/pretty.c\n * @param {Number[]} range A two-item array specifying [low, high] values for the axis range\n * @param {('low'|'high'|'both'|'neither')} [clip_range='neither'] What to do if first and last generated ticks extend\n * beyond the range. Set this to \"low\", \"high\", \"both\", or \"neither\" to clip the first (low) or last (high) tick to\n * be inside the range or allow them to extend beyond.\n * e.g. \"low\" will clip the first (low) tick if it extends beyond the low end of the range but allow the\n * last (high) tick to extend beyond the range. \"both\" clips both ends, \"neither\" allows both to extend beyond.\n * @param {Number} [target_tick_count=5] The approximate number of ticks you would like to be returned; may not be exact\n * @returns {Number[]}\n */\nLocusZoom.prettyTicks = function(range, clip_range, target_tick_count){\n if (typeof target_tick_count == \"undefined\" || isNaN(parseInt(target_tick_count))){\n target_tick_count = 5;\n }\n target_tick_count = parseInt(target_tick_count);\n \n var min_n = target_tick_count / 3;\n var shrink_sml = 0.75;\n var high_u_bias = 1.5;\n var u5_bias = 0.5 + 1.5 * high_u_bias;\n \n var d = Math.abs(range[0] - range[1]);\n var c = d / target_tick_count;\n if ((Math.log(d) / Math.LN10) < -2){\n c = (Math.max(Math.abs(d)) * shrink_sml) / min_n;\n }\n \n var base = Math.pow(10, Math.floor(Math.log(c)/Math.LN10));\n var base_toFixed = 0;\n if (base < 1 && base !== 0){\n base_toFixed = Math.abs(Math.round(Math.log(base)/Math.LN10));\n }\n \n var unit = base;\n if ( ((2 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 2 * base;\n if ( ((5 * base) - c) < (u5_bias * (c - unit)) ){\n unit = 5 * base;\n if ( ((10 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 10 * base;\n }\n }\n }\n \n var ticks = [];\n var i = parseFloat( (Math.floor(range[0]/unit)*unit).toFixed(base_toFixed) );\n while (i < range[1]){\n ticks.push(i);\n i += unit;\n if (base_toFixed > 0){\n i = parseFloat(i.toFixed(base_toFixed));\n }\n }\n ticks.push(i);\n \n if (typeof clip_range == \"undefined\" || [\"low\", \"high\", \"both\", \"neither\"].indexOf(clip_range) === -1){\n clip_range = \"neither\";\n }\n if (clip_range === \"low\" || clip_range === \"both\"){\n if (ticks[0] < range[0]){ ticks = ticks.slice(1); }\n }\n if (clip_range === \"high\" || clip_range === \"both\"){\n if (ticks[ticks.length-1] > range[1]){ ticks.pop(); }\n }\n \n return ticks;\n};\n\n/**\n * Make an AJAX request and return a promise.\n * From http://www.html5rocks.com/en/tutorials/cors/\n * and with promises from https://gist.github.com/kriskowal/593076\n *\n * @param {String} method The HTTP verb\n * @param {String} url\n * @param {String} body The request body to send to the server\n * @param {Object} headers Object of custom request headers\n * @param {Number} [timeout] If provided, wait this long (in ms) before timing out\n * @returns {Promise}\n */\nLocusZoom.createCORSPromise = function (method, url, body, headers, timeout) {\n var response = Q.defer();\n var xhr = new XMLHttpRequest();\n if (\"withCredentials\" in xhr) {\n // Check if the XMLHttpRequest object has a \"withCredentials\" property.\n // \"withCredentials\" only exists on XMLHTTPRequest2 objects.\n xhr.open(method, url, true);\n } else if (typeof XDomainRequest != \"undefined\") {\n // Otherwise, check if XDomainRequest.\n // XDomainRequest only exists in IE, and is IE's way of making CORS requests.\n xhr = new XDomainRequest();\n xhr.open(method, url);\n } else {\n // Otherwise, CORS is not supported by the browser.\n xhr = null;\n }\n if (xhr) {\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200 || xhr.status === 0 ) {\n response.resolve(xhr.response);\n } else {\n response.reject(\"HTTP \" + xhr.status + \" for \" + url);\n }\n }\n };\n timeout && setTimeout(response.reject, timeout);\n body = typeof body !== \"undefined\" ? body : \"\";\n if (typeof headers !== \"undefined\"){\n for (var header in headers){\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n // Send the request\n xhr.send(body);\n } \n return response.promise;\n};\n\n/**\n * Validate a (presumed complete) plot state object against internal rules for consistency, and ensure the plot fits\n * within any constraints imposed by the layout.\n * @param {Object} new_state\n * @param {Number} new_state.start\n * @param {Number} new_state.end\n * @param {Object} layout\n * @returns {*|{}}\n */\nLocusZoom.validateState = function(new_state, layout){\n\n new_state = new_state || {};\n layout = layout || {};\n\n // If a \"chr\", \"start\", and \"end\" are present then resolve start and end\n // to numeric values that are not decimal, negative, or flipped\n var validated_region = false;\n if (typeof new_state.chr != \"undefined\" && typeof new_state.start != \"undefined\" && typeof new_state.end != \"undefined\"){\n // Determine a numeric scale and midpoint for the attempted region,\n var attempted_midpoint = null; var attempted_scale;\n new_state.start = Math.max(parseInt(new_state.start), 1);\n new_state.end = Math.max(parseInt(new_state.end), 1);\n if (isNaN(new_state.start) && isNaN(new_state.end)){\n new_state.start = 1;\n new_state.end = 1;\n attempted_midpoint = 0.5;\n attempted_scale = 0;\n } else if (isNaN(new_state.start) || isNaN(new_state.end)){\n attempted_midpoint = new_state.start || new_state.end;\n attempted_scale = 0;\n new_state.start = (isNaN(new_state.start) ? new_state.end : new_state.start);\n new_state.end = (isNaN(new_state.end) ? new_state.start : new_state.end);\n } else {\n attempted_midpoint = Math.round((new_state.start + new_state.end) / 2);\n attempted_scale = new_state.end - new_state.start;\n if (attempted_scale < 0){\n var temp = new_state.start;\n new_state.end = new_state.start;\n new_state.start = temp;\n attempted_scale = new_state.end - new_state.start;\n }\n if (attempted_midpoint < 0){\n new_state.start = 1;\n new_state.end = 1;\n attempted_scale = 0;\n }\n }\n validated_region = true;\n }\n\n // Constrain w/r/t layout-defined minimum region scale\n if (!isNaN(layout.min_region_scale) && validated_region && attempted_scale < layout.min_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.min_region_scale / 2), 1);\n new_state.end = new_state.start + layout.min_region_scale;\n }\n\n // Constrain w/r/t layout-defined maximum region scale\n if (!isNaN(layout.max_region_scale) && validated_region && attempted_scale > layout.max_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.max_region_scale / 2), 1);\n new_state.end = new_state.start + layout.max_region_scale;\n }\n\n return new_state;\n};\n\n//\n/**\n * Replace placeholders in an html string with field values defined in a data object\n * Only works on scalar values! Will ignore non-scalars.\n *\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @param {Object} data\n * @param {String} html A placeholder string in which to substitute fields. Supports several template options:\n * `{{field_name}}` is a variable placeholder for the value of `field_name` from the provided data\n * `{{#if {{field_name}} }} Conditional text {{/if}} will insert the contents of the tag only if the value exists.\n * Since this is only an existence check, **variables with a value of 0 will be evaluated as true**.\n * @returns {string}\n */\nLocusZoom.parseFields = function (data, html) {\n if (typeof data != \"object\"){\n throw (\"LocusZoom.parseFields invalid arguments: data is not an object\");\n }\n if (typeof html != \"string\"){\n throw (\"LocusZoom.parseFields invalid arguments: html is not a string\");\n }\n // `tokens` is like [token,...]\n // `token` is like {text: '...'} or {variable: 'foo|bar'} or {condition: 'foo|bar'} or {close: 'if'}\n var tokens = [];\n var regex = /\\{\\{(?:(#if )?([A-Za-z0-9_:|]+)|(\\/if))\\}\\}/;\n while (html.length > 0){\n var m = regex.exec(html);\n if (!m) { tokens.push({text: html}); html = \"\"; }\n else if (m.index !== 0) { tokens.push({text: html.slice(0, m.index)}); html = html.slice(m.index); }\n else if (m[1] === \"#if \") { tokens.push({condition: m[2]}); html = html.slice(m[0].length); }\n else if (m[2]) { tokens.push({variable: m[2]}); html = html.slice(m[0].length); }\n else if (m[3] === \"/if\") { tokens.push({close: \"if\"}); html = html.slice(m[0].length); }\n else {\n console.error(\"Error tokenizing tooltip when remaining template is \" + JSON.stringify(html) +\n \" and previous tokens are \" + JSON.stringify(tokens) +\n \" and current regex match is \" + JSON.stringify([m[1], m[2], m[3]]));\n html=html.slice(m[0].length);\n }\n }\n var astify = function() {\n var token = tokens.shift();\n if (typeof token.text !== \"undefined\" || token.variable) {\n return token;\n } else if (token.condition) {\n token.then = [];\n while(tokens.length > 0) {\n if (tokens[0].close === \"if\") { tokens.shift(); break; }\n token.then.push(astify());\n }\n return token;\n } else {\n console.error(\"Error making tooltip AST due to unknown token \" + JSON.stringify(token));\n return { text: \"\" };\n }\n };\n // `ast` is like [thing,...]\n // `thing` is like {text: \"...\"} or {variable:\"foo|bar\"} or {condition: \"foo|bar\", then:[thing,...]}\n var ast = [];\n while (tokens.length > 0) ast.push(astify());\n\n var resolve = function(variable) {\n if (!resolve.cache.hasOwnProperty(variable)) {\n resolve.cache[variable] = (new LocusZoom.Data.Field(variable)).resolve(data);\n }\n return resolve.cache[variable];\n };\n resolve.cache = {};\n var render_node = function(node) {\n if (typeof node.text !== \"undefined\") {\n return node.text;\n } else if (node.variable) {\n try {\n var value = resolve(node.variable);\n if ([\"string\",\"number\",\"boolean\"].indexOf(typeof value) !== -1) { return value; }\n if (value === null) { return \"\"; }\n } catch (error) { console.error(\"Error while processing variable \" + JSON.stringify(node.variable)); }\n return \"{{\" + node.variable + \"}}\";\n } else if (node.condition) {\n try {\n var condition = resolve(node.condition);\n if (condition || condition === 0) {\n return node.then.map(render_node).join(\"\");\n }\n } catch (error) { console.error(\"Error while processing condition \" + JSON.stringify(node.variable)); }\n return \"\";\n } else { console.error(\"Error rendering tooltip due to unknown AST node \" + JSON.stringify(node)); }\n };\n return ast.map(render_node).join(\"\");\n};\n\n/**\n * Shortcut method for getting the data bound to a tool tip.\n * @param {Element} node\n * @returns {*} The first element of data bound to the tooltip\n */\nLocusZoom.getToolTipData = function(node){\n if (typeof node != \"object\" || typeof node.parentNode == \"undefined\"){\n throw(\"Invalid node object\");\n }\n // If this node is a locuszoom tool tip then return its data\n var selector = d3.select(node);\n if (selector.classed(\"lz-data_layer-tooltip\") && typeof selector.data()[0] != \"undefined\"){\n return selector.data()[0];\n } else {\n return LocusZoom.getToolTipData(node.parentNode);\n }\n};\n\n/**\n * Shortcut method for getting a reference to the data layer that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.getToolTipDataLayer = function(node){\n var data = LocusZoom.getToolTipData(node);\n if (data.getDataLayer){ return data.getDataLayer(); }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the panel that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.getToolTipPanel = function(node){\n var data_layer = LocusZoom.getToolTipDataLayer(node);\n if (data_layer){ return data_layer.parent; }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the plot that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.getToolTipPlot = function(node){\n var panel = LocusZoom.getToolTipPanel(node);\n if (panel){ return panel.parent; }\n return null;\n};\n\n/**\n * Generate a curtain object for a plot, panel, or any other subdivision of a layout\n * The panel curtain, like the plot curtain is an HTML overlay that obscures the entire panel. It can be styled\n * arbitrarily and display arbitrary messages. It is useful for reporting error messages visually to an end user\n * when the error renders the panel unusable.\n * TODO: Improve type doc here\n * @returns {object}\n */\nLocusZoom.generateCurtain = function(){\n var curtain = {\n showing: false,\n selector: null,\n content_selector: null,\n hide_delay: null,\n\n /**\n * Generate the curtain. Any content (string) argument passed will be displayed in the curtain as raw HTML.\n * CSS (object) can be passed which will apply styles to the curtain and its content.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n show: function(content, css){\n if (!this.curtain.showing){\n this.curtain.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-curtain\").attr(\"id\", this.id + \".curtain\");\n this.curtain.content_selector = this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-content\");\n this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-dismiss\").html(\"Dismiss\")\n .on(\"click\", function(){\n this.curtain.hide();\n }.bind(this));\n this.curtain.showing = true;\n }\n return this.curtain.update(content, css);\n }.bind(this),\n\n /**\n * Update the content and css of the curtain that's currently being shown. This method also adjusts the size\n * and positioning of the curtain to ensure it still covers the entire panel with no overlap.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n update: function(content, css){\n if (!this.curtain.showing){ return this.curtain; }\n clearTimeout(this.curtain.hide_delay);\n // Apply CSS if provided\n if (typeof css == \"object\"){\n this.curtain.selector.style(css);\n }\n // Update size and position\n var page_origin = this.getPageOrigin();\n this.curtain.selector.style({\n top: page_origin.y + \"px\",\n left: page_origin.x + \"px\",\n width: this.layout.width + \"px\",\n height: this.layout.height + \"px\"\n });\n this.curtain.content_selector.style({\n \"max-width\": (this.layout.width - 40) + \"px\",\n \"max-height\": (this.layout.height - 40) + \"px\"\n });\n // Apply content if provided\n if (typeof content == \"string\"){\n this.curtain.content_selector.html(content);\n }\n return this.curtain;\n }.bind(this),\n\n /**\n * Remove the curtain\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.curtain.showing){ return this.curtain; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.curtain.hide_delay);\n this.curtain.hide_delay = setTimeout(this.curtain.hide, delay);\n return this.curtain;\n }\n // Remove curtain\n this.curtain.selector.remove();\n this.curtain.selector = null;\n this.curtain.content_selector = null;\n this.curtain.showing = false;\n return this.curtain;\n }.bind(this)\n };\n return curtain;\n};\n\n/**\n * Generate a loader object for a plot, panel, or any other subdivision of a layout\n *\n * The panel loader is a small HTML overlay that appears in the lower left corner of the panel. It cannot be styled\n * arbitrarily, but can show a custom message and show a minimalist loading bar that can be updated to specific\n * completion percentages or be animated.\n * TODO Improve type documentation\n * @returns {object}\n */\nLocusZoom.generateLoader = function(){\n var loader = {\n showing: false,\n selector: null,\n content_selector: null,\n progress_selector: null,\n cancel_selector: null,\n\n /**\n * Show a loading indicator\n * @param {string} [content='Loading...'] Loading message (displayed as raw HTML)\n */\n show: function(content){\n // Generate loader\n if (!this.loader.showing){\n this.loader.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-loader\").attr(\"id\", this.id + \".loader\");\n this.loader.content_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-content\");\n this.loader.progress_selector = this.loader.selector\n .append(\"div\").attr(\"class\", \"lz-loader-progress-container\")\n .append(\"div\").attr(\"class\", \"lz-loader-progress\");\n /* TODO: figure out how to make this cancel button work\n this.loader.cancel_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-cancel\").html(\"Cancel\")\n .on(\"click\", function(){\n this.loader.hide();\n }.bind(this));\n */\n this.loader.showing = true;\n if (typeof content == \"undefined\"){ content = \"Loading...\"; }\n }\n return this.loader.update(content);\n }.bind(this),\n\n /**\n * Update the currently displayed loader and ensure the new content is positioned correctly.\n * @param {string} content The text to display (as raw HTML). If not a string, will be ignored.\n * @param {number} [percent] A number from 1-100. If a value is specified, it will stop all animations\n * in progress.\n */\n update: function(content, percent){\n if (!this.loader.showing){ return this.loader; }\n clearTimeout(this.loader.hide_delay);\n // Apply content if provided\n if (typeof content == \"string\"){\n this.loader.content_selector.html(content);\n }\n // Update size and position\n var padding = 6; // is there a better place to store/define this?\n var page_origin = this.getPageOrigin();\n var loader_boundrect = this.loader.selector.node().getBoundingClientRect();\n this.loader.selector.style({\n top: (page_origin.y + this.layout.height - loader_boundrect.height - padding) + \"px\",\n left: (page_origin.x + padding) + \"px\"\n });\n /* Uncomment this code when a functional cancel button can be shown\n var cancel_boundrect = this.loader.cancel_selector.node().getBoundingClientRect();\n this.loader.content_selector.style({\n \"padding-right\": (cancel_boundrect.width + padding) + \"px\"\n });\n */\n // Apply percent if provided\n if (typeof percent == \"number\"){\n this.loader.progress_selector.style({\n width: (Math.min(Math.max(percent, 1), 100)) + \"%\"\n });\n }\n return this.loader;\n }.bind(this),\n\n /**\n * Adds a class to the loading bar that makes it loop infinitely in a loading animation. Useful when exact\n * percent progress is not available.\n */\n animate: function(){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", true);\n return this.loader;\n }.bind(this),\n\n /**\n * Sets the loading bar in the loader to percentage width equal to the percent (number) value passed. Percents\n * will automatically be limited to a range of 1 to 100. Will stop all animations in progress.\n */\n setPercentCompleted: function(percent){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", false);\n return this.loader.update(null, percent);\n }.bind(this),\n\n /**\n * Remove the loader\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.loader.showing){ return this.loader; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.loader.hide_delay);\n this.loader.hide_delay = setTimeout(this.loader.hide, delay);\n return this.loader;\n }\n // Remove loader\n this.loader.selector.remove();\n this.loader.selector = null;\n this.loader.content_selector = null;\n this.loader.progress_selector = null;\n this.loader.cancel_selector = null;\n this.loader.showing = false;\n return this.loader;\n }.bind(this)\n };\n return loader;\n};\n\n/**\n * Create a new subclass following classical inheritance patterns. Some registry singletons use this internally to\n * enable code reuse and customization of known LZ core functionality.\n *\n * @param {Function} parent A parent class constructor that will be extended by the child class\n * @param {Object} extra An object of additional properties and methods to add/override behavior for the child class.\n * The special \"constructor\" property can be used to specify a custom constructor, or it will call parent by default.\n * Implementer must manage super calls when overriding the constructor.\n * @returns {Function} The constructor for the new child class\n */\nLocusZoom.subclass = function(parent, extra) {\n if (typeof parent !== \"function\" ) {\n throw \"Parent must be a callable constructor\";\n }\n\n extra = extra || {};\n var Sub = extra.hasOwnProperty(\"constructor\") ? extra.constructor : function() {\n parent.apply(this, arguments);\n };\n\n Sub.prototype = Object.create(parent.prototype);\n Object.keys(extra).forEach(function(k) {\n Sub.prototype[k] = extra[k];\n });\n return Sub;\n};\n\n\n/**\n * LocusZoom optional extensions will live under this namespace.\n *\n * Extension code is not part of the core LocusZoom app.js bundle.\n * @namespace\n * @public\n */\nLocusZoom.ext = {};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * Manage known layouts for all parts of the LocusZoom plot\n *\n * This registry allows for layouts to be reused and customized many times on a page, using a common base pattern.\n * It handles the work of ensuring that each new instance of the layout has no shared state with other copies.\n *\n * @class\n */\nLocusZoom.Layouts = (function() {\n var obj = {};\n var layouts = {\n \"plot\": {},\n \"panel\": {},\n \"data_layer\": {},\n \"dashboard\": {},\n \"tooltip\": {}\n };\n\n /**\n * Generate a layout configuration object\n * @param {('plot'|'panel'|'data_layer'|'dashboard'|'tooltip')} type The type of layout to retrieve\n * @param {string} name Identifier of the predefined layout within the specified type\n * @param {object} [modifications] Custom properties that override default settings for this layout\n * @returns {object} A JSON-serializable object representation\n */\n obj.get = function(type, name, modifications) {\n if (typeof type != \"string\" || typeof name != \"string\") {\n throw(\"invalid arguments passed to LocusZoom.Layouts.get, requires string (layout type) and string (layout name)\");\n } else if (layouts[type][name]) {\n // Get the base layout\n var layout = LocusZoom.Layouts.merge(modifications || {}, layouts[type][name]);\n // If \"unnamespaced\" is true then strike that from the layout and return the layout without namespacing\n if (layout.unnamespaced){\n delete layout.unnamespaced;\n return JSON.parse(JSON.stringify(layout));\n }\n // Determine the default namespace for namespaced values\n var default_namespace = \"\";\n if (typeof layout.namespace == \"string\"){\n default_namespace = layout.namespace;\n } else if (typeof layout.namespace == \"object\" && Object.keys(layout.namespace).length){\n if (typeof layout.namespace.default != \"undefined\"){\n default_namespace = layout.namespace.default;\n } else {\n default_namespace = layout.namespace[Object.keys(layout.namespace)[0]].toString();\n }\n }\n default_namespace += default_namespace.length ? \":\" : \"\";\n // Apply namespaces to layout, recursively\n var applyNamespaces = function(element, namespace){\n if (namespace){\n if (typeof namespace == \"string\"){\n namespace = { default: namespace }; \n }\n } else {\n namespace = { default: \"\" };\n }\n if (typeof element == \"string\"){\n var re = /\\{\\{namespace(\\[[A-Za-z_0-9]+\\]|)\\}\\}/g;\n var match, base, key, resolved_namespace;\n var replace = [];\n while ((match = re.exec(element)) !== null){\n base = match[0];\n key = match[1].length ? match[1].replace(/(\\[|\\])/g,\"\") : null;\n resolved_namespace = default_namespace;\n if (namespace != null && typeof namespace == \"object\" && typeof namespace[key] != \"undefined\"){\n resolved_namespace = namespace[key] + (namespace[key].length ? \":\" : \"\");\n }\n replace.push({ base: base, namespace: resolved_namespace });\n }\n for (var r in replace){\n element = element.replace(replace[r].base, replace[r].namespace);\n }\n } else if (typeof element == \"object\" && element != null){\n if (typeof element.namespace != \"undefined\"){\n var merge_namespace = (typeof element.namespace == \"string\") ? { default: element.namespace } : element.namespace;\n namespace = LocusZoom.Layouts.merge(namespace, merge_namespace);\n }\n var namespaced_element, namespaced_property;\n for (var property in element) {\n if (property === \"namespace\"){ continue; }\n namespaced_element = applyNamespaces(element[property], namespace);\n namespaced_property = applyNamespaces(property, namespace);\n if (property !== namespaced_property){\n delete element[property];\n }\n element[namespaced_property] = namespaced_element;\n }\n }\n return element;\n };\n layout = applyNamespaces(layout, layout.namespace);\n // Return the layout as valid JSON only\n return JSON.parse(JSON.stringify(layout));\n } else {\n throw(\"layout type [\" + type + \"] name [\" + name + \"] not found\");\n }\n };\n\n /** @private */\n obj.set = function(type, name, layout) {\n if (typeof type != \"string\" || typeof name != \"string\" || typeof layout != \"object\"){\n throw (\"unable to set new layout; bad arguments passed to set()\");\n }\n if (!layouts[type]){\n layouts[type] = {};\n }\n if (layout){\n return (layouts[type][name] = JSON.parse(JSON.stringify(layout)));\n } else {\n delete layouts[type][name];\n return null;\n }\n };\n\n /**\n * Register a new layout definition by name.\n *\n * @param {string} type The type of layout to add. Usually, this will be one of the predefined LocusZoom types,\n * but if you pass a different name, this method will automatically create the new `type` bucket\n * @param {string} name The identifier of the newly added layout\n * @param {object} [layout] A JSON-serializable object containing configuration properties for this layout\n * @returns The JSON representation of the newly created layout\n */\n obj.add = function(type, name, layout) {\n return obj.set(type, name, layout);\n };\n\n /**\n * List all registered layouts\n * @param [type] Optionally narrow the list to only layouts of a specific type; else return all known layouts\n * @returns {*}\n */\n obj.list = function(type) {\n if (!layouts[type]){\n var list = {};\n Object.keys(layouts).forEach(function(type){\n list[type] = Object.keys(layouts[type]);\n });\n return list;\n } else {\n return Object.keys(layouts[type]);\n }\n };\n\n /**\n * A helper method used for merging two objects. If a key is present in both, takes the value from the first object\n * Values from `default_layout` will be cleanly copied over, ensuring no references or shared state.\n *\n * Frequently used for preparing custom layouts. Both objects should be JSON-serializable.\n *\n * @param {object} custom_layout An object containing configuration parameters that override or add to defaults\n * @param {object} default_layout An object containing default settings.\n * @returns The custom layout is modified in place and also returned from this method.\n */\n obj.merge = function (custom_layout, default_layout) {\n if (typeof custom_layout !== \"object\" || typeof default_layout !== \"object\"){\n throw(\"LocusZoom.Layouts.merge only accepts two layout objects; \" + (typeof custom_layout) + \", \" + (typeof default_layout) + \" given\");\n }\n for (var property in default_layout) {\n if (!default_layout.hasOwnProperty(property)){ continue; }\n // Get types for comparison. Treat nulls in the custom layout as undefined for simplicity.\n // (javascript treats nulls as \"object\" when we just want to overwrite them as if they're undefined)\n // Also separate arrays from objects as a discrete type.\n var custom_type = custom_layout[property] === null ? \"undefined\" : typeof custom_layout[property];\n var default_type = typeof default_layout[property];\n if (custom_type === \"object\" && Array.isArray(custom_layout[property])){ custom_type = \"array\"; }\n if (default_type === \"object\" && Array.isArray(default_layout[property])){ default_type = \"array\"; }\n // Unsupported property types: throw an exception\n if (custom_type === \"function\" || default_type === \"function\"){\n throw(\"LocusZoom.Layouts.merge encountered an unsupported property type\");\n }\n // Undefined custom value: pull the default value\n if (custom_type === \"undefined\"){\n custom_layout[property] = JSON.parse(JSON.stringify(default_layout[property]));\n continue;\n }\n // Both values are objects: merge recursively\n if (custom_type === \"object\" && default_type === \"object\"){\n custom_layout[property] = LocusZoom.Layouts.merge(custom_layout[property], default_layout[property]);\n continue;\n }\n }\n return custom_layout;\n };\n\n return obj;\n})();\n\n\n/**\n * Tooltip Layouts\n * @namespace LocusZoom.Layouts.tooltips\n */\n\n// TODO: Improve documentation of predefined types within layout namespaces\nLocusZoom.Layouts.add(\"tooltip\", \"standard_association\", {\n namespace: { \"assoc\": \"assoc\" },\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[assoc]}}variant}}
      \"\n + \"P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
      \"\n + \"Ref. Allele: {{{{namespace[assoc]}}ref_allele}}
      \"\n + \"Make LD Reference
      \"\n});\n\nvar covariates_model_association = LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true });\ncovariates_model_association.html += \"Condition on Variant
      \";\nLocusZoom.Layouts.add(\"tooltip\", \"covariates_model_association\", covariates_model_association);\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_genes\", {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"

      {{gene_name}}

      \"\n + \"
      Gene ID: {{gene_id}}
      \"\n + \"
      Transcript ID: {{transcript_id}}
      \"\n + \"
      \"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"
      ConstraintExpected variantsObserved variantsConst. Metric
      Synonymous{{exp_syn}}{{n_syn}}z = {{syn_z}}
      Missense{{exp_mis}}{{n_mis}}z = {{mis_z}}
      LoF{{exp_lof}}{{n_lof}}pLI = {{pLI}}
      \"\n + \"More data on ExAC\"\n});\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n closable: false,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[intervals]}}state_name}}
      {{{{namespace[intervals]}}start}}-{{{{namespace[intervals]}}end}}\"\n});\n\n/**\n * Data Layer Layouts: represent specific information from a data source\n * @namespace Layouts.data_layer\n*/\n\nLocusZoom.Layouts.add(\"data_layer\", \"significance\", {\n id: \"significance\",\n type: \"orthogonal_line\",\n orientation: \"horizontal\",\n offset: 4.522\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"recomb_rate\", {\n namespace: { \"recomb\": \"recomb\" },\n id: \"recombrate\",\n type: \"line\",\n fields: [\"{{namespace[recomb]}}position\", \"{{namespace[recomb]}}recomb_rate\"],\n z_index: 1,\n style: {\n \"stroke\": \"#0000FF\",\n \"stroke-width\": \"1.5px\"\n },\n x_axis: {\n field: \"{{namespace[recomb]}}position\"\n },\n y_axis: {\n axis: 2,\n field: \"{{namespace[recomb]}}recomb_rate\",\n floor: 0,\n ceiling: 100\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"association_pvalues\", {\n namespace: { \"assoc\": \"assoc\", \"ld\": \"ld\" },\n id: \"associationpvalues\",\n type: \"scatter\",\n point_shape: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"diamond\",\n else: \"circle\"\n }\n },\n point_size: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: 80,\n else: 40\n }\n },\n color: [\n {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"#9632b8\"\n }\n },\n {\n scale_function: \"numerical_bin\",\n field: \"{{namespace[ld]}}state\",\n parameters: {\n breaks: [0, 0.2, 0.4, 0.6, 0.8],\n values: [\"#357ebd\",\"#46b8da\",\"#5cb85c\",\"#eea236\",\"#d43f3a\"]\n }\n },\n \"#B8B8B8\"\n ],\n legend: [\n { shape: \"diamond\", color: \"#9632b8\", size: 40, label: \"LD Ref Var\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#d43f3a\", size: 40, label: \"1.0 > r² ≥ 0.8\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#eea236\", size: 40, label: \"0.8 > r² ≥ 0.6\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#5cb85c\", size: 40, label: \"0.6 > r² ≥ 0.4\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#46b8da\", size: 40, label: \"0.4 > r² ≥ 0.2\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#357ebd\", size: 40, label: \"0.2 > r² ≥ 0.0\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#B8B8B8\", size: 40, label: \"no r² data\", class: \"lz-data_layer-scatter\" }\n ],\n fields: [\"{{namespace[assoc]}}variant\", \"{{namespace[assoc]}}position\", \"{{namespace[assoc]}}log_pvalue\", \"{{namespace[assoc]}}log_pvalue|logtoscinotation\", \"{{namespace[assoc]}}ref_allele\", \"{{namespace[ld]}}state\", \"{{namespace[ld]}}isrefvar\"],\n id_field: \"{{namespace[assoc]}}variant\",\n z_index: 2,\n x_axis: {\n field: \"{{namespace[assoc]}}position\"\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[assoc]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.10,\n min_extent: [ 0, 10 ]\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"phewas_pvalues\", {\n namespace: {\"phewas\": \"phewas\"},\n id: \"phewaspvalues\",\n type: \"category_scatter\",\n point_shape: \"circle\",\n point_size: 70,\n tooltip_positioning: \"vertical\",\n id_field: \"{{namespace[phewas]}}id\",\n fields: [\"{{namespace[phewas]}}id\", \"{{namespace[phewas]}}log_pvalue\", \"{{namespace[phewas]}}trait_group\", \"{{namespace[phewas]}}trait_label\"],\n x_axis: {\n field: \"{{namespace[phewas]}}x\", // Synthetic/derived field added by `category_scatter` layer\n category_field: \"{{namespace[phewas]}}trait_group\",\n lower_buffer: 0.025,\n upper_buffer: 0.025\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[phewas]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.15\n },\n color: {\n field: \"{{namespace[phewas]}}trait_group\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [],\n values: [],\n null_value: \"#B8B8B8\"\n }\n },\n fill_opacity: 0.7,\n tooltip: {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: [\n \"Trait: {{{{namespace[phewas]}}trait_label|htmlescape}}
      \",\n \"Trait Category: {{{{namespace[phewas]}}trait_group|htmlescape}}
      \",\n \"P-value: {{{{namespace[phewas]}}log_pvalue|logtoscinotation|htmlescape}}
      \"\n ].join(\"\")\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n label: {\n text: \"{{{{namespace[phewas]}}trait_label}}\",\n spacing: 6,\n lines: {\n style: {\n \"stroke-width\": \"2px\",\n \"stroke\": \"#333333\",\n \"stroke-dasharray\": \"2px 2px\"\n }\n },\n filters: [\n {\n field: \"{{namespace[phewas]}}log_pvalue\",\n operator: \">=\",\n value: 20\n }\n ],\n style: {\n \"font-size\": \"14px\",\n \"font-weight\": \"bold\",\n \"fill\": \"#333333\"\n }\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genes\", {\n namespace: { \"gene\": \"gene\", \"constraint\": \"constraint\" },\n id: \"genes\",\n type: \"genes\",\n fields: [\"{{namespace[gene]}}all\", \"{{namespace[constraint]}}all\"],\n id_field: \"gene_id\",\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_genes\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genome_legend\", {\n namespace: { \"genome\": \"genome\" },\n id: \"genome_legend\",\n type: \"genome_legend\",\n fields: [\"{{namespace[genome]}}chr\", \"{{namespace[genome]}}base_pairs\"],\n x_axis: {\n floor: 0,\n ceiling: 2881033286\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n id: \"intervals\",\n type: \"intervals\",\n fields: [\"{{namespace[intervals]}}start\",\"{{namespace[intervals]}}end\",\"{{namespace[intervals]}}state_id\",\"{{namespace[intervals]}}state_name\"],\n id_field: \"{{namespace[intervals]}}start\",\n start_field: \"{{namespace[intervals]}}start\",\n end_field: \"{{namespace[intervals]}}end\",\n track_split_field: \"{{namespace[intervals]}}state_id\",\n split_tracks: true,\n always_hide_legend: false,\n color: {\n field: \"{{namespace[intervals]}}state_id\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [1,2,3,4,5,6,7,8,9,10,11,12,13],\n values: [\"rgb(212,63,58)\", \"rgb(250,120,105)\", \"rgb(252,168,139)\", \"rgb(240,189,66)\", \"rgb(250,224,105)\", \"rgb(240,238,84)\", \"rgb(244,252,23)\", \"rgb(23,232,252)\", \"rgb(32,191,17)\", \"rgb(23,166,77)\", \"rgb(32,191,17)\", \"rgb(162,133,166)\", \"rgb(212,212,212)\"],\n null_value: \"#B8B8B8\"\n }\n },\n legend: [\n { shape: \"rect\", color: \"rgb(212,63,58)\", width: 9, label: \"Active Promoter\", \"{{namespace[intervals]}}state_id\": 1 },\n { shape: \"rect\", color: \"rgb(250,120,105)\", width: 9, label: \"Weak Promoter\", \"{{namespace[intervals]}}state_id\": 2 },\n { shape: \"rect\", color: \"rgb(252,168,139)\", width: 9, label: \"Poised Promoter\", \"{{namespace[intervals]}}state_id\": 3 },\n { shape: \"rect\", color: \"rgb(240,189,66)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 4 },\n { shape: \"rect\", color: \"rgb(250,224,105)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 5 },\n { shape: \"rect\", color: \"rgb(240,238,84)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 6 },\n { shape: \"rect\", color: \"rgb(244,252,23)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 7 },\n { shape: \"rect\", color: \"rgb(23,232,252)\", width: 9, label: \"Insulator\", \"{{namespace[intervals]}}state_id\": 8 },\n { shape: \"rect\", color: \"rgb(32,191,17)\", width: 9, label: \"Transcriptional transition\", \"{{namespace[intervals]}}state_id\": 9 },\n { shape: \"rect\", color: \"rgb(23,166,77)\", width: 9, label: \"Transcriptional elongation\", \"{{namespace[intervals]}}state_id\": 10 },\n { shape: \"rect\", color: \"rgb(136,240,129)\", width: 9, label: \"Weak transcribed\", \"{{namespace[intervals]}}state_id\": 11 },\n { shape: \"rect\", color: \"rgb(162,133,166)\", width: 9, label: \"Polycomb-repressed\", \"{{namespace[intervals]}}state_id\": 12 },\n { shape: \"rect\", color: \"rgb(212,212,212)\", width: 9, label: \"Heterochromatin / low signal\", \"{{namespace[intervals]}}state_id\": 13 }\n ],\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_intervals\", { unnamespaced: true })\n});\n\n/**\n * Dashboard Layouts: toolbar buttons etc\n * @namespace Layouts.dashboard\n */\nLocusZoom.Layouts.add(\"dashboard\", \"standard_panel\", {\n components: [\n {\n type: \"remove_panel\",\n position: \"right\",\n color: \"red\",\n group_position: \"end\"\n },\n {\n type: \"move_panel_up\",\n position: \"right\",\n group_position: \"middle\"\n },\n {\n type: \"move_panel_down\",\n position: \"right\",\n group_position: \"start\",\n style: { \"margin-left\": \"0.75em\" }\n }\n ]\n}); \n\nLocusZoom.Layouts.add(\"dashboard\", \"standard_plot\", {\n components: [\n {\n type: \"title\",\n title: \"LocusZoom\",\n subtitle: \"v\" + LocusZoom.version + \"\",\n position: \"left\"\n },\n {\n type: \"dimensions\",\n position: \"right\"\n },\n {\n type: \"region_scale\",\n position: \"right\"\n },\n {\n type: \"download\",\n position: \"right\"\n }\n ]\n});\n\nvar covariates_model_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\ncovariates_model_plot_dashboard.components.push({\n type: \"covariates_model\",\n button_html: \"Model\",\n button_title: \"Show and edit covariates currently in model\",\n position: \"left\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"covariates_model_plot\", covariates_model_plot_dashboard);\n\nvar region_nav_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 500000,\n button_html: \">>\",\n position: \"right\",\n group_position: \"end\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 50000,\n button_html: \">\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: 0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: -0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -50000,\n button_html: \"<\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -500000,\n button_html: \"<<\",\n position: \"right\",\n group_position: \"start\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"region_nav_plot\", region_nav_plot_dashboard);\n\n/**\n * Panel Layouts\n * @namespace Layouts.panel\n */\n\nLocusZoom.Layouts.add(\"panel\", \"association\", {\n id: \"association\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 200,\n proportional_width: 1,\n margin: { top: 35, right: 50, bottom: 40, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_legend\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n },\n y2: {\n label: \"Recombination Rate (cM/Mb)\",\n label_offset: 40\n }\n },\n legend: {\n orientation: \"vertical\",\n origin: { x: 55, y: 40 },\n hidden: true\n },\n interaction: {\n drag_background_to_pan: true,\n drag_x_ticks_to_scale: true,\n drag_y1_ticks_to_scale: true,\n drag_y2_ticks_to_scale: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"recomb_rate\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"association_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genes\", {\n id: \"genes\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 112.5,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 20, left: 50 },\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"resize_to_data\",\n position: \"right\"\n });\n return l;\n })(), \n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genes\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"phewas\", {\n id: \"phewas\",\n width: 800,\n height: 300,\n min_width: 800,\n min_height: 300,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 120, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n axes: {\n x: {\n ticks: { // Object based config (shared defaults; allow layers to specify ticks)\n style: {\n \"font-weight\": \"bold\",\n \"font-size\": \"11px\",\n \"text-anchor\": \"start\"\n },\n transform: \"rotate(50)\",\n position: \"left\" // Special param recognized by `category_scatter` layers\n }\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"phewas_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genome_legend\", {\n id: \"genome_legend\",\n width: 800,\n height: 50,\n origin: { x: 0, y: 300 },\n min_width: 800,\n min_height: 50,\n proportional_width: 1,\n margin: { top: 0, right: 50, bottom: 35, left: 50 },\n axes: {\n x: {\n label: \"Genomic Position (number denotes chromosome)\",\n label_offset: 35,\n ticks: [\n {\n x: 124625310,\n text: \"1\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 370850307,\n text: \"2\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 591461209,\n text: \"3\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 786049562,\n text: \"4\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 972084330,\n text: \"5\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1148099493,\n text: \"6\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1313226358,\n text: \"7\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1465977701,\n text: \"8\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1609766427,\n text: \"9\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1748140516,\n text: \"10\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1883411148,\n text: \"11\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2017840353,\n text: \"12\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2142351240,\n text: \"13\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2253610949,\n text: \"14\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2358551415,\n text: \"15\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2454994487,\n text: \"16\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2540769469,\n text: \"17\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2620405698,\n text: \"18\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2689008813,\n text: \"19\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2750086065,\n text: \"20\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2805663772,\n text: \"21\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2855381003,\n text: \"22\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n }\n ]\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genome_legend\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"intervals\", {\n id: \"intervals\",\n width: 1000,\n height: 50,\n min_width: 500,\n min_height: 50,\n margin: { top: 25, right: 150, bottom: 5, left: 50 },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_split_tracks\",\n data_layer_id: \"intervals\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n legend: {\n hidden: true,\n orientation: \"horizontal\",\n origin: { x: 50, y: 0 },\n pad_from_bottom: 5\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"intervals\", { unnamespaced: true })\n ]\n});\n\n\n/**\n * Plot Layouts\n * @namespace Layouts.plot\n */\n\nLocusZoom.Layouts.add(\"plot\", \"standard_association\", {\n state: {},\n width: 800,\n height: 450,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, proportional_height: 0.5 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, proportional_height: 0.5 })\n ]\n});\n\n// Shortcut to \"StandardLayout\" for backward compatibility\nLocusZoom.StandardLayout = LocusZoom.Layouts.get(\"plot\", \"standard_association\");\n\nLocusZoom.Layouts.add(\"plot\", \"standard_phewas\", {\n width: 800,\n height: 600,\n min_width: 800,\n min_height: 600,\n responsive_resize: true,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true } ),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"phewas\", { unnamespaced: true, proportional_height: 0.45 }),\n LocusZoom.Layouts.get(\"panel\", \"genome_legend\", { unnamespaced: true, proportional_height: 0.1 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", {\n unnamespaced: true, proportional_height: 0.45,\n margin: { bottom: 40 },\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n }\n }\n })\n ],\n mouse_guide: false\n});\n\nLocusZoom.Layouts.add(\"plot\", \"interval_association\", {\n state: {},\n width: 800,\n height: 550,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, width: 800, proportional_height: (225/570) }),\n LocusZoom.Layouts.get(\"panel\", \"intervals\", { unnamespaced: true, proportional_height: (120/570) }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, width: 800, proportional_height: (225/570) })\n ]\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A data layer is an abstract class representing a data set and its graphical representation within a panel\n * @public\n * @class\n * @param {Object} layout A JSON-serializable object describing the layout for this layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n*/\nLocusZoom.DataLayer = function(layout, parent) {\n /** @member {Boolean} */\n this.initialized = false;\n /** @member {Number} */\n this.layout_idx = null;\n\n /** @member {String} */\n this.id = null;\n /** @member {LocusZoom.Panel} */\n this.parent = parent || null;\n /**\n * @member {{group: d3.selection, container: d3.selection, clipRect: d3.selection}}\n */\n this.svg = {};\n\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n if (typeof parent != \"undefined\" && parent instanceof LocusZoom.Panel){ this.parent_plot = parent.parent; }\n\n /** @member {Object} */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.DataLayer.DefaultLayout);\n if (this.layout.id){ this.id = this.layout.id; }\n\n // Ensure any axes defined in the layout have an explicit axis number (default: 1)\n if (this.layout.x_axis !== {} && typeof this.layout.x_axis.axis !== \"number\"){ this.layout.x_axis.axis = 1; }\n if (this.layout.y_axis !== {} && typeof this.layout.y_axis.axis !== \"number\"){ this.layout.y_axis.axis = 1; }\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original data layer state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n /** @member {Object} */\n this.state = {};\n /** @member {String} */\n this.state_id = null;\n\n this.setDefaultState();\n\n // Initialize parameters for storing data and tool tips\n /** @member {Array} */\n this.data = [];\n if (this.layout.tooltip){\n /** @member {Object} */\n this.tooltips = {};\n }\n\n // Initialize flags for tracking global statuses\n this.global_statuses = {\n \"highlighted\": false,\n \"selected\": false,\n \"faded\": false,\n \"hidden\": false\n };\n \n return this;\n\n};\n\n/**\n * Instruct this datalayer to begin tracking additional fields from data sources (does not guarantee that such a field actually exists)\n *\n * Custom plots can use this to dynamically extend datalayer functionality after the plot is drawn\n *\n * (since removing core fields may break layer functionality, there is presently no hook for the inverse behavior)\n * @param fieldName\n * @param namespace\n * @param {String|String[]} transformations The name (or array of names) of transformations to apply to this field\n * @returns {String} The raw string added to the fields array\n */\nLocusZoom.DataLayer.prototype.addField = function(fieldName, namespace, transformations) {\n if (!fieldName || !namespace) {\n throw \"Must specify field name and namespace to use when adding field\";\n }\n var fieldString = namespace + \":\" + fieldName;\n if (transformations) {\n fieldString += \"|\";\n if (typeof transformations === \"string\") {\n fieldString += transformations;\n } else if (Array.isArray(transformations)) {\n fieldString += transformations.join(\"|\");\n } else {\n throw \"Must provide transformations as either a string or array of strings\";\n }\n }\n var fields = this.layout.fields;\n if (fields.indexOf(fieldString) === -1) {\n fields.push(fieldString);\n }\n return fieldString;\n};\n\n/**\n * Define default state that should get tracked during the lifetime of this layer.\n *\n * In some special custom usages, it may be useful to completely reset a panel (eg \"click for\n * genome region\" links), plotting new data that invalidates any previously tracked state. This hook makes it\n * possible to reset without destroying the panel entirely. It is used by `Plot.clearPanelData`.\n */\nLocusZoom.DataLayer.prototype.setDefaultState = function() {\n // Define state parameters specific to this data layer. Within plot state, this will live under a key\n // `panel_name.layer_name`.\n if (this.parent){\n this.state = this.parent.state;\n this.state_id = this.parent.id + \".\" + this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n this.state[this.state_id][status] = this.state[this.state_id][status] || [];\n }.bind(this));\n }\n};\n\n/**\n * A basic description of keys expected in a layout. Not intended to be directly used or modified by an end user.\n * @protected\n * @type {{type: string, fields: Array, x_axis: {}, y_axis: {}}}\n */\nLocusZoom.DataLayer.DefaultLayout = {\n type: \"\",\n fields: [],\n x_axis: {},\n y_axis: {}\n};\n\n/**\n * Available statuses that individual elements can have. Each status is described by\n * a verb/antiverb and an adjective. Verbs and antiverbs are used to generate data layer\n * methods for updating the status on one or more elements. Adjectives are used in class\n * names and applied or removed from elements to have a visual representation of the status,\n * as well as used as keys in the state for tracking which elements are in which status(es)\n * @static\n * @type {{verbs: String[], adjectives: String[], menu_antiverbs: String[]}}\n */\nLocusZoom.DataLayer.Statuses = {\n verbs: [\"highlight\", \"select\", \"fade\", \"hide\"],\n adjectives: [\"highlighted\", \"selected\", \"faded\", \"hidden\"],\n menu_antiverbs: [\"unhighlight\", \"deselect\", \"unfade\", \"show\"]\n};\n\n/**\n * Get the fully qualified identifier for the data layer, prefixed by any parent or container elements\n *\n * @returns {string} A dot-delimited string of the format ..\n */\nLocusZoom.DataLayer.prototype.getBaseId = function(){\n return this.parent_plot.id + \".\" + this.parent.id + \".\" + this.id;\n};\n\n/**\n * Determine the pixel height of data-bound objects represented inside this data layer. (excluding elements such as axes)\n *\n * May be used by operations that resize the data layer to fit available data\n *\n * @public\n * @returns {number}\n */\nLocusZoom.DataLayer.prototype.getAbsoluteDataHeight = function(){\n var dataBCR = this.svg.group.node().getBoundingClientRect();\n return dataBCR.height;\n};\n\n/**\n * Whether transitions can be applied to this data layer\n * @returns {boolean}\n */\nLocusZoom.DataLayer.prototype.canTransition = function(){\n if (!this.layout.transition){ return false; }\n return !(this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.panel_id);\n};\n\n/**\n * Fetch the fully qualified ID to be associated with a specific visual element, based on the data to which that\n * element is bound. In general this element ID will be unique, allowing it to be addressed directly via selectors.\n * @param {String|Object} element\n * @returns {String}\n */\nLocusZoom.DataLayer.prototype.getElementId = function(element){\n var element_id = \"element\";\n if (typeof element == \"string\"){\n element_id = element;\n } else if (typeof element == \"object\"){\n var id_field = this.layout.id_field || \"id\";\n if (typeof element[id_field] == \"undefined\"){\n throw(\"Unable to generate element ID\");\n }\n element_id = element[id_field].toString().replace(/\\W/g,\"\");\n }\n return (this.getBaseId() + \"-\" + element_id).replace(/(:|\\.|\\[|\\]|,)/g, \"_\");\n};\n\n/**\n * Fetch an ID that may bind a data element to a separate visual node for displaying status\n * Examples of this might be seperate visual nodes to show select/highlight statuses, or\n * even a common/shared node to show status across many elements in a set.\n * Abstract method. It should be overridden by data layers that implement seperate status\n * nodes specifically to the use case of the data layer type.\n * @param {String|Object} element\n * @returns {String|null}\n */\nLocusZoom.DataLayer.prototype.getElementStatusNodeId = function(element){\n return null;\n};\n\n/**\n * Returns a reference to the underlying data associated with a single visual element in the data layer, as\n * referenced by the unique identifier for the element\n\n * @param {String} id The unique identifier for the element, as defined by `getElementId`\n * @returns {Object|null} The data bound to that element\n */\nLocusZoom.DataLayer.prototype.getElementById = function(id){\n var selector = d3.select(\"#\" + id.replace(/(:|\\.|\\[|\\]|,)/g, \"\\\\$1\"));\n if (!selector.empty() && selector.data() && selector.data().length){\n return selector.data()[0];\n } else {\n return null;\n }\n};\n\n/**\n * Basic method to apply arbitrary methods and properties to data elements.\n * This is called on all data immediately after being fetched.\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyDataMethods = function(){\n this.data.forEach(function(d, i){\n // Basic toHTML() method - return the stringified value in the id_field, if defined.\n this.data[i].toHTML = function(){\n var id_field = this.layout.id_field || \"id\";\n var html = \"\";\n if (this.data[i][id_field]){ html = this.data[i][id_field].toString(); }\n return html;\n }.bind(this);\n // getDataLayer() method - return a reference to the data layer\n this.data[i].getDataLayer = function(){\n return this;\n }.bind(this);\n // deselect() method - shortcut method to deselect the element\n this.data[i].deselect = function(){\n var data_layer = this.getDataLayer();\n data_layer.unselectElement(this);\n };\n }.bind(this));\n this.applyCustomDataMethods();\n return this;\n};\n\n/**\n * Hook that allows custom datalayers to apply additional methods and properties to data elements as needed\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyCustomDataMethods = function(){\n return this;\n};\n\n/**\n * Initialize a data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.initialize = function(){\n\n // Append a container group element to house the main data layer group element and the clip path\n this.svg.container = this.parent.svg.group.append(\"g\")\n .attr(\"class\", \"lz-data_layer-container\")\n .attr(\"id\", this.getBaseId() + \".data_layer_container\");\n \n // Append clip path to the container element\n this.svg.clipRect = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\")\n .append(\"rect\");\n \n // Append svg group for rendering all data layer elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".data_layer\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n return this;\n\n};\n\n/**\n * Move a data layer up relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveUp = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Move a data layer down relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveDown = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Apply scaling functions to an element or parameter as needed, based on its layout and the element's data\n * If the layout parameter is already a primitive type, simply return the value as given\n * @param {Array|Number|String|Object} layout\n * @param {*} data The value to be used with the filter\n * @returns {*} The transformed value\n */\nLocusZoom.DataLayer.prototype.resolveScalableParameter = function(layout, data){\n var ret = null;\n if (Array.isArray(layout)){\n var idx = 0;\n while (ret === null && idx < layout.length){\n ret = this.resolveScalableParameter(layout[idx], data);\n idx++;\n }\n } else {\n switch (typeof layout){\n case \"number\":\n case \"string\":\n ret = layout;\n break;\n case \"object\":\n if (layout.scale_function){\n if(layout.field) {\n var f = new LocusZoom.Data.Field(layout.field);\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, f.resolve(data));\n } else {\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, data);\n }\n }\n break;\n }\n }\n return ret;\n};\n\n/**\n * Generate dimension extent function based on layout parameters\n * @param {('x'|'y')} dimension\n */\nLocusZoom.DataLayer.prototype.getAxisExtent = function(dimension){\n\n if ([\"x\", \"y\"].indexOf(dimension) === -1){\n throw(\"Invalid dimension identifier passed to LocusZoom.DataLayer.getAxisExtent()\");\n }\n\n var axis_name = dimension + \"_axis\";\n var axis_layout = this.layout[axis_name];\n\n // If a floor AND a ceiling are explicitly defined then just return that extent and be done\n if (!isNaN(axis_layout.floor) && !isNaN(axis_layout.ceiling)){\n return [+axis_layout.floor, +axis_layout.ceiling];\n }\n\n // If a field is defined for the axis and the data layer has data then generate the extent from the data set\n var data_extent = [];\n if (axis_layout.field && this.data) {\n if (!this.data.length) {\n // If data has been fetched (but no points in region), enforce the min_extent (with no buffers,\n // because we don't need padding around an empty screen)\n data_extent = axis_layout.min_extent || [];\n return data_extent;\n } else {\n data_extent = d3.extent(this.data, function (d) {\n var f = new LocusZoom.Data.Field(axis_layout.field);\n return +f.resolve(d);\n });\n\n // Apply upper/lower buffers, if applicable\n var original_extent_span = data_extent[1] - data_extent[0];\n if (!isNaN(axis_layout.lower_buffer)) {\n data_extent[0] -= original_extent_span * axis_layout.lower_buffer;\n }\n if (!isNaN(axis_layout.upper_buffer)) {\n data_extent[1] += original_extent_span * axis_layout.upper_buffer;\n }\n\n if (typeof axis_layout.min_extent == \"object\") {\n // The data should span at least the range specified by min_extent, an array with [low, high]\n var range_min = axis_layout.min_extent[0];\n var range_max = axis_layout.min_extent[1];\n if (!isNaN(range_min) && !isNaN(range_max)) {\n data_extent[0] = Math.min(data_extent[0], range_min);\n }\n if (!isNaN(range_max)) {\n data_extent[1] = Math.max(data_extent[1], range_max);\n }\n }\n // If specified, floor and ceiling will override the actual data range\n return [\n isNaN(axis_layout.floor) ? data_extent[0] : axis_layout.floor,\n isNaN(axis_layout.ceiling) ? data_extent[1] : axis_layout.ceiling\n ];\n }\n }\n\n // If this is for the x axis and no extent could be generated yet but state has a defined start and end\n // then default to using the state-defined region as the extent\n if (dimension === \"x\" && !isNaN(this.state.start) && !isNaN(this.state.end)) {\n return [this.state.start, this.state.end];\n }\n\n // No conditions met for generating a valid extent, return an empty array\n return [];\n\n};\n\n/**\n * Allow this data layer to tell the panel what axis ticks it thinks it will require. The panel may choose whether\n * to use some, all, or none of these when rendering, either alone or in conjunction with other data layers.\n *\n * This method is a stub and should be overridden in data layers that need to specify custom behavior.\n *\n * @param {('x'|'y')} dimension\n * @param {Object} [config] Additional parameters for the panel to specify how it wants ticks to be drawn. The names\n * and meanings of these parameters may vary between different data layers.\n * @returns {Object[]}\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.DataLayer.prototype.getTicks = function (dimension, config) {\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw(\"Invalid dimension identifier\");\n }\n return [];\n};\n\n/**\n * Generate a tool tip for a given element\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.createTooltip = function(d, id){\n if (typeof this.layout.tooltip != \"object\"){\n throw (\"DataLayer [\" + this.id + \"] layout does not define a tooltip\");\n }\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n if (this.tooltips[id]){\n this.positionTooltip(id);\n return;\n }\n this.tooltips[id] = {\n data: d,\n arrow: null,\n selector: d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-data_layer-tooltip\")\n .attr(\"id\", id + \"-tooltip\")\n };\n this.updateTooltip(d);\n return this;\n};\n\n/**\n * Update a tool tip (generate its inner HTML)\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.updateTooltip = function(d, id){\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n // Empty the tooltip of all HTML (including its arrow!)\n this.tooltips[id].selector.html(\"\");\n this.tooltips[id].arrow = null;\n // Set the new HTML\n if (this.layout.tooltip.html){\n this.tooltips[id].selector.html(LocusZoom.parseFields(d, this.layout.tooltip.html));\n }\n // If the layout allows tool tips on this data layer to be closable then add the close button\n // and add padding to the tooltip to accommodate it\n if (this.layout.tooltip.closable){\n this.tooltips[id].selector.insert(\"button\", \":first-child\")\n .attr(\"class\", \"lz-tooltip-close-button\")\n .attr(\"title\", \"Close\")\n .text(\"×\")\n .on(\"click\", function(){\n this.destroyTooltip(id);\n }.bind(this));\n }\n // Apply data directly to the tool tip for easier retrieval by custom UI elements inside the tool tip\n this.tooltips[id].selector.data([d]);\n // Reposition and draw a new arrow\n this.positionTooltip(id);\n return this;\n};\n\n/**\n * Destroy tool tip - remove the tool tip element from the DOM and delete the tool tip's record on the data layer\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyTooltip = function(d, id){\n if (typeof d == \"string\"){\n id = d;\n } else if (typeof id == \"undefined\"){\n id = this.getElementId(d);\n }\n if (this.tooltips[id]){\n if (typeof this.tooltips[id].selector == \"object\"){\n this.tooltips[id].selector.remove();\n }\n delete this.tooltips[id];\n }\n return this;\n};\n\n/**\n * Loop through and destroy all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyAllTooltips = function(){\n for (var id in this.tooltips){\n this.destroyTooltip(id);\n }\n return this;\n};\n\n//\n/**\n * Position tool tip - naïve function to place a tool tip to the lower right of the current mouse element\n * Most data layers reimplement this method to position tool tips specifically for the data they display\n * @param {String} id The identifier of the tooltip to position\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n // Position the div itself\n this.tooltips[id].selector\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY) + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!this.tooltips[id].arrow){\n this.tooltips[id].arrow = this.tooltips[id].selector.append(\"div\")\n .style(\"position\", \"absolute\")\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_top_left\");\n }\n this.tooltips[id].arrow\n .style(\"left\", \"-1px\")\n .style(\"top\", \"-1px\");\n return this;\n};\n\n/**\n * Loop through and position all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionAllTooltips = function(){\n for (var id in this.tooltips){\n this.positionTooltip(id);\n }\n return this;\n};\n\n/**\n * Show or hide a tool tip by ID depending on directives in the layout and state values relative to the ID\n * @param {String|Object} element The element associated with the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.showOrHideTooltip = function(element){\n \n if (typeof this.layout.tooltip != \"object\"){ return; }\n var id = this.getElementId(element);\n\n var resolveStatus = function(statuses, directive, operator){\n var status = null;\n if (typeof statuses != \"object\" || statuses === null){ return null; }\n if (Array.isArray(directive)){\n if (typeof operator == \"undefined\"){ operator = \"and\"; }\n if (directive.length === 1){\n status = statuses[directive[0]];\n } else {\n status = directive.reduce(function(previousValue, currentValue) {\n if (operator === \"and\"){\n return statuses[previousValue] && statuses[currentValue];\n } else if (operator === \"or\"){\n return statuses[previousValue] || statuses[currentValue];\n }\n return null;\n });\n }\n } else if (typeof directive == \"object\"){\n var sub_status;\n for (var sub_operator in directive){\n sub_status = resolveStatus(statuses, directive[sub_operator], sub_operator);\n if (status === null){\n status = sub_status;\n } else if (operator === \"and\"){\n status = status && sub_status;\n } else if (operator === \"or\"){\n status = status || sub_status;\n }\n }\n }\n return status;\n };\n\n var show_directive = {};\n if (typeof this.layout.tooltip.show == \"string\"){\n show_directive = { and: [ this.layout.tooltip.show ] };\n } else if (typeof this.layout.tooltip.show == \"object\"){\n show_directive = this.layout.tooltip.show;\n }\n\n var hide_directive = {};\n if (typeof this.layout.tooltip.hide == \"string\"){\n hide_directive = { and: [ this.layout.tooltip.hide ] };\n } else if (typeof this.layout.tooltip.hide == \"object\"){\n hide_directive = this.layout.tooltip.hide;\n }\n\n var statuses = {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n var antistatus = \"un\" + status;\n statuses[status] = this.state[this.state_id][status].indexOf(id) !== -1;\n statuses[antistatus] = !statuses[status];\n }.bind(this));\n\n var show_resolved = resolveStatus(statuses, show_directive);\n var hide_resolved = resolveStatus(statuses, hide_directive);\n\n // Only show tooltip if the resolved logic explicitly shows and explicitly not hides the tool tip\n // Otherwise ensure tooltip does not exist\n if (show_resolved && !hide_resolved){\n this.createTooltip(element);\n } else {\n this.destroyTooltip(element);\n }\n\n return this;\n \n};\n\n/**\n * Find the elements (or indices) that match any of a set of provided filters\n * @protected\n * @param {Array[]} filters A list of filter entries: [field, value] (for equivalence testing) or\n * [field, operator, value] for other operators\n * @param {('indexes'|'elements')} [return_type='indexes'] Specify whether to return either the indices of the matching\n * elements, or references to the elements themselves\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filter = function(filters, return_type){\n if (typeof return_type == \"undefined\" || [\"indexes\",\"elements\"].indexOf(return_type) === -1){\n return_type = \"indexes\";\n }\n if (!Array.isArray(filters)){ return []; }\n var test = function(element, filter){\n var operators = {\n \"=\": function(a,b){ return a === b; },\n \"<\": function(a,b){ return a < b; },\n \"<=\": function(a,b){ return a <= b; },\n \">\": function(a,b){ return a > b; },\n \">=\": function(a,b){ return a >= b; },\n \"%\": function(a,b){ return a % b; }\n };\n if (!Array.isArray(filter)){ return false; }\n if (filter.length === 2){\n return element[filter[0]] === filter[1];\n } else if (filter.length === 3 && operators[filter[1]]){\n return operators[filter[1]](element[filter[0]], filter[2]);\n } else {\n return false;\n }\n };\n var matches = [];\n this.data.forEach(function(element, idx){\n var match = true;\n filters.forEach(function(filter){\n if (!test(element, filter)){ match = false; }\n });\n if (match){ matches.push(return_type === \"indexes\" ? idx : element); }\n });\n return matches;\n};\n\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterIndexes = function(filters){ return this.filter(filters, \"indexes\"); };\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterElements = function(filters){ return this.filter(filters, \"elements\"); };\n\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset a single element's status\n // TODO: Improve documentation for dynamically generated methods/properties\n LocusZoom.DataLayer.prototype[verb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, true, exclusive);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, false, exclusive);\n return this;\n };\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.DataLayer.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.DataLayer.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.DataLayer.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n/**\n * Toggle a status (e.g. highlighted, selected, identified) on an element\n * @param {String} status The name of a recognized status to be added/removed on an appropriate element\n * @param {String|Object} element The data bound to the element of interest\n * @param {Boolean} toggle True to add the status (and associated CSS styles); false to remove it\n * @param {Boolean} exclusive Whether to only allow a state for a single element at a time\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatus = function(status, element, toggle, exclusive){\n // Sanity checks\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatus()\");\n }\n if (typeof element == \"undefined\"){\n throw(\"Invalid element passed to DataLayer.setElementStatus()\");\n }\n if (typeof toggle == \"undefined\"){\n toggle = true;\n }\n\n // Get an ID for the element or return having changed nothing\n try {\n var element_id = this.getElementId(element);\n } catch (get_element_id_error){\n return this;\n }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Set/unset the proper status class on the appropriate DOM element(s)\n d3.select(\"#\" + element_id).classed(\"lz-data_layer-\" + this.layout.type + \"-\" + status, toggle);\n var element_status_node_id = this.getElementStatusNodeId(element);\n if (element_status_node_id !== null){\n d3.select(\"#\" + element_status_node_id).classed(\"lz-data_layer-\" + this.layout.type + \"-statusnode-\" + status, toggle);\n }\n \n // Track element ID in the proper status state array\n var element_status_idx = this.state[this.state_id][status].indexOf(element_id);\n if (toggle && element_status_idx === -1){\n this.state[this.state_id][status].push(element_id);\n }\n if (!toggle && element_status_idx !== -1){\n this.state[this.state_id][status].splice(element_status_idx, 1);\n }\n \n // Trigger tool tip show/hide logic\n this.showOrHideTooltip(element);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n if (status === \"selected\") {\n // Notify parents that a given element has been interacted with. For now, we will only notify on\n // \"selected\" type events, which is (usually) a toggle-able state. If elements are exclusive, two selection\n // events will be sent in short order as the previously selected element has to be de-selected first\n this.parent.emit(\"element_selection\", { element: element, active: toggle }, true);\n }\n return this;\n \n};\n\n/**\n * Toggle a status on elements in the data layer based on a set of filters\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatusByFilters()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; } else { toggle = !!toggle; }\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n if (!Array.isArray(filters)){ filters = []; }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Apply statuses\n this.filterElements(filters).forEach(function(element){\n this.setElementStatus(status, element, toggle);\n }.bind(this));\n \n return this;\n};\n\n/**\n * Toggle a status on all elements in the data layer\n * @param {String} status\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setAllElementStatus = function(status, toggle){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Apply statuses\n if (toggle){\n this.data.forEach(function(element){\n this.setElementStatus(status, element, true);\n }.bind(this));\n } else {\n var status_ids = this.state[this.state_id][status].slice();\n status_ids.forEach(function(id){\n var element = this.getElementById(id);\n if (typeof element == \"object\" && element !== null){\n this.setElementStatus(status, element, false);\n }\n }.bind(this));\n this.state[this.state_id][status] = [];\n }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n return this;\n};\n\n/**\n * Apply all layout-defined behaviors (DOM event handlers) to a selection of elements\n * @param {d3.selection} selection\n */\nLocusZoom.DataLayer.prototype.applyBehaviors = function(selection){\n if (typeof this.layout.behaviors != \"object\"){ return; }\n Object.keys(this.layout.behaviors).forEach(function(directive){\n var event_match = /(click|mouseover|mouseout)/.exec(directive);\n if (!event_match){ return; }\n selection.on(event_match[0] + \".\" + directive, this.executeBehaviors(directive, this.layout.behaviors[directive]));\n }.bind(this));\n};\n\n/**\n * Generate a function that executes an arbitrary list of behaviors on an element during an event\n * @param {String} directive The name of the event, as described in layout.behaviors for this datalayer\n * @param {Object} behaviors An object describing the behavior to attach to this single element\n * @param {string} behaviors.action The name of the action that would trigger this behavior (eg click, mouseover, etc)\n * @param {string} behaviors.status What status to apply to the element when this behavior is triggered (highlighted,\n * selected, etc)\n * @param {string} [behaviors.exclusive] Whether triggering the event for this element should unset the relevant status\n * for all other elements. Useful for, eg, click events that exclusively highlight one thing.\n * @returns {function(this:LocusZoom.DataLayer)} Return a function that handles the event in context with the behavior\n * and the element- can be attached as an event listener\n */\nLocusZoom.DataLayer.prototype.executeBehaviors = function(directive, behaviors) {\n\n // Determine the required state of control and shift keys during the event\n var requiredKeyStates = {\n \"ctrl\": (directive.indexOf(\"ctrl\") !== -1),\n \"shift\": (directive.indexOf(\"shift\") !== -1)\n };\n\n return function(element){\n\n // Do nothing if the required control and shift key presses (or lack thereof) doesn't match the event\n if (requiredKeyStates.ctrl !== !!d3.event.ctrlKey || requiredKeyStates.shift !== !!d3.event.shiftKey){ return; }\n\n // Loop through behaviors making each one go in succession\n behaviors.forEach(function(behavior){\n \n // Route first by the action, if defined\n if (typeof behavior != \"object\" || behavior === null){ return; }\n \n switch (behavior.action){\n \n // Set a status (set to true regardless of current status, optionally with exclusivity)\n case \"set\":\n this.setElementStatus(behavior.status, element, true, behavior.exclusive);\n break;\n \n // Unset a status (set to false regardless of current status, optionally with exclusivity)\n case \"unset\":\n this.setElementStatus(behavior.status, element, false, behavior.exclusive);\n break;\n \n // Toggle a status\n case \"toggle\":\n var current_status_boolean = (this.state[this.state_id][behavior.status].indexOf(this.getElementId(element)) !== -1);\n var exclusive = behavior.exclusive && !current_status_boolean;\n this.setElementStatus(behavior.status, element, !current_status_boolean, exclusive);\n break;\n \n // Link to a dynamic URL\n case \"link\":\n if (typeof behavior.href == \"string\"){\n var url = LocusZoom.parseFields(element, behavior.href);\n if (typeof behavior.target == \"string\"){\n window.open(url, behavior.target);\n } else {\n window.location.href = url;\n }\n }\n break;\n \n // Action not defined, just return\n default:\n break;\n \n }\n \n return;\n \n }.bind(this));\n\n }.bind(this);\n\n};\n\n/**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\nLocusZoom.DataLayer.prototype.getPageOrigin = function(){\n var panel_origin = this.parent.getPageOrigin();\n return {\n x: panel_origin.x + this.parent.layout.margin.left,\n y: panel_origin.y + this.parent.layout.margin.top\n };\n};\n\n/**\n * Get a data layer's current underlying data in a standard format (e.g. JSON or CSV)\n * @param {('csv'|'tsv'|'json')} format How to export the data\n * @returns {*}\n */\nLocusZoom.DataLayer.prototype.exportData = function(format){\n var default_format = \"json\";\n format = format || default_format;\n format = (typeof format == \"string\" ? format.toLowerCase() : default_format);\n if ([\"json\",\"csv\",\"tsv\"].indexOf(format) === -1){ format = default_format; }\n var ret;\n switch (format){\n case \"json\":\n try {\n ret = JSON.stringify(this.data);\n } catch (e){\n ret = null;\n console.error(\"Unable to export JSON data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n case \"tsv\":\n case \"csv\":\n try {\n var jsonified = JSON.parse(JSON.stringify(this.data));\n if (typeof jsonified != \"object\"){\n ret = jsonified.toString();\n } else if (!Array.isArray(jsonified)){\n ret = \"Object\";\n } else {\n var delimiter = (format === \"tsv\") ? \"\\t\" : \",\";\n var header = this.layout.fields.map(function(header){\n return JSON.stringify(header);\n }).join(delimiter) + \"\\n\";\n ret = header + jsonified.map(function(record){\n return this.layout.fields.map(function(field){\n if (typeof record[field] == \"undefined\"){\n return JSON.stringify(null);\n } else if (typeof record[field] == \"object\" && record[field] !== null){\n return Array.isArray(record[field]) ? \"\\\"[Array(\" + record[field].length + \")]\\\"\" : \"\\\"[Object]\\\"\";\n } else {\n return JSON.stringify(record[field]);\n }\n }).join(delimiter);\n }.bind(this)).join(\"\\n\");\n }\n } catch (e){\n ret = null;\n console.error(\"Unable to export CSV data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n }\n return ret;\n};\n\n/**\n * Position the datalayer and all tooltips\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.draw = function(){\n this.svg.container.attr(\"transform\", \"translate(\" + this.parent.layout.cliparea.origin.x + \",\" + this.parent.layout.cliparea.origin.y + \")\");\n this.svg.clipRect\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.parent.layout.cliparea.height);\n this.positionAllTooltips();\n return this;\n};\n\n\n/**\n * Re-Map a data layer to reflect changes in the state of a plot (such as viewing region/ chromosome range)\n * @return {Promise}\n */\nLocusZoom.DataLayer.prototype.reMap = function(){\n\n this.destroyAllTooltips(); // hack - only non-visible tooltips should be destroyed\n // and then recreated if returning to visibility\n\n // Fetch new data. Datalayers are only given access to the final consolidated data from the chain (not headers or raw payloads)\n var promise = this.parent_plot.lzd.getData(this.state, this.layout.fields);\n promise.then(function(new_data) {\n this.data = new_data.body;\n this.applyDataMethods();\n this.initialized = true;\n }.bind(this));\n\n return promise;\n};\n\n\n/**\n * The central registry of known data layer definitions (which may be stored in separate files due to length)\n * @namespace\n */\nLocusZoom.DataLayers = (function() {\n var obj = {};\n var datalayers = {};\n /**\n * @name LocusZoom.DataLayers.get\n * @param {String} name The name of the datalayer\n * @param {Object} layout The configuration object for this data layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n * @returns {LocusZoom.DataLayer}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (datalayers[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for data layer [\" + name + \"]\");\n } else {\n return new datalayers[name](layout, parent);\n }\n } else {\n throw(\"data layer [\" + name + \"] not found\");\n }\n };\n\n /**\n * @name LocusZoom.DataLayers.set\n * @protected\n * @param {String} name\n * @param {Function} datalayer Constructor for the datalayer\n */\n obj.set = function(name, datalayer) {\n if (datalayer) {\n if (typeof datalayer != \"function\"){\n throw(\"unable to set data layer [\" + name + \"], argument provided is not a function\");\n } else {\n datalayers[name] = datalayer;\n datalayers[name].prototype = new LocusZoom.DataLayer();\n }\n } else {\n delete datalayers[name];\n }\n };\n\n /**\n * Add a new type of datalayer to the registry of known layer types\n * @name LocusZoom.DataLayers.add\n * @param {String} name The name of the data layer to register\n * @param {Function} datalayer\n */\n obj.add = function(name, datalayer) {\n if (datalayers[name]) {\n throw(\"data layer already exists with name: \" + name);\n } else {\n obj.set(name, datalayer);\n }\n };\n\n /**\n * Register a new datalayer that inherits and extends basic behaviors from a known datalayer\n * @param {String} parent_name The name of the parent data layer whose behavior is to be extended\n * @param {String} name The name of the new datalayer to register\n * @param {Object} [overrides] Object of properties and methods to combine with the prototype of the parent datalayer\n * @returns {Function} The constructor for the new child class\n */\n obj.extend = function(parent_name, name, overrides) {\n // TODO: Consider exposing additional constructor argument, if there is a use case for very granular extension\n overrides = overrides || {};\n\n var parent = datalayers[parent_name];\n if (!parent) {\n throw \"Attempted to subclass an unknown or unregistered datalayer type\";\n }\n if (typeof overrides !== \"object\") {\n throw \"Must specify an object of properties and methods\";\n }\n var child = LocusZoom.subclass(parent, overrides);\n // Bypass .set() because we want a layer of inheritance below `DataLayer`\n datalayers[name] = child;\n return child;\n };\n\n /**\n * List the names of all known datalayers\n * @name LocusZoom.DataLayers.list\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(datalayers);\n };\n\n return obj;\n})();\n","\"use strict\";\n\n/**\n * Create a single continuous 2D track that provides information about each datapoint\n *\n * For example, this can be used to color by membership in a group, alongside information in other panels\n *\n * @class LocusZoom.DataLayers.annotation_track\n * @augments LocusZoom.DataLayer\n * @param {Object} layout\n * @param {Object|String} [layout.color]\n * @param {Array[]} An array of filter entries specifying which points to draw annotations for.\n * See `LocusZoom.DataLayer.filter` for details\n */\nLocusZoom.DataLayers.add(\"annotation_track\", function(layout) {\n // In the future we may add additional options for controlling marker size/ shape, based on user feedback\n this.DefaultLayout = {\n color: \"#000000\",\n filters: []\n };\n\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n if (!Array.isArray(layout.filters)) {\n throw \"Annotation track must specify array of filters for selecting points to annotate\";\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n this.render = function() {\n var self = this;\n // Only render points that currently satisfy all provided filter conditions.\n var trackData = this.filter(this.layout.filters, \"elements\");\n\n var selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-\" + self.layout.type)\n .data(trackData, function(d) { return d[self.layout.id_field]; });\n\n // Add new elements as needed\n selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function (d){ return self.getElementId(d); });\n // Update the set of elements to reflect new data\n selection\n .attr(\"x\", function (d) { return self.parent[\"x_scale\"](d[self.layout.x_axis.field]); })\n .attr(\"width\", 1) // TODO autocalc width of track? Based on datarange / pixel width presumably\n .attr(\"height\", self.parent.layout.height)\n .attr(\"fill\", function(d){ return self.resolveScalableParameter(self.layout.color, d); });\n // Remove unused elements\n selection.exit().remove();\n\n // Set up tooltips and mouse interaction\n this.applyBehaviors(selection);\n };\n\n // Reimplement the positionTooltip() method to be annotation-specific\n this.positionTooltip = function(id) {\n if (typeof id != \"string\") {\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]) {\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var offset = stroke_width / 2;\n var page_origin = this.getPageOrigin();\n\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_center = data_layer_height / 2;\n\n // Tooltip should be horizontally centered above the point to be annotated. (or below if space is limited)\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width) + offset_left - offset_right - offset;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - y_center) {\n top = page_origin.y + y_center - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow) {\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n return this;\n});\n","\"use strict\";\n\n/*********************\n Forest Data Layer\n Implements a standard forest plot\n*/\n\nLocusZoom.DataLayers.add(\"forest\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"square\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 2\n },\n id_field: \"id\",\n confidence_intervals: {\n start_field: \"ci_start\",\n end_field: \"ci_end\"\n },\n show_no_significance_line: true\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be forest-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n var offset = Math.sqrt(point_size / Math.PI);\n var left, arrow_type, arrow_left;\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var top, arrow_top;\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n } \n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Implement the main render function\n this.render = function(){\n\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate confidence interval paths if fields are defined\n if (this.layout.confidence_intervals\n && this.layout.fields.indexOf(this.layout.confidence_intervals.start_field) !== -1\n && this.layout.fields.indexOf(this.layout.confidence_intervals.end_field) !== -1){\n // Generate a selection for all forest plot confidence intervals\n var ci_selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-forest.lz-data_layer-forest-ci\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n // Create confidence interval rect elements\n ci_selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-ci\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_ci\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + (isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height) + \")\");\n // Apply position and size parameters using transition if necessary\n var ci_transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n var ci_width = function(d){\n return this.parent[x_scale](d[this.layout.confidence_intervals.end_field])\n - this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n }.bind(this);\n var ci_height = 1;\n if (this.canTransition()){\n ci_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n } else {\n ci_selection\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n }\n // Remove old elements as needed\n ci_selection.exit().remove();\n }\n \n // Generate a selection for all forest plot points\n var points_selection = this.svg.group\n .selectAll(\"path.lz-data_layer-forest.lz-data_layer-forest-point\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n points_selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-point\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_point\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n if (this.canTransition()){\n points_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n points_selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n points_selection.exit().remove();\n\n // Apply default event emitters to selection\n points_selection.on(\"click.event_emitter\", function(element_data){\n this.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n \n // Apply behaviors to points\n this.applyBehaviors(points_selection);\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Genes Data Layer\n * Implements a data layer that will render gene tracks\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"genes\", function(layout){\n /**\n * Define a default layout for this DataLayer type and merge it with the passed argument\n * @protected\n * @member {Object}\n * */\n this.DefaultLayout = {\n // Optionally specify different fill and stroke properties\n stroke: \"rgb(54, 54, 150)\",\n color: \"#363696\",\n label_font_size: 12,\n label_exon_spacing: 4,\n exon_height: 16,\n bounding_box_padding: 6,\n track_vertical_spacing: 10\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Generate a statusnode ID for a given element\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n return this.getElementId(element) + \"-statusnode\";\n };\n\n /**\n * Helper function to sum layout values to derive total height for a single gene track\n * @returns {number}\n */\n this.getTrackHeight = function(){\n return 2 * this.layout.bounding_box_padding\n + this.layout.label_font_size\n + this.layout.label_exon_spacing\n + this.layout.exon_height\n + this.layout.track_vertical_spacing;\n };\n\n /**\n * A gene may have arbitrarily many transcripts, but this data layer isn't set up to render them yet.\n * Stash a transcript_idx to point to the first transcript and use that for all transcript refs.\n * @member {number}\n * @type {number}\n */\n this.transcript_idx = 0;\n\n /**\n * An internal counter for the number of tracks in the data layer. Used as an internal counter for looping\n * over positions / assignments\n * @protected\n * @member {number}\n */\n this.tracks = 1;\n\n /**\n * Store information about genes in dataset, in a hash indexed by track number: {track_number: [gene_indices]}\n * @member {Object.}\n */\n this.gene_track_index = { 1: [] };\n\n /**\n * Ensure that genes in overlapping chromosome regions are positioned so that parts of different genes do not\n * overlap in the view. A track is a row used to vertically separate overlapping genes.\n * @returns {LocusZoom.DataLayer}\n */\n this.assignTracks = function(){\n /**\n * Function to get the width in pixels of a label given the text and layout attributes\n * TODO: Move to outer scope?\n * @param {String} gene_name\n * @param {number|string} font_size\n * @returns {number}\n */\n this.getLabelWidth = function(gene_name, font_size){\n try {\n var temp_text = this.svg.group.append(\"text\")\n .attr(\"x\", 0).attr(\"y\", 0).attr(\"class\", \"lz-data_layer-genes lz-label\")\n .style(\"font-size\", font_size)\n .text(gene_name + \"→\");\n var label_width = temp_text.node().getBBox().width;\n temp_text.remove();\n return label_width;\n } catch (e){\n return 0;\n }\n };\n\n // Reinitialize some metadata\n this.tracks = 1;\n this.gene_track_index = { 1: [] };\n\n this.data.map(function(d, g){\n\n // If necessary, split combined gene id / version fields into discrete fields.\n // NOTE: this may be an issue with CSG's genes data source that may eventually be solved upstream.\n if (this.data[g].gene_id && this.data[g].gene_id.indexOf(\".\")){\n var split = this.data[g].gene_id.split(\".\");\n this.data[g].gene_id = split[0];\n this.data[g].gene_version = split[1];\n }\n\n // Stash the transcript ID on the parent gene\n this.data[g].transcript_id = this.data[g].transcripts[this.transcript_idx].transcript_id;\n\n // Determine display range start and end, based on minimum allowable gene display width, bounded by what we can see\n // (range: values in terms of pixels on the screen)\n this.data[g].display_range = {\n start: this.parent.x_scale(Math.max(d.start, this.state.start)),\n end: this.parent.x_scale(Math.min(d.end, this.state.end))\n };\n this.data[g].display_range.label_width = this.getLabelWidth(this.data[g].gene_name, this.layout.label_font_size);\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n // Determine label text anchor (default to middle)\n this.data[g].display_range.text_anchor = \"middle\";\n if (this.data[g].display_range.width < this.data[g].display_range.label_width){\n if (d.start < this.state.start){\n this.data[g].display_range.end = this.data[g].display_range.start\n + this.data[g].display_range.label_width\n + this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"start\";\n } else if (d.end > this.state.end){\n this.data[g].display_range.start = this.data[g].display_range.end\n - this.data[g].display_range.label_width\n - this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n var centered_margin = ((this.data[g].display_range.label_width - this.data[g].display_range.width) / 2)\n + this.layout.label_font_size;\n if ((this.data[g].display_range.start - centered_margin) < this.parent.x_scale(this.state.start)){\n this.data[g].display_range.start = this.parent.x_scale(this.state.start);\n this.data[g].display_range.end = this.data[g].display_range.start + this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"start\";\n } else if ((this.data[g].display_range.end + centered_margin) > this.parent.x_scale(this.state.end)) {\n this.data[g].display_range.end = this.parent.x_scale(this.state.end);\n this.data[g].display_range.start = this.data[g].display_range.end - this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n this.data[g].display_range.start -= centered_margin;\n this.data[g].display_range.end += centered_margin;\n }\n }\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n }\n // Add bounding box padding to the calculated display range start, end, and width\n this.data[g].display_range.start -= this.layout.bounding_box_padding;\n this.data[g].display_range.end += this.layout.bounding_box_padding;\n this.data[g].display_range.width += 2 * this.layout.bounding_box_padding;\n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[g].display_domain = {\n start: this.parent.x_scale.invert(this.data[g].display_range.start),\n end: this.parent.x_scale.invert(this.data[g].display_range.end)\n };\n this.data[g].display_domain.width = this.data[g].display_domain.end - this.data[g].display_domain.start;\n\n // Using display range/domain data generated above cast each gene to tracks such that none overlap\n this.data[g].track = null;\n var potential_track = 1;\n while (this.data[g].track === null){\n var collision_on_potential_track = false;\n this.gene_track_index[potential_track].map(function(placed_gene){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_gene.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_gene.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_gene.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[g]));\n if (!collision_on_potential_track){\n this.data[g].track = potential_track;\n this.gene_track_index[potential_track].push(this.data[g]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.gene_track_index[potential_track] = [];\n }\n }\n }\n\n // Stash parent references on all genes, trascripts, and exons\n this.data[g].parent = this;\n this.data[g].transcripts.map(function(d, t){\n this.data[g].transcripts[t].parent = this.data[g];\n this.data[g].transcripts[t].exons.map(function(d, e){\n this.data[g].transcripts[t].exons[e].parent = this.data[g].transcripts[t];\n }.bind(this));\n }.bind(this));\n\n }.bind(this));\n return this;\n };\n\n /**\n * Main render function\n */\n this.render = function(){\n\n var self = this;\n this.assignTracks();\n\n var width, height, x, y;\n\n // Render gene groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-genes\")\n .data(this.data, function(d){ return d.gene_name; });\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-genes\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(gene){\n\n var data_layer = gene.parent;\n\n // Render gene bounding boxes (status nodes to show selected/highlighted)\n var bboxes = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-data_layer-genes-statusnode\")\n .data([gene], function(d){ return data_layer.getElementStatusNodeId(d); });\n\n bboxes.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-data_layer-genes-statusnode\");\n \n bboxes\n .attr(\"id\", function(d){\n return data_layer.getElementStatusNodeId(d);\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n bboxes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n bboxes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n bboxes.exit().remove();\n\n // Render gene boundaries\n var boundary_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d); };\n var boundary_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d); };\n var boundaries = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-boundary\")\n .data([gene], function(d){ return d.gene_name + \"_boundary\"; })\n .style({ fill: boundary_fill, stroke: boundary_stroke });\n\n boundaries.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-boundary\");\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return 1; // TODO: scale dynamically?\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing\n + (Math.max(data_layer.layout.exon_height, 3) / 2);\n };\n if (data_layer.canTransition()){\n boundaries\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n boundaries\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n \n boundaries.exit().remove();\n\n // Render gene labels\n var labels = d3.select(this).selectAll(\"text.lz-data_layer-genes.lz-label\")\n .data([gene], function(d){ return d.gene_name + \"_label\"; });\n\n labels.enter().append(\"text\")\n .attr(\"class\", \"lz-data_layer-genes lz-label\");\n\n labels\n .attr(\"text-anchor\", function(d){\n return d.display_range.text_anchor;\n })\n .text(function(d){\n return (d.strand === \"+\") ? d.gene_name + \"→\" : \"←\" + d.gene_name;\n })\n .style(\"font-size\", gene.parent.layout.label_font_size);\n\n x = function(d){\n if (d.display_range.text_anchor === \"middle\"){\n return d.display_range.start + (d.display_range.width / 2);\n } else if (d.display_range.text_anchor === \"start\"){\n return d.display_range.start + data_layer.layout.bounding_box_padding;\n } else if (d.display_range.text_anchor === \"end\"){\n return d.display_range.end - data_layer.layout.bounding_box_padding;\n }\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size;\n };\n if (data_layer.canTransition()){\n labels\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"x\", x).attr(\"y\", y);\n } else {\n labels\n .attr(\"x\", x).attr(\"y\", y);\n }\n\n labels.exit().remove();\n\n // Render exon rects (first transcript only, for now)\n // Exons: by default color on gene properties for consistency with the gene boundary track- hence color uses d.parent.parent\n var exon_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d.parent.parent); };\n var exon_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d.parent.parent); };\n\n var exons = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-exon\")\n .data(gene.transcripts[gene.parent.transcript_idx].exons, function(d){ return d.exon_id; });\n\n exons.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-exon\");\n\n exons\n .style({ fill: exon_fill, stroke: exon_stroke });\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return data_layer.layout.exon_height;\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(){\n return ((gene.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing;\n };\n if (data_layer.canTransition()){\n exons\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n exons\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n exons.exit().remove();\n\n // Render gene click area\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-clickarea\")\n .data([gene], function(d){ return d.gene_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click.event_emitter\", function(element){\n element.parent.parent.emit(\"element_clicked\", element, true);\n });\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n };\n\n /**\n * Reimplement the positionTooltip() method to be gene-specific\n * @param {String} id\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var gene_bbox_id = this.getElementStatusNodeId(tooltip.data);\n var gene_bbox = d3.select(\"#\" + gene_bbox_id).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the gene that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var gene_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - gene_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + gene_center_x - data_layer_width, 0);\n var left = page_origin.x + gene_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the gene unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (gene_bbox.y + gene_bbox.height)){\n top = page_origin.y + gene_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + gene_bbox.y + gene_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Genome Legend Data Layer\n Implements a data layer that will render a genome legend\n*/\n\n// Build a custom data layer for a genome legend\nLocusZoom.DataLayers.add(\"genome_legend\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n chromosome_fill_colors: {\n light: \"rgb(155, 155, 188)\",\n dark: \"rgb(95, 95, 128)\"\n },\n chromosome_label_colors: {\n light: \"rgb(120, 120, 186)\",\n dark: \"rgb(0, 0, 66)\"\n }\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Implement the main render function\n this.render = function(){\n\n // Iterate over data to generate genome-wide start/end values for each chromosome\n var position = 0;\n this.data.forEach(function(d, i){\n this.data[i].genome_start = position;\n this.data[i].genome_end = position + d[\"genome:base_pairs\"];\n position += d[\"genome:base_pairs\"];\n }.bind(this));\n\n var chromosomes = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend\")\n .data(this.data, function(d){ return d[\"genome:chr\"]; });\n\n // Create chromosome elements, apply class\n chromosomes.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend\");\n\n // Position and fill chromosome rects\n var data_layer = this;\n var panel = this.parent;\n\n chromosomes\n .attr(\"fill\", function(d){ return (d[\"genome:chr\"] % 2 ? data_layer.layout.chromosome_fill_colors.light : data_layer.layout.chromosome_fill_colors.dark); })\n .attr(\"x\", function(d){ return panel.x_scale(d.genome_start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d[\"genome:base_pairs\"]); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n // Remove old elements as needed\n chromosomes.exit().remove();\n\n // Parse current state variant into a position\n // Assumes that variant string is of the format 10:123352136_C/T or 10:123352136\n var variant_parts = /([^:]+):(\\d+)(?:_.*)?/.exec(this.state.variant);\n if (!variant_parts) {\n throw(\"Genome legend cannot understand the specified variant position\");\n }\n var chr = variant_parts[1];\n var offset = variant_parts[2];\n // TODO: How does this handle representation of X or Y chromosomes?\n position = +this.data[chr-1].genome_start + +offset;\n\n // Render the position\n var region = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend-marker\")\n .data([{ start: position, end: position + 1 }]);\n\n region.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend-marker\");\n\n region\n .transition()\n .duration(500)\n .style({\n \"fill\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke-width\": \"3px\"\n })\n .attr(\"x\", function(d){ return panel.x_scale(d.start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d.end - d.start); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n region.exit().remove();\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/**\n * Intervals Data Layer\n * Implements a data layer that will render interval annotation tracks (intervals must provide start and end values)\n * @class LocusZoom.DataLayers.intervals\n * @augments LocusZoom.DataLayer\n */\nLocusZoom.DataLayers.add(\"intervals\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n start_field: \"start\",\n end_field: \"end\",\n track_split_field: \"state_id\",\n track_split_order: \"DESC\",\n track_split_legend_to_y_axis: 2,\n split_tracks: true,\n track_height: 15,\n track_vertical_spacing: 3,\n bounding_box_padding: 2,\n always_hide_legend: false,\n color: \"#B8B8B8\",\n fill_opacity: 1\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n \n /**\n * To define shared highlighting on the track split field define the status node id override\n * to generate an ID common to the track when we're actively splitting data out to separate tracks\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n if (this.layout.split_tracks){\n return (this.getBaseId() + \"-statusnode-\" + element[this.layout.track_split_field]).replace(/[:.[\\],]/g, \"_\");\n }\n return this.getElementId(element) + \"-statusnode\";\n }.bind(this);\n \n // Helper function to sum layout values to derive total height for a single interval track\n this.getTrackHeight = function(){\n return this.layout.track_height\n + this.layout.track_vertical_spacing\n + (2 * this.layout.bounding_box_padding);\n };\n\n this.tracks = 1;\n this.previous_tracks = 1;\n \n // track-number-indexed object with arrays of interval indexes in the dataset\n this.interval_track_index = { 1: [] };\n\n // After we've loaded interval data interpret it to assign\n // each to a track so that they do not overlap in the view\n this.assignTracks = function(){\n\n // Reinitialize some metadata\n this.previous_tracks = this.tracks;\n this.tracks = 0;\n this.interval_track_index = { 1: [] };\n this.track_split_field_index = {};\n \n // If splitting tracks by a field's value then do a first pass determine\n // a value/track mapping that preserves the order of possible values\n if (this.layout.track_split_field && this.layout.split_tracks){\n this.data.map(function(d){\n this.track_split_field_index[d[this.layout.track_split_field]] = null;\n }.bind(this));\n var index = Object.keys(this.track_split_field_index);\n if (this.layout.track_split_order === \"DESC\"){ index.reverse(); }\n index.forEach(function(val){\n this.track_split_field_index[val] = this.tracks + 1;\n this.interval_track_index[this.tracks + 1] = [];\n this.tracks++;\n }.bind(this));\n }\n\n this.data.map(function(d, i){\n\n // Stash a parent reference on the interval\n this.data[i].parent = this;\n\n // Determine display range start and end, based on minimum allowable interval display width,\n // bounded by what we can see (range: values in terms of pixels on the screen)\n this.data[i].display_range = {\n start: this.parent.x_scale(Math.max(d[this.layout.start_field], this.state.start)),\n end: this.parent.x_scale(Math.min(d[this.layout.end_field], this.state.end))\n };\n this.data[i].display_range.width = this.data[i].display_range.end - this.data[i].display_range.start;\n \n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[i].display_domain = {\n start: this.parent.x_scale.invert(this.data[i].display_range.start),\n end: this.parent.x_scale.invert(this.data[i].display_range.end)\n };\n this.data[i].display_domain.width = this.data[i].display_domain.end - this.data[i].display_domain.start;\n\n // If splitting to tracks based on the value of the designated track split field\n // then don't bother with collision detection (intervals will be grouped on tracks\n // solely by the value of track_split_field)\n if (this.layout.track_split_field && this.layout.split_tracks){\n var val = this.data[i][this.layout.track_split_field];\n this.data[i].track = this.track_split_field_index[val];\n this.interval_track_index[this.data[i].track].push(i);\n } else {\n // If not splitting to tracks based on a field value then do so based on collision\n // detection (as how it's done for genes). Use display range/domain data generated\n // above and cast each interval to tracks such that none overlap\n this.tracks = 1;\n this.data[i].track = null;\n var potential_track = 1;\n while (this.data[i].track === null){\n var collision_on_potential_track = false;\n this.interval_track_index[potential_track].map(function(placed_interval){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_interval.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_interval.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_interval.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[i]));\n if (!collision_on_potential_track){\n this.data[i].track = potential_track;\n this.interval_track_index[potential_track].push(this.data[i]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.interval_track_index[potential_track] = [];\n }\n }\n }\n\n }\n\n }.bind(this));\n\n return this;\n };\n\n // Implement the main render function\n this.render = function(){\n\n this.assignTracks();\n\n // Remove any shared highlight nodes and re-render them if we're splitting on tracks\n // At most there will only be dozen or so nodes here (one per track) and each time\n // we render data we may have new tracks, so wiping/redrawing all is reasonable.\n this.svg.group.selectAll(\".lz-data_layer-intervals-statusnode.lz-data_layer-intervals-shared\").remove();\n Object.keys(this.track_split_field_index).forEach(function(key){\n // Make a psuedo-element so that we can generate an id for the shared node\n var psuedoElement = {};\n psuedoElement[this.layout.track_split_field] = key;\n // Insert the shared node\n var sharedstatusnode_style = {display: (this.layout.split_tracks ? null : \"none\")};\n this.svg.group.insert(\"rect\", \":first-child\")\n .attr(\"id\", this.getElementStatusNodeId(psuedoElement))\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-shared\")\n .attr(\"rx\", this.layout.bounding_box_padding).attr(\"ry\", this.layout.bounding_box_padding)\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.getTrackHeight() - this.layout.track_vertical_spacing)\n .attr(\"x\", 0)\n .attr(\"y\", (this.track_split_field_index[key]-1) * this.getTrackHeight())\n .style(sharedstatusnode_style);\n }.bind(this));\n\n var width, height, x, y, fill, fill_opacity;\n \n // Render interval groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-intervals\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-intervals\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(interval){\n\n var data_layer = interval.parent;\n\n // Render interval status nodes (displayed behind intervals to show highlight\n // without needing to modify interval display element(s))\n var statusnode_style = {display: (data_layer.layout.split_tracks ? \"none\" : null)};\n var statusnodes = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-data_layer-intervals-statusnode.lz-data_layer-intervals-statusnode-discrete\")\n .data([interval], function(d){ return data_layer.getElementId(d) + \"-statusnode\"; });\n statusnodes.enter().insert(\"rect\", \":first-child\")\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-statusnode-discrete\");\n statusnodes\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"-statusnode\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .style(statusnode_style);\n width = function(d){\n return d.display_range.width + (2 * data_layer.layout.bounding_box_padding);\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start - data_layer.layout.bounding_box_padding;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n statusnodes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n statusnodes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n statusnodes.exit().remove();\n\n // Render primary interval rects\n var rects = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-interval_rect\")\n .data([interval], function(d){ return d[data_layer.layout.id_field] + \"_interval_rect\"; });\n\n rects.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-interval_rect\");\n\n height = data_layer.layout.track_height;\n width = function(d){\n return d.display_range.width;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding;\n };\n fill = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.color, d);\n };\n fill_opacity = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.fill_opacity, d);\n };\n \n \n if (data_layer.canTransition()){\n rects\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n } else {\n rects\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n }\n \n rects.exit().remove();\n\n // Render interval click areas\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-clickarea\")\n .data([interval], function(d){ return d.interval_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click\", function(element_data){\n element_data.parent.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Update the legend axis if the number of ticks changed\n if (this.previous_tracks !== this.tracks){\n this.updateSplitTrackAxis();\n }\n\n return this;\n\n };\n \n // Reimplement the positionTooltip() method to be interval-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var interval_bbox = d3.select(\"#\" + this.getElementStatusNodeId(tooltip.data)).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the interval that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var interval_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - interval_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + interval_center_x - data_layer_width, 0);\n var left = page_origin.x + interval_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the interval unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (interval_bbox.y + interval_bbox.height)){\n top = page_origin.y + interval_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + interval_bbox.y + interval_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Redraw split track axis or hide it, and show/hide the legend, as determined\n // by current layout parameters and data\n this.updateSplitTrackAxis = function(){\n var legend_axis = this.layout.track_split_legend_to_y_axis ? \"y\" + this.layout.track_split_legend_to_y_axis : false;\n if (this.layout.split_tracks){\n var tracks = +this.tracks || 0;\n var track_height = +this.layout.track_height || 0;\n var track_spacing = 2 * (+this.layout.bounding_box_padding || 0) + (+this.layout.track_vertical_spacing || 0);\n var target_height = (tracks * track_height) + ((tracks - 1) * track_spacing);\n this.parent.scaleHeightToData(target_height);\n if (legend_axis && this.parent.legend){\n this.parent.legend.hide(); \n this.parent.layout.axes[legend_axis] = {\n render: true,\n ticks: [],\n range: {\n start: (target_height - (this.layout.track_height/2)),\n end: (this.layout.track_height/2)\n }\n };\n this.layout.legend.forEach(function(element){\n var key = element[this.layout.track_split_field];\n var track = this.track_split_field_index[key];\n if (track){\n if (this.layout.track_split_order === \"DESC\"){\n track = Math.abs(track - tracks - 1);\n }\n this.parent.layout.axes[legend_axis].ticks.push({\n y: track,\n text: element.label\n });\n }\n }.bind(this));\n this.layout.y_axis = {\n axis: this.layout.track_split_legend_to_y_axis,\n floor: 1,\n ceiling: tracks\n };\n this.parent.render();\n }\n this.parent_plot.positionPanels();\n } else {\n if (legend_axis && this.parent.legend){\n if (!this.layout.always_hide_legend){ this.parent.legend.show(); }\n this.parent.layout.axes[legend_axis] = { render: false };\n this.parent.render();\n }\n }\n return this;\n };\n\n // Method to not only toggle the split tracks boolean but also update\n // necessary display values to animate a complete merge/split\n this.toggleSplitTracks = function(){\n this.layout.split_tracks = !this.layout.split_tracks;\n if (this.parent.legend && !this.layout.always_hide_legend){\n this.parent.layout.margin.bottom = 5 + (this.layout.split_tracks ? 0 : this.parent.legend.layout.height + 5);\n }\n this.render();\n this.updateSplitTrackAxis();\n return this;\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Line Data Layer\n * Implements a standard line plot\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n /** @member {Object} */\n this.DefaultLayout = {\n style: {\n fill: \"none\",\n \"stroke-width\": \"2px\"\n },\n interpolate: \"linear\",\n x_axis: { field: \"x\" },\n y_axis: { field: \"y\", axis: 1 },\n hitarea_width: 5\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Var for storing mouse events for use in tool tip positioning\n /** @member {String} */\n this.mouse_event = null;\n\n /**\n * Var for storing the generated line function itself\n * @member {d3.svg.line}\n * */\n this.line = null;\n\n /**\n * The timeout identifier returned by setTimeout\n * @member {Number}\n */\n this.tooltip_timeout = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n\n /**\n * Helper function to get display and data objects representing\n * the x/y coordinates of the current mouse event with respect to the line in terms of the display\n * and the interpolated values of the x/y fields with respect to the line\n * @returns {{display: {x: *, y: null}, data: {}, slope: null}}\n */\n this.getMouseDisplayAndData = function(){\n var ret = {\n display: {\n x: d3.mouse(this.mouse_event)[0],\n y: null\n },\n data: {},\n slope: null\n };\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n ret.data[x_field] = this.parent[x_scale].invert(ret.display.x);\n var bisect = d3.bisector(function(datum) { return +datum[x_field]; }).left;\n var index = bisect(this.data, ret.data[x_field]) - 1;\n var startDatum = this.data[index];\n var endDatum = this.data[index + 1];\n var interpolate = d3.interpolateNumber(+startDatum[y_field], +endDatum[y_field]);\n var range = +endDatum[x_field] - +startDatum[x_field];\n ret.data[y_field] = interpolate((ret.data[x_field] % range) / range);\n ret.display.y = this.parent[y_scale](ret.data[y_field]);\n if (this.layout.tooltip.x_precision){\n ret.data[x_field] = ret.data[x_field].toPrecision(this.layout.tooltip.x_precision);\n }\n if (this.layout.tooltip.y_precision){\n ret.data[y_field] = ret.data[y_field].toPrecision(this.layout.tooltip.y_precision);\n }\n ret.slope = (this.parent[y_scale](endDatum[y_field]) - this.parent[y_scale](startDatum[y_field]))\n / (this.parent[x_scale](endDatum[x_field]) - this.parent[x_scale](startDatum[x_field]));\n return ret;\n };\n\n /**\n * Reimplement the positionTooltip() method to be line-specific\n * @param {String} id Identify the tooltip to be positioned\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var arrow_width = 7; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var stroke_width = parseFloat(this.layout.style[\"stroke-width\"]) || 1;\n var page_origin = this.getPageOrigin();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n var top, left, arrow_top, arrow_left, arrow_type;\n\n // Determine x/y coordinates for display and data\n var dd = this.getMouseDisplayAndData();\n\n // If the absolute value of the slope of the line at this point is above 1 (including Infinity)\n // then position the tool tip left/right. Otherwise position top/bottom.\n if (Math.abs(dd.slope) > 1){\n\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (dd.display.x <= this.parent.layout.width / 2){\n left = page_origin.x + dd.display.x + stroke_width + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + dd.display.x - tooltip_box.width - stroke_width - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n if (dd.display.y - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + dd.display.y - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (dd.display.y + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + dd.display.y + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + dd.display.y - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n\n } else {\n\n // Position horizontally: attempt to center on the mouse's x coordinate\n // pad to either side if bumping up against the edge of the data layer\n var offset_right = Math.max((tooltip_box.width / 2) - dd.display.x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + dd.display.x - data_layer_width, 0);\n left = page_origin.x + dd.display.x - (tooltip_box.width / 2) - offset_left + offset_right;\n var min_arrow_left = arrow_width / 2;\n var max_arrow_left = tooltip_box.width - (2.5 * arrow_width);\n arrow_left = (tooltip_box.width / 2) - arrow_width + offset_left - offset_right;\n arrow_left = Math.min(Math.max(arrow_left, min_arrow_left), max_arrow_left);\n\n // Position vertically above the line unless there's insufficient space\n if (tooltip_box.height + stroke_width + arrow_width > dd.display.y){\n top = page_origin.y + dd.display.y + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n } else {\n top = page_origin.y + dd.display.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n }\n }\n\n // Apply positions to the main div\n tooltip.selector.style({ left: left + \"px\", top: top + \"px\" });\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style({ \"left\": arrow_left + \"px\", top: arrow_top + \"px\" });\n\n };\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var data_layer = this;\n var panel = this.parent;\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Apply tooltip, etc\n if (this.layout.tooltip){\n // Generate an overlaying transparent \"hit area\" line for more intuitive mouse events\n var hitarea_width = parseFloat(this.layout.hitarea_width).toString() + \"px\";\n var hitarea = this.svg.group\n .selectAll(\"path.lz-data_layer-line-hitarea\")\n .data([this.data]);\n hitarea.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line-hitarea\")\n .style(\"stroke-width\", hitarea_width);\n var hitarea_line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n hitarea\n .attr(\"d\", hitarea_line)\n .on(\"mouseover\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.createTooltip(dd.data);\n })\n .on(\"mousemove\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.updateTooltip(dd.data);\n data_layer.positionTooltip(data_layer.getElementId());\n })\n .on(\"mouseout\", function(){\n data_layer.tooltip_timeout = setTimeout(function(){\n data_layer.mouse_event = null;\n data_layer.destroyTooltip(data_layer.getElementId());\n }, 300);\n });\n hitarea.exit().remove();\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n /**\n * Redefine setElementStatus family of methods as line data layers will only ever have a single path element\n * @param {String} status A member of `LocusZoom.DataLayer.Statuses.adjectives`\n * @param {String|Object} element\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\n this.setElementStatus = function(status, element, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setElementStatusByFilters = function(status, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setAllElementStatus = function(status, toggle){\n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n // Apply class to path based on global status flags\n var path_class = \"lz-data_layer-line\";\n Object.keys(this.global_statuses).forEach(function(global_status){\n if (this.global_statuses[global_status]){ path_class += \" lz-data_layer-line-\" + global_status; }\n }.bind(this));\n this.path.attr(\"class\", path_class);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n return this;\n };\n\n return this;\n\n});\n\n\n/***************************\n * Orthogonal Line Data Layer\n * Implements a horizontal or vertical line given an orientation and an offset in the layout\n * Does not require a data source\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"orthogonal_line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n style: {\n \"stroke\": \"#D3D3D3\",\n \"stroke-width\": \"3px\",\n \"stroke-dasharray\": \"10px 10px\"\n },\n orientation: \"horizontal\",\n x_axis: {\n axis: 1,\n decoupled: true\n },\n y_axis: {\n axis: 1,\n decoupled: true\n },\n offset: 0\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Require that orientation be \"horizontal\" or \"vertical\" only\n if ([\"horizontal\",\"vertical\"].indexOf(layout.orientation) === -1){\n layout.orientation = \"horizontal\";\n }\n\n // Vars for storing the data generated line\n /** @member {Array} */\n this.data = [];\n /** @member {d3.svg.line} */\n this.line = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var panel = this.parent;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n var x_extent = \"x_extent\";\n var y_extent = \"y\" + this.layout.y_axis.axis + \"_extent\";\n var x_range = \"x_range\";\n var y_range = \"y\" + this.layout.y_axis.axis + \"_range\";\n\n // Generate data using extents depending on orientation\n if (this.layout.orientation === \"horizontal\"){\n this.data = [\n { x: panel[x_extent][0], y: this.layout.offset },\n { x: panel[x_extent][1], y: this.layout.offset }\n ];\n } else {\n this.data = [\n { x: this.layout.offset, y: panel[y_extent][0] },\n { x: this.layout.offset, y: panel[y_extent][1] }\n ];\n }\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d, i) {\n var x = parseFloat(panel[x_scale](d[\"x\"]));\n return isNaN(x) ? panel[x_range][i] : x;\n })\n .y(function(d, i) {\n var y = parseFloat(panel[y_scale](d[\"y\"]));\n return isNaN(y) ? panel[y_range][i] : y;\n })\n .interpolate(\"linear\");\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Scatter Data Layer\n Implements a standard scatter plot\n*/\n\nLocusZoom.DataLayers.add(\"scatter\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"circle\",\n tooltip_positioning: \"horizontal\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 1\n },\n id_field: \"id\"\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Extra default for layout spacing\n // Not in default layout since that would make the label attribute always present\n if (layout.label && isNaN(layout.label.spacing)){\n layout.label.spacing = 4;\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be scatter-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var offset = Math.sqrt(point_size / Math.PI);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n if (this.layout.tooltip_positioning === \"vertical\"){\n // Position horizontally centered above the point\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right - offset;\n // Position vertically above the point unless there's insufficient space, then go below\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (y_center + offset)){\n top = page_origin.y + y_center - (offset + tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + offset + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n } else {\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Function to flip labels from being anchored at the start of the text to the end\n // Both to keep labels from running outside the data layer and also as a first\n // pass on recursive separation\n this.flip_labels = function(){\n var data_layer = this;\n var point_size = data_layer.resolveScalableParameter(data_layer.layout.point_size, {});\n var spacing = data_layer.layout.label.spacing;\n var handle_lines = Boolean(data_layer.layout.label.lines);\n var min_x = 2 * spacing;\n var max_x = data_layer.parent.layout.width - data_layer.parent.layout.margin.left - data_layer.parent.layout.margin.right - (2 * spacing);\n var flip = function(dn, dnl){\n var dnx = +dn.attr(\"x\");\n var text_swing = (2 * spacing) + (2 * Math.sqrt(point_size));\n if (handle_lines){\n var dnlx2 = +dnl.attr(\"x2\");\n var line_swing = spacing + (2 * Math.sqrt(point_size));\n }\n if (dn.style(\"text-anchor\") === \"start\"){\n dn.style(\"text-anchor\", \"end\");\n dn.attr(\"x\", dnx - text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 - line_swing); }\n } else {\n dn.style(\"text-anchor\", \"start\");\n dn.attr(\"x\", dnx + text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 + line_swing); }\n }\n };\n // Flip any going over the right edge from the right side to the left side\n // (all labels start on the right side)\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n if (dax + abound.width + spacing > max_x){\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n flip(da, dal);\n }\n });\n // Second pass to flip any others that haven't flipped yet if they collide with another label\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n if (da.style(\"text-anchor\") === \"end\") return;\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n data_layer.label_texts.each(function () {\n var b = this;\n var db = d3.select(b);\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (collision){\n flip(da, dal);\n // Double check that this flip didn't push the label past min_x. If it did, immediately flip back.\n dax = +da.attr(\"x\");\n if (dax - abound.width - spacing < min_x){\n flip(da, dal);\n }\n }\n return;\n });\n });\n };\n\n // Recursive function to space labels apart immediately after initial render\n // Adapted from thudfactor's fiddle here: https://jsfiddle.net/thudfactor/HdwTH/\n // TODO: Make labels also aware of data elements\n this.separate_labels = function(){\n this.seperate_iterations++;\n var data_layer = this;\n var alpha = 0.5;\n var spacing = this.layout.label.spacing;\n var again = false;\n data_layer.label_texts.each(function () {\n var a = this;\n var da = d3.select(a);\n var y1 = da.attr(\"y\");\n data_layer.label_texts.each(function () {\n var b = this;\n // a & b are the same element and don't collide.\n if (a === b) return;\n var db = d3.select(b);\n // a & b are on opposite sides of the chart and\n // don't collide\n if (da.attr(\"text-anchor\") !== db.attr(\"text-anchor\")) return;\n // Determine if the bounding rects for the two text elements collide\n var abound = da.node().getBoundingClientRect();\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (!collision) return;\n again = true;\n // If the labels collide, we'll push each\n // of the two labels up and down a little bit.\n var y2 = db.attr(\"y\");\n var sign = abound.top < bbound.top ? 1 : -1;\n var adjust = sign * alpha;\n var new_a_y = +y1 - adjust;\n var new_b_y = +y2 + adjust;\n // Keep new values from extending outside the data layer\n var min_y = 2 * spacing;\n var max_y = data_layer.parent.layout.height - data_layer.parent.layout.margin.top - data_layer.parent.layout.margin.bottom - (2 * spacing);\n var delta;\n if (new_a_y - (abound.height/2) < min_y){\n delta = +y1 - new_a_y;\n new_a_y = +y1;\n new_b_y += delta;\n } else if (new_b_y - (bbound.height/2) < min_y){\n delta = +y2 - new_b_y;\n new_b_y = +y2;\n new_a_y += delta;\n }\n if (new_a_y + (abound.height/2) > max_y){\n delta = new_a_y - +y1;\n new_a_y = +y1;\n new_b_y -= delta;\n } else if (new_b_y + (bbound.height/2) > max_y){\n delta = new_b_y - +y2;\n new_b_y = +y2;\n new_a_y -= delta;\n }\n da.attr(\"y\",new_a_y);\n db.attr(\"y\",new_b_y);\n });\n });\n if (again) {\n // Adjust lines to follow the labels\n if (data_layer.layout.label.lines){\n var label_elements = data_layer.label_texts[0];\n data_layer.label_lines.attr(\"y2\",function(d,i) {\n var label_line = d3.select(label_elements[i]);\n return label_line.attr(\"y\");\n });\n }\n // After ~150 iterations we're probably beyond diminising returns, so stop recursing\n if (this.seperate_iterations < 150){\n setTimeout(function(){\n this.separate_labels();\n }.bind(this), 1);\n }\n }\n };\n\n // Implement the main render function\n this.render = function(){\n\n var data_layer = this;\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate labels first (if defined)\n if (this.layout.label){\n // Apply filters to generate a filtered data set\n var filtered_data = this.data.filter(function(d){\n if (!data_layer.layout.label.filters){\n return true;\n } else {\n // Start by assuming a match, run through all filters to test if not a match on any one\n var match = true;\n data_layer.layout.label.filters.forEach(function(filter){\n var field_value = (new LocusZoom.Data.Field(filter.field)).resolve(d);\n if (isNaN(field_value)){\n match = false;\n } else {\n switch (filter.operator){\n case \"<\":\n if (!(field_value < filter.value)){ match = false; }\n break;\n case \"<=\":\n if (!(field_value <= filter.value)){ match = false; }\n break;\n case \">\":\n if (!(field_value > filter.value)){ match = false; }\n break;\n case \">=\":\n if (!(field_value >= filter.value)){ match = false; }\n break;\n case \"=\":\n if (!(field_value === filter.value)){ match = false; }\n break;\n default:\n // If we got here the operator is not valid, so the filter should fail\n match = false;\n break;\n }\n }\n });\n return match;\n }\n });\n // Render label groups\n var self = this;\n this.label_groups = this.svg.group\n .selectAll(\"g.lz-data_layer-\" + this.layout.type + \"-label\")\n .data(filtered_data, function(d){ return d[self.layout.id_field] + \"_label\"; });\n this.label_groups.enter()\n .append(\"g\")\n .attr(\"class\", \"lz-data_layer-\"+ this.layout.type + \"-label\");\n // Render label texts\n if (this.label_texts){ this.label_texts.remove(); }\n this.label_texts = this.label_groups.append(\"text\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_texts\n .text(function(d){\n return LocusZoom.parseFields(d, data_layer.layout.label.text || \"\");\n })\n .style(data_layer.layout.label.style || {})\n .attr({\n \"x\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + data_layer.layout.label.spacing;\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"text-anchor\": function(){\n return \"start\";\n }\n });\n // Render label lines\n if (data_layer.layout.label.lines){\n if (this.label_lines){ this.label_lines.remove(); }\n this.label_lines = this.label_groups.append(\"line\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_lines\n .style(data_layer.layout.label.lines.style || {})\n .attr({\n \"x1\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field]);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y1\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"x2\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + (data_layer.layout.label.spacing/2);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y2\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n }\n });\n }\n // Remove labels when they're no longer in the filtered data set\n this.label_groups.exit().remove();\n }\n \n // Generate main scatter data elements\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-\" + this.layout.type)\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Apply default event emitters to selection\n selection.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n \n // Apply mouse behaviors\n this.applyBehaviors(selection);\n \n // Apply method to keep labels from overlapping each other\n if (this.layout.label){\n this.flip_labels();\n this.seperate_iterations = 0;\n this.separate_labels();\n // Apply default event emitters to selection\n this.label_texts.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n // Extend mouse behaviors to labels\n this.applyBehaviors(this.label_texts);\n }\n \n };\n\n // Method to set a passed element as the LD reference in the plot-level state\n this.makeLDReference = function(element){\n var ref = null;\n if (typeof element == \"undefined\"){\n throw(\"makeLDReference requires one argument of any type\");\n } else if (typeof element == \"object\"){\n if (this.layout.id_field && typeof element[this.layout.id_field] != \"undefined\"){\n ref = element[this.layout.id_field].toString();\n } else if (typeof element[\"id\"] != \"undefined\"){\n ref = element[\"id\"].toString();\n } else {\n ref = element.toString();\n }\n } else {\n ref = element.toString();\n }\n this.parent_plot.applyState({ ldrefvar: ref });\n };\n \n return this;\n\n});\n\n/**\n * A scatter plot in which the x-axis represents categories, rather than individual positions.\n * For example, this can be used by PheWAS plots to show related groups. This plot allows the categories to be\n * determined dynamically when data is first loaded.\n *\n * @class LocusZoom.DataLayers.category_scatter\n * @augments LocusZoom.DataLayers.scatter\n */\nLocusZoom.DataLayers.extend(\"scatter\", \"category_scatter\", {\n /**\n * This plot layer makes certain assumptions about the data passed in. Transform the raw array of records from\n * the datasource to prepare it for plotting, as follows:\n * 1. The scatter plot assumes that all records are given in sequence (pre-grouped by `category_field`)\n * 2. It assumes that all records have an x coordinate for individual plotting\n * @private\n */\n _prepareData: function() {\n var xField = this.layout.x_axis.field || \"x\";\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n if (!category_field) {\n throw \"Layout for \" + this.layout.id + \" must specify category_field\";\n }\n // Sort the data so that things in the same category are adjacent (case-insensitive by specified field)\n var sourceData = this.data\n .sort(function(a, b) {\n var ak = a[category_field];\n var bk = b[category_field];\n var av = ak.toString ? ak.toString().toLowerCase() : ak;\n var bv = bk.toString ? bk.toString().toLowerCase() : bk;\n return (av === bv) ? 0 : (av < bv ? -1 : 1);});\n sourceData.forEach(function(d, i){\n // Implementation detail: Scatter plot requires specifying an x-axis value, and most datasources do not\n // specify plotting positions. If a point is missing this field, fill in a synthetic value.\n d[xField] = d[xField] || i;\n });\n return sourceData;\n },\n\n /**\n * Identify the unique categories on the plot, and update the layout with an appropriate color scheme.\n * Also identify the min and max x value associated with the category, which will be used to generate ticks\n * @private\n * @returns {Object.} Series of entries used to build category name ticks {category_name: [min_x, max_x]}\n */\n _generateCategoryBounds: function() {\n // TODO: API may return null values in category_field; should we add placeholder category label?\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n var xField = this.layout.x_axis.field || \"x\";\n var uniqueCategories = {};\n this.data.forEach(function(item) {\n var category = item[category_field];\n var x = item[xField];\n var bounds = uniqueCategories[category] || [x, x];\n uniqueCategories[category] = [Math.min(bounds[0], x), Math.max(bounds[1], x)];\n });\n\n var categoryNames = Object.keys(uniqueCategories);\n this._setDynamicColorScheme(categoryNames);\n\n return uniqueCategories;\n },\n\n /**\n * Automatically define a color scheme for the layer based on data returned from the server.\n * If part of the color scheme has been specified, it will fill in remaining missing information.\n *\n * There are three scenarios:\n * 1. The layout does not specify either category names or (color) values. Dynamically build both based on\n * the data and update the layout.\n * 2. The layout specifies colors, but not categories. Use that exact color information provided, and dynamically\n * determine what categories are present in the data. (cycle through the available colors, reusing if there\n * are a lot of categories)\n * 3. The layout specifies exactly what colors and categories to use (and they match the data!). This is useful to\n * specify an explicit mapping between color scheme and category names, when you want to be sure that the\n * plot matches a standard color scheme.\n * (If the layout specifies categories that do not match the data, the user specified categories will be ignored)\n *\n * This method will only act if the layout defines a `categorical_bin` scale function for coloring. It may be\n * overridden in a subclass to suit other types of coloring methods.\n *\n * @param {String[]} categoryNames\n * @private\n */\n _setDynamicColorScheme: function(categoryNames) {\n var colorParams = this.layout.color.parameters;\n var baseParams = this._base_layout.color.parameters;\n\n // If the layout does not use a supported coloring scheme, or is already complete, this method should do nothing\n if (this.layout.color.scale_function !== \"categorical_bin\") {\n throw \"This layer requires that coloring be specified as a `categorical_bin`\";\n }\n\n if (baseParams.categories.length && baseParams.values.length) {\n // If there are preset category/color combos, make sure that they apply to the actual dataset\n var parameters_categories_hash = {};\n baseParams.categories.forEach(function (category) { parameters_categories_hash[category] = 1; });\n if (categoryNames.every(function (name) { return parameters_categories_hash.hasOwnProperty(name); })) {\n // The layout doesn't have to specify categories in order, but make sure they are all there\n colorParams.categories = baseParams.categories;\n } else {\n colorParams.categories = categoryNames;\n }\n } else {\n colorParams.categories = categoryNames;\n }\n // Prefer user-specified colors if provided. Make sure that there are enough colors for all the categories.\n var colors;\n if (baseParams.values.length) {\n colors = baseParams.values;\n } else {\n var color_scale = categoryNames.length <= 10 ? d3.scale.category10 : d3.scale.category20;\n colors = color_scale().range();\n }\n while (colors.length < categoryNames.length) { colors = colors.concat(colors); }\n colors = colors.slice(0, categoryNames.length); // List of hex values, should be of same length as categories array\n colorParams.values = colors;\n },\n\n /**\n *\n * @param dimension\n * @param {Object} [config] Parameters that customize how ticks are calculated (not style)\n * @param {('left'|'center'|'right')} [config.position='left'] Align ticks with the center or edge of category\n * @returns {Array}\n */\n getTicks: function(dimension, config) { // Overrides parent method\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw \"Invalid dimension identifier\";\n }\n var position = config.position || \"left\";\n if ([\"left\", \"center\", \"right\"].indexOf(position) === -1) {\n throw \"Invalid tick position\";\n }\n\n var categoryBounds = this._categories;\n if (!categoryBounds || !Object.keys(categoryBounds).length) {\n return [];\n }\n\n if (dimension === \"y\") {\n return [];\n }\n\n if (dimension === \"x\") {\n // If colors have been defined by this layer, use them to make tick colors match scatterplot point colors\n var knownCategories = this.layout.color.parameters.categories || [];\n var knownColors = this.layout.color.parameters.values || [];\n\n return Object.keys(categoryBounds).map(function (category, index) {\n var bounds = categoryBounds[category];\n var xPos;\n\n switch(position) {\n case \"left\":\n xPos = bounds[0];\n break;\n case \"center\":\n // Center tick under one or many elements as appropriate\n var diff = bounds[1] - bounds[0];\n xPos = bounds[0] + (diff !== 0 ? diff : bounds[0]) / 2;\n break;\n case \"right\":\n xPos = bounds[1];\n break;\n }\n return {\n x: xPos,\n text: category,\n style: {\n \"fill\": knownColors[knownCategories.indexOf(category)] || \"#000000\"\n }\n };\n });\n }\n },\n\n applyCustomDataMethods: function() {\n this.data = this._prepareData();\n /**\n * Define category names and extents (boundaries) for plotting. TODO: properties in constructor\n * @member {Object.} Category names and extents, in the form {category_name: [min_x, max_x]}\n */\n this._categories = this._generateCategoryBounds();\n return this;\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n *\n * LocusZoom has various singleton objects that are used for registering functions or classes.\n * These objects provide safe, standard methods to redefine or delete existing functions/classes\n * as well as define new custom functions/classes to be used in a plot.\n *\n * @namespace Singletons\n */\n\n\n/*\n * The Collection of \"Known\" Data Sources. This registry is used internally by the `DataSources` class\n * @class\n * @static\n */\nLocusZoom.KnownDataSources = (function() {\n /** @lends LocusZoom.KnownDataSources */\n var obj = {};\n /* @member {function[]} */\n var sources = [];\n\n var findSourceByName = function(x) {\n for(var i=0; i 1) {\n return function(x) {\n var val = x;\n for(var i = 0; i 1) {\n log = Math.ceil(Math.log(abs) / Math.LN10);\n } else { // 0...1\n log = Math.floor(Math.log(abs) / Math.LN10);\n }\n if (Math.abs(log) <= 3){\n return x.toFixed(3);\n } else {\n return x.toExponential(2).replace(\"+\", \"\").replace(\"e\", \" × 10^\");\n }\n});\n\n/**\n * URL-encode the provided text, eg for constructing hyperlinks\n * @function urlencode\n * @param {String} str\n */\nLocusZoom.TransformationFunctions.add(\"urlencode\", function(str) {\n return encodeURIComponent(str);\n});\n\n/**\n * HTML-escape user entered values for use in constructed HTML fragments\n *\n * For example, this filter can be used on tooltips with custom HTML display\n * @function htmlescape\n * @param {String} str HTML-escape the provided value\n */\nLocusZoom.TransformationFunctions.add(\"htmlescape\", function(str) {\n if ( !str ) {\n return \"\";\n }\n str = str + \"\";\n\n return str.replace( /['\"<>&`]/g, function( s ) {\n switch ( s ) {\n case \"'\":\n return \"'\";\n case \"\\\"\":\n return \""\";\n case \"<\":\n return \"<\";\n case \">\":\n return \">\";\n case \"&\":\n return \"&\";\n case \"`\":\n return \"`\";\n }\n });\n});\n\n/**\n * Singleton for accessing/storing functions that will convert arbitrary data points to values in a given scale\n * Useful for anything that needs to scale discretely with data (e.g. color, point size, etc.)\n *\n * A Scale Function can be thought of as a modifier to a layout directive that adds extra logic to how a piece of data\n * can be resolved to a value.\n *\n * All scale functions must accept an object of parameters and a value to process.\n * @class\n * @static\n */\nLocusZoom.ScaleFunctions = (function() {\n /** @lends LocusZoom.ScaleFunctions */\n var obj = {};\n var functions = {};\n\n /**\n * Find a scale function and return it. If parameters and values are passed, calls the function directly; otherwise\n * returns a callable.\n * @param {String} name\n * @param {Object} [parameters] Configuration parameters specific to the specified scale function\n * @param {*} [value] The value to operate on\n * @returns {*}\n */\n obj.get = function(name, parameters, value) {\n if (!name) {\n return null;\n } else if (functions[name]) {\n if (typeof parameters === \"undefined\" && typeof value === \"undefined\"){\n return functions[name];\n } else {\n return functions[name](parameters, value);\n }\n } else {\n throw(\"scale function [\" + name + \"] not found\");\n }\n };\n\n /**\n * @protected\n * @param {String} name The name of the function to set/unset\n * @param {Function} [fn] The function to register. If blank, removes this function name from the registry.\n */\n obj.set = function(name, fn) {\n if (fn) {\n functions[name] = fn;\n } else {\n delete functions[name];\n }\n };\n\n /**\n * Add a new scale function to the registry\n * @param {String} name The name of the scale function\n * @param {function} fn A scale function that accepts two parameters: an object of configuration and a value\n */\n obj.add = function(name, fn) {\n if (functions[name]) {\n throw(\"scale function already exists with name: \" + name);\n } else {\n obj.set(name, fn);\n }\n };\n\n /**\n * List the names of all registered scale functions\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(functions);\n };\n\n return obj;\n})();\n\n/**\n * Basic conditional function to evaluate the value of the input field and return based on equality.\n * @param {Object} parameters\n * @param {*} parameters.field_value The value against which to test the input value.\n * @param {*} parameters.then The value to return if the input value matches the field value\n * @param {*} parameters.else The value to return if the input value does not match the field value. Optional. If not\n * defined this scale function will return null (or value of null_value parameter, if defined) when input value fails\n * to match field_value.\n * @param {*} input value\n */\nLocusZoom.ScaleFunctions.add(\"if\", function(parameters, input){\n if (typeof input == \"undefined\" || parameters.field_value !== input){\n if (typeof parameters.else != \"undefined\"){\n return parameters.else;\n } else {\n return null;\n }\n } else {\n return parameters.then;\n }\n});\n\n/**\n * Function to sort numerical values into bins based on numerical break points. Will only operate on numbers and\n * return null (or value of null_value parameter, if defined) if provided a non-numeric input value. Parameters:\n * @function numerical_bin\n * @param {Object} parameters\n * @param {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter. If the input value is greater than or equal to break n and less than\n * or equal to break n+1 (or break n+1 doesn't exist) then returned value is the nth entry in the values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against break points. Must be of\n * equal length to breaks parameter. Each entry n represents the value to return if the input value is greater than\n * or equal to break n and less than or equal to break n+1 (or break n+1 doesn't exist).\n * @param {*} null_value\n * @param {*} input value\n * @returns\n */\nLocusZoom.ScaleFunctions.add(\"numerical_bin\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){\n return (parameters.null_value ? parameters.null_value : null);\n }\n var threshold = breaks.reduce(function(prev, curr){\n if (+input < prev || (+input >= prev && +input < curr)){\n return prev;\n } else {\n return curr;\n }\n });\n return values[breaks.indexOf(threshold)];\n});\n\n/**\n * Function to sort values of any type into bins based on direct equality testing with a list of categories.\n * Will return null if provided an input value that does not match to a listed category.\n * @function categorical_bin\n * @param {Object} parameters\n * @param {Array} parameters.categories Array of values against which to evaluate the input value. Must be of equal\n * length to values parameter. If the input value is equal to category n then returned value is the nth entry in the\n * values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against categories. Must be of equal\n * length to categories parameter. Each entry n represents the value to return if the input value is equal to the nth\n * value in the categories parameter.\n * @param {*} parameters.null_value Value to return if the input value fails to match to any categories. Optional.\n */\nLocusZoom.ScaleFunctions.add(\"categorical_bin\", function(parameters, value){\n if (typeof value == \"undefined\" || parameters.categories.indexOf(value) === -1){\n return (parameters.null_value ? parameters.null_value : null); \n } else {\n return parameters.values[parameters.categories.indexOf(value)];\n }\n});\n\n/**\n * Function for continuous interpolation of numerical values along a gradient with arbitrarily many break points.\n * @function interpolate\n * @parameters {Object} parameters\n * @parameters {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter and contain at least two elements. Input value will be evaluated for\n * relative position between two break points n and n+1 and the returned value will be interpolated at a relative\n * position between values n and n+1.\n * @parameters {*[]} parameters.values Array of values to interpolate and return given evaluations against break\n * points. Must be of equal length to breaks parameter and contain at least two elements. Each entry n represents\n * the value to return if the input value matches the nth entry in breaks exactly. Note that this scale function\n * uses d3.interpolate to provide for effective interpolation of many different value types, including numbers,\n * colors, shapes, etc.\n * @parameters {*} parameters.null_value\n */\nLocusZoom.ScaleFunctions.add(\"interpolate\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n var nullval = (parameters.null_value ? parameters.null_value : null);\n if (breaks.length < 2 || breaks.length !== values.length){ return nullval; }\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){ return nullval; }\n if (+input <= parameters.breaks[0]){\n return values[0];\n } else if (+input >= parameters.breaks[parameters.breaks.length-1]){\n return values[breaks.length-1];\n } else {\n var upper_idx = null;\n breaks.forEach(function(brk, idx){\n if (!idx){ return; }\n if (breaks[idx-1] <= +input && breaks[idx] >= +input){ upper_idx = idx; }\n });\n if (upper_idx === null){ return nullval; }\n var normalized_input = (+input - breaks[upper_idx-1]) / (breaks[upper_idx] - breaks[upper_idx-1]);\n if (!isFinite(normalized_input)){ return nullval; }\n return d3.interpolate(values[upper_idx-1], values[upper_idx])(normalized_input);\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A Dashboard is an HTML element used for presenting arbitrary user interface components. Dashboards are anchored\n * to either the entire Plot or to individual Panels.\n *\n * Each dashboard is an HTML-based (read: not SVG) collection of components used to display information or provide\n * user interface. Dashboards can exist on entire plots, where their visibility is permanent and vertically adjacent\n * to the plot, or on individual panels, where their visibility is tied to a behavior (e.g. a mouseover) and is as\n * an overlay.\n * @class\n */\nLocusZoom.Dashboard = function(parent){\n // parent must be a locuszoom plot or panel\n if (!(parent instanceof LocusZoom.Plot) && !(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create dashboard, parent must be a locuszoom plot or panel\";\n }\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".dashboard\";\n /** @member {('plot'|'panel')} */\n this.type = (this.parent instanceof LocusZoom.Plot) ? \"plot\" : \"panel\";\n /** @member {LocusZoom.Plot} */\n this.parent_plot = this.type === \"plot\" ? this.parent : this.parent.parent;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {LocusZoom.Dashboard.Component[]} */\n this.components = [];\n /**\n * The timer identifier as returned by setTimeout\n * @member {Number}\n */\n this.hide_timeout = null;\n /**\n * Whether to hide the dashboard. Can be overridden by a child component. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n\n // TODO: Return value from constructor function?\n return this.initialize();\n};\n\n/**\n * Prepare the dashboard for first use: generate all component instances for this dashboard, based on the provided\n * layout of the parent. Connects event listeners and shows/hides as appropriate.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.initialize = function() {\n // Parse layout to generate component instances\n if (Array.isArray(this.parent.layout.dashboard.components)){\n this.parent.layout.dashboard.components.forEach(function(layout){\n try {\n var component = LocusZoom.Dashboard.Components.get(layout.type, layout, this);\n this.components.push(component);\n } catch (e) {\n console.warn(e);\n }\n }.bind(this));\n }\n\n // Add mouseover event handlers to show/hide panel dashboard\n if (this.type === \"panel\"){\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseover.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n if (!this.selector || this.selector.style(\"visibility\") === \"hidden\"){ this.show(); }\n }.bind(this));\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseout.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n this.hide_timeout = setTimeout(function(){ this.hide(); }.bind(this), 300);\n }.bind(this));\n }\n\n return this;\n\n};\n\n/**\n * Whether to persist the dashboard. Returns true if at least one component should persist, or if the panel is engaged\n * in an active drag event.\n * @returns {boolean}\n */\nLocusZoom.Dashboard.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n var persist = false;\n // Persist if at least one component should also persist\n this.components.forEach(function(component){\n persist = persist || component.shouldPersist();\n });\n // Persist if in a parent drag event\n persist = persist || (this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.dragging);\n return !!persist;\n};\n\n/**\n * Make the dashboard appear. If it doesn't exist yet create it, including creating/positioning all components within,\n * and make sure it is set to be visible.\n */\nLocusZoom.Dashboard.prototype.show = function(){\n if (!this.selector){\n switch (this.type){\n case \"plot\":\n this.selector = d3.select(this.parent.svg.node().parentNode)\n .insert(\"div\",\":first-child\");\n break;\n case \"panel\":\n this.selector = d3.select(this.parent.parent.svg.node().parentNode)\n .insert(\"div\", \".lz-data_layer-tooltip, .lz-dashboard-menu, .lz-curtain\").classed(\"lz-panel-dashboard\", true);\n break;\n }\n this.selector.classed(\"lz-dashboard\", true).classed(\"lz-\"+this.type+\"-dashboard\", true).attr(\"id\", this.id);\n }\n this.components.forEach(function(component){ component.show(); });\n this.selector.style({ visibility: \"visible\" });\n return this.update();\n};\n\n/**\n * Update the dashboard and rerender all child components. This can be called whenever plot state changes.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.update = function(){\n if (!this.selector){ return this; }\n this.components.forEach(function(component){ component.update(); });\n return this.position();\n};\n\n/**\n * Position the dashboard (and child components) within the panel\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.position = function(){\n if (!this.selector){ return this; }\n // Position the dashboard itself (panel only)\n if (this.type === \"panel\"){\n var page_origin = this.parent.getPageOrigin();\n var top = (page_origin.y + 3.5).toString() + \"px\";\n var left = page_origin.x.toString() + \"px\";\n var width = (this.parent.layout.width - 4).toString() + \"px\";\n this.selector.style({ position: \"absolute\", top: top, left: left, width: width });\n }\n // Recursively position components\n this.components.forEach(function(component){ component.position(); });\n return this;\n};\n\n/**\n * Hide the dashboard (make invisible but do not destroy). Will do nothing if `shouldPersist` returns true.\n *\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n this.components.forEach(function(component){ component.hide(); });\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n\n/**\n * Completely remove dashboard and all child components. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n this.components.forEach(function(component){ component.destroy(true); });\n this.components = [];\n this.selector.remove();\n this.selector = null;\n return this;\n};\n\n/**\n *\n * A dashboard component is an empty div rendered on a dashboard that can display custom\n * html of user interface elements. LocusZoom.Dashboard.Components is a singleton used to\n * define and manage an extendable collection of dashboard components.\n * (e.g. by LocusZoom.Dashboard.Components.add())\n * @class\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @param {('left'|'right')} [layout.position='left'] Whether to float the component left or right.\n * @param {('start'|'middle'|'end')} [layout.group_position] Buttons can optionally be gathered into a visually\n * distinctive group whose elements are closer together. If a button is identified as the start or end of a group,\n * it will be drawn with rounded corners and an extra margin of spacing from any button not part of the group.\n * For example, the region_nav_plot dashboard is a defined as a group.\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple'} [layout.color='gray'] Color scheme for the\n * component. Applies to buttons and menus.\n * @param {LocusZoom.Dashboard} parent The dashboard that contains this component\n*/\nLocusZoom.Dashboard.Component = function(layout, parent) {\n /** @member {Object} */\n this.layout = layout || {};\n if (!this.layout.color){ this.layout.color = \"gray\"; }\n\n /** @member {LocusZoom.Dashboard|*} */\n this.parent = parent || null;\n /**\n * Some dashboards are attached to a panel, rather than directly to a plot\n * @member {LocusZoom.Panel|null}\n */\n this.parent_panel = null;\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n /**\n * This is a reference to either the panel or the plot, depending on what the dashboard is\n * tied to. Useful when absolutely positioning dashboard components relative to their SVG anchor.\n * @member {LocusZoom.Plot|LocusZoom.Panel}\n */\n this.parent_svg = null;\n if (this.parent instanceof LocusZoom.Dashboard){\n // TODO: when is the immediate parent *not* a dashboard?\n if (this.parent.type === \"panel\"){\n this.parent_panel = this.parent.parent;\n this.parent_plot = this.parent.parent.parent;\n this.parent_svg = this.parent_panel;\n } else {\n this.parent_plot = this.parent.parent;\n this.parent_svg = this.parent_plot;\n }\n }\n /** @member {d3.selection} */\n this.selector = null;\n /**\n * If this is an interactive component, it will contain a button or menu instance that handles the interactivity.\n * There is a 1-to-1 relationship of dashboard component to button\n * @member {null|LocusZoom.Dashboard.Component.Button}\n */\n this.button = null;\n /**\n * If any single component is marked persistent, it will bubble up to prevent automatic hide behavior on a\n * component's parent dashboard. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n if (!this.layout.position){ this.layout.position = \"left\"; }\n\n // TODO: Return value in constructor\n return this;\n};\n/**\n * Perform all rendering of component, including toggling visibility to true. Will initialize and create SVG element\n * if necessary, as well as updating with new data and performing layout actions.\n */\nLocusZoom.Dashboard.Component.prototype.show = function(){\n if (!this.parent || !this.parent.selector){ return; }\n if (!this.selector){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.layout.group_position) !== -1 ? \" lz-dashboard-group-\" + this.layout.group_position : \"\");\n this.selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-\" + this.layout.position + group_position);\n if (this.layout.style){ this.selector.style(this.layout.style); }\n if (typeof this.initialize == \"function\"){ this.initialize(); }\n }\n if (this.button && this.button.status === \"highlighted\"){ this.button.menu.show(); }\n this.selector.style({ visibility: \"visible\" });\n this.update();\n return this.position();\n};\n/**\n * Update the dashboard component with any new data or plot state as appropriate. This method performs all\n * necessary rendering steps.\n */\nLocusZoom.Dashboard.Component.prototype.update = function(){ /* stub */ };\n/**\n * Place the component correctly in the plot\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.position = function(){\n if (this.button){ this.button.menu.position(); }\n return this;\n};\n/**\n * Determine whether the component should persist (will bubble up to parent dashboard)\n * @returns {boolean}\n */\nLocusZoom.Dashboard.Component.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n if (this.button && this.button.persist){ return true; }\n return false;\n};\n/**\n * Toggle visibility to hidden, unless marked as persistent\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n if (this.button){ this.button.menu.hide(); }\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n/**\n * Completely remove component and button. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.Component.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n if (this.button && this.button.menu){ this.button.menu.destroy(); }\n this.selector.remove();\n this.selector = null;\n this.button = null;\n return this;\n};\n\n/**\n * Singleton registry of all known components\n * @class\n * @static\n */\nLocusZoom.Dashboard.Components = (function() {\n /** @lends LocusZoom.Dashboard.Components */\n var obj = {};\n var components = {};\n\n /**\n * Create a new component instance by name\n * @param {String} name The string identifier of the desired component\n * @param {Object} layout The layout to use to create the component\n * @param {LocusZoom.Dashboard} parent The containing dashboard to use when creating the component\n * @returns {LocusZoom.Dashboard.Component}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (components[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for dashboard component [\" + name + \"]\");\n } else {\n return new components[name](layout, parent);\n }\n } else {\n throw(\"dashboard component [\" + name + \"] not found\");\n }\n };\n /**\n * Add a new component constructor to the registry and ensure that it extends the correct parent class\n * @protected\n * @param name\n * @param component\n */\n obj.set = function(name, component) {\n if (component) {\n if (typeof component != \"function\"){\n throw(\"unable to set dashboard component [\" + name + \"], argument provided is not a function\");\n } else {\n components[name] = component;\n components[name].prototype = new LocusZoom.Dashboard.Component();\n }\n } else {\n delete components[name];\n }\n };\n\n /**\n * Register a new component constructor by name\n * @param {String} name\n * @param {function} component The component constructor\n */\n obj.add = function(name, component) {\n if (components[name]) {\n throw(\"dashboard component already exists with name: \" + name);\n } else {\n obj.set(name, component);\n }\n };\n\n /**\n * List the names of all registered components\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(components);\n };\n\n return obj;\n})();\n\n/**\n * Plots and panels may have a \"dashboard\" element suited for showing HTML components that may be interactive.\n * When components need to incorporate a generic button, or additionally a button that generates a menu, this\n * class provides much of the necessary framework.\n * @class\n * @param {LocusZoom.Dashboard.Component} parent\n */\nLocusZoom.Dashboard.Component.Button = function(parent) { \n \n if (!(parent instanceof LocusZoom.Dashboard.Component)){\n throw \"Unable to create dashboard component button, invalid parent\";\n }\n /** @member {LocusZoom.Dashboard.Component} */\n this.parent = parent;\n /** @member {LocusZoom.Dashboard.Panel} */\n this.parent_panel = this.parent.parent_panel;\n /** @member {LocusZoom.Dashboard.Plot} */\n this.parent_plot = this.parent.parent_plot;\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent_svg = this.parent.parent_svg;\n\n /** @member {LocusZoom.Dashboard|null|*} */\n this.parent_dashboard = this.parent.parent;\n /** @member {d3.selection} */\n this.selector = null;\n\n /**\n * Tag to use for the button (default: a)\n * @member {String}\n */\n this.tag = \"a\";\n\n /**\n * TODO This method does not appear to be used anywhere\n * @param {String} tag\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTag = function(tag){\n if (typeof tag != \"undefined\"){ this.tag = tag.toString(); }\n return this;\n };\n\n /**\n * HTML for the button to show.\n * @protected\n * @member {String}\n */\n this.html = \"\";\n /**\n * Specify the HTML content of this button.\n * WARNING: The string provided will be inserted into the document as raw markup; XSS mitigation is the\n * responsibility of each button implementation.\n * @param {String} html\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setHtml = function(html){\n if (typeof html != \"undefined\"){ this.html = html.toString(); }\n return this;\n };\n /**\n * @deprecated since 0.5.6; use setHTML instead\n */\n this.setText = this.setHTML;\n\n /**\n * Mouseover title text for the button to show\n * @protected\n * @member {String}\n */\n this.title = \"\";\n /**\n * Set the mouseover title text for the button (if any)\n * @param {String} title Simple text to display\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTitle = function(title){\n if (typeof title != \"undefined\"){ this.title = title.toString(); }\n return this;\n };\n\n /**\n * Color of the button\n * @member {String}\n */\n this.color = \"gray\";\n\n /**\n * Set the color associated with this button\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple')} color Any selection not in the preset list\n * will be replaced with gray.\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setColor = function(color){\n if (typeof color != \"undefined\"){\n if ([\"gray\", \"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"purple\"].indexOf(color) !== -1){ this.color = color; }\n else { this.color = \"gray\"; }\n }\n return this;\n };\n\n /**\n * Hash of arbitrary button styles to apply as {name: value} entries\n * @protected\n * @member {Object}\n */\n this.style = {};\n /**\n * Set a collection of custom styles to be used by the button\n * @param {Object} style Hash of {name:value} entries\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setStyle = function(style){\n if (typeof style != \"undefined\"){ this.style = style; }\n return this;\n };\n\n //\n /**\n * Method to generate a CSS class string\n * @returns {string}\n */\n this.getClass = function(){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.parent.layout.group_position) !== -1 ? \" lz-dashboard-button-group-\" + this.parent.layout.group_position : \"\");\n return \"lz-dashboard-button lz-dashboard-button-\" + this.color + (this.status ? \"-\" + this.status : \"\") + group_position;\n };\n\n // Permanence\n /**\n * Track internal state on whether to keep showing the button/ menu contents at the moment\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n /**\n * Configuration when defining a button: track whether this component should be allowed to keep open\n * menu/button contents in response to certain events\n * @protected\n * @member {Boolean}\n */\n this.permanent = false;\n /**\n * Allow code to change whether the button is allowed to be `permanent`\n * @param {boolean} bool\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setPermanent = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n this.permanent = bool;\n if (this.permanent){ this.persist = true; }\n return this;\n };\n /**\n * Determine whether the button/menu contents should persist in response to a specific event\n * @returns {Boolean}\n */\n this.shouldPersist = function(){\n return this.permanent || this.persist;\n };\n\n /**\n * Button status (highlighted / disabled/ etc)\n * @protected\n * @member {String}\n */\n this.status = \"\";\n /**\n * Change button state\n * @param {('highlighted'|'disabled'|'')} status\n */\n this.setStatus = function(status){\n if (typeof status != \"undefined\" && [\"\", \"highlighted\", \"disabled\"].indexOf(status) !== -1){ this.status = status; }\n return this.update();\n };\n /**\n * Toggle whether the button is highlighted\n * @param {boolean} bool If provided, explicitly set highlighted state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.highlight = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"highlighted\"); }\n else if (this.status === \"highlighted\"){ return this.setStatus(\"\"); }\n return this;\n };\n /**\n * Toggle whether the button is disabled\n * @param {boolean} bool If provided, explicitly set disabled state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.disable = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"disabled\"); }\n else if (this.status === \"disabled\"){ return this.setStatus(\"\"); }\n return this;\n };\n\n // Mouse events\n /** @member {function} */\n this.onmouseover = function(){};\n this.setOnMouseover = function(onmouseover){\n if (typeof onmouseover == \"function\"){ this.onmouseover = onmouseover; }\n else { this.onmouseover = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onmouseout = function(){};\n this.setOnMouseout = function(onmouseout){\n if (typeof onmouseout == \"function\"){ this.onmouseout = onmouseout; }\n else { this.onmouseout = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onclick = function(){};\n this.setOnclick = function(onclick){\n if (typeof onclick == \"function\"){ this.onclick = onclick; }\n else { this.onclick = function(){}; }\n return this;\n };\n \n // Primary behavior functions\n /**\n * Show the button, including creating DOM elements if necessary for first render\n */\n this.show = function(){\n if (!this.parent){ return; }\n if (!this.selector){\n this.selector = this.parent.selector.append(this.tag).attr(\"class\", this.getClass());\n }\n return this.update();\n };\n /**\n * Hook for any actions or state cleanup to be performed before rerendering\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.preUpdate = function(){ return this; };\n /**\n * Update button state and contents, and fully rerender\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.update = function(){\n if (!this.selector){ return this; }\n this.preUpdate();\n this.selector\n .attr(\"class\", this.getClass())\n .attr(\"title\", this.title).style(this.style)\n .on(\"mouseover\", (this.status === \"disabled\") ? null : this.onmouseover)\n .on(\"mouseout\", (this.status === \"disabled\") ? null : this.onmouseout)\n .on(\"click\", (this.status === \"disabled\") ? null : this.onclick)\n .html(this.html);\n this.menu.update();\n this.postUpdate();\n return this;\n };\n /**\n * Hook for any behavior to be added/changed after the button has been re-rendered\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.postUpdate = function(){ return this; };\n /**\n * Hide the button by removing it from the DOM (may be overridden by current persistence setting)\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.hide = function(){\n if (this.selector && !this.shouldPersist()){\n this.selector.remove();\n this.selector = null;\n }\n return this;\n }; \n\n /**\n * Button Menu Object\n * The menu is an HTML overlay that can appear below a button. It can contain arbitrary HTML and\n * has logic to be automatically positioned and sized to behave more or less like a dropdown menu.\n * @member {Object}\n */\n this.menu = {\n outer_selector: null,\n inner_selector: null,\n scroll_position: 0,\n hidden: true,\n /**\n * Show the button menu, including setting up any DOM elements needed for first rendering\n */\n show: function(){\n if (!this.menu.outer_selector){\n this.menu.outer_selector = d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu lz-dashboard-menu-\" + this.color)\n .attr(\"id\", this.parent_svg.getBaseId() + \".dashboard.menu\");\n this.menu.inner_selector = this.menu.outer_selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu-content\");\n this.menu.inner_selector.on(\"scroll\", function(){\n this.menu.scroll_position = this.menu.inner_selector.node().scrollTop;\n }.bind(this));\n }\n this.menu.outer_selector.style({ visibility: \"visible\" });\n this.menu.hidden = false;\n return this.menu.update();\n }.bind(this),\n /**\n * Update the rendering of the menu\n */\n update: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.populate(); // This function is stubbed for all buttons by default and custom implemented in component definition\n if (this.menu.inner_selector){ this.menu.inner_selector.node().scrollTop = this.menu.scroll_position; }\n return this.menu.position();\n }.bind(this),\n position: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n // Unset any explicitly defined outer selector height so that menus dynamically shrink if content is removed\n this.menu.outer_selector.style({ height: null });\n var padding = 3;\n var scrollbar_padding = 20;\n var menu_height_padding = 14; // 14: 2x 6px padding, 2x 1px border\n var page_origin = this.parent_svg.getPageOrigin();\n var page_scroll_top = document.documentElement.scrollTop || document.body.scrollTop;\n var container_offset = this.parent_plot.getContainerOffset();\n var dashboard_client_rect = this.parent_dashboard.selector.node().getBoundingClientRect();\n var button_client_rect = this.selector.node().getBoundingClientRect();\n var menu_client_rect = this.menu.outer_selector.node().getBoundingClientRect();\n var total_content_height = this.menu.inner_selector.node().scrollHeight;\n var top = 0; var left = 0;\n if (this.parent_dashboard.type === \"panel\"){\n top = (page_origin.y + dashboard_client_rect.height + (2 * padding));\n left = Math.max(page_origin.x + this.parent_svg.layout.width - menu_client_rect.width - padding, page_origin.x + padding);\n } else {\n top = button_client_rect.bottom + page_scroll_top + padding - container_offset.top;\n left = Math.max(button_client_rect.left + button_client_rect.width - menu_client_rect.width - container_offset.left, page_origin.x + padding);\n }\n var base_max_width = Math.max(this.parent_svg.layout.width - (2 * padding) - scrollbar_padding, scrollbar_padding);\n var container_max_width = base_max_width;\n var content_max_width = (base_max_width - (4 * padding));\n var base_max_height = Math.max(this.parent_svg.layout.height - (10 * padding) - menu_height_padding, menu_height_padding);\n var height = Math.min(total_content_height, base_max_height);\n var max_height = base_max_height;\n this.menu.outer_selector.style({\n \"top\": top.toString() + \"px\",\n \"left\": left.toString() + \"px\",\n \"max-width\": container_max_width.toString() + \"px\",\n \"max-height\": max_height.toString() + \"px\",\n \"height\": height.toString() + \"px\"\n });\n this.menu.inner_selector.style({ \"max-width\": content_max_width.toString() + \"px\" });\n this.menu.inner_selector.node().scrollTop = this.menu.scroll_position;\n return this.menu;\n }.bind(this),\n hide: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.outer_selector.style({ visibility: \"hidden\" });\n this.menu.hidden = true;\n return this.menu;\n }.bind(this),\n destroy: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.inner_selector.remove();\n this.menu.outer_selector.remove();\n this.menu.inner_selector = null;\n this.menu.outer_selector = null;\n return this.menu;\n }.bind(this),\n /**\n * Internal method definition\n * By convention populate() does nothing and should be reimplemented with each dashboard button definition\n * Reimplement by way of Dashboard.Component.Button.menu.setPopulate to define the populate method and hook\n * up standard menu click-toggle behavior prototype.\n * @protected\n */\n populate: function(){ /* stub */ }.bind(this),\n /**\n * Define how the menu is populated with items, and set up click and display properties as appropriate\n * @public\n */\n setPopulate: function(menu_populate_function){\n if (typeof menu_populate_function == \"function\"){\n this.menu.populate = menu_populate_function;\n this.setOnclick(function(){\n if (this.menu.hidden){\n this.menu.show();\n this.highlight().update();\n this.persist = true;\n } else {\n this.menu.hide();\n this.highlight(false).update();\n if (!this.permanent){ this.persist = false; }\n }\n }.bind(this));\n } else {\n this.setOnclick();\n }\n return this;\n }.bind(this)\n };\n\n};\n\n/**\n * Renders arbitrary text with title formatting\n * @class LocusZoom.Dashboard.Components.title\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.title Text to render\n */\nLocusZoom.Dashboard.Components.add(\"title\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.show = function(){\n this.div_selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-title lz-dashboard-\" + this.layout.position);\n this.title_selector = this.div_selector.append(\"h3\");\n return this.update();\n };\n this.update = function(){\n var title = layout.title.toString();\n if (this.layout.subtitle){ title += \" \" + this.layout.subtitle + \"\"; }\n this.title_selector.html(title);\n return this;\n };\n});\n\n/**\n * Renders text to display the current dimensions of the plot. Automatically updated as plot dimensions change\n * @class LocusZoom.Dashboard.Components.dimensions\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"dimensions\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var display_width = this.parent_plot.layout.width.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.width : this.parent_plot.layout.width.toFixed(2);\n var display_height = this.parent_plot.layout.height.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.height : this.parent_plot.layout.height.toFixed(2);\n this.selector.html(display_width + \"px × \" + display_height + \"px\");\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Display the current scale of the genome region displayed in the plot, as defined by the difference between\n * `state.end` and `state.start`.\n * @class LocusZoom.Dashboard.Components.region_scale\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"region_scale\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (!isNaN(this.parent_plot.state.start) && !isNaN(this.parent_plot.state.end)\n && this.parent_plot.state.start !== null && this.parent_plot.state.end !== null){\n this.selector.style(\"display\", null);\n this.selector.html(LocusZoom.positionIntToString(this.parent_plot.state.end - this.parent_plot.state.start, null, true));\n } else {\n this.selector.style(\"display\", \"none\");\n }\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Button to export current plot to an SVG image\n * @class LocusZoom.Dashboard.Components.download\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"download\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Download Image\").setTitle(\"Download image of the current plot as locuszoom.svg\")\n .setOnMouseover(function() {\n this.button.selector\n .classed(\"lz-dashboard-button-gray-disabled\", true)\n .html(\"Preparing Image\");\n this.generateBase64SVG().then(function(base64_string){\n this.button.selector\n .attr(\"href\", \"data:image/svg+xml;base64,\\n\" + base64_string)\n .classed(\"lz-dashboard-button-gray-disabled\", false)\n .classed(\"lz-dashboard-button-gray-highlighted\", true)\n .html(\"Download Image\");\n }.bind(this));\n }.bind(this))\n .setOnMouseout(function() {\n this.button.selector.classed(\"lz-dashboard-button-gray-highlighted\", false);\n }.bind(this));\n this.button.show();\n this.button.selector.attr(\"href-lang\", \"image/svg+xml\").attr(\"download\", \"locuszoom.svg\");\n return this;\n };\n this.css_string = \"\";\n for (var stylesheet in Object.keys(document.styleSheets)){\n if ( document.styleSheets[stylesheet].href !== null\n && document.styleSheets[stylesheet].href.indexOf(\"locuszoom.css\") !== -1){\n // TODO: \"Download image\" button will render the image incorrectly if the stylesheet has been renamed or concatenated\n LocusZoom.createCORSPromise(\"GET\", document.styleSheets[stylesheet].href)\n .then(function(response){\n this.css_string = response.replace(/[\\r\\n]/g,\" \").replace(/\\s+/g,\" \");\n if (this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\")){\n this.css_string = this.css_string.substring(0, this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\"));\n }\n }.bind(this));\n break;\n }\n } \n this.generateBase64SVG = function(){\n return Q.fcall(function () {\n // Insert a hidden div, clone the node into that so we can modify it with d3\n var container = this.parent.selector.append(\"div\").style(\"display\", \"none\")\n .html(this.parent_plot.svg.node().outerHTML);\n // Remove unnecessary elements\n container.selectAll(\"g.lz-curtain\").remove();\n container.selectAll(\"g.lz-mouse_guide\").remove();\n // Convert units on axis tick dy attributes from ems to pixels\n container.selectAll(\"g.tick text\").each(function(){\n var dy = +(d3.select(this).attr(\"dy\").substring(-2).slice(0,-2))*10;\n d3.select(this).attr(\"dy\", dy);\n });\n // Pull the svg into a string and add the contents of the locuszoom stylesheet\n // Don't add this with d3 because it will escape the CDATA declaration incorrectly\n var initial_html = d3.select(container.select(\"svg\").node().parentNode).html();\n var style_def = \"\";\n var insert_at = initial_html.indexOf(\">\") + 1;\n initial_html = initial_html.slice(0,insert_at) + style_def + initial_html.slice(insert_at);\n // Delete the container node\n container.remove();\n // Base64-encode the string and return it\n return btoa(encodeURIComponent(initial_html).replace(/%([0-9A-F]{2})/g, function(match, p1) {\n return String.fromCharCode(\"0x\" + p1);\n }));\n }.bind(this));\n };\n});\n\n/**\n * Button to remove panel from plot.\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.remove_panel\n * @augments LocusZoom.Dashboard.Component\n * @param {Boolean} [layout.suppress_confirm=false] If true, removes the panel without prompting user for confirmation\n */\nLocusZoom.Dashboard.Components.add(\"remove_panel\", function(layout) {\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function() {\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"×\").setTitle(\"Remove panel\")\n .setOnclick(function(){\n if (!layout.suppress_confirm && !confirm(\"Are you sure you want to remove this panel? This cannot be undone!\")){\n return false;\n }\n var panel = this.parent_panel;\n panel.dashboard.hide(true);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseover.\" + panel.getBaseId() + \".dashboard\", null);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseout.\" + panel.getBaseId() + \".dashboard\", null);\n return panel.parent.removePanel(panel.id);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to move panel up relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_up\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_up\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_top = (this.parent_panel.layout.y_index === 0);\n this.button.disable(is_at_top);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▴\").setTitle(\"Move panel up\")\n .setOnclick(function(){\n this.parent_panel.moveUp();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to move panel down relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_down\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_down\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_bottom = (this.parent_panel.layout.y_index === this.parent_plot.panel_ids_by_y_index.length-1);\n this.button.disable(is_at_bottom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▾\").setTitle(\"Move panel down\")\n .setOnclick(function(){\n this.parent_panel.moveDown();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to shift plot region forwards or back by a `step` increment provided in the layout\n * @class LocusZoom.Dashboard.Components.shift_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=50000] The stepsize to change the region by\n * @param {string} [layout.button_html]\n * @param {string} [layout.button_title]\n */\nLocusZoom.Dashboard.Components.add(\"shift_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add shift_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 50000; }\n if (typeof layout.button_html !== \"string\"){ layout.button_html = layout.step > 0 ? \">\" : \"<\"; }\n if (typeof layout.button_title !== \"string\"){\n layout.button_title = \"Shift region by \" + (layout.step > 0 ? \"+\" : \"-\") + LocusZoom.positionIntToString(Math.abs(layout.step),null,true);\n }\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start + layout.step, 1),\n end: this.parent_plot.state.end + layout.step\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Zoom in or out on the plot, centered on the middle of the plot region, by the specified amount\n * @class LocusZoom.Dashboard.Components.zoom_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=0.2] The amount to zoom in by (where 1 indicates 100%)\n */\nLocusZoom.Dashboard.Components.add(\"zoom_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add zoom_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 0.2; }\n if (typeof layout.button_html != \"string\"){ layout.button_html = layout.step > 0 ? \"z–\" : \"z+\"; }\n if (typeof layout.button_title != \"string\"){\n layout.button_title = \"Zoom region \" + (layout.step > 0 ? \"out\" : \"in\") + \" by \" + (Math.abs(layout.step)*100).toFixed(1) + \"%\";\n }\n this.update = function(){\n if (this.button){\n var can_zoom = true;\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n if (layout.step > 0 && !isNaN(this.parent_plot.layout.max_region_scale) && current_region_scale >= this.parent_plot.layout.max_region_scale){\n can_zoom = false;\n }\n if (layout.step < 0 && !isNaN(this.parent_plot.layout.min_region_scale) && current_region_scale <= this.parent_plot.layout.min_region_scale){\n can_zoom = false;\n }\n this.button.disable(!can_zoom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n var zoom_factor = 1 + layout.step;\n var new_region_scale = current_region_scale * zoom_factor;\n if (!isNaN(this.parent_plot.layout.max_region_scale)){\n new_region_scale = Math.min(new_region_scale, this.parent_plot.layout.max_region_scale);\n }\n if (!isNaN(this.parent_plot.layout.min_region_scale)){\n new_region_scale = Math.max(new_region_scale, this.parent_plot.layout.min_region_scale);\n }\n var delta = Math.floor((new_region_scale - current_region_scale) / 2);\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start - delta, 1),\n end: this.parent_plot.state.end + delta\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Renders button with arbitrary text that, when clicked, shows a dropdown containing arbitrary HTML\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @class LocusZoom.Dashboard.Components.menu\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n * @param {string} layout.menu_html The HTML content of the dropdown menu\n */\nLocusZoom.Dashboard.Components.add(\"menu\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title);\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(layout.menu_html);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Special button/menu to allow model building by tracking individual covariants. Will track a list of covariate\n * objects and store them in the special `model.covariates` field of plot `state`.\n * @class LocusZoom.Dashboard.Components.covariates_model\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n */\nLocusZoom.Dashboard.Components.add(\"covariates_model\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.initialize = function(){\n // Initialize state.model.covariates\n this.parent_plot.state.model = this.parent_plot.state.model || {};\n this.parent_plot.state.model.covariates = this.parent_plot.state.model.covariates || [];\n // Create an object at the plot level for easy access to interface methods in custom client-side JS\n /**\n * When a covariates model dashboard element is present, create (one) object at the plot level that exposes\n * component data and state for custom interactions with other plot elements.\n * @class LocusZoom.Plot.CovariatesModel\n */\n this.parent_plot.CovariatesModel = {\n /** @member {LocusZoom.Dashboard.Component.Button} */\n button: this,\n /**\n * Add an element to the model and show a representation of it in the dashboard component menu. If the\n * element is already part of the model, do nothing (to avoid adding duplicates).\n * When plot state is changed, this will automatically trigger requests for new data accordingly.\n * @param {string|object} element_reference Can be any value that can be put through JSON.stringify()\n * to create a serialized representation of itself.\n */\n add: function(element_reference){\n var element = JSON.parse(JSON.stringify(element_reference));\n if (typeof element_reference == \"object\" && typeof element.html != \"string\"){\n element.html = ( (typeof element_reference.toHTML == \"function\") ? element_reference.toHTML() : element_reference.toString());\n }\n // Check if the element is already in the model covariates array and return if it is.\n for (var i = 0; i < this.state.model.covariates.length; i++) {\n if (JSON.stringify(this.state.model.covariates[i]) === JSON.stringify(element)) {\n return this;\n }\n }\n this.state.model.covariates.push(element);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Remove an element from `state.model.covariates` (and from the dashboard component menu's\n * representation of the state model). When plot state is changed, this will automatically trigger\n * requests for new data accordingly.\n * @param {number} idx Array index of the element, in the `state.model.covariates array`.\n */\n removeByIdx: function(idx){\n if (typeof this.state.model.covariates[idx] == \"undefined\"){\n throw(\"Unable to remove model covariate, invalid index: \" + idx.toString());\n }\n this.state.model.covariates.splice(idx, 1);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Empty the `state.model.covariates` array (and dashboard component menu representation thereof) of all\n * elements. When plot state is changed, this will automatically trigger requests for new data accordingly\n */\n removeAll: function(){\n this.state.model.covariates = [];\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Manually trigger the update methods on the dashboard component's button and menu elements to force\n * display of most up-to-date content. Can be used to force the dashboard to reflect changes made, eg if\n * modifying `state.model.covariates` directly instead of via `plot.CovariatesModel`\n */\n updateComponent: function(){\n this.button.update();\n this.button.menu.update();\n }.bind(this)\n };\n }.bind(this);\n\n this.update = function(){\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n var selector = this.button.menu.inner_selector;\n selector.html(\"\");\n // General model HTML representation\n if (typeof this.parent_plot.state.model.html != \"undefined\"){\n selector.append(\"div\").html(this.parent_plot.state.model.html);\n }\n // Model covariates table\n if (!this.parent_plot.state.model.covariates.length){\n selector.append(\"i\").html(\"no covariates in model\");\n } else {\n selector.append(\"h5\").html(\"Model Covariates (\" + this.parent_plot.state.model.covariates.length + \")\");\n var table = selector.append(\"table\");\n this.parent_plot.state.model.covariates.forEach(function(covariate, idx){\n var html = ( (typeof covariate == \"object\" && typeof covariate.html == \"string\") ? covariate.html : covariate.toString() );\n var row = table.append(\"tr\");\n row.append(\"td\").append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeByIdx(idx);\n }.bind(this))\n .html(\"×\");\n row.append(\"td\").html(html);\n }.bind(this));\n selector.append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"4px\" }).html(\"× Remove All Covariates\")\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeAll();\n }.bind(this));\n }\n }.bind(this));\n\n this.button.preUpdate = function(){\n var html = \"Model\";\n if (this.parent_plot.state.model.covariates.length){\n var cov = this.parent_plot.state.model.covariates.length > 1 ? \"covariates\" : \"covariate\";\n html += \" (\" + this.parent_plot.state.model.covariates.length + \" \" + cov + \")\";\n }\n this.button.setHtml(html).disable(false);\n }.bind(this);\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Button to toggle split tracks\n * @class LocusZoom.Dashboard.Components.toggle_split_tracks\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_split_tracks\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (!layout.data_layer_id){ layout.data_layer_id = \"intervals\"; }\n if (!this.parent_panel.data_layers[layout.data_layer_id]){\n throw (\"Dashboard toggle split tracks component missing valid data layer ID\");\n }\n this.update = function(){\n var data_layer = this.parent_panel.data_layers[layout.data_layer_id];\n var html = data_layer.layout.split_tracks ? \"Merge Tracks\" : \"Split Tracks\";\n if (this.button){\n this.button.setHtml(html);\n this.button.show();\n this.parent.position();\n return this;\n } else {\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(html)\n .setTitle(\"Toggle whether tracks are split apart or merged together\")\n .setOnclick(function(){\n data_layer.toggleSplitTracks();\n if (this.scale_timeout){ clearTimeout(this.scale_timeout); }\n var timeout = data_layer.layout.transition ? +data_layer.layout.transition.duration || 0 : 0;\n this.scale_timeout = setTimeout(function(){\n this.parent_panel.scaleHeightToData();\n this.parent_plot.positionPanels();\n }.bind(this), timeout);\n this.update();\n }.bind(this));\n return this.update();\n }\n };\n});\n\n/**\n * Button to resize panel height to fit available data (eg when showing a list of tracks)\n * @class LocusZoom.Dashboard.Components.resize_to_data\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"resize_to_data\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Resize to Data\")\n .setTitle(\"Automatically resize this panel to fit the data its currently showing\")\n .setOnclick(function(){\n this.parent_panel.scaleHeightToData();\n this.update();\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to toggle legend\n * @class LocusZoom.Dashboard.Components.toggle_legend\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_legend\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var html = this.parent_panel.legend.layout.hidden ? \"Show Legend\" : \"Hide Legend\";\n if (this.button){\n this.button.setHtml(html).show();\n this.parent.position();\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color)\n .setTitle(\"Show or hide the legend for this panel\")\n .setOnclick(function(){\n this.parent_panel.legend.layout.hidden = !this.parent_panel.legend.layout.hidden;\n this.parent_panel.legend.render();\n this.update();\n }.bind(this));\n return this.update();\n };\n});\n\n/**\n * Menu for manipulating multiple data layers in a single panel: show/hide, change order, etc.\n * @class LocusZoom.Dashboard.Components.data_layers\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"data_layers\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.update = function(){\n\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Data Layers\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Manipulate Data Layers (sort, dim, show/hide, etc.)\"; }\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(\"\");\n var table = this.button.menu.inner_selector.append(\"table\");\n this.parent_panel.data_layer_ids_by_z_index.slice().reverse().forEach(function(id, idx){\n var data_layer = this.parent_panel.data_layers[id];\n var name = (typeof data_layer.layout.name != \"string\") ? data_layer.id : data_layer.layout.name;\n var row = table.append(\"tr\");\n // Layer name\n row.append(\"td\").html(name);\n // Status toggle buttons\n layout.statuses.forEach(function(status_adj){\n var status_idx = LocusZoom.DataLayer.Statuses.adjectives.indexOf(status_adj);\n var status_verb = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n var html, onclick, highlight;\n if (data_layer.global_statuses[status_adj]){\n html = LocusZoom.DataLayer.Statuses.menu_antiverbs[status_idx];\n onclick = \"un\" + status_verb + \"AllElements\";\n highlight = \"-highlighted\";\n } else {\n html = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n onclick = status_verb + \"AllElements\";\n highlight = \"\";\n }\n row.append(\"td\").append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color + highlight)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer[onclick](); this.button.menu.populate(); }.bind(this))\n .html(html);\n }.bind(this));\n // Sort layer buttons\n var at_top = (idx === 0);\n var at_bottom = (idx === (this.parent_panel.data_layer_ids_by_z_index.length - 1));\n var td = row.append(\"td\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-start lz-dashboard-button-\" + this.layout.color + (at_bottom ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveDown(); this.button.menu.populate(); }.bind(this))\n .html(\"▾\").attr(\"title\", \"Move layer down (further back)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-middle lz-dashboard-button-\" + this.layout.color + (at_top ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveUp(); this.button.menu.populate(); }.bind(this))\n .html(\"▴\").attr(\"title\", \"Move layer up (further front)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-end lz-dashboard-button-red\")\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n if (confirm(\"Are you sure you want to remove the \" + name + \" layer? This cannot be undone!\")){\n data_layer.parent.removeDataLayer(id);\n }\n return this.button.menu.populate();\n }.bind(this))\n .html(\"×\").attr(\"title\", \"Remove layer\");\n }.bind(this));\n return this;\n }.bind(this));\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Dropdown menu allowing the user to choose between different display options for a single specific data layer\n * within a panel.\n *\n * This allows controlling how points on a datalayer can be displayed- any display options supported via the layout for the target datalayer. This includes point\n * size/shape, coloring, etc.\n *\n * This button intentionally limits display options it can control to those available on common plot types.\n * Although the list of options it sets can be overridden (to control very special custom plot types), this\n * capability should be used sparingly if at all.\n *\n * @class LocusZoom.Dashboard.Components.display_options\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {String} [layout.button_html=\"Display options\"] Text to display on the toolbar button\n * @param {String} [layout.button_title=\"Control how plot items are displayed\"] Hover text for the toolbar button\n * @param {string} layout.layer_name Specify the datalayer that this button should affect\n * @param {string} [layout.default_config_display_name] Store the default configuration for this datalayer\n * configuration, and show a button to revert to the \"default\" (listing the human-readable display name provided)\n * @param {Array} [layout.fields_whitelist='see code'] The list of presentation fields that this button can control.\n * This can be overridden if this button needs to be used on a custom layer type with special options.\n * @typedef {{display_name: string, display: Object}} DisplayOptionsButtonConfigField\n * @param {DisplayOptionsButtonConfigField[]} layout.options Specify a label and set of layout directives associated\n * with this `display` option. Display field should include all changes to datalayer presentation options.\n */\nLocusZoom.Dashboard.Components.add(\"display_options\", function (layout) {\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Display options\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Control how plot items are displayed\"; }\n\n // Call parent constructor\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n // List of layout fields that this button is allowed to control. This ensures that we don't override any other\n // information (like plot height etc) while changing point rendering\n var allowed_fields = layout.fields_whitelist || [\"color\", \"fill_opacity\", \"label\", \"legend\",\n \"point_shape\", \"point_size\", \"tooltip\", \"tooltip_positioning\"];\n\n var dataLayer = this.parent_panel.data_layers[layout.layer_name];\n var dataLayerLayout = dataLayer.layout;\n\n // Store default configuration for the layer as a clean deep copy, so we may revert later\n var defaultConfig = {};\n allowed_fields.forEach(function(name) {\n var configSlot = dataLayerLayout[name];\n if (configSlot) {\n defaultConfig[name] = JSON.parse(JSON.stringify(configSlot));\n }\n });\n\n /**\n * Which item in the menu is currently selected. (track for rerendering menu)\n * @member {String}\n * @private\n */\n this._selected_item = \"default\";\n\n // Define the button + menu that provides the real functionality for this dashboard component\n var self = this;\n this.button = new LocusZoom.Dashboard.Component.Button(self)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function () {\n self.button.menu.populate();\n });\n this.button.menu.setPopulate(function () {\n // Multiple copies of this button might be used on a single LZ page; append unique IDs where needed\n var uniqueID = Math.floor(Math.random() * 1e4).toString();\n\n self.button.menu.inner_selector.html(\"\");\n var table = self.button.menu.inner_selector.append(\"table\");\n\n var menuLayout = self.layout;\n\n var renderRow = function(display_name, display_options, row_id) { // Helper method\n var row = table.append(\"tr\");\n row.append(\"td\")\n .append(\"input\")\n .attr({type: \"radio\", name: \"color-picker-\" + uniqueID, value: row_id})\n .property(\"checked\", (row_id === self._selected_item))\n .on(\"click\", function () {\n Object.keys(display_options).forEach(function(field_name) {\n dataLayer.layout[field_name] = display_options[field_name];\n });\n self._selected_item = row_id;\n self.parent_panel.render();\n var legend = self.parent_panel.legend;\n if (legend && display_options.legend) {\n // Update the legend only if necessary\n legend.render();\n }\n });\n row.append(\"td\").text(display_name);\n };\n // Render the \"display options\" menu: default and special custom options\n var defaultName = menuLayout.default_config_display_name || \"Default style\";\n renderRow(defaultName, defaultConfig, \"default\");\n menuLayout.options.forEach(function (item, index) {\n renderRow(item.display_name, item.display, index);\n });\n return self;\n });\n\n this.update = function () {\n this.button.show();\n return this;\n };\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * An SVG object used to display contextual information about a panel.\n * Panel layouts determine basic features of a legend - its position in the panel, orientation, title, etc.\n * Layouts of child data layers of the panel determine the actual content of the legend.\n *\n * @class\n * @param {LocusZoom.Panel} parent\n*/\nLocusZoom.Legend = function(parent){\n if (!(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create legend, parent must be a locuszoom panel\";\n }\n /** @member {LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".legend\";\n\n this.parent.layout.legend = LocusZoom.Layouts.merge(this.parent.layout.legend || {}, LocusZoom.Legend.DefaultLayout);\n /** @member {Object} */\n this.layout = this.parent.layout.legend;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {d3.selection} */\n this.background_rect = null;\n /** @member {d3.selection[]} */\n this.elements = [];\n /**\n * SVG selector for the group containing all elements in the legend\n * @protected\n * @member {d3.selection|null}\n */\n this.elements_group = null;\n\n /**\n * TODO: Not sure if this property is used; the external-facing methods are setting `layout.hidden` instead. Tentatively mark deprecated.\n * @deprecated\n * @protected\n * @member {Boolean}\n */\n this.hidden = false;\n\n // TODO Revisit constructor return value; see https://stackoverflow.com/a/3350364/1422268\n return this.render();\n};\n\n/**\n * The default layout used by legends (used internally)\n * @protected\n * @member {Object}\n */\nLocusZoom.Legend.DefaultLayout = {\n orientation: \"vertical\",\n origin: { x: 0, y: 0 },\n width: 10,\n height: 10,\n padding: 5,\n label_size: 12,\n hidden: false\n};\n\n/**\n * Render the legend in the parent panel\n */\nLocusZoom.Legend.prototype.render = function(){\n\n // Get a legend group selector if not yet defined\n if (!this.selector){\n this.selector = this.parent.svg.group.append(\"g\")\n .attr(\"id\", this.parent.getBaseId() + \".legend\").attr(\"class\", \"lz-legend\");\n }\n\n // Get a legend background rect selector if not yet defined\n if (!this.background_rect){\n this.background_rect = this.selector.append(\"rect\")\n .attr(\"width\", 100).attr(\"height\", 100).attr(\"class\", \"lz-legend-background\");\n }\n\n // Get a legend elements group selector if not yet defined\n if (!this.elements_group){\n this.elements_group = this.selector.append(\"g\");\n }\n\n // Remove all elements from the document and re-render from scratch\n this.elements.forEach(function(element){\n element.remove();\n });\n this.elements = [];\n\n // Gather all elements from data layers in order (top to bottom) and render them\n var padding = +this.layout.padding || 1;\n var x = padding;\n var y = padding;\n var line_height = 0;\n this.parent.data_layer_ids_by_z_index.slice().reverse().forEach(function(id){\n if (Array.isArray(this.parent.data_layers[id].layout.legend)){\n this.parent.data_layers[id].layout.legend.forEach(function(element){\n var selector = this.elements_group.append(\"g\")\n .attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n var label_size = +element.label_size || +this.layout.label_size || 12;\n var label_x = 0;\n var label_y = (label_size/2) + (padding/2);\n line_height = Math.max(line_height, label_size + padding);\n // Draw the legend element symbol (line, rect, shape, etc)\n if (element.shape === \"line\"){\n // Line symbol\n var length = +element.length || 16;\n var path_y = (label_size/4) + (padding/2);\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", \"M0,\" + path_y + \"L\" + length + \",\" + path_y)\n .style(element.style || {});\n label_x = length + padding;\n } else if (element.shape === \"rect\"){\n // Rect symbol\n var width = +element.width || 16;\n var height = +element.height || width;\n selector.append(\"rect\").attr(\"class\", element.class || \"\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = width + padding;\n line_height = Math.max(line_height, height + padding);\n } else if (d3.svg.symbolTypes.indexOf(element.shape) !== -1) {\n // Shape symbol (circle, diamond, etc.)\n var size = +element.size || 40;\n var radius = Math.ceil(Math.sqrt(size/Math.PI));\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", d3.svg.symbol().size(size).type(element.shape))\n .attr(\"transform\", \"translate(\" + radius + \",\" + (radius+(padding/2)) + \")\")\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = (2*radius) + padding;\n label_y = Math.max((2*radius)+(padding/2), label_y);\n line_height = Math.max(line_height, (2*radius) + padding);\n }\n // Draw the legend element label\n selector.append(\"text\").attr(\"text-anchor\", \"left\").attr(\"class\", \"lz-label\")\n .attr(\"x\", label_x).attr(\"y\", label_y).style({\"font-size\": label_size}).text(element.label);\n // Position the legend element group based on legend layout orientation\n var bcr = selector.node().getBoundingClientRect();\n if (this.layout.orientation === \"vertical\"){\n y += bcr.height + padding;\n line_height = 0;\n } else {\n // Ensure this element does not exceed the panel width\n // (E.g. drop to the next line if it does, but only if it's not the only element on this line)\n var right_x = this.layout.origin.x + x + bcr.width;\n if (x > padding && right_x > this.parent.layout.width){\n y += line_height;\n x = padding;\n selector.attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n }\n x += bcr.width + (3*padding);\n }\n // Store the element\n this.elements.push(selector);\n }.bind(this));\n }\n }.bind(this));\n\n // Scale the background rect to the elements in the legend\n var bcr = this.elements_group.node().getBoundingClientRect();\n this.layout.width = bcr.width + (2*this.layout.padding);\n this.layout.height = bcr.height + (2*this.layout.padding);\n this.background_rect\n .attr(\"width\", this.layout.width)\n .attr(\"height\", this.layout.height);\n\n // Set the visibility on the legend from the \"hidden\" flag\n // TODO: `show()` and `hide()` call a full rerender; might be able to make this more lightweight?\n this.selector.style({ visibility: this.layout.hidden ? \"hidden\" : \"visible\" });\n\n // TODO: Annotate return type and make consistent\n return this.position();\n};\n\n/**\n * Place the legend in position relative to the panel, as specified in the layout configuration\n * @returns {LocusZoom.Legend | null}\n * TODO: should this always be chainable?\n */\nLocusZoom.Legend.prototype.position = function(){\n if (!this.selector){ return this; }\n var bcr = this.selector.node().getBoundingClientRect();\n if (!isNaN(+this.layout.pad_from_bottom)){\n this.layout.origin.y = this.parent.layout.height - bcr.height - +this.layout.pad_from_bottom;\n }\n if (!isNaN(+this.layout.pad_from_right)){\n this.layout.origin.x = this.parent.layout.width - bcr.width - +this.layout.pad_from_right;\n }\n this.selector.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n};\n\n/**\n * Hide the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.hide = function(){\n this.layout.hidden = true;\n this.render();\n};\n\n/**\n * Show the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.show = function(){\n this.layout.hidden = false;\n this.render();\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * LocusZoom functionality used for data parsing and retrieval\n * @namespace\n * @public\n */\nLocusZoom.Data = LocusZoom.Data || {};\n\n/**\n * Create and coordinate an ensemble of (namespaced) data source instances\n * @public\n * @class\n */\nLocusZoom.DataSources = function() {\n /** @member {Object.} */\n this.sources = {};\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.addSource = function(ns, x) {\n console.warn(\"Warning: .addSource() is deprecated. Use .add() instead\");\n return this.add(ns, x);\n};\n\n/**\n * Add a (namespaced) datasource to the plot\n * @public\n * @param {String} ns A namespace used for fields from this data source\n * @param {LocusZoom.Data.Source|Array|null} x An instantiated datasource, or an array of arguments that can be used to\n * create a known datasource type.\n */\nLocusZoom.DataSources.prototype.add = function(ns, x) {\n return this.set(ns, x);\n};\n\n/** @protected */\nLocusZoom.DataSources.prototype.set = function(ns, x) {\n if (Array.isArray(x)) {\n // If passed array of source name and options, make the source\n var dsobj = LocusZoom.KnownDataSources.create.apply(null, x);\n // Each datasource in the chain should be aware of its assigned namespace\n dsobj.source_id = ns;\n this.sources[ns] = dsobj;\n } else {\n // If passed the already-created source object\n if (x !== null) {\n x.source_id = ns;\n this.sources[ns] = x;\n } else {\n delete this.sources[ns];\n }\n }\n return this;\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.getSource = function(ns) {\n console.warn(\"Warning: .getSource() is deprecated. Use .get() instead\");\n return this.get(ns);\n};\n\n/**\n * Return the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n * @returns {LocusZoom.Data.Source}\n */\nLocusZoom.DataSources.prototype.get = function(ns) {\n return this.sources[ns];\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.removeSource = function(ns) {\n console.warn(\"Warning: .removeSource() is deprecated. Use .remove() instead\");\n return this.remove(ns);\n};\n\n/**\n * Remove the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n */\nLocusZoom.DataSources.prototype.remove = function(ns) {\n return this.set(ns, null);\n};\n\n/**\n * Populate a list of datasources specified as a JSON object\n * @public\n * @param {String|Object} x An object or JSON representation containing {ns: configArray} entries\n * @returns {LocusZoom.DataSources}\n */\nLocusZoom.DataSources.prototype.fromJSON = function(x) {\n if (typeof x === \"string\") {\n x = JSON.parse(x);\n }\n var ds = this;\n Object.keys(x).forEach(function(ns) {\n ds.set(ns, x[ns]);\n });\n return ds;\n};\n\n/**\n * Return the names of all currently recognized datasources\n * @public\n * @returns {Array}\n */\nLocusZoom.DataSources.prototype.keys = function() {\n return Object.keys(this.sources);\n};\n\n/**\n * Datasources can be instantiated from a JSON object instead of code. This represents existing sources in that format.\n * For example, this can be helpful when sharing plots, or to share settings with others when debugging\n * @public\n */\nLocusZoom.DataSources.prototype.toJSON = function() {\n return this.sources;\n};\n\n/**\n * Represents an addressable unit of data from a namespaced datasource, subject to specified value transformations.\n *\n * When used by a data layer, fields will automatically be re-fetched from the appropriate data source whenever the\n * state of a plot fetches, eg pan or zoom operations that would affect what data is displayed.\n *\n * @public\n * @class\n * @param {String} field A string representing the namespace of the datasource, the name of the desired field to fetch\n * from that datasource, and arbitrarily many transformations to apply to the value. The namespace and\n * transformation(s) are optional and information is delimited according to the general syntax\n * `[namespace:]name[|transformation][|transformation]`. For example, `association:pvalue|neglog10`\n */\nLocusZoom.Data.Field = function(field){\n \n var parts = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/.exec(field);\n /** @member {String} */\n this.full_name = field;\n /** @member {String} */\n this.namespace = parts[1] || null;\n /** @member {String} */\n this.name = parts[2] || null;\n /** @member {Array} */\n this.transformations = [];\n \n if (typeof parts[3] == \"string\" && parts[3].length > 1){\n this.transformations = parts[3].substring(1).split(\"|\");\n this.transformations.forEach(function(transform, i){\n this.transformations[i] = LocusZoom.TransformationFunctions.get(transform);\n }.bind(this));\n }\n\n this.applyTransformations = function(val){\n this.transformations.forEach(function(transform){\n val = transform(val);\n });\n return val;\n };\n\n // Resolve the field for a given data element.\n // First look for a full match with transformations already applied by the data requester.\n // Otherwise prefer a namespace match and fall back to just a name match, applying transformations on the fly.\n this.resolve = function(d){\n if (typeof d[this.full_name] == \"undefined\"){\n var val = null;\n if (typeof (d[this.namespace+\":\"+this.name]) != \"undefined\"){ val = d[this.namespace+\":\"+this.name]; }\n else if (typeof d[this.name] != \"undefined\"){ val = d[this.name]; }\n d[this.full_name] = this.applyTransformations(val);\n }\n return d[this.full_name];\n };\n \n};\n\n/**\n * The Requester manages fetching of data across multiple data sources. It is used internally by LocusZoom data layers.\n * It passes state information and ensures that data is formatted in the manner expected by the plot.\n *\n * It is also responsible for constructing a \"chain\" of dependent requests, by requesting each datasource\n * sequentially in the order specified in the datalayer `fields` array. Data sources are only chained within a\n * data layer, and only if that layer requests more than one kind of data source.\n * @param {LocusZoom.DataSources} sources An object of {ns: LocusZoom.Data.Source} instances\n * @class\n */\nLocusZoom.Data.Requester = function(sources) {\n\n function split_requests(fields) {\n // Given a fields array, return an object specifying what datasource names the data layer should make requests\n // to, and how to handle the returned data\n var requests = {};\n // Regular expression finds namespace:field|trans\n var re = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/;\n fields.forEach(function(raw) {\n var parts = re.exec(raw);\n var ns = parts[1] || \"base\";\n var field = parts[2];\n var trans = LocusZoom.TransformationFunctions.get(parts[3]);\n if (typeof requests[ns] ==\"undefined\") {\n requests[ns] = {outnames:[], fields:[], trans:[]};\n }\n requests[ns].outnames.push(raw);\n requests[ns].fields.push(field);\n requests[ns].trans.push(trans);\n });\n return requests;\n }\n\n /**\n * Fetch data, and create a chain that only connects two data sources if they depend on each other\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields The list of data fields specified in the `layout` for a specific data layer\n * @returns {Promise}\n */\n this.getData = function(state, fields) {\n var requests = split_requests(fields);\n // Create an array of functions that, when called, will trigger the request to the specified datasource\n var request_handles = Object.keys(requests).map(function(key) {\n if (!sources.get(key)) {\n throw(\"Datasource for namespace \" + key + \" not found\");\n }\n return sources.get(key).getData(state, requests[key].fields, \n requests[key].outnames, requests[key].trans);\n });\n //assume the fields are requested in dependent order\n //TODO: better manage dependencies\n var ret = Q.when({header:{}, body:{}, discrete: {}});\n for(var i=0; i < request_handles.length; i++) {\n // If a single datalayer uses multiple sources, perform the next request when the previous one completes\n ret = ret.then(request_handles[i]);\n }\n return ret;\n };\n};\n\n/**\n * Base class for LocusZoom data sources\n * This can be extended with .extend() to create custom data sources\n * @class\n * @public\n */\nLocusZoom.Data.Source = function() {\n /**\n * Whether this source should enable caching\n * @member {Boolean}\n */\n this.enableCache = true;\n /**\n * Whether this data source type is dependent on previous requests- for example, the LD source cannot annotate\n * association data if no data was found for that region.\n * @member {boolean}\n */\n this.dependentSource = false;\n};\n\n/**\n * A default constructor that can be used when creating new data sources\n * @param {String|Object} init Basic configuration- either a url, or a config object\n * @param {String} [init.url] The datasource URL\n * @param {String} [init.params] Initial config params for the datasource\n */\nLocusZoom.Data.Source.prototype.parseInit = function(init) {\n if (typeof init === \"string\") {\n /** @member {String} */\n this.url = init;\n /** @member {String} */\n this.params = {};\n } else {\n this.url = init.url;\n this.params = init.params || {};\n }\n if (!this.url) {\n throw(\"Source not initialized with required URL\");\n }\n\n};\n\n/**\n * A unique identifier that indicates whether cached data is valid for this request\n * @protected\n * @param state\n * @param chain\n * @param fields\n * @returns {String|undefined}\n */\nLocusZoom.Data.Source.prototype.getCacheKey = function(state, chain, fields) {\n return this.getURL && this.getURL(state, chain, fields);\n};\n\n/**\n * Stub: build the URL for any requests made by this source.\n */\nLocusZoom.Data.Source.prototype.getURL = function(state, chain, fields) { return this.url; };\n\n/**\n * Perform a network request to fetch data for this source\n * @protected\n * @param {Object} state The state of the parent plot\n * @param chain\n * @param fields\n */\nLocusZoom.Data.Source.prototype.fetchRequest = function(state, chain, fields) {\n var url = this.getURL(state, chain, fields);\n return LocusZoom.createCORSPromise(\"GET\", url); \n};\n\n/**\n * Gets the data for just this source, typically via a network request (caching where possible)\n * @protected\n */\nLocusZoom.Data.Source.prototype.getRequest = function(state, chain, fields) {\n var req;\n var cacheKey = this.getCacheKey(state, chain, fields);\n if (this.enableCache && typeof(cacheKey) !== \"undefined\" && cacheKey === this._cachedKey) {\n req = Q.when(this._cachedResponse);\n } else {\n req = this.fetchRequest(state, chain, fields);\n if (this.enableCache) {\n req = req.then(function(x) {\n this._cachedKey = cacheKey;\n return this._cachedResponse = x;\n }.bind(this));\n }\n }\n return req;\n};\n\n/**\n * Fetch the data from the specified data source, and apply transformations requested by an external consumer.\n * This is the public-facing datasource method that will most commonly be called by external code.\n *\n * @public\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the \"namespace\" prefix)\n * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the\n * originally requested field name, including the namespace. This must be an array with the same length as `fields`\n * @param {Function[]} trans The collection of transformation functions to be run on selected fields.\n * This must be an array with the same length as `fields`\n * @returns {function} A callable operation that can be used as part of the data chain\n */\nLocusZoom.Data.Source.prototype.getData = function(state, fields, outnames, trans) {\n if (this.preGetData) {\n var pre = this.preGetData(state, fields, outnames, trans);\n if(this.pre) {\n state = pre.state || state;\n fields = pre.fields || fields;\n outnames = pre.outnames || outnames;\n trans = pre.trans || trans;\n }\n }\n\n var self = this;\n return function (chain) {\n if (self.dependentSource && chain && chain.body && !chain.body.length) {\n // A \"dependent\" source should not attempt to fire a request if there is no data for it to act on.\n // Therefore, it should simply return the previous data chain.\n return Q.when(chain);\n }\n\n return self.getRequest(state, chain, fields).then(function(resp) {\n return self.parseResponse(resp, chain, fields, outnames, trans);\n });\n };\n};\n\n/**\n * Ensure the server response is in a canonical form, an array of one object per record. [ {field: oneval} ].\n * If the server response contains columns, reformats the response from {column1: [], column2: []} to the above.\n *\n * Does not apply namespacing or transformations.\n *\n * May be overridden by data sources that inherently return more complex payloads, or that exist to annotate other\n * sources.\n *\n * @param {Object[]|Object} data The original parsed server response\n * @protected\n */\nLocusZoom.Data.Source.prototype.normalizeResponse = function (data) {\n if (Array.isArray(data)) {\n // Already in the desired form\n return data;\n }\n\n // Otherwise, assume the server response is an object representing columns of data.\n // Each array should have the same length (verify), and a given array index corresponds to a single row.\n var keys = Object.keys(data);\n var N = data[keys[0]].length;\n var sameLength = keys.every(function(key) {\n var item = data[key];\n return item.length === N;\n });\n if (!sameLength) {\n throw this.constructor.SOURCE_NAME + \" expects a response in which all arrays of data are the same length\";\n }\n\n // Go down the rows, and create an object for each record\n var records = [];\n var fields = Object.keys(data);\n for(var i = 0; i < N; i++) {\n var record = {};\n for(var j = 0; j < fields.length; j++) {\n record[fields[j]] = data[fields[j]][i];\n }\n records.push(record);\n }\n return records;\n};\n\n/** @deprecated */\nLocusZoom.Data.Source.prototype.prepareData = function (records) {\n console.warn(\"Warning: .prepareData() is deprecated. Use .annotateData() instead\");\n return this.annotateData(records);\n};\n\n/**\n * Hook to post-process the data returned by this source with new, additional behavior.\n * (eg cleaning up API values or performing complex calculations on the returned data)\n *\n * @param {Object[]} records The parsed data from the source (eg standardized api response)\n * @param {Object} chain The data chain object. For example, chain.headers may provide useful annotation metadata\n * @returns {Object[]|Promise} The modified set of records\n */\nLocusZoom.Data.Source.prototype.annotateData = function(records, chain) {\n // Default behavior: no transformations\n return records;\n};\n\n/**\n * Clean up the server records for use by datalayers: extract only certain fields, with the specified names.\n * Apply per-field transformations as appropriate.\n *\n * This hook can be overridden, eg to create a source that always returns all records and ignores the \"fields\" array.\n * This is particularly common for sources at the end of a chain- many \"dependent\" sources do not allow\n * cherry-picking individual fields, in which case by **convention** the fields array specifies \"last_source_name:all\"\n *\n * @param {Object[]} data One record object per element\n * @param {String[]} fields The names of fields to extract (as named in the source data). Eg \"afield\"\n * @param {String[]} outnames How to represent the source fields in the output. Eg \"namespace:afield|atransform\"\n * @param {function[]} trans An array of transformation functions (if any). One function per data element, or null.\n * @protected\n */\nLocusZoom.Data.Source.prototype.extractFields = function (data, fields, outnames, trans) {\n //intended for an array of objects\n // [ {\"id\":1, \"val\":5}, {\"id\":2, \"val\":10}]\n // Since a number of sources exist that do not obey this format, we will provide a convenient pass-through\n if (!Array.isArray(data)) {\n return data;\n }\n\n var fieldFound = [];\n for (var k=0; k1) {\n if (fields.length!==2 || fields.indexOf(\"isrefvar\")===-1) {\n throw(\"LD does not know how to get all fields: \" + fields.join(\", \"));\n }\n }\n};\n\nLocusZoom.Data.LDSource.prototype.findMergeFields = function(chain) {\n // since LD may be shared across sources with different namespaces\n // we use regex to find columns to join on rather than \n // requiring exact matches\n var exactMatch = function(arr) {return function() {\n var regexes = arguments;\n for(var i=0; i0) {\n var names = Object.keys(chain.body[0]);\n var nameMatch = exactMatch(names);\n dataFields.id = dataFields.id || nameMatch(/\\bvariant\\b/) || nameMatch(/\\bid\\b/);\n dataFields.position = dataFields.position || nameMatch(/\\bposition\\b/i, /\\bpos\\b/i);\n dataFields.pvalue = dataFields.pvalue || nameMatch(/\\bpvalue\\b/i, /\\blog_pvalue\\b/i);\n dataFields._names_ = names;\n }\n return dataFields;\n};\n\nLocusZoom.Data.LDSource.prototype.findRequestedFields = function(fields, outnames) {\n var obj = {};\n for(var i=0; i extremeVal) {\n extremeVal = x[i][pval] * sign;\n extremeIdx = i;\n }\n }\n return extremeIdx;\n };\n\n var refSource = state.ldrefsource || chain.header.ldrefsource || 1;\n var reqFields = this.findRequestedFields(fields);\n var refVar = reqFields.ldin;\n if (refVar === \"state\") {\n refVar = state.ldrefvar || chain.header.ldrefvar || \"best\";\n }\n if (refVar === \"best\") {\n if (!chain.body) {\n throw(\"No association data found to find best pvalue\");\n }\n var keys = this.findMergeFields(chain);\n if (!keys.pvalue || !keys.id) {\n var columns = \"\";\n if (!keys.id){ columns += (columns.length ? \", \" : \"\") + \"id\"; }\n if (!keys.pvalue){ columns += (columns.length ? \", \" : \"\") + \"pvalue\"; }\n throw(\"Unable to find necessary column(s) for merge: \" + columns + \" (available: \" + keys._names_ + \")\");\n }\n refVar = chain.body[findExtremeValue(chain.body, keys.pvalue)][keys.id];\n }\n if (!chain.header) {chain.header = {};}\n chain.header.ldrefvar = refVar;\n return this.url + \"results/?filter=reference eq \" + refSource + \n \" and chromosome2 eq '\" + state.chr + \"'\" + \n \" and position2 ge \" + state.start + \n \" and position2 le \" + state.end + \n \" and variant1 eq '\" + refVar + \"'\" + \n \"&fields=chr,pos,rsquare\";\n};\n\nLocusZoom.Data.LDSource.prototype.combineChainBody = function (data, chain, fields, outnames) {\n var keys = this.findMergeFields(chain);\n var reqFields = this.findRequestedFields(fields, outnames);\n if (!keys.position) {\n throw(\"Unable to find position field for merge: \" + keys._names_);\n }\n var leftJoin = function(left, right, lfield, rfield) {\n var i=0, j=0;\n while (i < left.length && j < right.position2.length) {\n if (left[i][keys.position] === right.position2[j]) {\n left[i][lfield] = right[rfield][j];\n i++;\n j++;\n } else if (left[i][keys.position] < right.position2[j]) {\n i++;\n } else {\n j++;\n }\n }\n };\n var tagRefVariant = function(data, refvar, idfield, outname) {\n for(var i=0; i} */\n this.panels = {};\n /**\n * TODO: This is currently used by external classes that manipulate the parent and may indicate room for a helper method in the api to coordinate boilerplate\n * @protected\n * @member {String[]}\n */\n this.panel_ids_by_y_index = [];\n\n /**\n * Notify each child panel of the plot of changes in panel ordering/ arrangement\n */\n this.applyPanelYIndexesToPanelLayouts = function(){\n this.panel_ids_by_y_index.forEach(function(pid, idx){\n this.panels[pid].layout.y_index = idx;\n }.bind(this));\n };\n\n /**\n * Get the qualified ID pathname for the plot\n * @returns {String}\n */\n this.getBaseId = function(){\n return this.id;\n };\n\n /**\n * Track update operations (reMap) performed on all child panels, and notify the parent plot when complete\n * TODO: Reconsider whether we need to be tracking this as global state outside of context of specific operations\n * @protected\n * @member {Promise[]}\n */\n this.remap_promises = [];\n\n if (typeof layout == \"undefined\"){\n /**\n * The layout is a serializable object used to describe the composition of the Plot\n * If no layout was passed, use the Standard Association Layout\n * Otherwise merge whatever was passed with the Default Layout\n * TODO: Review description; we *always* merge with default layout?\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge({}, LocusZoom.Layouts.get(\"plot\", \"standard_association\"));\n } else {\n this.layout = layout;\n }\n LocusZoom.Layouts.merge(this.layout, LocusZoom.Plot.DefaultLayout);\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original plot state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n\n /**\n * Create a shortcut to the state in the layout on the Plot. Tracking in the layout allows the plot to be created\n * with initial state/setup.\n *\n * Tracks state of the plot, eg start and end position\n * @member {Object}\n */\n this.state = this.layout.state;\n\n /** @member {LocusZoom.Data.Requester} */\n this.lzd = new LocusZoom.Data.Requester(datasource);\n\n /**\n * Window.onresize listener (responsive layouts only)\n * TODO: .on appears to return a selection, not a listener? Check logic here\n * https://github.com/d3/d3-selection/blob/00b904b9bcec4dfaf154ae0bbc777b1fc1d7bc08/test/selection/on-test.js#L11\n * @deprecated\n * @member {d3.selection}\n */\n this.window_onresize = null;\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": [],\n \"state_changed\": [] // Only triggered when a state change causes rerender\n };\n\n /**\n * @callback eventCallback\n * @param {object} eventData A description of the event\n * @param {String|null} eventData.sourceID The unique identifier (eg plot or parent name) of the element that\n * triggered the event. Will be automatically filled in if not explicitly provided.\n * @param {Object|null} eventData.context Any additional information to be passed to the callback, eg the data\n * associated with a clicked plot element\n */\n\n /**\n * There are several events that a LocusZoom plot can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following plot-level events are currently supported:\n * - `layout_changed` - context: plot - Any aspect of the plot's layout (including dimensions or state) has changed.\n * - `data_requested` - context: plot - A request for new data from any data source used in the plot has been made.\n * - `data_rendered` - context: plot - Data from a request has been received and rendered in the plot.\n * - `element_clicked` - context: plot - A data element in any of the plot's data layers has been clicked.\n * - `element_selection` - context: plot - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `plot.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * plot itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Plot}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n * @param {string} event A known event name\n * @param {*} eventData Data or event description that will be passed to the event listener\n * @returns {LocusZoom.Plot}\n */\n this.emit = function(event, eventData) {\n // TODO: there are small differences between the emit implementation between plots and panels. In the future,\n // DRY this code via mixins, and make sure to keep the interfaces compatible when refactoring.\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n var sourceID = this.getBaseId();\n var self = this;\n this.event_hooks[event].forEach(function(hookToRun) {\n var eventContext;\n if (eventData && eventData.sourceID) {\n // If we detect that an event originated elsewhere (via bubbling or externally), preserve the context\n // when re-emitting the event to plot-level listeners\n eventContext = eventData;\n } else {\n eventContext = {sourceID: sourceID, data: eventData || null};\n }\n // By default, any handlers fired here (either directly, or bubbled) will see the plot as the\n // value of `this`. If a bound function is registered as a handler, the previously bound `this` will\n // override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the plot's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the plot\n * @returns {{x: Number, y: Number, width: Number, height: Number}}\n */\n this.getPageOrigin = function(){\n var bounding_client_rect = this.svg.node().getBoundingClientRect();\n var x_offset = document.documentElement.scrollLeft || document.body.scrollLeft;\n var y_offset = document.documentElement.scrollTop || document.body.scrollTop;\n var container = this.svg.node();\n while (container.parentNode !== null){\n container = container.parentNode;\n if (container !== document && d3.select(container).style(\"position\") !== \"static\"){\n x_offset = -1 * container.getBoundingClientRect().left;\n y_offset = -1 * container.getBoundingClientRect().top;\n break;\n }\n }\n return {\n x: x_offset + bounding_client_rect.left,\n y: y_offset + bounding_client_rect.top,\n width: bounding_client_rect.width,\n height: bounding_client_rect.height\n };\n };\n\n /**\n * Get the top and left offset values for the plot's container element (the div that was populated)\n * @returns {{top: number, left: number}}\n */\n this.getContainerOffset = function(){\n var offset = { top: 0, left: 0 };\n var container = this.container.offsetParent || null;\n while (container !== null){\n offset.top += container.offsetTop;\n offset.left += container.offsetLeft;\n container = container.offsetParent || null;\n }\n return offset;\n };\n\n //\n /**\n * Event information describing interaction (e.g. panning and zooming) is stored on the plot\n * TODO: Add/ document details of interaction structure as we expand\n * @member {{panel_id: String, linked_panel_ids: Array, x_linked: *, dragging: *, zooming: *}}\n * @returns {LocusZoom.Plot}\n */\n this.interaction = {};\n\n /**\n * Track whether the target panel can respond to mouse interaction events\n * @param {String} panel_id\n * @returns {boolean}\n */\n this.canInteract = function(panel_id){\n panel_id = panel_id || null;\n if (panel_id){\n return ((typeof this.interaction.panel_id == \"undefined\" || this.interaction.panel_id === panel_id) && !this.loading_data);\n } else {\n return !(this.interaction.dragging || this.interaction.zooming || this.loading_data);\n }\n };\n\n // Initialize the layout\n this.initializeLayout();\n // TODO: Possibly superfluous return from constructor\n return this;\n};\n\n/**\n * Default/ expected configuration parameters for basic plotting; most plots will override\n *\n * @protected\n * @static\n * @type {Object}\n */\nLocusZoom.Plot.DefaultLayout = {\n state: {},\n width: 1,\n height: 1,\n min_width: 1,\n min_height: 1,\n responsive_resize: false,\n aspect_ratio: 1,\n panels: [],\n dashboard: {\n components: []\n },\n panel_boundaries: true,\n mouse_guide: true\n};\n\n/**\n * Helper method to sum the proportional dimensions of panels, a value that's checked often as panels are added/removed\n * @param {('Height'|'Width')} dimension\n * @returns {number}\n */\nLocusZoom.Plot.prototype.sumProportional = function(dimension){\n if (dimension !== \"height\" && dimension !== \"width\"){\n throw (\"Bad dimension value passed to LocusZoom.Plot.prototype.sumProportional\");\n }\n var total = 0;\n for (var id in this.panels){\n // Ensure every panel contributing to the sum has a non-zero proportional dimension\n if (!this.panels[id].layout[\"proportional_\" + dimension]){\n this.panels[id].layout[\"proportional_\" + dimension] = 1 / Object.keys(this.panels).length;\n }\n total += this.panels[id].layout[\"proportional_\" + dimension];\n }\n return total;\n};\n\n/**\n * Resize the plot to fit the bounding container\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.rescaleSVG = function(){\n var clientRect = this.svg.node().getBoundingClientRect();\n this.setDimensions(clientRect.width, clientRect.height);\n return this;\n};\n\n/**\n * Prepare the plot for first use by performing parameter validation, setting up panels, and calculating dimensions\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initializeLayout = function(){\n\n // Sanity check layout values\n // TODO: Find a way to generally abstract this, maybe into an object that models allowed layout values?\n if (isNaN(this.layout.width) || this.layout.width <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.height) || this.layout.height <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.aspect_ratio) || this.layout.aspect_ratio <= 0){\n throw (\"Plot layout parameter `aspect_ratio` must be a positive number\");\n }\n\n // If this is a responsive layout then set a namespaced/unique onresize event listener on the window\n if (this.layout.responsive_resize){\n this.window_onresize = d3.select(window).on(\"resize.lz-\"+this.id, function(){\n this.rescaleSVG();\n }.bind(this));\n // Forcing one additional setDimensions() call after the page is loaded clears up\n // any disagreements between the initial layout and the loaded responsive container's size\n d3.select(window).on(\"load.lz-\"+this.id, function(){\n this.setDimensions();\n }.bind(this));\n }\n\n // Add panels\n this.layout.panels.forEach(function(panel_layout){\n this.addPanel(panel_layout);\n }.bind(this));\n\n return this;\n};\n\n/**\n * Set the dimensions for a plot, and ensure that panels are sized and positioned correctly.\n *\n * If dimensions are provided, resizes each panel proportionally to match the new plot dimensions. Otherwise,\n * calculates the appropriate plot dimensions based on all panels.\n * @param {Number} [width] If provided and larger than minimum size, set plot to this width\n * @param {Number} [height] If provided and larger than minimum size, set plot to this height\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.setDimensions = function(width, height){\n\n var id;\n\n // Update minimum allowable width and height by aggregating minimums from panels, then apply minimums to containing element.\n var min_width = parseFloat(this.layout.min_width) || 0;\n var min_height = parseFloat(this.layout.min_height) || 0;\n for (id in this.panels){\n min_width = Math.max(min_width, this.panels[id].layout.min_width);\n if (parseFloat(this.panels[id].layout.min_height) > 0 && parseFloat(this.panels[id].layout.proportional_height) > 0){\n min_height = Math.max(min_height, (this.panels[id].layout.min_height / this.panels[id].layout.proportional_height));\n }\n }\n this.layout.min_width = Math.max(min_width, 1);\n this.layout.min_height = Math.max(min_height, 1);\n d3.select(this.svg.node().parentNode).style({\n \"min-width\": this.layout.min_width + \"px\",\n \"min-height\": this.layout.min_height + \"px\"\n });\n\n // If width and height arguments were passed then adjust them against plot minimums if necessary.\n // Then resize the plot and proportionally resize panels to fit inside the new plot dimensions.\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n // Override discrete values if resizing responsively\n if (this.layout.responsive_resize){\n if (this.svg){\n this.layout.width = Math.max(this.svg.node().parentNode.getBoundingClientRect().width, this.layout.min_width);\n }\n this.layout.height = this.layout.width / this.layout.aspect_ratio;\n if (this.layout.height < this.layout.min_height){\n this.layout.height = this.layout.min_height;\n this.layout.width = this.layout.height * this.layout.aspect_ratio;\n }\n }\n // Resize/reposition panels to fit, update proportional origins if necessary\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel_width = this.layout.width;\n var panel_height = this.panels[panel_id].layout.proportional_height * this.layout.height;\n this.panels[panel_id].setDimensions(panel_width, panel_height);\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n this.panels[panel_id].layout.proportional_origin.y = y_offset / this.layout.height;\n y_offset += panel_height;\n this.panels[panel_id].dashboard.update();\n }.bind(this));\n }\n\n // If width and height arguments were NOT passed (and panels exist) then determine the plot dimensions\n // by making it conform to panel dimensions, assuming panels are already positioned correctly.\n else if (Object.keys(this.panels).length) {\n this.layout.width = 0;\n this.layout.height = 0;\n for (id in this.panels){\n this.layout.width = Math.max(this.panels[id].layout.width, this.layout.width);\n this.layout.height += this.panels[id].layout.height;\n }\n this.layout.width = Math.max(this.layout.width, this.layout.min_width);\n this.layout.height = Math.max(this.layout.height, this.layout.min_height);\n }\n\n // Keep aspect ratio in agreement with dimensions\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n\n // Apply layout width and height as discrete values or viewbox values\n if (this.svg !== null){\n if (this.layout.responsive_resize){\n this.svg\n .attr(\"viewBox\", \"0 0 \" + this.layout.width + \" \" + this.layout.height)\n .attr(\"preserveAspectRatio\", \"xMinYMin meet\");\n } else {\n this.svg.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n }\n\n // If the plot has been initialized then trigger some necessary render functions\n if (this.initialized){\n this.panel_boundaries.position();\n this.dashboard.update();\n this.curtain.update();\n this.loader.update();\n }\n\n return this.emit(\"layout_changed\");\n};\n\n/**\n * Create a new panel from a layout, and handle the work of initializing and placing the panel on the plot\n * @param {Object} layout\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Plot.prototype.addPanel = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\"){\n throw \"Invalid panel layout passed to LocusZoom.Plot.prototype.addPanel()\";\n }\n\n // Create the Panel and set its parent\n var panel = new LocusZoom.Panel(layout, this);\n\n // Store the Panel on the Plot\n this.panels[panel.id] = panel;\n\n // If a discrete y_index was set in the layout then adjust other panel y_index values to accommodate this one\n if (panel.layout.y_index !== null && !isNaN(panel.layout.y_index)\n && this.panel_ids_by_y_index.length > 0){\n // Negative y_index values should count backwards from the end, so convert negatives to appropriate values here\n if (panel.layout.y_index < 0){\n panel.layout.y_index = Math.max(this.panel_ids_by_y_index.length + panel.layout.y_index, 0);\n }\n this.panel_ids_by_y_index.splice(panel.layout.y_index, 0, panel.id);\n this.applyPanelYIndexesToPanelLayouts();\n } else {\n var length = this.panel_ids_by_y_index.push(panel.id);\n this.panels[panel.id].layout.y_index = length - 1;\n }\n\n // Determine if this panel was already in the layout.panels array.\n // If it wasn't, add it. Either way store the layout.panels array index on the panel.\n var layout_idx = null;\n this.layout.panels.forEach(function(panel_layout, idx){\n if (panel_layout.id === panel.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.panels.push(this.panels[panel.id].layout) - 1;\n }\n this.panels[panel.id].layout_idx = layout_idx;\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n this.positionPanels();\n // Initialize and load data into the new panel\n this.panels[panel.id].initialize();\n this.panels[panel.id].reMap();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this.panels[panel.id];\n};\n\n\n/**\n * Clear all state, tooltips, and other persisted data associated with one (or all) panel(s) in the plot\n *\n * This is useful when reloading an existing plot with new data, eg \"click for genome region\" links.\n * This is a utility method for custom usage. It is not fired automatically during normal rerender of existing panels\n * @param {String} [panelId] If provided, clear state for only this panel. Otherwise, clear state for all panels.\n * @param {('wipe'|'reset')} [mode='wipe'] Optionally specify how state should be cleared. `wipe` deletes all data\n * and is useful for when the panel is being removed; `reset` is best when the panel will be reused in place.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.clearPanelData = function(panelId, mode) {\n mode = mode || \"wipe\";\n\n // TODO: Add unit tests for this method\n var panelsList;\n if (panelId) {\n panelsList = [panelId];\n } else {\n panelsList = Object.keys(this.panels);\n }\n var self = this;\n panelsList.forEach(function(pid) {\n self.panels[pid].data_layer_ids_by_z_index.forEach(function(dlid){\n var layer = self.panels[pid].data_layers[dlid];\n layer.destroyAllTooltips();\n\n delete self.layout.state[pid + \".\" + dlid];\n if(mode === \"reset\") {\n layer.setDefaultState();\n }\n });\n });\n return this;\n};\n\n/**\n * Remove the panel from the plot, and clear any state, tooltips, or other visual elements belonging to nested content\n * @param {String} id\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.removePanel = function(id){\n if (!this.panels[id]){\n throw (\"Unable to remove panel, ID not found: \" + id);\n }\n\n // Hide all panel boundaries\n this.panel_boundaries.hide();\n\n // Destroy all tooltips and state vars for all data layers on the panel\n this.clearPanelData(id);\n\n // Remove all panel-level HTML overlay elements\n this.panels[id].loader.hide();\n this.panels[id].dashboard.destroy(true);\n this.panels[id].curtain.hide();\n\n // Remove the svg container for the panel if it exists\n if (this.panels[id].svg.container){\n this.panels[id].svg.container.remove();\n }\n\n // Delete the panel and its presence in the plot layout and state\n this.layout.panels.splice(this.panels[id].layout_idx, 1);\n delete this.panels[id];\n delete this.layout.state[id];\n\n // Update layout_idx values for all remaining panels\n this.layout.panels.forEach(function(panel_layout, idx){\n this.panels[panel_layout.id].layout_idx = idx;\n }.bind(this));\n\n // Remove the panel id from the y_index array\n this.panel_ids_by_y_index.splice(this.panel_ids_by_y_index.indexOf(id), 1);\n this.applyPanelYIndexesToPanelLayouts();\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n // Allow the plot to shrink when panels are removed, by forcing it to recalculate min dimensions from scratch\n this.layout.min_height = this._base_layout.min_height;\n this.layout.min_width = this._base_layout.min_width;\n\n this.positionPanels();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this;\n};\n\n\n/**\n * Automatically position panels based on panel positioning rules and values.\n * Keep panels from overlapping vertically by adjusting origins, and keep the sum of proportional heights at 1.\n *\n * TODO: This logic currently only supports dynamic positioning of panels to prevent overlap in a VERTICAL orientation.\n * Some framework exists for positioning panels in horizontal orientations as well (width, proportional_width, origin.x, etc.)\n * but the logic for keeping these user-definable values straight approaches the complexity of a 2D box-packing algorithm.\n * That's complexity we don't need right now, and may not ever need, so it's on hiatus until a use case materializes.\n */\nLocusZoom.Plot.prototype.positionPanels = function(){\n\n var id;\n\n // We want to enforce that all x-linked panels have consistent horizontal margins\n // (to ensure that aligned items stay aligned despite inconsistent initial layout parameters)\n // NOTE: This assumes panels have consistent widths already. That should probably be enforced too!\n var x_linked_margins = { left: 0, right: 0 };\n\n // Proportional heights for newly added panels default to null unless explicitly set, so determine appropriate\n // proportional heights for all panels with a null value from discretely set dimensions.\n // Likewise handle default nulls for proportional widths, but instead just force a value of 1 (full width)\n for (id in this.panels){\n if (this.panels[id].layout.proportional_height === null){\n this.panels[id].layout.proportional_height = this.panels[id].layout.height / this.layout.height;\n }\n if (this.panels[id].layout.proportional_width === null){\n this.panels[id].layout.proportional_width = 1;\n }\n if (this.panels[id].layout.interaction.x_linked){\n x_linked_margins.left = Math.max(x_linked_margins.left, this.panels[id].layout.margin.left);\n x_linked_margins.right = Math.max(x_linked_margins.right, this.panels[id].layout.margin.right);\n }\n }\n\n // Sum the proportional heights and then adjust all proportionally so that the sum is exactly 1\n var total_proportional_height = this.sumProportional(\"height\");\n if (!total_proportional_height){\n return this;\n }\n var proportional_adjustment = 1 / total_proportional_height;\n for (id in this.panels){\n this.panels[id].layout.proportional_height *= proportional_adjustment;\n }\n\n // Update origins on all panels without changing plot-level dimensions yet\n // Also apply x-linked margins to x-linked panels, updating widths as needed\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n y_offset += this.panels[panel_id].layout.height;\n if (this.panels[panel_id].layout.interaction.x_linked){\n var delta = Math.max(x_linked_margins.left - this.panels[panel_id].layout.margin.left, 0)\n + Math.max(x_linked_margins.right - this.panels[panel_id].layout.margin.right, 0);\n this.panels[panel_id].layout.width += delta;\n this.panels[panel_id].layout.margin.left = x_linked_margins.left;\n this.panels[panel_id].layout.margin.right = x_linked_margins.right;\n this.panels[panel_id].layout.cliparea.origin.x = x_linked_margins.left;\n }\n }.bind(this));\n var calculated_plot_height = y_offset;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].layout.proportional_origin.y = this.panels[panel_id].layout.origin.y / calculated_plot_height;\n }.bind(this));\n\n // Update dimensions on the plot to accommodate repositioned panels\n this.setDimensions();\n\n // Set dimensions on all panels using newly set plot-level dimensions and panel-level proportional dimensions\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setDimensions(this.layout.width * this.panels[panel_id].layout.proportional_width,\n this.layout.height * this.panels[panel_id].layout.proportional_height);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Prepare the first rendering of the plot. This includes initializing the individual panels, but also creates shared\n * elements such as mouse events, panel guides/boundaries, and loader/curtain.\n *\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initialize = function(){\n\n // Ensure proper responsive class is present on the containing node if called for\n if (this.layout.responsive_resize){\n d3.select(this.container).classed(\"lz-container-responsive\", true);\n }\n\n // Create an element/layer for containing mouse guides\n if (this.layout.mouse_guide) {\n var mouse_guide_svg = this.svg.append(\"g\")\n .attr(\"class\", \"lz-mouse_guide\").attr(\"id\", this.id + \".mouse_guide\");\n var mouse_guide_vertical_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-vertical\").attr(\"x\",-1);\n var mouse_guide_horizontal_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-horizontal\").attr(\"y\",-1);\n this.mouse_guide = {\n svg: mouse_guide_svg,\n vertical: mouse_guide_vertical_svg,\n horizontal: mouse_guide_horizontal_svg\n };\n }\n\n // Add curtain and loader prototpyes to the plot\n this.curtain = LocusZoom.generateCurtain.call(this);\n this.loader = LocusZoom.generateLoader.call(this);\n\n // Create the panel_boundaries object with show/position/hide methods\n this.panel_boundaries = {\n parent: this,\n hide_timeout: null,\n showing: false,\n dragging: false,\n selectors: [],\n corner_selector: null,\n show: function(){\n // Generate panel boundaries\n if (!this.showing && !this.parent.curtain.showing){\n this.showing = true;\n // Loop through all panels to create a horizontal boundary for each\n this.parent.panel_ids_by_y_index.forEach(function(panel_id, panel_idx){\n var selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-boundary\")\n .attr(\"title\", \"Resize panel\");\n selector.append(\"span\");\n var panel_resize_drag = d3.behavior.drag();\n panel_resize_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n panel_resize_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n panel_resize_drag.on(\"drag\", function(){\n // First set the dimensions on the panel we're resizing\n var this_panel = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]];\n var original_panel_height = this_panel.layout.height;\n this_panel.setDimensions(this_panel.layout.width, this_panel.layout.height + d3.event.dy);\n var panel_height_change = this_panel.layout.height - original_panel_height;\n var new_calculated_plot_height = this.parent.layout.height + panel_height_change;\n // Next loop through all panels.\n // Update proportional dimensions for all panels including the one we've resized using discrete heights.\n // Reposition panels with a greater y-index than this panel to their appropriate new origin.\n this.parent.panel_ids_by_y_index.forEach(function(loop_panel_id, loop_panel_idx){\n var loop_panel = this.parent.panels[this.parent.panel_ids_by_y_index[loop_panel_idx]];\n loop_panel.layout.proportional_height = loop_panel.layout.height / new_calculated_plot_height;\n if (loop_panel_idx > panel_idx){\n loop_panel.setOrigin(loop_panel.layout.origin.x, loop_panel.layout.origin.y + panel_height_change);\n loop_panel.dashboard.position();\n }\n }.bind(this));\n // Reset dimensions on the entire plot and reposition panel boundaries\n this.parent.positionPanels();\n this.position();\n }.bind(this));\n selector.call(panel_resize_drag);\n this.parent.panel_boundaries.selectors.push(selector);\n }.bind(this));\n // Create a corner boundary / resize element on the bottom-most panel that resizes the entire plot\n var corner_selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-corner-boundary\")\n .attr(\"title\", \"Resize plot\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-outer\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-inner\");\n var corner_drag = d3.behavior.drag();\n corner_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n corner_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n corner_drag.on(\"drag\", function(){\n this.setDimensions(this.layout.width + d3.event.dx, this.layout.height + d3.event.dy);\n }.bind(this.parent));\n corner_selector.call(corner_drag);\n this.parent.panel_boundaries.corner_selector = corner_selector;\n }\n return this.position();\n },\n position: function(){\n if (!this.showing){ return this; }\n // Position panel boundaries\n var plot_page_origin = this.parent.getPageOrigin();\n this.selectors.forEach(function(selector, panel_idx){\n var panel_page_origin = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].getPageOrigin();\n var left = plot_page_origin.x;\n var top = panel_page_origin.y + this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].layout.height - 12;\n var width = this.parent.layout.width - 1;\n selector.style({\n top: top + \"px\",\n left: left + \"px\",\n width: width + \"px\"\n });\n selector.select(\"span\").style({\n width: width + \"px\"\n });\n }.bind(this));\n // Position corner selector\n var corner_padding = 10;\n var corner_size = 16;\n this.corner_selector.style({\n top: (plot_page_origin.y + this.parent.layout.height - corner_padding - corner_size) + \"px\",\n left: (plot_page_origin.x + this.parent.layout.width - corner_padding - corner_size) + \"px\"\n });\n return this;\n },\n hide: function(){\n if (!this.showing){ return this; }\n this.showing = false;\n // Remove panel boundaries\n this.selectors.forEach(function(selector){ selector.remove(); });\n this.selectors = [];\n // Remove corner boundary\n this.corner_selector.remove();\n this.corner_selector = null;\n return this;\n }\n };\n\n // Show panel boundaries stipulated by the layout (basic toggle, only show on mouse over plot)\n if (this.layout.panel_boundaries){\n d3.select(this.svg.node().parentNode).on(\"mouseover.\" + this.id + \".panel_boundaries\", function(){\n clearTimeout(this.panel_boundaries.hide_timeout);\n this.panel_boundaries.show();\n }.bind(this));\n d3.select(this.svg.node().parentNode).on(\"mouseout.\" + this.id + \".panel_boundaries\", function(){\n this.panel_boundaries.hide_timeout = setTimeout(function(){\n this.panel_boundaries.hide();\n }.bind(this), 300);\n }.bind(this));\n }\n\n // Create the dashboard object and immediately show it\n this.dashboard = new LocusZoom.Dashboard(this).show();\n\n // Initialize all panels\n for (var id in this.panels){\n this.panels[id].initialize();\n }\n\n // Define plot-level mouse events\n var namespace = \".\" + this.id;\n if (this.layout.mouse_guide) {\n var mouseout_mouse_guide = function(){\n this.mouse_guide.vertical.attr(\"x\", -1);\n this.mouse_guide.horizontal.attr(\"y\", -1);\n }.bind(this);\n var mousemove_mouse_guide = function(){\n var coords = d3.mouse(this.svg.node());\n this.mouse_guide.vertical.attr(\"x\", coords[0]);\n this.mouse_guide.horizontal.attr(\"y\", coords[1]);\n }.bind(this);\n this.svg\n .on(\"mouseout\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"touchleave\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"mousemove\" + namespace + \"-mouse_guide\", mousemove_mouse_guide);\n }\n var mouseup = function(){\n this.stopDrag();\n }.bind(this);\n var mousemove = function(){\n if (this.interaction.dragging){\n var coords = d3.mouse(this.svg.node());\n if (d3.event){ d3.event.preventDefault(); }\n this.interaction.dragging.dragged_x = coords[0] - this.interaction.dragging.start_x;\n this.interaction.dragging.dragged_y = coords[1] - this.interaction.dragging.start_y;\n this.panels[this.interaction.panel_id].render();\n this.interaction.linked_panel_ids.forEach(function(panel_id){\n this.panels[panel_id].render();\n }.bind(this));\n }\n }.bind(this);\n this.svg\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup)\n .on(\"mousemove\" + namespace, mousemove)\n .on(\"touchmove\" + namespace, mousemove);\n\n // Add an extra namespaced mouseup handler to the containing body, if there is one\n // This helps to stop interaction events gracefully when dragging outside of the plot element\n if (!d3.select(\"body\").empty()){\n d3.select(\"body\")\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup);\n }\n\n this.initialized = true;\n\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n var client_rect = this.svg.node().getBoundingClientRect();\n var width = client_rect.width ? client_rect.width : this.layout.width;\n var height = client_rect.height ? client_rect.height : this.layout.height;\n this.setDimensions(width, height);\n\n return this;\n\n};\n\n/**\n * Refresh (or fetch) a plot's data from sources, regardless of whether position or state has changed\n * @returns {Promise}\n */\nLocusZoom.Plot.prototype.refresh = function(){\n return this.applyState();\n};\n\n\n/**\n * A user-defined callback function that can receive (and potentially act on) new plot data.\n * @callback externalDataCallback\n * @param {Object} new_data The body resulting from a data request. This represents the same information that would be passed to\n * a data layer making an equivalent request.\n */\n\n/**\n * A user-defined callback function that can respond to errors received during a previous operation\n * @callback externalErrorCallback\n * @param err A representation of the error that occurred\n */\n\n/**\n * Allow newly fetched data to be made available outside the LocusZoom plot. For example, a callback could be\n * registered to draw an HTML table of top GWAS hits, and update that table whenever the plot region changes.\n *\n * This is a convenience method for external hooks. It registers an event listener and returns parsed data,\n * using the same fields syntax and underlying methods as data layers.\n *\n * @param {String[]} fields An array of field names and transforms, in the same syntax used by a data layer.\n * Different data sources should be prefixed by the source name.\n * @param {externalDataCallback} success_callback Used defined function that is automatically called any time that\n * new data is received by the plot.\n * @param {Object} [opts] Options\n * @param {externalErrorCallback} [opts.onerror] User defined function that is automatically called if a problem\n * occurs during the data request or subsequent callback operations\n * @param {boolean} [opts.discrete=false] Normally the callback will subscribe to the combined body from the chain,\n * which may not be in a format that matches what the external callback wants to do. If discrete=true, returns the\n * uncombined record info\n * @return {function} The newly created event listener, to allow for later cleanup/removal\n */\nLocusZoom.Plot.prototype.subscribeToData = function(fields, success_callback, opts) {\n opts = opts || {};\n\n // Register an event listener that is notified whenever new data has been rendered\n var error_callback = opts.onerror || function(err) {\n console.log(\"An error occurred while acting on an external callback\", err);\n };\n var self = this;\n\n var listener = function() {\n try {\n self.lzd.getData(self.state, fields)\n .then(function (new_data) {\n success_callback(opts.discrete ? new_data.discrete : new_data.body);\n }).catch(error_callback);\n } catch (error) {\n // In certain cases, errors are thrown before a promise can be generated, and LZ error display seems to rely on these errors bubbling up\n error_callback(error);\n }\n };\n this.on(\"data_rendered\", listener);\n return listener;\n};\n\n/**\n * Update state values and trigger a pull for fresh data on all data sources for all data layers\n * @param state_changes\n * @returns {Promise} A promise that resolves when all data fetch and update operations are complete\n */\nLocusZoom.Plot.prototype.applyState = function(state_changes){\n state_changes = state_changes || {};\n if (typeof state_changes != \"object\"){\n throw(\"LocusZoom.applyState only accepts an object; \" + (typeof state_changes) + \" given\");\n }\n\n // First make a copy of the current (old) state to work with\n var new_state = JSON.parse(JSON.stringify(this.state));\n\n // Apply changes by top-level property to the new state\n for (var property in state_changes) {\n new_state[property] = state_changes[property];\n }\n\n // Validate the new state (may do nothing, may do a lot, depends on how the user has things set up)\n new_state = LocusZoom.validateState(new_state, this.layout);\n\n // Apply new state to the actual state\n for (property in new_state) {\n this.state[property] = new_state[property];\n }\n\n // Generate requests for all panels given new state\n this.emit(\"data_requested\");\n this.remap_promises = [];\n this.loading_data = true;\n for (var id in this.panels){\n this.remap_promises.push(this.panels[id].reMap());\n }\n\n return Q.all(this.remap_promises)\n .catch(function(error){\n console.error(error);\n this.curtain.drop(error);\n this.loading_data = false;\n }.bind(this))\n .then(function(){\n // TODO: Check logic here; in some promise implementations, this would cause the error to be considered handled, and \"then\" would always fire. (may or may not be desired behavior)\n // Update dashboard / components\n this.dashboard.update();\n\n // Apply panel-level state values\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel = this.panels[panel_id];\n panel.dashboard.update();\n // Apply data-layer-level state values\n panel.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n var data_layer = this.data_layers[data_layer_id];\n var state_id = panel_id + \".\" + data_layer_id;\n for (var property in this.state[state_id]){\n if (!this.state[state_id].hasOwnProperty(property)){ continue; }\n if (Array.isArray(this.state[state_id][property])){\n this.state[state_id][property].forEach(function(element_id){\n try {\n this.setElementStatus(property, this.getElementById(element_id), true);\n } catch (e){\n console.error(\"Unable to apply state: \" + state_id + \", \" + property);\n }\n }.bind(data_layer));\n }\n }\n }.bind(panel));\n }.bind(this));\n\n // Emit events\n this.emit(\"layout_changed\");\n this.emit(\"data_rendered\");\n this.emit(\"state_changed\", state_changes);\n\n this.loading_data = false;\n\n }.bind(this));\n};\n\n/**\n * Register interactions along the specified axis, provided that the target panel allows interaction.\n *\n * @param {LocusZoom.Panel} panel\n * @param {('x_tick'|'y1_tick'|'y2_tick')} method The direction (axis) along which dragging is being performed.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.startDrag = function(panel, method){\n\n panel = panel || null;\n method = method || null;\n\n var axis = null;\n switch (method){\n case \"background\":\n case \"x_tick\":\n axis = \"x\";\n break;\n case \"y1_tick\":\n axis = \"y1\";\n break;\n case \"y2_tick\":\n axis = \"y2\";\n break;\n }\n\n if (!(panel instanceof LocusZoom.Panel) || !axis || !this.canInteract()){ return this.stopDrag(); }\n\n var coords = d3.mouse(this.svg.node());\n this.interaction = {\n panel_id: panel.id,\n linked_panel_ids: panel.getLinkedPanelIds(axis),\n dragging: {\n method: method,\n start_x: coords[0],\n start_y: coords[1],\n dragged_x: 0,\n dragged_y: 0,\n axis: axis\n }\n };\n\n this.svg.style(\"cursor\", \"all-scroll\");\n\n return this;\n\n};\n\n/**\n * Process drag interactions across the target panel and synchronize plot state across other panels in sync;\n * clear the event when complete\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.stopDrag = function(){\n\n if (!this.interaction.dragging){ return this; }\n\n if (typeof this.panels[this.interaction.panel_id] != \"object\"){\n this.interaction = {};\n return this;\n }\n var panel = this.panels[this.interaction.panel_id];\n\n // Helper function to find the appropriate axis layouts on child data layers\n // Once found, apply the extent as floor/ceiling and remove all other directives\n // This forces all associated axes to conform to the extent generated by a drag action\n var overrideAxisLayout = function(axis, axis_number, extent){\n panel.data_layer_ids_by_z_index.forEach(function(id){\n if (panel.data_layers[id].layout[axis+\"_axis\"].axis === axis_number){\n panel.data_layers[id].layout[axis+\"_axis\"].floor = extent[0];\n panel.data_layers[id].layout[axis+\"_axis\"].ceiling = extent[1];\n delete panel.data_layers[id].layout[axis+\"_axis\"].lower_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].upper_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].min_extent;\n delete panel.data_layers[id].layout[axis+\"_axis\"].ticks;\n }\n });\n };\n\n switch(this.interaction.dragging.method){\n case \"background\":\n case \"x_tick\":\n if (this.interaction.dragging.dragged_x !== 0){\n overrideAxisLayout(\"x\", 1, panel.x_extent);\n this.applyState({ start: panel.x_extent[0], end: panel.x_extent[1] });\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n if (this.interaction.dragging.dragged_y !== 0){\n // TODO: Hardcoded assumption of only two possible axes with single-digit #s (switch/case)\n var y_axis_number = parseInt(this.interaction.dragging.method[1]);\n overrideAxisLayout(\"y\", y_axis_number, panel[\"y\"+y_axis_number+\"_extent\"]);\n }\n break;\n }\n\n this.interaction = {};\n this.svg.style(\"cursor\", null);\n\n return this;\n\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A panel is an abstract class representing a subdivision of the LocusZoom stage\n * to display a distinct data representation as a collection of data layers.\n * @class\n * @param {Object} layout\n * @param {LocusZoom.Plot|null} parent\n*/\nLocusZoom.Panel = function(layout, parent) {\n\n if (typeof layout !== \"object\"){\n throw \"Unable to create panel, invalid layout\";\n }\n\n /** @member {LocusZoom.Plot|null} */\n this.parent = parent || null;\n /** @member {LocusZoom.Plot|null} */\n this.parent_plot = parent;\n\n // Ensure a valid ID is present. If there is no valid ID then generate one\n if (typeof layout.id !== \"string\" || !layout.id.length){\n if (!this.parent){\n layout.id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n } else {\n var id = null;\n var generateID = function(){\n id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n if (id == null || typeof this.parent.panels[id] != \"undefined\"){\n id = generateID();\n }\n }.bind(this);\n layout.id = id;\n }\n } else if (this.parent) {\n if (typeof this.parent.panels[layout.id] !== \"undefined\"){\n throw \"Cannot create panel with id [\" + layout.id + \"]; panel with that id already exists\";\n }\n }\n /** @member {String} */\n this.id = layout.id;\n\n /** @member {Boolean} */\n this.initialized = false;\n /**\n * The index of this panel in the parent plot's `layout.panels`\n * @member {number}\n * */\n this.layout_idx = null;\n /** @member {Object} */\n this.svg = {};\n\n /**\n * A JSON-serializable object used to describe the composition of the Panel\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.Panel.DefaultLayout);\n\n // Define state parameters specific to this panel\n if (this.parent){\n /** @member {Object} */\n this.state = this.parent.state;\n\n /** @member {String} */\n this.state_id = this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n } else {\n this.state = null;\n this.state_id = null;\n }\n\n /** @member {Object} */\n this.data_layers = {};\n /** @member {String[]} */\n this.data_layer_ids_by_z_index = [];\n\n /** @protected */\n this.applyDataLayerZIndexesToDataLayerLayouts = function(){\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n }.bind(this);\n\n /**\n * Track data requests in progress\n * @member {Promise[]}\n * @protected\n */\n this.data_promises = [];\n\n /** @member {d3.scale} */\n this.x_scale = null;\n /** @member {d3.scale} */\n this.y1_scale = null;\n /** @member {d3.scale} */\n this.y2_scale = null;\n\n /** @member {d3.extent} */\n this.x_extent = null;\n /** @member {d3.extent} */\n this.y1_extent = null;\n /** @member {d3.extent} */\n this.y2_extent = null;\n\n /** @member {Number[]} */\n this.x_ticks = [];\n /** @member {Number[]} */\n this.y1_ticks = [];\n /** @member {Number[]} */\n this.y2_ticks = [];\n\n /**\n * A timeout ID as returned by setTimeout\n * @protected\n * @member {number}\n */\n this.zoom_timeout = null;\n\n /** @returns {string} */\n this.getBaseId = function(){\n return this.parent.id + \".\" + this.id;\n };\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": []\n };\n /**\n * There are several events that a LocusZoom panel can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following panel-level events are currently supported:\n * - `layout_changed` - context: panel - Any aspect of the panel's layout (including dimensions or state) has changed.\n * - `data_requested` - context: panel - A request for new data from any data source used in the panel has been made.\n * - `data_rendered` - context: panel - Data from a request has been received and rendered in the panel.\n * - `element_clicked` - context: panel - A data element in any of the panel's data layers has been clicked.\n * - `element_selection` - context: panel - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `panel.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * panel itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of the event (as defined in `event_hooks`)\n * @param {function} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n // TODO: Dry plot and panel event code into a shared mixin\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Panel}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n *\n * There is a shorter overloaded form of this method: if the event does not have any data, the second\n * argument can be a boolean to control bubbling\n *\n * @param {string} event A known event name\n * @param {*} [eventData] Data or event description that will be passed to the event listener\n * @param {boolean} [bubble=false] Whether to bubble the event to the parent\n * @returns {LocusZoom.Panel}\n */\n this.emit = function(event, eventData, bubble) {\n bubble = bubble || false;\n\n // TODO: DRY this with the parent plot implementation. Ensure interfaces remain compatible.\n // TODO: Improve documentation for overloaded method signature (JSDoc may have trouble here)\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n if (typeof eventData === \"boolean\" && arguments.length === 2) {\n // Overloaded method signature: emit(event, bubble)\n bubble = eventData;\n eventData = null;\n }\n var sourceID = this.getBaseId();\n var self = this;\n var eventContext = {sourceID: sourceID, data: eventData || null};\n this.event_hooks[event].forEach(function(hookToRun) {\n // By default, any handlers fired here will see the panel as the value of `this`. If a bound function is\n // registered as a handler, the previously bound `this` will override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n if (bubble && this.parent) {\n this.parent.emit(event, eventContext);\n }\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\n this.getPageOrigin = function(){\n var plot_origin = this.parent.getPageOrigin();\n return {\n x: plot_origin.x + this.layout.origin.x,\n y: plot_origin.y + this.layout.origin.y\n };\n };\n\n // Initialize the layout\n this.initializeLayout();\n\n return this;\n\n};\n\n/**\n * Default panel layout\n * @static\n * @type {Object}\n */\nLocusZoom.Panel.DefaultLayout = {\n title: { text: \"\", style: {}, x: 10, y: 22 },\n y_index: null,\n width: 0,\n height: 0,\n origin: { x: 0, y: null },\n min_width: 1,\n min_height: 1,\n proportional_width: null,\n proportional_height: null,\n proportional_origin: { x: 0, y: null },\n margin: { top: 0, right: 0, bottom: 0, left: 0 },\n background_click: \"clear_selections\",\n dashboard: {\n components: []\n },\n cliparea: {\n height: 0,\n width: 0,\n origin: { x: 0, y: 0 }\n },\n axes: { // These are the only axes supported!!\n x: {},\n y1: {},\n y2: {}\n },\n legend: null,\n interaction: {\n drag_background_to_pan: false,\n drag_x_ticks_to_scale: false,\n drag_y1_ticks_to_scale: false,\n drag_y2_ticks_to_scale: false,\n scroll_to_zoom: false,\n x_linked: false,\n y1_linked: false,\n y2_linked: false\n },\n data_layers: []\n};\n\n/**\n * Prepare the panel for first use by performing parameter validation, creating axes, setting default dimensions,\n * and preparing / positioning data layers as appropriate.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initializeLayout = function(){\n\n // If the layout is missing BOTH width and proportional width then set the proportional width to 1.\n // This will default the panel to taking up the full width of the plot.\n if (this.layout.width === 0 && this.layout.proportional_width === null){\n this.layout.proportional_width = 1;\n }\n\n // If the layout is missing BOTH height and proportional height then set the proportional height to\n // an equal share of the plot's current height.\n if (this.layout.height === 0 && this.layout.proportional_height === null){\n var panel_count = Object.keys(this.parent.panels).length;\n if (panel_count > 0){\n this.layout.proportional_height = (1 / panel_count);\n } else {\n this.layout.proportional_height = 1;\n }\n }\n\n // Set panel dimensions, origin, and margin\n this.setDimensions();\n this.setOrigin();\n this.setMargin();\n\n // Set ranges\n // TODO: Define stub values in constructor\n this.x_range = [0, this.layout.cliparea.width];\n this.y1_range = [this.layout.cliparea.height, 0];\n this.y2_range = [this.layout.cliparea.height, 0];\n\n // Initialize panel axes\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!Object.keys(this.layout.axes[axis]).length || this.layout.axes[axis].render ===false){\n // The default layout sets the axis to an empty object, so set its render boolean here\n this.layout.axes[axis].render = false;\n } else {\n this.layout.axes[axis].render = true;\n this.layout.axes[axis].label = this.layout.axes[axis].label || null;\n this.layout.axes[axis].label_function = this.layout.axes[axis].label_function || null;\n }\n }.bind(this));\n\n // Add data layers (which define x and y extents)\n this.layout.data_layers.forEach(function(data_layer_layout){\n this.addDataLayer(data_layer_layout);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Set the dimensions for the panel. If passed with no arguments will calculate optimal size based on layout\n * directives and the available area within the plot. If passed discrete width (number) and height (number) will\n * attempt to resize the panel to them, but may be limited by minimum dimensions defined on the plot or panel.\n *\n * @public\n * @param {number} [width]\n * @param {number} [height]\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setDimensions = function(width, height){\n if (typeof width != \"undefined\" && typeof height != \"undefined\"){\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n }\n } else {\n if (this.layout.proportional_width !== null){\n this.layout.width = Math.max(this.layout.proportional_width * this.parent.layout.width, this.layout.min_width);\n }\n if (this.layout.proportional_height !== null){\n this.layout.height = Math.max(this.layout.proportional_height * this.parent.layout.height, this.layout.min_height);\n }\n }\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n if (this.svg.clipRect){\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n if (this.initialized){\n this.render();\n this.curtain.update();\n this.loader.update();\n this.dashboard.update();\n if (this.legend){ this.legend.position(); }\n }\n return this;\n};\n\n/**\n * Set panel origin on the plot, and re-render as appropriate\n *\n * @public\n * @param {number} x\n * @param {number} y\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setOrigin = function(x, y){\n if (!isNaN(x) && x >= 0){ this.layout.origin.x = Math.max(Math.round(+x), 0); }\n if (!isNaN(y) && y >= 0){ this.layout.origin.y = Math.max(Math.round(+y), 0); }\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set margins around this panel\n * @public\n * @param {number} top\n * @param {number} right\n * @param {number} bottom\n * @param {number} left\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setMargin = function(top, right, bottom, left){\n var extra;\n if (!isNaN(top) && top >= 0){ this.layout.margin.top = Math.max(Math.round(+top), 0); }\n if (!isNaN(right) && right >= 0){ this.layout.margin.right = Math.max(Math.round(+right), 0); }\n if (!isNaN(bottom) && bottom >= 0){ this.layout.margin.bottom = Math.max(Math.round(+bottom), 0); }\n if (!isNaN(left) && left >= 0){ this.layout.margin.left = Math.max(Math.round(+left), 0); }\n if (this.layout.margin.top + this.layout.margin.bottom > this.layout.height){\n extra = Math.floor(((this.layout.margin.top + this.layout.margin.bottom) - this.layout.height) / 2);\n this.layout.margin.top -= extra;\n this.layout.margin.bottom -= extra;\n }\n if (this.layout.margin.left + this.layout.margin.right > this.layout.width){\n extra = Math.floor(((this.layout.margin.left + this.layout.margin.right) - this.layout.width) / 2);\n this.layout.margin.left -= extra;\n this.layout.margin.right -= extra;\n }\n [\"top\", \"right\", \"bottom\", \"left\"].forEach(function(m){\n this.layout.margin[m] = Math.max(this.layout.margin[m], 0);\n }.bind(this));\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n this.layout.cliparea.origin.x = this.layout.margin.left;\n this.layout.cliparea.origin.y = this.layout.margin.top;\n\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set the title for the panel. If passed an object, will merge the object with the existing layout configuration, so\n * that all or only some of the title layout object's parameters can be customized. If passed null, false, or an empty\n * string, the title DOM element will be set to display: none.\n *\n * @param {string|object|null} title The title text, or an object with additional configuration\n * @param {string} title.text Text to display. Since titles are rendered as SVG text, HTML and newlines will not be rendered.\n * @param {number} title.x X-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n * @param {number} title.y Y-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n NOTE: SVG y values go from the top down, so the SVG origin of (0,0) is in the top left corner.\n * @param {object} title.style CSS styles object to be applied to the title's DOM element.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setTitle = function(title){\n if (typeof this.layout.title == \"string\"){\n var text = this.layout.title;\n this.layout.title = { text: text, x: 0, y: 0, style: {} };\n }\n if (typeof title == \"string\"){\n this.layout.title.text = title;\n } else if (typeof title == \"object\" && title !== null){\n this.layout.title = LocusZoom.Layouts.merge(title, this.layout.title);\n }\n if (this.layout.title.text.length){\n this.title.attr(\"display\", null)\n .attr(\"x\", parseFloat(this.layout.title.x))\n .attr(\"y\", parseFloat(this.layout.title.y))\n .style(this.layout.title.style)\n .text(this.layout.title.text);\n } else {\n this.title.attr(\"display\", \"none\");\n }\n return this;\n};\n\n\n/**\n * Prepare the first rendering of the panel. This includes drawing the individual data layers, but also creates shared\n * elements such as axes, title, and loader/curtain.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initialize = function(){\n\n // Append a container group element to house the main panel group element and the clip path\n // Position with initial layout parameters\n this.svg.container = this.parent.svg.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel_container\")\n .attr(\"transform\", \"translate(\" + (this.layout.origin.x || 0) + \",\" + (this.layout.origin.y || 0) + \")\");\n\n // Append clip path to the parent svg element, size with initial layout parameters\n var clipPath = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\");\n this.svg.clipRect = clipPath.append(\"rect\")\n .attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Append svg group for rendering all panel child elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n // Add curtain and loader prototypes to the panel\n /** @member {Object} */\n this.curtain = LocusZoom.generateCurtain.call(this);\n /** @member {Object} */\n this.loader = LocusZoom.generateLoader.call(this);\n\n /**\n * Create the dashboard object and hang components on it as defined by panel layout\n * @member {LocusZoom.Dashboard}\n */\n this.dashboard = new LocusZoom.Dashboard(this);\n\n // Inner border\n this.inner_border = this.svg.group.append(\"rect\")\n .attr(\"class\", \"lz-panel-background\")\n .on(\"click\", function(){\n if (this.layout.background_click === \"clear_selections\"){ this.clearSelections(); }\n }.bind(this));\n\n // Add the title\n /** @member {Element} */\n this.title = this.svg.group.append(\"text\").attr(\"class\", \"lz-panel-title\");\n if (typeof this.layout.title != \"undefined\"){ this.setTitle(); }\n\n // Initialize Axes\n this.svg.x_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".x_axis\").attr(\"class\", \"lz-x lz-axis\");\n if (this.layout.axes.x.render){\n this.svg.x_axis_label = this.svg.x_axis.append(\"text\")\n .attr(\"class\", \"lz-x lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y1_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y1_axis\").attr(\"class\", \"lz-y lz-y1 lz-axis\");\n if (this.layout.axes.y1.render){\n this.svg.y1_axis_label = this.svg.y1_axis.append(\"text\")\n .attr(\"class\", \"lz-y1 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y2_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y2_axis\").attr(\"class\", \"lz-y lz-y2 lz-axis\");\n if (this.layout.axes.y2.render){\n this.svg.y2_axis_label = this.svg.y2_axis.append(\"text\")\n .attr(\"class\", \"lz-y2 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n\n // Initialize child Data Layers\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].initialize();\n }.bind(this));\n\n /**\n * Legend object, as defined by panel layout and child data layer layouts\n * @member {LocusZoom.Legend}\n * */\n this.legend = null;\n if (this.layout.legend){\n this.legend = new LocusZoom.Legend(this);\n }\n\n // Establish panel background drag interaction mousedown event handler (on the panel background)\n if (this.layout.interaction.drag_background_to_pan){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var mousedown = function(){\n this.parent.startDrag(this, \"background\");\n }.bind(this);\n this.svg.container.select(\".lz-panel-background\")\n .on(\"mousedown\" + namespace + \".background\", mousedown)\n .on(\"touchstart\" + namespace + \".background\", mousedown);\n }\n\n return this;\n\n};\n\n/**\n * Refresh the sort order of all data layers (called by data layer moveUp and moveDown methods)\n */\nLocusZoom.Panel.prototype.resortDataLayers = function(){\n var sort = [];\n this.data_layer_ids_by_z_index.forEach(function(id){\n sort.push(this.data_layers[id].layout.z_index);\n }.bind(this));\n this.svg.group.selectAll(\"g.lz-data_layer-container\").data(sort).sort(d3.ascending);\n this.applyDataLayerZIndexesToDataLayerLayouts();\n};\n\n/**\n * Get an array of panel IDs that are axis-linked to this panel\n * @param {('x'|'y1'|'y2')} axis\n * @returns {Array}\n */\nLocusZoom.Panel.prototype.getLinkedPanelIds = function(axis){\n axis = axis || null;\n var linked_panel_ids = [];\n if ([\"x\",\"y1\",\"y2\"].indexOf(axis) === -1){ return linked_panel_ids; }\n if (!this.layout.interaction[axis + \"_linked\"]){ return linked_panel_ids; }\n this.parent.panel_ids_by_y_index.forEach(function(panel_id){\n if (panel_id !== this.id && this.parent.panels[panel_id].layout.interaction[axis + \"_linked\"]){\n linked_panel_ids.push(panel_id);\n }\n }.bind(this));\n return linked_panel_ids;\n};\n\n/**\n * Move a panel up relative to others by y-index\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveUp = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index - 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index - 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index - 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Move a panel down (y-axis) relative to others in the plot\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveDown = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index + 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index + 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index + 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Create a new data layer from a provided layout object. Should have the keys specified in `DefaultLayout`\n * Will automatically add at the top (depth/z-index) of the panel unless explicitly directed differently\n * in the layout provided.\n * @param {object} layout\n * @returns {*}\n */\nLocusZoom.Panel.prototype.addDataLayer = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\" || typeof layout.id !== \"string\" || !layout.id.length){\n throw \"Invalid data layer layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n if (typeof this.data_layers[layout.id] !== \"undefined\"){\n throw \"Cannot create data_layer with id [\" + layout.id + \"]; data layer with that id already exists in the panel\";\n }\n if (typeof layout.type !== \"string\"){\n throw \"Invalid data layer type in layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n\n // If the layout defines a y axis make sure the axis number is set and is 1 or 2 (default to 1)\n if (typeof layout.y_axis == \"object\" && (typeof layout.y_axis.axis == \"undefined\" || [1,2].indexOf(layout.y_axis.axis) === -1)){\n layout.y_axis.axis = 1;\n }\n\n // Create the Data Layer\n var data_layer = LocusZoom.DataLayers.get(layout.type, layout, this);\n\n // Store the Data Layer on the Panel\n this.data_layers[data_layer.id] = data_layer;\n\n // If a discrete z_index was set in the layout then adjust other data layer z_index values to accommodate this one\n if (data_layer.layout.z_index !== null && !isNaN(data_layer.layout.z_index)\n && this.data_layer_ids_by_z_index.length > 0){\n // Negative z_index values should count backwards from the end, so convert negatives to appropriate values here\n if (data_layer.layout.z_index < 0){\n data_layer.layout.z_index = Math.max(this.data_layer_ids_by_z_index.length + data_layer.layout.z_index, 0);\n }\n this.data_layer_ids_by_z_index.splice(data_layer.layout.z_index, 0, data_layer.id);\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n } else {\n var length = this.data_layer_ids_by_z_index.push(data_layer.id);\n this.data_layers[data_layer.id].layout.z_index = length - 1;\n }\n\n // Determine if this data layer was already in the layout.data_layers array.\n // If it wasn't, add it. Either way store the layout.data_layers array index on the data_layer.\n var layout_idx = null;\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n if (data_layer_layout.id === data_layer.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.data_layers.push(this.data_layers[data_layer.id].layout) - 1;\n }\n this.data_layers[data_layer.id].layout_idx = layout_idx;\n\n return this.data_layers[data_layer.id];\n};\n\n/**\n * Remove a data layer by id\n * @param {string} id\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.removeDataLayer = function(id){\n if (!this.data_layers[id]){\n throw (\"Unable to remove data layer, ID not found: \" + id);\n }\n\n // Destroy all tooltips for the data layer\n this.data_layers[id].destroyAllTooltips();\n\n // Remove the svg container for the data layer if it exists\n if (this.data_layers[id].svg.container){\n this.data_layers[id].svg.container.remove();\n }\n\n // Delete the data layer and its presence in the panel layout and state\n this.layout.data_layers.splice(this.data_layers[id].layout_idx, 1);\n delete this.state[this.data_layers[id].state_id];\n delete this.data_layers[id];\n\n // Remove the data_layer id from the z_index array\n this.data_layer_ids_by_z_index.splice(this.data_layer_ids_by_z_index.indexOf(id), 1);\n\n // Update layout_idx and layout.z_index values for all remaining data_layers\n this.applyDataLayerZIndexesToDataLayerLayouts();\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n this.data_layers[data_layer_layout.id].layout_idx = idx;\n }.bind(this));\n\n return this;\n};\n\n/**\n * Clear all selections on all data layers\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.clearSelections = function(){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(\"selected\", false);\n }.bind(this));\n return this;\n};\n\n/**\n * When the parent plot changes state, adjust the panel accordingly. For example, this may include fetching new data\n * from the API as the viewing region changes\n * @returns {Promise}\n */\nLocusZoom.Panel.prototype.reMap = function(){\n this.emit(\"data_requested\");\n this.data_promises = [];\n\n // Remove any previous error messages before attempting to load new data\n this.curtain.hide();\n // Trigger reMap on each Data Layer\n for (var id in this.data_layers){\n try {\n this.data_promises.push(this.data_layers[id].reMap());\n } catch (error) {\n console.warn(error);\n this.curtain.show(error);\n }\n }\n // When all finished trigger a render\n return Q.all(this.data_promises)\n .then(function(){\n this.initialized = true;\n this.render();\n this.emit(\"layout_changed\", true);\n this.emit(\"data_rendered\");\n }.bind(this))\n .catch(function(error){\n console.warn(error);\n this.curtain.show(error);\n }.bind(this));\n};\n\n/**\n * Iterate over data layers to generate panel axis extents\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.generateExtents = function(){\n\n // Reset extents\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n this[axis + \"_extent\"] = null;\n }.bind(this));\n\n // Loop through the data layers\n for (var id in this.data_layers){\n\n var data_layer = this.data_layers[id];\n\n // If defined and not decoupled, merge the x extent of the data layer with the panel's x extent\n if (data_layer.layout.x_axis && !data_layer.layout.x_axis.decoupled){\n this.x_extent = d3.extent((this.x_extent || []).concat(data_layer.getAxisExtent(\"x\")));\n }\n\n // If defined and not decoupled, merge the y extent of the data layer with the panel's appropriate y extent\n if (data_layer.layout.y_axis && !data_layer.layout.y_axis.decoupled){\n var y_axis = \"y\" + data_layer.layout.y_axis.axis;\n this[y_axis+\"_extent\"] = d3.extent((this[y_axis+\"_extent\"] || []).concat(data_layer.getAxisExtent(\"y\")));\n }\n\n }\n\n // Override x_extent from state if explicitly defined to do so\n if (this.layout.axes.x && this.layout.axes.x.extent === \"state\"){\n this.x_extent = [ this.state.start, this.state.end ];\n }\n\n return this;\n\n};\n\n/**\n * Generate an array of ticks for an axis. These ticks are generated in one of three ways (highest wins):\n * 1. An array of specific tick marks\n * 2. Query each data layer for what ticks are appropriate, and allow a panel-level tick configuration parameter\n * object to override the layer's default presentation settings\n * 3. Generate generic tick marks based on the extent of the data\n * @param {('x'|'y1'|'y2')} axis The string identifier of the axis\n * @returns {Number[]|Object[]} TODO: number format?\n * An array of numbers: interpreted as an array of axis value offsets for positioning.\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.Panel.prototype.generateTicks = function(axis){\n\n // Parse an explicit 'ticks' attribute in the axis layout\n if (this.layout.axes[axis].ticks){\n var layout = this.layout.axes[axis];\n\n var baseTickConfig = layout.ticks;\n if (Array.isArray(baseTickConfig)){\n // Array of specific ticks hard-coded into a panel will override any ticks that an individual layer might specify\n return baseTickConfig;\n }\n\n if (typeof baseTickConfig === \"object\") {\n // If the layout specifies base configuration for ticks- but without specific positions- then ask each\n // data layer to report the tick marks that it thinks it needs\n // TODO: Few layers currently need to specify custom ticks (which is ok!). But if it becomes common, consider adding mechanisms to deduplicate ticks across layers\n var self = this;\n\n // Pass any layer-specific customizations for how ticks are calculated. (styles are overridden separately)\n var config = { position: baseTickConfig.position };\n\n var combinedTicks = this.data_layer_ids_by_z_index.reduce(function(acc, data_layer_id) {\n var nextLayer = self.data_layers[data_layer_id];\n return acc.concat(nextLayer.getTicks(axis, config));\n }, []);\n\n return combinedTicks.map(function(item) {\n // The layer makes suggestions, but tick configuration params specified on the panel take precedence\n var itemConfig = {};\n itemConfig = LocusZoom.Layouts.merge(itemConfig, baseTickConfig);\n return LocusZoom.Layouts.merge(itemConfig, item);\n });\n }\n }\n\n // If no other configuration is provided, attempt to generate ticks from the extent\n if (this[axis + \"_extent\"]) {\n return LocusZoom.prettyTicks(this[axis + \"_extent\"], \"both\");\n }\n return [];\n};\n\n/**\n * Update rendering of this panel whenever an event triggers a redraw. Assumes that the panel has already been\n * prepared the first time via `initialize`\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.render = function(){\n\n // Position the panel container\n this.svg.container.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n\n // Set size on the clip rect\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Set and position the inner border, style if necessary\n this.inner_border\n .attr(\"x\", this.layout.margin.left).attr(\"y\", this.layout.margin.top)\n .attr(\"width\", this.layout.width - (this.layout.margin.left + this.layout.margin.right))\n .attr(\"height\", this.layout.height - (this.layout.margin.top + this.layout.margin.bottom));\n if (this.layout.inner_border){\n this.inner_border.style({ \"stroke-width\": 1, \"stroke\": this.layout.inner_border });\n }\n\n // Set/update panel title if necessary\n this.setTitle();\n\n // Regenerate all extents\n this.generateExtents();\n\n // Helper function to constrain any procedurally generated vectors (e.g. ranges, extents)\n // Constraints applied here keep vectors from going to infinity or beyond a definable power of ten\n var constrain = function(value, limit_exponent){\n var neg_min = Math.pow(-10, limit_exponent);\n var neg_max = Math.pow(-10, -limit_exponent);\n var pos_min = Math.pow(10, -limit_exponent);\n var pos_max = Math.pow(10, limit_exponent);\n if (value === Infinity){ value = pos_max; }\n if (value === -Infinity){ value = neg_min; }\n if (value === 0){ value = pos_min; }\n if (value > 0){ value = Math.max(Math.min(value, pos_max), pos_min); }\n if (value < 0){ value = Math.max(Math.min(value, neg_max), neg_min); }\n return value;\n };\n\n // Define default and shifted ranges for all axes\n var ranges = {};\n if (this.x_extent){\n var base_x_range = { start: 0, end: this.layout.cliparea.width };\n if (this.layout.axes.x.range){\n base_x_range.start = this.layout.axes.x.range.start || base_x_range.start;\n base_x_range.end = this.layout.axes.x.range.end || base_x_range.end;\n }\n ranges.x = [base_x_range.start, base_x_range.end];\n ranges.x_shifted = [base_x_range.start, base_x_range.end];\n }\n if (this.y1_extent){\n var base_y1_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y1.range){\n base_y1_range.start = this.layout.axes.y1.range.start || base_y1_range.start;\n base_y1_range.end = this.layout.axes.y1.range.end || base_y1_range.end;\n }\n ranges.y1 = [base_y1_range.start, base_y1_range.end];\n ranges.y1_shifted = [base_y1_range.start, base_y1_range.end];\n }\n if (this.y2_extent){\n var base_y2_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y2.range){\n base_y2_range.start = this.layout.axes.y2.range.start || base_y2_range.start;\n base_y2_range.end = this.layout.axes.y2.range.end || base_y2_range.end;\n }\n ranges.y2 = [base_y2_range.start, base_y2_range.end];\n ranges.y2_shifted = [base_y2_range.start, base_y2_range.end];\n }\n\n // Shift ranges based on any drag or zoom interactions currently underway\n if (this.parent.interaction.panel_id && (this.parent.interaction.panel_id === this.id || this.parent.interaction.linked_panel_ids.indexOf(this.id) !== -1)){\n var anchor, scalar = null;\n if (this.parent.interaction.zooming && typeof this.x_scale == \"function\"){\n var current_extent_size = Math.abs(this.x_extent[1] - this.x_extent[0]);\n var current_scaled_extent_size = Math.round(this.x_scale.invert(ranges.x_shifted[1])) - Math.round(this.x_scale.invert(ranges.x_shifted[0]));\n var zoom_factor = this.parent.interaction.zooming.scale;\n var potential_extent_size = Math.floor(current_scaled_extent_size * (1 / zoom_factor));\n if (zoom_factor < 1 && !isNaN(this.parent.layout.max_region_scale)){\n zoom_factor = 1 /(Math.min(potential_extent_size, this.parent.layout.max_region_scale) / current_scaled_extent_size);\n } else if (zoom_factor > 1 && !isNaN(this.parent.layout.min_region_scale)){\n zoom_factor = 1 / (Math.max(potential_extent_size, this.parent.layout.min_region_scale) / current_scaled_extent_size);\n }\n var new_extent_size = Math.floor(current_extent_size * zoom_factor);\n anchor = this.parent.interaction.zooming.center - this.layout.margin.left - this.layout.origin.x;\n var offset_ratio = anchor / this.layout.cliparea.width;\n var new_x_extent_start = Math.max(Math.floor(this.x_scale.invert(ranges.x_shifted[0]) - ((new_extent_size - current_scaled_extent_size) * offset_ratio)), 1);\n ranges.x_shifted = [ this.x_scale(new_x_extent_start), this.x_scale(new_x_extent_start + new_extent_size) ];\n } else if (this.parent.interaction.dragging){\n switch (this.parent.interaction.dragging.method){\n case \"background\":\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n break;\n case \"x_tick\":\n if (d3.event && d3.event.shiftKey){\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n } else {\n anchor = this.parent.interaction.dragging.start_x - this.layout.margin.left - this.layout.origin.x;\n scalar = constrain(anchor / (anchor + this.parent.interaction.dragging.dragged_x), 3);\n ranges.x_shifted[0] = 0;\n ranges.x_shifted[1] = Math.max(this.layout.cliparea.width * (1 / scalar), 1);\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n var y_shifted = \"y\" + this.parent.interaction.dragging.method[1] + \"_shifted\";\n if (d3.event && d3.event.shiftKey){\n ranges[y_shifted][0] = this.layout.cliparea.height + this.parent.interaction.dragging.dragged_y;\n ranges[y_shifted][1] = +this.parent.interaction.dragging.dragged_y;\n } else {\n anchor = this.layout.cliparea.height - (this.parent.interaction.dragging.start_y - this.layout.margin.top - this.layout.origin.y);\n scalar = constrain(anchor / (anchor - this.parent.interaction.dragging.dragged_y), 3);\n ranges[y_shifted][0] = this.layout.cliparea.height;\n ranges[y_shifted][1] = this.layout.cliparea.height - (this.layout.cliparea.height * (1 / scalar));\n }\n }\n }\n }\n\n // Generate scales and ticks for all axes, then render them\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!this[axis + \"_extent\"]){ return; }\n\n // Base Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"])\n .range(ranges[axis + \"_shifted\"]);\n\n // Shift the extent\n this[axis + \"_extent\"] = [\n this[axis + \"_scale\"].invert(ranges[axis][0]),\n this[axis + \"_scale\"].invert(ranges[axis][1])\n ];\n\n // Finalize Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"]).range(ranges[axis]);\n\n // Render axis (and generate ticks as needed)\n this.renderAxis(axis);\n }.bind(this));\n\n // Establish mousewheel zoom event handers on the panel (namespacing not passed through by d3, so not used here)\n if (this.layout.interaction.scroll_to_zoom){\n var zoom_handler = function(){\n // Look for a shift key press while scrolling to execute.\n // If not present, gracefully raise a notification and allow conventional scrolling\n if (!d3.event.shiftKey){\n if (this.parent.canInteract(this.id)){\n this.loader.show(\"Press [SHIFT] while scrolling to zoom\").hide(1000);\n }\n return;\n }\n d3.event.preventDefault();\n if (!this.parent.canInteract(this.id)){ return; }\n var coords = d3.mouse(this.svg.container.node());\n var delta = Math.max(-1, Math.min(1, (d3.event.wheelDelta || -d3.event.detail || -d3.event.deltaY)));\n if (delta === 0){ return; }\n this.parent.interaction = {\n panel_id: this.id,\n linked_panel_ids: this.getLinkedPanelIds(\"x\"),\n zooming: {\n scale: (delta < 1) ? 0.9 : 1.1,\n center: coords[0]\n }\n };\n this.render();\n this.parent.interaction.linked_panel_ids.forEach(function(panel_id){\n this.parent.panels[panel_id].render();\n }.bind(this));\n if (this.zoom_timeout !== null){ clearTimeout(this.zoom_timeout); }\n this.zoom_timeout = setTimeout(function(){\n this.parent.interaction = {};\n this.parent.applyState({ start: this.x_extent[0], end: this.x_extent[1] });\n }.bind(this), 500);\n }.bind(this);\n this.zoom_listener = d3.behavior.zoom();\n this.svg.container.call(this.zoom_listener)\n .on(\"wheel.zoom\", zoom_handler)\n .on(\"mousewheel.zoom\", zoom_handler)\n .on(\"DOMMouseScroll.zoom\", zoom_handler);\n }\n\n // Render data layers in order by z-index\n this.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n this.data_layers[data_layer_id].draw().render();\n }.bind(this));\n\n return this;\n};\n\n\n/**\n * Render ticks for a particular axis\n * @param {('x'|'y1'|'y2')} axis The identifier of the axes\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.renderAxis = function(axis){\n\n if ([\"x\", \"y1\", \"y2\"].indexOf(axis) === -1){\n throw(\"Unable to render axis; invalid axis identifier: \" + axis);\n }\n\n var canRender = this.layout.axes[axis].render\n && typeof this[axis + \"_scale\"] == \"function\"\n && !isNaN(this[axis + \"_scale\"](0));\n\n // If the axis has already been rendered then check if we can/can't render it\n // Make sure the axis element is shown/hidden to suit\n if (this[axis+\"_axis\"]){\n this.svg.container.select(\"g.lz-axis.lz-\"+axis).style(\"display\", canRender ? null : \"none\");\n }\n\n if (!canRender){ return this; }\n\n // Axis-specific values to plug in where needed\n var axis_params = {\n x: {\n position: \"translate(\" + this.layout.margin.left + \",\" + (this.layout.height - this.layout.margin.bottom) + \")\",\n orientation: \"bottom\",\n label_x: this.layout.cliparea.width / 2,\n label_y: (this.layout.axes[axis].label_offset || 0),\n label_rotate: null\n },\n y1: {\n position: \"translate(\" + this.layout.margin.left + \",\" + this.layout.margin.top + \")\",\n orientation: \"left\",\n label_x: -1 * (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n },\n y2: {\n position: \"translate(\" + (this.layout.width - this.layout.margin.right) + \",\" + this.layout.margin.top + \")\",\n orientation: \"right\",\n label_x: (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n }\n };\n\n // Generate Ticks\n this[axis + \"_ticks\"] = this.generateTicks(axis);\n\n // Determine if the ticks are all numbers (d3-automated tick rendering) or not (manual tick rendering)\n var ticksAreAllNumbers = (function(ticks){\n for (var i = 0; i < ticks.length; i++){\n if (isNaN(ticks[i])){\n return false;\n }\n }\n return true;\n })(this[axis+\"_ticks\"]);\n\n // Initialize the axis; set scale and orientation\n this[axis+\"_axis\"] = d3.svg.axis().scale(this[axis+\"_scale\"]).orient(axis_params[axis].orientation).tickPadding(3);\n\n // Set tick values and format\n if (ticksAreAllNumbers){\n this[axis+\"_axis\"].tickValues(this[axis+\"_ticks\"]);\n if (this.layout.axes[axis].tick_format === \"region\"){\n this[axis+\"_axis\"].tickFormat(function(d) { return LocusZoom.positionIntToString(d, 6); });\n }\n } else {\n var ticks = this[axis+\"_ticks\"].map(function(t){\n return(t[axis.substr(0,1)]);\n });\n this[axis+\"_axis\"].tickValues(ticks)\n .tickFormat(function(t, i) { return this[axis+\"_ticks\"][i].text; }.bind(this));\n }\n\n // Position the axis in the SVG and apply the axis construct\n this.svg[axis+\"_axis\"]\n .attr(\"transform\", axis_params[axis].position)\n .call(this[axis+\"_axis\"]);\n\n // If necessary manually apply styles and transforms to ticks as specified by the layout\n if (!ticksAreAllNumbers){\n var tick_selector = d3.selectAll(\"g#\" + this.getBaseId().replace(\".\",\"\\\\.\") + \"\\\\.\" + axis + \"_axis g.tick\");\n var panel = this;\n tick_selector.each(function(d, i){\n var selector = d3.select(this).select(\"text\");\n if (panel[axis+\"_ticks\"][i].style){\n selector.style(panel[axis+\"_ticks\"][i].style);\n }\n if (panel[axis+\"_ticks\"][i].transform){\n selector.attr(\"transform\", panel[axis+\"_ticks\"][i].transform);\n }\n });\n }\n\n // Render the axis label if necessary\n var label = this.layout.axes[axis].label || null;\n if (label !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"x\", axis_params[axis].label_x).attr(\"y\", axis_params[axis].label_y)\n .text(LocusZoom.parseFields(this.state, label));\n if (axis_params[axis].label_rotate !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"transform\", \"rotate(\" + axis_params[axis].label_rotate + \" \" + axis_params[axis].label_x + \",\" + axis_params[axis].label_y + \")\");\n }\n }\n\n // Attach interactive handlers to ticks as needed\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (this.layout.interaction[\"drag_\" + axis + \"_ticks_to_scale\"]){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var tick_mouseover = function(){\n if (typeof d3.select(this).node().focus == \"function\"){ d3.select(this).node().focus(); }\n var cursor = (axis === \"x\") ? \"ew-resize\" : \"ns-resize\";\n if (d3.event && d3.event.shiftKey){ cursor = \"move\"; }\n d3.select(this)\n .style({\"font-weight\": \"bold\", \"cursor\": cursor})\n .on(\"keydown\" + namespace, tick_mouseover)\n .on(\"keyup\" + namespace, tick_mouseover);\n };\n this.svg.container.selectAll(\".lz-axis.lz-\" + axis + \" .tick text\")\n .attr(\"tabindex\", 0) // necessary to make the tick focusable so keypress events can be captured\n .on(\"mouseover\" + namespace, tick_mouseover)\n .on(\"mouseout\" + namespace, function(){\n d3.select(this).style({\"font-weight\": \"normal\"});\n d3.select(this).on(\"keydown\" + namespace, null).on(\"keyup\" + namespace, null);\n })\n .on(\"mousedown\" + namespace, function(){\n this.parent.startDrag(this, axis + \"_tick\");\n }.bind(this));\n }\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Force the height of this panel to the largest absolute height of the data in\n * all child data layers (if not null for any child data layers)\n * @param {number} [target_height] A target height, which will be used in situations when the expected height can be\n * pre-calculated (eg when the layers are transitioning)\n */\nLocusZoom.Panel.prototype.scaleHeightToData = function(target_height){\n target_height = +target_height || null;\n if (target_height === null){\n this.data_layer_ids_by_z_index.forEach(function(id){\n var dh = this.data_layers[id].getAbsoluteDataHeight();\n if (+dh){\n if (target_height === null){ target_height = +dh; }\n else { target_height = Math.max(target_height, +dh); }\n }\n }.bind(this));\n }\n if (+target_height){\n target_height += +this.layout.margin.top + +this.layout.margin.bottom;\n this.setDimensions(this.layout.width, target_height);\n this.parent.setDimensions();\n this.parent.panel_ids_by_y_index.forEach(function(id){\n this.parent.panels[id].layout.proportional_height = null;\n }.bind(this));\n this.parent.positionPanels();\n }\n};\n\n/**\n * Methods to set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n */\nLocusZoom.Panel.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setElementStatusByFilters(status, toggle, filters, exclusive);\n }.bind(this));\n};\n/**\n * Set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n */\nLocusZoom.Panel.prototype.setAllElementStatus = function(status, toggle){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(status, toggle);\n }.bind(this));\n};\n// TODO: Capture documentation for dynamically generated methods\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.Panel.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.Panel.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.Panel.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.Panel.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n\n/**\n * Add a \"basic\" loader to a panel\n * This method is just a shortcut for adding the most commonly used type of loading indicator, which appears when\n * data is requested, animates (e.g. shows an infinitely cycling progress bar as opposed to one that loads from\n * 0-100% based on actual load progress), and disappears when new data is loaded and rendered.\n *\n *\n * @param {Boolean} show_immediately\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.addBasicLoader = function(show_immediately){\n if (typeof show_immediately != \"undefined\"){ show_immediately = true; }\n if (show_immediately){\n this.loader.show(\"Loading...\").animate();\n }\n this.on(\"data_requested\", function(){\n this.loader.show(\"Loading...\").animate();\n }.bind(this));\n this.on(\"data_rendered\", function(){\n this.loader.hide();\n }.bind(this));\n return this;\n};\n"]} \ No newline at end of file +{"version":3,"sources":["LocusZoom.js","Layouts.js","DataLayer.js","annotation_track.js","forest.js","genes.js","genome_legend.js","intervals.js","line.js","scatter.js","Singletons.js","Dashboard.js","Legend.js","Data.js","Plot.js","Panel.js"],"names":["LocusZoom","version","populate","selector","datasource","layout","d3","select","html","plot","call","node","id","iterator","empty","attr","Plot","container","dataset","region","parsed_state","parsePositionQuery","Object","keys","forEach","key","state","svg","append","style","setDimensions","positionPanels","initialize","length","refresh","populateAll","plots","selectAll","each","d","i","positionIntToString","pos","exp","suffix","exp_symbols","isNaN","log","Math","LN10","min","max","places_exp","floor","toFixed","min_exp","places","ret","pow","positionStringToInt","p","val","toUpperCase","replace","suffixre","exec","mult","Number","x","chrposoff","chrpos","match","center","offset","chr","start","end","position","prettyTicks","range","clip_range","target_tick_count","parseInt","min_n","shrink_sml","high_u_bias","u5_bias","abs","c","base","base_toFixed","round","unit","ticks","parseFloat","push","indexOf","slice","pop","createCORSPromise","method","url","body","headers","timeout","response","Q","defer","xhr","XMLHttpRequest","open","XDomainRequest","onreadystatechange","readyState","status","resolve","reject","setTimeout","header","setRequestHeader","send","promise","validateState","new_state","validated_region","attempted_midpoint","attempted_scale","temp","min_region_scale","max_region_scale","parseFields","data","tokens","regex","m","text","index","condition","variable","close","console","error","JSON","stringify","astify","token","shift","then","ast","cache","hasOwnProperty","Data","Field","render_node","value","map","join","getToolTipData","parentNode","classed","getToolTipDataLayer","getDataLayer","getToolTipPanel","data_layer","parent","getToolTipPlot","panel","generateCurtain","curtain","showing","content_selector","hide_delay","show","content","css","parent_plot","insert","on","hide","bind","update","clearTimeout","page_origin","getPageOrigin","top","y","left","width","height","delay","remove","generateLoader","loader","progress_selector","cancel_selector","percent","padding","loader_boundrect","getBoundingClientRect","animate","setPercentCompleted","subclass","extra","Sub","constructor","apply","arguments","prototype","create","k","ext","Layouts","obj","layouts","get","type","name","modifications","merge","unnamespaced","parse","default_namespace","namespace","default","toString","applyNamespaces","element","re","resolved_namespace","r","merge_namespace","namespaced_element","namespaced_property","property","set","add","list","custom_layout","default_layout","custom_type","default_type","Array","isArray","closable","or","and","covariates_model_association","orientation","fields","z_index","x_axis","field","y_axis","axis","ceiling","point_shape","scale_function","parameters","field_value","else","point_size","color","breaks","values","legend","shape","size","label","class","id_field","upper_buffer","min_extent","behaviors","onmouseover","action","onmouseout","onclick","exclusive","onshiftclick","tooltip","tooltip_positioning","category_field","lower_buffer","categories","null_value","fill_opacity","spacing","lines","filters","operator","start_field","end_field","track_split_field","split_tracks","always_hide_legend","components","group_position","title","subtitle","covariates_model_plot_dashboard","button_html","button_title","region_nav_plot_dashboard","step","min_width","min_height","proportional_width","margin","right","bottom","inner_border","dashboard","l","axes","label_offset","tick_format","extent","y1","y2","origin","hidden","interaction","drag_background_to_pan","drag_x_ticks_to_scale","drag_y1_ticks_to_scale","drag_y2_ticks_to_scale","scroll_to_zoom","x_linked","data_layers","transform","data_layer_id","pad_from_bottom","responsive_resize","panels","proportional_height","StandardLayout","mouse_guide","DataLayer","initialized","layout_idx","Panel","DefaultLayout","_base_layout","state_id","setDefaultState","tooltips","global_statuses","addField","fieldName","transformations","fieldString","Statuses","adjectives","verbs","menu_antiverbs","getBaseId","getAbsoluteDataHeight","dataBCR","group","canTransition","transition","panel_boundaries","dragging","panel_id","getElementId","element_id","getElementStatusNodeId","getElementById","applyDataMethods","toHTML","deselect","unselectElement","applyCustomDataMethods","clipRect","moveUp","data_layer_ids_by_z_index","resortDataLayers","moveDown","resolveScalableParameter","idx","f","ScaleFunctions","getAxisExtent","dimension","axis_name","axis_layout","data_extent","original_extent_span","range_min","range_max","getTicks","config","createTooltip","positionTooltip","arrow","updateTooltip","destroyTooltip","destroyAllTooltips","event","pageX","pageY","positionAllTooltips","showOrHideTooltip","resolveStatus","statuses","directive","reduce","previousValue","currentValue","sub_status","sub_operator","show_directive","hide_directive","antistatus","show_resolved","hide_resolved","filter","return_type","test","operators","a","b","matches","filterIndexes","filterElements","verb","adjective","antiverb","setElementStatus","setElementStatusByFilters","setAllElementStatus","toggle","get_element_id_error","element_status_node_id","element_status_idx","splice","emit","active","status_ids","applyBehaviors","selection","event_match","executeBehaviors","requiredKeyStates","ctrl","ctrlKey","shiftKey","behavior","current_status_boolean","href","target","window","location","panel_origin","exportData","format","default_format","toLowerCase","e","jsonified","delimiter","record","draw","cliparea","reMap","lzd","getData","new_data","DataLayers","datalayers","datalayer","extend","parent_name","overrides","child","render","self","trackData","enter","exit","arrow_type","arrow_top","arrow_left","arrow_width","stroke_width","tooltip_box","data_layer_height","data_layer_width","x_center","x_scale","y_center","offset_right","offset_left","confidence_intervals","show_no_significance_line","border_radius","y_scale","sqrt","PI","ci_selection","ci_transform","ci_width","ci_height","duration","ease","points_selection","initial_y","fill","symbol","element_data","stroke","label_font_size","label_exon_spacing","exon_height","bounding_box_padding","track_vertical_spacing","getTrackHeight","transcript_idx","tracks","gene_track_index","assignTracks","getLabelWidth","gene_name","font_size","temp_text","label_width","getBBox","g","gene_id","split","gene_version","transcript_id","transcripts","display_range","text_anchor","centered_margin","display_domain","invert","track","potential_track","collision_on_potential_track","placed_gene","min_start","max_end","t","exons","gene","bboxes","boundary_fill","boundary_stroke","boundaries","labels","strand","exon_fill","exon_stroke","exon_id","clickareas","gene_bbox_id","gene_bbox","gene_center_x","chromosome_fill_colors","light","dark","chromosome_label_colors","genome_start","genome_end","chromosomes","variant_parts","variant","track_split_order","track_split_legend_to_y_axis","track_height","previous_tracks","interval_track_index","track_split_field_index","reverse","placed_interval","psuedoElement","sharedstatusnode_style","display","interval","statusnode_style","statusnodes","rects","interval_name","updateSplitTrackAxis","interval_bbox","interval_center_x","legend_axis","track_spacing","target_height","scaleHeightToData","toggleSplitTracks","interpolate","hitarea_width","mouse_event","line","tooltip_timeout","getMouseDisplayAndData","mouse","slope","x_field","y_field","bisect","bisector","datum","startDatum","endDatum","interpolateNumber","x_precision","toPrecision","y_precision","dd","min_arrow_left","max_arrow_left","path","hitarea","hitarea_line","path_class","global_status","decoupled","x_extent","y_extent","x_range","y_range","flip_labels","handle_lines","Boolean","min_x","max_x","flip","dn","dnl","dnx","text_swing","dnlx2","line_swing","label_texts","da","dax","abound","dal","label_lines","db","bbound","collision","separate_labels","seperate_iterations","alpha","again","sign","adjust","new_a_y","new_b_y","min_y","max_y","delta","label_elements","label_line","filtered_data","label_groups","makeLDReference","ref","applyState","ldrefvar","_prepareData","xField","sourceData","sort","ak","bk","av","bv","_generateCategoryBounds","uniqueCategories","item","category","bounds","categoryNames","_setDynamicColorScheme","colorParams","baseParams","parameters_categories_hash","every","colors","color_scale","scale","category10","category20","concat","categoryBounds","_categories","knownCategories","knownColors","xPos","diff","KnownDataSources","sources","findSourceByName","SOURCE_NAME","source","warn","source_name","newObj","params","Function","getAll","setAll","clear","TransformationFunctions","getTrans","fun","parseTrans","parseTransString","funs","result","substring","fn","ceil","toExponential","str","encodeURIComponent","s","functions","input","threshold","prev","curr","nullval","upper_idx","brk","normalized_input","isFinite","Dashboard","hide_timeout","persist","component","Components","shouldPersist","visibility","destroy","force","Component","parent_panel","parent_svg","button","menu","Button","parent_dashboard","tag","setTag","setHtml","setText","setHTML","setTitle","setColor","setStyle","getClass","permanent","setPermanent","bool","setStatus","highlight","disable","setOnMouseover","setOnMouseout","setOnclick","preUpdate","postUpdate","outer_selector","inner_selector","scroll_position","scrollTop","scrollbar_padding","menu_height_padding","page_scroll_top","document","documentElement","container_offset","getContainerOffset","dashboard_client_rect","button_client_rect","menu_client_rect","total_content_height","scrollHeight","base_max_width","container_max_width","content_max_width","base_max_height","max_height","setPopulate","menu_populate_function","div_selector","title_selector","display_width","display_height","generateBase64SVG","base64_string","css_string","stylesheet","styleSheets","fcall","outerHTML","dy","initial_html","style_def","insert_at","btoa","p1","String","fromCharCode","suppress_confirm","confirm","removePanel","is_at_top","y_index","is_at_bottom","panel_ids_by_y_index","can_zoom","current_region_scale","zoom_factor","new_region_scale","menu_html","model","covariates","CovariatesModel","element_reference","updateComponent","removeByIdx","removeAll","table","covariate","row","cov","scale_timeout","status_adj","status_idx","status_verb","at_top","at_bottom","td","removeDataLayer","allowed_fields","fields_whitelist","dataLayer","layer_name","dataLayerLayout","defaultConfig","configSlot","_selected_item","uniqueID","random","menuLayout","renderRow","display_name","display_options","row_id","field_name","defaultName","default_config_display_name","options","Legend","background_rect","elements","elements_group","label_size","line_height","label_x","label_y","path_y","symbolTypes","radius","bcr","right_x","pad_from_right","DataSources","addSource","ns","dsobj","source_id","getSource","removeSource","fromJSON","ds","toJSON","parts","full_name","applyTransformations","Requester","split_requests","requests","raw","trans","outnames","request_handles","when","discrete","Source","enableCache","dependentSource","parseInit","init","getCacheKey","chain","getURL","fetchRequest","getRequest","req","cacheKey","_cachedKey","_cachedResponse","preGetData","pre","resp","parseResponse","normalizeResponse","N","sameLength","records","j","prepareData","annotateData","extractFields","fieldFound","output_record","v","combineChainBody","json","standardized","one_source_body","new_body","parseArraysToObjects","standard","parseObjectsToObjects","parseData","constructorFun","uniqueName","getPrototypeOf","AssociationSource","unshift","analysis","LDSource","findMergeFields","exactMatch","arr","regexes","dataFields","position_field","pvalue","pvalue_field","_names_","names","nameMatch","findRequestedFields","isrefvarin","isrefvarout","ldin","ldout","findExtremeValue","pval","extremeVal","extremeIdx","refSource","ldrefsource","reqFields","refVar","columns","leftJoin","lfield","rfield","position2","tagRefVariant","refvar","idfield","outname","GeneSource","GeneConstraintSource","geneids","substr","constraint_fields","RecombinationRateSource","recombsource","IntervalSource","bedtracksource","StaticSource","_data","PheWASSource","build","ConnectorSource","_source_name_mapping","specified_ids","REQUIRED_SOURCES","chain_source_id","applyPanelYIndexesToPanelLayouts","pid","remap_promises","window_onresize","event_hooks","hook","off","theseHooks","undefined","hookMatch","eventData","sourceID","hookToRun","eventContext","bounding_client_rect","x_offset","scrollLeft","y_offset","offsetParent","offsetTop","offsetLeft","canInteract","loading_data","zooming","initializeLayout","aspect_ratio","sumProportional","total","rescaleSVG","clientRect","panel_layout","addPanel","panel_width","panel_height","setOrigin","proportional_origin","clearPanelData","panelId","mode","panelsList","dlid","layer","x_linked_margins","total_proportional_height","proportional_adjustment","calculated_plot_height","mouse_guide_svg","mouse_guide_vertical_svg","mouse_guide_horizontal_svg","vertical","horizontal","selectors","corner_selector","panel_idx","panel_resize_drag","drag","this_panel","original_panel_height","panel_height_change","new_calculated_plot_height","loop_panel_id","loop_panel_idx","loop_panel","corner_drag","dx","plot_page_origin","panel_page_origin","corner_padding","corner_size","mouseout_mouse_guide","mousemove_mouse_guide","coords","mouseup","stopDrag","mousemove","preventDefault","dragged_x","start_x","dragged_y","start_y","linked_panel_ids","client_rect","subscribeToData","success_callback","opts","error_callback","onerror","err","listener","catch","state_changes","all","drop","startDrag","getLinkedPanelIds","overrideAxisLayout","axis_number","y_axis_number","generateID","applyDataLayerZIndexesToDataLayerLayouts","data_promises","y1_scale","y2_scale","y1_extent","y2_extent","x_ticks","y1_ticks","y2_ticks","zoom_timeout","bubble","plot_origin","background_click","y1_linked","y2_linked","panel_count","setMargin","y1_range","y2_range","label_function","data_layer_layout","addDataLayer","clipPath","clearSelections","x_axis_label","y1_axis","y1_axis_label","y2_axis","y2_axis_label","mousedown","ascending","generateExtents","generateTicks","baseTickConfig","combinedTicks","acc","nextLayer","itemConfig","constrain","limit_exponent","neg_min","neg_max","pos_min","pos_max","Infinity","ranges","base_x_range","x_shifted","base_y1_range","y1_shifted","base_y2_range","y2_shifted","anchor","scalar","current_extent_size","current_scaled_extent_size","potential_extent_size","new_extent_size","offset_ratio","new_x_extent_start","y_shifted","linear","domain","renderAxis","zoom_handler","wheelDelta","detail","deltaY","zoom_listener","zoom","canRender","axis_params","label_rotate","ticksAreAllNumbers","orient","tickPadding","tickValues","tickFormat","tick_selector","tick_mouseover","focus","cursor","dh","addBasicLoader","show_immediately"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAGA,IAAAA,SAAA,GAAA,EACAC,OAAA,EAAA,OADA,EAAA,C;QAaA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAAD,SAAA,CAAAE,QAAA,GAAA,UAAAC,QAAA,EAAAC,UAAA,EAAAC,MAAA,EAAA;AAAA,YACA,IAAA,OAAAF,QAAA,IAAA,WAAA,EAAA;AAAA,gBACA,MAAA,yCAAA,CADA;AAAA,aADA;AAAA,YAKA;AAAA,YAAAG,EAAA,CAAAC,MAAA,CAAAJ,QAAA,EAAAK,IAAA,CAAA,EAAA,EALA;AAAA,YAMA,IAAAC,IAAA,CANA;AAAA,YAOAH,EAAA,CAAAC,MAAA,CAAAJ,QAAA,EAAAO,IAAA,CAAA,YAAA;AAAA,gBAEA;A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.app.js","sourcesContent":["/**\n * @namespace\n */\nvar LocusZoom = {\n version: \"0.8.0\"\n};\n\n/**\n * Populate a single element with a LocusZoom plot.\n * selector can be a string for a DOM Query or a d3 selector.\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot} The newly created plot instance\n */\nLocusZoom.populate = function(selector, datasource, layout) {\n if (typeof selector == \"undefined\"){\n throw (\"LocusZoom.populate selector not defined\");\n }\n // Empty the selector of any existing content\n d3.select(selector).html(\"\");\n var plot;\n d3.select(selector).call(function(){\n // Require each containing element have an ID. If one isn't present, create one.\n if (typeof this.node().id == \"undefined\"){\n var iterator = 0;\n while (!d3.select(\"#lz-\" + iterator).empty()){ iterator++; }\n this.attr(\"id\", \"#lz-\" + iterator);\n }\n // Create the plot\n plot = new LocusZoom.Plot(this.node().id, datasource, layout);\n plot.container = this.node();\n // Detect data-region and fill in state values if present\n if (typeof this.node().dataset !== \"undefined\" && typeof this.node().dataset.region !== \"undefined\"){\n var parsed_state = LocusZoom.parsePositionQuery(this.node().dataset.region);\n Object.keys(parsed_state).forEach(function(key){\n plot.state[key] = parsed_state[key];\n });\n }\n // Add an SVG to the div and set its dimensions\n plot.svg = d3.select(\"div#\" + plot.id)\n .append(\"svg\")\n .attr(\"version\", \"1.1\")\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .attr(\"id\", plot.id + \"_svg\").attr(\"class\", \"lz-locuszoom\")\n .style(plot.layout.style);\n plot.setDimensions();\n plot.positionPanels();\n // Initialize the plot\n plot.initialize();\n // If the plot has defined data sources then trigger its first mapping based on state values\n if (typeof datasource == \"object\" && Object.keys(datasource).length){\n plot.refresh();\n }\n });\n return plot;\n};\n\n/**\n * Populate arbitrarily many elements each with a LocusZoom plot\n * using a common datasource and layout\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot[]}\n */\nLocusZoom.populateAll = function(selector, datasource, layout) {\n var plots = [];\n d3.selectAll(selector).each(function(d,i) {\n plots[i] = LocusZoom.populate(this, datasource, layout);\n });\n return plots;\n};\n\n/**\n * Convert an integer chromosome position to an SI string representation (e.g. 23423456 => \"23.42\" (Mb))\n * @param {Number} pos Position\n * @param {String} [exp] Exponent to use for the returned string, eg 6=> MB. If not specified, will attempt to guess\n * the most appropriate SI prefix based on the number provided.\n * @param {Boolean} [suffix=false] Whether or not to append a suffix (e.g. \"Mb\") to the end of the returned string\n * @returns {string}\n */\nLocusZoom.positionIntToString = function(pos, exp, suffix){\n var exp_symbols = { 0: \"\", 3: \"K\", 6: \"M\", 9: \"G\" };\n suffix = suffix || false;\n if (isNaN(exp) || exp === null){\n var log = Math.log(pos) / Math.LN10;\n exp = Math.min(Math.max(log - (log % 3), 0), 9);\n }\n var places_exp = exp - Math.floor((Math.log(pos) / Math.LN10).toFixed(exp + 3));\n var min_exp = Math.min(Math.max(exp, 0), 2);\n var places = Math.min(Math.max(places_exp, min_exp), 12);\n var ret = \"\" + (pos / Math.pow(10, exp)).toFixed(places);\n if (suffix && typeof exp_symbols[exp] !== \"undefined\"){\n ret += \" \" + exp_symbols[exp] + \"b\";\n }\n return ret;\n};\n\n/**\n * Convert an SI string chromosome position to an integer representation (e.g. \"5.8 Mb\" => 58000000)\n * @param {String} p The chromosome position\n * @returns {Number}\n */\nLocusZoom.positionStringToInt = function(p) {\n var val = p.toUpperCase();\n val = val.replace(/,/g, \"\");\n var suffixre = /([KMG])[B]*$/;\n var suffix = suffixre.exec(val);\n var mult = 1;\n if (suffix) {\n if (suffix[1]===\"M\") {\n mult = 1e6;\n } else if (suffix[1]===\"G\") {\n mult = 1e9;\n } else {\n mult = 1e3; //K\n }\n val = val.replace(suffixre,\"\");\n }\n val = Number(val) * mult;\n return val;\n};\n\n/**\n * Parse region queries into their constituent parts\n * TODO: handle genes (or send off to API)\n * @param {String} x A chromosome position query. May be any of the forms `chr:start-end`, `chr:center+offset`,\n * or `chr:pos`\n * @returns {{chr:*, start: *, end:*} | {chr:*, position:*}}\n */\nLocusZoom.parsePositionQuery = function(x) {\n var chrposoff = /^(\\w+):([\\d,.]+[kmgbKMGB]*)([-+])([\\d,.]+[kmgbKMGB]*)$/;\n var chrpos = /^(\\w+):([\\d,.]+[kmgbKMGB]*)$/;\n var match = chrposoff.exec(x);\n if (match) {\n if (match[3] === \"+\") {\n var center = LocusZoom.positionStringToInt(match[2]);\n var offset = LocusZoom.positionStringToInt(match[4]);\n return {\n chr:match[1],\n start: center - offset,\n end: center + offset\n };\n } else {\n return {\n chr: match[1],\n start: LocusZoom.positionStringToInt(match[2]),\n end: LocusZoom.positionStringToInt(match[4])\n };\n }\n }\n match = chrpos.exec(x);\n if (match) {\n return {\n chr:match[1],\n position: LocusZoom.positionStringToInt(match[2])\n };\n }\n return null;\n};\n\n/**\n * Generate a \"pretty\" set of ticks (multiples of 1, 2, or 5 on the same order of magnitude for the range)\n * Based on R's \"pretty\" function: https://github.com/wch/r-source/blob/b156e3a711967f58131e23c1b1dc1ea90e2f0c43/src/appl/pretty.c\n * @param {Number[]} range A two-item array specifying [low, high] values for the axis range\n * @param {('low'|'high'|'both'|'neither')} [clip_range='neither'] What to do if first and last generated ticks extend\n * beyond the range. Set this to \"low\", \"high\", \"both\", or \"neither\" to clip the first (low) or last (high) tick to\n * be inside the range or allow them to extend beyond.\n * e.g. \"low\" will clip the first (low) tick if it extends beyond the low end of the range but allow the\n * last (high) tick to extend beyond the range. \"both\" clips both ends, \"neither\" allows both to extend beyond.\n * @param {Number} [target_tick_count=5] The approximate number of ticks you would like to be returned; may not be exact\n * @returns {Number[]}\n */\nLocusZoom.prettyTicks = function(range, clip_range, target_tick_count){\n if (typeof target_tick_count == \"undefined\" || isNaN(parseInt(target_tick_count))){\n target_tick_count = 5;\n }\n target_tick_count = parseInt(target_tick_count);\n \n var min_n = target_tick_count / 3;\n var shrink_sml = 0.75;\n var high_u_bias = 1.5;\n var u5_bias = 0.5 + 1.5 * high_u_bias;\n \n var d = Math.abs(range[0] - range[1]);\n var c = d / target_tick_count;\n if ((Math.log(d) / Math.LN10) < -2){\n c = (Math.max(Math.abs(d)) * shrink_sml) / min_n;\n }\n \n var base = Math.pow(10, Math.floor(Math.log(c)/Math.LN10));\n var base_toFixed = 0;\n if (base < 1 && base !== 0){\n base_toFixed = Math.abs(Math.round(Math.log(base)/Math.LN10));\n }\n \n var unit = base;\n if ( ((2 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 2 * base;\n if ( ((5 * base) - c) < (u5_bias * (c - unit)) ){\n unit = 5 * base;\n if ( ((10 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 10 * base;\n }\n }\n }\n \n var ticks = [];\n var i = parseFloat( (Math.floor(range[0]/unit)*unit).toFixed(base_toFixed) );\n while (i < range[1]){\n ticks.push(i);\n i += unit;\n if (base_toFixed > 0){\n i = parseFloat(i.toFixed(base_toFixed));\n }\n }\n ticks.push(i);\n \n if (typeof clip_range == \"undefined\" || [\"low\", \"high\", \"both\", \"neither\"].indexOf(clip_range) === -1){\n clip_range = \"neither\";\n }\n if (clip_range === \"low\" || clip_range === \"both\"){\n if (ticks[0] < range[0]){ ticks = ticks.slice(1); }\n }\n if (clip_range === \"high\" || clip_range === \"both\"){\n if (ticks[ticks.length-1] > range[1]){ ticks.pop(); }\n }\n \n return ticks;\n};\n\n/**\n * Make an AJAX request and return a promise.\n * From http://www.html5rocks.com/en/tutorials/cors/\n * and with promises from https://gist.github.com/kriskowal/593076\n *\n * @param {String} method The HTTP verb\n * @param {String} url\n * @param {String} body The request body to send to the server\n * @param {Object} headers Object of custom request headers\n * @param {Number} [timeout] If provided, wait this long (in ms) before timing out\n * @returns {Promise}\n */\nLocusZoom.createCORSPromise = function (method, url, body, headers, timeout) {\n var response = Q.defer();\n var xhr = new XMLHttpRequest();\n if (\"withCredentials\" in xhr) {\n // Check if the XMLHttpRequest object has a \"withCredentials\" property.\n // \"withCredentials\" only exists on XMLHTTPRequest2 objects.\n xhr.open(method, url, true);\n } else if (typeof XDomainRequest != \"undefined\") {\n // Otherwise, check if XDomainRequest.\n // XDomainRequest only exists in IE, and is IE's way of making CORS requests.\n xhr = new XDomainRequest();\n xhr.open(method, url);\n } else {\n // Otherwise, CORS is not supported by the browser.\n xhr = null;\n }\n if (xhr) {\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200 || xhr.status === 0 ) {\n response.resolve(xhr.response);\n } else {\n response.reject(\"HTTP \" + xhr.status + \" for \" + url);\n }\n }\n };\n timeout && setTimeout(response.reject, timeout);\n body = typeof body !== \"undefined\" ? body : \"\";\n if (typeof headers !== \"undefined\"){\n for (var header in headers){\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n // Send the request\n xhr.send(body);\n } \n return response.promise;\n};\n\n/**\n * Validate a (presumed complete) plot state object against internal rules for consistency, and ensure the plot fits\n * within any constraints imposed by the layout.\n * @param {Object} new_state\n * @param {Number} new_state.start\n * @param {Number} new_state.end\n * @param {Object} layout\n * @returns {*|{}}\n */\nLocusZoom.validateState = function(new_state, layout){\n\n new_state = new_state || {};\n layout = layout || {};\n\n // If a \"chr\", \"start\", and \"end\" are present then resolve start and end\n // to numeric values that are not decimal, negative, or flipped\n var validated_region = false;\n if (typeof new_state.chr != \"undefined\" && typeof new_state.start != \"undefined\" && typeof new_state.end != \"undefined\"){\n // Determine a numeric scale and midpoint for the attempted region,\n var attempted_midpoint = null; var attempted_scale;\n new_state.start = Math.max(parseInt(new_state.start), 1);\n new_state.end = Math.max(parseInt(new_state.end), 1);\n if (isNaN(new_state.start) && isNaN(new_state.end)){\n new_state.start = 1;\n new_state.end = 1;\n attempted_midpoint = 0.5;\n attempted_scale = 0;\n } else if (isNaN(new_state.start) || isNaN(new_state.end)){\n attempted_midpoint = new_state.start || new_state.end;\n attempted_scale = 0;\n new_state.start = (isNaN(new_state.start) ? new_state.end : new_state.start);\n new_state.end = (isNaN(new_state.end) ? new_state.start : new_state.end);\n } else {\n attempted_midpoint = Math.round((new_state.start + new_state.end) / 2);\n attempted_scale = new_state.end - new_state.start;\n if (attempted_scale < 0){\n var temp = new_state.start;\n new_state.end = new_state.start;\n new_state.start = temp;\n attempted_scale = new_state.end - new_state.start;\n }\n if (attempted_midpoint < 0){\n new_state.start = 1;\n new_state.end = 1;\n attempted_scale = 0;\n }\n }\n validated_region = true;\n }\n\n // Constrain w/r/t layout-defined minimum region scale\n if (!isNaN(layout.min_region_scale) && validated_region && attempted_scale < layout.min_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.min_region_scale / 2), 1);\n new_state.end = new_state.start + layout.min_region_scale;\n }\n\n // Constrain w/r/t layout-defined maximum region scale\n if (!isNaN(layout.max_region_scale) && validated_region && attempted_scale > layout.max_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.max_region_scale / 2), 1);\n new_state.end = new_state.start + layout.max_region_scale;\n }\n\n return new_state;\n};\n\n//\n/**\n * Replace placeholders in an html string with field values defined in a data object\n * Only works on scalar values! Will ignore non-scalars.\n *\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @param {Object} data\n * @param {String} html A placeholder string in which to substitute fields. Supports several template options:\n * `{{field_name}}` is a variable placeholder for the value of `field_name` from the provided data\n * `{{#if {{field_name}} }} Conditional text {{/if}} will insert the contents of the tag only if the value exists.\n * Since this is only an existence check, **variables with a value of 0 will be evaluated as true**.\n * @returns {string}\n */\nLocusZoom.parseFields = function (data, html) {\n if (typeof data != \"object\"){\n throw (\"LocusZoom.parseFields invalid arguments: data is not an object\");\n }\n if (typeof html != \"string\"){\n throw (\"LocusZoom.parseFields invalid arguments: html is not a string\");\n }\n // `tokens` is like [token,...]\n // `token` is like {text: '...'} or {variable: 'foo|bar'} or {condition: 'foo|bar'} or {close: 'if'}\n var tokens = [];\n var regex = /\\{\\{(?:(#if )?([A-Za-z0-9_:|]+)|(\\/if))\\}\\}/;\n while (html.length > 0){\n var m = regex.exec(html);\n if (!m) { tokens.push({text: html}); html = \"\"; }\n else if (m.index !== 0) { tokens.push({text: html.slice(0, m.index)}); html = html.slice(m.index); }\n else if (m[1] === \"#if \") { tokens.push({condition: m[2]}); html = html.slice(m[0].length); }\n else if (m[2]) { tokens.push({variable: m[2]}); html = html.slice(m[0].length); }\n else if (m[3] === \"/if\") { tokens.push({close: \"if\"}); html = html.slice(m[0].length); }\n else {\n console.error(\"Error tokenizing tooltip when remaining template is \" + JSON.stringify(html) +\n \" and previous tokens are \" + JSON.stringify(tokens) +\n \" and current regex match is \" + JSON.stringify([m[1], m[2], m[3]]));\n html=html.slice(m[0].length);\n }\n }\n var astify = function() {\n var token = tokens.shift();\n if (typeof token.text !== \"undefined\" || token.variable) {\n return token;\n } else if (token.condition) {\n token.then = [];\n while(tokens.length > 0) {\n if (tokens[0].close === \"if\") { tokens.shift(); break; }\n token.then.push(astify());\n }\n return token;\n } else {\n console.error(\"Error making tooltip AST due to unknown token \" + JSON.stringify(token));\n return { text: \"\" };\n }\n };\n // `ast` is like [thing,...]\n // `thing` is like {text: \"...\"} or {variable:\"foo|bar\"} or {condition: \"foo|bar\", then:[thing,...]}\n var ast = [];\n while (tokens.length > 0) ast.push(astify());\n\n var resolve = function(variable) {\n if (!resolve.cache.hasOwnProperty(variable)) {\n resolve.cache[variable] = (new LocusZoom.Data.Field(variable)).resolve(data);\n }\n return resolve.cache[variable];\n };\n resolve.cache = {};\n var render_node = function(node) {\n if (typeof node.text !== \"undefined\") {\n return node.text;\n } else if (node.variable) {\n try {\n var value = resolve(node.variable);\n if ([\"string\",\"number\",\"boolean\"].indexOf(typeof value) !== -1) { return value; }\n if (value === null) { return \"\"; }\n } catch (error) { console.error(\"Error while processing variable \" + JSON.stringify(node.variable)); }\n return \"{{\" + node.variable + \"}}\";\n } else if (node.condition) {\n try {\n var condition = resolve(node.condition);\n if (condition || condition === 0) {\n return node.then.map(render_node).join(\"\");\n }\n } catch (error) { console.error(\"Error while processing condition \" + JSON.stringify(node.variable)); }\n return \"\";\n } else { console.error(\"Error rendering tooltip due to unknown AST node \" + JSON.stringify(node)); }\n };\n return ast.map(render_node).join(\"\");\n};\n\n/**\n * Shortcut method for getting the data bound to a tool tip.\n * @param {Element} node\n * @returns {*} The first element of data bound to the tooltip\n */\nLocusZoom.getToolTipData = function(node){\n if (typeof node != \"object\" || typeof node.parentNode == \"undefined\"){\n throw(\"Invalid node object\");\n }\n // If this node is a locuszoom tool tip then return its data\n var selector = d3.select(node);\n if (selector.classed(\"lz-data_layer-tooltip\") && typeof selector.data()[0] != \"undefined\"){\n return selector.data()[0];\n } else {\n return LocusZoom.getToolTipData(node.parentNode);\n }\n};\n\n/**\n * Shortcut method for getting a reference to the data layer that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.getToolTipDataLayer = function(node){\n var data = LocusZoom.getToolTipData(node);\n if (data.getDataLayer){ return data.getDataLayer(); }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the panel that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.getToolTipPanel = function(node){\n var data_layer = LocusZoom.getToolTipDataLayer(node);\n if (data_layer){ return data_layer.parent; }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the plot that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.getToolTipPlot = function(node){\n var panel = LocusZoom.getToolTipPanel(node);\n if (panel){ return panel.parent; }\n return null;\n};\n\n/**\n * Generate a curtain object for a plot, panel, or any other subdivision of a layout\n * The panel curtain, like the plot curtain is an HTML overlay that obscures the entire panel. It can be styled\n * arbitrarily and display arbitrary messages. It is useful for reporting error messages visually to an end user\n * when the error renders the panel unusable.\n * TODO: Improve type doc here\n * @returns {object}\n */\nLocusZoom.generateCurtain = function(){\n var curtain = {\n showing: false,\n selector: null,\n content_selector: null,\n hide_delay: null,\n\n /**\n * Generate the curtain. Any content (string) argument passed will be displayed in the curtain as raw HTML.\n * CSS (object) can be passed which will apply styles to the curtain and its content.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n show: function(content, css){\n if (!this.curtain.showing){\n this.curtain.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-curtain\").attr(\"id\", this.id + \".curtain\");\n this.curtain.content_selector = this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-content\");\n this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-dismiss\").html(\"Dismiss\")\n .on(\"click\", function(){\n this.curtain.hide();\n }.bind(this));\n this.curtain.showing = true;\n }\n return this.curtain.update(content, css);\n }.bind(this),\n\n /**\n * Update the content and css of the curtain that's currently being shown. This method also adjusts the size\n * and positioning of the curtain to ensure it still covers the entire panel with no overlap.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n update: function(content, css){\n if (!this.curtain.showing){ return this.curtain; }\n clearTimeout(this.curtain.hide_delay);\n // Apply CSS if provided\n if (typeof css == \"object\"){\n this.curtain.selector.style(css);\n }\n // Update size and position\n var page_origin = this.getPageOrigin();\n this.curtain.selector.style({\n top: page_origin.y + \"px\",\n left: page_origin.x + \"px\",\n width: this.layout.width + \"px\",\n height: this.layout.height + \"px\"\n });\n this.curtain.content_selector.style({\n \"max-width\": (this.layout.width - 40) + \"px\",\n \"max-height\": (this.layout.height - 40) + \"px\"\n });\n // Apply content if provided\n if (typeof content == \"string\"){\n this.curtain.content_selector.html(content);\n }\n return this.curtain;\n }.bind(this),\n\n /**\n * Remove the curtain\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.curtain.showing){ return this.curtain; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.curtain.hide_delay);\n this.curtain.hide_delay = setTimeout(this.curtain.hide, delay);\n return this.curtain;\n }\n // Remove curtain\n this.curtain.selector.remove();\n this.curtain.selector = null;\n this.curtain.content_selector = null;\n this.curtain.showing = false;\n return this.curtain;\n }.bind(this)\n };\n return curtain;\n};\n\n/**\n * Generate a loader object for a plot, panel, or any other subdivision of a layout\n *\n * The panel loader is a small HTML overlay that appears in the lower left corner of the panel. It cannot be styled\n * arbitrarily, but can show a custom message and show a minimalist loading bar that can be updated to specific\n * completion percentages or be animated.\n * TODO Improve type documentation\n * @returns {object}\n */\nLocusZoom.generateLoader = function(){\n var loader = {\n showing: false,\n selector: null,\n content_selector: null,\n progress_selector: null,\n cancel_selector: null,\n\n /**\n * Show a loading indicator\n * @param {string} [content='Loading...'] Loading message (displayed as raw HTML)\n */\n show: function(content){\n // Generate loader\n if (!this.loader.showing){\n this.loader.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-loader\").attr(\"id\", this.id + \".loader\");\n this.loader.content_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-content\");\n this.loader.progress_selector = this.loader.selector\n .append(\"div\").attr(\"class\", \"lz-loader-progress-container\")\n .append(\"div\").attr(\"class\", \"lz-loader-progress\");\n /* TODO: figure out how to make this cancel button work\n this.loader.cancel_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-cancel\").html(\"Cancel\")\n .on(\"click\", function(){\n this.loader.hide();\n }.bind(this));\n */\n this.loader.showing = true;\n if (typeof content == \"undefined\"){ content = \"Loading...\"; }\n }\n return this.loader.update(content);\n }.bind(this),\n\n /**\n * Update the currently displayed loader and ensure the new content is positioned correctly.\n * @param {string} content The text to display (as raw HTML). If not a string, will be ignored.\n * @param {number} [percent] A number from 1-100. If a value is specified, it will stop all animations\n * in progress.\n */\n update: function(content, percent){\n if (!this.loader.showing){ return this.loader; }\n clearTimeout(this.loader.hide_delay);\n // Apply content if provided\n if (typeof content == \"string\"){\n this.loader.content_selector.html(content);\n }\n // Update size and position\n var padding = 6; // is there a better place to store/define this?\n var page_origin = this.getPageOrigin();\n var loader_boundrect = this.loader.selector.node().getBoundingClientRect();\n this.loader.selector.style({\n top: (page_origin.y + this.layout.height - loader_boundrect.height - padding) + \"px\",\n left: (page_origin.x + padding) + \"px\"\n });\n /* Uncomment this code when a functional cancel button can be shown\n var cancel_boundrect = this.loader.cancel_selector.node().getBoundingClientRect();\n this.loader.content_selector.style({\n \"padding-right\": (cancel_boundrect.width + padding) + \"px\"\n });\n */\n // Apply percent if provided\n if (typeof percent == \"number\"){\n this.loader.progress_selector.style({\n width: (Math.min(Math.max(percent, 1), 100)) + \"%\"\n });\n }\n return this.loader;\n }.bind(this),\n\n /**\n * Adds a class to the loading bar that makes it loop infinitely in a loading animation. Useful when exact\n * percent progress is not available.\n */\n animate: function(){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", true);\n return this.loader;\n }.bind(this),\n\n /**\n * Sets the loading bar in the loader to percentage width equal to the percent (number) value passed. Percents\n * will automatically be limited to a range of 1 to 100. Will stop all animations in progress.\n */\n setPercentCompleted: function(percent){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", false);\n return this.loader.update(null, percent);\n }.bind(this),\n\n /**\n * Remove the loader\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.loader.showing){ return this.loader; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.loader.hide_delay);\n this.loader.hide_delay = setTimeout(this.loader.hide, delay);\n return this.loader;\n }\n // Remove loader\n this.loader.selector.remove();\n this.loader.selector = null;\n this.loader.content_selector = null;\n this.loader.progress_selector = null;\n this.loader.cancel_selector = null;\n this.loader.showing = false;\n return this.loader;\n }.bind(this)\n };\n return loader;\n};\n\n/**\n * Create a new subclass following classical inheritance patterns. Some registry singletons use this internally to\n * enable code reuse and customization of known LZ core functionality.\n *\n * @param {Function} parent A parent class constructor that will be extended by the child class\n * @param {Object} extra An object of additional properties and methods to add/override behavior for the child class.\n * The special \"constructor\" property can be used to specify a custom constructor, or it will call parent by default.\n * Implementer must manage super calls when overriding the constructor.\n * @returns {Function} The constructor for the new child class\n */\nLocusZoom.subclass = function(parent, extra) {\n if (typeof parent !== \"function\" ) {\n throw \"Parent must be a callable constructor\";\n }\n\n extra = extra || {};\n var Sub = extra.hasOwnProperty(\"constructor\") ? extra.constructor : function() {\n parent.apply(this, arguments);\n };\n\n Sub.prototype = Object.create(parent.prototype);\n Object.keys(extra).forEach(function(k) {\n Sub.prototype[k] = extra[k];\n });\n return Sub;\n};\n\n\n/**\n * LocusZoom optional extensions will live under this namespace.\n *\n * Extension code is not part of the core LocusZoom app.js bundle.\n * @namespace\n * @public\n */\nLocusZoom.ext = {};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * Manage known layouts for all parts of the LocusZoom plot\n *\n * This registry allows for layouts to be reused and customized many times on a page, using a common base pattern.\n * It handles the work of ensuring that each new instance of the layout has no shared state with other copies.\n *\n * @class\n */\nLocusZoom.Layouts = (function() {\n var obj = {};\n var layouts = {\n \"plot\": {},\n \"panel\": {},\n \"data_layer\": {},\n \"dashboard\": {},\n \"tooltip\": {}\n };\n\n /**\n * Generate a layout configuration object\n * @param {('plot'|'panel'|'data_layer'|'dashboard'|'tooltip')} type The type of layout to retrieve\n * @param {string} name Identifier of the predefined layout within the specified type\n * @param {object} [modifications] Custom properties that override default settings for this layout\n * @returns {object} A JSON-serializable object representation\n */\n obj.get = function(type, name, modifications) {\n if (typeof type != \"string\" || typeof name != \"string\") {\n throw(\"invalid arguments passed to LocusZoom.Layouts.get, requires string (layout type) and string (layout name)\");\n } else if (layouts[type][name]) {\n // Get the base layout\n var layout = LocusZoom.Layouts.merge(modifications || {}, layouts[type][name]);\n // If \"unnamespaced\" is true then strike that from the layout and return the layout without namespacing\n if (layout.unnamespaced){\n delete layout.unnamespaced;\n return JSON.parse(JSON.stringify(layout));\n }\n // Determine the default namespace for namespaced values\n var default_namespace = \"\";\n if (typeof layout.namespace == \"string\"){\n default_namespace = layout.namespace;\n } else if (typeof layout.namespace == \"object\" && Object.keys(layout.namespace).length){\n if (typeof layout.namespace.default != \"undefined\"){\n default_namespace = layout.namespace.default;\n } else {\n default_namespace = layout.namespace[Object.keys(layout.namespace)[0]].toString();\n }\n }\n default_namespace += default_namespace.length ? \":\" : \"\";\n // Apply namespaces to layout, recursively\n var applyNamespaces = function(element, namespace){\n if (namespace){\n if (typeof namespace == \"string\"){\n namespace = { default: namespace }; \n }\n } else {\n namespace = { default: \"\" };\n }\n if (typeof element == \"string\"){\n var re = /\\{\\{namespace(\\[[A-Za-z_0-9]+\\]|)\\}\\}/g;\n var match, base, key, resolved_namespace;\n var replace = [];\n while ((match = re.exec(element)) !== null){\n base = match[0];\n key = match[1].length ? match[1].replace(/(\\[|\\])/g,\"\") : null;\n resolved_namespace = default_namespace;\n if (namespace != null && typeof namespace == \"object\" && typeof namespace[key] != \"undefined\"){\n resolved_namespace = namespace[key] + (namespace[key].length ? \":\" : \"\");\n }\n replace.push({ base: base, namespace: resolved_namespace });\n }\n for (var r in replace){\n element = element.replace(replace[r].base, replace[r].namespace);\n }\n } else if (typeof element == \"object\" && element != null){\n if (typeof element.namespace != \"undefined\"){\n var merge_namespace = (typeof element.namespace == \"string\") ? { default: element.namespace } : element.namespace;\n namespace = LocusZoom.Layouts.merge(namespace, merge_namespace);\n }\n var namespaced_element, namespaced_property;\n for (var property in element) {\n if (property === \"namespace\"){ continue; }\n namespaced_element = applyNamespaces(element[property], namespace);\n namespaced_property = applyNamespaces(property, namespace);\n if (property !== namespaced_property){\n delete element[property];\n }\n element[namespaced_property] = namespaced_element;\n }\n }\n return element;\n };\n layout = applyNamespaces(layout, layout.namespace);\n // Return the layout as valid JSON only\n return JSON.parse(JSON.stringify(layout));\n } else {\n throw(\"layout type [\" + type + \"] name [\" + name + \"] not found\");\n }\n };\n\n /** @private */\n obj.set = function(type, name, layout) {\n if (typeof type != \"string\" || typeof name != \"string\" || typeof layout != \"object\"){\n throw (\"unable to set new layout; bad arguments passed to set()\");\n }\n if (!layouts[type]){\n layouts[type] = {};\n }\n if (layout){\n return (layouts[type][name] = JSON.parse(JSON.stringify(layout)));\n } else {\n delete layouts[type][name];\n return null;\n }\n };\n\n /**\n * Register a new layout definition by name.\n *\n * @param {string} type The type of layout to add. Usually, this will be one of the predefined LocusZoom types,\n * but if you pass a different name, this method will automatically create the new `type` bucket\n * @param {string} name The identifier of the newly added layout\n * @param {object} [layout] A JSON-serializable object containing configuration properties for this layout\n * @returns The JSON representation of the newly created layout\n */\n obj.add = function(type, name, layout) {\n return obj.set(type, name, layout);\n };\n\n /**\n * List all registered layouts\n * @param [type] Optionally narrow the list to only layouts of a specific type; else return all known layouts\n * @returns {*}\n */\n obj.list = function(type) {\n if (!layouts[type]){\n var list = {};\n Object.keys(layouts).forEach(function(type){\n list[type] = Object.keys(layouts[type]);\n });\n return list;\n } else {\n return Object.keys(layouts[type]);\n }\n };\n\n /**\n * A helper method used for merging two objects. If a key is present in both, takes the value from the first object\n * Values from `default_layout` will be cleanly copied over, ensuring no references or shared state.\n *\n * Frequently used for preparing custom layouts. Both objects should be JSON-serializable.\n *\n * @param {object} custom_layout An object containing configuration parameters that override or add to defaults\n * @param {object} default_layout An object containing default settings.\n * @returns The custom layout is modified in place and also returned from this method.\n */\n obj.merge = function (custom_layout, default_layout) {\n if (typeof custom_layout !== \"object\" || typeof default_layout !== \"object\"){\n throw(\"LocusZoom.Layouts.merge only accepts two layout objects; \" + (typeof custom_layout) + \", \" + (typeof default_layout) + \" given\");\n }\n for (var property in default_layout) {\n if (!default_layout.hasOwnProperty(property)){ continue; }\n // Get types for comparison. Treat nulls in the custom layout as undefined for simplicity.\n // (javascript treats nulls as \"object\" when we just want to overwrite them as if they're undefined)\n // Also separate arrays from objects as a discrete type.\n var custom_type = custom_layout[property] === null ? \"undefined\" : typeof custom_layout[property];\n var default_type = typeof default_layout[property];\n if (custom_type === \"object\" && Array.isArray(custom_layout[property])){ custom_type = \"array\"; }\n if (default_type === \"object\" && Array.isArray(default_layout[property])){ default_type = \"array\"; }\n // Unsupported property types: throw an exception\n if (custom_type === \"function\" || default_type === \"function\"){\n throw(\"LocusZoom.Layouts.merge encountered an unsupported property type\");\n }\n // Undefined custom value: pull the default value\n if (custom_type === \"undefined\"){\n custom_layout[property] = JSON.parse(JSON.stringify(default_layout[property]));\n continue;\n }\n // Both values are objects: merge recursively\n if (custom_type === \"object\" && default_type === \"object\"){\n custom_layout[property] = LocusZoom.Layouts.merge(custom_layout[property], default_layout[property]);\n continue;\n }\n }\n return custom_layout;\n };\n\n return obj;\n})();\n\n\n/**\n * Tooltip Layouts\n * @namespace LocusZoom.Layouts.tooltips\n */\n\n// TODO: Improve documentation of predefined types within layout namespaces\nLocusZoom.Layouts.add(\"tooltip\", \"standard_association\", {\n namespace: { \"assoc\": \"assoc\" },\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[assoc]}}variant}}
      \"\n + \"P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
      \"\n + \"Ref. Allele: {{{{namespace[assoc]}}ref_allele}}
      \"\n + \"Make LD Reference
      \"\n});\n\nvar covariates_model_association = LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true });\ncovariates_model_association.html += \"Condition on Variant
      \";\nLocusZoom.Layouts.add(\"tooltip\", \"covariates_model_association\", covariates_model_association);\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_genes\", {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"

      {{gene_name}}

      \"\n + \"
      Gene ID: {{gene_id}}
      \"\n + \"
      Transcript ID: {{transcript_id}}
      \"\n + \"
      \"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"
      ConstraintExpected variantsObserved variantsConst. Metric
      Synonymous{{exp_syn}}{{n_syn}}z = {{syn_z}}
      Missense{{exp_mis}}{{n_mis}}z = {{mis_z}}
      LoF{{exp_lof}}{{n_lof}}pLI = {{pLI}}
      \"\n + \"More data on ExAC\"\n});\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n closable: false,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[intervals]}}state_name}}
      {{{{namespace[intervals]}}start}}-{{{{namespace[intervals]}}end}}\"\n});\n\n/**\n * Data Layer Layouts: represent specific information from a data source\n * @namespace Layouts.data_layer\n*/\n\nLocusZoom.Layouts.add(\"data_layer\", \"significance\", {\n id: \"significance\",\n type: \"orthogonal_line\",\n orientation: \"horizontal\",\n offset: 4.522\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"recomb_rate\", {\n namespace: { \"recomb\": \"recomb\" },\n id: \"recombrate\",\n type: \"line\",\n fields: [\"{{namespace[recomb]}}position\", \"{{namespace[recomb]}}recomb_rate\"],\n z_index: 1,\n style: {\n \"stroke\": \"#0000FF\",\n \"stroke-width\": \"1.5px\"\n },\n x_axis: {\n field: \"{{namespace[recomb]}}position\"\n },\n y_axis: {\n axis: 2,\n field: \"{{namespace[recomb]}}recomb_rate\",\n floor: 0,\n ceiling: 100\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"association_pvalues\", {\n namespace: { \"assoc\": \"assoc\", \"ld\": \"ld\" },\n id: \"associationpvalues\",\n type: \"scatter\",\n point_shape: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"diamond\",\n else: \"circle\"\n }\n },\n point_size: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: 80,\n else: 40\n }\n },\n color: [\n {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"#9632b8\"\n }\n },\n {\n scale_function: \"numerical_bin\",\n field: \"{{namespace[ld]}}state\",\n parameters: {\n breaks: [0, 0.2, 0.4, 0.6, 0.8],\n values: [\"#357ebd\",\"#46b8da\",\"#5cb85c\",\"#eea236\",\"#d43f3a\"]\n }\n },\n \"#B8B8B8\"\n ],\n legend: [\n { shape: \"diamond\", color: \"#9632b8\", size: 40, label: \"LD Ref Var\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#d43f3a\", size: 40, label: \"1.0 > r² ≥ 0.8\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#eea236\", size: 40, label: \"0.8 > r² ≥ 0.6\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#5cb85c\", size: 40, label: \"0.6 > r² ≥ 0.4\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#46b8da\", size: 40, label: \"0.4 > r² ≥ 0.2\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#357ebd\", size: 40, label: \"0.2 > r² ≥ 0.0\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#B8B8B8\", size: 40, label: \"no r² data\", class: \"lz-data_layer-scatter\" }\n ],\n fields: [\"{{namespace[assoc]}}variant\", \"{{namespace[assoc]}}position\", \"{{namespace[assoc]}}log_pvalue\", \"{{namespace[assoc]}}log_pvalue|logtoscinotation\", \"{{namespace[assoc]}}ref_allele\", \"{{namespace[ld]}}state\", \"{{namespace[ld]}}isrefvar\"],\n id_field: \"{{namespace[assoc]}}variant\",\n z_index: 2,\n x_axis: {\n field: \"{{namespace[assoc]}}position\"\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[assoc]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.10,\n min_extent: [ 0, 10 ]\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"phewas_pvalues\", {\n namespace: {\"phewas\": \"phewas\"},\n id: \"phewaspvalues\",\n type: \"category_scatter\",\n point_shape: \"circle\",\n point_size: 70,\n tooltip_positioning: \"vertical\",\n id_field: \"{{namespace[phewas]}}id\",\n fields: [\"{{namespace[phewas]}}id\", \"{{namespace[phewas]}}log_pvalue\", \"{{namespace[phewas]}}trait_group\", \"{{namespace[phewas]}}trait_label\"],\n x_axis: {\n field: \"{{namespace[phewas]}}x\", // Synthetic/derived field added by `category_scatter` layer\n category_field: \"{{namespace[phewas]}}trait_group\",\n lower_buffer: 0.025,\n upper_buffer: 0.025\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[phewas]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.15\n },\n color: {\n field: \"{{namespace[phewas]}}trait_group\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [],\n values: [],\n null_value: \"#B8B8B8\"\n }\n },\n fill_opacity: 0.7,\n tooltip: {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: [\n \"Trait: {{{{namespace[phewas]}}trait_label|htmlescape}}
      \",\n \"Trait Category: {{{{namespace[phewas]}}trait_group|htmlescape}}
      \",\n \"P-value: {{{{namespace[phewas]}}log_pvalue|logtoscinotation|htmlescape}}
      \"\n ].join(\"\")\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n label: {\n text: \"{{{{namespace[phewas]}}trait_label}}\",\n spacing: 6,\n lines: {\n style: {\n \"stroke-width\": \"2px\",\n \"stroke\": \"#333333\",\n \"stroke-dasharray\": \"2px 2px\"\n }\n },\n filters: [\n {\n field: \"{{namespace[phewas]}}log_pvalue\",\n operator: \">=\",\n value: 20\n }\n ],\n style: {\n \"font-size\": \"14px\",\n \"font-weight\": \"bold\",\n \"fill\": \"#333333\"\n }\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genes\", {\n namespace: { \"gene\": \"gene\", \"constraint\": \"constraint\" },\n id: \"genes\",\n type: \"genes\",\n fields: [\"{{namespace[gene]}}all\", \"{{namespace[constraint]}}all\"],\n id_field: \"gene_id\",\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_genes\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genome_legend\", {\n namespace: { \"genome\": \"genome\" },\n id: \"genome_legend\",\n type: \"genome_legend\",\n fields: [\"{{namespace[genome]}}chr\", \"{{namespace[genome]}}base_pairs\"],\n x_axis: {\n floor: 0,\n ceiling: 2881033286\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n id: \"intervals\",\n type: \"intervals\",\n fields: [\"{{namespace[intervals]}}start\",\"{{namespace[intervals]}}end\",\"{{namespace[intervals]}}state_id\",\"{{namespace[intervals]}}state_name\"],\n id_field: \"{{namespace[intervals]}}start\",\n start_field: \"{{namespace[intervals]}}start\",\n end_field: \"{{namespace[intervals]}}end\",\n track_split_field: \"{{namespace[intervals]}}state_id\",\n split_tracks: true,\n always_hide_legend: false,\n color: {\n field: \"{{namespace[intervals]}}state_id\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [1,2,3,4,5,6,7,8,9,10,11,12,13],\n values: [\"rgb(212,63,58)\", \"rgb(250,120,105)\", \"rgb(252,168,139)\", \"rgb(240,189,66)\", \"rgb(250,224,105)\", \"rgb(240,238,84)\", \"rgb(244,252,23)\", \"rgb(23,232,252)\", \"rgb(32,191,17)\", \"rgb(23,166,77)\", \"rgb(32,191,17)\", \"rgb(162,133,166)\", \"rgb(212,212,212)\"],\n null_value: \"#B8B8B8\"\n }\n },\n legend: [\n { shape: \"rect\", color: \"rgb(212,63,58)\", width: 9, label: \"Active Promoter\", \"{{namespace[intervals]}}state_id\": 1 },\n { shape: \"rect\", color: \"rgb(250,120,105)\", width: 9, label: \"Weak Promoter\", \"{{namespace[intervals]}}state_id\": 2 },\n { shape: \"rect\", color: \"rgb(252,168,139)\", width: 9, label: \"Poised Promoter\", \"{{namespace[intervals]}}state_id\": 3 },\n { shape: \"rect\", color: \"rgb(240,189,66)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 4 },\n { shape: \"rect\", color: \"rgb(250,224,105)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 5 },\n { shape: \"rect\", color: \"rgb(240,238,84)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 6 },\n { shape: \"rect\", color: \"rgb(244,252,23)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 7 },\n { shape: \"rect\", color: \"rgb(23,232,252)\", width: 9, label: \"Insulator\", \"{{namespace[intervals]}}state_id\": 8 },\n { shape: \"rect\", color: \"rgb(32,191,17)\", width: 9, label: \"Transcriptional transition\", \"{{namespace[intervals]}}state_id\": 9 },\n { shape: \"rect\", color: \"rgb(23,166,77)\", width: 9, label: \"Transcriptional elongation\", \"{{namespace[intervals]}}state_id\": 10 },\n { shape: \"rect\", color: \"rgb(136,240,129)\", width: 9, label: \"Weak transcribed\", \"{{namespace[intervals]}}state_id\": 11 },\n { shape: \"rect\", color: \"rgb(162,133,166)\", width: 9, label: \"Polycomb-repressed\", \"{{namespace[intervals]}}state_id\": 12 },\n { shape: \"rect\", color: \"rgb(212,212,212)\", width: 9, label: \"Heterochromatin / low signal\", \"{{namespace[intervals]}}state_id\": 13 }\n ],\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_intervals\", { unnamespaced: true })\n});\n\n/**\n * Dashboard Layouts: toolbar buttons etc\n * @namespace Layouts.dashboard\n */\nLocusZoom.Layouts.add(\"dashboard\", \"standard_panel\", {\n components: [\n {\n type: \"remove_panel\",\n position: \"right\",\n color: \"red\",\n group_position: \"end\"\n },\n {\n type: \"move_panel_up\",\n position: \"right\",\n group_position: \"middle\"\n },\n {\n type: \"move_panel_down\",\n position: \"right\",\n group_position: \"start\",\n style: { \"margin-left\": \"0.75em\" }\n }\n ]\n}); \n\nLocusZoom.Layouts.add(\"dashboard\", \"standard_plot\", {\n components: [\n {\n type: \"title\",\n title: \"LocusZoom\",\n subtitle: \"v\" + LocusZoom.version + \"\",\n position: \"left\"\n },\n {\n type: \"download\",\n position: \"right\"\n }\n ]\n});\n\nvar covariates_model_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\ncovariates_model_plot_dashboard.components.push({\n type: \"covariates_model\",\n button_html: \"Model\",\n button_title: \"Show and edit covariates currently in model\",\n position: \"left\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"covariates_model_plot\", covariates_model_plot_dashboard);\n\nvar region_nav_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 500000,\n button_html: \">>\",\n position: \"right\",\n group_position: \"end\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 50000,\n button_html: \">\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: 0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: -0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -50000,\n button_html: \"<\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -500000,\n button_html: \"<<\",\n position: \"right\",\n group_position: \"start\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"region_nav_plot\", region_nav_plot_dashboard);\n\n/**\n * Panel Layouts\n * @namespace Layouts.panel\n */\n\nLocusZoom.Layouts.add(\"panel\", \"association\", {\n id: \"association\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 200,\n proportional_width: 1,\n margin: { top: 35, right: 50, bottom: 40, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_legend\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n },\n y2: {\n label: \"Recombination Rate (cM/Mb)\",\n label_offset: 40\n }\n },\n legend: {\n orientation: \"vertical\",\n origin: { x: 55, y: 40 },\n hidden: true\n },\n interaction: {\n drag_background_to_pan: true,\n drag_x_ticks_to_scale: true,\n drag_y1_ticks_to_scale: true,\n drag_y2_ticks_to_scale: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"recomb_rate\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"association_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genes\", {\n id: \"genes\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 112.5,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 20, left: 50 },\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"resize_to_data\",\n position: \"right\"\n });\n return l;\n })(), \n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genes\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"phewas\", {\n id: \"phewas\",\n width: 800,\n height: 300,\n min_width: 800,\n min_height: 300,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 120, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n axes: {\n x: {\n ticks: { // Object based config (shared defaults; allow layers to specify ticks)\n style: {\n \"font-weight\": \"bold\",\n \"font-size\": \"11px\",\n \"text-anchor\": \"start\"\n },\n transform: \"rotate(50)\",\n position: \"left\" // Special param recognized by `category_scatter` layers\n }\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"phewas_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genome_legend\", {\n id: \"genome_legend\",\n width: 800,\n height: 50,\n origin: { x: 0, y: 300 },\n min_width: 800,\n min_height: 50,\n proportional_width: 1,\n margin: { top: 0, right: 50, bottom: 35, left: 50 },\n axes: {\n x: {\n label: \"Genomic Position (number denotes chromosome)\",\n label_offset: 35,\n ticks: [\n {\n x: 124625310,\n text: \"1\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 370850307,\n text: \"2\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 591461209,\n text: \"3\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 786049562,\n text: \"4\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 972084330,\n text: \"5\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1148099493,\n text: \"6\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1313226358,\n text: \"7\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1465977701,\n text: \"8\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1609766427,\n text: \"9\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1748140516,\n text: \"10\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1883411148,\n text: \"11\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2017840353,\n text: \"12\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2142351240,\n text: \"13\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2253610949,\n text: \"14\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2358551415,\n text: \"15\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2454994487,\n text: \"16\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2540769469,\n text: \"17\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2620405698,\n text: \"18\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2689008813,\n text: \"19\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2750086065,\n text: \"20\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2805663772,\n text: \"21\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2855381003,\n text: \"22\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n }\n ]\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genome_legend\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"intervals\", {\n id: \"intervals\",\n width: 1000,\n height: 50,\n min_width: 500,\n min_height: 50,\n margin: { top: 25, right: 150, bottom: 5, left: 50 },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_split_tracks\",\n data_layer_id: \"intervals\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n legend: {\n hidden: true,\n orientation: \"horizontal\",\n origin: { x: 50, y: 0 },\n pad_from_bottom: 5\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"intervals\", { unnamespaced: true })\n ]\n});\n\n\n/**\n * Plot Layouts\n * @namespace Layouts.plot\n */\n\nLocusZoom.Layouts.add(\"plot\", \"standard_association\", {\n state: {},\n width: 800,\n height: 450,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, proportional_height: 0.5 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, proportional_height: 0.5 })\n ]\n});\n\n// Shortcut to \"StandardLayout\" for backward compatibility\nLocusZoom.StandardLayout = LocusZoom.Layouts.get(\"plot\", \"standard_association\");\n\nLocusZoom.Layouts.add(\"plot\", \"standard_phewas\", {\n width: 800,\n height: 600,\n min_width: 800,\n min_height: 600,\n responsive_resize: true,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true } ),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"phewas\", { unnamespaced: true, proportional_height: 0.45 }),\n LocusZoom.Layouts.get(\"panel\", \"genome_legend\", { unnamespaced: true, proportional_height: 0.1 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", {\n unnamespaced: true, proportional_height: 0.45,\n margin: { bottom: 40 },\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n }\n }\n })\n ],\n mouse_guide: false\n});\n\nLocusZoom.Layouts.add(\"plot\", \"interval_association\", {\n state: {},\n width: 800,\n height: 550,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, width: 800, proportional_height: (225/570) }),\n LocusZoom.Layouts.get(\"panel\", \"intervals\", { unnamespaced: true, proportional_height: (120/570) }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, width: 800, proportional_height: (225/570) })\n ]\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A data layer is an abstract class representing a data set and its graphical representation within a panel\n * @public\n * @class\n * @param {Object} layout A JSON-serializable object describing the layout for this layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n*/\nLocusZoom.DataLayer = function(layout, parent) {\n /** @member {Boolean} */\n this.initialized = false;\n /** @member {Number} */\n this.layout_idx = null;\n\n /** @member {String} */\n this.id = null;\n /** @member {LocusZoom.Panel} */\n this.parent = parent || null;\n /**\n * @member {{group: d3.selection, container: d3.selection, clipRect: d3.selection}}\n */\n this.svg = {};\n\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n if (typeof parent != \"undefined\" && parent instanceof LocusZoom.Panel){ this.parent_plot = parent.parent; }\n\n /** @member {Object} */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.DataLayer.DefaultLayout);\n if (this.layout.id){ this.id = this.layout.id; }\n\n // Ensure any axes defined in the layout have an explicit axis number (default: 1)\n if (this.layout.x_axis !== {} && typeof this.layout.x_axis.axis !== \"number\"){ this.layout.x_axis.axis = 1; }\n if (this.layout.y_axis !== {} && typeof this.layout.y_axis.axis !== \"number\"){ this.layout.y_axis.axis = 1; }\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original data layer state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n /** @member {Object} */\n this.state = {};\n /** @member {String} */\n this.state_id = null;\n\n this.setDefaultState();\n\n // Initialize parameters for storing data and tool tips\n /** @member {Array} */\n this.data = [];\n if (this.layout.tooltip){\n /** @member {Object} */\n this.tooltips = {};\n }\n\n // Initialize flags for tracking global statuses\n this.global_statuses = {\n \"highlighted\": false,\n \"selected\": false,\n \"faded\": false,\n \"hidden\": false\n };\n \n return this;\n\n};\n\n/**\n * Instruct this datalayer to begin tracking additional fields from data sources (does not guarantee that such a field actually exists)\n *\n * Custom plots can use this to dynamically extend datalayer functionality after the plot is drawn\n *\n * (since removing core fields may break layer functionality, there is presently no hook for the inverse behavior)\n * @param fieldName\n * @param namespace\n * @param {String|String[]} transformations The name (or array of names) of transformations to apply to this field\n * @returns {String} The raw string added to the fields array\n */\nLocusZoom.DataLayer.prototype.addField = function(fieldName, namespace, transformations) {\n if (!fieldName || !namespace) {\n throw \"Must specify field name and namespace to use when adding field\";\n }\n var fieldString = namespace + \":\" + fieldName;\n if (transformations) {\n fieldString += \"|\";\n if (typeof transformations === \"string\") {\n fieldString += transformations;\n } else if (Array.isArray(transformations)) {\n fieldString += transformations.join(\"|\");\n } else {\n throw \"Must provide transformations as either a string or array of strings\";\n }\n }\n var fields = this.layout.fields;\n if (fields.indexOf(fieldString) === -1) {\n fields.push(fieldString);\n }\n return fieldString;\n};\n\n/**\n * Define default state that should get tracked during the lifetime of this layer.\n *\n * In some special custom usages, it may be useful to completely reset a panel (eg \"click for\n * genome region\" links), plotting new data that invalidates any previously tracked state. This hook makes it\n * possible to reset without destroying the panel entirely. It is used by `Plot.clearPanelData`.\n */\nLocusZoom.DataLayer.prototype.setDefaultState = function() {\n // Define state parameters specific to this data layer. Within plot state, this will live under a key\n // `panel_name.layer_name`.\n if (this.parent){\n this.state = this.parent.state;\n this.state_id = this.parent.id + \".\" + this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n this.state[this.state_id][status] = this.state[this.state_id][status] || [];\n }.bind(this));\n }\n};\n\n/**\n * A basic description of keys expected in a layout. Not intended to be directly used or modified by an end user.\n * @protected\n * @type {{type: string, fields: Array, x_axis: {}, y_axis: {}}}\n */\nLocusZoom.DataLayer.DefaultLayout = {\n type: \"\",\n fields: [],\n x_axis: {},\n y_axis: {}\n};\n\n/**\n * Available statuses that individual elements can have. Each status is described by\n * a verb/antiverb and an adjective. Verbs and antiverbs are used to generate data layer\n * methods for updating the status on one or more elements. Adjectives are used in class\n * names and applied or removed from elements to have a visual representation of the status,\n * as well as used as keys in the state for tracking which elements are in which status(es)\n * @static\n * @type {{verbs: String[], adjectives: String[], menu_antiverbs: String[]}}\n */\nLocusZoom.DataLayer.Statuses = {\n verbs: [\"highlight\", \"select\", \"fade\", \"hide\"],\n adjectives: [\"highlighted\", \"selected\", \"faded\", \"hidden\"],\n menu_antiverbs: [\"unhighlight\", \"deselect\", \"unfade\", \"show\"]\n};\n\n/**\n * Get the fully qualified identifier for the data layer, prefixed by any parent or container elements\n *\n * @returns {string} A dot-delimited string of the format ..\n */\nLocusZoom.DataLayer.prototype.getBaseId = function(){\n return this.parent_plot.id + \".\" + this.parent.id + \".\" + this.id;\n};\n\n/**\n * Determine the pixel height of data-bound objects represented inside this data layer. (excluding elements such as axes)\n *\n * May be used by operations that resize the data layer to fit available data\n *\n * @public\n * @returns {number}\n */\nLocusZoom.DataLayer.prototype.getAbsoluteDataHeight = function(){\n var dataBCR = this.svg.group.node().getBoundingClientRect();\n return dataBCR.height;\n};\n\n/**\n * Whether transitions can be applied to this data layer\n * @returns {boolean}\n */\nLocusZoom.DataLayer.prototype.canTransition = function(){\n if (!this.layout.transition){ return false; }\n return !(this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.panel_id);\n};\n\n/**\n * Fetch the fully qualified ID to be associated with a specific visual element, based on the data to which that\n * element is bound. In general this element ID will be unique, allowing it to be addressed directly via selectors.\n * @param {String|Object} element\n * @returns {String}\n */\nLocusZoom.DataLayer.prototype.getElementId = function(element){\n var element_id = \"element\";\n if (typeof element == \"string\"){\n element_id = element;\n } else if (typeof element == \"object\"){\n var id_field = this.layout.id_field || \"id\";\n if (typeof element[id_field] == \"undefined\"){\n throw(\"Unable to generate element ID\");\n }\n element_id = element[id_field].toString().replace(/\\W/g,\"\");\n }\n return (this.getBaseId() + \"-\" + element_id).replace(/(:|\\.|\\[|\\]|,)/g, \"_\");\n};\n\n/**\n * Fetch an ID that may bind a data element to a separate visual node for displaying status\n * Examples of this might be seperate visual nodes to show select/highlight statuses, or\n * even a common/shared node to show status across many elements in a set.\n * Abstract method. It should be overridden by data layers that implement seperate status\n * nodes specifically to the use case of the data layer type.\n * @param {String|Object} element\n * @returns {String|null}\n */\nLocusZoom.DataLayer.prototype.getElementStatusNodeId = function(element){\n return null;\n};\n\n/**\n * Returns a reference to the underlying data associated with a single visual element in the data layer, as\n * referenced by the unique identifier for the element\n\n * @param {String} id The unique identifier for the element, as defined by `getElementId`\n * @returns {Object|null} The data bound to that element\n */\nLocusZoom.DataLayer.prototype.getElementById = function(id){\n var selector = d3.select(\"#\" + id.replace(/(:|\\.|\\[|\\]|,)/g, \"\\\\$1\"));\n if (!selector.empty() && selector.data() && selector.data().length){\n return selector.data()[0];\n } else {\n return null;\n }\n};\n\n/**\n * Basic method to apply arbitrary methods and properties to data elements.\n * This is called on all data immediately after being fetched.\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyDataMethods = function(){\n this.data.forEach(function(d, i){\n // Basic toHTML() method - return the stringified value in the id_field, if defined.\n this.data[i].toHTML = function(){\n var id_field = this.layout.id_field || \"id\";\n var html = \"\";\n if (this.data[i][id_field]){ html = this.data[i][id_field].toString(); }\n return html;\n }.bind(this);\n // getDataLayer() method - return a reference to the data layer\n this.data[i].getDataLayer = function(){\n return this;\n }.bind(this);\n // deselect() method - shortcut method to deselect the element\n this.data[i].deselect = function(){\n var data_layer = this.getDataLayer();\n data_layer.unselectElement(this);\n };\n }.bind(this));\n this.applyCustomDataMethods();\n return this;\n};\n\n/**\n * Hook that allows custom datalayers to apply additional methods and properties to data elements as needed\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyCustomDataMethods = function(){\n return this;\n};\n\n/**\n * Initialize a data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.initialize = function(){\n\n // Append a container group element to house the main data layer group element and the clip path\n this.svg.container = this.parent.svg.group.append(\"g\")\n .attr(\"class\", \"lz-data_layer-container\")\n .attr(\"id\", this.getBaseId() + \".data_layer_container\");\n \n // Append clip path to the container element\n this.svg.clipRect = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\")\n .append(\"rect\");\n \n // Append svg group for rendering all data layer elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".data_layer\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n return this;\n\n};\n\n/**\n * Move a data layer up relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveUp = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Move a data layer down relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveDown = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Apply scaling functions to an element or parameter as needed, based on its layout and the element's data\n * If the layout parameter is already a primitive type, simply return the value as given\n * @param {Array|Number|String|Object} layout\n * @param {*} data The value to be used with the filter\n * @returns {*} The transformed value\n */\nLocusZoom.DataLayer.prototype.resolveScalableParameter = function(layout, data){\n var ret = null;\n if (Array.isArray(layout)){\n var idx = 0;\n while (ret === null && idx < layout.length){\n ret = this.resolveScalableParameter(layout[idx], data);\n idx++;\n }\n } else {\n switch (typeof layout){\n case \"number\":\n case \"string\":\n ret = layout;\n break;\n case \"object\":\n if (layout.scale_function){\n if(layout.field) {\n var f = new LocusZoom.Data.Field(layout.field);\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, f.resolve(data));\n } else {\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, data);\n }\n }\n break;\n }\n }\n return ret;\n};\n\n/**\n * Generate dimension extent function based on layout parameters\n * @param {('x'|'y')} dimension\n */\nLocusZoom.DataLayer.prototype.getAxisExtent = function(dimension){\n\n if ([\"x\", \"y\"].indexOf(dimension) === -1){\n throw(\"Invalid dimension identifier passed to LocusZoom.DataLayer.getAxisExtent()\");\n }\n\n var axis_name = dimension + \"_axis\";\n var axis_layout = this.layout[axis_name];\n\n // If a floor AND a ceiling are explicitly defined then just return that extent and be done\n if (!isNaN(axis_layout.floor) && !isNaN(axis_layout.ceiling)){\n return [+axis_layout.floor, +axis_layout.ceiling];\n }\n\n // If a field is defined for the axis and the data layer has data then generate the extent from the data set\n var data_extent = [];\n if (axis_layout.field && this.data) {\n if (!this.data.length) {\n // If data has been fetched (but no points in region), enforce the min_extent (with no buffers,\n // because we don't need padding around an empty screen)\n data_extent = axis_layout.min_extent || [];\n return data_extent;\n } else {\n data_extent = d3.extent(this.data, function (d) {\n var f = new LocusZoom.Data.Field(axis_layout.field);\n return +f.resolve(d);\n });\n\n // Apply upper/lower buffers, if applicable\n var original_extent_span = data_extent[1] - data_extent[0];\n if (!isNaN(axis_layout.lower_buffer)) {\n data_extent[0] -= original_extent_span * axis_layout.lower_buffer;\n }\n if (!isNaN(axis_layout.upper_buffer)) {\n data_extent[1] += original_extent_span * axis_layout.upper_buffer;\n }\n\n if (typeof axis_layout.min_extent == \"object\") {\n // The data should span at least the range specified by min_extent, an array with [low, high]\n var range_min = axis_layout.min_extent[0];\n var range_max = axis_layout.min_extent[1];\n if (!isNaN(range_min) && !isNaN(range_max)) {\n data_extent[0] = Math.min(data_extent[0], range_min);\n }\n if (!isNaN(range_max)) {\n data_extent[1] = Math.max(data_extent[1], range_max);\n }\n }\n // If specified, floor and ceiling will override the actual data range\n return [\n isNaN(axis_layout.floor) ? data_extent[0] : axis_layout.floor,\n isNaN(axis_layout.ceiling) ? data_extent[1] : axis_layout.ceiling\n ];\n }\n }\n\n // If this is for the x axis and no extent could be generated yet but state has a defined start and end\n // then default to using the state-defined region as the extent\n if (dimension === \"x\" && !isNaN(this.state.start) && !isNaN(this.state.end)) {\n return [this.state.start, this.state.end];\n }\n\n // No conditions met for generating a valid extent, return an empty array\n return [];\n\n};\n\n/**\n * Allow this data layer to tell the panel what axis ticks it thinks it will require. The panel may choose whether\n * to use some, all, or none of these when rendering, either alone or in conjunction with other data layers.\n *\n * This method is a stub and should be overridden in data layers that need to specify custom behavior.\n *\n * @param {('x'|'y')} dimension\n * @param {Object} [config] Additional parameters for the panel to specify how it wants ticks to be drawn. The names\n * and meanings of these parameters may vary between different data layers.\n * @returns {Object[]}\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.DataLayer.prototype.getTicks = function (dimension, config) {\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw(\"Invalid dimension identifier\");\n }\n return [];\n};\n\n/**\n * Generate a tool tip for a given element\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.createTooltip = function(d, id){\n if (typeof this.layout.tooltip != \"object\"){\n throw (\"DataLayer [\" + this.id + \"] layout does not define a tooltip\");\n }\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n if (this.tooltips[id]){\n this.positionTooltip(id);\n return;\n }\n this.tooltips[id] = {\n data: d,\n arrow: null,\n selector: d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-data_layer-tooltip\")\n .attr(\"id\", id + \"-tooltip\")\n };\n this.updateTooltip(d);\n return this;\n};\n\n/**\n * Update a tool tip (generate its inner HTML)\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.updateTooltip = function(d, id){\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n // Empty the tooltip of all HTML (including its arrow!)\n this.tooltips[id].selector.html(\"\");\n this.tooltips[id].arrow = null;\n // Set the new HTML\n if (this.layout.tooltip.html){\n this.tooltips[id].selector.html(LocusZoom.parseFields(d, this.layout.tooltip.html));\n }\n // If the layout allows tool tips on this data layer to be closable then add the close button\n // and add padding to the tooltip to accommodate it\n if (this.layout.tooltip.closable){\n this.tooltips[id].selector.insert(\"button\", \":first-child\")\n .attr(\"class\", \"lz-tooltip-close-button\")\n .attr(\"title\", \"Close\")\n .text(\"×\")\n .on(\"click\", function(){\n this.destroyTooltip(id);\n }.bind(this));\n }\n // Apply data directly to the tool tip for easier retrieval by custom UI elements inside the tool tip\n this.tooltips[id].selector.data([d]);\n // Reposition and draw a new arrow\n this.positionTooltip(id);\n return this;\n};\n\n/**\n * Destroy tool tip - remove the tool tip element from the DOM and delete the tool tip's record on the data layer\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyTooltip = function(d, id){\n if (typeof d == \"string\"){\n id = d;\n } else if (typeof id == \"undefined\"){\n id = this.getElementId(d);\n }\n if (this.tooltips[id]){\n if (typeof this.tooltips[id].selector == \"object\"){\n this.tooltips[id].selector.remove();\n }\n delete this.tooltips[id];\n }\n return this;\n};\n\n/**\n * Loop through and destroy all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyAllTooltips = function(){\n for (var id in this.tooltips){\n this.destroyTooltip(id);\n }\n return this;\n};\n\n//\n/**\n * Position tool tip - naïve function to place a tool tip to the lower right of the current mouse element\n * Most data layers reimplement this method to position tool tips specifically for the data they display\n * @param {String} id The identifier of the tooltip to position\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n // Position the div itself\n this.tooltips[id].selector\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY) + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!this.tooltips[id].arrow){\n this.tooltips[id].arrow = this.tooltips[id].selector.append(\"div\")\n .style(\"position\", \"absolute\")\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_top_left\");\n }\n this.tooltips[id].arrow\n .style(\"left\", \"-1px\")\n .style(\"top\", \"-1px\");\n return this;\n};\n\n/**\n * Loop through and position all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionAllTooltips = function(){\n for (var id in this.tooltips){\n this.positionTooltip(id);\n }\n return this;\n};\n\n/**\n * Show or hide a tool tip by ID depending on directives in the layout and state values relative to the ID\n * @param {String|Object} element The element associated with the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.showOrHideTooltip = function(element){\n \n if (typeof this.layout.tooltip != \"object\"){ return; }\n var id = this.getElementId(element);\n\n var resolveStatus = function(statuses, directive, operator){\n var status = null;\n if (typeof statuses != \"object\" || statuses === null){ return null; }\n if (Array.isArray(directive)){\n if (typeof operator == \"undefined\"){ operator = \"and\"; }\n if (directive.length === 1){\n status = statuses[directive[0]];\n } else {\n status = directive.reduce(function(previousValue, currentValue) {\n if (operator === \"and\"){\n return statuses[previousValue] && statuses[currentValue];\n } else if (operator === \"or\"){\n return statuses[previousValue] || statuses[currentValue];\n }\n return null;\n });\n }\n } else if (typeof directive == \"object\"){\n var sub_status;\n for (var sub_operator in directive){\n sub_status = resolveStatus(statuses, directive[sub_operator], sub_operator);\n if (status === null){\n status = sub_status;\n } else if (operator === \"and\"){\n status = status && sub_status;\n } else if (operator === \"or\"){\n status = status || sub_status;\n }\n }\n }\n return status;\n };\n\n var show_directive = {};\n if (typeof this.layout.tooltip.show == \"string\"){\n show_directive = { and: [ this.layout.tooltip.show ] };\n } else if (typeof this.layout.tooltip.show == \"object\"){\n show_directive = this.layout.tooltip.show;\n }\n\n var hide_directive = {};\n if (typeof this.layout.tooltip.hide == \"string\"){\n hide_directive = { and: [ this.layout.tooltip.hide ] };\n } else if (typeof this.layout.tooltip.hide == \"object\"){\n hide_directive = this.layout.tooltip.hide;\n }\n\n var statuses = {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n var antistatus = \"un\" + status;\n statuses[status] = this.state[this.state_id][status].indexOf(id) !== -1;\n statuses[antistatus] = !statuses[status];\n }.bind(this));\n\n var show_resolved = resolveStatus(statuses, show_directive);\n var hide_resolved = resolveStatus(statuses, hide_directive);\n\n // Only show tooltip if the resolved logic explicitly shows and explicitly not hides the tool tip\n // Otherwise ensure tooltip does not exist\n if (show_resolved && !hide_resolved){\n this.createTooltip(element);\n } else {\n this.destroyTooltip(element);\n }\n\n return this;\n \n};\n\n/**\n * Find the elements (or indices) that match any of a set of provided filters\n * @protected\n * @param {Array[]} filters A list of filter entries: [field, value] (for equivalence testing) or\n * [field, operator, value] for other operators\n * @param {('indexes'|'elements')} [return_type='indexes'] Specify whether to return either the indices of the matching\n * elements, or references to the elements themselves\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filter = function(filters, return_type){\n if (typeof return_type == \"undefined\" || [\"indexes\",\"elements\"].indexOf(return_type) === -1){\n return_type = \"indexes\";\n }\n if (!Array.isArray(filters)){ return []; }\n var test = function(element, filter){\n var operators = {\n \"=\": function(a,b){ return a === b; },\n \"<\": function(a,b){ return a < b; },\n \"<=\": function(a,b){ return a <= b; },\n \">\": function(a,b){ return a > b; },\n \">=\": function(a,b){ return a >= b; },\n \"%\": function(a,b){ return a % b; }\n };\n if (!Array.isArray(filter)){ return false; }\n if (filter.length === 2){\n return element[filter[0]] === filter[1];\n } else if (filter.length === 3 && operators[filter[1]]){\n return operators[filter[1]](element[filter[0]], filter[2]);\n } else {\n return false;\n }\n };\n var matches = [];\n this.data.forEach(function(element, idx){\n var match = true;\n filters.forEach(function(filter){\n if (!test(element, filter)){ match = false; }\n });\n if (match){ matches.push(return_type === \"indexes\" ? idx : element); }\n });\n return matches;\n};\n\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterIndexes = function(filters){ return this.filter(filters, \"indexes\"); };\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterElements = function(filters){ return this.filter(filters, \"elements\"); };\n\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset a single element's status\n // TODO: Improve documentation for dynamically generated methods/properties\n LocusZoom.DataLayer.prototype[verb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, true, exclusive);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, false, exclusive);\n return this;\n };\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.DataLayer.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.DataLayer.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.DataLayer.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n/**\n * Toggle a status (e.g. highlighted, selected, identified) on an element\n * @param {String} status The name of a recognized status to be added/removed on an appropriate element\n * @param {String|Object} element The data bound to the element of interest\n * @param {Boolean} toggle True to add the status (and associated CSS styles); false to remove it\n * @param {Boolean} exclusive Whether to only allow a state for a single element at a time\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatus = function(status, element, toggle, exclusive){\n // Sanity checks\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatus()\");\n }\n if (typeof element == \"undefined\"){\n throw(\"Invalid element passed to DataLayer.setElementStatus()\");\n }\n if (typeof toggle == \"undefined\"){\n toggle = true;\n }\n\n // Get an ID for the element or return having changed nothing\n try {\n var element_id = this.getElementId(element);\n } catch (get_element_id_error){\n return this;\n }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Set/unset the proper status class on the appropriate DOM element(s)\n d3.select(\"#\" + element_id).classed(\"lz-data_layer-\" + this.layout.type + \"-\" + status, toggle);\n var element_status_node_id = this.getElementStatusNodeId(element);\n if (element_status_node_id !== null){\n d3.select(\"#\" + element_status_node_id).classed(\"lz-data_layer-\" + this.layout.type + \"-statusnode-\" + status, toggle);\n }\n \n // Track element ID in the proper status state array\n var element_status_idx = this.state[this.state_id][status].indexOf(element_id);\n if (toggle && element_status_idx === -1){\n this.state[this.state_id][status].push(element_id);\n }\n if (!toggle && element_status_idx !== -1){\n this.state[this.state_id][status].splice(element_status_idx, 1);\n }\n \n // Trigger tool tip show/hide logic\n this.showOrHideTooltip(element);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n if (status === \"selected\") {\n // Notify parents that a given element has been interacted with. For now, we will only notify on\n // \"selected\" type events, which is (usually) a toggle-able state. If elements are exclusive, two selection\n // events will be sent in short order as the previously selected element has to be de-selected first\n this.parent.emit(\"element_selection\", { element: element, active: toggle }, true);\n }\n return this;\n \n};\n\n/**\n * Toggle a status on elements in the data layer based on a set of filters\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatusByFilters()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; } else { toggle = !!toggle; }\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n if (!Array.isArray(filters)){ filters = []; }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Apply statuses\n this.filterElements(filters).forEach(function(element){\n this.setElementStatus(status, element, toggle);\n }.bind(this));\n \n return this;\n};\n\n/**\n * Toggle a status on all elements in the data layer\n * @param {String} status\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setAllElementStatus = function(status, toggle){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Apply statuses\n if (toggle){\n this.data.forEach(function(element){\n this.setElementStatus(status, element, true);\n }.bind(this));\n } else {\n var status_ids = this.state[this.state_id][status].slice();\n status_ids.forEach(function(id){\n var element = this.getElementById(id);\n if (typeof element == \"object\" && element !== null){\n this.setElementStatus(status, element, false);\n }\n }.bind(this));\n this.state[this.state_id][status] = [];\n }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n return this;\n};\n\n/**\n * Apply all layout-defined behaviors (DOM event handlers) to a selection of elements\n * @param {d3.selection} selection\n */\nLocusZoom.DataLayer.prototype.applyBehaviors = function(selection){\n if (typeof this.layout.behaviors != \"object\"){ return; }\n Object.keys(this.layout.behaviors).forEach(function(directive){\n var event_match = /(click|mouseover|mouseout)/.exec(directive);\n if (!event_match){ return; }\n selection.on(event_match[0] + \".\" + directive, this.executeBehaviors(directive, this.layout.behaviors[directive]));\n }.bind(this));\n};\n\n/**\n * Generate a function that executes an arbitrary list of behaviors on an element during an event\n * @param {String} directive The name of the event, as described in layout.behaviors for this datalayer\n * @param {Object} behaviors An object describing the behavior to attach to this single element\n * @param {string} behaviors.action The name of the action that would trigger this behavior (eg click, mouseover, etc)\n * @param {string} behaviors.status What status to apply to the element when this behavior is triggered (highlighted,\n * selected, etc)\n * @param {string} [behaviors.exclusive] Whether triggering the event for this element should unset the relevant status\n * for all other elements. Useful for, eg, click events that exclusively highlight one thing.\n * @returns {function(this:LocusZoom.DataLayer)} Return a function that handles the event in context with the behavior\n * and the element- can be attached as an event listener\n */\nLocusZoom.DataLayer.prototype.executeBehaviors = function(directive, behaviors) {\n\n // Determine the required state of control and shift keys during the event\n var requiredKeyStates = {\n \"ctrl\": (directive.indexOf(\"ctrl\") !== -1),\n \"shift\": (directive.indexOf(\"shift\") !== -1)\n };\n\n return function(element){\n\n // Do nothing if the required control and shift key presses (or lack thereof) doesn't match the event\n if (requiredKeyStates.ctrl !== !!d3.event.ctrlKey || requiredKeyStates.shift !== !!d3.event.shiftKey){ return; }\n\n // Loop through behaviors making each one go in succession\n behaviors.forEach(function(behavior){\n \n // Route first by the action, if defined\n if (typeof behavior != \"object\" || behavior === null){ return; }\n \n switch (behavior.action){\n \n // Set a status (set to true regardless of current status, optionally with exclusivity)\n case \"set\":\n this.setElementStatus(behavior.status, element, true, behavior.exclusive);\n break;\n \n // Unset a status (set to false regardless of current status, optionally with exclusivity)\n case \"unset\":\n this.setElementStatus(behavior.status, element, false, behavior.exclusive);\n break;\n \n // Toggle a status\n case \"toggle\":\n var current_status_boolean = (this.state[this.state_id][behavior.status].indexOf(this.getElementId(element)) !== -1);\n var exclusive = behavior.exclusive && !current_status_boolean;\n this.setElementStatus(behavior.status, element, !current_status_boolean, exclusive);\n break;\n \n // Link to a dynamic URL\n case \"link\":\n if (typeof behavior.href == \"string\"){\n var url = LocusZoom.parseFields(element, behavior.href);\n if (typeof behavior.target == \"string\"){\n window.open(url, behavior.target);\n } else {\n window.location.href = url;\n }\n }\n break;\n \n // Action not defined, just return\n default:\n break;\n \n }\n \n return;\n \n }.bind(this));\n\n }.bind(this);\n\n};\n\n/**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\nLocusZoom.DataLayer.prototype.getPageOrigin = function(){\n var panel_origin = this.parent.getPageOrigin();\n return {\n x: panel_origin.x + this.parent.layout.margin.left,\n y: panel_origin.y + this.parent.layout.margin.top\n };\n};\n\n/**\n * Get a data layer's current underlying data in a standard format (e.g. JSON or CSV)\n * @param {('csv'|'tsv'|'json')} format How to export the data\n * @returns {*}\n */\nLocusZoom.DataLayer.prototype.exportData = function(format){\n var default_format = \"json\";\n format = format || default_format;\n format = (typeof format == \"string\" ? format.toLowerCase() : default_format);\n if ([\"json\",\"csv\",\"tsv\"].indexOf(format) === -1){ format = default_format; }\n var ret;\n switch (format){\n case \"json\":\n try {\n ret = JSON.stringify(this.data);\n } catch (e){\n ret = null;\n console.error(\"Unable to export JSON data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n case \"tsv\":\n case \"csv\":\n try {\n var jsonified = JSON.parse(JSON.stringify(this.data));\n if (typeof jsonified != \"object\"){\n ret = jsonified.toString();\n } else if (!Array.isArray(jsonified)){\n ret = \"Object\";\n } else {\n var delimiter = (format === \"tsv\") ? \"\\t\" : \",\";\n var header = this.layout.fields.map(function(header){\n return JSON.stringify(header);\n }).join(delimiter) + \"\\n\";\n ret = header + jsonified.map(function(record){\n return this.layout.fields.map(function(field){\n if (typeof record[field] == \"undefined\"){\n return JSON.stringify(null);\n } else if (typeof record[field] == \"object\" && record[field] !== null){\n return Array.isArray(record[field]) ? \"\\\"[Array(\" + record[field].length + \")]\\\"\" : \"\\\"[Object]\\\"\";\n } else {\n return JSON.stringify(record[field]);\n }\n }).join(delimiter);\n }.bind(this)).join(\"\\n\");\n }\n } catch (e){\n ret = null;\n console.error(\"Unable to export CSV data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n }\n return ret;\n};\n\n/**\n * Position the datalayer and all tooltips\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.draw = function(){\n this.svg.container.attr(\"transform\", \"translate(\" + this.parent.layout.cliparea.origin.x + \",\" + this.parent.layout.cliparea.origin.y + \")\");\n this.svg.clipRect\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.parent.layout.cliparea.height);\n this.positionAllTooltips();\n return this;\n};\n\n\n/**\n * Re-Map a data layer to reflect changes in the state of a plot (such as viewing region/ chromosome range)\n * @return {Promise}\n */\nLocusZoom.DataLayer.prototype.reMap = function(){\n\n this.destroyAllTooltips(); // hack - only non-visible tooltips should be destroyed\n // and then recreated if returning to visibility\n\n // Fetch new data. Datalayers are only given access to the final consolidated data from the chain (not headers or raw payloads)\n var promise = this.parent_plot.lzd.getData(this.state, this.layout.fields);\n promise.then(function(new_data) {\n this.data = new_data.body;\n this.applyDataMethods();\n this.initialized = true;\n }.bind(this));\n\n return promise;\n};\n\n\n/**\n * The central registry of known data layer definitions (which may be stored in separate files due to length)\n * @namespace\n */\nLocusZoom.DataLayers = (function() {\n var obj = {};\n var datalayers = {};\n /**\n * @name LocusZoom.DataLayers.get\n * @param {String} name The name of the datalayer\n * @param {Object} layout The configuration object for this data layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n * @returns {LocusZoom.DataLayer}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (datalayers[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for data layer [\" + name + \"]\");\n } else {\n return new datalayers[name](layout, parent);\n }\n } else {\n throw(\"data layer [\" + name + \"] not found\");\n }\n };\n\n /**\n * @name LocusZoom.DataLayers.set\n * @protected\n * @param {String} name\n * @param {Function} datalayer Constructor for the datalayer\n */\n obj.set = function(name, datalayer) {\n if (datalayer) {\n if (typeof datalayer != \"function\"){\n throw(\"unable to set data layer [\" + name + \"], argument provided is not a function\");\n } else {\n datalayers[name] = datalayer;\n datalayers[name].prototype = new LocusZoom.DataLayer();\n }\n } else {\n delete datalayers[name];\n }\n };\n\n /**\n * Add a new type of datalayer to the registry of known layer types\n * @name LocusZoom.DataLayers.add\n * @param {String} name The name of the data layer to register\n * @param {Function} datalayer\n */\n obj.add = function(name, datalayer) {\n if (datalayers[name]) {\n throw(\"data layer already exists with name: \" + name);\n } else {\n obj.set(name, datalayer);\n }\n };\n\n /**\n * Register a new datalayer that inherits and extends basic behaviors from a known datalayer\n * @param {String} parent_name The name of the parent data layer whose behavior is to be extended\n * @param {String} name The name of the new datalayer to register\n * @param {Object} [overrides] Object of properties and methods to combine with the prototype of the parent datalayer\n * @returns {Function} The constructor for the new child class\n */\n obj.extend = function(parent_name, name, overrides) {\n // TODO: Consider exposing additional constructor argument, if there is a use case for very granular extension\n overrides = overrides || {};\n\n var parent = datalayers[parent_name];\n if (!parent) {\n throw \"Attempted to subclass an unknown or unregistered datalayer type\";\n }\n if (typeof overrides !== \"object\") {\n throw \"Must specify an object of properties and methods\";\n }\n var child = LocusZoom.subclass(parent, overrides);\n // Bypass .set() because we want a layer of inheritance below `DataLayer`\n datalayers[name] = child;\n return child;\n };\n\n /**\n * List the names of all known datalayers\n * @name LocusZoom.DataLayers.list\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(datalayers);\n };\n\n return obj;\n})();\n","\"use strict\";\n\n/**\n * Create a single continuous 2D track that provides information about each datapoint\n *\n * For example, this can be used to color by membership in a group, alongside information in other panels\n *\n * @class LocusZoom.DataLayers.annotation_track\n * @augments LocusZoom.DataLayer\n * @param {Object} layout\n * @param {Object|String} [layout.color]\n * @param {Array[]} An array of filter entries specifying which points to draw annotations for.\n * See `LocusZoom.DataLayer.filter` for details\n */\nLocusZoom.DataLayers.add(\"annotation_track\", function(layout) {\n // In the future we may add additional options for controlling marker size/ shape, based on user feedback\n this.DefaultLayout = {\n color: \"#000000\",\n filters: []\n };\n\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n if (!Array.isArray(layout.filters)) {\n throw \"Annotation track must specify array of filters for selecting points to annotate\";\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n this.render = function() {\n var self = this;\n // Only render points that currently satisfy all provided filter conditions.\n var trackData = this.filter(this.layout.filters, \"elements\");\n\n var selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-\" + self.layout.type)\n .data(trackData, function(d) { return d[self.layout.id_field]; });\n\n // Add new elements as needed\n selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function (d){ return self.getElementId(d); });\n // Update the set of elements to reflect new data\n selection\n .attr(\"x\", function (d) { return self.parent[\"x_scale\"](d[self.layout.x_axis.field]); })\n .attr(\"width\", 1) // TODO autocalc width of track? Based on datarange / pixel width presumably\n .attr(\"height\", self.parent.layout.height)\n .attr(\"fill\", function(d){ return self.resolveScalableParameter(self.layout.color, d); });\n // Remove unused elements\n selection.exit().remove();\n\n // Set up tooltips and mouse interaction\n this.applyBehaviors(selection);\n };\n\n // Reimplement the positionTooltip() method to be annotation-specific\n this.positionTooltip = function(id) {\n if (typeof id != \"string\") {\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]) {\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var offset = stroke_width / 2;\n var page_origin = this.getPageOrigin();\n\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_center = data_layer_height / 2;\n\n // Tooltip should be horizontally centered above the point to be annotated. (or below if space is limited)\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width) + offset_left - offset_right - offset;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - y_center) {\n top = page_origin.y + y_center - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow) {\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n return this;\n});\n","\"use strict\";\n\n/*********************\n Forest Data Layer\n Implements a standard forest plot\n*/\n\nLocusZoom.DataLayers.add(\"forest\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"square\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 2\n },\n id_field: \"id\",\n confidence_intervals: {\n start_field: \"ci_start\",\n end_field: \"ci_end\"\n },\n show_no_significance_line: true\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be forest-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n var offset = Math.sqrt(point_size / Math.PI);\n var left, arrow_type, arrow_left;\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var top, arrow_top;\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n } \n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Implement the main render function\n this.render = function(){\n\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate confidence interval paths if fields are defined\n if (this.layout.confidence_intervals\n && this.layout.fields.indexOf(this.layout.confidence_intervals.start_field) !== -1\n && this.layout.fields.indexOf(this.layout.confidence_intervals.end_field) !== -1){\n // Generate a selection for all forest plot confidence intervals\n var ci_selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-forest.lz-data_layer-forest-ci\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n // Create confidence interval rect elements\n ci_selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-ci\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_ci\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + (isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height) + \")\");\n // Apply position and size parameters using transition if necessary\n var ci_transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n var ci_width = function(d){\n return this.parent[x_scale](d[this.layout.confidence_intervals.end_field])\n - this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n }.bind(this);\n var ci_height = 1;\n if (this.canTransition()){\n ci_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n } else {\n ci_selection\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n }\n // Remove old elements as needed\n ci_selection.exit().remove();\n }\n \n // Generate a selection for all forest plot points\n var points_selection = this.svg.group\n .selectAll(\"path.lz-data_layer-forest.lz-data_layer-forest-point\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n points_selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-point\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_point\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n if (this.canTransition()){\n points_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n points_selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n points_selection.exit().remove();\n\n // Apply default event emitters to selection\n points_selection.on(\"click.event_emitter\", function(element_data){\n this.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n \n // Apply behaviors to points\n this.applyBehaviors(points_selection);\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Genes Data Layer\n * Implements a data layer that will render gene tracks\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"genes\", function(layout){\n /**\n * Define a default layout for this DataLayer type and merge it with the passed argument\n * @protected\n * @member {Object}\n * */\n this.DefaultLayout = {\n // Optionally specify different fill and stroke properties\n stroke: \"rgb(54, 54, 150)\",\n color: \"#363696\",\n label_font_size: 12,\n label_exon_spacing: 4,\n exon_height: 16,\n bounding_box_padding: 6,\n track_vertical_spacing: 10\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Generate a statusnode ID for a given element\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n return this.getElementId(element) + \"-statusnode\";\n };\n\n /**\n * Helper function to sum layout values to derive total height for a single gene track\n * @returns {number}\n */\n this.getTrackHeight = function(){\n return 2 * this.layout.bounding_box_padding\n + this.layout.label_font_size\n + this.layout.label_exon_spacing\n + this.layout.exon_height\n + this.layout.track_vertical_spacing;\n };\n\n /**\n * A gene may have arbitrarily many transcripts, but this data layer isn't set up to render them yet.\n * Stash a transcript_idx to point to the first transcript and use that for all transcript refs.\n * @member {number}\n * @type {number}\n */\n this.transcript_idx = 0;\n\n /**\n * An internal counter for the number of tracks in the data layer. Used as an internal counter for looping\n * over positions / assignments\n * @protected\n * @member {number}\n */\n this.tracks = 1;\n\n /**\n * Store information about genes in dataset, in a hash indexed by track number: {track_number: [gene_indices]}\n * @member {Object.}\n */\n this.gene_track_index = { 1: [] };\n\n /**\n * Ensure that genes in overlapping chromosome regions are positioned so that parts of different genes do not\n * overlap in the view. A track is a row used to vertically separate overlapping genes.\n * @returns {LocusZoom.DataLayer}\n */\n this.assignTracks = function(){\n /**\n * Function to get the width in pixels of a label given the text and layout attributes\n * TODO: Move to outer scope?\n * @param {String} gene_name\n * @param {number|string} font_size\n * @returns {number}\n */\n this.getLabelWidth = function(gene_name, font_size){\n try {\n var temp_text = this.svg.group.append(\"text\")\n .attr(\"x\", 0).attr(\"y\", 0).attr(\"class\", \"lz-data_layer-genes lz-label\")\n .style(\"font-size\", font_size)\n .text(gene_name + \"→\");\n var label_width = temp_text.node().getBBox().width;\n temp_text.remove();\n return label_width;\n } catch (e){\n return 0;\n }\n };\n\n // Reinitialize some metadata\n this.tracks = 1;\n this.gene_track_index = { 1: [] };\n\n this.data.map(function(d, g){\n\n // If necessary, split combined gene id / version fields into discrete fields.\n // NOTE: this may be an issue with CSG's genes data source that may eventually be solved upstream.\n if (this.data[g].gene_id && this.data[g].gene_id.indexOf(\".\")){\n var split = this.data[g].gene_id.split(\".\");\n this.data[g].gene_id = split[0];\n this.data[g].gene_version = split[1];\n }\n\n // Stash the transcript ID on the parent gene\n this.data[g].transcript_id = this.data[g].transcripts[this.transcript_idx].transcript_id;\n\n // Determine display range start and end, based on minimum allowable gene display width, bounded by what we can see\n // (range: values in terms of pixels on the screen)\n this.data[g].display_range = {\n start: this.parent.x_scale(Math.max(d.start, this.state.start)),\n end: this.parent.x_scale(Math.min(d.end, this.state.end))\n };\n this.data[g].display_range.label_width = this.getLabelWidth(this.data[g].gene_name, this.layout.label_font_size);\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n // Determine label text anchor (default to middle)\n this.data[g].display_range.text_anchor = \"middle\";\n if (this.data[g].display_range.width < this.data[g].display_range.label_width){\n if (d.start < this.state.start){\n this.data[g].display_range.end = this.data[g].display_range.start\n + this.data[g].display_range.label_width\n + this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"start\";\n } else if (d.end > this.state.end){\n this.data[g].display_range.start = this.data[g].display_range.end\n - this.data[g].display_range.label_width\n - this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n var centered_margin = ((this.data[g].display_range.label_width - this.data[g].display_range.width) / 2)\n + this.layout.label_font_size;\n if ((this.data[g].display_range.start - centered_margin) < this.parent.x_scale(this.state.start)){\n this.data[g].display_range.start = this.parent.x_scale(this.state.start);\n this.data[g].display_range.end = this.data[g].display_range.start + this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"start\";\n } else if ((this.data[g].display_range.end + centered_margin) > this.parent.x_scale(this.state.end)) {\n this.data[g].display_range.end = this.parent.x_scale(this.state.end);\n this.data[g].display_range.start = this.data[g].display_range.end - this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n this.data[g].display_range.start -= centered_margin;\n this.data[g].display_range.end += centered_margin;\n }\n }\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n }\n // Add bounding box padding to the calculated display range start, end, and width\n this.data[g].display_range.start -= this.layout.bounding_box_padding;\n this.data[g].display_range.end += this.layout.bounding_box_padding;\n this.data[g].display_range.width += 2 * this.layout.bounding_box_padding;\n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[g].display_domain = {\n start: this.parent.x_scale.invert(this.data[g].display_range.start),\n end: this.parent.x_scale.invert(this.data[g].display_range.end)\n };\n this.data[g].display_domain.width = this.data[g].display_domain.end - this.data[g].display_domain.start;\n\n // Using display range/domain data generated above cast each gene to tracks such that none overlap\n this.data[g].track = null;\n var potential_track = 1;\n while (this.data[g].track === null){\n var collision_on_potential_track = false;\n this.gene_track_index[potential_track].map(function(placed_gene){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_gene.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_gene.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_gene.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[g]));\n if (!collision_on_potential_track){\n this.data[g].track = potential_track;\n this.gene_track_index[potential_track].push(this.data[g]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.gene_track_index[potential_track] = [];\n }\n }\n }\n\n // Stash parent references on all genes, trascripts, and exons\n this.data[g].parent = this;\n this.data[g].transcripts.map(function(d, t){\n this.data[g].transcripts[t].parent = this.data[g];\n this.data[g].transcripts[t].exons.map(function(d, e){\n this.data[g].transcripts[t].exons[e].parent = this.data[g].transcripts[t];\n }.bind(this));\n }.bind(this));\n\n }.bind(this));\n return this;\n };\n\n /**\n * Main render function\n */\n this.render = function(){\n\n var self = this;\n this.assignTracks();\n\n var width, height, x, y;\n\n // Render gene groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-genes\")\n .data(this.data, function(d){ return d.gene_name; });\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-genes\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(gene){\n\n var data_layer = gene.parent;\n\n // Render gene bounding boxes (status nodes to show selected/highlighted)\n var bboxes = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-data_layer-genes-statusnode\")\n .data([gene], function(d){ return data_layer.getElementStatusNodeId(d); });\n\n bboxes.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-data_layer-genes-statusnode\");\n \n bboxes\n .attr(\"id\", function(d){\n return data_layer.getElementStatusNodeId(d);\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n bboxes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n bboxes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n bboxes.exit().remove();\n\n // Render gene boundaries\n var boundary_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d); };\n var boundary_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d); };\n var boundaries = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-boundary\")\n .data([gene], function(d){ return d.gene_name + \"_boundary\"; })\n .style({ fill: boundary_fill, stroke: boundary_stroke });\n\n boundaries.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-boundary\");\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return 1; // TODO: scale dynamically?\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing\n + (Math.max(data_layer.layout.exon_height, 3) / 2);\n };\n if (data_layer.canTransition()){\n boundaries\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n boundaries\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n \n boundaries.exit().remove();\n\n // Render gene labels\n var labels = d3.select(this).selectAll(\"text.lz-data_layer-genes.lz-label\")\n .data([gene], function(d){ return d.gene_name + \"_label\"; });\n\n labels.enter().append(\"text\")\n .attr(\"class\", \"lz-data_layer-genes lz-label\");\n\n labels\n .attr(\"text-anchor\", function(d){\n return d.display_range.text_anchor;\n })\n .text(function(d){\n return (d.strand === \"+\") ? d.gene_name + \"→\" : \"←\" + d.gene_name;\n })\n .style(\"font-size\", gene.parent.layout.label_font_size);\n\n x = function(d){\n if (d.display_range.text_anchor === \"middle\"){\n return d.display_range.start + (d.display_range.width / 2);\n } else if (d.display_range.text_anchor === \"start\"){\n return d.display_range.start + data_layer.layout.bounding_box_padding;\n } else if (d.display_range.text_anchor === \"end\"){\n return d.display_range.end - data_layer.layout.bounding_box_padding;\n }\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size;\n };\n if (data_layer.canTransition()){\n labels\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"x\", x).attr(\"y\", y);\n } else {\n labels\n .attr(\"x\", x).attr(\"y\", y);\n }\n\n labels.exit().remove();\n\n // Render exon rects (first transcript only, for now)\n // Exons: by default color on gene properties for consistency with the gene boundary track- hence color uses d.parent.parent\n var exon_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d.parent.parent); };\n var exon_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d.parent.parent); };\n\n var exons = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-exon\")\n .data(gene.transcripts[gene.parent.transcript_idx].exons, function(d){ return d.exon_id; });\n\n exons.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-exon\");\n\n exons\n .style({ fill: exon_fill, stroke: exon_stroke });\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return data_layer.layout.exon_height;\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(){\n return ((gene.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing;\n };\n if (data_layer.canTransition()){\n exons\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n exons\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n exons.exit().remove();\n\n // Render gene click area\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-clickarea\")\n .data([gene], function(d){ return d.gene_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click.event_emitter\", function(element){\n element.parent.parent.emit(\"element_clicked\", element, true);\n });\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n };\n\n /**\n * Reimplement the positionTooltip() method to be gene-specific\n * @param {String} id\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var gene_bbox_id = this.getElementStatusNodeId(tooltip.data);\n var gene_bbox = d3.select(\"#\" + gene_bbox_id).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the gene that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var gene_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - gene_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + gene_center_x - data_layer_width, 0);\n var left = page_origin.x + gene_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the gene unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (gene_bbox.y + gene_bbox.height)){\n top = page_origin.y + gene_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + gene_bbox.y + gene_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Genome Legend Data Layer\n Implements a data layer that will render a genome legend\n*/\n\n// Build a custom data layer for a genome legend\nLocusZoom.DataLayers.add(\"genome_legend\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n chromosome_fill_colors: {\n light: \"rgb(155, 155, 188)\",\n dark: \"rgb(95, 95, 128)\"\n },\n chromosome_label_colors: {\n light: \"rgb(120, 120, 186)\",\n dark: \"rgb(0, 0, 66)\"\n }\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Implement the main render function\n this.render = function(){\n\n // Iterate over data to generate genome-wide start/end values for each chromosome\n var position = 0;\n this.data.forEach(function(d, i){\n this.data[i].genome_start = position;\n this.data[i].genome_end = position + d[\"genome:base_pairs\"];\n position += d[\"genome:base_pairs\"];\n }.bind(this));\n\n var chromosomes = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend\")\n .data(this.data, function(d){ return d[\"genome:chr\"]; });\n\n // Create chromosome elements, apply class\n chromosomes.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend\");\n\n // Position and fill chromosome rects\n var data_layer = this;\n var panel = this.parent;\n\n chromosomes\n .attr(\"fill\", function(d){ return (d[\"genome:chr\"] % 2 ? data_layer.layout.chromosome_fill_colors.light : data_layer.layout.chromosome_fill_colors.dark); })\n .attr(\"x\", function(d){ return panel.x_scale(d.genome_start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d[\"genome:base_pairs\"]); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n // Remove old elements as needed\n chromosomes.exit().remove();\n\n // Parse current state variant into a position\n // Assumes that variant string is of the format 10:123352136_C/T or 10:123352136\n var variant_parts = /([^:]+):(\\d+)(?:_.*)?/.exec(this.state.variant);\n if (!variant_parts) {\n throw(\"Genome legend cannot understand the specified variant position\");\n }\n var chr = variant_parts[1];\n var offset = variant_parts[2];\n // TODO: How does this handle representation of X or Y chromosomes?\n position = +this.data[chr-1].genome_start + +offset;\n\n // Render the position\n var region = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend-marker\")\n .data([{ start: position, end: position + 1 }]);\n\n region.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend-marker\");\n\n region\n .transition()\n .duration(500)\n .style({\n \"fill\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke-width\": \"3px\"\n })\n .attr(\"x\", function(d){ return panel.x_scale(d.start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d.end - d.start); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n region.exit().remove();\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/**\n * Intervals Data Layer\n * Implements a data layer that will render interval annotation tracks (intervals must provide start and end values)\n * @class LocusZoom.DataLayers.intervals\n * @augments LocusZoom.DataLayer\n */\nLocusZoom.DataLayers.add(\"intervals\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n start_field: \"start\",\n end_field: \"end\",\n track_split_field: \"state_id\",\n track_split_order: \"DESC\",\n track_split_legend_to_y_axis: 2,\n split_tracks: true,\n track_height: 15,\n track_vertical_spacing: 3,\n bounding_box_padding: 2,\n always_hide_legend: false,\n color: \"#B8B8B8\",\n fill_opacity: 1\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n \n /**\n * To define shared highlighting on the track split field define the status node id override\n * to generate an ID common to the track when we're actively splitting data out to separate tracks\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n if (this.layout.split_tracks){\n return (this.getBaseId() + \"-statusnode-\" + element[this.layout.track_split_field]).replace(/[:.[\\],]/g, \"_\");\n }\n return this.getElementId(element) + \"-statusnode\";\n }.bind(this);\n \n // Helper function to sum layout values to derive total height for a single interval track\n this.getTrackHeight = function(){\n return this.layout.track_height\n + this.layout.track_vertical_spacing\n + (2 * this.layout.bounding_box_padding);\n };\n\n this.tracks = 1;\n this.previous_tracks = 1;\n \n // track-number-indexed object with arrays of interval indexes in the dataset\n this.interval_track_index = { 1: [] };\n\n // After we've loaded interval data interpret it to assign\n // each to a track so that they do not overlap in the view\n this.assignTracks = function(){\n\n // Reinitialize some metadata\n this.previous_tracks = this.tracks;\n this.tracks = 0;\n this.interval_track_index = { 1: [] };\n this.track_split_field_index = {};\n \n // If splitting tracks by a field's value then do a first pass determine\n // a value/track mapping that preserves the order of possible values\n if (this.layout.track_split_field && this.layout.split_tracks){\n this.data.map(function(d){\n this.track_split_field_index[d[this.layout.track_split_field]] = null;\n }.bind(this));\n var index = Object.keys(this.track_split_field_index);\n if (this.layout.track_split_order === \"DESC\"){ index.reverse(); }\n index.forEach(function(val){\n this.track_split_field_index[val] = this.tracks + 1;\n this.interval_track_index[this.tracks + 1] = [];\n this.tracks++;\n }.bind(this));\n }\n\n this.data.map(function(d, i){\n\n // Stash a parent reference on the interval\n this.data[i].parent = this;\n\n // Determine display range start and end, based on minimum allowable interval display width,\n // bounded by what we can see (range: values in terms of pixels on the screen)\n this.data[i].display_range = {\n start: this.parent.x_scale(Math.max(d[this.layout.start_field], this.state.start)),\n end: this.parent.x_scale(Math.min(d[this.layout.end_field], this.state.end))\n };\n this.data[i].display_range.width = this.data[i].display_range.end - this.data[i].display_range.start;\n \n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[i].display_domain = {\n start: this.parent.x_scale.invert(this.data[i].display_range.start),\n end: this.parent.x_scale.invert(this.data[i].display_range.end)\n };\n this.data[i].display_domain.width = this.data[i].display_domain.end - this.data[i].display_domain.start;\n\n // If splitting to tracks based on the value of the designated track split field\n // then don't bother with collision detection (intervals will be grouped on tracks\n // solely by the value of track_split_field)\n if (this.layout.track_split_field && this.layout.split_tracks){\n var val = this.data[i][this.layout.track_split_field];\n this.data[i].track = this.track_split_field_index[val];\n this.interval_track_index[this.data[i].track].push(i);\n } else {\n // If not splitting to tracks based on a field value then do so based on collision\n // detection (as how it's done for genes). Use display range/domain data generated\n // above and cast each interval to tracks such that none overlap\n this.tracks = 1;\n this.data[i].track = null;\n var potential_track = 1;\n while (this.data[i].track === null){\n var collision_on_potential_track = false;\n this.interval_track_index[potential_track].map(function(placed_interval){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_interval.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_interval.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_interval.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[i]));\n if (!collision_on_potential_track){\n this.data[i].track = potential_track;\n this.interval_track_index[potential_track].push(this.data[i]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.interval_track_index[potential_track] = [];\n }\n }\n }\n\n }\n\n }.bind(this));\n\n return this;\n };\n\n // Implement the main render function\n this.render = function(){\n\n this.assignTracks();\n\n // Remove any shared highlight nodes and re-render them if we're splitting on tracks\n // At most there will only be dozen or so nodes here (one per track) and each time\n // we render data we may have new tracks, so wiping/redrawing all is reasonable.\n this.svg.group.selectAll(\".lz-data_layer-intervals-statusnode.lz-data_layer-intervals-shared\").remove();\n Object.keys(this.track_split_field_index).forEach(function(key){\n // Make a psuedo-element so that we can generate an id for the shared node\n var psuedoElement = {};\n psuedoElement[this.layout.track_split_field] = key;\n // Insert the shared node\n var sharedstatusnode_style = {display: (this.layout.split_tracks ? null : \"none\")};\n this.svg.group.insert(\"rect\", \":first-child\")\n .attr(\"id\", this.getElementStatusNodeId(psuedoElement))\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-shared\")\n .attr(\"rx\", this.layout.bounding_box_padding).attr(\"ry\", this.layout.bounding_box_padding)\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.getTrackHeight() - this.layout.track_vertical_spacing)\n .attr(\"x\", 0)\n .attr(\"y\", (this.track_split_field_index[key]-1) * this.getTrackHeight())\n .style(sharedstatusnode_style);\n }.bind(this));\n\n var width, height, x, y, fill, fill_opacity;\n \n // Render interval groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-intervals\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-intervals\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(interval){\n\n var data_layer = interval.parent;\n\n // Render interval status nodes (displayed behind intervals to show highlight\n // without needing to modify interval display element(s))\n var statusnode_style = {display: (data_layer.layout.split_tracks ? \"none\" : null)};\n var statusnodes = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-data_layer-intervals-statusnode.lz-data_layer-intervals-statusnode-discrete\")\n .data([interval], function(d){ return data_layer.getElementId(d) + \"-statusnode\"; });\n statusnodes.enter().insert(\"rect\", \":first-child\")\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-statusnode-discrete\");\n statusnodes\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"-statusnode\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .style(statusnode_style);\n width = function(d){\n return d.display_range.width + (2 * data_layer.layout.bounding_box_padding);\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start - data_layer.layout.bounding_box_padding;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n statusnodes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n statusnodes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n statusnodes.exit().remove();\n\n // Render primary interval rects\n var rects = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-interval_rect\")\n .data([interval], function(d){ return d[data_layer.layout.id_field] + \"_interval_rect\"; });\n\n rects.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-interval_rect\");\n\n height = data_layer.layout.track_height;\n width = function(d){\n return d.display_range.width;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding;\n };\n fill = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.color, d);\n };\n fill_opacity = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.fill_opacity, d);\n };\n \n \n if (data_layer.canTransition()){\n rects\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n } else {\n rects\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n }\n \n rects.exit().remove();\n\n // Render interval click areas\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-clickarea\")\n .data([interval], function(d){ return d.interval_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click\", function(element_data){\n element_data.parent.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Update the legend axis if the number of ticks changed\n if (this.previous_tracks !== this.tracks){\n this.updateSplitTrackAxis();\n }\n\n return this;\n\n };\n \n // Reimplement the positionTooltip() method to be interval-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var interval_bbox = d3.select(\"#\" + this.getElementStatusNodeId(tooltip.data)).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the interval that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var interval_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - interval_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + interval_center_x - data_layer_width, 0);\n var left = page_origin.x + interval_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the interval unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (interval_bbox.y + interval_bbox.height)){\n top = page_origin.y + interval_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + interval_bbox.y + interval_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Redraw split track axis or hide it, and show/hide the legend, as determined\n // by current layout parameters and data\n this.updateSplitTrackAxis = function(){\n var legend_axis = this.layout.track_split_legend_to_y_axis ? \"y\" + this.layout.track_split_legend_to_y_axis : false;\n if (this.layout.split_tracks){\n var tracks = +this.tracks || 0;\n var track_height = +this.layout.track_height || 0;\n var track_spacing = 2 * (+this.layout.bounding_box_padding || 0) + (+this.layout.track_vertical_spacing || 0);\n var target_height = (tracks * track_height) + ((tracks - 1) * track_spacing);\n this.parent.scaleHeightToData(target_height);\n if (legend_axis && this.parent.legend){\n this.parent.legend.hide(); \n this.parent.layout.axes[legend_axis] = {\n render: true,\n ticks: [],\n range: {\n start: (target_height - (this.layout.track_height/2)),\n end: (this.layout.track_height/2)\n }\n };\n this.layout.legend.forEach(function(element){\n var key = element[this.layout.track_split_field];\n var track = this.track_split_field_index[key];\n if (track){\n if (this.layout.track_split_order === \"DESC\"){\n track = Math.abs(track - tracks - 1);\n }\n this.parent.layout.axes[legend_axis].ticks.push({\n y: track,\n text: element.label\n });\n }\n }.bind(this));\n this.layout.y_axis = {\n axis: this.layout.track_split_legend_to_y_axis,\n floor: 1,\n ceiling: tracks\n };\n this.parent.render();\n }\n this.parent_plot.positionPanels();\n } else {\n if (legend_axis && this.parent.legend){\n if (!this.layout.always_hide_legend){ this.parent.legend.show(); }\n this.parent.layout.axes[legend_axis] = { render: false };\n this.parent.render();\n }\n }\n return this;\n };\n\n // Method to not only toggle the split tracks boolean but also update\n // necessary display values to animate a complete merge/split\n this.toggleSplitTracks = function(){\n this.layout.split_tracks = !this.layout.split_tracks;\n if (this.parent.legend && !this.layout.always_hide_legend){\n this.parent.layout.margin.bottom = 5 + (this.layout.split_tracks ? 0 : this.parent.legend.layout.height + 5);\n }\n this.render();\n this.updateSplitTrackAxis();\n return this;\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Line Data Layer\n * Implements a standard line plot\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n /** @member {Object} */\n this.DefaultLayout = {\n style: {\n fill: \"none\",\n \"stroke-width\": \"2px\"\n },\n interpolate: \"linear\",\n x_axis: { field: \"x\" },\n y_axis: { field: \"y\", axis: 1 },\n hitarea_width: 5\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Var for storing mouse events for use in tool tip positioning\n /** @member {String} */\n this.mouse_event = null;\n\n /**\n * Var for storing the generated line function itself\n * @member {d3.svg.line}\n * */\n this.line = null;\n\n /**\n * The timeout identifier returned by setTimeout\n * @member {Number}\n */\n this.tooltip_timeout = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n\n /**\n * Helper function to get display and data objects representing\n * the x/y coordinates of the current mouse event with respect to the line in terms of the display\n * and the interpolated values of the x/y fields with respect to the line\n * @returns {{display: {x: *, y: null}, data: {}, slope: null}}\n */\n this.getMouseDisplayAndData = function(){\n var ret = {\n display: {\n x: d3.mouse(this.mouse_event)[0],\n y: null\n },\n data: {},\n slope: null\n };\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n ret.data[x_field] = this.parent[x_scale].invert(ret.display.x);\n var bisect = d3.bisector(function(datum) { return +datum[x_field]; }).left;\n var index = bisect(this.data, ret.data[x_field]) - 1;\n var startDatum = this.data[index];\n var endDatum = this.data[index + 1];\n var interpolate = d3.interpolateNumber(+startDatum[y_field], +endDatum[y_field]);\n var range = +endDatum[x_field] - +startDatum[x_field];\n ret.data[y_field] = interpolate((ret.data[x_field] % range) / range);\n ret.display.y = this.parent[y_scale](ret.data[y_field]);\n if (this.layout.tooltip.x_precision){\n ret.data[x_field] = ret.data[x_field].toPrecision(this.layout.tooltip.x_precision);\n }\n if (this.layout.tooltip.y_precision){\n ret.data[y_field] = ret.data[y_field].toPrecision(this.layout.tooltip.y_precision);\n }\n ret.slope = (this.parent[y_scale](endDatum[y_field]) - this.parent[y_scale](startDatum[y_field]))\n / (this.parent[x_scale](endDatum[x_field]) - this.parent[x_scale](startDatum[x_field]));\n return ret;\n };\n\n /**\n * Reimplement the positionTooltip() method to be line-specific\n * @param {String} id Identify the tooltip to be positioned\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var arrow_width = 7; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var stroke_width = parseFloat(this.layout.style[\"stroke-width\"]) || 1;\n var page_origin = this.getPageOrigin();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n var top, left, arrow_top, arrow_left, arrow_type;\n\n // Determine x/y coordinates for display and data\n var dd = this.getMouseDisplayAndData();\n\n // If the absolute value of the slope of the line at this point is above 1 (including Infinity)\n // then position the tool tip left/right. Otherwise position top/bottom.\n if (Math.abs(dd.slope) > 1){\n\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (dd.display.x <= this.parent.layout.width / 2){\n left = page_origin.x + dd.display.x + stroke_width + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + dd.display.x - tooltip_box.width - stroke_width - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n if (dd.display.y - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + dd.display.y - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (dd.display.y + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + dd.display.y + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + dd.display.y - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n\n } else {\n\n // Position horizontally: attempt to center on the mouse's x coordinate\n // pad to either side if bumping up against the edge of the data layer\n var offset_right = Math.max((tooltip_box.width / 2) - dd.display.x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + dd.display.x - data_layer_width, 0);\n left = page_origin.x + dd.display.x - (tooltip_box.width / 2) - offset_left + offset_right;\n var min_arrow_left = arrow_width / 2;\n var max_arrow_left = tooltip_box.width - (2.5 * arrow_width);\n arrow_left = (tooltip_box.width / 2) - arrow_width + offset_left - offset_right;\n arrow_left = Math.min(Math.max(arrow_left, min_arrow_left), max_arrow_left);\n\n // Position vertically above the line unless there's insufficient space\n if (tooltip_box.height + stroke_width + arrow_width > dd.display.y){\n top = page_origin.y + dd.display.y + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n } else {\n top = page_origin.y + dd.display.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n }\n }\n\n // Apply positions to the main div\n tooltip.selector.style({ left: left + \"px\", top: top + \"px\" });\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style({ \"left\": arrow_left + \"px\", top: arrow_top + \"px\" });\n\n };\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var data_layer = this;\n var panel = this.parent;\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Apply tooltip, etc\n if (this.layout.tooltip){\n // Generate an overlaying transparent \"hit area\" line for more intuitive mouse events\n var hitarea_width = parseFloat(this.layout.hitarea_width).toString() + \"px\";\n var hitarea = this.svg.group\n .selectAll(\"path.lz-data_layer-line-hitarea\")\n .data([this.data]);\n hitarea.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line-hitarea\")\n .style(\"stroke-width\", hitarea_width);\n var hitarea_line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n hitarea\n .attr(\"d\", hitarea_line)\n .on(\"mouseover\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.createTooltip(dd.data);\n })\n .on(\"mousemove\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.updateTooltip(dd.data);\n data_layer.positionTooltip(data_layer.getElementId());\n })\n .on(\"mouseout\", function(){\n data_layer.tooltip_timeout = setTimeout(function(){\n data_layer.mouse_event = null;\n data_layer.destroyTooltip(data_layer.getElementId());\n }, 300);\n });\n hitarea.exit().remove();\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n /**\n * Redefine setElementStatus family of methods as line data layers will only ever have a single path element\n * @param {String} status A member of `LocusZoom.DataLayer.Statuses.adjectives`\n * @param {String|Object} element\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\n this.setElementStatus = function(status, element, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setElementStatusByFilters = function(status, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setAllElementStatus = function(status, toggle){\n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n // Apply class to path based on global status flags\n var path_class = \"lz-data_layer-line\";\n Object.keys(this.global_statuses).forEach(function(global_status){\n if (this.global_statuses[global_status]){ path_class += \" lz-data_layer-line-\" + global_status; }\n }.bind(this));\n this.path.attr(\"class\", path_class);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n return this;\n };\n\n return this;\n\n});\n\n\n/***************************\n * Orthogonal Line Data Layer\n * Implements a horizontal or vertical line given an orientation and an offset in the layout\n * Does not require a data source\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"orthogonal_line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n style: {\n \"stroke\": \"#D3D3D3\",\n \"stroke-width\": \"3px\",\n \"stroke-dasharray\": \"10px 10px\"\n },\n orientation: \"horizontal\",\n x_axis: {\n axis: 1,\n decoupled: true\n },\n y_axis: {\n axis: 1,\n decoupled: true\n },\n offset: 0\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Require that orientation be \"horizontal\" or \"vertical\" only\n if ([\"horizontal\",\"vertical\"].indexOf(layout.orientation) === -1){\n layout.orientation = \"horizontal\";\n }\n\n // Vars for storing the data generated line\n /** @member {Array} */\n this.data = [];\n /** @member {d3.svg.line} */\n this.line = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var panel = this.parent;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n var x_extent = \"x_extent\";\n var y_extent = \"y\" + this.layout.y_axis.axis + \"_extent\";\n var x_range = \"x_range\";\n var y_range = \"y\" + this.layout.y_axis.axis + \"_range\";\n\n // Generate data using extents depending on orientation\n if (this.layout.orientation === \"horizontal\"){\n this.data = [\n { x: panel[x_extent][0], y: this.layout.offset },\n { x: panel[x_extent][1], y: this.layout.offset }\n ];\n } else {\n this.data = [\n { x: this.layout.offset, y: panel[y_extent][0] },\n { x: this.layout.offset, y: panel[y_extent][1] }\n ];\n }\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d, i) {\n var x = parseFloat(panel[x_scale](d[\"x\"]));\n return isNaN(x) ? panel[x_range][i] : x;\n })\n .y(function(d, i) {\n var y = parseFloat(panel[y_scale](d[\"y\"]));\n return isNaN(y) ? panel[y_range][i] : y;\n })\n .interpolate(\"linear\");\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Scatter Data Layer\n Implements a standard scatter plot\n*/\n\nLocusZoom.DataLayers.add(\"scatter\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"circle\",\n tooltip_positioning: \"horizontal\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 1\n },\n id_field: \"id\"\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Extra default for layout spacing\n // Not in default layout since that would make the label attribute always present\n if (layout.label && isNaN(layout.label.spacing)){\n layout.label.spacing = 4;\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be scatter-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var offset = Math.sqrt(point_size / Math.PI);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n if (this.layout.tooltip_positioning === \"vertical\"){\n // Position horizontally centered above the point\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right - offset;\n // Position vertically above the point unless there's insufficient space, then go below\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (y_center + offset)){\n top = page_origin.y + y_center - (offset + tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + offset + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n } else {\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Function to flip labels from being anchored at the start of the text to the end\n // Both to keep labels from running outside the data layer and also as a first\n // pass on recursive separation\n this.flip_labels = function(){\n var data_layer = this;\n var point_size = data_layer.resolveScalableParameter(data_layer.layout.point_size, {});\n var spacing = data_layer.layout.label.spacing;\n var handle_lines = Boolean(data_layer.layout.label.lines);\n var min_x = 2 * spacing;\n var max_x = data_layer.parent.layout.width - data_layer.parent.layout.margin.left - data_layer.parent.layout.margin.right - (2 * spacing);\n var flip = function(dn, dnl){\n var dnx = +dn.attr(\"x\");\n var text_swing = (2 * spacing) + (2 * Math.sqrt(point_size));\n if (handle_lines){\n var dnlx2 = +dnl.attr(\"x2\");\n var line_swing = spacing + (2 * Math.sqrt(point_size));\n }\n if (dn.style(\"text-anchor\") === \"start\"){\n dn.style(\"text-anchor\", \"end\");\n dn.attr(\"x\", dnx - text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 - line_swing); }\n } else {\n dn.style(\"text-anchor\", \"start\");\n dn.attr(\"x\", dnx + text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 + line_swing); }\n }\n };\n // Flip any going over the right edge from the right side to the left side\n // (all labels start on the right side)\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n if (dax + abound.width + spacing > max_x){\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n flip(da, dal);\n }\n });\n // Second pass to flip any others that haven't flipped yet if they collide with another label\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n if (da.style(\"text-anchor\") === \"end\") return;\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n data_layer.label_texts.each(function () {\n var b = this;\n var db = d3.select(b);\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (collision){\n flip(da, dal);\n // Double check that this flip didn't push the label past min_x. If it did, immediately flip back.\n dax = +da.attr(\"x\");\n if (dax - abound.width - spacing < min_x){\n flip(da, dal);\n }\n }\n return;\n });\n });\n };\n\n // Recursive function to space labels apart immediately after initial render\n // Adapted from thudfactor's fiddle here: https://jsfiddle.net/thudfactor/HdwTH/\n // TODO: Make labels also aware of data elements\n this.separate_labels = function(){\n this.seperate_iterations++;\n var data_layer = this;\n var alpha = 0.5;\n var spacing = this.layout.label.spacing;\n var again = false;\n data_layer.label_texts.each(function () {\n var a = this;\n var da = d3.select(a);\n var y1 = da.attr(\"y\");\n data_layer.label_texts.each(function () {\n var b = this;\n // a & b are the same element and don't collide.\n if (a === b) return;\n var db = d3.select(b);\n // a & b are on opposite sides of the chart and\n // don't collide\n if (da.attr(\"text-anchor\") !== db.attr(\"text-anchor\")) return;\n // Determine if the bounding rects for the two text elements collide\n var abound = da.node().getBoundingClientRect();\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (!collision) return;\n again = true;\n // If the labels collide, we'll push each\n // of the two labels up and down a little bit.\n var y2 = db.attr(\"y\");\n var sign = abound.top < bbound.top ? 1 : -1;\n var adjust = sign * alpha;\n var new_a_y = +y1 - adjust;\n var new_b_y = +y2 + adjust;\n // Keep new values from extending outside the data layer\n var min_y = 2 * spacing;\n var max_y = data_layer.parent.layout.height - data_layer.parent.layout.margin.top - data_layer.parent.layout.margin.bottom - (2 * spacing);\n var delta;\n if (new_a_y - (abound.height/2) < min_y){\n delta = +y1 - new_a_y;\n new_a_y = +y1;\n new_b_y += delta;\n } else if (new_b_y - (bbound.height/2) < min_y){\n delta = +y2 - new_b_y;\n new_b_y = +y2;\n new_a_y += delta;\n }\n if (new_a_y + (abound.height/2) > max_y){\n delta = new_a_y - +y1;\n new_a_y = +y1;\n new_b_y -= delta;\n } else if (new_b_y + (bbound.height/2) > max_y){\n delta = new_b_y - +y2;\n new_b_y = +y2;\n new_a_y -= delta;\n }\n da.attr(\"y\",new_a_y);\n db.attr(\"y\",new_b_y);\n });\n });\n if (again) {\n // Adjust lines to follow the labels\n if (data_layer.layout.label.lines){\n var label_elements = data_layer.label_texts[0];\n data_layer.label_lines.attr(\"y2\",function(d,i) {\n var label_line = d3.select(label_elements[i]);\n return label_line.attr(\"y\");\n });\n }\n // After ~150 iterations we're probably beyond diminising returns, so stop recursing\n if (this.seperate_iterations < 150){\n setTimeout(function(){\n this.separate_labels();\n }.bind(this), 1);\n }\n }\n };\n\n // Implement the main render function\n this.render = function(){\n\n var data_layer = this;\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate labels first (if defined)\n if (this.layout.label){\n // Apply filters to generate a filtered data set\n var filtered_data = this.data.filter(function(d){\n if (!data_layer.layout.label.filters){\n return true;\n } else {\n // Start by assuming a match, run through all filters to test if not a match on any one\n var match = true;\n data_layer.layout.label.filters.forEach(function(filter){\n var field_value = (new LocusZoom.Data.Field(filter.field)).resolve(d);\n if (isNaN(field_value)){\n match = false;\n } else {\n switch (filter.operator){\n case \"<\":\n if (!(field_value < filter.value)){ match = false; }\n break;\n case \"<=\":\n if (!(field_value <= filter.value)){ match = false; }\n break;\n case \">\":\n if (!(field_value > filter.value)){ match = false; }\n break;\n case \">=\":\n if (!(field_value >= filter.value)){ match = false; }\n break;\n case \"=\":\n if (!(field_value === filter.value)){ match = false; }\n break;\n default:\n // If we got here the operator is not valid, so the filter should fail\n match = false;\n break;\n }\n }\n });\n return match;\n }\n });\n // Render label groups\n var self = this;\n this.label_groups = this.svg.group\n .selectAll(\"g.lz-data_layer-\" + this.layout.type + \"-label\")\n .data(filtered_data, function(d){ return d[self.layout.id_field] + \"_label\"; });\n this.label_groups.enter()\n .append(\"g\")\n .attr(\"class\", \"lz-data_layer-\"+ this.layout.type + \"-label\");\n // Render label texts\n if (this.label_texts){ this.label_texts.remove(); }\n this.label_texts = this.label_groups.append(\"text\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_texts\n .text(function(d){\n return LocusZoom.parseFields(d, data_layer.layout.label.text || \"\");\n })\n .style(data_layer.layout.label.style || {})\n .attr({\n \"x\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + data_layer.layout.label.spacing;\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"text-anchor\": function(){\n return \"start\";\n }\n });\n // Render label lines\n if (data_layer.layout.label.lines){\n if (this.label_lines){ this.label_lines.remove(); }\n this.label_lines = this.label_groups.append(\"line\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_lines\n .style(data_layer.layout.label.lines.style || {})\n .attr({\n \"x1\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field]);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y1\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"x2\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + (data_layer.layout.label.spacing/2);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y2\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n }\n });\n }\n // Remove labels when they're no longer in the filtered data set\n this.label_groups.exit().remove();\n }\n \n // Generate main scatter data elements\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-\" + this.layout.type)\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Apply default event emitters to selection\n selection.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n \n // Apply mouse behaviors\n this.applyBehaviors(selection);\n \n // Apply method to keep labels from overlapping each other\n if (this.layout.label){\n this.flip_labels();\n this.seperate_iterations = 0;\n this.separate_labels();\n // Apply default event emitters to selection\n this.label_texts.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n // Extend mouse behaviors to labels\n this.applyBehaviors(this.label_texts);\n }\n \n };\n\n // Method to set a passed element as the LD reference in the plot-level state\n this.makeLDReference = function(element){\n var ref = null;\n if (typeof element == \"undefined\"){\n throw(\"makeLDReference requires one argument of any type\");\n } else if (typeof element == \"object\"){\n if (this.layout.id_field && typeof element[this.layout.id_field] != \"undefined\"){\n ref = element[this.layout.id_field].toString();\n } else if (typeof element[\"id\"] != \"undefined\"){\n ref = element[\"id\"].toString();\n } else {\n ref = element.toString();\n }\n } else {\n ref = element.toString();\n }\n this.parent_plot.applyState({ ldrefvar: ref });\n };\n \n return this;\n\n});\n\n/**\n * A scatter plot in which the x-axis represents categories, rather than individual positions.\n * For example, this can be used by PheWAS plots to show related groups. This plot allows the categories to be\n * determined dynamically when data is first loaded.\n *\n * @class LocusZoom.DataLayers.category_scatter\n * @augments LocusZoom.DataLayers.scatter\n */\nLocusZoom.DataLayers.extend(\"scatter\", \"category_scatter\", {\n /**\n * This plot layer makes certain assumptions about the data passed in. Transform the raw array of records from\n * the datasource to prepare it for plotting, as follows:\n * 1. The scatter plot assumes that all records are given in sequence (pre-grouped by `category_field`)\n * 2. It assumes that all records have an x coordinate for individual plotting\n * @private\n */\n _prepareData: function() {\n var xField = this.layout.x_axis.field || \"x\";\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n if (!category_field) {\n throw \"Layout for \" + this.layout.id + \" must specify category_field\";\n }\n // Sort the data so that things in the same category are adjacent (case-insensitive by specified field)\n var sourceData = this.data\n .sort(function(a, b) {\n var ak = a[category_field];\n var bk = b[category_field];\n var av = ak.toString ? ak.toString().toLowerCase() : ak;\n var bv = bk.toString ? bk.toString().toLowerCase() : bk;\n return (av === bv) ? 0 : (av < bv ? -1 : 1);});\n sourceData.forEach(function(d, i){\n // Implementation detail: Scatter plot requires specifying an x-axis value, and most datasources do not\n // specify plotting positions. If a point is missing this field, fill in a synthetic value.\n d[xField] = d[xField] || i;\n });\n return sourceData;\n },\n\n /**\n * Identify the unique categories on the plot, and update the layout with an appropriate color scheme.\n * Also identify the min and max x value associated with the category, which will be used to generate ticks\n * @private\n * @returns {Object.} Series of entries used to build category name ticks {category_name: [min_x, max_x]}\n */\n _generateCategoryBounds: function() {\n // TODO: API may return null values in category_field; should we add placeholder category label?\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n var xField = this.layout.x_axis.field || \"x\";\n var uniqueCategories = {};\n this.data.forEach(function(item) {\n var category = item[category_field];\n var x = item[xField];\n var bounds = uniqueCategories[category] || [x, x];\n uniqueCategories[category] = [Math.min(bounds[0], x), Math.max(bounds[1], x)];\n });\n\n var categoryNames = Object.keys(uniqueCategories);\n this._setDynamicColorScheme(categoryNames);\n\n return uniqueCategories;\n },\n\n /**\n * Automatically define a color scheme for the layer based on data returned from the server.\n * If part of the color scheme has been specified, it will fill in remaining missing information.\n *\n * There are three scenarios:\n * 1. The layout does not specify either category names or (color) values. Dynamically build both based on\n * the data and update the layout.\n * 2. The layout specifies colors, but not categories. Use that exact color information provided, and dynamically\n * determine what categories are present in the data. (cycle through the available colors, reusing if there\n * are a lot of categories)\n * 3. The layout specifies exactly what colors and categories to use (and they match the data!). This is useful to\n * specify an explicit mapping between color scheme and category names, when you want to be sure that the\n * plot matches a standard color scheme.\n * (If the layout specifies categories that do not match the data, the user specified categories will be ignored)\n *\n * This method will only act if the layout defines a `categorical_bin` scale function for coloring. It may be\n * overridden in a subclass to suit other types of coloring methods.\n *\n * @param {String[]} categoryNames\n * @private\n */\n _setDynamicColorScheme: function(categoryNames) {\n var colorParams = this.layout.color.parameters;\n var baseParams = this._base_layout.color.parameters;\n\n // If the layout does not use a supported coloring scheme, or is already complete, this method should do nothing\n if (this.layout.color.scale_function !== \"categorical_bin\") {\n throw \"This layer requires that coloring be specified as a `categorical_bin`\";\n }\n\n if (baseParams.categories.length && baseParams.values.length) {\n // If there are preset category/color combos, make sure that they apply to the actual dataset\n var parameters_categories_hash = {};\n baseParams.categories.forEach(function (category) { parameters_categories_hash[category] = 1; });\n if (categoryNames.every(function (name) { return parameters_categories_hash.hasOwnProperty(name); })) {\n // The layout doesn't have to specify categories in order, but make sure they are all there\n colorParams.categories = baseParams.categories;\n } else {\n colorParams.categories = categoryNames;\n }\n } else {\n colorParams.categories = categoryNames;\n }\n // Prefer user-specified colors if provided. Make sure that there are enough colors for all the categories.\n var colors;\n if (baseParams.values.length) {\n colors = baseParams.values;\n } else {\n var color_scale = categoryNames.length <= 10 ? d3.scale.category10 : d3.scale.category20;\n colors = color_scale().range();\n }\n while (colors.length < categoryNames.length) { colors = colors.concat(colors); }\n colors = colors.slice(0, categoryNames.length); // List of hex values, should be of same length as categories array\n colorParams.values = colors;\n },\n\n /**\n *\n * @param dimension\n * @param {Object} [config] Parameters that customize how ticks are calculated (not style)\n * @param {('left'|'center'|'right')} [config.position='left'] Align ticks with the center or edge of category\n * @returns {Array}\n */\n getTicks: function(dimension, config) { // Overrides parent method\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw \"Invalid dimension identifier\";\n }\n var position = config.position || \"left\";\n if ([\"left\", \"center\", \"right\"].indexOf(position) === -1) {\n throw \"Invalid tick position\";\n }\n\n var categoryBounds = this._categories;\n if (!categoryBounds || !Object.keys(categoryBounds).length) {\n return [];\n }\n\n if (dimension === \"y\") {\n return [];\n }\n\n if (dimension === \"x\") {\n // If colors have been defined by this layer, use them to make tick colors match scatterplot point colors\n var knownCategories = this.layout.color.parameters.categories || [];\n var knownColors = this.layout.color.parameters.values || [];\n\n return Object.keys(categoryBounds).map(function (category, index) {\n var bounds = categoryBounds[category];\n var xPos;\n\n switch(position) {\n case \"left\":\n xPos = bounds[0];\n break;\n case \"center\":\n // Center tick under one or many elements as appropriate\n var diff = bounds[1] - bounds[0];\n xPos = bounds[0] + (diff !== 0 ? diff : bounds[0]) / 2;\n break;\n case \"right\":\n xPos = bounds[1];\n break;\n }\n return {\n x: xPos,\n text: category,\n style: {\n \"fill\": knownColors[knownCategories.indexOf(category)] || \"#000000\"\n }\n };\n });\n }\n },\n\n applyCustomDataMethods: function() {\n this.data = this._prepareData();\n /**\n * Define category names and extents (boundaries) for plotting. TODO: properties in constructor\n * @member {Object.} Category names and extents, in the form {category_name: [min_x, max_x]}\n */\n this._categories = this._generateCategoryBounds();\n return this;\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n *\n * LocusZoom has various singleton objects that are used for registering functions or classes.\n * These objects provide safe, standard methods to redefine or delete existing functions/classes\n * as well as define new custom functions/classes to be used in a plot.\n *\n * @namespace Singletons\n */\n\n\n/*\n * The Collection of \"Known\" Data Sources. This registry is used internally by the `DataSources` class\n * @class\n * @static\n */\nLocusZoom.KnownDataSources = (function() {\n /** @lends LocusZoom.KnownDataSources */\n var obj = {};\n /* @member {function[]} */\n var sources = [];\n\n var findSourceByName = function(x) {\n for(var i=0; i 1) {\n return function(x) {\n var val = x;\n for(var i = 0; i 1) {\n log = Math.ceil(Math.log(abs) / Math.LN10);\n } else { // 0...1\n log = Math.floor(Math.log(abs) / Math.LN10);\n }\n if (Math.abs(log) <= 3){\n return x.toFixed(3);\n } else {\n return x.toExponential(2).replace(\"+\", \"\").replace(\"e\", \" × 10^\");\n }\n});\n\n/**\n * URL-encode the provided text, eg for constructing hyperlinks\n * @function urlencode\n * @param {String} str\n */\nLocusZoom.TransformationFunctions.add(\"urlencode\", function(str) {\n return encodeURIComponent(str);\n});\n\n/**\n * HTML-escape user entered values for use in constructed HTML fragments\n *\n * For example, this filter can be used on tooltips with custom HTML display\n * @function htmlescape\n * @param {String} str HTML-escape the provided value\n */\nLocusZoom.TransformationFunctions.add(\"htmlescape\", function(str) {\n if ( !str ) {\n return \"\";\n }\n str = str + \"\";\n\n return str.replace( /['\"<>&`]/g, function( s ) {\n switch ( s ) {\n case \"'\":\n return \"'\";\n case \"\\\"\":\n return \""\";\n case \"<\":\n return \"<\";\n case \">\":\n return \">\";\n case \"&\":\n return \"&\";\n case \"`\":\n return \"`\";\n }\n });\n});\n\n/**\n * Singleton for accessing/storing functions that will convert arbitrary data points to values in a given scale\n * Useful for anything that needs to scale discretely with data (e.g. color, point size, etc.)\n *\n * A Scale Function can be thought of as a modifier to a layout directive that adds extra logic to how a piece of data\n * can be resolved to a value.\n *\n * All scale functions must accept an object of parameters and a value to process.\n * @class\n * @static\n */\nLocusZoom.ScaleFunctions = (function() {\n /** @lends LocusZoom.ScaleFunctions */\n var obj = {};\n var functions = {};\n\n /**\n * Find a scale function and return it. If parameters and values are passed, calls the function directly; otherwise\n * returns a callable.\n * @param {String} name\n * @param {Object} [parameters] Configuration parameters specific to the specified scale function\n * @param {*} [value] The value to operate on\n * @returns {*}\n */\n obj.get = function(name, parameters, value) {\n if (!name) {\n return null;\n } else if (functions[name]) {\n if (typeof parameters === \"undefined\" && typeof value === \"undefined\"){\n return functions[name];\n } else {\n return functions[name](parameters, value);\n }\n } else {\n throw(\"scale function [\" + name + \"] not found\");\n }\n };\n\n /**\n * @protected\n * @param {String} name The name of the function to set/unset\n * @param {Function} [fn] The function to register. If blank, removes this function name from the registry.\n */\n obj.set = function(name, fn) {\n if (fn) {\n functions[name] = fn;\n } else {\n delete functions[name];\n }\n };\n\n /**\n * Add a new scale function to the registry\n * @param {String} name The name of the scale function\n * @param {function} fn A scale function that accepts two parameters: an object of configuration and a value\n */\n obj.add = function(name, fn) {\n if (functions[name]) {\n throw(\"scale function already exists with name: \" + name);\n } else {\n obj.set(name, fn);\n }\n };\n\n /**\n * List the names of all registered scale functions\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(functions);\n };\n\n return obj;\n})();\n\n/**\n * Basic conditional function to evaluate the value of the input field and return based on equality.\n * @param {Object} parameters\n * @param {*} parameters.field_value The value against which to test the input value.\n * @param {*} parameters.then The value to return if the input value matches the field value\n * @param {*} parameters.else The value to return if the input value does not match the field value. Optional. If not\n * defined this scale function will return null (or value of null_value parameter, if defined) when input value fails\n * to match field_value.\n * @param {*} input value\n */\nLocusZoom.ScaleFunctions.add(\"if\", function(parameters, input){\n if (typeof input == \"undefined\" || parameters.field_value !== input){\n if (typeof parameters.else != \"undefined\"){\n return parameters.else;\n } else {\n return null;\n }\n } else {\n return parameters.then;\n }\n});\n\n/**\n * Function to sort numerical values into bins based on numerical break points. Will only operate on numbers and\n * return null (or value of null_value parameter, if defined) if provided a non-numeric input value. Parameters:\n * @function numerical_bin\n * @param {Object} parameters\n * @param {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter. If the input value is greater than or equal to break n and less than\n * or equal to break n+1 (or break n+1 doesn't exist) then returned value is the nth entry in the values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against break points. Must be of\n * equal length to breaks parameter. Each entry n represents the value to return if the input value is greater than\n * or equal to break n and less than or equal to break n+1 (or break n+1 doesn't exist).\n * @param {*} null_value\n * @param {*} input value\n * @returns\n */\nLocusZoom.ScaleFunctions.add(\"numerical_bin\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){\n return (parameters.null_value ? parameters.null_value : null);\n }\n var threshold = breaks.reduce(function(prev, curr){\n if (+input < prev || (+input >= prev && +input < curr)){\n return prev;\n } else {\n return curr;\n }\n });\n return values[breaks.indexOf(threshold)];\n});\n\n/**\n * Function to sort values of any type into bins based on direct equality testing with a list of categories.\n * Will return null if provided an input value that does not match to a listed category.\n * @function categorical_bin\n * @param {Object} parameters\n * @param {Array} parameters.categories Array of values against which to evaluate the input value. Must be of equal\n * length to values parameter. If the input value is equal to category n then returned value is the nth entry in the\n * values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against categories. Must be of equal\n * length to categories parameter. Each entry n represents the value to return if the input value is equal to the nth\n * value in the categories parameter.\n * @param {*} parameters.null_value Value to return if the input value fails to match to any categories. Optional.\n */\nLocusZoom.ScaleFunctions.add(\"categorical_bin\", function(parameters, value){\n if (typeof value == \"undefined\" || parameters.categories.indexOf(value) === -1){\n return (parameters.null_value ? parameters.null_value : null); \n } else {\n return parameters.values[parameters.categories.indexOf(value)];\n }\n});\n\n/**\n * Function for continuous interpolation of numerical values along a gradient with arbitrarily many break points.\n * @function interpolate\n * @parameters {Object} parameters\n * @parameters {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter and contain at least two elements. Input value will be evaluated for\n * relative position between two break points n and n+1 and the returned value will be interpolated at a relative\n * position between values n and n+1.\n * @parameters {*[]} parameters.values Array of values to interpolate and return given evaluations against break\n * points. Must be of equal length to breaks parameter and contain at least two elements. Each entry n represents\n * the value to return if the input value matches the nth entry in breaks exactly. Note that this scale function\n * uses d3.interpolate to provide for effective interpolation of many different value types, including numbers,\n * colors, shapes, etc.\n * @parameters {*} parameters.null_value\n */\nLocusZoom.ScaleFunctions.add(\"interpolate\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n var nullval = (parameters.null_value ? parameters.null_value : null);\n if (breaks.length < 2 || breaks.length !== values.length){ return nullval; }\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){ return nullval; }\n if (+input <= parameters.breaks[0]){\n return values[0];\n } else if (+input >= parameters.breaks[parameters.breaks.length-1]){\n return values[breaks.length-1];\n } else {\n var upper_idx = null;\n breaks.forEach(function(brk, idx){\n if (!idx){ return; }\n if (breaks[idx-1] <= +input && breaks[idx] >= +input){ upper_idx = idx; }\n });\n if (upper_idx === null){ return nullval; }\n var normalized_input = (+input - breaks[upper_idx-1]) / (breaks[upper_idx] - breaks[upper_idx-1]);\n if (!isFinite(normalized_input)){ return nullval; }\n return d3.interpolate(values[upper_idx-1], values[upper_idx])(normalized_input);\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A Dashboard is an HTML element used for presenting arbitrary user interface components. Dashboards are anchored\n * to either the entire Plot or to individual Panels.\n *\n * Each dashboard is an HTML-based (read: not SVG) collection of components used to display information or provide\n * user interface. Dashboards can exist on entire plots, where their visibility is permanent and vertically adjacent\n * to the plot, or on individual panels, where their visibility is tied to a behavior (e.g. a mouseover) and is as\n * an overlay.\n * @class\n */\nLocusZoom.Dashboard = function(parent){\n // parent must be a locuszoom plot or panel\n if (!(parent instanceof LocusZoom.Plot) && !(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create dashboard, parent must be a locuszoom plot or panel\";\n }\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".dashboard\";\n /** @member {('plot'|'panel')} */\n this.type = (this.parent instanceof LocusZoom.Plot) ? \"plot\" : \"panel\";\n /** @member {LocusZoom.Plot} */\n this.parent_plot = this.type === \"plot\" ? this.parent : this.parent.parent;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {LocusZoom.Dashboard.Component[]} */\n this.components = [];\n /**\n * The timer identifier as returned by setTimeout\n * @member {Number}\n */\n this.hide_timeout = null;\n /**\n * Whether to hide the dashboard. Can be overridden by a child component. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n\n // TODO: Return value from constructor function?\n return this.initialize();\n};\n\n/**\n * Prepare the dashboard for first use: generate all component instances for this dashboard, based on the provided\n * layout of the parent. Connects event listeners and shows/hides as appropriate.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.initialize = function() {\n // Parse layout to generate component instances\n if (Array.isArray(this.parent.layout.dashboard.components)){\n this.parent.layout.dashboard.components.forEach(function(layout){\n try {\n var component = LocusZoom.Dashboard.Components.get(layout.type, layout, this);\n this.components.push(component);\n } catch (e) {\n console.warn(e);\n }\n }.bind(this));\n }\n\n // Add mouseover event handlers to show/hide panel dashboard\n if (this.type === \"panel\"){\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseover.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n if (!this.selector || this.selector.style(\"visibility\") === \"hidden\"){ this.show(); }\n }.bind(this));\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseout.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n this.hide_timeout = setTimeout(function(){ this.hide(); }.bind(this), 300);\n }.bind(this));\n }\n\n return this;\n\n};\n\n/**\n * Whether to persist the dashboard. Returns true if at least one component should persist, or if the panel is engaged\n * in an active drag event.\n * @returns {boolean}\n */\nLocusZoom.Dashboard.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n var persist = false;\n // Persist if at least one component should also persist\n this.components.forEach(function(component){\n persist = persist || component.shouldPersist();\n });\n // Persist if in a parent drag event\n persist = persist || (this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.dragging);\n return !!persist;\n};\n\n/**\n * Make the dashboard appear. If it doesn't exist yet create it, including creating/positioning all components within,\n * and make sure it is set to be visible.\n */\nLocusZoom.Dashboard.prototype.show = function(){\n if (!this.selector){\n switch (this.type){\n case \"plot\":\n this.selector = d3.select(this.parent.svg.node().parentNode)\n .insert(\"div\",\":first-child\");\n break;\n case \"panel\":\n this.selector = d3.select(this.parent.parent.svg.node().parentNode)\n .insert(\"div\", \".lz-data_layer-tooltip, .lz-dashboard-menu, .lz-curtain\").classed(\"lz-panel-dashboard\", true);\n break;\n }\n this.selector.classed(\"lz-dashboard\", true).classed(\"lz-\"+this.type+\"-dashboard\", true).attr(\"id\", this.id);\n }\n this.components.forEach(function(component){ component.show(); });\n this.selector.style({ visibility: \"visible\" });\n return this.update();\n};\n\n/**\n * Update the dashboard and rerender all child components. This can be called whenever plot state changes.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.update = function(){\n if (!this.selector){ return this; }\n this.components.forEach(function(component){ component.update(); });\n return this.position();\n};\n\n/**\n * Position the dashboard (and child components) within the panel\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.position = function(){\n if (!this.selector){ return this; }\n // Position the dashboard itself (panel only)\n if (this.type === \"panel\"){\n var page_origin = this.parent.getPageOrigin();\n var top = (page_origin.y + 3.5).toString() + \"px\";\n var left = page_origin.x.toString() + \"px\";\n var width = (this.parent.layout.width - 4).toString() + \"px\";\n this.selector.style({ position: \"absolute\", top: top, left: left, width: width });\n }\n // Recursively position components\n this.components.forEach(function(component){ component.position(); });\n return this;\n};\n\n/**\n * Hide the dashboard (make invisible but do not destroy). Will do nothing if `shouldPersist` returns true.\n *\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n this.components.forEach(function(component){ component.hide(); });\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n\n/**\n * Completely remove dashboard and all child components. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n this.components.forEach(function(component){ component.destroy(true); });\n this.components = [];\n this.selector.remove();\n this.selector = null;\n return this;\n};\n\n/**\n *\n * A dashboard component is an empty div rendered on a dashboard that can display custom\n * html of user interface elements. LocusZoom.Dashboard.Components is a singleton used to\n * define and manage an extendable collection of dashboard components.\n * (e.g. by LocusZoom.Dashboard.Components.add())\n * @class\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @param {('left'|'right')} [layout.position='left'] Whether to float the component left or right.\n * @param {('start'|'middle'|'end')} [layout.group_position] Buttons can optionally be gathered into a visually\n * distinctive group whose elements are closer together. If a button is identified as the start or end of a group,\n * it will be drawn with rounded corners and an extra margin of spacing from any button not part of the group.\n * For example, the region_nav_plot dashboard is a defined as a group.\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple'} [layout.color='gray'] Color scheme for the\n * component. Applies to buttons and menus.\n * @param {LocusZoom.Dashboard} parent The dashboard that contains this component\n*/\nLocusZoom.Dashboard.Component = function(layout, parent) {\n /** @member {Object} */\n this.layout = layout || {};\n if (!this.layout.color){ this.layout.color = \"gray\"; }\n\n /** @member {LocusZoom.Dashboard|*} */\n this.parent = parent || null;\n /**\n * Some dashboards are attached to a panel, rather than directly to a plot\n * @member {LocusZoom.Panel|null}\n */\n this.parent_panel = null;\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n /**\n * This is a reference to either the panel or the plot, depending on what the dashboard is\n * tied to. Useful when absolutely positioning dashboard components relative to their SVG anchor.\n * @member {LocusZoom.Plot|LocusZoom.Panel}\n */\n this.parent_svg = null;\n if (this.parent instanceof LocusZoom.Dashboard){\n // TODO: when is the immediate parent *not* a dashboard?\n if (this.parent.type === \"panel\"){\n this.parent_panel = this.parent.parent;\n this.parent_plot = this.parent.parent.parent;\n this.parent_svg = this.parent_panel;\n } else {\n this.parent_plot = this.parent.parent;\n this.parent_svg = this.parent_plot;\n }\n }\n /** @member {d3.selection} */\n this.selector = null;\n /**\n * If this is an interactive component, it will contain a button or menu instance that handles the interactivity.\n * There is a 1-to-1 relationship of dashboard component to button\n * @member {null|LocusZoom.Dashboard.Component.Button}\n */\n this.button = null;\n /**\n * If any single component is marked persistent, it will bubble up to prevent automatic hide behavior on a\n * component's parent dashboard. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n if (!this.layout.position){ this.layout.position = \"left\"; }\n\n // TODO: Return value in constructor\n return this;\n};\n/**\n * Perform all rendering of component, including toggling visibility to true. Will initialize and create SVG element\n * if necessary, as well as updating with new data and performing layout actions.\n */\nLocusZoom.Dashboard.Component.prototype.show = function(){\n if (!this.parent || !this.parent.selector){ return; }\n if (!this.selector){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.layout.group_position) !== -1 ? \" lz-dashboard-group-\" + this.layout.group_position : \"\");\n this.selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-\" + this.layout.position + group_position);\n if (this.layout.style){ this.selector.style(this.layout.style); }\n if (typeof this.initialize == \"function\"){ this.initialize(); }\n }\n if (this.button && this.button.status === \"highlighted\"){ this.button.menu.show(); }\n this.selector.style({ visibility: \"visible\" });\n this.update();\n return this.position();\n};\n/**\n * Update the dashboard component with any new data or plot state as appropriate. This method performs all\n * necessary rendering steps.\n */\nLocusZoom.Dashboard.Component.prototype.update = function(){ /* stub */ };\n/**\n * Place the component correctly in the plot\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.position = function(){\n if (this.button){ this.button.menu.position(); }\n return this;\n};\n/**\n * Determine whether the component should persist (will bubble up to parent dashboard)\n * @returns {boolean}\n */\nLocusZoom.Dashboard.Component.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n if (this.button && this.button.persist){ return true; }\n return false;\n};\n/**\n * Toggle visibility to hidden, unless marked as persistent\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n if (this.button){ this.button.menu.hide(); }\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n/**\n * Completely remove component and button. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.Component.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n if (this.button && this.button.menu){ this.button.menu.destroy(); }\n this.selector.remove();\n this.selector = null;\n this.button = null;\n return this;\n};\n\n/**\n * Singleton registry of all known components\n * @class\n * @static\n */\nLocusZoom.Dashboard.Components = (function() {\n /** @lends LocusZoom.Dashboard.Components */\n var obj = {};\n var components = {};\n\n /**\n * Create a new component instance by name\n * @param {String} name The string identifier of the desired component\n * @param {Object} layout The layout to use to create the component\n * @param {LocusZoom.Dashboard} parent The containing dashboard to use when creating the component\n * @returns {LocusZoom.Dashboard.Component}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (components[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for dashboard component [\" + name + \"]\");\n } else {\n return new components[name](layout, parent);\n }\n } else {\n throw(\"dashboard component [\" + name + \"] not found\");\n }\n };\n /**\n * Add a new component constructor to the registry and ensure that it extends the correct parent class\n * @protected\n * @param name\n * @param component\n */\n obj.set = function(name, component) {\n if (component) {\n if (typeof component != \"function\"){\n throw(\"unable to set dashboard component [\" + name + \"], argument provided is not a function\");\n } else {\n components[name] = component;\n components[name].prototype = new LocusZoom.Dashboard.Component();\n }\n } else {\n delete components[name];\n }\n };\n\n /**\n * Register a new component constructor by name\n * @param {String} name\n * @param {function} component The component constructor\n */\n obj.add = function(name, component) {\n if (components[name]) {\n throw(\"dashboard component already exists with name: \" + name);\n } else {\n obj.set(name, component);\n }\n };\n\n /**\n * List the names of all registered components\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(components);\n };\n\n return obj;\n})();\n\n/**\n * Plots and panels may have a \"dashboard\" element suited for showing HTML components that may be interactive.\n * When components need to incorporate a generic button, or additionally a button that generates a menu, this\n * class provides much of the necessary framework.\n * @class\n * @param {LocusZoom.Dashboard.Component} parent\n */\nLocusZoom.Dashboard.Component.Button = function(parent) { \n \n if (!(parent instanceof LocusZoom.Dashboard.Component)){\n throw \"Unable to create dashboard component button, invalid parent\";\n }\n /** @member {LocusZoom.Dashboard.Component} */\n this.parent = parent;\n /** @member {LocusZoom.Dashboard.Panel} */\n this.parent_panel = this.parent.parent_panel;\n /** @member {LocusZoom.Dashboard.Plot} */\n this.parent_plot = this.parent.parent_plot;\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent_svg = this.parent.parent_svg;\n\n /** @member {LocusZoom.Dashboard|null|*} */\n this.parent_dashboard = this.parent.parent;\n /** @member {d3.selection} */\n this.selector = null;\n\n /**\n * Tag to use for the button (default: a)\n * @member {String}\n */\n this.tag = \"a\";\n\n /**\n * TODO This method does not appear to be used anywhere\n * @param {String} tag\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTag = function(tag){\n if (typeof tag != \"undefined\"){ this.tag = tag.toString(); }\n return this;\n };\n\n /**\n * HTML for the button to show.\n * @protected\n * @member {String}\n */\n this.html = \"\";\n /**\n * Specify the HTML content of this button.\n * WARNING: The string provided will be inserted into the document as raw markup; XSS mitigation is the\n * responsibility of each button implementation.\n * @param {String} html\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setHtml = function(html){\n if (typeof html != \"undefined\"){ this.html = html.toString(); }\n return this;\n };\n /**\n * @deprecated since 0.5.6; use setHTML instead\n */\n this.setText = this.setHTML;\n\n /**\n * Mouseover title text for the button to show\n * @protected\n * @member {String}\n */\n this.title = \"\";\n /**\n * Set the mouseover title text for the button (if any)\n * @param {String} title Simple text to display\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTitle = function(title){\n if (typeof title != \"undefined\"){ this.title = title.toString(); }\n return this;\n };\n\n /**\n * Color of the button\n * @member {String}\n */\n this.color = \"gray\";\n\n /**\n * Set the color associated with this button\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple')} color Any selection not in the preset list\n * will be replaced with gray.\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setColor = function(color){\n if (typeof color != \"undefined\"){\n if ([\"gray\", \"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"purple\"].indexOf(color) !== -1){ this.color = color; }\n else { this.color = \"gray\"; }\n }\n return this;\n };\n\n /**\n * Hash of arbitrary button styles to apply as {name: value} entries\n * @protected\n * @member {Object}\n */\n this.style = {};\n /**\n * Set a collection of custom styles to be used by the button\n * @param {Object} style Hash of {name:value} entries\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setStyle = function(style){\n if (typeof style != \"undefined\"){ this.style = style; }\n return this;\n };\n\n //\n /**\n * Method to generate a CSS class string\n * @returns {string}\n */\n this.getClass = function(){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.parent.layout.group_position) !== -1 ? \" lz-dashboard-button-group-\" + this.parent.layout.group_position : \"\");\n return \"lz-dashboard-button lz-dashboard-button-\" + this.color + (this.status ? \"-\" + this.status : \"\") + group_position;\n };\n\n // Permanence\n /**\n * Track internal state on whether to keep showing the button/ menu contents at the moment\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n /**\n * Configuration when defining a button: track whether this component should be allowed to keep open\n * menu/button contents in response to certain events\n * @protected\n * @member {Boolean}\n */\n this.permanent = false;\n /**\n * Allow code to change whether the button is allowed to be `permanent`\n * @param {boolean} bool\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setPermanent = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n this.permanent = bool;\n if (this.permanent){ this.persist = true; }\n return this;\n };\n /**\n * Determine whether the button/menu contents should persist in response to a specific event\n * @returns {Boolean}\n */\n this.shouldPersist = function(){\n return this.permanent || this.persist;\n };\n\n /**\n * Button status (highlighted / disabled/ etc)\n * @protected\n * @member {String}\n */\n this.status = \"\";\n /**\n * Change button state\n * @param {('highlighted'|'disabled'|'')} status\n */\n this.setStatus = function(status){\n if (typeof status != \"undefined\" && [\"\", \"highlighted\", \"disabled\"].indexOf(status) !== -1){ this.status = status; }\n return this.update();\n };\n /**\n * Toggle whether the button is highlighted\n * @param {boolean} bool If provided, explicitly set highlighted state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.highlight = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"highlighted\"); }\n else if (this.status === \"highlighted\"){ return this.setStatus(\"\"); }\n return this;\n };\n /**\n * Toggle whether the button is disabled\n * @param {boolean} bool If provided, explicitly set disabled state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.disable = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"disabled\"); }\n else if (this.status === \"disabled\"){ return this.setStatus(\"\"); }\n return this;\n };\n\n // Mouse events\n /** @member {function} */\n this.onmouseover = function(){};\n this.setOnMouseover = function(onmouseover){\n if (typeof onmouseover == \"function\"){ this.onmouseover = onmouseover; }\n else { this.onmouseover = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onmouseout = function(){};\n this.setOnMouseout = function(onmouseout){\n if (typeof onmouseout == \"function\"){ this.onmouseout = onmouseout; }\n else { this.onmouseout = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onclick = function(){};\n this.setOnclick = function(onclick){\n if (typeof onclick == \"function\"){ this.onclick = onclick; }\n else { this.onclick = function(){}; }\n return this;\n };\n \n // Primary behavior functions\n /**\n * Show the button, including creating DOM elements if necessary for first render\n */\n this.show = function(){\n if (!this.parent){ return; }\n if (!this.selector){\n this.selector = this.parent.selector.append(this.tag).attr(\"class\", this.getClass());\n }\n return this.update();\n };\n /**\n * Hook for any actions or state cleanup to be performed before rerendering\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.preUpdate = function(){ return this; };\n /**\n * Update button state and contents, and fully rerender\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.update = function(){\n if (!this.selector){ return this; }\n this.preUpdate();\n this.selector\n .attr(\"class\", this.getClass())\n .attr(\"title\", this.title).style(this.style)\n .on(\"mouseover\", (this.status === \"disabled\") ? null : this.onmouseover)\n .on(\"mouseout\", (this.status === \"disabled\") ? null : this.onmouseout)\n .on(\"click\", (this.status === \"disabled\") ? null : this.onclick)\n .html(this.html);\n this.menu.update();\n this.postUpdate();\n return this;\n };\n /**\n * Hook for any behavior to be added/changed after the button has been re-rendered\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.postUpdate = function(){ return this; };\n /**\n * Hide the button by removing it from the DOM (may be overridden by current persistence setting)\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.hide = function(){\n if (this.selector && !this.shouldPersist()){\n this.selector.remove();\n this.selector = null;\n }\n return this;\n }; \n\n /**\n * Button Menu Object\n * The menu is an HTML overlay that can appear below a button. It can contain arbitrary HTML and\n * has logic to be automatically positioned and sized to behave more or less like a dropdown menu.\n * @member {Object}\n */\n this.menu = {\n outer_selector: null,\n inner_selector: null,\n scroll_position: 0,\n hidden: true,\n /**\n * Show the button menu, including setting up any DOM elements needed for first rendering\n */\n show: function(){\n if (!this.menu.outer_selector){\n this.menu.outer_selector = d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu lz-dashboard-menu-\" + this.color)\n .attr(\"id\", this.parent_svg.getBaseId() + \".dashboard.menu\");\n this.menu.inner_selector = this.menu.outer_selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu-content\");\n this.menu.inner_selector.on(\"scroll\", function(){\n this.menu.scroll_position = this.menu.inner_selector.node().scrollTop;\n }.bind(this));\n }\n this.menu.outer_selector.style({ visibility: \"visible\" });\n this.menu.hidden = false;\n return this.menu.update();\n }.bind(this),\n /**\n * Update the rendering of the menu\n */\n update: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.populate(); // This function is stubbed for all buttons by default and custom implemented in component definition\n if (this.menu.inner_selector){ this.menu.inner_selector.node().scrollTop = this.menu.scroll_position; }\n return this.menu.position();\n }.bind(this),\n position: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n // Unset any explicitly defined outer selector height so that menus dynamically shrink if content is removed\n this.menu.outer_selector.style({ height: null });\n var padding = 3;\n var scrollbar_padding = 20;\n var menu_height_padding = 14; // 14: 2x 6px padding, 2x 1px border\n var page_origin = this.parent_svg.getPageOrigin();\n var page_scroll_top = document.documentElement.scrollTop || document.body.scrollTop;\n var container_offset = this.parent_plot.getContainerOffset();\n var dashboard_client_rect = this.parent_dashboard.selector.node().getBoundingClientRect();\n var button_client_rect = this.selector.node().getBoundingClientRect();\n var menu_client_rect = this.menu.outer_selector.node().getBoundingClientRect();\n var total_content_height = this.menu.inner_selector.node().scrollHeight;\n var top = 0; var left = 0;\n if (this.parent_dashboard.type === \"panel\"){\n top = (page_origin.y + dashboard_client_rect.height + (2 * padding));\n left = Math.max(page_origin.x + this.parent_svg.layout.width - menu_client_rect.width - padding, page_origin.x + padding);\n } else {\n top = button_client_rect.bottom + page_scroll_top + padding - container_offset.top;\n left = Math.max(button_client_rect.left + button_client_rect.width - menu_client_rect.width - container_offset.left, page_origin.x + padding);\n }\n var base_max_width = Math.max(this.parent_svg.layout.width - (2 * padding) - scrollbar_padding, scrollbar_padding);\n var container_max_width = base_max_width;\n var content_max_width = (base_max_width - (4 * padding));\n var base_max_height = Math.max(this.parent_svg.layout.height - (10 * padding) - menu_height_padding, menu_height_padding);\n var height = Math.min(total_content_height, base_max_height);\n var max_height = base_max_height;\n this.menu.outer_selector.style({\n \"top\": top.toString() + \"px\",\n \"left\": left.toString() + \"px\",\n \"max-width\": container_max_width.toString() + \"px\",\n \"max-height\": max_height.toString() + \"px\",\n \"height\": height.toString() + \"px\"\n });\n this.menu.inner_selector.style({ \"max-width\": content_max_width.toString() + \"px\" });\n this.menu.inner_selector.node().scrollTop = this.menu.scroll_position;\n return this.menu;\n }.bind(this),\n hide: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.outer_selector.style({ visibility: \"hidden\" });\n this.menu.hidden = true;\n return this.menu;\n }.bind(this),\n destroy: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.inner_selector.remove();\n this.menu.outer_selector.remove();\n this.menu.inner_selector = null;\n this.menu.outer_selector = null;\n return this.menu;\n }.bind(this),\n /**\n * Internal method definition\n * By convention populate() does nothing and should be reimplemented with each dashboard button definition\n * Reimplement by way of Dashboard.Component.Button.menu.setPopulate to define the populate method and hook\n * up standard menu click-toggle behavior prototype.\n * @protected\n */\n populate: function(){ /* stub */ }.bind(this),\n /**\n * Define how the menu is populated with items, and set up click and display properties as appropriate\n * @public\n */\n setPopulate: function(menu_populate_function){\n if (typeof menu_populate_function == \"function\"){\n this.menu.populate = menu_populate_function;\n this.setOnclick(function(){\n if (this.menu.hidden){\n this.menu.show();\n this.highlight().update();\n this.persist = true;\n } else {\n this.menu.hide();\n this.highlight(false).update();\n if (!this.permanent){ this.persist = false; }\n }\n }.bind(this));\n } else {\n this.setOnclick();\n }\n return this;\n }.bind(this)\n };\n\n};\n\n/**\n * Renders arbitrary text with title formatting\n * @class LocusZoom.Dashboard.Components.title\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.title Text to render\n */\nLocusZoom.Dashboard.Components.add(\"title\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.show = function(){\n this.div_selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-title lz-dashboard-\" + this.layout.position);\n this.title_selector = this.div_selector.append(\"h3\");\n return this.update();\n };\n this.update = function(){\n var title = layout.title.toString();\n if (this.layout.subtitle){ title += \" \" + this.layout.subtitle + \"\"; }\n this.title_selector.html(title);\n return this;\n };\n});\n\n/**\n * Renders text to display the current dimensions of the plot. Automatically updated as plot dimensions change\n * @class LocusZoom.Dashboard.Components.dimensions\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"dimensions\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var display_width = this.parent_plot.layout.width.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.width : this.parent_plot.layout.width.toFixed(2);\n var display_height = this.parent_plot.layout.height.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.height : this.parent_plot.layout.height.toFixed(2);\n this.selector.html(display_width + \"px × \" + display_height + \"px\");\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Display the current scale of the genome region displayed in the plot, as defined by the difference between\n * `state.end` and `state.start`.\n * @class LocusZoom.Dashboard.Components.region_scale\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"region_scale\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (!isNaN(this.parent_plot.state.start) && !isNaN(this.parent_plot.state.end)\n && this.parent_plot.state.start !== null && this.parent_plot.state.end !== null){\n this.selector.style(\"display\", null);\n this.selector.html(LocusZoom.positionIntToString(this.parent_plot.state.end - this.parent_plot.state.start, null, true));\n } else {\n this.selector.style(\"display\", \"none\");\n }\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Button to export current plot to an SVG image\n * @class LocusZoom.Dashboard.Components.download\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"download\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Download Image\").setTitle(\"Download image of the current plot as locuszoom.svg\")\n .setOnMouseover(function() {\n this.button.selector\n .classed(\"lz-dashboard-button-gray-disabled\", true)\n .html(\"Preparing Image\");\n this.generateBase64SVG().then(function(base64_string){\n this.button.selector\n .attr(\"href\", \"data:image/svg+xml;base64,\\n\" + base64_string)\n .classed(\"lz-dashboard-button-gray-disabled\", false)\n .classed(\"lz-dashboard-button-gray-highlighted\", true)\n .html(\"Download Image\");\n }.bind(this));\n }.bind(this))\n .setOnMouseout(function() {\n this.button.selector.classed(\"lz-dashboard-button-gray-highlighted\", false);\n }.bind(this));\n this.button.show();\n this.button.selector.attr(\"href-lang\", \"image/svg+xml\").attr(\"download\", \"locuszoom.svg\");\n return this;\n };\n this.css_string = \"\";\n for (var stylesheet in Object.keys(document.styleSheets)){\n if ( document.styleSheets[stylesheet].href !== null\n && document.styleSheets[stylesheet].href.indexOf(\"locuszoom.css\") !== -1){\n // TODO: \"Download image\" button will render the image incorrectly if the stylesheet has been renamed or concatenated\n LocusZoom.createCORSPromise(\"GET\", document.styleSheets[stylesheet].href)\n .then(function(response){\n this.css_string = response.replace(/[\\r\\n]/g,\" \").replace(/\\s+/g,\" \");\n if (this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\")){\n this.css_string = this.css_string.substring(0, this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\"));\n }\n }.bind(this));\n break;\n }\n } \n this.generateBase64SVG = function(){\n return Q.fcall(function () {\n // Insert a hidden div, clone the node into that so we can modify it with d3\n var container = this.parent.selector.append(\"div\").style(\"display\", \"none\")\n .html(this.parent_plot.svg.node().outerHTML);\n // Remove unnecessary elements\n container.selectAll(\"g.lz-curtain\").remove();\n container.selectAll(\"g.lz-mouse_guide\").remove();\n // Convert units on axis tick dy attributes from ems to pixels\n container.selectAll(\"g.tick text\").each(function(){\n var dy = +(d3.select(this).attr(\"dy\").substring(-2).slice(0,-2))*10;\n d3.select(this).attr(\"dy\", dy);\n });\n // Pull the svg into a string and add the contents of the locuszoom stylesheet\n // Don't add this with d3 because it will escape the CDATA declaration incorrectly\n var initial_html = d3.select(container.select(\"svg\").node().parentNode).html();\n var style_def = \"\";\n var insert_at = initial_html.indexOf(\">\") + 1;\n initial_html = initial_html.slice(0,insert_at) + style_def + initial_html.slice(insert_at);\n // Delete the container node\n container.remove();\n // Base64-encode the string and return it\n return btoa(encodeURIComponent(initial_html).replace(/%([0-9A-F]{2})/g, function(match, p1) {\n return String.fromCharCode(\"0x\" + p1);\n }));\n }.bind(this));\n };\n});\n\n/**\n * Button to remove panel from plot.\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.remove_panel\n * @augments LocusZoom.Dashboard.Component\n * @param {Boolean} [layout.suppress_confirm=false] If true, removes the panel without prompting user for confirmation\n */\nLocusZoom.Dashboard.Components.add(\"remove_panel\", function(layout) {\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function() {\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"×\").setTitle(\"Remove panel\")\n .setOnclick(function(){\n if (!layout.suppress_confirm && !confirm(\"Are you sure you want to remove this panel? This cannot be undone!\")){\n return false;\n }\n var panel = this.parent_panel;\n panel.dashboard.hide(true);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseover.\" + panel.getBaseId() + \".dashboard\", null);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseout.\" + panel.getBaseId() + \".dashboard\", null);\n return panel.parent.removePanel(panel.id);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to move panel up relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_up\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_up\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_top = (this.parent_panel.layout.y_index === 0);\n this.button.disable(is_at_top);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▴\").setTitle(\"Move panel up\")\n .setOnclick(function(){\n this.parent_panel.moveUp();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to move panel down relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_down\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_down\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_bottom = (this.parent_panel.layout.y_index === this.parent_plot.panel_ids_by_y_index.length-1);\n this.button.disable(is_at_bottom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▾\").setTitle(\"Move panel down\")\n .setOnclick(function(){\n this.parent_panel.moveDown();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to shift plot region forwards or back by a `step` increment provided in the layout\n * @class LocusZoom.Dashboard.Components.shift_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=50000] The stepsize to change the region by\n * @param {string} [layout.button_html]\n * @param {string} [layout.button_title]\n */\nLocusZoom.Dashboard.Components.add(\"shift_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add shift_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 50000; }\n if (typeof layout.button_html !== \"string\"){ layout.button_html = layout.step > 0 ? \">\" : \"<\"; }\n if (typeof layout.button_title !== \"string\"){\n layout.button_title = \"Shift region by \" + (layout.step > 0 ? \"+\" : \"-\") + LocusZoom.positionIntToString(Math.abs(layout.step),null,true);\n }\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start + layout.step, 1),\n end: this.parent_plot.state.end + layout.step\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Zoom in or out on the plot, centered on the middle of the plot region, by the specified amount\n * @class LocusZoom.Dashboard.Components.zoom_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=0.2] The amount to zoom in by (where 1 indicates 100%)\n */\nLocusZoom.Dashboard.Components.add(\"zoom_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add zoom_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 0.2; }\n if (typeof layout.button_html != \"string\"){ layout.button_html = layout.step > 0 ? \"z–\" : \"z+\"; }\n if (typeof layout.button_title != \"string\"){\n layout.button_title = \"Zoom region \" + (layout.step > 0 ? \"out\" : \"in\") + \" by \" + (Math.abs(layout.step)*100).toFixed(1) + \"%\";\n }\n this.update = function(){\n if (this.button){\n var can_zoom = true;\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n if (layout.step > 0 && !isNaN(this.parent_plot.layout.max_region_scale) && current_region_scale >= this.parent_plot.layout.max_region_scale){\n can_zoom = false;\n }\n if (layout.step < 0 && !isNaN(this.parent_plot.layout.min_region_scale) && current_region_scale <= this.parent_plot.layout.min_region_scale){\n can_zoom = false;\n }\n this.button.disable(!can_zoom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n var zoom_factor = 1 + layout.step;\n var new_region_scale = current_region_scale * zoom_factor;\n if (!isNaN(this.parent_plot.layout.max_region_scale)){\n new_region_scale = Math.min(new_region_scale, this.parent_plot.layout.max_region_scale);\n }\n if (!isNaN(this.parent_plot.layout.min_region_scale)){\n new_region_scale = Math.max(new_region_scale, this.parent_plot.layout.min_region_scale);\n }\n var delta = Math.floor((new_region_scale - current_region_scale) / 2);\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start - delta, 1),\n end: this.parent_plot.state.end + delta\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Renders button with arbitrary text that, when clicked, shows a dropdown containing arbitrary HTML\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @class LocusZoom.Dashboard.Components.menu\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n * @param {string} layout.menu_html The HTML content of the dropdown menu\n */\nLocusZoom.Dashboard.Components.add(\"menu\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title);\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(layout.menu_html);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Special button/menu to allow model building by tracking individual covariants. Will track a list of covariate\n * objects and store them in the special `model.covariates` field of plot `state`.\n * @class LocusZoom.Dashboard.Components.covariates_model\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n */\nLocusZoom.Dashboard.Components.add(\"covariates_model\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.initialize = function(){\n // Initialize state.model.covariates\n this.parent_plot.state.model = this.parent_plot.state.model || {};\n this.parent_plot.state.model.covariates = this.parent_plot.state.model.covariates || [];\n // Create an object at the plot level for easy access to interface methods in custom client-side JS\n /**\n * When a covariates model dashboard element is present, create (one) object at the plot level that exposes\n * component data and state for custom interactions with other plot elements.\n * @class LocusZoom.Plot.CovariatesModel\n */\n this.parent_plot.CovariatesModel = {\n /** @member {LocusZoom.Dashboard.Component.Button} */\n button: this,\n /**\n * Add an element to the model and show a representation of it in the dashboard component menu. If the\n * element is already part of the model, do nothing (to avoid adding duplicates).\n * When plot state is changed, this will automatically trigger requests for new data accordingly.\n * @param {string|object} element_reference Can be any value that can be put through JSON.stringify()\n * to create a serialized representation of itself.\n */\n add: function(element_reference){\n var element = JSON.parse(JSON.stringify(element_reference));\n if (typeof element_reference == \"object\" && typeof element.html != \"string\"){\n element.html = ( (typeof element_reference.toHTML == \"function\") ? element_reference.toHTML() : element_reference.toString());\n }\n // Check if the element is already in the model covariates array and return if it is.\n for (var i = 0; i < this.state.model.covariates.length; i++) {\n if (JSON.stringify(this.state.model.covariates[i]) === JSON.stringify(element)) {\n return this;\n }\n }\n this.state.model.covariates.push(element);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Remove an element from `state.model.covariates` (and from the dashboard component menu's\n * representation of the state model). When plot state is changed, this will automatically trigger\n * requests for new data accordingly.\n * @param {number} idx Array index of the element, in the `state.model.covariates array`.\n */\n removeByIdx: function(idx){\n if (typeof this.state.model.covariates[idx] == \"undefined\"){\n throw(\"Unable to remove model covariate, invalid index: \" + idx.toString());\n }\n this.state.model.covariates.splice(idx, 1);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Empty the `state.model.covariates` array (and dashboard component menu representation thereof) of all\n * elements. When plot state is changed, this will automatically trigger requests for new data accordingly\n */\n removeAll: function(){\n this.state.model.covariates = [];\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Manually trigger the update methods on the dashboard component's button and menu elements to force\n * display of most up-to-date content. Can be used to force the dashboard to reflect changes made, eg if\n * modifying `state.model.covariates` directly instead of via `plot.CovariatesModel`\n */\n updateComponent: function(){\n this.button.update();\n this.button.menu.update();\n }.bind(this)\n };\n }.bind(this);\n\n this.update = function(){\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n var selector = this.button.menu.inner_selector;\n selector.html(\"\");\n // General model HTML representation\n if (typeof this.parent_plot.state.model.html != \"undefined\"){\n selector.append(\"div\").html(this.parent_plot.state.model.html);\n }\n // Model covariates table\n if (!this.parent_plot.state.model.covariates.length){\n selector.append(\"i\").html(\"no covariates in model\");\n } else {\n selector.append(\"h5\").html(\"Model Covariates (\" + this.parent_plot.state.model.covariates.length + \")\");\n var table = selector.append(\"table\");\n this.parent_plot.state.model.covariates.forEach(function(covariate, idx){\n var html = ( (typeof covariate == \"object\" && typeof covariate.html == \"string\") ? covariate.html : covariate.toString() );\n var row = table.append(\"tr\");\n row.append(\"td\").append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeByIdx(idx);\n }.bind(this))\n .html(\"×\");\n row.append(\"td\").html(html);\n }.bind(this));\n selector.append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"4px\" }).html(\"× Remove All Covariates\")\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeAll();\n }.bind(this));\n }\n }.bind(this));\n\n this.button.preUpdate = function(){\n var html = \"Model\";\n if (this.parent_plot.state.model.covariates.length){\n var cov = this.parent_plot.state.model.covariates.length > 1 ? \"covariates\" : \"covariate\";\n html += \" (\" + this.parent_plot.state.model.covariates.length + \" \" + cov + \")\";\n }\n this.button.setHtml(html).disable(false);\n }.bind(this);\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Button to toggle split tracks\n * @class LocusZoom.Dashboard.Components.toggle_split_tracks\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_split_tracks\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (!layout.data_layer_id){ layout.data_layer_id = \"intervals\"; }\n if (!this.parent_panel.data_layers[layout.data_layer_id]){\n throw (\"Dashboard toggle split tracks component missing valid data layer ID\");\n }\n this.update = function(){\n var data_layer = this.parent_panel.data_layers[layout.data_layer_id];\n var html = data_layer.layout.split_tracks ? \"Merge Tracks\" : \"Split Tracks\";\n if (this.button){\n this.button.setHtml(html);\n this.button.show();\n this.parent.position();\n return this;\n } else {\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(html)\n .setTitle(\"Toggle whether tracks are split apart or merged together\")\n .setOnclick(function(){\n data_layer.toggleSplitTracks();\n if (this.scale_timeout){ clearTimeout(this.scale_timeout); }\n var timeout = data_layer.layout.transition ? +data_layer.layout.transition.duration || 0 : 0;\n this.scale_timeout = setTimeout(function(){\n this.parent_panel.scaleHeightToData();\n this.parent_plot.positionPanels();\n }.bind(this), timeout);\n this.update();\n }.bind(this));\n return this.update();\n }\n };\n});\n\n/**\n * Button to resize panel height to fit available data (eg when showing a list of tracks)\n * @class LocusZoom.Dashboard.Components.resize_to_data\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"resize_to_data\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Resize to Data\")\n .setTitle(\"Automatically resize this panel to fit the data its currently showing\")\n .setOnclick(function(){\n this.parent_panel.scaleHeightToData();\n this.update();\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to toggle legend\n * @class LocusZoom.Dashboard.Components.toggle_legend\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_legend\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var html = this.parent_panel.legend.layout.hidden ? \"Show Legend\" : \"Hide Legend\";\n if (this.button){\n this.button.setHtml(html).show();\n this.parent.position();\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color)\n .setTitle(\"Show or hide the legend for this panel\")\n .setOnclick(function(){\n this.parent_panel.legend.layout.hidden = !this.parent_panel.legend.layout.hidden;\n this.parent_panel.legend.render();\n this.update();\n }.bind(this));\n return this.update();\n };\n});\n\n/**\n * Menu for manipulating multiple data layers in a single panel: show/hide, change order, etc.\n * @class LocusZoom.Dashboard.Components.data_layers\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"data_layers\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.update = function(){\n\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Data Layers\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Manipulate Data Layers (sort, dim, show/hide, etc.)\"; }\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(\"\");\n var table = this.button.menu.inner_selector.append(\"table\");\n this.parent_panel.data_layer_ids_by_z_index.slice().reverse().forEach(function(id, idx){\n var data_layer = this.parent_panel.data_layers[id];\n var name = (typeof data_layer.layout.name != \"string\") ? data_layer.id : data_layer.layout.name;\n var row = table.append(\"tr\");\n // Layer name\n row.append(\"td\").html(name);\n // Status toggle buttons\n layout.statuses.forEach(function(status_adj){\n var status_idx = LocusZoom.DataLayer.Statuses.adjectives.indexOf(status_adj);\n var status_verb = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n var html, onclick, highlight;\n if (data_layer.global_statuses[status_adj]){\n html = LocusZoom.DataLayer.Statuses.menu_antiverbs[status_idx];\n onclick = \"un\" + status_verb + \"AllElements\";\n highlight = \"-highlighted\";\n } else {\n html = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n onclick = status_verb + \"AllElements\";\n highlight = \"\";\n }\n row.append(\"td\").append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color + highlight)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer[onclick](); this.button.menu.populate(); }.bind(this))\n .html(html);\n }.bind(this));\n // Sort layer buttons\n var at_top = (idx === 0);\n var at_bottom = (idx === (this.parent_panel.data_layer_ids_by_z_index.length - 1));\n var td = row.append(\"td\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-start lz-dashboard-button-\" + this.layout.color + (at_bottom ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveDown(); this.button.menu.populate(); }.bind(this))\n .html(\"▾\").attr(\"title\", \"Move layer down (further back)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-middle lz-dashboard-button-\" + this.layout.color + (at_top ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveUp(); this.button.menu.populate(); }.bind(this))\n .html(\"▴\").attr(\"title\", \"Move layer up (further front)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-end lz-dashboard-button-red\")\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n if (confirm(\"Are you sure you want to remove the \" + name + \" layer? This cannot be undone!\")){\n data_layer.parent.removeDataLayer(id);\n }\n return this.button.menu.populate();\n }.bind(this))\n .html(\"×\").attr(\"title\", \"Remove layer\");\n }.bind(this));\n return this;\n }.bind(this));\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Dropdown menu allowing the user to choose between different display options for a single specific data layer\n * within a panel.\n *\n * This allows controlling how points on a datalayer can be displayed- any display options supported via the layout for the target datalayer. This includes point\n * size/shape, coloring, etc.\n *\n * This button intentionally limits display options it can control to those available on common plot types.\n * Although the list of options it sets can be overridden (to control very special custom plot types), this\n * capability should be used sparingly if at all.\n *\n * @class LocusZoom.Dashboard.Components.display_options\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {String} [layout.button_html=\"Display options\"] Text to display on the toolbar button\n * @param {String} [layout.button_title=\"Control how plot items are displayed\"] Hover text for the toolbar button\n * @param {string} layout.layer_name Specify the datalayer that this button should affect\n * @param {string} [layout.default_config_display_name] Store the default configuration for this datalayer\n * configuration, and show a button to revert to the \"default\" (listing the human-readable display name provided)\n * @param {Array} [layout.fields_whitelist='see code'] The list of presentation fields that this button can control.\n * This can be overridden if this button needs to be used on a custom layer type with special options.\n * @typedef {{display_name: string, display: Object}} DisplayOptionsButtonConfigField\n * @param {DisplayOptionsButtonConfigField[]} layout.options Specify a label and set of layout directives associated\n * with this `display` option. Display field should include all changes to datalayer presentation options.\n */\nLocusZoom.Dashboard.Components.add(\"display_options\", function (layout) {\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Display options\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Control how plot items are displayed\"; }\n\n // Call parent constructor\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n // List of layout fields that this button is allowed to control. This ensures that we don't override any other\n // information (like plot height etc) while changing point rendering\n var allowed_fields = layout.fields_whitelist || [\"color\", \"fill_opacity\", \"label\", \"legend\",\n \"point_shape\", \"point_size\", \"tooltip\", \"tooltip_positioning\"];\n\n var dataLayer = this.parent_panel.data_layers[layout.layer_name];\n var dataLayerLayout = dataLayer.layout;\n\n // Store default configuration for the layer as a clean deep copy, so we may revert later\n var defaultConfig = {};\n allowed_fields.forEach(function(name) {\n var configSlot = dataLayerLayout[name];\n if (configSlot) {\n defaultConfig[name] = JSON.parse(JSON.stringify(configSlot));\n }\n });\n\n /**\n * Which item in the menu is currently selected. (track for rerendering menu)\n * @member {String}\n * @private\n */\n this._selected_item = \"default\";\n\n // Define the button + menu that provides the real functionality for this dashboard component\n var self = this;\n this.button = new LocusZoom.Dashboard.Component.Button(self)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function () {\n self.button.menu.populate();\n });\n this.button.menu.setPopulate(function () {\n // Multiple copies of this button might be used on a single LZ page; append unique IDs where needed\n var uniqueID = Math.floor(Math.random() * 1e4).toString();\n\n self.button.menu.inner_selector.html(\"\");\n var table = self.button.menu.inner_selector.append(\"table\");\n\n var menuLayout = self.layout;\n\n var renderRow = function(display_name, display_options, row_id) { // Helper method\n var row = table.append(\"tr\");\n row.append(\"td\")\n .append(\"input\")\n .attr({type: \"radio\", name: \"color-picker-\" + uniqueID, value: row_id})\n .property(\"checked\", (row_id === self._selected_item))\n .on(\"click\", function () {\n Object.keys(display_options).forEach(function(field_name) {\n dataLayer.layout[field_name] = display_options[field_name];\n });\n self._selected_item = row_id;\n self.parent_panel.render();\n var legend = self.parent_panel.legend;\n if (legend && display_options.legend) {\n // Update the legend only if necessary\n legend.render();\n }\n });\n row.append(\"td\").text(display_name);\n };\n // Render the \"display options\" menu: default and special custom options\n var defaultName = menuLayout.default_config_display_name || \"Default style\";\n renderRow(defaultName, defaultConfig, \"default\");\n menuLayout.options.forEach(function (item, index) {\n renderRow(item.display_name, item.display, index);\n });\n return self;\n });\n\n this.update = function () {\n this.button.show();\n return this;\n };\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * An SVG object used to display contextual information about a panel.\n * Panel layouts determine basic features of a legend - its position in the panel, orientation, title, etc.\n * Layouts of child data layers of the panel determine the actual content of the legend.\n *\n * @class\n * @param {LocusZoom.Panel} parent\n*/\nLocusZoom.Legend = function(parent){\n if (!(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create legend, parent must be a locuszoom panel\";\n }\n /** @member {LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".legend\";\n\n this.parent.layout.legend = LocusZoom.Layouts.merge(this.parent.layout.legend || {}, LocusZoom.Legend.DefaultLayout);\n /** @member {Object} */\n this.layout = this.parent.layout.legend;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {d3.selection} */\n this.background_rect = null;\n /** @member {d3.selection[]} */\n this.elements = [];\n /**\n * SVG selector for the group containing all elements in the legend\n * @protected\n * @member {d3.selection|null}\n */\n this.elements_group = null;\n\n /**\n * TODO: Not sure if this property is used; the external-facing methods are setting `layout.hidden` instead. Tentatively mark deprecated.\n * @deprecated\n * @protected\n * @member {Boolean}\n */\n this.hidden = false;\n\n // TODO Revisit constructor return value; see https://stackoverflow.com/a/3350364/1422268\n return this.render();\n};\n\n/**\n * The default layout used by legends (used internally)\n * @protected\n * @member {Object}\n */\nLocusZoom.Legend.DefaultLayout = {\n orientation: \"vertical\",\n origin: { x: 0, y: 0 },\n width: 10,\n height: 10,\n padding: 5,\n label_size: 12,\n hidden: false\n};\n\n/**\n * Render the legend in the parent panel\n */\nLocusZoom.Legend.prototype.render = function(){\n\n // Get a legend group selector if not yet defined\n if (!this.selector){\n this.selector = this.parent.svg.group.append(\"g\")\n .attr(\"id\", this.parent.getBaseId() + \".legend\").attr(\"class\", \"lz-legend\");\n }\n\n // Get a legend background rect selector if not yet defined\n if (!this.background_rect){\n this.background_rect = this.selector.append(\"rect\")\n .attr(\"width\", 100).attr(\"height\", 100).attr(\"class\", \"lz-legend-background\");\n }\n\n // Get a legend elements group selector if not yet defined\n if (!this.elements_group){\n this.elements_group = this.selector.append(\"g\");\n }\n\n // Remove all elements from the document and re-render from scratch\n this.elements.forEach(function(element){\n element.remove();\n });\n this.elements = [];\n\n // Gather all elements from data layers in order (top to bottom) and render them\n var padding = +this.layout.padding || 1;\n var x = padding;\n var y = padding;\n var line_height = 0;\n this.parent.data_layer_ids_by_z_index.slice().reverse().forEach(function(id){\n if (Array.isArray(this.parent.data_layers[id].layout.legend)){\n this.parent.data_layers[id].layout.legend.forEach(function(element){\n var selector = this.elements_group.append(\"g\")\n .attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n var label_size = +element.label_size || +this.layout.label_size || 12;\n var label_x = 0;\n var label_y = (label_size/2) + (padding/2);\n line_height = Math.max(line_height, label_size + padding);\n // Draw the legend element symbol (line, rect, shape, etc)\n if (element.shape === \"line\"){\n // Line symbol\n var length = +element.length || 16;\n var path_y = (label_size/4) + (padding/2);\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", \"M0,\" + path_y + \"L\" + length + \",\" + path_y)\n .style(element.style || {});\n label_x = length + padding;\n } else if (element.shape === \"rect\"){\n // Rect symbol\n var width = +element.width || 16;\n var height = +element.height || width;\n selector.append(\"rect\").attr(\"class\", element.class || \"\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = width + padding;\n line_height = Math.max(line_height, height + padding);\n } else if (d3.svg.symbolTypes.indexOf(element.shape) !== -1) {\n // Shape symbol (circle, diamond, etc.)\n var size = +element.size || 40;\n var radius = Math.ceil(Math.sqrt(size/Math.PI));\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", d3.svg.symbol().size(size).type(element.shape))\n .attr(\"transform\", \"translate(\" + radius + \",\" + (radius+(padding/2)) + \")\")\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = (2*radius) + padding;\n label_y = Math.max((2*radius)+(padding/2), label_y);\n line_height = Math.max(line_height, (2*radius) + padding);\n }\n // Draw the legend element label\n selector.append(\"text\").attr(\"text-anchor\", \"left\").attr(\"class\", \"lz-label\")\n .attr(\"x\", label_x).attr(\"y\", label_y).style({\"font-size\": label_size}).text(element.label);\n // Position the legend element group based on legend layout orientation\n var bcr = selector.node().getBoundingClientRect();\n if (this.layout.orientation === \"vertical\"){\n y += bcr.height + padding;\n line_height = 0;\n } else {\n // Ensure this element does not exceed the panel width\n // (E.g. drop to the next line if it does, but only if it's not the only element on this line)\n var right_x = this.layout.origin.x + x + bcr.width;\n if (x > padding && right_x > this.parent.layout.width){\n y += line_height;\n x = padding;\n selector.attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n }\n x += bcr.width + (3*padding);\n }\n // Store the element\n this.elements.push(selector);\n }.bind(this));\n }\n }.bind(this));\n\n // Scale the background rect to the elements in the legend\n var bcr = this.elements_group.node().getBoundingClientRect();\n this.layout.width = bcr.width + (2*this.layout.padding);\n this.layout.height = bcr.height + (2*this.layout.padding);\n this.background_rect\n .attr(\"width\", this.layout.width)\n .attr(\"height\", this.layout.height);\n\n // Set the visibility on the legend from the \"hidden\" flag\n // TODO: `show()` and `hide()` call a full rerender; might be able to make this more lightweight?\n this.selector.style({ visibility: this.layout.hidden ? \"hidden\" : \"visible\" });\n\n // TODO: Annotate return type and make consistent\n return this.position();\n};\n\n/**\n * Place the legend in position relative to the panel, as specified in the layout configuration\n * @returns {LocusZoom.Legend | null}\n * TODO: should this always be chainable?\n */\nLocusZoom.Legend.prototype.position = function(){\n if (!this.selector){ return this; }\n var bcr = this.selector.node().getBoundingClientRect();\n if (!isNaN(+this.layout.pad_from_bottom)){\n this.layout.origin.y = this.parent.layout.height - bcr.height - +this.layout.pad_from_bottom;\n }\n if (!isNaN(+this.layout.pad_from_right)){\n this.layout.origin.x = this.parent.layout.width - bcr.width - +this.layout.pad_from_right;\n }\n this.selector.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n};\n\n/**\n * Hide the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.hide = function(){\n this.layout.hidden = true;\n this.render();\n};\n\n/**\n * Show the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.show = function(){\n this.layout.hidden = false;\n this.render();\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * LocusZoom functionality used for data parsing and retrieval\n * @namespace\n * @public\n */\nLocusZoom.Data = LocusZoom.Data || {};\n\n/**\n * Create and coordinate an ensemble of (namespaced) data source instances\n * @public\n * @class\n */\nLocusZoom.DataSources = function() {\n /** @member {Object.} */\n this.sources = {};\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.addSource = function(ns, x) {\n console.warn(\"Warning: .addSource() is deprecated. Use .add() instead\");\n return this.add(ns, x);\n};\n\n/**\n * Add a (namespaced) datasource to the plot\n * @public\n * @param {String} ns A namespace used for fields from this data source\n * @param {LocusZoom.Data.Source|Array|null} x An instantiated datasource, or an array of arguments that can be used to\n * create a known datasource type.\n */\nLocusZoom.DataSources.prototype.add = function(ns, x) {\n return this.set(ns, x);\n};\n\n/** @protected */\nLocusZoom.DataSources.prototype.set = function(ns, x) {\n if (Array.isArray(x)) {\n // If passed array of source name and options, make the source\n var dsobj = LocusZoom.KnownDataSources.create.apply(null, x);\n // Each datasource in the chain should be aware of its assigned namespace\n dsobj.source_id = ns;\n this.sources[ns] = dsobj;\n } else {\n // If passed the already-created source object\n if (x !== null) {\n x.source_id = ns;\n this.sources[ns] = x;\n } else {\n delete this.sources[ns];\n }\n }\n return this;\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.getSource = function(ns) {\n console.warn(\"Warning: .getSource() is deprecated. Use .get() instead\");\n return this.get(ns);\n};\n\n/**\n * Return the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n * @returns {LocusZoom.Data.Source}\n */\nLocusZoom.DataSources.prototype.get = function(ns) {\n return this.sources[ns];\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.removeSource = function(ns) {\n console.warn(\"Warning: .removeSource() is deprecated. Use .remove() instead\");\n return this.remove(ns);\n};\n\n/**\n * Remove the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n */\nLocusZoom.DataSources.prototype.remove = function(ns) {\n return this.set(ns, null);\n};\n\n/**\n * Populate a list of datasources specified as a JSON object\n * @public\n * @param {String|Object} x An object or JSON representation containing {ns: configArray} entries\n * @returns {LocusZoom.DataSources}\n */\nLocusZoom.DataSources.prototype.fromJSON = function(x) {\n if (typeof x === \"string\") {\n x = JSON.parse(x);\n }\n var ds = this;\n Object.keys(x).forEach(function(ns) {\n ds.set(ns, x[ns]);\n });\n return ds;\n};\n\n/**\n * Return the names of all currently recognized datasources\n * @public\n * @returns {Array}\n */\nLocusZoom.DataSources.prototype.keys = function() {\n return Object.keys(this.sources);\n};\n\n/**\n * Datasources can be instantiated from a JSON object instead of code. This represents existing sources in that format.\n * For example, this can be helpful when sharing plots, or to share settings with others when debugging\n * @public\n */\nLocusZoom.DataSources.prototype.toJSON = function() {\n return this.sources;\n};\n\n/**\n * Represents an addressable unit of data from a namespaced datasource, subject to specified value transformations.\n *\n * When used by a data layer, fields will automatically be re-fetched from the appropriate data source whenever the\n * state of a plot fetches, eg pan or zoom operations that would affect what data is displayed.\n *\n * @public\n * @class\n * @param {String} field A string representing the namespace of the datasource, the name of the desired field to fetch\n * from that datasource, and arbitrarily many transformations to apply to the value. The namespace and\n * transformation(s) are optional and information is delimited according to the general syntax\n * `[namespace:]name[|transformation][|transformation]`. For example, `association:pvalue|neglog10`\n */\nLocusZoom.Data.Field = function(field){\n \n var parts = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/.exec(field);\n /** @member {String} */\n this.full_name = field;\n /** @member {String} */\n this.namespace = parts[1] || null;\n /** @member {String} */\n this.name = parts[2] || null;\n /** @member {Array} */\n this.transformations = [];\n \n if (typeof parts[3] == \"string\" && parts[3].length > 1){\n this.transformations = parts[3].substring(1).split(\"|\");\n this.transformations.forEach(function(transform, i){\n this.transformations[i] = LocusZoom.TransformationFunctions.get(transform);\n }.bind(this));\n }\n\n this.applyTransformations = function(val){\n this.transformations.forEach(function(transform){\n val = transform(val);\n });\n return val;\n };\n\n // Resolve the field for a given data element.\n // First look for a full match with transformations already applied by the data requester.\n // Otherwise prefer a namespace match and fall back to just a name match, applying transformations on the fly.\n this.resolve = function(d){\n if (typeof d[this.full_name] == \"undefined\"){\n var val = null;\n if (typeof (d[this.namespace+\":\"+this.name]) != \"undefined\"){ val = d[this.namespace+\":\"+this.name]; }\n else if (typeof d[this.name] != \"undefined\"){ val = d[this.name]; }\n d[this.full_name] = this.applyTransformations(val);\n }\n return d[this.full_name];\n };\n \n};\n\n/**\n * The Requester manages fetching of data across multiple data sources. It is used internally by LocusZoom data layers.\n * It passes state information and ensures that data is formatted in the manner expected by the plot.\n *\n * It is also responsible for constructing a \"chain\" of dependent requests, by requesting each datasource\n * sequentially in the order specified in the datalayer `fields` array. Data sources are only chained within a\n * data layer, and only if that layer requests more than one kind of data source.\n * @param {LocusZoom.DataSources} sources An object of {ns: LocusZoom.Data.Source} instances\n * @class\n */\nLocusZoom.Data.Requester = function(sources) {\n\n function split_requests(fields) {\n // Given a fields array, return an object specifying what datasource names the data layer should make requests\n // to, and how to handle the returned data\n var requests = {};\n // Regular expression finds namespace:field|trans\n var re = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/;\n fields.forEach(function(raw) {\n var parts = re.exec(raw);\n var ns = parts[1] || \"base\";\n var field = parts[2];\n var trans = LocusZoom.TransformationFunctions.get(parts[3]);\n if (typeof requests[ns] ==\"undefined\") {\n requests[ns] = {outnames:[], fields:[], trans:[]};\n }\n requests[ns].outnames.push(raw);\n requests[ns].fields.push(field);\n requests[ns].trans.push(trans);\n });\n return requests;\n }\n\n /**\n * Fetch data, and create a chain that only connects two data sources if they depend on each other\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields The list of data fields specified in the `layout` for a specific data layer\n * @returns {Promise}\n */\n this.getData = function(state, fields) {\n var requests = split_requests(fields);\n // Create an array of functions that, when called, will trigger the request to the specified datasource\n var request_handles = Object.keys(requests).map(function(key) {\n if (!sources.get(key)) {\n throw(\"Datasource for namespace \" + key + \" not found\");\n }\n return sources.get(key).getData(state, requests[key].fields, \n requests[key].outnames, requests[key].trans);\n });\n //assume the fields are requested in dependent order\n //TODO: better manage dependencies\n var ret = Q.when({header:{}, body:{}, discrete: {}});\n for(var i=0; i < request_handles.length; i++) {\n // If a single datalayer uses multiple sources, perform the next request when the previous one completes\n ret = ret.then(request_handles[i]);\n }\n return ret;\n };\n};\n\n/**\n * Base class for LocusZoom data sources\n * This can be extended with .extend() to create custom data sources\n * @class\n * @public\n */\nLocusZoom.Data.Source = function() {\n /**\n * Whether this source should enable caching\n * @member {Boolean}\n */\n this.enableCache = true;\n /**\n * Whether this data source type is dependent on previous requests- for example, the LD source cannot annotate\n * association data if no data was found for that region.\n * @member {boolean}\n */\n this.dependentSource = false;\n};\n\n/**\n * A default constructor that can be used when creating new data sources\n * @param {String|Object} init Basic configuration- either a url, or a config object\n * @param {String} [init.url] The datasource URL\n * @param {String} [init.params] Initial config params for the datasource\n */\nLocusZoom.Data.Source.prototype.parseInit = function(init) {\n if (typeof init === \"string\") {\n /** @member {String} */\n this.url = init;\n /** @member {String} */\n this.params = {};\n } else {\n this.url = init.url;\n this.params = init.params || {};\n }\n if (!this.url) {\n throw(\"Source not initialized with required URL\");\n }\n\n};\n\n/**\n * A unique identifier that indicates whether cached data is valid for this request\n * @protected\n * @param state\n * @param chain\n * @param fields\n * @returns {String|undefined}\n */\nLocusZoom.Data.Source.prototype.getCacheKey = function(state, chain, fields) {\n return this.getURL && this.getURL(state, chain, fields);\n};\n\n/**\n * Stub: build the URL for any requests made by this source.\n */\nLocusZoom.Data.Source.prototype.getURL = function(state, chain, fields) { return this.url; };\n\n/**\n * Perform a network request to fetch data for this source\n * @protected\n * @param {Object} state The state of the parent plot\n * @param chain\n * @param fields\n */\nLocusZoom.Data.Source.prototype.fetchRequest = function(state, chain, fields) {\n var url = this.getURL(state, chain, fields);\n return LocusZoom.createCORSPromise(\"GET\", url); \n};\n\n/**\n * Gets the data for just this source, typically via a network request (caching where possible)\n * @protected\n */\nLocusZoom.Data.Source.prototype.getRequest = function(state, chain, fields) {\n var req;\n var cacheKey = this.getCacheKey(state, chain, fields);\n if (this.enableCache && typeof(cacheKey) !== \"undefined\" && cacheKey === this._cachedKey) {\n req = Q.when(this._cachedResponse);\n } else {\n req = this.fetchRequest(state, chain, fields);\n if (this.enableCache) {\n req = req.then(function(x) {\n this._cachedKey = cacheKey;\n return this._cachedResponse = x;\n }.bind(this));\n }\n }\n return req;\n};\n\n/**\n * Fetch the data from the specified data source, and apply transformations requested by an external consumer.\n * This is the public-facing datasource method that will most commonly be called by external code.\n *\n * @public\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the \"namespace\" prefix)\n * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the\n * originally requested field name, including the namespace. This must be an array with the same length as `fields`\n * @param {Function[]} trans The collection of transformation functions to be run on selected fields.\n * This must be an array with the same length as `fields`\n * @returns {function} A callable operation that can be used as part of the data chain\n */\nLocusZoom.Data.Source.prototype.getData = function(state, fields, outnames, trans) {\n if (this.preGetData) {\n var pre = this.preGetData(state, fields, outnames, trans);\n if(this.pre) {\n state = pre.state || state;\n fields = pre.fields || fields;\n outnames = pre.outnames || outnames;\n trans = pre.trans || trans;\n }\n }\n\n var self = this;\n return function (chain) {\n if (self.dependentSource && chain && chain.body && !chain.body.length) {\n // A \"dependent\" source should not attempt to fire a request if there is no data for it to act on.\n // Therefore, it should simply return the previous data chain.\n return Q.when(chain);\n }\n\n return self.getRequest(state, chain, fields).then(function(resp) {\n return self.parseResponse(resp, chain, fields, outnames, trans);\n });\n };\n};\n\n/**\n * Ensure the server response is in a canonical form, an array of one object per record. [ {field: oneval} ].\n * If the server response contains columns, reformats the response from {column1: [], column2: []} to the above.\n *\n * Does not apply namespacing or transformations.\n *\n * May be overridden by data sources that inherently return more complex payloads, or that exist to annotate other\n * sources.\n *\n * @param {Object[]|Object} data The original parsed server response\n * @protected\n */\nLocusZoom.Data.Source.prototype.normalizeResponse = function (data) {\n if (Array.isArray(data)) {\n // Already in the desired form\n return data;\n }\n\n // Otherwise, assume the server response is an object representing columns of data.\n // Each array should have the same length (verify), and a given array index corresponds to a single row.\n var keys = Object.keys(data);\n var N = data[keys[0]].length;\n var sameLength = keys.every(function(key) {\n var item = data[key];\n return item.length === N;\n });\n if (!sameLength) {\n throw this.constructor.SOURCE_NAME + \" expects a response in which all arrays of data are the same length\";\n }\n\n // Go down the rows, and create an object for each record\n var records = [];\n var fields = Object.keys(data);\n for(var i = 0; i < N; i++) {\n var record = {};\n for(var j = 0; j < fields.length; j++) {\n record[fields[j]] = data[fields[j]][i];\n }\n records.push(record);\n }\n return records;\n};\n\n/** @deprecated */\nLocusZoom.Data.Source.prototype.prepareData = function (records) {\n console.warn(\"Warning: .prepareData() is deprecated. Use .annotateData() instead\");\n return this.annotateData(records);\n};\n\n/**\n * Hook to post-process the data returned by this source with new, additional behavior.\n * (eg cleaning up API values or performing complex calculations on the returned data)\n *\n * @param {Object[]} records The parsed data from the source (eg standardized api response)\n * @param {Object} chain The data chain object. For example, chain.headers may provide useful annotation metadata\n * @returns {Object[]|Promise} The modified set of records\n */\nLocusZoom.Data.Source.prototype.annotateData = function(records, chain) {\n // Default behavior: no transformations\n return records;\n};\n\n/**\n * Clean up the server records for use by datalayers: extract only certain fields, with the specified names.\n * Apply per-field transformations as appropriate.\n *\n * This hook can be overridden, eg to create a source that always returns all records and ignores the \"fields\" array.\n * This is particularly common for sources at the end of a chain- many \"dependent\" sources do not allow\n * cherry-picking individual fields, in which case by **convention** the fields array specifies \"last_source_name:all\"\n *\n * @param {Object[]} data One record object per element\n * @param {String[]} fields The names of fields to extract (as named in the source data). Eg \"afield\"\n * @param {String[]} outnames How to represent the source fields in the output. Eg \"namespace:afield|atransform\"\n * @param {function[]} trans An array of transformation functions (if any). One function per data element, or null.\n * @protected\n */\nLocusZoom.Data.Source.prototype.extractFields = function (data, fields, outnames, trans) {\n //intended for an array of objects\n // [ {\"id\":1, \"val\":5}, {\"id\":2, \"val\":10}]\n // Since a number of sources exist that do not obey this format, we will provide a convenient pass-through\n if (!Array.isArray(data)) {\n return data;\n }\n\n var fieldFound = [];\n for (var k=0; k1) {\n if (fields.length!==2 || fields.indexOf(\"isrefvar\")===-1) {\n throw(\"LD does not know how to get all fields: \" + fields.join(\", \"));\n }\n }\n};\n\nLocusZoom.Data.LDSource.prototype.findMergeFields = function(chain) {\n // since LD may be shared across sources with different namespaces\n // we use regex to find columns to join on rather than \n // requiring exact matches\n var exactMatch = function(arr) {return function() {\n var regexes = arguments;\n for(var i=0; i0) {\n var names = Object.keys(chain.body[0]);\n var nameMatch = exactMatch(names);\n dataFields.id = dataFields.id || nameMatch(/\\bvariant\\b/) || nameMatch(/\\bid\\b/);\n dataFields.position = dataFields.position || nameMatch(/\\bposition\\b/i, /\\bpos\\b/i);\n dataFields.pvalue = dataFields.pvalue || nameMatch(/\\bpvalue\\b/i, /\\blog_pvalue\\b/i);\n dataFields._names_ = names;\n }\n return dataFields;\n};\n\nLocusZoom.Data.LDSource.prototype.findRequestedFields = function(fields, outnames) {\n var obj = {};\n for(var i=0; i extremeVal) {\n extremeVal = x[i][pval] * sign;\n extremeIdx = i;\n }\n }\n return extremeIdx;\n };\n\n var refSource = state.ldrefsource || chain.header.ldrefsource || 1;\n var reqFields = this.findRequestedFields(fields);\n var refVar = reqFields.ldin;\n if (refVar === \"state\") {\n refVar = state.ldrefvar || chain.header.ldrefvar || \"best\";\n }\n if (refVar === \"best\") {\n if (!chain.body) {\n throw(\"No association data found to find best pvalue\");\n }\n var keys = this.findMergeFields(chain);\n if (!keys.pvalue || !keys.id) {\n var columns = \"\";\n if (!keys.id){ columns += (columns.length ? \", \" : \"\") + \"id\"; }\n if (!keys.pvalue){ columns += (columns.length ? \", \" : \"\") + \"pvalue\"; }\n throw(\"Unable to find necessary column(s) for merge: \" + columns + \" (available: \" + keys._names_ + \")\");\n }\n refVar = chain.body[findExtremeValue(chain.body, keys.pvalue)][keys.id];\n }\n if (!chain.header) {chain.header = {};}\n chain.header.ldrefvar = refVar;\n return this.url + \"results/?filter=reference eq \" + refSource + \n \" and chromosome2 eq '\" + state.chr + \"'\" + \n \" and position2 ge \" + state.start + \n \" and position2 le \" + state.end + \n \" and variant1 eq '\" + refVar + \"'\" + \n \"&fields=chr,pos,rsquare\";\n};\n\nLocusZoom.Data.LDSource.prototype.combineChainBody = function (data, chain, fields, outnames) {\n var keys = this.findMergeFields(chain);\n var reqFields = this.findRequestedFields(fields, outnames);\n if (!keys.position) {\n throw(\"Unable to find position field for merge: \" + keys._names_);\n }\n var leftJoin = function(left, right, lfield, rfield) {\n var i=0, j=0;\n while (i < left.length && j < right.position2.length) {\n if (left[i][keys.position] === right.position2[j]) {\n left[i][lfield] = right[rfield][j];\n i++;\n j++;\n } else if (left[i][keys.position] < right.position2[j]) {\n i++;\n } else {\n j++;\n }\n }\n };\n var tagRefVariant = function(data, refvar, idfield, outname) {\n for(var i=0; i} */\n this.panels = {};\n /**\n * TODO: This is currently used by external classes that manipulate the parent and may indicate room for a helper method in the api to coordinate boilerplate\n * @protected\n * @member {String[]}\n */\n this.panel_ids_by_y_index = [];\n\n /**\n * Notify each child panel of the plot of changes in panel ordering/ arrangement\n */\n this.applyPanelYIndexesToPanelLayouts = function(){\n this.panel_ids_by_y_index.forEach(function(pid, idx){\n this.panels[pid].layout.y_index = idx;\n }.bind(this));\n };\n\n /**\n * Get the qualified ID pathname for the plot\n * @returns {String}\n */\n this.getBaseId = function(){\n return this.id;\n };\n\n /**\n * Track update operations (reMap) performed on all child panels, and notify the parent plot when complete\n * TODO: Reconsider whether we need to be tracking this as global state outside of context of specific operations\n * @protected\n * @member {Promise[]}\n */\n this.remap_promises = [];\n\n if (typeof layout == \"undefined\"){\n /**\n * The layout is a serializable object used to describe the composition of the Plot\n * If no layout was passed, use the Standard Association Layout\n * Otherwise merge whatever was passed with the Default Layout\n * TODO: Review description; we *always* merge with default layout?\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge({}, LocusZoom.Layouts.get(\"plot\", \"standard_association\"));\n } else {\n this.layout = layout;\n }\n LocusZoom.Layouts.merge(this.layout, LocusZoom.Plot.DefaultLayout);\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original plot state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n\n /**\n * Create a shortcut to the state in the layout on the Plot. Tracking in the layout allows the plot to be created\n * with initial state/setup.\n *\n * Tracks state of the plot, eg start and end position\n * @member {Object}\n */\n this.state = this.layout.state;\n\n /** @member {LocusZoom.Data.Requester} */\n this.lzd = new LocusZoom.Data.Requester(datasource);\n\n /**\n * Window.onresize listener (responsive layouts only)\n * TODO: .on appears to return a selection, not a listener? Check logic here\n * https://github.com/d3/d3-selection/blob/00b904b9bcec4dfaf154ae0bbc777b1fc1d7bc08/test/selection/on-test.js#L11\n * @deprecated\n * @member {d3.selection}\n */\n this.window_onresize = null;\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": [],\n \"state_changed\": [] // Only triggered when a state change causes rerender\n };\n\n /**\n * @callback eventCallback\n * @param {object} eventData A description of the event\n * @param {String|null} eventData.sourceID The unique identifier (eg plot or parent name) of the element that\n * triggered the event. Will be automatically filled in if not explicitly provided.\n * @param {Object|null} eventData.context Any additional information to be passed to the callback, eg the data\n * associated with a clicked plot element\n */\n\n /**\n * There are several events that a LocusZoom plot can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following plot-level events are currently supported:\n * - `layout_changed` - context: plot - Any aspect of the plot's layout (including dimensions or state) has changed.\n * - `data_requested` - context: plot - A request for new data from any data source used in the plot has been made.\n * - `data_rendered` - context: plot - Data from a request has been received and rendered in the plot.\n * - `element_clicked` - context: plot - A data element in any of the plot's data layers has been clicked.\n * - `element_selection` - context: plot - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `plot.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * plot itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Plot}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n * @param {string} event A known event name\n * @param {*} eventData Data or event description that will be passed to the event listener\n * @returns {LocusZoom.Plot}\n */\n this.emit = function(event, eventData) {\n // TODO: there are small differences between the emit implementation between plots and panels. In the future,\n // DRY this code via mixins, and make sure to keep the interfaces compatible when refactoring.\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n var sourceID = this.getBaseId();\n var self = this;\n this.event_hooks[event].forEach(function(hookToRun) {\n var eventContext;\n if (eventData && eventData.sourceID) {\n // If we detect that an event originated elsewhere (via bubbling or externally), preserve the context\n // when re-emitting the event to plot-level listeners\n eventContext = eventData;\n } else {\n eventContext = {sourceID: sourceID, data: eventData || null};\n }\n // By default, any handlers fired here (either directly, or bubbled) will see the plot as the\n // value of `this`. If a bound function is registered as a handler, the previously bound `this` will\n // override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the plot's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the plot\n * @returns {{x: Number, y: Number, width: Number, height: Number}}\n */\n this.getPageOrigin = function(){\n var bounding_client_rect = this.svg.node().getBoundingClientRect();\n var x_offset = document.documentElement.scrollLeft || document.body.scrollLeft;\n var y_offset = document.documentElement.scrollTop || document.body.scrollTop;\n var container = this.svg.node();\n while (container.parentNode !== null){\n container = container.parentNode;\n if (container !== document && d3.select(container).style(\"position\") !== \"static\"){\n x_offset = -1 * container.getBoundingClientRect().left;\n y_offset = -1 * container.getBoundingClientRect().top;\n break;\n }\n }\n return {\n x: x_offset + bounding_client_rect.left,\n y: y_offset + bounding_client_rect.top,\n width: bounding_client_rect.width,\n height: bounding_client_rect.height\n };\n };\n\n /**\n * Get the top and left offset values for the plot's container element (the div that was populated)\n * @returns {{top: number, left: number}}\n */\n this.getContainerOffset = function(){\n var offset = { top: 0, left: 0 };\n var container = this.container.offsetParent || null;\n while (container !== null){\n offset.top += container.offsetTop;\n offset.left += container.offsetLeft;\n container = container.offsetParent || null;\n }\n return offset;\n };\n\n //\n /**\n * Event information describing interaction (e.g. panning and zooming) is stored on the plot\n * TODO: Add/ document details of interaction structure as we expand\n * @member {{panel_id: String, linked_panel_ids: Array, x_linked: *, dragging: *, zooming: *}}\n * @returns {LocusZoom.Plot}\n */\n this.interaction = {};\n\n /**\n * Track whether the target panel can respond to mouse interaction events\n * @param {String} panel_id\n * @returns {boolean}\n */\n this.canInteract = function(panel_id){\n panel_id = panel_id || null;\n if (panel_id){\n return ((typeof this.interaction.panel_id == \"undefined\" || this.interaction.panel_id === panel_id) && !this.loading_data);\n } else {\n return !(this.interaction.dragging || this.interaction.zooming || this.loading_data);\n }\n };\n\n // Initialize the layout\n this.initializeLayout();\n // TODO: Possibly superfluous return from constructor\n return this;\n};\n\n/**\n * Default/ expected configuration parameters for basic plotting; most plots will override\n *\n * @protected\n * @static\n * @type {Object}\n */\nLocusZoom.Plot.DefaultLayout = {\n state: {},\n width: 1,\n height: 1,\n min_width: 1,\n min_height: 1,\n responsive_resize: false,\n aspect_ratio: 1,\n panels: [],\n dashboard: {\n components: []\n },\n panel_boundaries: true,\n mouse_guide: true\n};\n\n/**\n * Helper method to sum the proportional dimensions of panels, a value that's checked often as panels are added/removed\n * @param {('Height'|'Width')} dimension\n * @returns {number}\n */\nLocusZoom.Plot.prototype.sumProportional = function(dimension){\n if (dimension !== \"height\" && dimension !== \"width\"){\n throw (\"Bad dimension value passed to LocusZoom.Plot.prototype.sumProportional\");\n }\n var total = 0;\n for (var id in this.panels){\n // Ensure every panel contributing to the sum has a non-zero proportional dimension\n if (!this.panels[id].layout[\"proportional_\" + dimension]){\n this.panels[id].layout[\"proportional_\" + dimension] = 1 / Object.keys(this.panels).length;\n }\n total += this.panels[id].layout[\"proportional_\" + dimension];\n }\n return total;\n};\n\n/**\n * Resize the plot to fit the bounding container\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.rescaleSVG = function(){\n var clientRect = this.svg.node().getBoundingClientRect();\n this.setDimensions(clientRect.width, clientRect.height);\n return this;\n};\n\n/**\n * Prepare the plot for first use by performing parameter validation, setting up panels, and calculating dimensions\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initializeLayout = function(){\n\n // Sanity check layout values\n // TODO: Find a way to generally abstract this, maybe into an object that models allowed layout values?\n if (isNaN(this.layout.width) || this.layout.width <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.height) || this.layout.height <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.aspect_ratio) || this.layout.aspect_ratio <= 0){\n throw (\"Plot layout parameter `aspect_ratio` must be a positive number\");\n }\n\n // If this is a responsive layout then set a namespaced/unique onresize event listener on the window\n if (this.layout.responsive_resize){\n this.window_onresize = d3.select(window).on(\"resize.lz-\"+this.id, function(){\n this.rescaleSVG();\n }.bind(this));\n // Forcing one additional setDimensions() call after the page is loaded clears up\n // any disagreements between the initial layout and the loaded responsive container's size\n d3.select(window).on(\"load.lz-\"+this.id, function(){\n this.setDimensions();\n }.bind(this));\n }\n\n // Add panels\n this.layout.panels.forEach(function(panel_layout){\n this.addPanel(panel_layout);\n }.bind(this));\n\n return this;\n};\n\n/**\n * Set the dimensions for a plot, and ensure that panels are sized and positioned correctly.\n *\n * If dimensions are provided, resizes each panel proportionally to match the new plot dimensions. Otherwise,\n * calculates the appropriate plot dimensions based on all panels.\n * @param {Number} [width] If provided and larger than minimum size, set plot to this width\n * @param {Number} [height] If provided and larger than minimum size, set plot to this height\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.setDimensions = function(width, height){\n\n var id;\n\n // Update minimum allowable width and height by aggregating minimums from panels, then apply minimums to containing element.\n var min_width = parseFloat(this.layout.min_width) || 0;\n var min_height = parseFloat(this.layout.min_height) || 0;\n for (id in this.panels){\n min_width = Math.max(min_width, this.panels[id].layout.min_width);\n if (parseFloat(this.panels[id].layout.min_height) > 0 && parseFloat(this.panels[id].layout.proportional_height) > 0){\n min_height = Math.max(min_height, (this.panels[id].layout.min_height / this.panels[id].layout.proportional_height));\n }\n }\n this.layout.min_width = Math.max(min_width, 1);\n this.layout.min_height = Math.max(min_height, 1);\n d3.select(this.svg.node().parentNode).style({\n \"min-width\": this.layout.min_width + \"px\",\n \"min-height\": this.layout.min_height + \"px\"\n });\n\n // If width and height arguments were passed then adjust them against plot minimums if necessary.\n // Then resize the plot and proportionally resize panels to fit inside the new plot dimensions.\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n // Override discrete values if resizing responsively\n if (this.layout.responsive_resize){\n if (this.svg){\n this.layout.width = Math.max(this.svg.node().parentNode.getBoundingClientRect().width, this.layout.min_width);\n }\n this.layout.height = this.layout.width / this.layout.aspect_ratio;\n if (this.layout.height < this.layout.min_height){\n this.layout.height = this.layout.min_height;\n this.layout.width = this.layout.height * this.layout.aspect_ratio;\n }\n }\n // Resize/reposition panels to fit, update proportional origins if necessary\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel_width = this.layout.width;\n var panel_height = this.panels[panel_id].layout.proportional_height * this.layout.height;\n this.panels[panel_id].setDimensions(panel_width, panel_height);\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n this.panels[panel_id].layout.proportional_origin.y = y_offset / this.layout.height;\n y_offset += panel_height;\n this.panels[panel_id].dashboard.update();\n }.bind(this));\n }\n\n // If width and height arguments were NOT passed (and panels exist) then determine the plot dimensions\n // by making it conform to panel dimensions, assuming panels are already positioned correctly.\n else if (Object.keys(this.panels).length) {\n this.layout.width = 0;\n this.layout.height = 0;\n for (id in this.panels){\n this.layout.width = Math.max(this.panels[id].layout.width, this.layout.width);\n this.layout.height += this.panels[id].layout.height;\n }\n this.layout.width = Math.max(this.layout.width, this.layout.min_width);\n this.layout.height = Math.max(this.layout.height, this.layout.min_height);\n }\n\n // Keep aspect ratio in agreement with dimensions\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n\n // Apply layout width and height as discrete values or viewbox values\n if (this.svg !== null){\n if (this.layout.responsive_resize){\n this.svg\n .attr(\"viewBox\", \"0 0 \" + this.layout.width + \" \" + this.layout.height)\n .attr(\"preserveAspectRatio\", \"xMinYMin meet\");\n } else {\n this.svg.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n }\n\n // If the plot has been initialized then trigger some necessary render functions\n if (this.initialized){\n this.panel_boundaries.position();\n this.dashboard.update();\n this.curtain.update();\n this.loader.update();\n }\n\n return this.emit(\"layout_changed\");\n};\n\n/**\n * Create a new panel from a layout, and handle the work of initializing and placing the panel on the plot\n * @param {Object} layout\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Plot.prototype.addPanel = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\"){\n throw \"Invalid panel layout passed to LocusZoom.Plot.prototype.addPanel()\";\n }\n\n // Create the Panel and set its parent\n var panel = new LocusZoom.Panel(layout, this);\n\n // Store the Panel on the Plot\n this.panels[panel.id] = panel;\n\n // If a discrete y_index was set in the layout then adjust other panel y_index values to accommodate this one\n if (panel.layout.y_index !== null && !isNaN(panel.layout.y_index)\n && this.panel_ids_by_y_index.length > 0){\n // Negative y_index values should count backwards from the end, so convert negatives to appropriate values here\n if (panel.layout.y_index < 0){\n panel.layout.y_index = Math.max(this.panel_ids_by_y_index.length + panel.layout.y_index, 0);\n }\n this.panel_ids_by_y_index.splice(panel.layout.y_index, 0, panel.id);\n this.applyPanelYIndexesToPanelLayouts();\n } else {\n var length = this.panel_ids_by_y_index.push(panel.id);\n this.panels[panel.id].layout.y_index = length - 1;\n }\n\n // Determine if this panel was already in the layout.panels array.\n // If it wasn't, add it. Either way store the layout.panels array index on the panel.\n var layout_idx = null;\n this.layout.panels.forEach(function(panel_layout, idx){\n if (panel_layout.id === panel.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.panels.push(this.panels[panel.id].layout) - 1;\n }\n this.panels[panel.id].layout_idx = layout_idx;\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n this.positionPanels();\n // Initialize and load data into the new panel\n this.panels[panel.id].initialize();\n this.panels[panel.id].reMap();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this.panels[panel.id];\n};\n\n\n/**\n * Clear all state, tooltips, and other persisted data associated with one (or all) panel(s) in the plot\n *\n * This is useful when reloading an existing plot with new data, eg \"click for genome region\" links.\n * This is a utility method for custom usage. It is not fired automatically during normal rerender of existing panels\n * @param {String} [panelId] If provided, clear state for only this panel. Otherwise, clear state for all panels.\n * @param {('wipe'|'reset')} [mode='wipe'] Optionally specify how state should be cleared. `wipe` deletes all data\n * and is useful for when the panel is being removed; `reset` is best when the panel will be reused in place.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.clearPanelData = function(panelId, mode) {\n mode = mode || \"wipe\";\n\n // TODO: Add unit tests for this method\n var panelsList;\n if (panelId) {\n panelsList = [panelId];\n } else {\n panelsList = Object.keys(this.panels);\n }\n var self = this;\n panelsList.forEach(function(pid) {\n self.panels[pid].data_layer_ids_by_z_index.forEach(function(dlid){\n var layer = self.panels[pid].data_layers[dlid];\n layer.destroyAllTooltips();\n\n delete self.layout.state[pid + \".\" + dlid];\n if(mode === \"reset\") {\n layer.setDefaultState();\n }\n });\n });\n return this;\n};\n\n/**\n * Remove the panel from the plot, and clear any state, tooltips, or other visual elements belonging to nested content\n * @param {String} id\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.removePanel = function(id){\n if (!this.panels[id]){\n throw (\"Unable to remove panel, ID not found: \" + id);\n }\n\n // Hide all panel boundaries\n this.panel_boundaries.hide();\n\n // Destroy all tooltips and state vars for all data layers on the panel\n this.clearPanelData(id);\n\n // Remove all panel-level HTML overlay elements\n this.panels[id].loader.hide();\n this.panels[id].dashboard.destroy(true);\n this.panels[id].curtain.hide();\n\n // Remove the svg container for the panel if it exists\n if (this.panels[id].svg.container){\n this.panels[id].svg.container.remove();\n }\n\n // Delete the panel and its presence in the plot layout and state\n this.layout.panels.splice(this.panels[id].layout_idx, 1);\n delete this.panels[id];\n delete this.layout.state[id];\n\n // Update layout_idx values for all remaining panels\n this.layout.panels.forEach(function(panel_layout, idx){\n this.panels[panel_layout.id].layout_idx = idx;\n }.bind(this));\n\n // Remove the panel id from the y_index array\n this.panel_ids_by_y_index.splice(this.panel_ids_by_y_index.indexOf(id), 1);\n this.applyPanelYIndexesToPanelLayouts();\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n // Allow the plot to shrink when panels are removed, by forcing it to recalculate min dimensions from scratch\n this.layout.min_height = this._base_layout.min_height;\n this.layout.min_width = this._base_layout.min_width;\n\n this.positionPanels();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this;\n};\n\n\n/**\n * Automatically position panels based on panel positioning rules and values.\n * Keep panels from overlapping vertically by adjusting origins, and keep the sum of proportional heights at 1.\n *\n * TODO: This logic currently only supports dynamic positioning of panels to prevent overlap in a VERTICAL orientation.\n * Some framework exists for positioning panels in horizontal orientations as well (width, proportional_width, origin.x, etc.)\n * but the logic for keeping these user-definable values straight approaches the complexity of a 2D box-packing algorithm.\n * That's complexity we don't need right now, and may not ever need, so it's on hiatus until a use case materializes.\n */\nLocusZoom.Plot.prototype.positionPanels = function(){\n\n var id;\n\n // We want to enforce that all x-linked panels have consistent horizontal margins\n // (to ensure that aligned items stay aligned despite inconsistent initial layout parameters)\n // NOTE: This assumes panels have consistent widths already. That should probably be enforced too!\n var x_linked_margins = { left: 0, right: 0 };\n\n // Proportional heights for newly added panels default to null unless explicitly set, so determine appropriate\n // proportional heights for all panels with a null value from discretely set dimensions.\n // Likewise handle default nulls for proportional widths, but instead just force a value of 1 (full width)\n for (id in this.panels){\n if (this.panels[id].layout.proportional_height === null){\n this.panels[id].layout.proportional_height = this.panels[id].layout.height / this.layout.height;\n }\n if (this.panels[id].layout.proportional_width === null){\n this.panels[id].layout.proportional_width = 1;\n }\n if (this.panels[id].layout.interaction.x_linked){\n x_linked_margins.left = Math.max(x_linked_margins.left, this.panels[id].layout.margin.left);\n x_linked_margins.right = Math.max(x_linked_margins.right, this.panels[id].layout.margin.right);\n }\n }\n\n // Sum the proportional heights and then adjust all proportionally so that the sum is exactly 1\n var total_proportional_height = this.sumProportional(\"height\");\n if (!total_proportional_height){\n return this;\n }\n var proportional_adjustment = 1 / total_proportional_height;\n for (id in this.panels){\n this.panels[id].layout.proportional_height *= proportional_adjustment;\n }\n\n // Update origins on all panels without changing plot-level dimensions yet\n // Also apply x-linked margins to x-linked panels, updating widths as needed\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n y_offset += this.panels[panel_id].layout.height;\n if (this.panels[panel_id].layout.interaction.x_linked){\n var delta = Math.max(x_linked_margins.left - this.panels[panel_id].layout.margin.left, 0)\n + Math.max(x_linked_margins.right - this.panels[panel_id].layout.margin.right, 0);\n this.panels[panel_id].layout.width += delta;\n this.panels[panel_id].layout.margin.left = x_linked_margins.left;\n this.panels[panel_id].layout.margin.right = x_linked_margins.right;\n this.panels[panel_id].layout.cliparea.origin.x = x_linked_margins.left;\n }\n }.bind(this));\n var calculated_plot_height = y_offset;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].layout.proportional_origin.y = this.panels[panel_id].layout.origin.y / calculated_plot_height;\n }.bind(this));\n\n // Update dimensions on the plot to accommodate repositioned panels\n this.setDimensions();\n\n // Set dimensions on all panels using newly set plot-level dimensions and panel-level proportional dimensions\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setDimensions(this.layout.width * this.panels[panel_id].layout.proportional_width,\n this.layout.height * this.panels[panel_id].layout.proportional_height);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Prepare the first rendering of the plot. This includes initializing the individual panels, but also creates shared\n * elements such as mouse events, panel guides/boundaries, and loader/curtain.\n *\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initialize = function(){\n\n // Ensure proper responsive class is present on the containing node if called for\n if (this.layout.responsive_resize){\n d3.select(this.container).classed(\"lz-container-responsive\", true);\n }\n\n // Create an element/layer for containing mouse guides\n if (this.layout.mouse_guide) {\n var mouse_guide_svg = this.svg.append(\"g\")\n .attr(\"class\", \"lz-mouse_guide\").attr(\"id\", this.id + \".mouse_guide\");\n var mouse_guide_vertical_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-vertical\").attr(\"x\",-1);\n var mouse_guide_horizontal_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-horizontal\").attr(\"y\",-1);\n this.mouse_guide = {\n svg: mouse_guide_svg,\n vertical: mouse_guide_vertical_svg,\n horizontal: mouse_guide_horizontal_svg\n };\n }\n\n // Add curtain and loader prototpyes to the plot\n this.curtain = LocusZoom.generateCurtain.call(this);\n this.loader = LocusZoom.generateLoader.call(this);\n\n // Create the panel_boundaries object with show/position/hide methods\n this.panel_boundaries = {\n parent: this,\n hide_timeout: null,\n showing: false,\n dragging: false,\n selectors: [],\n corner_selector: null,\n show: function(){\n // Generate panel boundaries\n if (!this.showing && !this.parent.curtain.showing){\n this.showing = true;\n // Loop through all panels to create a horizontal boundary for each\n this.parent.panel_ids_by_y_index.forEach(function(panel_id, panel_idx){\n var selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-boundary\")\n .attr(\"title\", \"Resize panel\");\n selector.append(\"span\");\n var panel_resize_drag = d3.behavior.drag();\n panel_resize_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n panel_resize_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n panel_resize_drag.on(\"drag\", function(){\n // First set the dimensions on the panel we're resizing\n var this_panel = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]];\n var original_panel_height = this_panel.layout.height;\n this_panel.setDimensions(this_panel.layout.width, this_panel.layout.height + d3.event.dy);\n var panel_height_change = this_panel.layout.height - original_panel_height;\n var new_calculated_plot_height = this.parent.layout.height + panel_height_change;\n // Next loop through all panels.\n // Update proportional dimensions for all panels including the one we've resized using discrete heights.\n // Reposition panels with a greater y-index than this panel to their appropriate new origin.\n this.parent.panel_ids_by_y_index.forEach(function(loop_panel_id, loop_panel_idx){\n var loop_panel = this.parent.panels[this.parent.panel_ids_by_y_index[loop_panel_idx]];\n loop_panel.layout.proportional_height = loop_panel.layout.height / new_calculated_plot_height;\n if (loop_panel_idx > panel_idx){\n loop_panel.setOrigin(loop_panel.layout.origin.x, loop_panel.layout.origin.y + panel_height_change);\n loop_panel.dashboard.position();\n }\n }.bind(this));\n // Reset dimensions on the entire plot and reposition panel boundaries\n this.parent.positionPanels();\n this.position();\n }.bind(this));\n selector.call(panel_resize_drag);\n this.parent.panel_boundaries.selectors.push(selector);\n }.bind(this));\n // Create a corner boundary / resize element on the bottom-most panel that resizes the entire plot\n var corner_selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-corner-boundary\")\n .attr(\"title\", \"Resize plot\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-outer\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-inner\");\n var corner_drag = d3.behavior.drag();\n corner_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n corner_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n corner_drag.on(\"drag\", function(){\n this.setDimensions(this.layout.width + d3.event.dx, this.layout.height + d3.event.dy);\n }.bind(this.parent));\n corner_selector.call(corner_drag);\n this.parent.panel_boundaries.corner_selector = corner_selector;\n }\n return this.position();\n },\n position: function(){\n if (!this.showing){ return this; }\n // Position panel boundaries\n var plot_page_origin = this.parent.getPageOrigin();\n this.selectors.forEach(function(selector, panel_idx){\n var panel_page_origin = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].getPageOrigin();\n var left = plot_page_origin.x;\n var top = panel_page_origin.y + this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].layout.height - 12;\n var width = this.parent.layout.width - 1;\n selector.style({\n top: top + \"px\",\n left: left + \"px\",\n width: width + \"px\"\n });\n selector.select(\"span\").style({\n width: width + \"px\"\n });\n }.bind(this));\n // Position corner selector\n var corner_padding = 10;\n var corner_size = 16;\n this.corner_selector.style({\n top: (plot_page_origin.y + this.parent.layout.height - corner_padding - corner_size) + \"px\",\n left: (plot_page_origin.x + this.parent.layout.width - corner_padding - corner_size) + \"px\"\n });\n return this;\n },\n hide: function(){\n if (!this.showing){ return this; }\n this.showing = false;\n // Remove panel boundaries\n this.selectors.forEach(function(selector){ selector.remove(); });\n this.selectors = [];\n // Remove corner boundary\n this.corner_selector.remove();\n this.corner_selector = null;\n return this;\n }\n };\n\n // Show panel boundaries stipulated by the layout (basic toggle, only show on mouse over plot)\n if (this.layout.panel_boundaries){\n d3.select(this.svg.node().parentNode).on(\"mouseover.\" + this.id + \".panel_boundaries\", function(){\n clearTimeout(this.panel_boundaries.hide_timeout);\n this.panel_boundaries.show();\n }.bind(this));\n d3.select(this.svg.node().parentNode).on(\"mouseout.\" + this.id + \".panel_boundaries\", function(){\n this.panel_boundaries.hide_timeout = setTimeout(function(){\n this.panel_boundaries.hide();\n }.bind(this), 300);\n }.bind(this));\n }\n\n // Create the dashboard object and immediately show it\n this.dashboard = new LocusZoom.Dashboard(this).show();\n\n // Initialize all panels\n for (var id in this.panels){\n this.panels[id].initialize();\n }\n\n // Define plot-level mouse events\n var namespace = \".\" + this.id;\n if (this.layout.mouse_guide) {\n var mouseout_mouse_guide = function(){\n this.mouse_guide.vertical.attr(\"x\", -1);\n this.mouse_guide.horizontal.attr(\"y\", -1);\n }.bind(this);\n var mousemove_mouse_guide = function(){\n var coords = d3.mouse(this.svg.node());\n this.mouse_guide.vertical.attr(\"x\", coords[0]);\n this.mouse_guide.horizontal.attr(\"y\", coords[1]);\n }.bind(this);\n this.svg\n .on(\"mouseout\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"touchleave\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"mousemove\" + namespace + \"-mouse_guide\", mousemove_mouse_guide);\n }\n var mouseup = function(){\n this.stopDrag();\n }.bind(this);\n var mousemove = function(){\n if (this.interaction.dragging){\n var coords = d3.mouse(this.svg.node());\n if (d3.event){ d3.event.preventDefault(); }\n this.interaction.dragging.dragged_x = coords[0] - this.interaction.dragging.start_x;\n this.interaction.dragging.dragged_y = coords[1] - this.interaction.dragging.start_y;\n this.panels[this.interaction.panel_id].render();\n this.interaction.linked_panel_ids.forEach(function(panel_id){\n this.panels[panel_id].render();\n }.bind(this));\n }\n }.bind(this);\n this.svg\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup)\n .on(\"mousemove\" + namespace, mousemove)\n .on(\"touchmove\" + namespace, mousemove);\n\n // Add an extra namespaced mouseup handler to the containing body, if there is one\n // This helps to stop interaction events gracefully when dragging outside of the plot element\n if (!d3.select(\"body\").empty()){\n d3.select(\"body\")\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup);\n }\n\n this.initialized = true;\n\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n var client_rect = this.svg.node().getBoundingClientRect();\n var width = client_rect.width ? client_rect.width : this.layout.width;\n var height = client_rect.height ? client_rect.height : this.layout.height;\n this.setDimensions(width, height);\n\n return this;\n\n};\n\n/**\n * Refresh (or fetch) a plot's data from sources, regardless of whether position or state has changed\n * @returns {Promise}\n */\nLocusZoom.Plot.prototype.refresh = function(){\n return this.applyState();\n};\n\n\n/**\n * A user-defined callback function that can receive (and potentially act on) new plot data.\n * @callback externalDataCallback\n * @param {Object} new_data The body resulting from a data request. This represents the same information that would be passed to\n * a data layer making an equivalent request.\n */\n\n/**\n * A user-defined callback function that can respond to errors received during a previous operation\n * @callback externalErrorCallback\n * @param err A representation of the error that occurred\n */\n\n/**\n * Allow newly fetched data to be made available outside the LocusZoom plot. For example, a callback could be\n * registered to draw an HTML table of top GWAS hits, and update that table whenever the plot region changes.\n *\n * This is a convenience method for external hooks. It registers an event listener and returns parsed data,\n * using the same fields syntax and underlying methods as data layers.\n *\n * @param {String[]} fields An array of field names and transforms, in the same syntax used by a data layer.\n * Different data sources should be prefixed by the source name.\n * @param {externalDataCallback} success_callback Used defined function that is automatically called any time that\n * new data is received by the plot.\n * @param {Object} [opts] Options\n * @param {externalErrorCallback} [opts.onerror] User defined function that is automatically called if a problem\n * occurs during the data request or subsequent callback operations\n * @param {boolean} [opts.discrete=false] Normally the callback will subscribe to the combined body from the chain,\n * which may not be in a format that matches what the external callback wants to do. If discrete=true, returns the\n * uncombined record info\n * @return {function} The newly created event listener, to allow for later cleanup/removal\n */\nLocusZoom.Plot.prototype.subscribeToData = function(fields, success_callback, opts) {\n opts = opts || {};\n\n // Register an event listener that is notified whenever new data has been rendered\n var error_callback = opts.onerror || function(err) {\n console.log(\"An error occurred while acting on an external callback\", err);\n };\n var self = this;\n\n var listener = function() {\n try {\n self.lzd.getData(self.state, fields)\n .then(function (new_data) {\n success_callback(opts.discrete ? new_data.discrete : new_data.body);\n }).catch(error_callback);\n } catch (error) {\n // In certain cases, errors are thrown before a promise can be generated, and LZ error display seems to rely on these errors bubbling up\n error_callback(error);\n }\n };\n this.on(\"data_rendered\", listener);\n return listener;\n};\n\n/**\n * Update state values and trigger a pull for fresh data on all data sources for all data layers\n * @param state_changes\n * @returns {Promise} A promise that resolves when all data fetch and update operations are complete\n */\nLocusZoom.Plot.prototype.applyState = function(state_changes){\n state_changes = state_changes || {};\n if (typeof state_changes != \"object\"){\n throw(\"LocusZoom.applyState only accepts an object; \" + (typeof state_changes) + \" given\");\n }\n\n // First make a copy of the current (old) state to work with\n var new_state = JSON.parse(JSON.stringify(this.state));\n\n // Apply changes by top-level property to the new state\n for (var property in state_changes) {\n new_state[property] = state_changes[property];\n }\n\n // Validate the new state (may do nothing, may do a lot, depends on how the user has things set up)\n new_state = LocusZoom.validateState(new_state, this.layout);\n\n // Apply new state to the actual state\n for (property in new_state) {\n this.state[property] = new_state[property];\n }\n\n // Generate requests for all panels given new state\n this.emit(\"data_requested\");\n this.remap_promises = [];\n this.loading_data = true;\n for (var id in this.panels){\n this.remap_promises.push(this.panels[id].reMap());\n }\n\n return Q.all(this.remap_promises)\n .catch(function(error){\n console.error(error);\n this.curtain.drop(error);\n this.loading_data = false;\n }.bind(this))\n .then(function(){\n // TODO: Check logic here; in some promise implementations, this would cause the error to be considered handled, and \"then\" would always fire. (may or may not be desired behavior)\n // Update dashboard / components\n this.dashboard.update();\n\n // Apply panel-level state values\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel = this.panels[panel_id];\n panel.dashboard.update();\n // Apply data-layer-level state values\n panel.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n var data_layer = this.data_layers[data_layer_id];\n var state_id = panel_id + \".\" + data_layer_id;\n for (var property in this.state[state_id]){\n if (!this.state[state_id].hasOwnProperty(property)){ continue; }\n if (Array.isArray(this.state[state_id][property])){\n this.state[state_id][property].forEach(function(element_id){\n try {\n this.setElementStatus(property, this.getElementById(element_id), true);\n } catch (e){\n console.error(\"Unable to apply state: \" + state_id + \", \" + property);\n }\n }.bind(data_layer));\n }\n }\n }.bind(panel));\n }.bind(this));\n\n // Emit events\n this.emit(\"layout_changed\");\n this.emit(\"data_rendered\");\n this.emit(\"state_changed\", state_changes);\n\n this.loading_data = false;\n\n }.bind(this));\n};\n\n/**\n * Register interactions along the specified axis, provided that the target panel allows interaction.\n *\n * @param {LocusZoom.Panel} panel\n * @param {('x_tick'|'y1_tick'|'y2_tick')} method The direction (axis) along which dragging is being performed.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.startDrag = function(panel, method){\n\n panel = panel || null;\n method = method || null;\n\n var axis = null;\n switch (method){\n case \"background\":\n case \"x_tick\":\n axis = \"x\";\n break;\n case \"y1_tick\":\n axis = \"y1\";\n break;\n case \"y2_tick\":\n axis = \"y2\";\n break;\n }\n\n if (!(panel instanceof LocusZoom.Panel) || !axis || !this.canInteract()){ return this.stopDrag(); }\n\n var coords = d3.mouse(this.svg.node());\n this.interaction = {\n panel_id: panel.id,\n linked_panel_ids: panel.getLinkedPanelIds(axis),\n dragging: {\n method: method,\n start_x: coords[0],\n start_y: coords[1],\n dragged_x: 0,\n dragged_y: 0,\n axis: axis\n }\n };\n\n this.svg.style(\"cursor\", \"all-scroll\");\n\n return this;\n\n};\n\n/**\n * Process drag interactions across the target panel and synchronize plot state across other panels in sync;\n * clear the event when complete\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.stopDrag = function(){\n\n if (!this.interaction.dragging){ return this; }\n\n if (typeof this.panels[this.interaction.panel_id] != \"object\"){\n this.interaction = {};\n return this;\n }\n var panel = this.panels[this.interaction.panel_id];\n\n // Helper function to find the appropriate axis layouts on child data layers\n // Once found, apply the extent as floor/ceiling and remove all other directives\n // This forces all associated axes to conform to the extent generated by a drag action\n var overrideAxisLayout = function(axis, axis_number, extent){\n panel.data_layer_ids_by_z_index.forEach(function(id){\n if (panel.data_layers[id].layout[axis+\"_axis\"].axis === axis_number){\n panel.data_layers[id].layout[axis+\"_axis\"].floor = extent[0];\n panel.data_layers[id].layout[axis+\"_axis\"].ceiling = extent[1];\n delete panel.data_layers[id].layout[axis+\"_axis\"].lower_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].upper_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].min_extent;\n delete panel.data_layers[id].layout[axis+\"_axis\"].ticks;\n }\n });\n };\n\n switch(this.interaction.dragging.method){\n case \"background\":\n case \"x_tick\":\n if (this.interaction.dragging.dragged_x !== 0){\n overrideAxisLayout(\"x\", 1, panel.x_extent);\n this.applyState({ start: panel.x_extent[0], end: panel.x_extent[1] });\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n if (this.interaction.dragging.dragged_y !== 0){\n // TODO: Hardcoded assumption of only two possible axes with single-digit #s (switch/case)\n var y_axis_number = parseInt(this.interaction.dragging.method[1]);\n overrideAxisLayout(\"y\", y_axis_number, panel[\"y\"+y_axis_number+\"_extent\"]);\n }\n break;\n }\n\n this.interaction = {};\n this.svg.style(\"cursor\", null);\n\n return this;\n\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A panel is an abstract class representing a subdivision of the LocusZoom stage\n * to display a distinct data representation as a collection of data layers.\n * @class\n * @param {Object} layout\n * @param {LocusZoom.Plot|null} parent\n*/\nLocusZoom.Panel = function(layout, parent) {\n\n if (typeof layout !== \"object\"){\n throw \"Unable to create panel, invalid layout\";\n }\n\n /** @member {LocusZoom.Plot|null} */\n this.parent = parent || null;\n /** @member {LocusZoom.Plot|null} */\n this.parent_plot = parent;\n\n // Ensure a valid ID is present. If there is no valid ID then generate one\n if (typeof layout.id !== \"string\" || !layout.id.length){\n if (!this.parent){\n layout.id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n } else {\n var id = null;\n var generateID = function(){\n id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n if (id == null || typeof this.parent.panels[id] != \"undefined\"){\n id = generateID();\n }\n }.bind(this);\n layout.id = id;\n }\n } else if (this.parent) {\n if (typeof this.parent.panels[layout.id] !== \"undefined\"){\n throw \"Cannot create panel with id [\" + layout.id + \"]; panel with that id already exists\";\n }\n }\n /** @member {String} */\n this.id = layout.id;\n\n /** @member {Boolean} */\n this.initialized = false;\n /**\n * The index of this panel in the parent plot's `layout.panels`\n * @member {number}\n * */\n this.layout_idx = null;\n /** @member {Object} */\n this.svg = {};\n\n /**\n * A JSON-serializable object used to describe the composition of the Panel\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.Panel.DefaultLayout);\n\n // Define state parameters specific to this panel\n if (this.parent){\n /** @member {Object} */\n this.state = this.parent.state;\n\n /** @member {String} */\n this.state_id = this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n } else {\n this.state = null;\n this.state_id = null;\n }\n\n /** @member {Object} */\n this.data_layers = {};\n /** @member {String[]} */\n this.data_layer_ids_by_z_index = [];\n\n /** @protected */\n this.applyDataLayerZIndexesToDataLayerLayouts = function(){\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n }.bind(this);\n\n /**\n * Track data requests in progress\n * @member {Promise[]}\n * @protected\n */\n this.data_promises = [];\n\n /** @member {d3.scale} */\n this.x_scale = null;\n /** @member {d3.scale} */\n this.y1_scale = null;\n /** @member {d3.scale} */\n this.y2_scale = null;\n\n /** @member {d3.extent} */\n this.x_extent = null;\n /** @member {d3.extent} */\n this.y1_extent = null;\n /** @member {d3.extent} */\n this.y2_extent = null;\n\n /** @member {Number[]} */\n this.x_ticks = [];\n /** @member {Number[]} */\n this.y1_ticks = [];\n /** @member {Number[]} */\n this.y2_ticks = [];\n\n /**\n * A timeout ID as returned by setTimeout\n * @protected\n * @member {number}\n */\n this.zoom_timeout = null;\n\n /** @returns {string} */\n this.getBaseId = function(){\n return this.parent.id + \".\" + this.id;\n };\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": []\n };\n /**\n * There are several events that a LocusZoom panel can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following panel-level events are currently supported:\n * - `layout_changed` - context: panel - Any aspect of the panel's layout (including dimensions or state) has changed.\n * - `data_requested` - context: panel - A request for new data from any data source used in the panel has been made.\n * - `data_rendered` - context: panel - Data from a request has been received and rendered in the panel.\n * - `element_clicked` - context: panel - A data element in any of the panel's data layers has been clicked.\n * - `element_selection` - context: panel - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `panel.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * panel itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of the event (as defined in `event_hooks`)\n * @param {function} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n // TODO: Dry plot and panel event code into a shared mixin\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Panel}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n *\n * There is a shorter overloaded form of this method: if the event does not have any data, the second\n * argument can be a boolean to control bubbling\n *\n * @param {string} event A known event name\n * @param {*} [eventData] Data or event description that will be passed to the event listener\n * @param {boolean} [bubble=false] Whether to bubble the event to the parent\n * @returns {LocusZoom.Panel}\n */\n this.emit = function(event, eventData, bubble) {\n bubble = bubble || false;\n\n // TODO: DRY this with the parent plot implementation. Ensure interfaces remain compatible.\n // TODO: Improve documentation for overloaded method signature (JSDoc may have trouble here)\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n if (typeof eventData === \"boolean\" && arguments.length === 2) {\n // Overloaded method signature: emit(event, bubble)\n bubble = eventData;\n eventData = null;\n }\n var sourceID = this.getBaseId();\n var self = this;\n var eventContext = {sourceID: sourceID, data: eventData || null};\n this.event_hooks[event].forEach(function(hookToRun) {\n // By default, any handlers fired here will see the panel as the value of `this`. If a bound function is\n // registered as a handler, the previously bound `this` will override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n if (bubble && this.parent) {\n this.parent.emit(event, eventContext);\n }\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\n this.getPageOrigin = function(){\n var plot_origin = this.parent.getPageOrigin();\n return {\n x: plot_origin.x + this.layout.origin.x,\n y: plot_origin.y + this.layout.origin.y\n };\n };\n\n // Initialize the layout\n this.initializeLayout();\n\n return this;\n\n};\n\n/**\n * Default panel layout\n * @static\n * @type {Object}\n */\nLocusZoom.Panel.DefaultLayout = {\n title: { text: \"\", style: {}, x: 10, y: 22 },\n y_index: null,\n width: 0,\n height: 0,\n origin: { x: 0, y: null },\n min_width: 1,\n min_height: 1,\n proportional_width: null,\n proportional_height: null,\n proportional_origin: { x: 0, y: null },\n margin: { top: 0, right: 0, bottom: 0, left: 0 },\n background_click: \"clear_selections\",\n dashboard: {\n components: []\n },\n cliparea: {\n height: 0,\n width: 0,\n origin: { x: 0, y: 0 }\n },\n axes: { // These are the only axes supported!!\n x: {},\n y1: {},\n y2: {}\n },\n legend: null,\n interaction: {\n drag_background_to_pan: false,\n drag_x_ticks_to_scale: false,\n drag_y1_ticks_to_scale: false,\n drag_y2_ticks_to_scale: false,\n scroll_to_zoom: false,\n x_linked: false,\n y1_linked: false,\n y2_linked: false\n },\n data_layers: []\n};\n\n/**\n * Prepare the panel for first use by performing parameter validation, creating axes, setting default dimensions,\n * and preparing / positioning data layers as appropriate.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initializeLayout = function(){\n\n // If the layout is missing BOTH width and proportional width then set the proportional width to 1.\n // This will default the panel to taking up the full width of the plot.\n if (this.layout.width === 0 && this.layout.proportional_width === null){\n this.layout.proportional_width = 1;\n }\n\n // If the layout is missing BOTH height and proportional height then set the proportional height to\n // an equal share of the plot's current height.\n if (this.layout.height === 0 && this.layout.proportional_height === null){\n var panel_count = Object.keys(this.parent.panels).length;\n if (panel_count > 0){\n this.layout.proportional_height = (1 / panel_count);\n } else {\n this.layout.proportional_height = 1;\n }\n }\n\n // Set panel dimensions, origin, and margin\n this.setDimensions();\n this.setOrigin();\n this.setMargin();\n\n // Set ranges\n // TODO: Define stub values in constructor\n this.x_range = [0, this.layout.cliparea.width];\n this.y1_range = [this.layout.cliparea.height, 0];\n this.y2_range = [this.layout.cliparea.height, 0];\n\n // Initialize panel axes\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!Object.keys(this.layout.axes[axis]).length || this.layout.axes[axis].render ===false){\n // The default layout sets the axis to an empty object, so set its render boolean here\n this.layout.axes[axis].render = false;\n } else {\n this.layout.axes[axis].render = true;\n this.layout.axes[axis].label = this.layout.axes[axis].label || null;\n this.layout.axes[axis].label_function = this.layout.axes[axis].label_function || null;\n }\n }.bind(this));\n\n // Add data layers (which define x and y extents)\n this.layout.data_layers.forEach(function(data_layer_layout){\n this.addDataLayer(data_layer_layout);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Set the dimensions for the panel. If passed with no arguments will calculate optimal size based on layout\n * directives and the available area within the plot. If passed discrete width (number) and height (number) will\n * attempt to resize the panel to them, but may be limited by minimum dimensions defined on the plot or panel.\n *\n * @public\n * @param {number} [width]\n * @param {number} [height]\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setDimensions = function(width, height){\n if (typeof width != \"undefined\" && typeof height != \"undefined\"){\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n }\n } else {\n if (this.layout.proportional_width !== null){\n this.layout.width = Math.max(this.layout.proportional_width * this.parent.layout.width, this.layout.min_width);\n }\n if (this.layout.proportional_height !== null){\n this.layout.height = Math.max(this.layout.proportional_height * this.parent.layout.height, this.layout.min_height);\n }\n }\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n if (this.svg.clipRect){\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n if (this.initialized){\n this.render();\n this.curtain.update();\n this.loader.update();\n this.dashboard.update();\n if (this.legend){ this.legend.position(); }\n }\n return this;\n};\n\n/**\n * Set panel origin on the plot, and re-render as appropriate\n *\n * @public\n * @param {number} x\n * @param {number} y\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setOrigin = function(x, y){\n if (!isNaN(x) && x >= 0){ this.layout.origin.x = Math.max(Math.round(+x), 0); }\n if (!isNaN(y) && y >= 0){ this.layout.origin.y = Math.max(Math.round(+y), 0); }\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set margins around this panel\n * @public\n * @param {number} top\n * @param {number} right\n * @param {number} bottom\n * @param {number} left\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setMargin = function(top, right, bottom, left){\n var extra;\n if (!isNaN(top) && top >= 0){ this.layout.margin.top = Math.max(Math.round(+top), 0); }\n if (!isNaN(right) && right >= 0){ this.layout.margin.right = Math.max(Math.round(+right), 0); }\n if (!isNaN(bottom) && bottom >= 0){ this.layout.margin.bottom = Math.max(Math.round(+bottom), 0); }\n if (!isNaN(left) && left >= 0){ this.layout.margin.left = Math.max(Math.round(+left), 0); }\n if (this.layout.margin.top + this.layout.margin.bottom > this.layout.height){\n extra = Math.floor(((this.layout.margin.top + this.layout.margin.bottom) - this.layout.height) / 2);\n this.layout.margin.top -= extra;\n this.layout.margin.bottom -= extra;\n }\n if (this.layout.margin.left + this.layout.margin.right > this.layout.width){\n extra = Math.floor(((this.layout.margin.left + this.layout.margin.right) - this.layout.width) / 2);\n this.layout.margin.left -= extra;\n this.layout.margin.right -= extra;\n }\n [\"top\", \"right\", \"bottom\", \"left\"].forEach(function(m){\n this.layout.margin[m] = Math.max(this.layout.margin[m], 0);\n }.bind(this));\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n this.layout.cliparea.origin.x = this.layout.margin.left;\n this.layout.cliparea.origin.y = this.layout.margin.top;\n\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set the title for the panel. If passed an object, will merge the object with the existing layout configuration, so\n * that all or only some of the title layout object's parameters can be customized. If passed null, false, or an empty\n * string, the title DOM element will be set to display: none.\n *\n * @param {string|object|null} title The title text, or an object with additional configuration\n * @param {string} title.text Text to display. Since titles are rendered as SVG text, HTML and newlines will not be rendered.\n * @param {number} title.x X-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n * @param {number} title.y Y-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n NOTE: SVG y values go from the top down, so the SVG origin of (0,0) is in the top left corner.\n * @param {object} title.style CSS styles object to be applied to the title's DOM element.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setTitle = function(title){\n if (typeof this.layout.title == \"string\"){\n var text = this.layout.title;\n this.layout.title = { text: text, x: 0, y: 0, style: {} };\n }\n if (typeof title == \"string\"){\n this.layout.title.text = title;\n } else if (typeof title == \"object\" && title !== null){\n this.layout.title = LocusZoom.Layouts.merge(title, this.layout.title);\n }\n if (this.layout.title.text.length){\n this.title.attr(\"display\", null)\n .attr(\"x\", parseFloat(this.layout.title.x))\n .attr(\"y\", parseFloat(this.layout.title.y))\n .style(this.layout.title.style)\n .text(this.layout.title.text);\n } else {\n this.title.attr(\"display\", \"none\");\n }\n return this;\n};\n\n\n/**\n * Prepare the first rendering of the panel. This includes drawing the individual data layers, but also creates shared\n * elements such as axes, title, and loader/curtain.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initialize = function(){\n\n // Append a container group element to house the main panel group element and the clip path\n // Position with initial layout parameters\n this.svg.container = this.parent.svg.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel_container\")\n .attr(\"transform\", \"translate(\" + (this.layout.origin.x || 0) + \",\" + (this.layout.origin.y || 0) + \")\");\n\n // Append clip path to the parent svg element, size with initial layout parameters\n var clipPath = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\");\n this.svg.clipRect = clipPath.append(\"rect\")\n .attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Append svg group for rendering all panel child elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n // Add curtain and loader prototypes to the panel\n /** @member {Object} */\n this.curtain = LocusZoom.generateCurtain.call(this);\n /** @member {Object} */\n this.loader = LocusZoom.generateLoader.call(this);\n\n /**\n * Create the dashboard object and hang components on it as defined by panel layout\n * @member {LocusZoom.Dashboard}\n */\n this.dashboard = new LocusZoom.Dashboard(this);\n\n // Inner border\n this.inner_border = this.svg.group.append(\"rect\")\n .attr(\"class\", \"lz-panel-background\")\n .on(\"click\", function(){\n if (this.layout.background_click === \"clear_selections\"){ this.clearSelections(); }\n }.bind(this));\n\n // Add the title\n /** @member {Element} */\n this.title = this.svg.group.append(\"text\").attr(\"class\", \"lz-panel-title\");\n if (typeof this.layout.title != \"undefined\"){ this.setTitle(); }\n\n // Initialize Axes\n this.svg.x_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".x_axis\").attr(\"class\", \"lz-x lz-axis\");\n if (this.layout.axes.x.render){\n this.svg.x_axis_label = this.svg.x_axis.append(\"text\")\n .attr(\"class\", \"lz-x lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y1_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y1_axis\").attr(\"class\", \"lz-y lz-y1 lz-axis\");\n if (this.layout.axes.y1.render){\n this.svg.y1_axis_label = this.svg.y1_axis.append(\"text\")\n .attr(\"class\", \"lz-y1 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y2_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y2_axis\").attr(\"class\", \"lz-y lz-y2 lz-axis\");\n if (this.layout.axes.y2.render){\n this.svg.y2_axis_label = this.svg.y2_axis.append(\"text\")\n .attr(\"class\", \"lz-y2 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n\n // Initialize child Data Layers\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].initialize();\n }.bind(this));\n\n /**\n * Legend object, as defined by panel layout and child data layer layouts\n * @member {LocusZoom.Legend}\n * */\n this.legend = null;\n if (this.layout.legend){\n this.legend = new LocusZoom.Legend(this);\n }\n\n // Establish panel background drag interaction mousedown event handler (on the panel background)\n if (this.layout.interaction.drag_background_to_pan){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var mousedown = function(){\n this.parent.startDrag(this, \"background\");\n }.bind(this);\n this.svg.container.select(\".lz-panel-background\")\n .on(\"mousedown\" + namespace + \".background\", mousedown)\n .on(\"touchstart\" + namespace + \".background\", mousedown);\n }\n\n return this;\n\n};\n\n/**\n * Refresh the sort order of all data layers (called by data layer moveUp and moveDown methods)\n */\nLocusZoom.Panel.prototype.resortDataLayers = function(){\n var sort = [];\n this.data_layer_ids_by_z_index.forEach(function(id){\n sort.push(this.data_layers[id].layout.z_index);\n }.bind(this));\n this.svg.group.selectAll(\"g.lz-data_layer-container\").data(sort).sort(d3.ascending);\n this.applyDataLayerZIndexesToDataLayerLayouts();\n};\n\n/**\n * Get an array of panel IDs that are axis-linked to this panel\n * @param {('x'|'y1'|'y2')} axis\n * @returns {Array}\n */\nLocusZoom.Panel.prototype.getLinkedPanelIds = function(axis){\n axis = axis || null;\n var linked_panel_ids = [];\n if ([\"x\",\"y1\",\"y2\"].indexOf(axis) === -1){ return linked_panel_ids; }\n if (!this.layout.interaction[axis + \"_linked\"]){ return linked_panel_ids; }\n this.parent.panel_ids_by_y_index.forEach(function(panel_id){\n if (panel_id !== this.id && this.parent.panels[panel_id].layout.interaction[axis + \"_linked\"]){\n linked_panel_ids.push(panel_id);\n }\n }.bind(this));\n return linked_panel_ids;\n};\n\n/**\n * Move a panel up relative to others by y-index\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveUp = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index - 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index - 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index - 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Move a panel down (y-axis) relative to others in the plot\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveDown = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index + 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index + 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index + 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Create a new data layer from a provided layout object. Should have the keys specified in `DefaultLayout`\n * Will automatically add at the top (depth/z-index) of the panel unless explicitly directed differently\n * in the layout provided.\n * @param {object} layout\n * @returns {*}\n */\nLocusZoom.Panel.prototype.addDataLayer = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\" || typeof layout.id !== \"string\" || !layout.id.length){\n throw \"Invalid data layer layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n if (typeof this.data_layers[layout.id] !== \"undefined\"){\n throw \"Cannot create data_layer with id [\" + layout.id + \"]; data layer with that id already exists in the panel\";\n }\n if (typeof layout.type !== \"string\"){\n throw \"Invalid data layer type in layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n\n // If the layout defines a y axis make sure the axis number is set and is 1 or 2 (default to 1)\n if (typeof layout.y_axis == \"object\" && (typeof layout.y_axis.axis == \"undefined\" || [1,2].indexOf(layout.y_axis.axis) === -1)){\n layout.y_axis.axis = 1;\n }\n\n // Create the Data Layer\n var data_layer = LocusZoom.DataLayers.get(layout.type, layout, this);\n\n // Store the Data Layer on the Panel\n this.data_layers[data_layer.id] = data_layer;\n\n // If a discrete z_index was set in the layout then adjust other data layer z_index values to accommodate this one\n if (data_layer.layout.z_index !== null && !isNaN(data_layer.layout.z_index)\n && this.data_layer_ids_by_z_index.length > 0){\n // Negative z_index values should count backwards from the end, so convert negatives to appropriate values here\n if (data_layer.layout.z_index < 0){\n data_layer.layout.z_index = Math.max(this.data_layer_ids_by_z_index.length + data_layer.layout.z_index, 0);\n }\n this.data_layer_ids_by_z_index.splice(data_layer.layout.z_index, 0, data_layer.id);\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n } else {\n var length = this.data_layer_ids_by_z_index.push(data_layer.id);\n this.data_layers[data_layer.id].layout.z_index = length - 1;\n }\n\n // Determine if this data layer was already in the layout.data_layers array.\n // If it wasn't, add it. Either way store the layout.data_layers array index on the data_layer.\n var layout_idx = null;\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n if (data_layer_layout.id === data_layer.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.data_layers.push(this.data_layers[data_layer.id].layout) - 1;\n }\n this.data_layers[data_layer.id].layout_idx = layout_idx;\n\n return this.data_layers[data_layer.id];\n};\n\n/**\n * Remove a data layer by id\n * @param {string} id\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.removeDataLayer = function(id){\n if (!this.data_layers[id]){\n throw (\"Unable to remove data layer, ID not found: \" + id);\n }\n\n // Destroy all tooltips for the data layer\n this.data_layers[id].destroyAllTooltips();\n\n // Remove the svg container for the data layer if it exists\n if (this.data_layers[id].svg.container){\n this.data_layers[id].svg.container.remove();\n }\n\n // Delete the data layer and its presence in the panel layout and state\n this.layout.data_layers.splice(this.data_layers[id].layout_idx, 1);\n delete this.state[this.data_layers[id].state_id];\n delete this.data_layers[id];\n\n // Remove the data_layer id from the z_index array\n this.data_layer_ids_by_z_index.splice(this.data_layer_ids_by_z_index.indexOf(id), 1);\n\n // Update layout_idx and layout.z_index values for all remaining data_layers\n this.applyDataLayerZIndexesToDataLayerLayouts();\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n this.data_layers[data_layer_layout.id].layout_idx = idx;\n }.bind(this));\n\n return this;\n};\n\n/**\n * Clear all selections on all data layers\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.clearSelections = function(){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(\"selected\", false);\n }.bind(this));\n return this;\n};\n\n/**\n * When the parent plot changes state, adjust the panel accordingly. For example, this may include fetching new data\n * from the API as the viewing region changes\n * @returns {Promise}\n */\nLocusZoom.Panel.prototype.reMap = function(){\n this.emit(\"data_requested\");\n this.data_promises = [];\n\n // Remove any previous error messages before attempting to load new data\n this.curtain.hide();\n // Trigger reMap on each Data Layer\n for (var id in this.data_layers){\n try {\n this.data_promises.push(this.data_layers[id].reMap());\n } catch (error) {\n console.warn(error);\n this.curtain.show(error);\n }\n }\n // When all finished trigger a render\n return Q.all(this.data_promises)\n .then(function(){\n this.initialized = true;\n this.render();\n this.emit(\"layout_changed\", true);\n this.emit(\"data_rendered\");\n }.bind(this))\n .catch(function(error){\n console.warn(error);\n this.curtain.show(error);\n }.bind(this));\n};\n\n/**\n * Iterate over data layers to generate panel axis extents\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.generateExtents = function(){\n\n // Reset extents\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n this[axis + \"_extent\"] = null;\n }.bind(this));\n\n // Loop through the data layers\n for (var id in this.data_layers){\n\n var data_layer = this.data_layers[id];\n\n // If defined and not decoupled, merge the x extent of the data layer with the panel's x extent\n if (data_layer.layout.x_axis && !data_layer.layout.x_axis.decoupled){\n this.x_extent = d3.extent((this.x_extent || []).concat(data_layer.getAxisExtent(\"x\")));\n }\n\n // If defined and not decoupled, merge the y extent of the data layer with the panel's appropriate y extent\n if (data_layer.layout.y_axis && !data_layer.layout.y_axis.decoupled){\n var y_axis = \"y\" + data_layer.layout.y_axis.axis;\n this[y_axis+\"_extent\"] = d3.extent((this[y_axis+\"_extent\"] || []).concat(data_layer.getAxisExtent(\"y\")));\n }\n\n }\n\n // Override x_extent from state if explicitly defined to do so\n if (this.layout.axes.x && this.layout.axes.x.extent === \"state\"){\n this.x_extent = [ this.state.start, this.state.end ];\n }\n\n return this;\n\n};\n\n/**\n * Generate an array of ticks for an axis. These ticks are generated in one of three ways (highest wins):\n * 1. An array of specific tick marks\n * 2. Query each data layer for what ticks are appropriate, and allow a panel-level tick configuration parameter\n * object to override the layer's default presentation settings\n * 3. Generate generic tick marks based on the extent of the data\n * @param {('x'|'y1'|'y2')} axis The string identifier of the axis\n * @returns {Number[]|Object[]} TODO: number format?\n * An array of numbers: interpreted as an array of axis value offsets for positioning.\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.Panel.prototype.generateTicks = function(axis){\n\n // Parse an explicit 'ticks' attribute in the axis layout\n if (this.layout.axes[axis].ticks){\n var layout = this.layout.axes[axis];\n\n var baseTickConfig = layout.ticks;\n if (Array.isArray(baseTickConfig)){\n // Array of specific ticks hard-coded into a panel will override any ticks that an individual layer might specify\n return baseTickConfig;\n }\n\n if (typeof baseTickConfig === \"object\") {\n // If the layout specifies base configuration for ticks- but without specific positions- then ask each\n // data layer to report the tick marks that it thinks it needs\n // TODO: Few layers currently need to specify custom ticks (which is ok!). But if it becomes common, consider adding mechanisms to deduplicate ticks across layers\n var self = this;\n\n // Pass any layer-specific customizations for how ticks are calculated. (styles are overridden separately)\n var config = { position: baseTickConfig.position };\n\n var combinedTicks = this.data_layer_ids_by_z_index.reduce(function(acc, data_layer_id) {\n var nextLayer = self.data_layers[data_layer_id];\n return acc.concat(nextLayer.getTicks(axis, config));\n }, []);\n\n return combinedTicks.map(function(item) {\n // The layer makes suggestions, but tick configuration params specified on the panel take precedence\n var itemConfig = {};\n itemConfig = LocusZoom.Layouts.merge(itemConfig, baseTickConfig);\n return LocusZoom.Layouts.merge(itemConfig, item);\n });\n }\n }\n\n // If no other configuration is provided, attempt to generate ticks from the extent\n if (this[axis + \"_extent\"]) {\n return LocusZoom.prettyTicks(this[axis + \"_extent\"], \"both\");\n }\n return [];\n};\n\n/**\n * Update rendering of this panel whenever an event triggers a redraw. Assumes that the panel has already been\n * prepared the first time via `initialize`\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.render = function(){\n\n // Position the panel container\n this.svg.container.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n\n // Set size on the clip rect\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Set and position the inner border, style if necessary\n this.inner_border\n .attr(\"x\", this.layout.margin.left).attr(\"y\", this.layout.margin.top)\n .attr(\"width\", this.layout.width - (this.layout.margin.left + this.layout.margin.right))\n .attr(\"height\", this.layout.height - (this.layout.margin.top + this.layout.margin.bottom));\n if (this.layout.inner_border){\n this.inner_border.style({ \"stroke-width\": 1, \"stroke\": this.layout.inner_border });\n }\n\n // Set/update panel title if necessary\n this.setTitle();\n\n // Regenerate all extents\n this.generateExtents();\n\n // Helper function to constrain any procedurally generated vectors (e.g. ranges, extents)\n // Constraints applied here keep vectors from going to infinity or beyond a definable power of ten\n var constrain = function(value, limit_exponent){\n var neg_min = Math.pow(-10, limit_exponent);\n var neg_max = Math.pow(-10, -limit_exponent);\n var pos_min = Math.pow(10, -limit_exponent);\n var pos_max = Math.pow(10, limit_exponent);\n if (value === Infinity){ value = pos_max; }\n if (value === -Infinity){ value = neg_min; }\n if (value === 0){ value = pos_min; }\n if (value > 0){ value = Math.max(Math.min(value, pos_max), pos_min); }\n if (value < 0){ value = Math.max(Math.min(value, neg_max), neg_min); }\n return value;\n };\n\n // Define default and shifted ranges for all axes\n var ranges = {};\n if (this.x_extent){\n var base_x_range = { start: 0, end: this.layout.cliparea.width };\n if (this.layout.axes.x.range){\n base_x_range.start = this.layout.axes.x.range.start || base_x_range.start;\n base_x_range.end = this.layout.axes.x.range.end || base_x_range.end;\n }\n ranges.x = [base_x_range.start, base_x_range.end];\n ranges.x_shifted = [base_x_range.start, base_x_range.end];\n }\n if (this.y1_extent){\n var base_y1_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y1.range){\n base_y1_range.start = this.layout.axes.y1.range.start || base_y1_range.start;\n base_y1_range.end = this.layout.axes.y1.range.end || base_y1_range.end;\n }\n ranges.y1 = [base_y1_range.start, base_y1_range.end];\n ranges.y1_shifted = [base_y1_range.start, base_y1_range.end];\n }\n if (this.y2_extent){\n var base_y2_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y2.range){\n base_y2_range.start = this.layout.axes.y2.range.start || base_y2_range.start;\n base_y2_range.end = this.layout.axes.y2.range.end || base_y2_range.end;\n }\n ranges.y2 = [base_y2_range.start, base_y2_range.end];\n ranges.y2_shifted = [base_y2_range.start, base_y2_range.end];\n }\n\n // Shift ranges based on any drag or zoom interactions currently underway\n if (this.parent.interaction.panel_id && (this.parent.interaction.panel_id === this.id || this.parent.interaction.linked_panel_ids.indexOf(this.id) !== -1)){\n var anchor, scalar = null;\n if (this.parent.interaction.zooming && typeof this.x_scale == \"function\"){\n var current_extent_size = Math.abs(this.x_extent[1] - this.x_extent[0]);\n var current_scaled_extent_size = Math.round(this.x_scale.invert(ranges.x_shifted[1])) - Math.round(this.x_scale.invert(ranges.x_shifted[0]));\n var zoom_factor = this.parent.interaction.zooming.scale;\n var potential_extent_size = Math.floor(current_scaled_extent_size * (1 / zoom_factor));\n if (zoom_factor < 1 && !isNaN(this.parent.layout.max_region_scale)){\n zoom_factor = 1 /(Math.min(potential_extent_size, this.parent.layout.max_region_scale) / current_scaled_extent_size);\n } else if (zoom_factor > 1 && !isNaN(this.parent.layout.min_region_scale)){\n zoom_factor = 1 / (Math.max(potential_extent_size, this.parent.layout.min_region_scale) / current_scaled_extent_size);\n }\n var new_extent_size = Math.floor(current_extent_size * zoom_factor);\n anchor = this.parent.interaction.zooming.center - this.layout.margin.left - this.layout.origin.x;\n var offset_ratio = anchor / this.layout.cliparea.width;\n var new_x_extent_start = Math.max(Math.floor(this.x_scale.invert(ranges.x_shifted[0]) - ((new_extent_size - current_scaled_extent_size) * offset_ratio)), 1);\n ranges.x_shifted = [ this.x_scale(new_x_extent_start), this.x_scale(new_x_extent_start + new_extent_size) ];\n } else if (this.parent.interaction.dragging){\n switch (this.parent.interaction.dragging.method){\n case \"background\":\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n break;\n case \"x_tick\":\n if (d3.event && d3.event.shiftKey){\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n } else {\n anchor = this.parent.interaction.dragging.start_x - this.layout.margin.left - this.layout.origin.x;\n scalar = constrain(anchor / (anchor + this.parent.interaction.dragging.dragged_x), 3);\n ranges.x_shifted[0] = 0;\n ranges.x_shifted[1] = Math.max(this.layout.cliparea.width * (1 / scalar), 1);\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n var y_shifted = \"y\" + this.parent.interaction.dragging.method[1] + \"_shifted\";\n if (d3.event && d3.event.shiftKey){\n ranges[y_shifted][0] = this.layout.cliparea.height + this.parent.interaction.dragging.dragged_y;\n ranges[y_shifted][1] = +this.parent.interaction.dragging.dragged_y;\n } else {\n anchor = this.layout.cliparea.height - (this.parent.interaction.dragging.start_y - this.layout.margin.top - this.layout.origin.y);\n scalar = constrain(anchor / (anchor - this.parent.interaction.dragging.dragged_y), 3);\n ranges[y_shifted][0] = this.layout.cliparea.height;\n ranges[y_shifted][1] = this.layout.cliparea.height - (this.layout.cliparea.height * (1 / scalar));\n }\n }\n }\n }\n\n // Generate scales and ticks for all axes, then render them\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!this[axis + \"_extent\"]){ return; }\n\n // Base Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"])\n .range(ranges[axis + \"_shifted\"]);\n\n // Shift the extent\n this[axis + \"_extent\"] = [\n this[axis + \"_scale\"].invert(ranges[axis][0]),\n this[axis + \"_scale\"].invert(ranges[axis][1])\n ];\n\n // Finalize Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"]).range(ranges[axis]);\n\n // Render axis (and generate ticks as needed)\n this.renderAxis(axis);\n }.bind(this));\n\n // Establish mousewheel zoom event handers on the panel (namespacing not passed through by d3, so not used here)\n if (this.layout.interaction.scroll_to_zoom){\n var zoom_handler = function(){\n // Look for a shift key press while scrolling to execute.\n // If not present, gracefully raise a notification and allow conventional scrolling\n if (!d3.event.shiftKey){\n if (this.parent.canInteract(this.id)){\n this.loader.show(\"Press [SHIFT] while scrolling to zoom\").hide(1000);\n }\n return;\n }\n d3.event.preventDefault();\n if (!this.parent.canInteract(this.id)){ return; }\n var coords = d3.mouse(this.svg.container.node());\n var delta = Math.max(-1, Math.min(1, (d3.event.wheelDelta || -d3.event.detail || -d3.event.deltaY)));\n if (delta === 0){ return; }\n this.parent.interaction = {\n panel_id: this.id,\n linked_panel_ids: this.getLinkedPanelIds(\"x\"),\n zooming: {\n scale: (delta < 1) ? 0.9 : 1.1,\n center: coords[0]\n }\n };\n this.render();\n this.parent.interaction.linked_panel_ids.forEach(function(panel_id){\n this.parent.panels[panel_id].render();\n }.bind(this));\n if (this.zoom_timeout !== null){ clearTimeout(this.zoom_timeout); }\n this.zoom_timeout = setTimeout(function(){\n this.parent.interaction = {};\n this.parent.applyState({ start: this.x_extent[0], end: this.x_extent[1] });\n }.bind(this), 500);\n }.bind(this);\n this.zoom_listener = d3.behavior.zoom();\n this.svg.container.call(this.zoom_listener)\n .on(\"wheel.zoom\", zoom_handler)\n .on(\"mousewheel.zoom\", zoom_handler)\n .on(\"DOMMouseScroll.zoom\", zoom_handler);\n }\n\n // Render data layers in order by z-index\n this.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n this.data_layers[data_layer_id].draw().render();\n }.bind(this));\n\n return this;\n};\n\n\n/**\n * Render ticks for a particular axis\n * @param {('x'|'y1'|'y2')} axis The identifier of the axes\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.renderAxis = function(axis){\n\n if ([\"x\", \"y1\", \"y2\"].indexOf(axis) === -1){\n throw(\"Unable to render axis; invalid axis identifier: \" + axis);\n }\n\n var canRender = this.layout.axes[axis].render\n && typeof this[axis + \"_scale\"] == \"function\"\n && !isNaN(this[axis + \"_scale\"](0));\n\n // If the axis has already been rendered then check if we can/can't render it\n // Make sure the axis element is shown/hidden to suit\n if (this[axis+\"_axis\"]){\n this.svg.container.select(\"g.lz-axis.lz-\"+axis).style(\"display\", canRender ? null : \"none\");\n }\n\n if (!canRender){ return this; }\n\n // Axis-specific values to plug in where needed\n var axis_params = {\n x: {\n position: \"translate(\" + this.layout.margin.left + \",\" + (this.layout.height - this.layout.margin.bottom) + \")\",\n orientation: \"bottom\",\n label_x: this.layout.cliparea.width / 2,\n label_y: (this.layout.axes[axis].label_offset || 0),\n label_rotate: null\n },\n y1: {\n position: \"translate(\" + this.layout.margin.left + \",\" + this.layout.margin.top + \")\",\n orientation: \"left\",\n label_x: -1 * (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n },\n y2: {\n position: \"translate(\" + (this.layout.width - this.layout.margin.right) + \",\" + this.layout.margin.top + \")\",\n orientation: \"right\",\n label_x: (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n }\n };\n\n // Generate Ticks\n this[axis + \"_ticks\"] = this.generateTicks(axis);\n\n // Determine if the ticks are all numbers (d3-automated tick rendering) or not (manual tick rendering)\n var ticksAreAllNumbers = (function(ticks){\n for (var i = 0; i < ticks.length; i++){\n if (isNaN(ticks[i])){\n return false;\n }\n }\n return true;\n })(this[axis+\"_ticks\"]);\n\n // Initialize the axis; set scale and orientation\n this[axis+\"_axis\"] = d3.svg.axis().scale(this[axis+\"_scale\"]).orient(axis_params[axis].orientation).tickPadding(3);\n\n // Set tick values and format\n if (ticksAreAllNumbers){\n this[axis+\"_axis\"].tickValues(this[axis+\"_ticks\"]);\n if (this.layout.axes[axis].tick_format === \"region\"){\n this[axis+\"_axis\"].tickFormat(function(d) { return LocusZoom.positionIntToString(d, 6); });\n }\n } else {\n var ticks = this[axis+\"_ticks\"].map(function(t){\n return(t[axis.substr(0,1)]);\n });\n this[axis+\"_axis\"].tickValues(ticks)\n .tickFormat(function(t, i) { return this[axis+\"_ticks\"][i].text; }.bind(this));\n }\n\n // Position the axis in the SVG and apply the axis construct\n this.svg[axis+\"_axis\"]\n .attr(\"transform\", axis_params[axis].position)\n .call(this[axis+\"_axis\"]);\n\n // If necessary manually apply styles and transforms to ticks as specified by the layout\n if (!ticksAreAllNumbers){\n var tick_selector = d3.selectAll(\"g#\" + this.getBaseId().replace(\".\",\"\\\\.\") + \"\\\\.\" + axis + \"_axis g.tick\");\n var panel = this;\n tick_selector.each(function(d, i){\n var selector = d3.select(this).select(\"text\");\n if (panel[axis+\"_ticks\"][i].style){\n selector.style(panel[axis+\"_ticks\"][i].style);\n }\n if (panel[axis+\"_ticks\"][i].transform){\n selector.attr(\"transform\", panel[axis+\"_ticks\"][i].transform);\n }\n });\n }\n\n // Render the axis label if necessary\n var label = this.layout.axes[axis].label || null;\n if (label !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"x\", axis_params[axis].label_x).attr(\"y\", axis_params[axis].label_y)\n .text(LocusZoom.parseFields(this.state, label));\n if (axis_params[axis].label_rotate !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"transform\", \"rotate(\" + axis_params[axis].label_rotate + \" \" + axis_params[axis].label_x + \",\" + axis_params[axis].label_y + \")\");\n }\n }\n\n // Attach interactive handlers to ticks as needed\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (this.layout.interaction[\"drag_\" + axis + \"_ticks_to_scale\"]){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var tick_mouseover = function(){\n if (typeof d3.select(this).node().focus == \"function\"){ d3.select(this).node().focus(); }\n var cursor = (axis === \"x\") ? \"ew-resize\" : \"ns-resize\";\n if (d3.event && d3.event.shiftKey){ cursor = \"move\"; }\n d3.select(this)\n .style({\"font-weight\": \"bold\", \"cursor\": cursor})\n .on(\"keydown\" + namespace, tick_mouseover)\n .on(\"keyup\" + namespace, tick_mouseover);\n };\n this.svg.container.selectAll(\".lz-axis.lz-\" + axis + \" .tick text\")\n .attr(\"tabindex\", 0) // necessary to make the tick focusable so keypress events can be captured\n .on(\"mouseover\" + namespace, tick_mouseover)\n .on(\"mouseout\" + namespace, function(){\n d3.select(this).style({\"font-weight\": \"normal\"});\n d3.select(this).on(\"keydown\" + namespace, null).on(\"keyup\" + namespace, null);\n })\n .on(\"mousedown\" + namespace, function(){\n this.parent.startDrag(this, axis + \"_tick\");\n }.bind(this));\n }\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Force the height of this panel to the largest absolute height of the data in\n * all child data layers (if not null for any child data layers)\n * @param {number} [target_height] A target height, which will be used in situations when the expected height can be\n * pre-calculated (eg when the layers are transitioning)\n */\nLocusZoom.Panel.prototype.scaleHeightToData = function(target_height){\n target_height = +target_height || null;\n if (target_height === null){\n this.data_layer_ids_by_z_index.forEach(function(id){\n var dh = this.data_layers[id].getAbsoluteDataHeight();\n if (+dh){\n if (target_height === null){ target_height = +dh; }\n else { target_height = Math.max(target_height, +dh); }\n }\n }.bind(this));\n }\n if (+target_height){\n target_height += +this.layout.margin.top + +this.layout.margin.bottom;\n this.setDimensions(this.layout.width, target_height);\n this.parent.setDimensions();\n this.parent.panel_ids_by_y_index.forEach(function(id){\n this.parent.panels[id].layout.proportional_height = null;\n }.bind(this));\n this.parent.positionPanels();\n }\n};\n\n/**\n * Methods to set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n */\nLocusZoom.Panel.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setElementStatusByFilters(status, toggle, filters, exclusive);\n }.bind(this));\n};\n/**\n * Set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n */\nLocusZoom.Panel.prototype.setAllElementStatus = function(status, toggle){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(status, toggle);\n }.bind(this));\n};\n// TODO: Capture documentation for dynamically generated methods\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.Panel.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.Panel.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.Panel.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.Panel.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n\n/**\n * Add a \"basic\" loader to a panel\n * This method is just a shortcut for adding the most commonly used type of loading indicator, which appears when\n * data is requested, animates (e.g. shows an infinitely cycling progress bar as opposed to one that loads from\n * 0-100% based on actual load progress), and disappears when new data is loaded and rendered.\n *\n *\n * @param {Boolean} show_immediately\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.addBasicLoader = function(show_immediately){\n if (typeof show_immediately != \"undefined\"){ show_immediately = true; }\n if (show_immediately){\n this.loader.show(\"Loading...\").animate();\n }\n this.on(\"data_requested\", function(){\n this.loader.show(\"Loading...\").animate();\n }.bind(this));\n this.on(\"data_rendered\", function(){\n this.loader.hide();\n }.bind(this));\n return this;\n};\n"]} \ No newline at end of file diff --git a/dist/locuszoom.app.min.js b/dist/locuszoom.app.min.js index 0b29568f..890df394 100644 --- a/dist/locuszoom.app.min.js +++ b/dist/locuszoom.app.min.js @@ -1,7 +1,7 @@ -!function(t,e){"function"==typeof define&&define.amd?define(["d3","Q"],function(a,i){return t.LocusZoom=e(a,i)}):"object"==typeof module&&module.exports?module.exports=t.LocusZoom=e(require("d3"),require("Q")):t.LocusZoom=e(t.d3,t.Q)}(this,function(t,e){var a=function(t,e){if(e==t)return!0;var a=t.split("."),i=e.split("."),n=!1;return a.forEach(function(t,e){!n&&+i[e]>+a[e]&&(n=!0)}),n};try{var i="3.5.6";if("object"!=typeof t)throw"d3 dependency not met. Library missing.";if(!a(i,t.version))throw"d3 dependency not met. Outdated version detected.\nRequired d3 version: "+i+" or higher (found: "+t.version+").";if("function"!=typeof e)throw"Q dependency not met. Library missing.";!function(t,e){"function"==typeof define&&define.amd?define(["d3","Q"],function(a,i){return t.LocusZoom=e(a,i)}):"object"==typeof module&&module.exports?module.exports=t.LocusZoom=e(require("d3"),require("Q")):t.LocusZoom=e(t.d3,t.Q)}(this,function(t,e){var a=function(t,e){if(e==t)return!0;var a=t.split("."),i=e.split("."),n=!1;return a.forEach(function(t,e){!n&&+i[e]>+a[e]&&(n=!0)}),n};try{var i="3.5.6";if("object"!=typeof t)throw"d3 dependency not met. Library missing.";if(!a(i,t.version))throw"d3 dependency not met. Outdated version detected.\nRequired d3 version: "+i+" or higher (found: "+t.version+").";if("function"!=typeof e)throw"Q dependency not met. Library missing.";var n={version:"0.8.0"};n.populate=function(e,a,i){if("undefined"==typeof e)throw"LocusZoom.populate selector not defined";t.select(e).html("");var s;return t.select(e).call(function(){if("undefined"==typeof this.node().id){for(var e=0;!t.select("#lz-"+e).empty();)e++;this.attr("id","#lz-"+e)}if(s=new n.Plot(this.node().id,a,i),s.container=this.node(),"undefined"!=typeof this.node().dataset&&"undefined"!=typeof this.node().dataset.region){var o=n.parsePositionQuery(this.node().dataset.region);Object.keys(o).forEach(function(t){s.state[t]=o[t]})}s.svg=t.select("div#"+s.id).append("svg").attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").attr("id",s.id+"_svg").attr("class","lz-locuszoom").style(s.layout.style),s.setDimensions(),s.positionPanels(),s.initialize(),"object"==typeof a&&Object.keys(a).length&&s.refresh()}),s},n.populateAll=function(e,a,i){var s=[];return t.selectAll(e).each(function(t,e){s[e]=n.populate(this,a,i)}),s},n.positionIntToString=function(t,e,a){var i={0:"",3:"K",6:"M",9:"G"};if(a=a||!1,isNaN(e)||null===e){var n=Math.log(t)/Math.LN10;e=Math.min(Math.max(n-n%3,0),9)}var s=e-Math.floor((Math.log(t)/Math.LN10).toFixed(e+3)),o=Math.min(Math.max(e,0),2),r=Math.min(Math.max(s,o),12),l=""+(t/Math.pow(10,e)).toFixed(r);return a&&"undefined"!=typeof i[e]&&(l+=" "+i[e]+"b"),l},n.positionStringToInt=function(t){var e=t.toUpperCase();e=e.replace(/,/g,"");var a=/([KMG])[B]*$/,i=a.exec(e),n=1;return i&&(n="M"===i[1]?1e6:"G"===i[1]?1e9:1e3,e=e.replace(a,"")),e=Number(e)*n},n.parsePositionQuery=function(t){var e=/^(\w+):([\d,.]+[kmgbKMGB]*)([-+])([\d,.]+[kmgbKMGB]*)$/,a=/^(\w+):([\d,.]+[kmgbKMGB]*)$/,i=e.exec(t);if(i){if("+"===i[3]){var s=n.positionStringToInt(i[2]),o=n.positionStringToInt(i[4]);return{chr:i[1],start:s-o,end:s+o}}return{chr:i[1],start:n.positionStringToInt(i[2]),end:n.positionStringToInt(i[4])}}return i=a.exec(t),i?{chr:i[1],position:n.positionStringToInt(i[2])}:null},n.prettyTicks=function(t,e,a){("undefined"==typeof a||isNaN(parseInt(a)))&&(a=5),a=parseInt(a);var i=a/3,n=.75,s=1.5,o=.5+1.5*s,r=Math.abs(t[0]-t[1]),l=r/a;Math.log(r)/Math.LN10<-2&&(l=Math.max(Math.abs(r))*n/i);var h=Math.pow(10,Math.floor(Math.log(l)/Math.LN10)),d=0;h<1&&0!==h&&(d=Math.abs(Math.round(Math.log(h)/Math.LN10)));var u=h;2*h-l0&&(c=parseFloat(c.toFixed(d)));return p.push(c),"undefined"!=typeof e&&["low","high","both","neither"].indexOf(e)!==-1||(e="neither"),"low"!==e&&"both"!==e||p[0]t[1]&&p.pop(),p},n.createCORSPromise=function(t,a,i,n,s){var o=e.defer(),r=new XMLHttpRequest;if("withCredentials"in r?r.open(t,a,!0):"undefined"!=typeof XDomainRequest?(r=new XDomainRequest,r.open(t,a)):r=null,r){if(r.onreadystatechange=function(){4===r.readyState&&(200===r.status||0===r.status?o.resolve(r.response):o.reject("HTTP "+r.status+" for "+a))},s&&setTimeout(o.reject,s),i="undefined"!=typeof i?i:"","undefined"!=typeof n)for(var l in n)r.setRequestHeader(l,n[l]);r.send(i)}return o.promise},n.validateState=function(t,e){t=t||{},e=e||{};var a=!1;if("undefined"!=typeof t.chr&&"undefined"!=typeof t.start&&"undefined"!=typeof t.end){var i,n=null;if(t.start=Math.max(parseInt(t.start),1),t.end=Math.max(parseInt(t.end),1),isNaN(t.start)&&isNaN(t.end))t.start=1,t.end=1,n=.5,i=0;else if(isNaN(t.start)||isNaN(t.end))n=t.start||t.end,i=0,t.start=isNaN(t.start)?t.end:t.start,t.end=isNaN(t.end)?t.start:t.end;else{if(n=Math.round((t.start+t.end)/2),i=t.end-t.start,i<0){var s=t.start;t.end=t.start,t.start=s,i=t.end-t.start}n<0&&(t.start=1,t.end=1,i=0)}a=!0}return!isNaN(e.min_region_scale)&&a&&ie.max_region_scale&&(t.start=Math.max(n-Math.floor(e.max_region_scale/2),1),t.end=t.start+e.max_region_scale),t},n.parseFields=function(t,e){if("object"!=typeof t)throw"LocusZoom.parseFields invalid arguments: data is not an object";if("string"!=typeof e)throw"LocusZoom.parseFields invalid arguments: html is not a string";for(var a=[],i=/\{\{(?:(#if )?([A-Za-z0-9_:|]+)|(\/if))\}\}/;e.length>0;){var s=i.exec(e);s?0!==s.index?(a.push({text:e.slice(0,s.index)}),e=e.slice(s.index)):"#if "===s[1]?(a.push({condition:s[2]}),e=e.slice(s[0].length)):s[2]?(a.push({variable:s[2]}),e=e.slice(s[0].length)):"/if"===s[3]?(a.push({close:"if"}),e=e.slice(s[0].length)):(console.error("Error tokenizing tooltip when remaining template is "+JSON.stringify(e)+" and previous tokens are "+JSON.stringify(a)+" and current regex match is "+JSON.stringify([s[1],s[2],s[3]])),e=e.slice(s[0].length)):(a.push({text:e}),e="")}for(var o=function(){var t=a.shift();if("undefined"!=typeof t.text||t.variable)return t;if(t.condition){for(t.then=[];a.length>0;){if("if"===a[0].close){a.shift();break}t.then.push(o())}return t}return console.error("Error making tooltip AST due to unknown token "+JSON.stringify(t)),{text:""}},r=[];a.length>0;)r.push(o());var l=function(e){return l.cache.hasOwnProperty(e)||(l.cache[e]=new n.Data.Field(e).resolve(t)),l.cache[e]};l.cache={};var h=function(t){if("undefined"!=typeof t.text)return t.text;if(t.variable){try{var e=l(t.variable);if(["string","number","boolean"].indexOf(typeof e)!==-1)return e;if(null===e)return""}catch(e){console.error("Error while processing variable "+JSON.stringify(t.variable))}return"{{"+t.variable+"}}"}if(t.condition){try{var a=l(t.condition);if(a||0===a)return t.then.map(h).join("")}catch(e){console.error("Error while processing condition "+JSON.stringify(t.variable))}return""}console.error("Error rendering tooltip due to unknown AST node "+JSON.stringify(t))};return r.map(h).join("")},n.getToolTipData=function(e){if("object"!=typeof e||"undefined"==typeof e.parentNode)throw"Invalid node object";var a=t.select(e);return a.classed("lz-data_layer-tooltip")&&"undefined"!=typeof a.data()[0]?a.data()[0]:n.getToolTipData(e.parentNode)},n.getToolTipDataLayer=function(t){var e=n.getToolTipData(t);return e.getDataLayer?e.getDataLayer():null},n.getToolTipPanel=function(t){var e=n.getToolTipDataLayer(t);return e?e.parent:null},n.getToolTipPlot=function(t){var e=n.getToolTipPanel(t);return e?e.parent:null},n.generateCurtain=function(){var e={showing:!1,selector:null,content_selector:null,hide_delay:null,show:function(e,a){return this.curtain.showing||(this.curtain.selector=t.select(this.parent_plot.svg.node().parentNode).insert("div").attr("class","lz-curtain").attr("id",this.id+".curtain"),this.curtain.content_selector=this.curtain.selector.append("div").attr("class","lz-curtain-content"),this.curtain.selector.append("div").attr("class","lz-curtain-dismiss").html("Dismiss").on("click",function(){this.curtain.hide()}.bind(this)),this.curtain.showing=!0),this.curtain.update(e,a)}.bind(this),update:function(t,e){if(!this.curtain.showing)return this.curtain;clearTimeout(this.curtain.hide_delay),"object"==typeof e&&this.curtain.selector.style(e);var a=this.getPageOrigin();return this.curtain.selector.style({top:a.y+"px",left:a.x+"px",width:this.layout.width+"px",height:this.layout.height+"px"}),this.curtain.content_selector.style({"max-width":this.layout.width-40+"px","max-height":this.layout.height-40+"px"}),"string"==typeof t&&this.curtain.content_selector.html(t),this.curtain}.bind(this),hide:function(t){return this.curtain.showing?"number"==typeof t?(clearTimeout(this.curtain.hide_delay),this.curtain.hide_delay=setTimeout(this.curtain.hide,t),this.curtain):(this.curtain.selector.remove(),this.curtain.selector=null,this.curtain.content_selector=null,this.curtain.showing=!1,this.curtain):this.curtain}.bind(this)};return e},n.generateLoader=function(){var e={showing:!1,selector:null,content_selector:null,progress_selector:null,cancel_selector:null,show:function(e){return this.loader.showing||(this.loader.selector=t.select(this.parent_plot.svg.node().parentNode).insert("div").attr("class","lz-loader").attr("id",this.id+".loader"),this.loader.content_selector=this.loader.selector.append("div").attr("class","lz-loader-content"),this.loader.progress_selector=this.loader.selector.append("div").attr("class","lz-loader-progress-container").append("div").attr("class","lz-loader-progress"),this.loader.showing=!0,"undefined"==typeof e&&(e="Loading...")),this.loader.update(e)}.bind(this),update:function(t,e){if(!this.loader.showing)return this.loader;clearTimeout(this.loader.hide_delay),"string"==typeof t&&this.loader.content_selector.html(t);var a=6,i=this.getPageOrigin(),n=this.loader.selector.node().getBoundingClientRect();return this.loader.selector.style({top:i.y+this.layout.height-n.height-a+"px",left:i.x+a+"px"}),"number"==typeof e&&this.loader.progress_selector.style({width:Math.min(Math.max(e,1),100)+"%"}),this.loader}.bind(this),animate:function(){return this.loader.progress_selector.classed("lz-loader-progress-animated",!0),this.loader}.bind(this),setPercentCompleted:function(t){return this.loader.progress_selector.classed("lz-loader-progress-animated",!1),this.loader.update(null,t)}.bind(this),hide:function(t){return this.loader.showing?"number"==typeof t?(clearTimeout(this.loader.hide_delay),this.loader.hide_delay=setTimeout(this.loader.hide,t),this.loader):(this.loader.selector.remove(),this.loader.selector=null,this.loader.content_selector=null,this.loader.progress_selector=null,this.loader.cancel_selector=null,this.loader.showing=!1,this.loader):this.loader}.bind(this)};return e},n.subclass=function(t,e){if("function"!=typeof t)throw"Parent must be a callable constructor";e=e||{};var a=e.hasOwnProperty("constructor")?e.constructor:function(){t.apply(this,arguments)};return a.prototype=Object.create(t.prototype),Object.keys(e).forEach(function(t){a.prototype[t]=e[t]}),a},n.ext={},n.Layouts=function(){var t={},e={plot:{},panel:{},data_layer:{},dashboard:{},tooltip:{}};return t.get=function(t,a,i){if("string"!=typeof t||"string"!=typeof a)throw"invalid arguments passed to LocusZoom.Layouts.get, requires string (layout type) and string (layout name)";if(e[t][a]){var s=n.Layouts.merge(i||{},e[t][a]);if(s.unnamespaced)return delete s.unnamespaced,JSON.parse(JSON.stringify(s));var o="";"string"==typeof s.namespace?o=s.namespace:"object"==typeof s.namespace&&Object.keys(s.namespace).length&&(o="undefined"!=typeof s.namespace.default?s.namespace.default:s.namespace[Object.keys(s.namespace)[0]].toString()),o+=o.length?":":"";var r=function(t,e){if(e?"string"==typeof e&&(e={default:e}):e={default:""},"string"==typeof t){for(var a,i,s,l,h=/\{\{namespace(\[[A-Za-z_0-9]+\]|)\}\}/g,d=[];null!==(a=h.exec(t));)i=a[0],s=a[1].length?a[1].replace(/(\[|\])/g,""):null,l=o,null!=e&&"object"==typeof e&&"undefined"!=typeof e[s]&&(l=e[s]+(e[s].length?":":"")),d.push({base:i,namespace:l});for(var u in d)t=t.replace(d[u].base,d[u].namespace)}else if("object"==typeof t&&null!=t){if("undefined"!=typeof t.namespace){var p="string"==typeof t.namespace?{default:t.namespace}:t.namespace;e=n.Layouts.merge(e,p)}var c,y;for(var f in t)"namespace"!==f&&(c=r(t[f],e),y=r(f,e),f!==y&&delete t[f],t[y]=c)}return t};return s=r(s,s.namespace),JSON.parse(JSON.stringify(s))}throw"layout type ["+t+"] name ["+a+"] not found"},t.set=function(t,a,i){if("string"!=typeof t||"string"!=typeof a||"object"!=typeof i)throw"unable to set new layout; bad arguments passed to set()";return e[t]||(e[t]={}),i?e[t][a]=JSON.parse(JSON.stringify(i)):(delete e[t][a],null)},t.add=function(e,a,i){return t.set(e,a,i)},t.list=function(t){if(e[t])return Object.keys(e[t]);var a={};return Object.keys(e).forEach(function(t){a[t]=Object.keys(e[t])}),a},t.merge=function(t,e){if("object"!=typeof t||"object"!=typeof e)throw"LocusZoom.Layouts.merge only accepts two layout objects; "+typeof t+", "+typeof e+" given";for(var a in e)if(e.hasOwnProperty(a)){var i=null===t[a]?"undefined":typeof t[a],s=typeof e[a];if("object"===i&&Array.isArray(t[a])&&(i="array"),"object"===s&&Array.isArray(e[a])&&(s="array"),"function"===i||"function"===s)throw"LocusZoom.Layouts.merge encountered an unsupported property type";"undefined"!==i?"object"!==i||"object"!==s||(t[a]=n.Layouts.merge(t[a],e[a])):t[a]=JSON.parse(JSON.stringify(e[a]))}return t},t}(),n.Layouts.add("tooltip","standard_association",{namespace:{assoc:"assoc"},closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:'{{{{namespace[assoc]}}variant}}
      P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
      Ref. Allele: {{{{namespace[assoc]}}ref_allele}}
      Make LD Reference
      '});var s=n.Layouts.get("tooltip","standard_association",{unnamespaced:!0});s.html+='Condition on Variant
      ',n.Layouts.add("tooltip","covariates_model_association",s),n.Layouts.add("tooltip","standard_genes",{closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:'

      {{gene_name}}

      Gene ID: {{gene_id}}
      Transcript ID: {{transcript_id}}
      ConstraintExpected variantsObserved variantsConst. Metric
      Synonymous{{exp_syn}}{{n_syn}}z = {{syn_z}}
      Missense{{exp_mis}}{{n_mis}}z = {{mis_z}}
      LoF{{exp_lof}}{{n_lof}}pLI = {{pLI}}
      More data on ExAC'}),n.Layouts.add("tooltip","standard_intervals",{namespace:{intervals:"intervals"},closable:!1,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:"{{{{namespace[intervals]}}state_name}}
      {{{{namespace[intervals]}}start}}-{{{{namespace[intervals]}}end}}"}),n.Layouts.add("data_layer","significance",{id:"significance",type:"orthogonal_line",orientation:"horizontal",offset:4.522}),n.Layouts.add("data_layer","recomb_rate",{namespace:{recomb:"recomb"},id:"recombrate",type:"line",fields:["{{namespace[recomb]}}position","{{namespace[recomb]}}recomb_rate"],z_index:1,style:{stroke:"#0000FF","stroke-width":"1.5px"},x_axis:{field:"{{namespace[recomb]}}position"},y_axis:{axis:2,field:"{{namespace[recomb]}}recomb_rate",floor:0,ceiling:100}}),n.Layouts.add("data_layer","association_pvalues",{namespace:{assoc:"assoc",ld:"ld"},id:"associationpvalues",type:"scatter",point_shape:{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:"diamond",else:"circle"}},point_size:{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:80,else:40}},color:[{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:"#9632b8"}},{scale_function:"numerical_bin",field:"{{namespace[ld]}}state",parameters:{breaks:[0,.2,.4,.6,.8],values:["#357ebd","#46b8da","#5cb85c","#eea236","#d43f3a"]}},"#B8B8B8"],legend:[{shape:"diamond",color:"#9632b8",size:40,label:"LD Ref Var",class:"lz-data_layer-scatter"},{shape:"circle",color:"#d43f3a",size:40,label:"1.0 > r² ≥ 0.8",class:"lz-data_layer-scatter"},{shape:"circle",color:"#eea236",size:40,label:"0.8 > r² ≥ 0.6",class:"lz-data_layer-scatter"},{shape:"circle",color:"#5cb85c",size:40,label:"0.6 > r² ≥ 0.4",class:"lz-data_layer-scatter"},{shape:"circle",color:"#46b8da",size:40,label:"0.4 > r² ≥ 0.2",class:"lz-data_layer-scatter"},{shape:"circle",color:"#357ebd",size:40,label:"0.2 > r² ≥ 0.0",class:"lz-data_layer-scatter"},{shape:"circle",color:"#B8B8B8",size:40,label:"no r² data",class:"lz-data_layer-scatter"}],fields:["{{namespace[assoc]}}variant","{{namespace[assoc]}}position","{{namespace[assoc]}}log_pvalue","{{namespace[assoc]}}log_pvalue|logtoscinotation","{{namespace[assoc]}}ref_allele","{{namespace[ld]}}state","{{namespace[ld]}}isrefvar"],id_field:"{{namespace[assoc]}}variant",z_index:2,x_axis:{field:"{{namespace[assoc]}}position"},y_axis:{axis:1,field:"{{namespace[assoc]}}log_pvalue",floor:0,upper_buffer:.1,min_extent:[0,10]},behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_association",{unnamespaced:!0})}),n.Layouts.add("data_layer","phewas_pvalues",{namespace:{phewas:"phewas"},id:"phewaspvalues",type:"category_scatter",point_shape:"circle",point_size:70,tooltip_positioning:"vertical",id_field:"{{namespace[phewas]}}id",fields:["{{namespace[phewas]}}id","{{namespace[phewas]}}log_pvalue","{{namespace[phewas]}}trait_group","{{namespace[phewas]}}trait_label"],x_axis:{field:"{{namespace[phewas]}}x",category_field:"{{namespace[phewas]}}trait_group",lower_buffer:.025,upper_buffer:.025},y_axis:{axis:1,field:"{{namespace[phewas]}}log_pvalue",floor:0,upper_buffer:.15},color:{field:"{{namespace[phewas]}}trait_group",scale_function:"categorical_bin",parameters:{categories:[],values:[],null_value:"#B8B8B8"}},fill_opacity:.7,tooltip:{closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:["Trait: {{{{namespace[phewas]}}trait_label|htmlescape}}
      ","Trait Category: {{{{namespace[phewas]}}trait_group|htmlescape}}
      ","P-value: {{{{namespace[phewas]}}log_pvalue|logtoscinotation|htmlescape}}
      "].join("")},behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},label:{text:"{{{{namespace[phewas]}}trait_label}}",spacing:6,lines:{style:{"stroke-width":"2px",stroke:"#333333","stroke-dasharray":"2px 2px"}},filters:[{field:"{{namespace[phewas]}}log_pvalue",operator:">=",value:20}],style:{"font-size":"14px","font-weight":"bold",fill:"#333333"}}}),n.Layouts.add("data_layer","genes",{namespace:{gene:"gene",constraint:"constraint"},id:"genes",type:"genes",fields:["{{namespace[gene]}}all","{{namespace[constraint]}}all"],id_field:"gene_id",behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_genes",{unnamespaced:!0})}),n.Layouts.add("data_layer","genome_legend",{namespace:{genome:"genome"},id:"genome_legend",type:"genome_legend",fields:["{{namespace[genome]}}chr","{{namespace[genome]}}base_pairs"],x_axis:{floor:0,ceiling:2881033286}}),n.Layouts.add("data_layer","intervals",{namespace:{intervals:"intervals"},id:"intervals",type:"intervals",fields:["{{namespace[intervals]}}start","{{namespace[intervals]}}end","{{namespace[intervals]}}state_id","{{namespace[intervals]}}state_name"],id_field:"{{namespace[intervals]}}start",start_field:"{{namespace[intervals]}}start",end_field:"{{namespace[intervals]}}end",track_split_field:"{{namespace[intervals]}}state_id",split_tracks:!0,always_hide_legend:!1,color:{field:"{{namespace[intervals]}}state_id",scale_function:"categorical_bin",parameters:{categories:[1,2,3,4,5,6,7,8,9,10,11,12,13],values:["rgb(212,63,58)","rgb(250,120,105)","rgb(252,168,139)","rgb(240,189,66)","rgb(250,224,105)","rgb(240,238,84)","rgb(244,252,23)","rgb(23,232,252)","rgb(32,191,17)","rgb(23,166,77)","rgb(32,191,17)","rgb(162,133,166)","rgb(212,212,212)"],null_value:"#B8B8B8"}},legend:[{shape:"rect",color:"rgb(212,63,58)",width:9,label:"Active Promoter","{{namespace[intervals]}}state_id":1},{shape:"rect",color:"rgb(250,120,105)",width:9,label:"Weak Promoter","{{namespace[intervals]}}state_id":2},{shape:"rect",color:"rgb(252,168,139)",width:9,label:"Poised Promoter","{{namespace[intervals]}}state_id":3},{shape:"rect",color:"rgb(240,189,66)",width:9,label:"Strong enhancer","{{namespace[intervals]}}state_id":4},{shape:"rect",color:"rgb(250,224,105)",width:9,label:"Strong enhancer","{{namespace[intervals]}}state_id":5},{shape:"rect",color:"rgb(240,238,84)",width:9,label:"Weak enhancer","{{namespace[intervals]}}state_id":6},{shape:"rect",color:"rgb(244,252,23)",width:9,label:"Weak enhancer","{{namespace[intervals]}}state_id":7},{shape:"rect",color:"rgb(23,232,252)",width:9,label:"Insulator","{{namespace[intervals]}}state_id":8},{shape:"rect",color:"rgb(32,191,17)",width:9,label:"Transcriptional transition","{{namespace[intervals]}}state_id":9},{shape:"rect",color:"rgb(23,166,77)",width:9,label:"Transcriptional elongation","{{namespace[intervals]}}state_id":10},{shape:"rect",color:"rgb(136,240,129)",width:9,label:"Weak transcribed","{{namespace[intervals]}}state_id":11},{shape:"rect",color:"rgb(162,133,166)",width:9,label:"Polycomb-repressed","{{namespace[intervals]}}state_id":12},{shape:"rect",color:"rgb(212,212,212)",width:9,label:"Heterochromatin / low signal","{{namespace[intervals]}}state_id":13}],behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_intervals",{unnamespaced:!0})}),n.Layouts.add("dashboard","standard_panel",{components:[{type:"remove_panel",position:"right",color:"red",group_position:"end"},{type:"move_panel_up",position:"right",group_position:"middle"},{type:"move_panel_down",position:"right",group_position:"start",style:{"margin-left":"0.75em"}}]}),n.Layouts.add("dashboard","standard_plot",{components:[{type:"title",title:"LocusZoom",subtitle:'v'+n.version+"",position:"left"},{type:"dimensions",position:"right"},{type:"region_scale",position:"right"},{type:"download",position:"right"}]});var o=n.Layouts.get("dashboard","standard_plot");o.components.push({type:"covariates_model",button_html:"Model",button_title:"Show and edit covariates currently in model",position:"left"}),n.Layouts.add("dashboard","covariates_model_plot",o);var r=n.Layouts.get("dashboard","standard_plot");r.components.push({type:"shift_region",step:5e5,button_html:">>",position:"right",group_position:"end"}),r.components.push({type:"shift_region",step:5e4,button_html:">",position:"right",group_position:"middle"}),r.components.push({type:"zoom_region",step:.2,position:"right",group_position:"middle"}),r.components.push({type:"zoom_region",step:-.2,position:"right",group_position:"middle"}),r.components.push({type:"shift_region",step:-5e4,button_html:"<",position:"right",group_position:"middle"}),r.components.push({type:"shift_region",step:-5e5,button_html:"<<",position:"right",group_position:"start"}),n.Layouts.add("dashboard","region_nav_plot",r),n.Layouts.add("panel","association",{id:"association",width:800,height:225,min_width:400,min_height:200,proportional_width:1,margin:{top:35,right:50,bottom:40,left:50},inner_border:"rgb(210, 210, 210)",dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"toggle_legend",position:"right"}),t}(),axes:{x:{label:"Chromosome {{chr}} (Mb)",label_offset:32,tick_format:"region",extent:"state"},y1:{label:"-log10 p-value",label_offset:28},y2:{label:"Recombination Rate (cM/Mb)",label_offset:40}},legend:{orientation:"vertical",origin:{x:55,y:40},hidden:!0},interaction:{drag_background_to_pan:!0,drag_x_ticks_to_scale:!0,drag_y1_ticks_to_scale:!0,drag_y2_ticks_to_scale:!0,scroll_to_zoom:!0,x_linked:!0},data_layers:[n.Layouts.get("data_layer","significance",{unnamespaced:!0}),n.Layouts.get("data_layer","recomb_rate",{unnamespaced:!0}),n.Layouts.get("data_layer","association_pvalues",{unnamespaced:!0})]}),n.Layouts.add("panel","genes",{id:"genes",width:800,height:225,min_width:400,min_height:112.5,proportional_width:1,margin:{top:20,right:50,bottom:20,left:50},axes:{},interaction:{drag_background_to_pan:!0,scroll_to_zoom:!0,x_linked:!0},dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"resize_to_data",position:"right"}),t}(),data_layers:[n.Layouts.get("data_layer","genes",{unnamespaced:!0})]}),n.Layouts.add("panel","phewas",{id:"phewas",width:800,height:300,min_width:800,min_height:300,proportional_width:1,margin:{top:20,right:50,bottom:120,left:50},inner_border:"rgb(210, 210, 210)",axes:{x:{ticks:{style:{"font-weight":"bold","font-size":"11px","text-anchor":"start"},transform:"rotate(50)",position:"left"}},y1:{label:"-log10 p-value",label_offset:28}},data_layers:[n.Layouts.get("data_layer","significance",{unnamespaced:!0}),n.Layouts.get("data_layer","phewas_pvalues",{unnamespaced:!0})]}),n.Layouts.add("panel","genome_legend",{id:"genome_legend",width:800,height:50,origin:{x:0,y:300},min_width:800,min_height:50,proportional_width:1,margin:{top:0,right:50,bottom:35,left:50},axes:{x:{label:"Genomic Position (number denotes chromosome)",label_offset:35,ticks:[{x:124625310,text:"1",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:370850307,text:"2",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:591461209,text:"3",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:786049562,text:"4",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:972084330,text:"5",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1148099493,text:"6",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1313226358,text:"7",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1465977701,text:"8",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1609766427,text:"9",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1748140516,text:"10",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1883411148,text:"11",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2017840353,text:"12",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2142351240,text:"13",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2253610949,text:"14",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2358551415,text:"15",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2454994487,text:"16",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2540769469,text:"17",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2620405698,text:"18",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2689008813,text:"19",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2750086065,text:"20",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2805663772,text:"21",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2855381003,text:"22",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"}]}},data_layers:[n.Layouts.get("data_layer","genome_legend",{unnamespaced:!0})]}),n.Layouts.add("panel","intervals",{id:"intervals",width:1e3,height:50,min_width:500,min_height:50,margin:{top:25,right:150,bottom:5,left:50},dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"toggle_split_tracks",data_layer_id:"intervals",position:"right"}),t}(),axes:{},interaction:{drag_background_to_pan:!0,scroll_to_zoom:!0,x_linked:!0},legend:{hidden:!0,orientation:"horizontal",origin:{x:50,y:0},pad_from_bottom:5},data_layers:[n.Layouts.get("data_layer","intervals",{unnamespaced:!0})]}),n.Layouts.add("plot","standard_association",{state:{},width:800,height:450,responsive_resize:!0,min_region_scale:2e4,max_region_scale:1e6,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","association",{unnamespaced:!0,proportional_height:.5}),n.Layouts.get("panel","genes",{unnamespaced:!0,proportional_height:.5})]}),n.StandardLayout=n.Layouts.get("plot","standard_association"),n.Layouts.add("plot","standard_phewas",{width:800,height:600,min_width:800,min_height:600,responsive_resize:!0,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","phewas",{unnamespaced:!0,proportional_height:.45}),n.Layouts.get("panel","genome_legend",{unnamespaced:!0,proportional_height:.1}),n.Layouts.get("panel","genes",{unnamespaced:!0,proportional_height:.45,margin:{bottom:40},axes:{x:{label:"Chromosome {{chr}} (Mb)",label_offset:32,tick_format:"region",extent:"state"}}})],mouse_guide:!1}),n.Layouts.add("plot","interval_association",{state:{},width:800,height:550,responsive_resize:!0,min_region_scale:2e4,max_region_scale:1e6,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","association",{unnamespaced:!0,width:800,proportional_height:225/570}),n.Layouts.get("panel","intervals",{ -unnamespaced:!0,proportional_height:120/570}),n.Layouts.get("panel","genes",{unnamespaced:!0,width:800,proportional_height:225/570})]}),n.DataLayer=function(t,e){return this.initialized=!1,this.layout_idx=null,this.id=null,this.parent=e||null,this.svg={},this.parent_plot=null,"undefined"!=typeof e&&e instanceof n.Panel&&(this.parent_plot=e.parent),this.layout=n.Layouts.merge(t||{},n.DataLayer.DefaultLayout),this.layout.id&&(this.id=this.layout.id),this.layout.x_axis!=={}&&"number"!=typeof this.layout.x_axis.axis&&(this.layout.x_axis.axis=1),this.layout.y_axis!=={}&&"number"!=typeof this.layout.y_axis.axis&&(this.layout.y_axis.axis=1),this._base_layout=JSON.parse(JSON.stringify(this.layout)),this.state={},this.state_id=null,this.setDefaultState(),this.data=[],this.layout.tooltip&&(this.tooltips={}),this.global_statuses={highlighted:!1,selected:!1,faded:!1,hidden:!1},this},n.DataLayer.prototype.addField=function(t,e,a){if(!t||!e)throw"Must specify field name and namespace to use when adding field";var i=e+":"+t;if(a)if(i+="|","string"==typeof a)i+=a;else{if(!Array.isArray(a))throw"Must provide transformations as either a string or array of strings";i+=a.join("|")}var n=this.layout.fields;return n.indexOf(i)===-1&&n.push(i),i},n.DataLayer.prototype.setDefaultState=function(){this.parent&&(this.state=this.parent.state,this.state_id=this.parent.id+"."+this.id,this.state[this.state_id]=this.state[this.state_id]||{},n.DataLayer.Statuses.adjectives.forEach(function(t){this.state[this.state_id][t]=this.state[this.state_id][t]||[]}.bind(this)))},n.DataLayer.DefaultLayout={type:"",fields:[],x_axis:{},y_axis:{}},n.DataLayer.Statuses={verbs:["highlight","select","fade","hide"],adjectives:["highlighted","selected","faded","hidden"],menu_antiverbs:["unhighlight","deselect","unfade","show"]},n.DataLayer.prototype.getBaseId=function(){return this.parent_plot.id+"."+this.parent.id+"."+this.id},n.DataLayer.prototype.getAbsoluteDataHeight=function(){var t=this.svg.group.node().getBoundingClientRect();return t.height},n.DataLayer.prototype.canTransition=function(){return!!this.layout.transition&&!(this.parent_plot.panel_boundaries.dragging||this.parent_plot.interaction.panel_id)},n.DataLayer.prototype.getElementId=function(t){var e="element";if("string"==typeof t)e=t;else if("object"==typeof t){var a=this.layout.id_field||"id";if("undefined"==typeof t[a])throw"Unable to generate element ID";e=t[a].toString().replace(/\W/g,"")}return(this.getBaseId()+"-"+e).replace(/(:|\.|\[|\]|,)/g,"_")},n.DataLayer.prototype.getElementStatusNodeId=function(t){return null},n.DataLayer.prototype.getElementById=function(e){var a=t.select("#"+e.replace(/(:|\.|\[|\]|,)/g,"\\$1"));return!a.empty()&&a.data()&&a.data().length?a.data()[0]:null},n.DataLayer.prototype.applyDataMethods=function(){return this.data.forEach(function(t,e){this.data[e].toHTML=function(){var t=this.layout.id_field||"id",a="";return this.data[e][t]&&(a=this.data[e][t].toString()),a}.bind(this),this.data[e].getDataLayer=function(){return this}.bind(this),this.data[e].deselect=function(){var t=this.getDataLayer();t.unselectElement(this)}}.bind(this)),this.applyCustomDataMethods(),this},n.DataLayer.prototype.applyCustomDataMethods=function(){return this},n.DataLayer.prototype.initialize=function(){return this.svg.container=this.parent.svg.group.append("g").attr("class","lz-data_layer-container").attr("id",this.getBaseId()+".data_layer_container"),this.svg.clipRect=this.svg.container.append("clipPath").attr("id",this.getBaseId()+".clip").append("rect"),this.svg.group=this.svg.container.append("g").attr("id",this.getBaseId()+".data_layer").attr("clip-path","url(#"+this.getBaseId()+".clip)"),this},n.DataLayer.prototype.moveUp=function(){return this.parent.data_layer_ids_by_z_index[this.layout.z_index+1]&&(this.parent.data_layer_ids_by_z_index[this.layout.z_index]=this.parent.data_layer_ids_by_z_index[this.layout.z_index+1],this.parent.data_layer_ids_by_z_index[this.layout.z_index+1]=this.id,this.parent.resortDataLayers()),this},n.DataLayer.prototype.moveDown=function(){return this.parent.data_layer_ids_by_z_index[this.layout.z_index-1]&&(this.parent.data_layer_ids_by_z_index[this.layout.z_index]=this.parent.data_layer_ids_by_z_index[this.layout.z_index-1],this.parent.data_layer_ids_by_z_index[this.layout.z_index-1]=this.id,this.parent.resortDataLayers()),this},n.DataLayer.prototype.resolveScalableParameter=function(t,e){var a=null;if(Array.isArray(t))for(var i=0;null===a&&i":function(t,e){return t>e},">=":function(t,e){return t>=e},"%":function(t,e){return t%e}};return!!Array.isArray(e)&&(2===e.length?t[e[0]]===e[1]:!(3!==e.length||!a[e[1]])&&a[e[1]](t[e[0]],e[2]))},i=[];return this.data.forEach(function(n,s){var o=!0;t.forEach(function(t){a(n,t)||(o=!1)}),o&&i.push("indexes"===e?s:n)}),i},n.DataLayer.prototype.filterIndexes=function(t){return this.filter(t,"indexes")},n.DataLayer.prototype.filterElements=function(t){return this.filter(t,"elements")},n.DataLayer.Statuses.verbs.forEach(function(t,e){var a=n.DataLayer.Statuses.adjectives[e],i="un"+t;n.DataLayer.prototype[t+"Element"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatus(a,t,!0,e),this},n.DataLayer.prototype[i+"Element"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatus(a,t,!1,e),this},n.DataLayer.prototype[t+"ElementsByFilters"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatusByFilters(a,!0,t,e)},n.DataLayer.prototype[i+"ElementsByFilters"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatusByFilters(a,!1,t,e)},n.DataLayer.prototype[t+"AllElements"]=function(){return this.setAllElementStatus(a,!0),this},n.DataLayer.prototype[i+"AllElements"]=function(){return this.setAllElementStatus(a,!1),this}}),n.DataLayer.prototype.setElementStatus=function(e,a,i,s){if("undefined"==typeof e||n.DataLayer.Statuses.adjectives.indexOf(e)===-1)throw"Invalid status passed to DataLayer.setElementStatus()";if("undefined"==typeof a)throw"Invalid element passed to DataLayer.setElementStatus()";"undefined"==typeof i&&(i=!0);try{var o=this.getElementId(a)}catch(t){return this}s&&this.setAllElementStatus(e,!i),t.select("#"+o).classed("lz-data_layer-"+this.layout.type+"-"+e,i);var r=this.getElementStatusNodeId(a);null!==r&&t.select("#"+r).classed("lz-data_layer-"+this.layout.type+"-statusnode-"+e,i);var l=this.state[this.state_id][e].indexOf(o);return i&&l===-1&&this.state[this.state_id][e].push(o),i||l===-1||this.state[this.state_id][e].splice(l,1),this.showOrHideTooltip(a),this.parent.emit("layout_changed",!0),"selected"===e&&this.parent.emit("element_selection",{element:a,active:i},!0),this},n.DataLayer.prototype.setElementStatusByFilters=function(t,e,a,i){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setElementStatusByFilters()";return"undefined"==typeof this.state[this.state_id][t]?this:(e="undefined"==typeof e||!!e,i="undefined"!=typeof i&&!!i,Array.isArray(a)||(a=[]),i&&this.setAllElementStatus(t,!e),this.filterElements(a).forEach(function(a){this.setElementStatus(t,a,e)}.bind(this)),this)},n.DataLayer.prototype.setAllElementStatus=function(t,e){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setAllElementStatus()";if("undefined"==typeof this.state[this.state_id][t])return this;if("undefined"==typeof e&&(e=!0),e)this.data.forEach(function(e){this.setElementStatus(t,e,!0)}.bind(this));else{var a=this.state[this.state_id][t].slice();a.forEach(function(e){var a=this.getElementById(e);"object"==typeof a&&null!==a&&this.setElementStatus(t,a,!1)}.bind(this)),this.state[this.state_id][t]=[]}return this.global_statuses[t]=e,this},n.DataLayer.prototype.applyBehaviors=function(t){"object"==typeof this.layout.behaviors&&Object.keys(this.layout.behaviors).forEach(function(e){var a=/(click|mouseover|mouseout)/.exec(e);a&&t.on(a[0]+"."+e,this.executeBehaviors(e,this.layout.behaviors[e]))}.bind(this))},n.DataLayer.prototype.executeBehaviors=function(e,a){var i={ctrl:e.indexOf("ctrl")!==-1,shift:e.indexOf("shift")!==-1};return function(e){i.ctrl===!!t.event.ctrlKey&&i.shift===!!t.event.shiftKey&&a.forEach(function(t){if("object"==typeof t&&null!==t)switch(t.action){case"set":this.setElementStatus(t.status,e,!0,t.exclusive);break;case"unset":this.setElementStatus(t.status,e,!1,t.exclusive);break;case"toggle":var a=this.state[this.state_id][t.status].indexOf(this.getElementId(e))!==-1,i=t.exclusive&&!a;this.setElementStatus(t.status,e,!a,i);break;case"link":if("string"==typeof t.href){var s=n.parseFields(e,t.href);"string"==typeof t.target?window.open(s,t.target):window.location.href=s}}}.bind(this))}.bind(this)},n.DataLayer.prototype.getPageOrigin=function(){var t=this.parent.getPageOrigin();return{x:t.x+this.parent.layout.margin.left,y:t.y+this.parent.layout.margin.top}},n.DataLayer.prototype.exportData=function(t){var e="json";t=t||e,t="string"==typeof t?t.toLowerCase():e,["json","csv","tsv"].indexOf(t)===-1&&(t=e);var a;switch(t){case"json":try{a=JSON.stringify(this.data)}catch(t){a=null,console.error("Unable to export JSON data from data layer: "+this.getBaseId()+";",t)}break;case"tsv":case"csv":try{var i=JSON.parse(JSON.stringify(this.data));if("object"!=typeof i)a=i.toString();else if(Array.isArray(i)){var n="tsv"===t?"\t":",",s=this.layout.fields.map(function(t){return JSON.stringify(t)}).join(n)+"\n";a=s+i.map(function(t){return this.layout.fields.map(function(e){return"undefined"==typeof t[e]?JSON.stringify(null):"object"==typeof t[e]&&null!==t[e]?Array.isArray(t[e])?'"[Array('+t[e].length+')]"':'"[Object]"':JSON.stringify(t[e])}).join(n)}.bind(this)).join("\n")}else a="Object"}catch(t){a=null,console.error("Unable to export CSV data from data layer: "+this.getBaseId()+";",t)}}return a},n.DataLayer.prototype.draw=function(){return this.svg.container.attr("transform","translate("+this.parent.layout.cliparea.origin.x+","+this.parent.layout.cliparea.origin.y+")"),this.svg.clipRect.attr("width",this.parent.layout.cliparea.width).attr("height",this.parent.layout.cliparea.height),this.positionAllTooltips(),this},n.DataLayer.prototype.reMap=function(){this.destroyAllTooltips();var t=this.parent_plot.lzd.getData(this.state,this.layout.fields);return t.then(function(t){this.data=t.body,this.applyDataMethods(),this.initialized=!0}.bind(this)),t},n.DataLayers=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t]){if("object"!=typeof a)throw"invalid layout argument for data layer ["+t+"]";return new e[t](a,i)}throw"data layer ["+t+"] not found"}return null},t.set=function(t,a){if(a){if("function"!=typeof a)throw"unable to set data layer ["+t+"], argument provided is not a function";e[t]=a,e[t].prototype=new n.DataLayer}else delete e[t]},t.add=function(a,i){if(e[a])throw"data layer already exists with name: "+a;t.set(a,i)},t.extend=function(t,a,i){i=i||{};var s=e[t];if(!s)throw"Attempted to subclass an unknown or unregistered datalayer type";if("object"!=typeof i)throw"Must specify an object of properties and methods";var o=n.subclass(s,i);return e[a]=o,o},t.list=function(){return Object.keys(e)},t}(),n.DataLayers.add("annotation_track",function(t){if(this.DefaultLayout={color:"#000000",filters:[]},t=n.Layouts.merge(t,this.DefaultLayout),!Array.isArray(t.filters))throw"Annotation track must specify array of filters for selecting points to annotate";return n.DataLayer.apply(this,arguments),this.render=function(){var t=this,e=this.filter(this.layout.filters,"elements"),a=this.svg.group.selectAll("rect.lz-data_layer-"+t.layout.type).data(e,function(e){return e[t.layout.id_field]});a.enter().append("rect").attr("class","lz-data_layer-"+this.layout.type).attr("id",function(e){return t.getElementId(e)}),a.attr("x",function(e){return t.parent.x_scale(e[t.layout.x_axis.field])}).attr("width",1).attr("height",t.parent.layout.height).attr("fill",function(e){return t.resolveScalableParameter(t.layout.color,e)}),a.exit().remove(),this.applyBehaviors(a)},this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=7,l=1,h=l/2,d=this.getPageOrigin(),u=o.selector.node().getBoundingClientRect(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=this.parent.x_scale(o.data[this.layout.x_axis.field]),f=p/2,g=Math.max(u.width/2-y,0),_=Math.max(u.width/2+y-c,0);a=d.x+y-u.width/2-_+g,s=u.width/2-r+_-g-h,u.height+l+r>p-f?(e=d.y+f-(u.height+l+r),i="down",n=u.height-l):(e=d.y+f+l+r,i="up",n=0-l-r),o.selector.style("left",a+"px").style("top",e+"px"),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",s+"px").style("top",n+"px")},this}),n.DataLayers.add("forest",function(e){return this.DefaultLayout={point_size:40,point_shape:"square",color:"#888888",fill_opacity:1,y_axis:{axis:2},id_field:"id",confidence_intervals:{start_field:"ci_start",end_field:"ci_end"},show_no_significance_line:!0},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n=this.tooltips[t],s=this.resolveScalableParameter(this.layout.point_size,n.data),o=7,r=1,l=6,h=this.getPageOrigin(),d=this.parent.x_scale(n.data[this.layout.x_axis.field]),u="y"+this.layout.y_axis.axis+"_scale",p=this.parent[u](n.data[this.layout.y_axis.field]),c=n.selector.node().getBoundingClientRect(),y=Math.sqrt(s/Math.PI);d<=this.parent.layout.width/2?(e=h.x+d+y+o+r,a="left",i=-1*(o+r)):(e=h.x+d-c.width-y-o-r,a="right",i=c.width-r);var f,g,_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom);p-c.height/2<=0?(f=h.y+p-1.5*o-l,g=l):p+c.height/2>=_?(f=h.y+p+o+l-c.height,g=c.height-2*o-l):(f=h.y+p-c.height/2,g=c.height/2-o),n.selector.style("left",e+"px").style("top",f+"px"),n.arrow||(n.arrow=n.selector.append("div").style("position","absolute")),n.arrow.attr("class","lz-data_layer-tooltip-arrow_"+a).style("left",i+"px").style("top",g+"px")},this.render=function(){var e="x_scale",a="y"+this.layout.y_axis.axis+"_scale";if(this.layout.confidence_intervals&&this.layout.fields.indexOf(this.layout.confidence_intervals.start_field)!==-1&&this.layout.fields.indexOf(this.layout.confidence_intervals.end_field)!==-1){var i=this.svg.group.selectAll("rect.lz-data_layer-forest.lz-data_layer-forest-ci").data(this.data,function(t){return t[this.layout.id_field]}.bind(this));i.enter().append("rect").attr("class","lz-data_layer-forest lz-data_layer-forest-ci").attr("id",function(t){return this.getElementId(t)+"_ci"}.bind(this)).attr("transform","translate(0,"+(isNaN(this.parent.layout.height)?0:this.parent.layout.height)+")");var n=function(t){var i=this.parent[e](t[this.layout.confidence_intervals.start_field]),n=this.parent[a](t[this.layout.y_axis.field]);return isNaN(i)&&(i=-1e3),isNaN(n)&&(n=-1e3),"translate("+i+","+n+")"}.bind(this),s=function(t){return this.parent[e](t[this.layout.confidence_intervals.end_field])-this.parent[e](t[this.layout.confidence_intervals.start_field])}.bind(this),o=1;this.canTransition()?i.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",n).attr("width",s).attr("height",o):i.attr("transform",n).attr("width",s).attr("height",o),i.exit().remove()}var r=this.svg.group.selectAll("path.lz-data_layer-forest.lz-data_layer-forest-point").data(this.data,function(t){return t[this.layout.id_field]}.bind(this)),l=isNaN(this.parent.layout.height)?0:this.parent.layout.height;r.enter().append("path").attr("class","lz-data_layer-forest lz-data_layer-forest-point").attr("id",function(t){return this.getElementId(t)+"_point"}.bind(this)).attr("transform","translate(0,"+l+")");var h=function(t){var i=this.parent[e](t[this.layout.x_axis.field]),n=this.parent[a](t[this.layout.y_axis.field]);return isNaN(i)&&(i=-1e3),isNaN(n)&&(n=-1e3),"translate("+i+","+n+")"}.bind(this),d=function(t){return this.resolveScalableParameter(this.layout.color,t)}.bind(this),u=function(t){return this.resolveScalableParameter(this.layout.fill_opacity,t)}.bind(this),p=t.svg.symbol().size(function(t){return this.resolveScalableParameter(this.layout.point_size,t)}.bind(this)).type(function(t){return this.resolveScalableParameter(this.layout.point_shape,t)}.bind(this));this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p):r.attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p),r.exit().remove(),r.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t,!0)}.bind(this)),this.applyBehaviors(r)},this}),n.DataLayers.add("genes",function(e){return this.DefaultLayout={stroke:"rgb(54, 54, 150)",color:"#363696",label_font_size:12,label_exon_spacing:4,exon_height:16,bounding_box_padding:6,track_vertical_spacing:10},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.getElementStatusNodeId=function(t){return this.getElementId(t)+"-statusnode"},this.getTrackHeight=function(){return 2*this.layout.bounding_box_padding+this.layout.label_font_size+this.layout.label_exon_spacing+this.layout.exon_height+this.layout.track_vertical_spacing},this.transcript_idx=0,this.tracks=1,this.gene_track_index={1:[]},this.assignTracks=function(){return this.getLabelWidth=function(t,e){try{var a=this.svg.group.append("text").attr("x",0).attr("y",0).attr("class","lz-data_layer-genes lz-label").style("font-size",e).text(t+"→"),i=a.node().getBBox().width;return a.remove(),i}catch(t){return 0}},this.tracks=1,this.gene_track_index={1:[]},this.data.map(function(t,e){if(this.data[e].gene_id&&this.data[e].gene_id.indexOf(".")){var a=this.data[e].gene_id.split(".");this.data[e].gene_id=a[0],this.data[e].gene_version=a[1]}if(this.data[e].transcript_id=this.data[e].transcripts[this.transcript_idx].transcript_id,this.data[e].display_range={start:this.parent.x_scale(Math.max(t.start,this.state.start)),end:this.parent.x_scale(Math.min(t.end,this.state.end))},this.data[e].display_range.label_width=this.getLabelWidth(this.data[e].gene_name,this.layout.label_font_size),this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start,this.data[e].display_range.text_anchor="middle",this.data[e].display_range.widththis.state.end)this.data[e].display_range.start=this.data[e].display_range.end-this.data[e].display_range.label_width-this.layout.label_font_size,this.data[e].display_range.text_anchor="end";else{var i=(this.data[e].display_range.label_width-this.data[e].display_range.width)/2+this.layout.label_font_size;this.data[e].display_range.start-ithis.parent.x_scale(this.state.end)?(this.data[e].display_range.end=this.parent.x_scale(this.state.end),this.data[e].display_range.start=this.data[e].display_range.end-this.data[e].display_range.label_width,this.data[e].display_range.text_anchor="end"):(this.data[e].display_range.start-=i,this.data[e].display_range.end+=i)}this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start}this.data[e].display_range.start-=this.layout.bounding_box_padding,this.data[e].display_range.end+=this.layout.bounding_box_padding,this.data[e].display_range.width+=2*this.layout.bounding_box_padding,this.data[e].display_domain={start:this.parent.x_scale.invert(this.data[e].display_range.start),end:this.parent.x_scale.invert(this.data[e].display_range.end)},this.data[e].display_domain.width=this.data[e].display_domain.end-this.data[e].display_domain.start,this.data[e].track=null;for(var n=1;null===this.data[e].track;){var s=!1;this.gene_track_index[n].map(function(t){if(!s){var e=Math.min(t.display_range.start,this.display_range.start),a=Math.max(t.display_range.end,this.display_range.end);a-ethis.tracks&&(this.tracks=n,this.gene_track_index[n]=[])):(this.data[e].track=n,this.gene_track_index[n].push(this.data[e]))}this.data[e].parent=this,this.data[e].transcripts.map(function(t,a){this.data[e].transcripts[a].parent=this.data[e],this.data[e].transcripts[a].exons.map(function(t,i){this.data[e].transcripts[a].exons[i].parent=this.data[e].transcripts[a]}.bind(this))}.bind(this))}.bind(this)),this},this.render=function(){var e=this;this.assignTracks();var a,i,n,s,o=this.svg.group.selectAll("g.lz-data_layer-genes").data(this.data,function(t){return t.gene_name});o.enter().append("g").attr("class","lz-data_layer-genes"),o.attr("id",function(t){return this.getElementId(t)}.bind(this)).each(function(o){var r=o.parent,l=t.select(this).selectAll("rect.lz-data_layer-genes.lz-data_layer-genes-statusnode").data([o],function(t){return r.getElementStatusNodeId(t)});l.enter().append("rect").attr("class","lz-data_layer-genes lz-data_layer-genes-statusnode"),l.attr("id",function(t){return r.getElementStatusNodeId(t)}).attr("rx",function(){return r.layout.bounding_box_padding}).attr("ry",function(){return r.layout.bounding_box_padding}),a=function(t){return t.display_range.width},i=function(){return r.getTrackHeight()-r.layout.track_vertical_spacing},n=function(t){return t.display_range.start},s=function(t){return(t.track-1)*r.getTrackHeight()},r.canTransition()?l.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):l.attr("width",a).attr("height",i).attr("x",n).attr("y",s),l.exit().remove();var h=function(t){return e.resolveScalableParameter(e.layout.color,t)},d=function(t){return e.resolveScalableParameter(e.layout.stroke,t)},u=t.select(this).selectAll("rect.lz-data_layer-genes.lz-boundary").data([o],function(t){return t.gene_name+"_boundary"}).style({fill:h,stroke:d});u.enter().append("rect").attr("class","lz-data_layer-genes lz-boundary"),a=function(t){return r.parent.x_scale(t.end)-r.parent.x_scale(t.start)},i=function(){return 1},n=function(t){return r.parent.x_scale(t.start)},s=function(t){return(t.track-1)*r.getTrackHeight()+r.layout.bounding_box_padding+r.layout.label_font_size+r.layout.label_exon_spacing+Math.max(r.layout.exon_height,3)/2},r.canTransition()?u.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):u.attr("width",a).attr("height",i).attr("x",n).attr("y",s),u.exit().remove();var p=t.select(this).selectAll("text.lz-data_layer-genes.lz-label").data([o],function(t){return t.gene_name+"_label"});p.enter().append("text").attr("class","lz-data_layer-genes lz-label"),p.attr("text-anchor",function(t){return t.display_range.text_anchor}).text(function(t){return"+"===t.strand?t.gene_name+"→":"←"+t.gene_name}).style("font-size",o.parent.layout.label_font_size),n=function(t){return"middle"===t.display_range.text_anchor?t.display_range.start+t.display_range.width/2:"start"===t.display_range.text_anchor?t.display_range.start+r.layout.bounding_box_padding:"end"===t.display_range.text_anchor?t.display_range.end-r.layout.bounding_box_padding:void 0},s=function(t){return(t.track-1)*r.getTrackHeight()+r.layout.bounding_box_padding+r.layout.label_font_size},r.canTransition()?p.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("x",n).attr("y",s):p.attr("x",n).attr("y",s),p.exit().remove();var c=function(t){return e.resolveScalableParameter(e.layout.color,t.parent.parent)},y=function(t){return e.resolveScalableParameter(e.layout.stroke,t.parent.parent)},f=t.select(this).selectAll("rect.lz-data_layer-genes.lz-exon").data(o.transcripts[o.parent.transcript_idx].exons,function(t){return t.exon_id});f.enter().append("rect").attr("class","lz-data_layer-genes lz-exon"),f.style({fill:c,stroke:y}),a=function(t){return r.parent.x_scale(t.end)-r.parent.x_scale(t.start)},i=function(){return r.layout.exon_height},n=function(t){return r.parent.x_scale(t.start)},s=function(){return(o.track-1)*r.getTrackHeight()+r.layout.bounding_box_padding+r.layout.label_font_size+r.layout.label_exon_spacing},r.canTransition()?f.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):f.attr("width",a).attr("height",i).attr("x",n).attr("y",s),f.exit().remove();var g=t.select(this).selectAll("rect.lz-data_layer-genes.lz-clickarea").data([o],function(t){return t.gene_name+"_clickarea"});g.enter().append("rect").attr("class","lz-data_layer-genes lz-clickarea"),g.attr("id",function(t){return r.getElementId(t)+"_clickarea"}).attr("rx",function(){return r.layout.bounding_box_padding}).attr("ry",function(){return r.layout.bounding_box_padding}),a=function(t){return t.display_range.width},i=function(){return r.getTrackHeight()-r.layout.track_vertical_spacing},n=function(t){return t.display_range.start},s=function(t){return(t.track-1)*r.getTrackHeight()},r.canTransition()?g.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):g.attr("width",a).attr("height",i).attr("x",n).attr("y",s),g.exit().remove(),g.on("click.event_emitter",function(t){t.parent.parent.emit("element_clicked",t,!0)}),r.applyBehaviors(g)}),o.exit().remove()},this.positionTooltip=function(e){if("string"!=typeof e)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[e])throw"Unable to position tooltip: id does not point to a valid tooltip";var a,i,n,s=this.tooltips[e],o=7,r=1,l=this.getPageOrigin(),h=s.selector.node().getBoundingClientRect(),d=this.getElementStatusNodeId(s.data),u=t.select("#"+d).node().getBBox(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=(s.data.display_range.start+s.data.display_range.end)/2-this.layout.bounding_box_padding/2,f=Math.max(h.width/2-y,0),g=Math.max(h.width/2+y-c,0),_=l.x+y-h.width/2-g+f,m=h.width/2-o/2+g-f;h.height+r+o>p-(u.y+u.height)?(a=l.y+u.y-(h.height+r+o),i="down",n=h.height-r):(a=l.y+u.y+u.height+r+o,i="up",n=0-r-o),s.selector.style("left",_+"px").style("top",a+"px"),s.arrow||(s.arrow=s.selector.append("div").style("position","absolute")),s.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",m+"px").style("top",n+"px"); -},this}),n.DataLayers.add("genome_legend",function(t){return this.DefaultLayout={chromosome_fill_colors:{light:"rgb(155, 155, 188)",dark:"rgb(95, 95, 128)"},chromosome_label_colors:{light:"rgb(120, 120, 186)",dark:"rgb(0, 0, 66)"}},t=n.Layouts.merge(t,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.render=function(){var t=0;this.data.forEach(function(e,a){this.data[a].genome_start=t,this.data[a].genome_end=t+e["genome:base_pairs"],t+=e["genome:base_pairs"]}.bind(this));var e=this.svg.group.selectAll("rect.lz-data_layer-genome_legend").data(this.data,function(t){return t["genome:chr"]});e.enter().append("rect").attr("class","lz-data_layer-genome_legend");var a=this,i=this.parent;e.attr("fill",function(t){return t["genome:chr"]%2?a.layout.chromosome_fill_colors.light:a.layout.chromosome_fill_colors.dark}).attr("x",function(t){return i.x_scale(t.genome_start)}).attr("y",0).attr("width",function(t){return i.x_scale(t["genome:base_pairs"])}).attr("height",i.layout.cliparea.height),e.exit().remove();var n=/([^:]+):(\d+)(?:_.*)?/.exec(this.state.variant);if(!n)throw"Genome legend cannot understand the specified variant position";var s=n[1],o=n[2];t=+this.data[s-1].genome_start+ +o;var r=this.svg.group.selectAll("rect.lz-data_layer-genome_legend-marker").data([{start:t,end:t+1}]);r.enter().append("rect").attr("class","lz-data_layer-genome_legend-marker"),r.transition().duration(500).style({fill:"rgba(255, 250, 50, 0.8)",stroke:"rgba(255, 250, 50, 0.8)","stroke-width":"3px"}).attr("x",function(t){return i.x_scale(t.start)}).attr("y",0).attr("width",function(t){return i.x_scale(t.end-t.start)}).attr("height",i.layout.cliparea.height),r.exit().remove()},this}),n.DataLayers.add("intervals",function(e){return this.DefaultLayout={start_field:"start",end_field:"end",track_split_field:"state_id",track_split_order:"DESC",track_split_legend_to_y_axis:2,split_tracks:!0,track_height:15,track_vertical_spacing:3,bounding_box_padding:2,always_hide_legend:!1,color:"#B8B8B8",fill_opacity:1},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.getElementStatusNodeId=function(t){return this.layout.split_tracks?(this.getBaseId()+"-statusnode-"+t[this.layout.track_split_field]).replace(/[:.[\],]/g,"_"):this.getElementId(t)+"-statusnode"}.bind(this),this.getTrackHeight=function(){return this.layout.track_height+this.layout.track_vertical_spacing+2*this.layout.bounding_box_padding},this.tracks=1,this.previous_tracks=1,this.interval_track_index={1:[]},this.assignTracks=function(){if(this.previous_tracks=this.tracks,this.tracks=0,this.interval_track_index={1:[]},this.track_split_field_index={},this.layout.track_split_field&&this.layout.split_tracks){this.data.map(function(t){this.track_split_field_index[t[this.layout.track_split_field]]=null}.bind(this));var t=Object.keys(this.track_split_field_index);"DESC"===this.layout.track_split_order&&t.reverse(),t.forEach(function(t){this.track_split_field_index[t]=this.tracks+1,this.interval_track_index[this.tracks+1]=[],this.tracks++}.bind(this))}return this.data.map(function(t,e){if(this.data[e].parent=this,this.data[e].display_range={start:this.parent.x_scale(Math.max(t[this.layout.start_field],this.state.start)),end:this.parent.x_scale(Math.min(t[this.layout.end_field],this.state.end))},this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start,this.data[e].display_domain={start:this.parent.x_scale.invert(this.data[e].display_range.start),end:this.parent.x_scale.invert(this.data[e].display_range.end)},this.data[e].display_domain.width=this.data[e].display_domain.end-this.data[e].display_domain.start,this.layout.track_split_field&&this.layout.split_tracks){var a=this.data[e][this.layout.track_split_field];this.data[e].track=this.track_split_field_index[a],this.interval_track_index[this.data[e].track].push(e)}else{this.tracks=1,this.data[e].track=null;for(var i=1;null===this.data[e].track;){var n=!1;this.interval_track_index[i].map(function(t){if(!n){var e=Math.min(t.display_range.start,this.display_range.start),a=Math.max(t.display_range.end,this.display_range.end);a-ethis.tracks&&(this.tracks=i,this.interval_track_index[i]=[])):(this.data[e].track=i,this.interval_track_index[i].push(this.data[e]))}}}.bind(this)),this},this.render=function(){this.assignTracks(),this.svg.group.selectAll(".lz-data_layer-intervals-statusnode.lz-data_layer-intervals-shared").remove(),Object.keys(this.track_split_field_index).forEach(function(t){var e={};e[this.layout.track_split_field]=t;var a={display:this.layout.split_tracks?null:"none"};this.svg.group.insert("rect",":first-child").attr("id",this.getElementStatusNodeId(e)).attr("class","lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-shared").attr("rx",this.layout.bounding_box_padding).attr("ry",this.layout.bounding_box_padding).attr("width",this.parent.layout.cliparea.width).attr("height",this.getTrackHeight()-this.layout.track_vertical_spacing).attr("x",0).attr("y",(this.track_split_field_index[t]-1)*this.getTrackHeight()).style(a)}.bind(this));var e,a,i,n,s,o,r=this.svg.group.selectAll("g.lz-data_layer-intervals").data(this.data,function(t){return t[this.layout.id_field]}.bind(this));return r.enter().append("g").attr("class","lz-data_layer-intervals"),r.attr("id",function(t){return this.getElementId(t)}.bind(this)).each(function(r){var l=r.parent,h={display:l.layout.split_tracks?"none":null},d=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-data_layer-intervals-statusnode.lz-data_layer-intervals-statusnode-discrete").data([r],function(t){return l.getElementId(t)+"-statusnode"});d.enter().insert("rect",":first-child").attr("class","lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-statusnode-discrete"),d.attr("id",function(t){return l.getElementId(t)+"-statusnode"}).attr("rx",function(){return l.layout.bounding_box_padding}).attr("ry",function(){return l.layout.bounding_box_padding}).style(h),e=function(t){return t.display_range.width+2*l.layout.bounding_box_padding},a=function(){return l.getTrackHeight()-l.layout.track_vertical_spacing},i=function(t){return t.display_range.start-l.layout.bounding_box_padding},n=function(t){return(t.track-1)*l.getTrackHeight()},l.canTransition()?d.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):d.attr("width",e).attr("height",a).attr("x",i).attr("y",n),d.exit().remove();var u=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-interval_rect").data([r],function(t){return t[l.layout.id_field]+"_interval_rect"});u.enter().append("rect").attr("class","lz-data_layer-intervals lz-interval_rect"),a=l.layout.track_height,e=function(t){return t.display_range.width},i=function(t){return t.display_range.start},n=function(t){return(t.track-1)*l.getTrackHeight()+l.layout.bounding_box_padding},s=function(t){return l.resolveScalableParameter(l.layout.color,t)},o=function(t){return l.resolveScalableParameter(l.layout.fill_opacity,t)},l.canTransition()?u.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n).attr("fill",s).attr("fill-opacity",o):u.attr("width",e).attr("height",a).attr("x",i).attr("y",n).attr("fill",s).attr("fill-opacity",o),u.exit().remove();var p=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-clickarea").data([r],function(t){return t.interval_name+"_clickarea"});p.enter().append("rect").attr("class","lz-data_layer-intervals lz-clickarea"),p.attr("id",function(t){return l.getElementId(t)+"_clickarea"}).attr("rx",function(){return l.layout.bounding_box_padding}).attr("ry",function(){return l.layout.bounding_box_padding}),e=function(t){return t.display_range.width},a=function(){return l.getTrackHeight()-l.layout.track_vertical_spacing},i=function(t){return t.display_range.start},n=function(t){return(t.track-1)*l.getTrackHeight()},l.canTransition()?p.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):p.attr("width",e).attr("height",a).attr("x",i).attr("y",n),p.exit().remove(),p.on("click",function(t){t.parent.parent.emit("element_clicked",t,!0)}.bind(this)),l.applyBehaviors(p)}),r.exit().remove(),this.previous_tracks!==this.tracks&&this.updateSplitTrackAxis(),this},this.positionTooltip=function(e){if("string"!=typeof e)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[e])throw"Unable to position tooltip: id does not point to a valid tooltip";var a,i,n,s=this.tooltips[e],o=7,r=1,l=this.getPageOrigin(),h=s.selector.node().getBoundingClientRect(),d=t.select("#"+this.getElementStatusNodeId(s.data)).node().getBBox(),u=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),p=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),c=(s.data.display_range.start+s.data.display_range.end)/2-this.layout.bounding_box_padding/2,y=Math.max(h.width/2-c,0),f=Math.max(h.width/2+c-p,0),g=l.x+c-h.width/2-f+y,_=h.width/2-o/2+f-y;h.height+r+o>u-(d.y+d.height)?(a=l.y+d.y-(h.height+r+o),i="down",n=h.height-r):(a=l.y+d.y+d.height+r+o,i="up",n=0-r-o),s.selector.style("left",g+"px").style("top",a+"px"),s.arrow||(s.arrow=s.selector.append("div").style("position","absolute")),s.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",_+"px").style("top",n+"px")},this.updateSplitTrackAxis=function(){var t=!!this.layout.track_split_legend_to_y_axis&&"y"+this.layout.track_split_legend_to_y_axis;if(this.layout.split_tracks){var e=+this.tracks||0,a=+this.layout.track_height||0,i=2*(+this.layout.bounding_box_padding||0)+(+this.layout.track_vertical_spacing||0),n=e*a+(e-1)*i;this.parent.scaleHeightToData(n),t&&this.parent.legend&&(this.parent.legend.hide(),this.parent.layout.axes[t]={render:!0,ticks:[],range:{start:n-this.layout.track_height/2,end:this.layout.track_height/2}},this.layout.legend.forEach(function(a){var i=a[this.layout.track_split_field],n=this.track_split_field_index[i];n&&("DESC"===this.layout.track_split_order&&(n=Math.abs(n-e-1)),this.parent.layout.axes[t].ticks.push({y:n,text:a.label}))}.bind(this)),this.layout.y_axis={axis:this.layout.track_split_legend_to_y_axis,floor:1,ceiling:e},this.parent.render()),this.parent_plot.positionPanels()}else t&&this.parent.legend&&(this.layout.always_hide_legend||this.parent.legend.show(),this.parent.layout.axes[t]={render:!1},this.parent.render());return this},this.toggleSplitTracks=function(){return this.layout.split_tracks=!this.layout.split_tracks,this.parent.legend&&!this.layout.always_hide_legend&&(this.parent.layout.margin.bottom=5+(this.layout.split_tracks?0:this.parent.legend.layout.height+5)),this.render(),this.updateSplitTrackAxis(),this},this}),n.DataLayers.add("line",function(e){return this.DefaultLayout={style:{fill:"none","stroke-width":"2px"},interpolate:"linear",x_axis:{field:"x"},y_axis:{field:"y",axis:1},hitarea_width:5},e=n.Layouts.merge(e,this.DefaultLayout),this.mouse_event=null,this.line=null,this.tooltip_timeout=null,n.DataLayer.apply(this,arguments),this.getMouseDisplayAndData=function(){var e={display:{x:t.mouse(this.mouse_event)[0],y:null},data:{},slope:null},a=this.layout.x_axis.field,i=this.layout.y_axis.field,n="x_scale",s="y"+this.layout.y_axis.axis+"_scale";e.data[a]=this.parent[n].invert(e.display.x);var o=t.bisector(function(t){return+t[a]}).left,r=o(this.data,e.data[a])-1,l=this.data[r],h=this.data[r+1],d=t.interpolateNumber(+l[i],+h[i]),u=+h[a]-+l[a];return e.data[i]=d(e.data[a]%u/u),e.display.y=this.parent[s](e.data[i]),this.layout.tooltip.x_precision&&(e.data[a]=e.data[a].toPrecision(this.layout.tooltip.x_precision)),this.layout.tooltip.y_precision&&(e.data[i]=e.data[i].toPrecision(this.layout.tooltip.y_precision)),e.slope=(this.parent[s](h[i])-this.parent[s](l[i]))/(this.parent[n](h[a])-this.parent[n](l[a])),e},this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=o.selector.node().getBoundingClientRect(),l=7,h=6,d=parseFloat(this.layout.style["stroke-width"])||1,u=this.getPageOrigin(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=this.getMouseDisplayAndData();if(Math.abs(y.slope)>1)y.display.x<=this.parent.layout.width/2?(a=u.x+y.display.x+d+l+d,s="left",n=-1*(l+d)):(a=u.x+y.display.x-r.width-d-l-d,s="right",n=r.width-d),y.display.y-r.height/2<=0?(e=u.y+y.display.y-1.5*l-h,i=h):y.display.y+r.height/2>=p?(e=u.y+y.display.y+l+h-r.height,i=r.height-2*l-h):(e=u.y+y.display.y-r.height/2,i=r.height/2-l);else{var f=Math.max(r.width/2-y.display.x,0),g=Math.max(r.width/2+y.display.x-c,0);a=u.x+y.display.x-r.width/2-g+f;var _=l/2,m=r.width-2.5*l;n=r.width/2-l+g-f,n=Math.min(Math.max(n,_),m),r.height+d+l>y.display.y?(e=u.y+y.display.y+d+l,s="up",i=0-d-l):(e=u.y+y.display.y-(r.height+d+l),s="down",i=r.height-d)}o.selector.style({left:a+"px",top:e+"px"}),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+s).style({left:n+"px",top:i+"px"})},this.render=function(){var e=this,a=this.parent,i=this.layout.x_axis.field,n=this.layout.y_axis.field,s="x_scale",o="y"+this.layout.y_axis.axis+"_scale",r=this.svg.group.selectAll("path.lz-data_layer-line").data([this.data]);if(this.path=r.enter().append("path").attr("class","lz-data_layer-line"),this.line=t.svg.line().x(function(t){return parseFloat(a[s](t[i]))}).y(function(t){return parseFloat(a[o](t[n]))}).interpolate(this.layout.interpolate),this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("d",this.line).style(this.layout.style):r.attr("d",this.line).style(this.layout.style),this.layout.tooltip){var l=parseFloat(this.layout.hitarea_width).toString()+"px",h=this.svg.group.selectAll("path.lz-data_layer-line-hitarea").data([this.data]);h.enter().append("path").attr("class","lz-data_layer-line-hitarea").style("stroke-width",l);var d=t.svg.line().x(function(t){return parseFloat(a[s](t[i]))}).y(function(t){return parseFloat(a[o](t[n]))}).interpolate(this.layout.interpolate);h.attr("d",d).on("mouseover",function(){clearTimeout(e.tooltip_timeout),e.mouse_event=this;var t=e.getMouseDisplayAndData();e.createTooltip(t.data)}).on("mousemove",function(){clearTimeout(e.tooltip_timeout),e.mouse_event=this;var t=e.getMouseDisplayAndData();e.updateTooltip(t.data),e.positionTooltip(e.getElementId())}).on("mouseout",function(){e.tooltip_timeout=setTimeout(function(){e.mouse_event=null,e.destroyTooltip(e.getElementId())},300)}),h.exit().remove()}r.exit().remove()},this.setElementStatus=function(t,e,a){return this.setAllElementStatus(t,a)},this.setElementStatusByFilters=function(t,e){return this.setAllElementStatus(t,e)},this.setAllElementStatus=function(t,e){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setAllElementStatus()";if("undefined"==typeof this.state[this.state_id][t])return this;"undefined"==typeof e&&(e=!0),this.global_statuses[t]=e;var a="lz-data_layer-line";return Object.keys(this.global_statuses).forEach(function(t){this.global_statuses[t]&&(a+=" lz-data_layer-line-"+t)}.bind(this)),this.path.attr("class",a),this.parent.emit("layout_changed",!0),this},this}),n.DataLayers.add("orthogonal_line",function(e){return this.DefaultLayout={style:{stroke:"#D3D3D3","stroke-width":"3px","stroke-dasharray":"10px 10px"},orientation:"horizontal",x_axis:{axis:1,decoupled:!0},y_axis:{axis:1,decoupled:!0},offset:0},e=n.Layouts.merge(e,this.DefaultLayout),["horizontal","vertical"].indexOf(e.orientation)===-1&&(e.orientation="horizontal"),this.data=[],this.line=null,n.DataLayer.apply(this,arguments),this.render=function(){var e=this.parent,a="x_scale",i="y"+this.layout.y_axis.axis+"_scale",n="x_extent",s="y"+this.layout.y_axis.axis+"_extent",o="x_range",r="y"+this.layout.y_axis.axis+"_range";"horizontal"===this.layout.orientation?this.data=[{x:e[n][0],y:this.layout.offset},{x:e[n][1],y:this.layout.offset}]:this.data=[{x:this.layout.offset,y:e[s][0]},{x:this.layout.offset,y:e[s][1]}];var l=this.svg.group.selectAll("path.lz-data_layer-line").data([this.data]);this.path=l.enter().append("path").attr("class","lz-data_layer-line"),this.line=t.svg.line().x(function(t,i){var n=parseFloat(e[a](t.x));return isNaN(n)?e[o][i]:n}).y(function(t,a){var n=parseFloat(e[i](t.y));return isNaN(n)?e[r][a]:n}).interpolate("linear"),this.canTransition()?l.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("d",this.line).style(this.layout.style):l.attr("d",this.line).style(this.layout.style),l.exit().remove()},this}),n.DataLayers.add("scatter",function(e){return this.DefaultLayout={point_size:40,point_shape:"circle",tooltip_positioning:"horizontal",color:"#888888",fill_opacity:1,y_axis:{axis:1},id_field:"id"},e=n.Layouts.merge(e,this.DefaultLayout),e.label&&isNaN(e.label.spacing)&&(e.label.spacing=4),n.DataLayer.apply(this,arguments),this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=this.resolveScalableParameter(this.layout.point_size,o.data),l=Math.sqrt(r/Math.PI),h=7,d=1,u=6,p=this.getPageOrigin(),c=this.parent.x_scale(o.data[this.layout.x_axis.field]),y="y"+this.layout.y_axis.axis+"_scale",f=this.parent[y](o.data[this.layout.y_axis.field]),g=o.selector.node().getBoundingClientRect(),_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),m=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right);if("vertical"===this.layout.tooltip_positioning){var b=Math.max(g.width/2-c,0),v=Math.max(g.width/2+c-m,0);a=p.x+c-g.width/2-v+b,s=g.width/2-h/2+v-b-l,g.height+d+h>_-(f+l)?(e=p.y+f-(l+g.height+d+h),i="down",n=g.height-d):(e=p.y+f+l+d+h,i="up",n=0-d-h)}else c<=this.parent.layout.width/2?(a=p.x+c+l+h+d,i="left",s=-1*(h+d)):(a=p.x+c-g.width-l-h-d,i="right",s=g.width-d),_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),f-g.height/2<=0?(e=p.y+f-1.5*h-u,n=u):f+g.height/2>=_?(e=p.y+f+h+u-g.height,n=g.height-2*h-u):(e=p.y+f-g.height/2,n=g.height/2-h);o.selector.style("left",a+"px").style("top",e+"px"),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",s+"px").style("top",n+"px")},this.flip_labels=function(){var e=this,a=e.resolveScalableParameter(e.layout.point_size,{}),i=e.layout.label.spacing,n=Boolean(e.layout.label.lines),s=2*i,o=e.parent.layout.width-e.parent.layout.margin.left-e.parent.layout.margin.right-2*i,r=function(t,e){var s=+t.attr("x"),o=2*i+2*Math.sqrt(a);if(n)var r=+e.attr("x2"),l=i+2*Math.sqrt(a);"start"===t.style("text-anchor")?(t.style("text-anchor","end"),t.attr("x",s-o),n&&e.attr("x2",r-l)):(t.style("text-anchor","start"),t.attr("x",s+o),n&&e.attr("x2",r+l))};e.label_texts.each(function(a,s){var l=this,h=t.select(l),d=+h.attr("x"),u=h.node().getBoundingClientRect();if(d+u.width+i>o){var p=n?t.select(e.label_lines[0][s]):null;r(h,p)}}),e.label_texts.each(function(a,o){var l=this,h=t.select(l);if("end"!==h.style("text-anchor")){var d=+h.attr("x"),u=h.node().getBoundingClientRect(),p=n?t.select(e.label_lines[0][o]):null;e.label_texts.each(function(){var e=this,a=t.select(e),n=a.node().getBoundingClientRect(),o=u.leftn.left&&u.topn.top;o&&(r(h,p),d=+h.attr("x"),d-u.width-iu.left&&d.topu.top;if(p){n=!0;var c,y=h.attr("y"),f=d.topv?(c=_-+r,_=+r,m-=c):m+u.height/2>v&&(c=m-+y,m=+y,_-=c),o.attr("y",_),h.attr("y",m)}}}})}),n){if(e.layout.label.lines){var s=e.label_texts[0];e.label_lines.attr("y2",function(e,a){var i=t.select(s[a]);return i.attr("y")})}this.seperate_iterations<150&&setTimeout(function(){this.separate_labels()}.bind(this),1)}},this.render=function(){var e=this,a="x_scale",i="y"+this.layout.y_axis.axis+"_scale";if(this.layout.label){var s=this.data.filter(function(t){if(e.layout.label.filters){var a=!0;return e.layout.label.filters.forEach(function(e){var i=new n.Data.Field(e.field).resolve(t);if(isNaN(i))a=!1;else switch(e.operator){case"<":i":i>e.value||(a=!1);break;case">=":i>=e.value||(a=!1);break;case"=":i!==e.value&&(a=!1);break;default:a=!1}}),a}return!0}),o=this;this.label_groups=this.svg.group.selectAll("g.lz-data_layer-"+this.layout.type+"-label").data(s,function(t){return t[o.layout.id_field]+"_label"}),this.label_groups.enter().append("g").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_texts&&this.label_texts.remove(),this.label_texts=this.label_groups.append("text").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_texts.text(function(t){return n.parseFields(t,e.layout.label.text||"")}).style(e.layout.label.style||{}).attr({x:function(t){var i=e.parent[a](t[e.layout.x_axis.field])+Math.sqrt(e.resolveScalableParameter(e.layout.point_size,t))+e.layout.label.spacing;return isNaN(i)&&(i=-1e3),i},y:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a},"text-anchor":function(){return"start"}}),e.layout.label.lines&&(this.label_lines&&this.label_lines.remove(),this.label_lines=this.label_groups.append("line").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_lines.style(e.layout.label.lines.style||{}).attr({x1:function(t){var i=e.parent[a](t[e.layout.x_axis.field]);return isNaN(i)&&(i=-1e3),i},y1:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a},x2:function(t){var i=e.parent[a](t[e.layout.x_axis.field])+Math.sqrt(e.resolveScalableParameter(e.layout.point_size,t))+e.layout.label.spacing/2;return isNaN(i)&&(i=-1e3),i},y2:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a}})),this.label_groups.exit().remove()}var r=this.svg.group.selectAll("path.lz-data_layer-"+this.layout.type).data(this.data,function(t){return t[this.layout.id_field]}.bind(this)),l=isNaN(this.parent.layout.height)?0:this.parent.layout.height;r.enter().append("path").attr("class","lz-data_layer-"+this.layout.type).attr("id",function(t){return this.getElementId(t)}.bind(this)).attr("transform","translate(0,"+l+")");var h=function(t){var e=this.parent[a](t[this.layout.x_axis.field]),n=this.parent[i](t[this.layout.y_axis.field]);return isNaN(e)&&(e=-1e3),isNaN(n)&&(n=-1e3),"translate("+e+","+n+")"}.bind(this),d=function(t){return this.resolveScalableParameter(this.layout.color,t)}.bind(this),u=function(t){return this.resolveScalableParameter(this.layout.fill_opacity,t)}.bind(this),p=t.svg.symbol().size(function(t){return this.resolveScalableParameter(this.layout.point_size,t)}.bind(this)).type(function(t){return this.resolveScalableParameter(this.layout.point_shape,t)}.bind(this));this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p):r.attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p),r.exit().remove(),r.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t,!0)}.bind(this)),this.applyBehaviors(r),this.layout.label&&(this.flip_labels(),this.seperate_iterations=0,this.separate_labels(),this.label_texts.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t,!0)}.bind(this)),this.applyBehaviors(this.label_texts))},this.makeLDReference=function(t){var e=null;if("undefined"==typeof t)throw"makeLDReference requires one argument of any type";e="object"==typeof t?this.layout.id_field&&"undefined"!=typeof t[this.layout.id_field]?t[this.layout.id_field].toString():"undefined"!=typeof t.id?t.id.toString():t.toString():t.toString(),this.parent_plot.applyState({ldrefvar:e})},this}),n.DataLayers.extend("scatter","category_scatter",{_prepareData:function(){var t=this.layout.x_axis.field||"x",e=this.layout.x_axis.category_field;if(!e)throw"Layout for "+this.layout.id+" must specify category_field";var a=this.data.sort(function(t,a){var i=t[e],n=a[e],s=i.toString?i.toString().toLowerCase():i,o=n.toString?n.toString().toLowerCase():n;return s===o?0:s1?function(t){for(var e=t,n=0;n1?Math.ceil(Math.log(a)/Math.LN10):Math.floor(Math.log(a)/Math.LN10),Math.abs(e)<=3?t.toFixed(3):t.toExponential(2).replace("+","").replace("e"," × 10^")}),n.TransformationFunctions.add("urlencode",function(t){return encodeURIComponent(t)}),n.TransformationFunctions.add("htmlescape",function(t){return t?(t+="",t.replace(/['"<>&`]/g,function(t){switch(t){case"'":return"'";case'"':return""";case"<":return"<";case">":return">";case"&":return"&";case"`":return"`"}})):""}),n.ScaleFunctions=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t])return"undefined"==typeof a&&"undefined"==typeof i?e[t]:e[t](a,i);throw"scale function ["+t+"] not found"}return null},t.set=function(t,a){a?e[t]=a:delete e[t]},t.add=function(a,i){if(e[a])throw"scale function already exists with name: "+a;t.set(a,i)},t.list=function(){return Object.keys(e)},t}(),n.ScaleFunctions.add("if",function(t,e){return"undefined"==typeof e||t.field_value!==e?"undefined"!=typeof t.else?t.else:null:t.then}),n.ScaleFunctions.add("numerical_bin",function(t,e){var a=t.breaks||[],i=t.values||[];if("undefined"==typeof e||null===e||isNaN(+e))return t.null_value?t.null_value:null;var n=a.reduce(function(t,a){return+e=t&&+e=e.breaks[e.breaks.length-1])return n[i.length-1];var o=null;if(i.forEach(function(t,e){e&&i[e-1]<=+a&&i[e]>=+a&&(o=e)}),null===o)return s;var r=(+a-i[o-1])/(i[o]-i[o-1]);return isFinite(r)?t.interpolate(n[o-1],n[o])(r):s}),n.Dashboard=function(t){if(!(t instanceof n.Plot||t instanceof n.Panel))throw"Unable to create dashboard, parent must be a locuszoom plot or panel";return this.parent=t,this.id=this.parent.getBaseId()+".dashboard",this.type=this.parent instanceof n.Plot?"plot":"panel",this.parent_plot="plot"===this.type?this.parent:this.parent.parent,this.selector=null,this.components=[],this.hide_timeout=null,this.persist=!1,this.initialize()},n.Dashboard.prototype.initialize=function(){ -return Array.isArray(this.parent.layout.dashboard.components)&&this.parent.layout.dashboard.components.forEach(function(t){try{var e=n.Dashboard.Components.get(t.type,t,this);this.components.push(e)}catch(t){console.warn(t)}}.bind(this)),"panel"===this.type&&(t.select(this.parent.parent.svg.node().parentNode).on("mouseover."+this.id,function(){clearTimeout(this.hide_timeout),this.selector&&"hidden"!==this.selector.style("visibility")||this.show()}.bind(this)),t.select(this.parent.parent.svg.node().parentNode).on("mouseout."+this.id,function(){clearTimeout(this.hide_timeout),this.hide_timeout=setTimeout(function(){this.hide()}.bind(this),300)}.bind(this))),this},n.Dashboard.prototype.shouldPersist=function(){if(this.persist)return!0;var t=!1;return this.components.forEach(function(e){t=t||e.shouldPersist()}),t=t||this.parent_plot.panel_boundaries.dragging||this.parent_plot.interaction.dragging,!!t},n.Dashboard.prototype.show=function(){if(!this.selector){switch(this.type){case"plot":this.selector=t.select(this.parent.svg.node().parentNode).insert("div",":first-child");break;case"panel":this.selector=t.select(this.parent.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip, .lz-dashboard-menu, .lz-curtain").classed("lz-panel-dashboard",!0)}this.selector.classed("lz-dashboard",!0).classed("lz-"+this.type+"-dashboard",!0).attr("id",this.id)}return this.components.forEach(function(t){t.show()}),this.selector.style({visibility:"visible"}),this.update()},n.Dashboard.prototype.update=function(){return this.selector?(this.components.forEach(function(t){t.update()}),this.position()):this},n.Dashboard.prototype.position=function(){if(!this.selector)return this;if("panel"===this.type){var t=this.parent.getPageOrigin(),e=(t.y+3.5).toString()+"px",a=t.x.toString()+"px",i=(this.parent.layout.width-4).toString()+"px";this.selector.style({position:"absolute",top:e,left:a,width:i})}return this.components.forEach(function(t){t.position()}),this},n.Dashboard.prototype.hide=function(){return!this.selector||this.shouldPersist()?this:(this.components.forEach(function(t){t.hide()}),this.selector.style({visibility:"hidden"}),this)},n.Dashboard.prototype.destroy=function(t){return"undefined"==typeof t&&(t=!1),this.selector?this.shouldPersist()&&!t?this:(this.components.forEach(function(t){t.destroy(!0)}),this.components=[],this.selector.remove(),this.selector=null,this):this},n.Dashboard.Component=function(t,e){return this.layout=t||{},this.layout.color||(this.layout.color="gray"),this.parent=e||null,this.parent_panel=null,this.parent_plot=null,this.parent_svg=null,this.parent instanceof n.Dashboard&&("panel"===this.parent.type?(this.parent_panel=this.parent.parent,this.parent_plot=this.parent.parent.parent,this.parent_svg=this.parent_panel):(this.parent_plot=this.parent.parent,this.parent_svg=this.parent_plot)),this.selector=null,this.button=null,this.persist=!1,this.layout.position||(this.layout.position="left"),this},n.Dashboard.Component.prototype.show=function(){if(this.parent&&this.parent.selector){if(!this.selector){var t=["start","middle","end"].indexOf(this.layout.group_position)!==-1?" lz-dashboard-group-"+this.layout.group_position:"";this.selector=this.parent.selector.append("div").attr("class","lz-dashboard-"+this.layout.position+t),this.layout.style&&this.selector.style(this.layout.style),"function"==typeof this.initialize&&this.initialize()}return this.button&&"highlighted"===this.button.status&&this.button.menu.show(),this.selector.style({visibility:"visible"}),this.update(),this.position()}},n.Dashboard.Component.prototype.update=function(){},n.Dashboard.Component.prototype.position=function(){return this.button&&this.button.menu.position(),this},n.Dashboard.Component.prototype.shouldPersist=function(){return!!this.persist||!(!this.button||!this.button.persist)},n.Dashboard.Component.prototype.hide=function(){return!this.selector||this.shouldPersist()?this:(this.button&&this.button.menu.hide(),this.selector.style({visibility:"hidden"}),this)},n.Dashboard.Component.prototype.destroy=function(t){return"undefined"==typeof t&&(t=!1),this.selector?this.shouldPersist()&&!t?this:(this.button&&this.button.menu&&this.button.menu.destroy(),this.selector.remove(),this.selector=null,this.button=null,this):this},n.Dashboard.Components=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t]){if("object"!=typeof a)throw"invalid layout argument for dashboard component ["+t+"]";return new e[t](a,i)}throw"dashboard component ["+t+"] not found"}return null},t.set=function(t,a){if(a){if("function"!=typeof a)throw"unable to set dashboard component ["+t+"], argument provided is not a function";e[t]=a,e[t].prototype=new n.Dashboard.Component}else delete e[t]},t.add=function(a,i){if(e[a])throw"dashboard component already exists with name: "+a;t.set(a,i)},t.list=function(){return Object.keys(e)},t}(),n.Dashboard.Component.Button=function(e){if(!(e instanceof n.Dashboard.Component))throw"Unable to create dashboard component button, invalid parent";this.parent=e,this.parent_panel=this.parent.parent_panel,this.parent_plot=this.parent.parent_plot,this.parent_svg=this.parent.parent_svg,this.parent_dashboard=this.parent.parent,this.selector=null,this.tag="a",this.setTag=function(t){return"undefined"!=typeof t&&(this.tag=t.toString()),this},this.html="",this.setHtml=function(t){return"undefined"!=typeof t&&(this.html=t.toString()),this},this.setText=this.setHTML,this.title="",this.setTitle=function(t){return"undefined"!=typeof t&&(this.title=t.toString()),this},this.color="gray",this.setColor=function(t){return"undefined"!=typeof t&&(["gray","red","orange","yellow","green","blue","purple"].indexOf(t)!==-1?this.color=t:this.color="gray"),this},this.style={},this.setStyle=function(t){return"undefined"!=typeof t&&(this.style=t),this},this.getClass=function(){var t=["start","middle","end"].indexOf(this.parent.layout.group_position)!==-1?" lz-dashboard-button-group-"+this.parent.layout.group_position:"";return"lz-dashboard-button lz-dashboard-button-"+this.color+(this.status?"-"+this.status:"")+t},this.persist=!1,this.permanent=!1,this.setPermanent=function(t){return t="undefined"==typeof t||Boolean(t),this.permanent=t,this.permanent&&(this.persist=!0),this},this.shouldPersist=function(){return this.permanent||this.persist},this.status="",this.setStatus=function(t){return"undefined"!=typeof t&&["","highlighted","disabled"].indexOf(t)!==-1&&(this.status=t),this.update()},this.highlight=function(t){return t="undefined"==typeof t||Boolean(t),t?this.setStatus("highlighted"):"highlighted"===this.status?this.setStatus(""):this},this.disable=function(t){return t="undefined"==typeof t||Boolean(t),t?this.setStatus("disabled"):"disabled"===this.status?this.setStatus(""):this},this.onmouseover=function(){},this.setOnMouseover=function(t){return"function"==typeof t?this.onmouseover=t:this.onmouseover=function(){},this},this.onmouseout=function(){},this.setOnMouseout=function(t){return"function"==typeof t?this.onmouseout=t:this.onmouseout=function(){},this},this.onclick=function(){},this.setOnclick=function(t){return"function"==typeof t?this.onclick=t:this.onclick=function(){},this},this.show=function(){if(this.parent)return this.selector||(this.selector=this.parent.selector.append(this.tag).attr("class",this.getClass())),this.update()},this.preUpdate=function(){return this},this.update=function(){return this.selector?(this.preUpdate(),this.selector.attr("class",this.getClass()).attr("title",this.title).style(this.style).on("mouseover","disabled"===this.status?null:this.onmouseover).on("mouseout","disabled"===this.status?null:this.onmouseout).on("click","disabled"===this.status?null:this.onclick).html(this.html),this.menu.update(),this.postUpdate(),this):this},this.postUpdate=function(){return this},this.hide=function(){return this.selector&&!this.shouldPersist()&&(this.selector.remove(),this.selector=null),this},this.menu={outer_selector:null,inner_selector:null,scroll_position:0,hidden:!0,show:function(){return this.menu.outer_selector||(this.menu.outer_selector=t.select(this.parent_plot.svg.node().parentNode).append("div").attr("class","lz-dashboard-menu lz-dashboard-menu-"+this.color).attr("id",this.parent_svg.getBaseId()+".dashboard.menu"),this.menu.inner_selector=this.menu.outer_selector.append("div").attr("class","lz-dashboard-menu-content"),this.menu.inner_selector.on("scroll",function(){this.menu.scroll_position=this.menu.inner_selector.node().scrollTop}.bind(this))),this.menu.outer_selector.style({visibility:"visible"}),this.menu.hidden=!1,this.menu.update()}.bind(this),update:function(){return this.menu.outer_selector?(this.menu.populate(),this.menu.inner_selector&&(this.menu.inner_selector.node().scrollTop=this.menu.scroll_position),this.menu.position()):this.menu}.bind(this),position:function(){if(!this.menu.outer_selector)return this.menu;this.menu.outer_selector.style({height:null});var t=3,e=20,a=14,i=this.parent_svg.getPageOrigin(),n=document.documentElement.scrollTop||document.body.scrollTop,s=this.parent_plot.getContainerOffset(),o=this.parent_dashboard.selector.node().getBoundingClientRect(),r=this.selector.node().getBoundingClientRect(),l=this.menu.outer_selector.node().getBoundingClientRect(),h=this.menu.inner_selector.node().scrollHeight,d=0,u=0;"panel"===this.parent_dashboard.type?(d=i.y+o.height+2*t,u=Math.max(i.x+this.parent_svg.layout.width-l.width-t,i.x+t)):(d=r.bottom+n+t-s.top,u=Math.max(r.left+r.width-l.width-s.left,i.x+t));var p=Math.max(this.parent_svg.layout.width-2*t-e,e),c=p,y=p-4*t,f=Math.max(this.parent_svg.layout.height-10*t-a,a),g=Math.min(h,f),_=f;return this.menu.outer_selector.style({top:d.toString()+"px",left:u.toString()+"px","max-width":c.toString()+"px","max-height":_.toString()+"px",height:g.toString()+"px"}),this.menu.inner_selector.style({"max-width":y.toString()+"px"}),this.menu.inner_selector.node().scrollTop=this.menu.scroll_position,this.menu}.bind(this),hide:function(){return this.menu.outer_selector?(this.menu.outer_selector.style({visibility:"hidden"}),this.menu.hidden=!0,this.menu):this.menu}.bind(this),destroy:function(){return this.menu.outer_selector?(this.menu.inner_selector.remove(),this.menu.outer_selector.remove(),this.menu.inner_selector=null,this.menu.outer_selector=null,this.menu):this.menu}.bind(this),populate:function(){}.bind(this),setPopulate:function(t){return"function"==typeof t?(this.menu.populate=t,this.setOnclick(function(){this.menu.hidden?(this.menu.show(),this.highlight().update(),this.persist=!0):(this.menu.hide(),this.highlight(!1).update(),this.permanent||(this.persist=!1))}.bind(this))):this.setOnclick(),this}.bind(this)}},n.Dashboard.Components.add("title",function(t){n.Dashboard.Component.apply(this,arguments),this.show=function(){return this.div_selector=this.parent.selector.append("div").attr("class","lz-dashboard-title lz-dashboard-"+this.layout.position),this.title_selector=this.div_selector.append("h3"),this.update()},this.update=function(){var e=t.title.toString();return this.layout.subtitle&&(e+=" "+this.layout.subtitle+""),this.title_selector.html(e),this}}),n.Dashboard.Components.add("dimensions",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){var e=this.parent_plot.layout.width.toString().indexOf(".")===-1?this.parent_plot.layout.width:this.parent_plot.layout.width.toFixed(2),a=this.parent_plot.layout.height.toString().indexOf(".")===-1?this.parent_plot.layout.height:this.parent_plot.layout.height.toFixed(2);return this.selector.html(e+"px × "+a+"px"),t.class&&this.selector.attr("class",t.class),t.style&&this.selector.style(t.style),this}}),n.Dashboard.Components.add("region_scale",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)||null===this.parent_plot.state.start||null===this.parent_plot.state.end?this.selector.style("display","none"):(this.selector.style("display",null),this.selector.html(n.positionIntToString(this.parent_plot.state.end-this.parent_plot.state.start,null,!0))),t.class&&this.selector.attr("class",t.class),t.style&&this.selector.style(t.style),this}}),n.Dashboard.Components.add("download",function(a){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(a.color).setHtml("Download Image").setTitle("Download image of the current plot as locuszoom.svg").setOnMouseover(function(){this.button.selector.classed("lz-dashboard-button-gray-disabled",!0).html("Preparing Image"),this.generateBase64SVG().then(function(t){this.button.selector.attr("href","data:image/svg+xml;base64,\n"+t).classed("lz-dashboard-button-gray-disabled",!1).classed("lz-dashboard-button-gray-highlighted",!0).html("Download Image")}.bind(this))}.bind(this)).setOnMouseout(function(){this.button.selector.classed("lz-dashboard-button-gray-highlighted",!1)}.bind(this)),this.button.show(),this.button.selector.attr("href-lang","image/svg+xml").attr("download","locuszoom.svg"),this)},this.css_string="";for(var i in Object.keys(document.styleSheets))if(null!==document.styleSheets[i].href&&document.styleSheets[i].href.indexOf("locuszoom.css")!==-1){n.createCORSPromise("GET",document.styleSheets[i].href).then(function(t){this.css_string=t.replace(/[\r\n]/g," ").replace(/\s+/g," "),this.css_string.indexOf("/* ! LocusZoom HTML Styles */")&&(this.css_string=this.css_string.substring(0,this.css_string.indexOf("/* ! LocusZoom HTML Styles */")))}.bind(this));break}this.generateBase64SVG=function(){return e.fcall(function(){var e=this.parent.selector.append("div").style("display","none").html(this.parent_plot.svg.node().outerHTML);e.selectAll("g.lz-curtain").remove(),e.selectAll("g.lz-mouse_guide").remove(),e.selectAll("g.tick text").each(function(){var e=10*+t.select(this).attr("dy").substring(-2).slice(0,-2);t.select(this).attr("dy",e)});var a=t.select(e.select("svg").node().parentNode).html(),i='",n=a.indexOf(">")+1;return a=a.slice(0,n)+i+a.slice(n),e.remove(),btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode("0x"+e)}))}.bind(this))}}),n.Dashboard.Components.add("remove_panel",function(e){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(e.color).setHtml("×").setTitle("Remove panel").setOnclick(function(){if(!e.suppress_confirm&&!confirm("Are you sure you want to remove this panel? This cannot be undone!"))return!1;var a=this.parent_panel;return a.dashboard.hide(!0),t.select(a.parent.svg.node().parentNode).on("mouseover."+a.getBaseId()+".dashboard",null),t.select(a.parent.svg.node().parentNode).on("mouseout."+a.getBaseId()+".dashboard",null),a.parent.removePanel(a.id)}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("move_panel_up",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){if(this.button){var e=0===this.parent_panel.layout.y_index;return this.button.disable(e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("▴").setTitle("Move panel up").setOnclick(function(){this.parent_panel.moveUp(),this.update()}.bind(this)),this.button.show(),this.update()}}),n.Dashboard.Components.add("move_panel_down",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){if(this.button){var e=this.parent_panel.layout.y_index===this.parent_plot.panel_ids_by_y_index.length-1;return this.button.disable(e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("▾").setTitle("Move panel down").setOnclick(function(){this.parent_panel.moveDown(),this.update()}.bind(this)),this.button.show(),this.update()}}),n.Dashboard.Components.add("shift_region",function(t){return n.Dashboard.Component.apply(this,arguments),isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)?(this.update=function(){},void console.warn("Unable to add shift_region dashboard component: plot state does not have region bounds")):((isNaN(t.step)||0===t.step)&&(t.step=5e4),"string"!=typeof t.button_html&&(t.button_html=t.step>0?">":"<"),"string"!=typeof t.button_title&&(t.button_title="Shift region by "+(t.step>0?"+":"-")+n.positionIntToString(Math.abs(t.step),null,!0)),void(this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){this.parent_plot.applyState({start:Math.max(this.parent_plot.state.start+t.step,1),end:this.parent_plot.state.end+t.step})}.bind(this)),this.button.show(),this)}))}),n.Dashboard.Components.add("zoom_region",function(t){return n.Dashboard.Component.apply(this,arguments),isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)?(this.update=function(){},void console.warn("Unable to add zoom_region dashboard component: plot state does not have region bounds")):((isNaN(t.step)||0===t.step)&&(t.step=.2),"string"!=typeof t.button_html&&(t.button_html=t.step>0?"z–":"z+"),"string"!=typeof t.button_title&&(t.button_title="Zoom region "+(t.step>0?"out":"in")+" by "+(100*Math.abs(t.step)).toFixed(1)+"%"),void(this.update=function(){if(this.button){var e=!0,a=this.parent_plot.state.end-this.parent_plot.state.start;return t.step>0&&!isNaN(this.parent_plot.layout.max_region_scale)&&a>=this.parent_plot.layout.max_region_scale&&(e=!1),t.step<0&&!isNaN(this.parent_plot.layout.min_region_scale)&&a<=this.parent_plot.layout.min_region_scale&&(e=!1),this.button.disable(!e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){var e=this.parent_plot.state.end-this.parent_plot.state.start,a=1+t.step,i=e*a;isNaN(this.parent_plot.layout.max_region_scale)||(i=Math.min(i,this.parent_plot.layout.max_region_scale)),isNaN(this.parent_plot.layout.min_region_scale)||(i=Math.max(i,this.parent_plot.layout.min_region_scale));var n=Math.floor((i-e)/2);this.parent_plot.applyState({start:Math.max(this.parent_plot.state.start-n,1),end:this.parent_plot.state.end+n})}.bind(this)),this.button.show(),this}))}),n.Dashboard.Components.add("menu",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title),this.button.menu.setPopulate(function(){this.button.menu.inner_selector.html(t.menu_html)}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("covariates_model",function(t){n.Dashboard.Component.apply(this,arguments),this.initialize=function(){this.parent_plot.state.model=this.parent_plot.state.model||{},this.parent_plot.state.model.covariates=this.parent_plot.state.model.covariates||[],this.parent_plot.CovariatesModel={button:this,add:function(t){var e=JSON.parse(JSON.stringify(t));"object"==typeof t&&"string"!=typeof e.html&&(e.html="function"==typeof t.toHTML?t.toHTML():t.toString());for(var a=0;a1?"covariates":"covariate";t+=" ("+this.parent_plot.state.model.covariates.length+" "+e+")"}this.button.setHtml(t).disable(!1)}.bind(this),this.button.show(),this)}}),n.Dashboard.Components.add("toggle_split_tracks",function(t){if(n.Dashboard.Component.apply(this,arguments),t.data_layer_id||(t.data_layer_id="intervals"),!this.parent_panel.data_layers[t.data_layer_id])throw"Dashboard toggle split tracks component missing valid data layer ID";this.update=function(){var e=this.parent_panel.data_layers[t.data_layer_id],a=e.layout.split_tracks?"Merge Tracks":"Split Tracks";return this.button?(this.button.setHtml(a),this.button.show(),this.parent.position(),this):(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(a).setTitle("Toggle whether tracks are split apart or merged together").setOnclick(function(){e.toggleSplitTracks(),this.scale_timeout&&clearTimeout(this.scale_timeout);var t=e.layout.transition?+e.layout.transition.duration||0:0;this.scale_timeout=setTimeout(function(){this.parent_panel.scaleHeightToData(),this.parent_plot.positionPanels()}.bind(this),t),this.update()}.bind(this)),this.update())}}),n.Dashboard.Components.add("resize_to_data",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("Resize to Data").setTitle("Automatically resize this panel to fit the data its currently showing").setOnclick(function(){this.parent_panel.scaleHeightToData(),this.update()}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("toggle_legend",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){var e=this.parent_panel.legend.layout.hidden?"Show Legend":"Hide Legend";return this.button?(this.button.setHtml(e).show(),this.parent.position(),this):(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setTitle("Show or hide the legend for this panel").setOnclick(function(){this.parent_panel.legend.layout.hidden=!this.parent_panel.legend.layout.hidden,this.parent_panel.legend.render(),this.update()}.bind(this)),this.update())}}),n.Dashboard.Components.add("data_layers",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return"string"!=typeof t.button_html&&(t.button_html="Data Layers"),"string"!=typeof t.button_title&&(t.button_title="Manipulate Data Layers (sort, dim, show/hide, etc.)"),this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){this.button.menu.populate()}.bind(this)),this.button.menu.setPopulate(function(){this.button.menu.inner_selector.html("");var e=this.button.menu.inner_selector.append("table");return this.parent_panel.data_layer_ids_by_z_index.slice().reverse().forEach(function(a,i){var s=this.parent_panel.data_layers[a],o="string"!=typeof s.layout.name?s.id:s.layout.name,r=e.append("tr");r.append("td").html(o),t.statuses.forEach(function(t){var e,a,i,o=n.DataLayer.Statuses.adjectives.indexOf(t),l=n.DataLayer.Statuses.verbs[o];s.global_statuses[t]?(e=n.DataLayer.Statuses.menu_antiverbs[o],a="un"+l+"AllElements",i="-highlighted"):(e=n.DataLayer.Statuses.verbs[o],a=l+"AllElements",i=""),r.append("td").append("a").attr("class","lz-dashboard-button lz-dashboard-button-"+this.layout.color+i).style({"margin-left":"0em"}).on("click",function(){s[a](),this.button.menu.populate()}.bind(this)).html(e)}.bind(this));var l=0===i,h=i===this.parent_panel.data_layer_ids_by_z_index.length-1,d=r.append("td");d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-start lz-dashboard-button-"+this.layout.color+(h?"-disabled":"")).style({"margin-left":"0em"}).on("click",function(){s.moveDown(),this.button.menu.populate()}.bind(this)).html("▾").attr("title","Move layer down (further back)"),d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-middle lz-dashboard-button-"+this.layout.color+(l?"-disabled":"")).style({"margin-left":"0em"}).on("click",function(){s.moveUp(),this.button.menu.populate()}.bind(this)).html("▴").attr("title","Move layer up (further front)"),d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-end lz-dashboard-button-red").style({"margin-left":"0em"}).on("click",function(){return confirm("Are you sure you want to remove the "+o+" layer? This cannot be undone!")&&s.parent.removeDataLayer(a),this.button.menu.populate()}.bind(this)).html("×").attr("title","Remove layer")}.bind(this)),this}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("display_options",function(t){"string"!=typeof t.button_html&&(t.button_html="Display options"),"string"!=typeof t.button_title&&(t.button_title="Control how plot items are displayed"),n.Dashboard.Component.apply(this,arguments);var e=t.fields_whitelist||["color","fill_opacity","label","legend","point_shape","point_size","tooltip","tooltip_positioning"],a=this.parent_panel.data_layers[t.layer_name],i=a.layout,s={};e.forEach(function(t){var e=i[t];e&&(s[t]=JSON.parse(JSON.stringify(e)))}),this._selected_item="default";var o=this;this.button=new n.Dashboard.Component.Button(o).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){o.button.menu.populate()}),this.button.menu.setPopulate(function(){var t=Math.floor(1e4*Math.random()).toString();o.button.menu.inner_selector.html("");var e=o.button.menu.inner_selector.append("table"),i=o.layout,n=function(i,n,s){var r=e.append("tr");r.append("td").append("input").attr({type:"radio",name:"color-picker-"+t,value:s}).property("checked",s===o._selected_item).on("click",function(){Object.keys(n).forEach(function(t){a.layout[t]=n[t]}),o._selected_item=s,o.parent_panel.render();var t=o.parent_panel.legend;t&&n.legend&&t.render()}),r.append("td").text(i)},r=i.default_config_display_name||"Default style";return n(r,s,"default"),i.options.forEach(function(t,e){n(t.display_name,t.display,e)}),o}),this.update=function(){return this.button.show(),this}}),n.Legend=function(t){if(!(t instanceof n.Panel))throw"Unable to create legend, parent must be a locuszoom panel";return this.parent=t,this.id=this.parent.getBaseId()+".legend",this.parent.layout.legend=n.Layouts.merge(this.parent.layout.legend||{},n.Legend.DefaultLayout),this.layout=this.parent.layout.legend,this.selector=null,this.background_rect=null,this.elements=[],this.elements_group=null,this.hidden=!1,this.render()},n.Legend.DefaultLayout={orientation:"vertical",origin:{x:0,y:0},width:10,height:10,padding:5,label_size:12,hidden:!1},n.Legend.prototype.render=function(){this.selector||(this.selector=this.parent.svg.group.append("g").attr("id",this.parent.getBaseId()+".legend").attr("class","lz-legend")),this.background_rect||(this.background_rect=this.selector.append("rect").attr("width",100).attr("height",100).attr("class","lz-legend-background")),this.elements_group||(this.elements_group=this.selector.append("g")),this.elements.forEach(function(t){t.remove()}),this.elements=[];var e=+this.layout.padding||1,a=e,i=e,n=0;this.parent.data_layer_ids_by_z_index.slice().reverse().forEach(function(s){Array.isArray(this.parent.data_layers[s].layout.legend)&&this.parent.data_layers[s].layout.legend.forEach(function(s){var o=this.elements_group.append("g").attr("transform","translate("+a+","+i+")"),r=+s.label_size||+this.layout.label_size||12,l=0,h=r/2+e/2;if(n=Math.max(n,r+e),"line"===s.shape){var d=+s.length||16,u=r/4+e/2;o.append("path").attr("class",s.class||"").attr("d","M0,"+u+"L"+d+","+u).style(s.style||{}),l=d+e}else if("rect"===s.shape){var p=+s.width||16,c=+s.height||p;o.append("rect").attr("class",s.class||"").attr("width",p).attr("height",c).attr("fill",s.color||{}).style(s.style||{}),l=p+e,n=Math.max(n,c+e)}else if(t.svg.symbolTypes.indexOf(s.shape)!==-1){var y=+s.size||40,f=Math.ceil(Math.sqrt(y/Math.PI));o.append("path").attr("class",s.class||"").attr("d",t.svg.symbol().size(y).type(s.shape)).attr("transform","translate("+f+","+(f+e/2)+")").attr("fill",s.color||{}).style(s.style||{}),l=2*f+e,h=Math.max(2*f+e/2,h),n=Math.max(n,2*f+e)}o.append("text").attr("text-anchor","left").attr("class","lz-label").attr("x",l).attr("y",h).style({"font-size":r}).text(s.label);var g=o.node().getBoundingClientRect();if("vertical"===this.layout.orientation)i+=g.height+e,n=0;else{var _=this.layout.origin.x+a+g.width;a>e&&_>this.parent.layout.width&&(i+=n,a=e,o.attr("transform","translate("+a+","+i+")")),a+=g.width+3*e}this.elements.push(o)}.bind(this))}.bind(this));var s=this.elements_group.node().getBoundingClientRect();return this.layout.width=s.width+2*this.layout.padding,this.layout.height=s.height+2*this.layout.padding,this.background_rect.attr("width",this.layout.width).attr("height",this.layout.height),this.selector.style({visibility:this.layout.hidden?"hidden":"visible"}),this.position()},n.Legend.prototype.position=function(){if(!this.selector)return this;var t=this.selector.node().getBoundingClientRect();isNaN(+this.layout.pad_from_bottom)||(this.layout.origin.y=this.parent.layout.height-t.height-+this.layout.pad_from_bottom),isNaN(+this.layout.pad_from_right)||(this.layout.origin.x=this.parent.layout.width-t.width-+this.layout.pad_from_right),this.selector.attr("transform","translate("+this.layout.origin.x+","+this.layout.origin.y+")")},n.Legend.prototype.hide=function(){this.layout.hidden=!0,this.render()},n.Legend.prototype.show=function(){this.layout.hidden=!1,this.render()},n.Data=n.Data||{},n.DataSources=function(){this.sources={}},n.DataSources.prototype.addSource=function(t,e){return console.warn("Warning: .addSource() is deprecated. Use .add() instead"),this.add(t,e)},n.DataSources.prototype.add=function(t,e){return this.set(t,e)},n.DataSources.prototype.set=function(t,e){if(Array.isArray(e)){var a=n.KnownDataSources.create.apply(null,e);a.source_id=t,this.sources[t]=a}else null!==e?(e.source_id=t,this.sources[t]=e):delete this.sources[t];return this},n.DataSources.prototype.getSource=function(t){return console.warn("Warning: .getSource() is deprecated. Use .get() instead"),this.get(t)},n.DataSources.prototype.get=function(t){return this.sources[t]},n.DataSources.prototype.removeSource=function(t){return console.warn("Warning: .removeSource() is deprecated. Use .remove() instead"),this.remove(t)},n.DataSources.prototype.remove=function(t){return this.set(t,null)},n.DataSources.prototype.fromJSON=function(t){"string"==typeof t&&(t=JSON.parse(t)); -var e=this;return Object.keys(t).forEach(function(a){e.set(a,t[a])}),e},n.DataSources.prototype.keys=function(){return Object.keys(this.sources)},n.DataSources.prototype.toJSON=function(){return this.sources},n.Data.Field=function(t){var e=/^(?:([^:]+):)?([^:|]*)(\|.+)*$/.exec(t);this.full_name=t,this.namespace=e[1]||null,this.name=e[2]||null,this.transformations=[],"string"==typeof e[3]&&e[3].length>1&&(this.transformations=e[3].substring(1).split("|"),this.transformations.forEach(function(t,e){this.transformations[e]=n.TransformationFunctions.get(t)}.bind(this))),this.applyTransformations=function(t){return this.transformations.forEach(function(e){t=e(t)}),t},this.resolve=function(t){if("undefined"==typeof t[this.full_name]){var e=null;"undefined"!=typeof t[this.namespace+":"+this.name]?e=t[this.namespace+":"+this.name]:"undefined"!=typeof t[this.name]&&(e=t[this.name]),t[this.full_name]=this.applyTransformations(e)}return t[this.full_name]}},n.Data.Requester=function(t){function a(t){var e={},a=/^(?:([^:]+):)?([^:|]*)(\|.+)*$/;return t.forEach(function(t){var i=a.exec(t),s=i[1]||"base",o=i[2],r=n.TransformationFunctions.get(i[3]);"undefined"==typeof e[s]&&(e[s]={outnames:[],fields:[],trans:[]}),e[s].outnames.push(t),e[s].fields.push(o),e[s].trans.push(r)}),e}this.getData=function(i,n){for(var s=a(n),o=Object.keys(s).map(function(e){if(!t.get(e))throw"Datasource for namespace "+e+" not found";return t.get(e).getData(i,s[e].fields,s[e].outnames,s[e].trans)}),r=e.when({header:{},body:{},discrete:{}}),l=0;l1&&(2!==e.length||e.indexOf("isrefvar")===-1))throw"LD does not know how to get all fields: "+e.join(", ")},n.Data.LDSource.prototype.findMergeFields=function(t){var e=function(t){return function(){for(var e=arguments,a=0;a0){var i=Object.keys(t.body[0]),n=e(i);a.id=a.id||n(/\bvariant\b/)||n(/\bid\b/),a.position=a.position||n(/\bposition\b/i,/\bpos\b/i),a.pvalue=a.pvalue||n(/\bpvalue\b/i,/\blog_pvalue\b/i),a._names_=i}return a},n.Data.LDSource.prototype.findRequestedFields=function(t,e){for(var a={},i=0;ii&&(i=t[s][e]*a,n=s);return n},n=t.ldrefsource||e.header.ldrefsource||1,s=this.findRequestedFields(a),o=s.ldin;if("state"===o&&(o=t.ldrefvar||e.header.ldrefvar||"best"),"best"===o){if(!e.body)throw"No association data found to find best pvalue";var r=this.findMergeFields(e);if(!r.pvalue||!r.id){var l="";throw r.id||(l+=(l.length?", ":"")+"id"),r.pvalue||(l+=(l.length?", ":"")+"pvalue"),"Unable to find necessary column(s) for merge: "+l+" (available: "+r._names_+")"}o=e.body[i(e.body,r.pvalue)][r.id]}return e.header||(e.header={}),e.header.ldrefvar=o,this.url+"results/?filter=reference eq "+n+" and chromosome2 eq '"+t.chr+"' and position2 ge "+t.start+" and position2 le "+t.end+" and variant1 eq '"+o+"'&fields=chr,pos,rsquare"},n.Data.LDSource.prototype.combineChainBody=function(t,e,a,i){var n=this.findMergeFields(e),s=this.findRequestedFields(a,i);if(!n.position)throw"Unable to find position field for merge: "+n._names_;var o=function(t,e,a,i){for(var s=0,o=0;s0&&parseFloat(this.panels[i].layout.proportional_height)>0&&(s=Math.max(s,this.panels[i].layout.min_height/this.panels[i].layout.proportional_height));if(this.layout.min_width=Math.max(n,1),this.layout.min_height=Math.max(s,1),t.select(this.svg.node().parentNode).style({"min-width":this.layout.min_width+"px","min-height":this.layout.min_height+"px"}),!isNaN(e)&&e>=0&&!isNaN(a)&&a>=0){this.layout.width=Math.max(Math.round(+e),this.layout.min_width),this.layout.height=Math.max(Math.round(+a),this.layout.min_height),this.layout.aspect_ratio=this.layout.width/this.layout.height,this.layout.responsive_resize&&(this.svg&&(this.layout.width=Math.max(this.svg.node().parentNode.getBoundingClientRect().width,this.layout.min_width)),this.layout.height=this.layout.width/this.layout.aspect_ratio,this.layout.height0)e.layout.y_index<0&&(e.layout.y_index=Math.max(this.panel_ids_by_y_index.length+e.layout.y_index,0)),this.panel_ids_by_y_index.splice(e.layout.y_index,0,e.id),this.applyPanelYIndexesToPanelLayouts();else{var a=this.panel_ids_by_y_index.push(e.id);this.panels[e.id].layout.y_index=a-1}var i=null;return this.layout.panels.forEach(function(t,a){t.id===e.id&&(i=a)}),null===i&&(i=this.layout.panels.push(this.panels[e.id].layout)-1),this.panels[e.id].layout_idx=i,this.initialized&&(this.positionPanels(),this.panels[e.id].initialize(),this.panels[e.id].reMap(),this.setDimensions(this.layout.width,this.layout.height)),this.panels[e.id]},n.Plot.prototype.clearPanelData=function(t,e){e=e||"wipe";var a;a=t?[t]:Object.keys(this.panels);var i=this;return a.forEach(function(t){i.panels[t].data_layer_ids_by_z_index.forEach(function(a){var n=i.panels[t].data_layers[a];n.destroyAllTooltips(),delete i.layout.state[t+"."+a],"reset"===e&&n.setDefaultState()})}),this},n.Plot.prototype.removePanel=function(t){if(!this.panels[t])throw"Unable to remove panel, ID not found: "+t;return this.panel_boundaries.hide(),this.clearPanelData(t),this.panels[t].loader.hide(),this.panels[t].dashboard.destroy(!0),this.panels[t].curtain.hide(),this.panels[t].svg.container&&this.panels[t].svg.container.remove(),this.layout.panels.splice(this.panels[t].layout_idx,1),delete this.panels[t],delete this.layout.state[t],this.layout.panels.forEach(function(t,e){this.panels[t.id].layout_idx=e}.bind(this)),this.panel_ids_by_y_index.splice(this.panel_ids_by_y_index.indexOf(t),1),this.applyPanelYIndexesToPanelLayouts(),this.initialized&&(this.layout.min_height=this._base_layout.min_height,this.layout.min_width=this._base_layout.min_width,this.positionPanels(),this.setDimensions(this.layout.width,this.layout.height)),this},n.Plot.prototype.positionPanels=function(){var t,e={left:0,right:0};for(t in this.panels)null===this.panels[t].layout.proportional_height&&(this.panels[t].layout.proportional_height=this.panels[t].layout.height/this.layout.height),null===this.panels[t].layout.proportional_width&&(this.panels[t].layout.proportional_width=1),this.panels[t].layout.interaction.x_linked&&(e.left=Math.max(e.left,this.panels[t].layout.margin.left),e.right=Math.max(e.right,this.panels[t].layout.margin.right));var a=this.sumProportional("height");if(!a)return this;var i=1/a;for(t in this.panels)this.panels[t].layout.proportional_height*=i;var n=0;this.panel_ids_by_y_index.forEach(function(t){if(this.panels[t].setOrigin(0,n),this.panels[t].layout.proportional_origin.x=0,n+=this.panels[t].layout.height,this.panels[t].layout.interaction.x_linked){var a=Math.max(e.left-this.panels[t].layout.margin.left,0)+Math.max(e.right-this.panels[t].layout.margin.right,0);this.panels[t].layout.width+=a,this.panels[t].layout.margin.left=e.left,this.panels[t].layout.margin.right=e.right,this.panels[t].layout.cliparea.origin.x=e.left}}.bind(this));var s=n;return this.panel_ids_by_y_index.forEach(function(t){this.panels[t].layout.proportional_origin.y=this.panels[t].layout.origin.y/s}.bind(this)),this.setDimensions(),this.panel_ids_by_y_index.forEach(function(t){this.panels[t].setDimensions(this.layout.width*this.panels[t].layout.proportional_width,this.layout.height*this.panels[t].layout.proportional_height)}.bind(this)),this},n.Plot.prototype.initialize=function(){if(this.layout.responsive_resize&&t.select(this.container).classed("lz-container-responsive",!0),this.layout.mouse_guide){var e=this.svg.append("g").attr("class","lz-mouse_guide").attr("id",this.id+".mouse_guide"),a=e.append("rect").attr("class","lz-mouse_guide-vertical").attr("x",-1),i=e.append("rect").attr("class","lz-mouse_guide-horizontal").attr("y",-1);this.mouse_guide={svg:e,vertical:a,horizontal:i}}this.curtain=n.generateCurtain.call(this),this.loader=n.generateLoader.call(this),this.panel_boundaries={parent:this,hide_timeout:null,showing:!1,dragging:!1,selectors:[],corner_selector:null,show:function(){if(!this.showing&&!this.parent.curtain.showing){this.showing=!0,this.parent.panel_ids_by_y_index.forEach(function(e,a){var i=t.select(this.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip").attr("class","lz-panel-boundary").attr("title","Resize panel");i.append("span");var n=t.behavior.drag();n.on("dragstart",function(){this.dragging=!0}.bind(this)),n.on("dragend",function(){this.dragging=!1}.bind(this)),n.on("drag",function(){var e=this.parent.panels[this.parent.panel_ids_by_y_index[a]],i=e.layout.height;e.setDimensions(e.layout.width,e.layout.height+t.event.dy);var n=e.layout.height-i,s=this.parent.layout.height+n;this.parent.panel_ids_by_y_index.forEach(function(t,e){var i=this.parent.panels[this.parent.panel_ids_by_y_index[e]];i.layout.proportional_height=i.layout.height/s,e>a&&(i.setOrigin(i.layout.origin.x,i.layout.origin.y+n),i.dashboard.position())}.bind(this)),this.parent.positionPanels(),this.position()}.bind(this)),i.call(n),this.parent.panel_boundaries.selectors.push(i)}.bind(this));var e=t.select(this.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip").attr("class","lz-panel-corner-boundary").attr("title","Resize plot");e.append("span").attr("class","lz-panel-corner-boundary-outer"),e.append("span").attr("class","lz-panel-corner-boundary-inner");var a=t.behavior.drag();a.on("dragstart",function(){this.dragging=!0}.bind(this)),a.on("dragend",function(){this.dragging=!1}.bind(this)),a.on("drag",function(){this.setDimensions(this.layout.width+t.event.dx,this.layout.height+t.event.dy)}.bind(this.parent)),e.call(a),this.parent.panel_boundaries.corner_selector=e}return this.position()},position:function(){if(!this.showing)return this;var t=this.parent.getPageOrigin();this.selectors.forEach(function(e,a){var i=this.parent.panels[this.parent.panel_ids_by_y_index[a]].getPageOrigin(),n=t.x,s=i.y+this.parent.panels[this.parent.panel_ids_by_y_index[a]].layout.height-12,o=this.parent.layout.width-1;e.style({top:s+"px",left:n+"px",width:o+"px"}),e.select("span").style({width:o+"px"})}.bind(this));var e=10,a=16;return this.corner_selector.style({top:t.y+this.parent.layout.height-e-a+"px",left:t.x+this.parent.layout.width-e-a+"px"}),this},hide:function(){return this.showing?(this.showing=!1,this.selectors.forEach(function(t){t.remove()}),this.selectors=[],this.corner_selector.remove(),this.corner_selector=null,this):this}},this.layout.panel_boundaries&&(t.select(this.svg.node().parentNode).on("mouseover."+this.id+".panel_boundaries",function(){clearTimeout(this.panel_boundaries.hide_timeout),this.panel_boundaries.show()}.bind(this)),t.select(this.svg.node().parentNode).on("mouseout."+this.id+".panel_boundaries",function(){this.panel_boundaries.hide_timeout=setTimeout(function(){this.panel_boundaries.hide()}.bind(this),300)}.bind(this))),this.dashboard=new n.Dashboard(this).show();for(var s in this.panels)this.panels[s].initialize();var o="."+this.id;if(this.layout.mouse_guide){var r=function(){this.mouse_guide.vertical.attr("x",-1),this.mouse_guide.horizontal.attr("y",-1)}.bind(this),l=function(){var e=t.mouse(this.svg.node());this.mouse_guide.vertical.attr("x",e[0]),this.mouse_guide.horizontal.attr("y",e[1])}.bind(this);this.svg.on("mouseout"+o+"-mouse_guide",r).on("touchleave"+o+"-mouse_guide",r).on("mousemove"+o+"-mouse_guide",l)}var h=function(){this.stopDrag()}.bind(this),d=function(){if(this.interaction.dragging){var e=t.mouse(this.svg.node());t.event&&t.event.preventDefault(),this.interaction.dragging.dragged_x=e[0]-this.interaction.dragging.start_x,this.interaction.dragging.dragged_y=e[1]-this.interaction.dragging.start_y,this.panels[this.interaction.panel_id].render(),this.interaction.linked_panel_ids.forEach(function(t){this.panels[t].render()}.bind(this))}}.bind(this);this.svg.on("mouseup"+o,h).on("touchend"+o,h).on("mousemove"+o,d).on("touchmove"+o,d),t.select("body").empty()||t.select("body").on("mouseup"+o,h).on("touchend"+o,h),this.initialized=!0;var u=this.svg.node().getBoundingClientRect(),p=u.width?u.width:this.layout.width,c=u.height?u.height:this.layout.height;return this.setDimensions(p,c),this},n.Plot.prototype.refresh=function(){return this.applyState()},n.Plot.prototype.subscribeToData=function(t,e,a){a=a||{};var i=a.onerror||function(t){console.log("An error occurred while acting on an external callback",t)},n=this,s=function(){try{n.lzd.getData(n.state,t).then(function(t){e(a.discrete?t.discrete:t.body)}).catch(i)}catch(t){i(t)}};return this.on("data_rendered",s),s},n.Plot.prototype.applyState=function(t){if(t=t||{},"object"!=typeof t)throw"LocusZoom.applyState only accepts an object; "+typeof t+" given";var a=JSON.parse(JSON.stringify(this.state));for(var i in t)a[i]=t[i];a=n.validateState(a,this.layout);for(i in a)this.state[i]=a[i];this.emit("data_requested"),this.remap_promises=[],this.loading_data=!0;for(var s in this.panels)this.remap_promises.push(this.panels[s].reMap());return e.all(this.remap_promises).catch(function(t){console.error(t),this.curtain.drop(t),this.loading_data=!1}.bind(this)).then(function(){this.dashboard.update(),this.panel_ids_by_y_index.forEach(function(t){var e=this.panels[t];e.dashboard.update(),e.data_layer_ids_by_z_index.forEach(function(e){var a=this.data_layers[e],i=t+"."+e;for(var n in this.state[i])this.state[i].hasOwnProperty(n)&&Array.isArray(this.state[i][n])&&this.state[i][n].forEach(function(t){try{this.setElementStatus(n,this.getElementById(t),!0)}catch(t){console.error("Unable to apply state: "+i+", "+n)}}.bind(a))}.bind(e))}.bind(this)),this.emit("layout_changed"),this.emit("data_rendered"),this.emit("state_changed",t),this.loading_data=!1}.bind(this))},n.Plot.prototype.startDrag=function(e,a){e=e||null,a=a||null;var i=null;switch(a){case"background":case"x_tick":i="x";break;case"y1_tick":i="y1";break;case"y2_tick":i="y2"}if(!(e instanceof n.Panel&&i&&this.canInteract()))return this.stopDrag();var s=t.mouse(this.svg.node());return this.interaction={panel_id:e.id,linked_panel_ids:e.getLinkedPanelIds(i),dragging:{method:a,start_x:s[0],start_y:s[1],dragged_x:0,dragged_y:0,axis:i}},this.svg.style("cursor","all-scroll"),this},n.Plot.prototype.stopDrag=function(){if(!this.interaction.dragging)return this;if("object"!=typeof this.panels[this.interaction.panel_id])return this.interaction={},this;var t=this.panels[this.interaction.panel_id],e=function(e,a,i){t.data_layer_ids_by_z_index.forEach(function(n){t.data_layers[n].layout[e+"_axis"].axis===a&&(t.data_layers[n].layout[e+"_axis"].floor=i[0],t.data_layers[n].layout[e+"_axis"].ceiling=i[1],delete t.data_layers[n].layout[e+"_axis"].lower_buffer,delete t.data_layers[n].layout[e+"_axis"].upper_buffer,delete t.data_layers[n].layout[e+"_axis"].min_extent,delete t.data_layers[n].layout[e+"_axis"].ticks)})};switch(this.interaction.dragging.method){case"background":case"x_tick":0!==this.interaction.dragging.dragged_x&&(e("x",1,t.x_extent),this.applyState({start:t.x_extent[0],end:t.x_extent[1]}));break;case"y1_tick":case"y2_tick":if(0!==this.interaction.dragging.dragged_y){var a=parseInt(this.interaction.dragging.method[1]);e("y",a,t["y"+a+"_extent"])}}return this.interaction={},this.svg.style("cursor",null),this},n.Panel=function(t,e){if("object"!=typeof t)throw"Unable to create panel, invalid layout";if(this.parent=e||null,this.parent_plot=e,"string"==typeof t.id&&t.id.length){if(this.parent&&"undefined"!=typeof this.parent.panels[t.id])throw"Cannot create panel with id ["+t.id+"]; panel with that id already exists"}else if(this.parent){var a=null,i=function(){a="p"+Math.floor(Math.random()*Math.pow(10,8)),null!=a&&"undefined"==typeof this.parent.panels[a]||(a=i())}.bind(this);t.id=a}else t.id="p"+Math.floor(Math.random()*Math.pow(10,8));return this.id=t.id,this.initialized=!1,this.layout_idx=null,this.svg={},this.layout=n.Layouts.merge(t||{},n.Panel.DefaultLayout),this.parent?(this.state=this.parent.state,this.state_id=this.id,this.state[this.state_id]=this.state[this.state_id]||{}):(this.state=null,this.state_id=null),this.data_layers={},this.data_layer_ids_by_z_index=[],this.applyDataLayerZIndexesToDataLayerLayouts=function(){this.data_layer_ids_by_z_index.forEach(function(t,e){this.data_layers[t].layout.z_index=e}.bind(this))}.bind(this),this.data_promises=[],this.x_scale=null,this.y1_scale=null,this.y2_scale=null,this.x_extent=null,this.y1_extent=null,this.y2_extent=null,this.x_ticks=[],this.y1_ticks=[], -this.y2_ticks=[],this.zoom_timeout=null,this.getBaseId=function(){return this.parent.id+"."+this.id},this.event_hooks={layout_changed:[],data_requested:[],data_rendered:[],element_clicked:[],element_selection:[]},this.on=function(t,e){if(!Array.isArray(this.event_hooks[t]))throw"Unable to register event hook, invalid event: "+t.toString();if("function"!=typeof e)throw"Unable to register event hook, invalid hook function passed";return this.event_hooks[t].push(e),e},this.off=function(t,e){var a=this.event_hooks[t];if(!Array.isArray(a))throw"Unable to remove event hook, invalid event: "+t.toString();if(void 0===e)this.event_hooks[t]=[];else{var i=a.indexOf(e);if(i===-1)throw"The specified event listener is not registered and therefore cannot be removed";a.splice(i,1)}return this},this.emit=function(t,e,a){if(a=a||!1,!Array.isArray(this.event_hooks[t]))throw"LocusZoom attempted to throw an invalid event: "+t.toString();"boolean"==typeof e&&2===arguments.length&&(a=e,e=null);var i=this.getBaseId(),n=this,s={sourceID:i,data:e||null};return this.event_hooks[t].forEach(function(t){t.call(n,s)}),a&&this.parent&&this.parent.emit(t,s),this},this.getPageOrigin=function(){var t=this.parent.getPageOrigin();return{x:t.x+this.layout.origin.x,y:t.y+this.layout.origin.y}},this.initializeLayout(),this};n.Panel.DefaultLayout={title:{text:"",style:{},x:10,y:22},y_index:null,width:0,height:0,origin:{x:0,y:null},min_width:1,min_height:1,proportional_width:null,proportional_height:null,proportional_origin:{x:0,y:null},margin:{top:0,right:0,bottom:0,left:0},background_click:"clear_selections",dashboard:{components:[]},cliparea:{height:0,width:0,origin:{x:0,y:0}},axes:{x:{},y1:{},y2:{}},legend:null,interaction:{drag_background_to_pan:!1,drag_x_ticks_to_scale:!1,drag_y1_ticks_to_scale:!1,drag_y2_ticks_to_scale:!1,scroll_to_zoom:!1,x_linked:!1,y1_linked:!1,y2_linked:!1},data_layers:[]};n.Panel.prototype.initializeLayout=function(){if(0===this.layout.width&&null===this.layout.proportional_width&&(this.layout.proportional_width=1),0===this.layout.height&&null===this.layout.proportional_height){var t=Object.keys(this.parent.panels).length;t>0?this.layout.proportional_height=1/t:this.layout.proportional_height=1}return this.setDimensions(),this.setOrigin(),this.setMargin(),this.x_range=[0,this.layout.cliparea.width],this.y1_range=[this.layout.cliparea.height,0],this.y2_range=[this.layout.cliparea.height,0],["x","y1","y2"].forEach(function(t){Object.keys(this.layout.axes[t]).length&&this.layout.axes[t].render!==!1?(this.layout.axes[t].render=!0,this.layout.axes[t].label=this.layout.axes[t].label||null,this.layout.axes[t].label_function=this.layout.axes[t].label_function||null):this.layout.axes[t].render=!1}.bind(this)),this.layout.data_layers.forEach(function(t){this.addDataLayer(t)}.bind(this)),this},n.Panel.prototype.setDimensions=function(t,e){return"undefined"!=typeof t&&"undefined"!=typeof e?!isNaN(t)&&t>=0&&!isNaN(e)&&e>=0&&(this.layout.width=Math.max(Math.round(+t),this.layout.min_width),this.layout.height=Math.max(Math.round(+e),this.layout.min_height)):(null!==this.layout.proportional_width&&(this.layout.width=Math.max(this.layout.proportional_width*this.parent.layout.width,this.layout.min_width)),null!==this.layout.proportional_height&&(this.layout.height=Math.max(this.layout.proportional_height*this.parent.layout.height,this.layout.min_height))),this.layout.cliparea.width=Math.max(this.layout.width-(this.layout.margin.left+this.layout.margin.right),0),this.layout.cliparea.height=Math.max(this.layout.height-(this.layout.margin.top+this.layout.margin.bottom),0),this.svg.clipRect&&this.svg.clipRect.attr("width",this.layout.width).attr("height",this.layout.height),this.initialized&&(this.render(),this.curtain.update(),this.loader.update(),this.dashboard.update(),this.legend&&this.legend.position()),this},n.Panel.prototype.setOrigin=function(t,e){return!isNaN(t)&&t>=0&&(this.layout.origin.x=Math.max(Math.round(+t),0)),!isNaN(e)&&e>=0&&(this.layout.origin.y=Math.max(Math.round(+e),0)),this.initialized&&this.render(),this},n.Panel.prototype.setMargin=function(t,e,a,i){var n;return!isNaN(t)&&t>=0&&(this.layout.margin.top=Math.max(Math.round(+t),0)),!isNaN(e)&&e>=0&&(this.layout.margin.right=Math.max(Math.round(+e),0)),!isNaN(a)&&a>=0&&(this.layout.margin.bottom=Math.max(Math.round(+a),0)),!isNaN(i)&&i>=0&&(this.layout.margin.left=Math.max(Math.round(+i),0)),this.layout.margin.top+this.layout.margin.bottom>this.layout.height&&(n=Math.floor((this.layout.margin.top+this.layout.margin.bottom-this.layout.height)/2),this.layout.margin.top-=n,this.layout.margin.bottom-=n),this.layout.margin.left+this.layout.margin.right>this.layout.width&&(n=Math.floor((this.layout.margin.left+this.layout.margin.right-this.layout.width)/2),this.layout.margin.left-=n,this.layout.margin.right-=n),["top","right","bottom","left"].forEach(function(t){this.layout.margin[t]=Math.max(this.layout.margin[t],0)}.bind(this)),this.layout.cliparea.width=Math.max(this.layout.width-(this.layout.margin.left+this.layout.margin.right),0),this.layout.cliparea.height=Math.max(this.layout.height-(this.layout.margin.top+this.layout.margin.bottom),0),this.layout.cliparea.origin.x=this.layout.margin.left,this.layout.cliparea.origin.y=this.layout.margin.top,this.initialized&&this.render(),this},n.Panel.prototype.setTitle=function(t){if("string"==typeof this.layout.title){var e=this.layout.title;this.layout.title={text:e,x:0,y:0,style:{}}}return"string"==typeof t?this.layout.title.text=t:"object"==typeof t&&null!==t&&(this.layout.title=n.Layouts.merge(t,this.layout.title)),this.layout.title.text.length?this.title.attr("display",null).attr("x",parseFloat(this.layout.title.x)).attr("y",parseFloat(this.layout.title.y)).style(this.layout.title.style).text(this.layout.title.text):this.title.attr("display","none"),this},n.Panel.prototype.initialize=function(){this.svg.container=this.parent.svg.append("g").attr("id",this.getBaseId()+".panel_container").attr("transform","translate("+(this.layout.origin.x||0)+","+(this.layout.origin.y||0)+")");var t=this.svg.container.append("clipPath").attr("id",this.getBaseId()+".clip");if(this.svg.clipRect=t.append("rect").attr("width",this.layout.width).attr("height",this.layout.height),this.svg.group=this.svg.container.append("g").attr("id",this.getBaseId()+".panel").attr("clip-path","url(#"+this.getBaseId()+".clip)"),this.curtain=n.generateCurtain.call(this),this.loader=n.generateLoader.call(this),this.dashboard=new n.Dashboard(this),this.inner_border=this.svg.group.append("rect").attr("class","lz-panel-background").on("click",function(){"clear_selections"===this.layout.background_click&&this.clearSelections()}.bind(this)),this.title=this.svg.group.append("text").attr("class","lz-panel-title"),"undefined"!=typeof this.layout.title&&this.setTitle(),this.svg.x_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".x_axis").attr("class","lz-x lz-axis"),this.layout.axes.x.render&&(this.svg.x_axis_label=this.svg.x_axis.append("text").attr("class","lz-x lz-axis lz-label").attr("text-anchor","middle")),this.svg.y1_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".y1_axis").attr("class","lz-y lz-y1 lz-axis"),this.layout.axes.y1.render&&(this.svg.y1_axis_label=this.svg.y1_axis.append("text").attr("class","lz-y1 lz-axis lz-label").attr("text-anchor","middle")),this.svg.y2_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".y2_axis").attr("class","lz-y lz-y2 lz-axis"),this.layout.axes.y2.render&&(this.svg.y2_axis_label=this.svg.y2_axis.append("text").attr("class","lz-y2 lz-axis lz-label").attr("text-anchor","middle")),this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].initialize()}.bind(this)),this.legend=null,this.layout.legend&&(this.legend=new n.Legend(this)),this.layout.interaction.drag_background_to_pan){var e="."+this.parent.id+"."+this.id+".interaction.drag",a=function(){this.parent.startDrag(this,"background")}.bind(this);this.svg.container.select(".lz-panel-background").on("mousedown"+e+".background",a).on("touchstart"+e+".background",a)}return this},n.Panel.prototype.resortDataLayers=function(){var e=[];this.data_layer_ids_by_z_index.forEach(function(t){e.push(this.data_layers[t].layout.z_index)}.bind(this)),this.svg.group.selectAll("g.lz-data_layer-container").data(e).sort(t.ascending),this.applyDataLayerZIndexesToDataLayerLayouts()},n.Panel.prototype.getLinkedPanelIds=function(t){t=t||null;var e=[];return["x","y1","y2"].indexOf(t)===-1?e:this.layout.interaction[t+"_linked"]?(this.parent.panel_ids_by_y_index.forEach(function(a){a!==this.id&&this.parent.panels[a].layout.interaction[t+"_linked"]&&e.push(a)}.bind(this)),e):e},n.Panel.prototype.moveUp=function(){return this.parent.panel_ids_by_y_index[this.layout.y_index-1]&&(this.parent.panel_ids_by_y_index[this.layout.y_index]=this.parent.panel_ids_by_y_index[this.layout.y_index-1],this.parent.panel_ids_by_y_index[this.layout.y_index-1]=this.id,this.parent.applyPanelYIndexesToPanelLayouts(),this.parent.positionPanels()),this},n.Panel.prototype.moveDown=function(){return this.parent.panel_ids_by_y_index[this.layout.y_index+1]&&(this.parent.panel_ids_by_y_index[this.layout.y_index]=this.parent.panel_ids_by_y_index[this.layout.y_index+1],this.parent.panel_ids_by_y_index[this.layout.y_index+1]=this.id,this.parent.applyPanelYIndexesToPanelLayouts(),this.parent.positionPanels()),this},n.Panel.prototype.addDataLayer=function(t){if("object"!=typeof t||"string"!=typeof t.id||!t.id.length)throw"Invalid data layer layout passed to LocusZoom.Panel.prototype.addDataLayer()";if("undefined"!=typeof this.data_layers[t.id])throw"Cannot create data_layer with id ["+t.id+"]; data layer with that id already exists in the panel";if("string"!=typeof t.type)throw"Invalid data layer type in layout passed to LocusZoom.Panel.prototype.addDataLayer()";"object"!=typeof t.y_axis||"undefined"!=typeof t.y_axis.axis&&[1,2].indexOf(t.y_axis.axis)!==-1||(t.y_axis.axis=1);var e=n.DataLayers.get(t.type,t,this);if(this.data_layers[e.id]=e,null!==e.layout.z_index&&!isNaN(e.layout.z_index)&&this.data_layer_ids_by_z_index.length>0)e.layout.z_index<0&&(e.layout.z_index=Math.max(this.data_layer_ids_by_z_index.length+e.layout.z_index,0)),this.data_layer_ids_by_z_index.splice(e.layout.z_index,0,e.id),this.data_layer_ids_by_z_index.forEach(function(t,e){this.data_layers[t].layout.z_index=e}.bind(this));else{var a=this.data_layer_ids_by_z_index.push(e.id);this.data_layers[e.id].layout.z_index=a-1}var i=null;return this.layout.data_layers.forEach(function(t,a){t.id===e.id&&(i=a)}),null===i&&(i=this.layout.data_layers.push(this.data_layers[e.id].layout)-1),this.data_layers[e.id].layout_idx=i,this.data_layers[e.id]},n.Panel.prototype.removeDataLayer=function(t){if(!this.data_layers[t])throw"Unable to remove data layer, ID not found: "+t;return this.data_layers[t].destroyAllTooltips(),this.data_layers[t].svg.container&&this.data_layers[t].svg.container.remove(),this.layout.data_layers.splice(this.data_layers[t].layout_idx,1),delete this.state[this.data_layers[t].state_id],delete this.data_layers[t],this.data_layer_ids_by_z_index.splice(this.data_layer_ids_by_z_index.indexOf(t),1),this.applyDataLayerZIndexesToDataLayerLayouts(),this.layout.data_layers.forEach(function(t,e){this.data_layers[t.id].layout_idx=e}.bind(this)),this},n.Panel.prototype.clearSelections=function(){return this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].setAllElementStatus("selected",!1)}.bind(this)),this},n.Panel.prototype.reMap=function(){this.emit("data_requested"),this.data_promises=[],this.curtain.hide();for(var t in this.data_layers)try{this.data_promises.push(this.data_layers[t].reMap())}catch(t){console.warn(t),this.curtain.show(t)}return e.all(this.data_promises).then(function(){this.initialized=!0,this.render(),this.emit("layout_changed",!0),this.emit("data_rendered")}.bind(this)).catch(function(t){console.warn(t),this.curtain.show(t)}.bind(this))},n.Panel.prototype.generateExtents=function(){["x","y1","y2"].forEach(function(t){this[t+"_extent"]=null}.bind(this));for(var e in this.data_layers){var a=this.data_layers[e];if(a.layout.x_axis&&!a.layout.x_axis.decoupled&&(this.x_extent=t.extent((this.x_extent||[]).concat(a.getAxisExtent("x")))),a.layout.y_axis&&!a.layout.y_axis.decoupled){var i="y"+a.layout.y_axis.axis;this[i+"_extent"]=t.extent((this[i+"_extent"]||[]).concat(a.getAxisExtent("y")))}}return this.layout.axes.x&&"state"===this.layout.axes.x.extent&&(this.x_extent=[this.state.start,this.state.end]),this},n.Panel.prototype.generateTicks=function(t){if(this.layout.axes[t].ticks){var e=this.layout.axes[t],a=e.ticks;if(Array.isArray(a))return a;if("object"==typeof a){var i=this,s={position:a.position},o=this.data_layer_ids_by_z_index.reduce(function(e,a){var n=i.data_layers[a];return e.concat(n.getTicks(t,s))},[]);return o.map(function(t){var e={};return e=n.Layouts.merge(e,a),n.Layouts.merge(e,t)})}}return this[t+"_extent"]?n.prettyTicks(this[t+"_extent"],"both"):[]},n.Panel.prototype.render=function(){this.svg.container.attr("transform","translate("+this.layout.origin.x+","+this.layout.origin.y+")"),this.svg.clipRect.attr("width",this.layout.width).attr("height",this.layout.height),this.inner_border.attr("x",this.layout.margin.left).attr("y",this.layout.margin.top).attr("width",this.layout.width-(this.layout.margin.left+this.layout.margin.right)).attr("height",this.layout.height-(this.layout.margin.top+this.layout.margin.bottom)),this.layout.inner_border&&this.inner_border.style({"stroke-width":1,stroke:this.layout.inner_border}),this.setTitle(),this.generateExtents();var e=function(t,e){var a=Math.pow(-10,e),i=Math.pow(-10,-e),n=Math.pow(10,-e),s=Math.pow(10,e);return t===1/0&&(t=s),t===-(1/0)&&(t=a),0===t&&(t=n),t>0&&(t=Math.max(Math.min(t,s),n)),t<0&&(t=Math.max(Math.min(t,i),a)),t},a={};if(this.x_extent){var i={start:0,end:this.layout.cliparea.width};this.layout.axes.x.range&&(i.start=this.layout.axes.x.range.start||i.start,i.end=this.layout.axes.x.range.end||i.end),a.x=[i.start,i.end],a.x_shifted=[i.start,i.end]}if(this.y1_extent){var n={start:this.layout.cliparea.height,end:0};this.layout.axes.y1.range&&(n.start=this.layout.axes.y1.range.start||n.start,n.end=this.layout.axes.y1.range.end||n.end),a.y1=[n.start,n.end],a.y1_shifted=[n.start,n.end]}if(this.y2_extent){var s={start:this.layout.cliparea.height,end:0};this.layout.axes.y2.range&&(s.start=this.layout.axes.y2.range.start||s.start,s.end=this.layout.axes.y2.range.end||s.end),a.y2=[s.start,s.end],a.y2_shifted=[s.start,s.end]}if(this.parent.interaction.panel_id&&(this.parent.interaction.panel_id===this.id||this.parent.interaction.linked_panel_ids.indexOf(this.id)!==-1)){var o,r=null;if(this.parent.interaction.zooming&&"function"==typeof this.x_scale){var l=Math.abs(this.x_extent[1]-this.x_extent[0]),h=Math.round(this.x_scale.invert(a.x_shifted[1]))-Math.round(this.x_scale.invert(a.x_shifted[0])),d=this.parent.interaction.zooming.scale,u=Math.floor(h*(1/d));d<1&&!isNaN(this.parent.layout.max_region_scale)?d=1/(Math.min(u,this.parent.layout.max_region_scale)/h):d>1&&!isNaN(this.parent.layout.min_region_scale)&&(d=1/(Math.max(u,this.parent.layout.min_region_scale)/h));var p=Math.floor(l*d);o=this.parent.interaction.zooming.center-this.layout.margin.left-this.layout.origin.x;var c=o/this.layout.cliparea.width,y=Math.max(Math.floor(this.x_scale.invert(a.x_shifted[0])-(p-h)*c),1);a.x_shifted=[this.x_scale(y),this.x_scale(y+p)]}else if(this.parent.interaction.dragging)switch(this.parent.interaction.dragging.method){case"background":a.x_shifted[0]=+this.parent.interaction.dragging.dragged_x,a.x_shifted[1]=this.layout.cliparea.width+this.parent.interaction.dragging.dragged_x;break;case"x_tick":t.event&&t.event.shiftKey?(a.x_shifted[0]=+this.parent.interaction.dragging.dragged_x,a.x_shifted[1]=this.layout.cliparea.width+this.parent.interaction.dragging.dragged_x):(o=this.parent.interaction.dragging.start_x-this.layout.margin.left-this.layout.origin.x,r=e(o/(o+this.parent.interaction.dragging.dragged_x),3),a.x_shifted[0]=0,a.x_shifted[1]=Math.max(this.layout.cliparea.width*(1/r),1));break;case"y1_tick":case"y2_tick":var f="y"+this.parent.interaction.dragging.method[1]+"_shifted";t.event&&t.event.shiftKey?(a[f][0]=this.layout.cliparea.height+this.parent.interaction.dragging.dragged_y,a[f][1]=+this.parent.interaction.dragging.dragged_y):(o=this.layout.cliparea.height-(this.parent.interaction.dragging.start_y-this.layout.margin.top-this.layout.origin.y),r=e(o/(o-this.parent.interaction.dragging.dragged_y),3),a[f][0]=this.layout.cliparea.height,a[f][1]=this.layout.cliparea.height-this.layout.cliparea.height*(1/r))}}if(["x","y1","y2"].forEach(function(e){this[e+"_extent"]&&(this[e+"_scale"]=t.scale.linear().domain(this[e+"_extent"]).range(a[e+"_shifted"]),this[e+"_extent"]=[this[e+"_scale"].invert(a[e][0]),this[e+"_scale"].invert(a[e][1])],this[e+"_scale"]=t.scale.linear().domain(this[e+"_extent"]).range(a[e]),this.renderAxis(e))}.bind(this)),this.layout.interaction.scroll_to_zoom){var g=function(){if(!t.event.shiftKey)return void(this.parent.canInteract(this.id)&&this.loader.show("Press [SHIFT] while scrolling to zoom").hide(1e3));if(t.event.preventDefault(),this.parent.canInteract(this.id)){var e=t.mouse(this.svg.container.node()),a=Math.max(-1,Math.min(1,t.event.wheelDelta||-t.event.detail||-t.event.deltaY));0!==a&&(this.parent.interaction={panel_id:this.id,linked_panel_ids:this.getLinkedPanelIds("x"),zooming:{scale:a<1?.9:1.1,center:e[0]}},this.render(),this.parent.interaction.linked_panel_ids.forEach(function(t){this.parent.panels[t].render()}.bind(this)),null!==this.zoom_timeout&&clearTimeout(this.zoom_timeout),this.zoom_timeout=setTimeout(function(){this.parent.interaction={},this.parent.applyState({start:this.x_extent[0],end:this.x_extent[1]})}.bind(this),500))}}.bind(this);this.zoom_listener=t.behavior.zoom(),this.svg.container.call(this.zoom_listener).on("wheel.zoom",g).on("mousewheel.zoom",g).on("DOMMouseScroll.zoom",g)}return this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].draw().render()}.bind(this)),this},n.Panel.prototype.renderAxis=function(e){if(["x","y1","y2"].indexOf(e)===-1)throw"Unable to render axis; invalid axis identifier: "+e;var a=this.layout.axes[e].render&&"function"==typeof this[e+"_scale"]&&!isNaN(this[e+"_scale"](0));if(this[e+"_axis"]&&this.svg.container.select("g.lz-axis.lz-"+e).style("display",a?null:"none"),!a)return this;var i={x:{position:"translate("+this.layout.margin.left+","+(this.layout.height-this.layout.margin.bottom)+")",orientation:"bottom",label_x:this.layout.cliparea.width/2,label_y:this.layout.axes[e].label_offset||0,label_rotate:null},y1:{position:"translate("+this.layout.margin.left+","+this.layout.margin.top+")",orientation:"left",label_x:-1*(this.layout.axes[e].label_offset||0),label_y:this.layout.cliparea.height/2,label_rotate:-90},y2:{position:"translate("+(this.layout.width-this.layout.margin.right)+","+this.layout.margin.top+")",orientation:"right",label_x:this.layout.axes[e].label_offset||0,label_y:this.layout.cliparea.height/2,label_rotate:-90}};this[e+"_ticks"]=this.generateTicks(e);var s=function(t){for(var e=0;e+a[e]&&(n=!0)}),n};try{var i="3.5.6";if("object"!=typeof t)throw"d3 dependency not met. Library missing.";if(!a(i,t.version))throw"d3 dependency not met. Outdated version detected.\nRequired d3 version: "+i+" or higher (found: "+t.version+").";if("function"!=typeof e)throw"Q dependency not met. Library missing.";!function(t,e){"function"==typeof define&&define.amd?define(["d3","Q"],function(a,i){return t.LocusZoom=e(a,i)}):"object"==typeof module&&module.exports?module.exports=t.LocusZoom=e(require("d3"),require("Q")):t.LocusZoom=e(t.d3,t.Q)}(this,function(t,e){var a=function(t,e){if(e==t)return!0;var a=t.split("."),i=e.split("."),n=!1;return a.forEach(function(t,e){!n&&+i[e]>+a[e]&&(n=!0)}),n};try{var i="3.5.6";if("object"!=typeof t)throw"d3 dependency not met. Library missing.";if(!a(i,t.version))throw"d3 dependency not met. Outdated version detected.\nRequired d3 version: "+i+" or higher (found: "+t.version+").";if("function"!=typeof e)throw"Q dependency not met. Library missing.";var n={version:"0.8.0"};n.populate=function(e,a,i){if("undefined"==typeof e)throw"LocusZoom.populate selector not defined";t.select(e).html("");var s;return t.select(e).call(function(){if("undefined"==typeof this.node().id){for(var e=0;!t.select("#lz-"+e).empty();)e++;this.attr("id","#lz-"+e)}if(s=new n.Plot(this.node().id,a,i),s.container=this.node(),"undefined"!=typeof this.node().dataset&&"undefined"!=typeof this.node().dataset.region){var o=n.parsePositionQuery(this.node().dataset.region);Object.keys(o).forEach(function(t){s.state[t]=o[t]})}s.svg=t.select("div#"+s.id).append("svg").attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").attr("id",s.id+"_svg").attr("class","lz-locuszoom").style(s.layout.style),s.setDimensions(),s.positionPanels(),s.initialize(),"object"==typeof a&&Object.keys(a).length&&s.refresh()}),s},n.populateAll=function(e,a,i){var s=[];return t.selectAll(e).each(function(t,e){s[e]=n.populate(this,a,i)}),s},n.positionIntToString=function(t,e,a){var i={0:"",3:"K",6:"M",9:"G"};if(a=a||!1,isNaN(e)||null===e){var n=Math.log(t)/Math.LN10;e=Math.min(Math.max(n-n%3,0),9)}var s=e-Math.floor((Math.log(t)/Math.LN10).toFixed(e+3)),o=Math.min(Math.max(e,0),2),r=Math.min(Math.max(s,o),12),l=""+(t/Math.pow(10,e)).toFixed(r);return a&&"undefined"!=typeof i[e]&&(l+=" "+i[e]+"b"),l},n.positionStringToInt=function(t){var e=t.toUpperCase();e=e.replace(/,/g,"");var a=/([KMG])[B]*$/,i=a.exec(e),n=1;return i&&(n="M"===i[1]?1e6:"G"===i[1]?1e9:1e3,e=e.replace(a,"")),e=Number(e)*n},n.parsePositionQuery=function(t){var e=/^(\w+):([\d,.]+[kmgbKMGB]*)([-+])([\d,.]+[kmgbKMGB]*)$/,a=/^(\w+):([\d,.]+[kmgbKMGB]*)$/,i=e.exec(t);if(i){if("+"===i[3]){var s=n.positionStringToInt(i[2]),o=n.positionStringToInt(i[4]);return{chr:i[1],start:s-o,end:s+o}}return{chr:i[1],start:n.positionStringToInt(i[2]),end:n.positionStringToInt(i[4])}}return i=a.exec(t),i?{chr:i[1],position:n.positionStringToInt(i[2])}:null},n.prettyTicks=function(t,e,a){("undefined"==typeof a||isNaN(parseInt(a)))&&(a=5),a=parseInt(a);var i=a/3,n=.75,s=1.5,o=.5+1.5*s,r=Math.abs(t[0]-t[1]),l=r/a;Math.log(r)/Math.LN10<-2&&(l=Math.max(Math.abs(r))*n/i);var h=Math.pow(10,Math.floor(Math.log(l)/Math.LN10)),d=0;h<1&&0!==h&&(d=Math.abs(Math.round(Math.log(h)/Math.LN10)));var u=h;2*h-l0&&(c=parseFloat(c.toFixed(d)));return p.push(c),"undefined"!=typeof e&&["low","high","both","neither"].indexOf(e)!==-1||(e="neither"),"low"!==e&&"both"!==e||p[0]t[1]&&p.pop(),p},n.createCORSPromise=function(t,a,i,n,s){var o=e.defer(),r=new XMLHttpRequest;if("withCredentials"in r?r.open(t,a,!0):"undefined"!=typeof XDomainRequest?(r=new XDomainRequest,r.open(t,a)):r=null,r){if(r.onreadystatechange=function(){4===r.readyState&&(200===r.status||0===r.status?o.resolve(r.response):o.reject("HTTP "+r.status+" for "+a))},s&&setTimeout(o.reject,s),i="undefined"!=typeof i?i:"","undefined"!=typeof n)for(var l in n)r.setRequestHeader(l,n[l]);r.send(i)}return o.promise},n.validateState=function(t,e){t=t||{},e=e||{};var a=!1;if("undefined"!=typeof t.chr&&"undefined"!=typeof t.start&&"undefined"!=typeof t.end){var i,n=null;if(t.start=Math.max(parseInt(t.start),1),t.end=Math.max(parseInt(t.end),1),isNaN(t.start)&&isNaN(t.end))t.start=1,t.end=1,n=.5,i=0;else if(isNaN(t.start)||isNaN(t.end))n=t.start||t.end,i=0,t.start=isNaN(t.start)?t.end:t.start,t.end=isNaN(t.end)?t.start:t.end;else{if(n=Math.round((t.start+t.end)/2),i=t.end-t.start,i<0){var s=t.start;t.end=t.start,t.start=s,i=t.end-t.start}n<0&&(t.start=1,t.end=1,i=0)}a=!0}return!isNaN(e.min_region_scale)&&a&&ie.max_region_scale&&(t.start=Math.max(n-Math.floor(e.max_region_scale/2),1),t.end=t.start+e.max_region_scale),t},n.parseFields=function(t,e){if("object"!=typeof t)throw"LocusZoom.parseFields invalid arguments: data is not an object";if("string"!=typeof e)throw"LocusZoom.parseFields invalid arguments: html is not a string";for(var a=[],i=/\{\{(?:(#if )?([A-Za-z0-9_:|]+)|(\/if))\}\}/;e.length>0;){var s=i.exec(e);s?0!==s.index?(a.push({text:e.slice(0,s.index)}),e=e.slice(s.index)):"#if "===s[1]?(a.push({condition:s[2]}),e=e.slice(s[0].length)):s[2]?(a.push({variable:s[2]}),e=e.slice(s[0].length)):"/if"===s[3]?(a.push({close:"if"}),e=e.slice(s[0].length)):(console.error("Error tokenizing tooltip when remaining template is "+JSON.stringify(e)+" and previous tokens are "+JSON.stringify(a)+" and current regex match is "+JSON.stringify([s[1],s[2],s[3]])),e=e.slice(s[0].length)):(a.push({text:e}),e="")}for(var o=function(){var t=a.shift();if("undefined"!=typeof t.text||t.variable)return t;if(t.condition){for(t.then=[];a.length>0;){if("if"===a[0].close){a.shift();break}t.then.push(o())}return t}return console.error("Error making tooltip AST due to unknown token "+JSON.stringify(t)),{text:""}},r=[];a.length>0;)r.push(o());var l=function(e){return l.cache.hasOwnProperty(e)||(l.cache[e]=new n.Data.Field(e).resolve(t)),l.cache[e]};l.cache={};var h=function(t){if("undefined"!=typeof t.text)return t.text;if(t.variable){try{var e=l(t.variable);if(["string","number","boolean"].indexOf(typeof e)!==-1)return e;if(null===e)return""}catch(e){console.error("Error while processing variable "+JSON.stringify(t.variable))}return"{{"+t.variable+"}}"}if(t.condition){try{var a=l(t.condition);if(a||0===a)return t.then.map(h).join("")}catch(e){console.error("Error while processing condition "+JSON.stringify(t.variable))}return""}console.error("Error rendering tooltip due to unknown AST node "+JSON.stringify(t))};return r.map(h).join("")},n.getToolTipData=function(e){if("object"!=typeof e||"undefined"==typeof e.parentNode)throw"Invalid node object";var a=t.select(e);return a.classed("lz-data_layer-tooltip")&&"undefined"!=typeof a.data()[0]?a.data()[0]:n.getToolTipData(e.parentNode)},n.getToolTipDataLayer=function(t){var e=n.getToolTipData(t);return e.getDataLayer?e.getDataLayer():null},n.getToolTipPanel=function(t){var e=n.getToolTipDataLayer(t);return e?e.parent:null},n.getToolTipPlot=function(t){var e=n.getToolTipPanel(t);return e?e.parent:null},n.generateCurtain=function(){var e={showing:!1,selector:null,content_selector:null,hide_delay:null,show:function(e,a){return this.curtain.showing||(this.curtain.selector=t.select(this.parent_plot.svg.node().parentNode).insert("div").attr("class","lz-curtain").attr("id",this.id+".curtain"),this.curtain.content_selector=this.curtain.selector.append("div").attr("class","lz-curtain-content"),this.curtain.selector.append("div").attr("class","lz-curtain-dismiss").html("Dismiss").on("click",function(){this.curtain.hide()}.bind(this)),this.curtain.showing=!0),this.curtain.update(e,a)}.bind(this),update:function(t,e){if(!this.curtain.showing)return this.curtain;clearTimeout(this.curtain.hide_delay),"object"==typeof e&&this.curtain.selector.style(e);var a=this.getPageOrigin();return this.curtain.selector.style({top:a.y+"px",left:a.x+"px",width:this.layout.width+"px",height:this.layout.height+"px"}),this.curtain.content_selector.style({"max-width":this.layout.width-40+"px","max-height":this.layout.height-40+"px"}),"string"==typeof t&&this.curtain.content_selector.html(t),this.curtain}.bind(this),hide:function(t){return this.curtain.showing?"number"==typeof t?(clearTimeout(this.curtain.hide_delay),this.curtain.hide_delay=setTimeout(this.curtain.hide,t),this.curtain):(this.curtain.selector.remove(),this.curtain.selector=null,this.curtain.content_selector=null,this.curtain.showing=!1,this.curtain):this.curtain}.bind(this)};return e},n.generateLoader=function(){var e={showing:!1,selector:null,content_selector:null,progress_selector:null,cancel_selector:null,show:function(e){return this.loader.showing||(this.loader.selector=t.select(this.parent_plot.svg.node().parentNode).insert("div").attr("class","lz-loader").attr("id",this.id+".loader"),this.loader.content_selector=this.loader.selector.append("div").attr("class","lz-loader-content"),this.loader.progress_selector=this.loader.selector.append("div").attr("class","lz-loader-progress-container").append("div").attr("class","lz-loader-progress"),this.loader.showing=!0,"undefined"==typeof e&&(e="Loading...")),this.loader.update(e)}.bind(this),update:function(t,e){if(!this.loader.showing)return this.loader;clearTimeout(this.loader.hide_delay),"string"==typeof t&&this.loader.content_selector.html(t);var a=6,i=this.getPageOrigin(),n=this.loader.selector.node().getBoundingClientRect();return this.loader.selector.style({top:i.y+this.layout.height-n.height-a+"px",left:i.x+a+"px"}),"number"==typeof e&&this.loader.progress_selector.style({width:Math.min(Math.max(e,1),100)+"%"}),this.loader}.bind(this),animate:function(){return this.loader.progress_selector.classed("lz-loader-progress-animated",!0),this.loader}.bind(this),setPercentCompleted:function(t){return this.loader.progress_selector.classed("lz-loader-progress-animated",!1),this.loader.update(null,t)}.bind(this),hide:function(t){return this.loader.showing?"number"==typeof t?(clearTimeout(this.loader.hide_delay),this.loader.hide_delay=setTimeout(this.loader.hide,t),this.loader):(this.loader.selector.remove(),this.loader.selector=null,this.loader.content_selector=null,this.loader.progress_selector=null,this.loader.cancel_selector=null,this.loader.showing=!1,this.loader):this.loader}.bind(this)};return e},n.subclass=function(t,e){if("function"!=typeof t)throw"Parent must be a callable constructor";e=e||{};var a=e.hasOwnProperty("constructor")?e.constructor:function(){t.apply(this,arguments)};return a.prototype=Object.create(t.prototype),Object.keys(e).forEach(function(t){a.prototype[t]=e[t]}),a},n.ext={},n.Layouts=function(){var t={},e={plot:{},panel:{},data_layer:{},dashboard:{},tooltip:{}};return t.get=function(t,a,i){if("string"!=typeof t||"string"!=typeof a)throw"invalid arguments passed to LocusZoom.Layouts.get, requires string (layout type) and string (layout name)";if(e[t][a]){var s=n.Layouts.merge(i||{},e[t][a]);if(s.unnamespaced)return delete s.unnamespaced,JSON.parse(JSON.stringify(s));var o="";"string"==typeof s.namespace?o=s.namespace:"object"==typeof s.namespace&&Object.keys(s.namespace).length&&(o="undefined"!=typeof s.namespace.default?s.namespace.default:s.namespace[Object.keys(s.namespace)[0]].toString()),o+=o.length?":":"";var r=function(t,e){if(e?"string"==typeof e&&(e={default:e}):e={default:""},"string"==typeof t){for(var a,i,s,l,h=/\{\{namespace(\[[A-Za-z_0-9]+\]|)\}\}/g,d=[];null!==(a=h.exec(t));)i=a[0],s=a[1].length?a[1].replace(/(\[|\])/g,""):null,l=o,null!=e&&"object"==typeof e&&"undefined"!=typeof e[s]&&(l=e[s]+(e[s].length?":":"")),d.push({base:i,namespace:l});for(var u in d)t=t.replace(d[u].base,d[u].namespace)}else if("object"==typeof t&&null!=t){if("undefined"!=typeof t.namespace){var p="string"==typeof t.namespace?{default:t.namespace}:t.namespace;e=n.Layouts.merge(e,p)}var c,y;for(var f in t)"namespace"!==f&&(c=r(t[f],e),y=r(f,e),f!==y&&delete t[f],t[y]=c)}return t};return s=r(s,s.namespace),JSON.parse(JSON.stringify(s))}throw"layout type ["+t+"] name ["+a+"] not found"},t.set=function(t,a,i){if("string"!=typeof t||"string"!=typeof a||"object"!=typeof i)throw"unable to set new layout; bad arguments passed to set()";return e[t]||(e[t]={}),i?e[t][a]=JSON.parse(JSON.stringify(i)):(delete e[t][a],null)},t.add=function(e,a,i){return t.set(e,a,i)},t.list=function(t){if(e[t])return Object.keys(e[t]);var a={};return Object.keys(e).forEach(function(t){a[t]=Object.keys(e[t])}),a},t.merge=function(t,e){if("object"!=typeof t||"object"!=typeof e)throw"LocusZoom.Layouts.merge only accepts two layout objects; "+typeof t+", "+typeof e+" given";for(var a in e)if(e.hasOwnProperty(a)){var i=null===t[a]?"undefined":typeof t[a],s=typeof e[a];if("object"===i&&Array.isArray(t[a])&&(i="array"),"object"===s&&Array.isArray(e[a])&&(s="array"),"function"===i||"function"===s)throw"LocusZoom.Layouts.merge encountered an unsupported property type";"undefined"!==i?"object"!==i||"object"!==s||(t[a]=n.Layouts.merge(t[a],e[a])):t[a]=JSON.parse(JSON.stringify(e[a]))}return t},t}(),n.Layouts.add("tooltip","standard_association",{namespace:{assoc:"assoc"},closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:'{{{{namespace[assoc]}}variant}}
      P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
      Ref. Allele: {{{{namespace[assoc]}}ref_allele}}
      Make LD Reference
      '});var s=n.Layouts.get("tooltip","standard_association",{unnamespaced:!0});s.html+='Condition on Variant
      ',n.Layouts.add("tooltip","covariates_model_association",s),n.Layouts.add("tooltip","standard_genes",{closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:'

      {{gene_name}}

      Gene ID: {{gene_id}}
      Transcript ID: {{transcript_id}}
      ConstraintExpected variantsObserved variantsConst. Metric
      Synonymous{{exp_syn}}{{n_syn}}z = {{syn_z}}
      Missense{{exp_mis}}{{n_mis}}z = {{mis_z}}
      LoF{{exp_lof}}{{n_lof}}pLI = {{pLI}}
      More data on ExAC'}),n.Layouts.add("tooltip","standard_intervals",{namespace:{intervals:"intervals"},closable:!1,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:"{{{{namespace[intervals]}}state_name}}
      {{{{namespace[intervals]}}start}}-{{{{namespace[intervals]}}end}}"}),n.Layouts.add("data_layer","significance",{id:"significance",type:"orthogonal_line",orientation:"horizontal",offset:4.522}),n.Layouts.add("data_layer","recomb_rate",{namespace:{recomb:"recomb"},id:"recombrate",type:"line",fields:["{{namespace[recomb]}}position","{{namespace[recomb]}}recomb_rate"],z_index:1,style:{stroke:"#0000FF","stroke-width":"1.5px"},x_axis:{field:"{{namespace[recomb]}}position"},y_axis:{axis:2,field:"{{namespace[recomb]}}recomb_rate",floor:0,ceiling:100}}),n.Layouts.add("data_layer","association_pvalues",{namespace:{assoc:"assoc",ld:"ld"},id:"associationpvalues",type:"scatter",point_shape:{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:"diamond",else:"circle"}},point_size:{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:80,else:40}},color:[{scale_function:"if",field:"{{namespace[ld]}}isrefvar",parameters:{field_value:1,then:"#9632b8"}},{scale_function:"numerical_bin",field:"{{namespace[ld]}}state",parameters:{breaks:[0,.2,.4,.6,.8],values:["#357ebd","#46b8da","#5cb85c","#eea236","#d43f3a"]}},"#B8B8B8"],legend:[{shape:"diamond",color:"#9632b8",size:40,label:"LD Ref Var",class:"lz-data_layer-scatter"},{shape:"circle",color:"#d43f3a",size:40,label:"1.0 > r² ≥ 0.8",class:"lz-data_layer-scatter"},{shape:"circle",color:"#eea236",size:40,label:"0.8 > r² ≥ 0.6",class:"lz-data_layer-scatter"},{shape:"circle",color:"#5cb85c",size:40,label:"0.6 > r² ≥ 0.4",class:"lz-data_layer-scatter"},{shape:"circle",color:"#46b8da",size:40,label:"0.4 > r² ≥ 0.2",class:"lz-data_layer-scatter"},{shape:"circle",color:"#357ebd",size:40,label:"0.2 > r² ≥ 0.0",class:"lz-data_layer-scatter"},{shape:"circle",color:"#B8B8B8",size:40,label:"no r² data",class:"lz-data_layer-scatter"}],fields:["{{namespace[assoc]}}variant","{{namespace[assoc]}}position","{{namespace[assoc]}}log_pvalue","{{namespace[assoc]}}log_pvalue|logtoscinotation","{{namespace[assoc]}}ref_allele","{{namespace[ld]}}state","{{namespace[ld]}}isrefvar"],id_field:"{{namespace[assoc]}}variant",z_index:2,x_axis:{field:"{{namespace[assoc]}}position"},y_axis:{axis:1,field:"{{namespace[assoc]}}log_pvalue",floor:0,upper_buffer:.1,min_extent:[0,10]},behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_association",{unnamespaced:!0})}),n.Layouts.add("data_layer","phewas_pvalues",{namespace:{phewas:"phewas"},id:"phewaspvalues",type:"category_scatter",point_shape:"circle",point_size:70,tooltip_positioning:"vertical",id_field:"{{namespace[phewas]}}id",fields:["{{namespace[phewas]}}id","{{namespace[phewas]}}log_pvalue","{{namespace[phewas]}}trait_group","{{namespace[phewas]}}trait_label"],x_axis:{field:"{{namespace[phewas]}}x",category_field:"{{namespace[phewas]}}trait_group",lower_buffer:.025,upper_buffer:.025},y_axis:{axis:1,field:"{{namespace[phewas]}}log_pvalue",floor:0,upper_buffer:.15},color:{field:"{{namespace[phewas]}}trait_group",scale_function:"categorical_bin",parameters:{categories:[],values:[],null_value:"#B8B8B8"}},fill_opacity:.7,tooltip:{closable:!0,show:{or:["highlighted","selected"]},hide:{and:["unhighlighted","unselected"]},html:["Trait: {{{{namespace[phewas]}}trait_label|htmlescape}}
      ","Trait Category: {{{{namespace[phewas]}}trait_group|htmlescape}}
      ","P-value: {{{{namespace[phewas]}}log_pvalue|logtoscinotation|htmlescape}}
      "].join("")},behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},label:{text:"{{{{namespace[phewas]}}trait_label}}",spacing:6,lines:{style:{"stroke-width":"2px",stroke:"#333333","stroke-dasharray":"2px 2px"}},filters:[{field:"{{namespace[phewas]}}log_pvalue",operator:">=",value:20}],style:{"font-size":"14px","font-weight":"bold",fill:"#333333"}}}),n.Layouts.add("data_layer","genes",{namespace:{gene:"gene",constraint:"constraint"},id:"genes",type:"genes",fields:["{{namespace[gene]}}all","{{namespace[constraint]}}all"],id_field:"gene_id",behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_genes",{unnamespaced:!0})}),n.Layouts.add("data_layer","genome_legend",{namespace:{genome:"genome"},id:"genome_legend",type:"genome_legend",fields:["{{namespace[genome]}}chr","{{namespace[genome]}}base_pairs"],x_axis:{floor:0,ceiling:2881033286}}),n.Layouts.add("data_layer","intervals",{namespace:{intervals:"intervals"},id:"intervals",type:"intervals",fields:["{{namespace[intervals]}}start","{{namespace[intervals]}}end","{{namespace[intervals]}}state_id","{{namespace[intervals]}}state_name"],id_field:"{{namespace[intervals]}}start",start_field:"{{namespace[intervals]}}start",end_field:"{{namespace[intervals]}}end",track_split_field:"{{namespace[intervals]}}state_id",split_tracks:!0,always_hide_legend:!1,color:{field:"{{namespace[intervals]}}state_id",scale_function:"categorical_bin",parameters:{categories:[1,2,3,4,5,6,7,8,9,10,11,12,13],values:["rgb(212,63,58)","rgb(250,120,105)","rgb(252,168,139)","rgb(240,189,66)","rgb(250,224,105)","rgb(240,238,84)","rgb(244,252,23)","rgb(23,232,252)","rgb(32,191,17)","rgb(23,166,77)","rgb(32,191,17)","rgb(162,133,166)","rgb(212,212,212)"],null_value:"#B8B8B8"}},legend:[{shape:"rect",color:"rgb(212,63,58)",width:9,label:"Active Promoter","{{namespace[intervals]}}state_id":1},{shape:"rect",color:"rgb(250,120,105)",width:9,label:"Weak Promoter","{{namespace[intervals]}}state_id":2},{shape:"rect",color:"rgb(252,168,139)",width:9,label:"Poised Promoter","{{namespace[intervals]}}state_id":3},{shape:"rect",color:"rgb(240,189,66)",width:9,label:"Strong enhancer","{{namespace[intervals]}}state_id":4},{shape:"rect",color:"rgb(250,224,105)",width:9,label:"Strong enhancer","{{namespace[intervals]}}state_id":5},{shape:"rect",color:"rgb(240,238,84)",width:9,label:"Weak enhancer","{{namespace[intervals]}}state_id":6},{shape:"rect",color:"rgb(244,252,23)",width:9,label:"Weak enhancer","{{namespace[intervals]}}state_id":7},{shape:"rect",color:"rgb(23,232,252)",width:9,label:"Insulator","{{namespace[intervals]}}state_id":8},{shape:"rect",color:"rgb(32,191,17)",width:9,label:"Transcriptional transition","{{namespace[intervals]}}state_id":9},{shape:"rect",color:"rgb(23,166,77)",width:9,label:"Transcriptional elongation","{{namespace[intervals]}}state_id":10},{shape:"rect",color:"rgb(136,240,129)",width:9,label:"Weak transcribed","{{namespace[intervals]}}state_id":11},{shape:"rect",color:"rgb(162,133,166)",width:9,label:"Polycomb-repressed","{{namespace[intervals]}}state_id":12},{shape:"rect",color:"rgb(212,212,212)",width:9,label:"Heterochromatin / low signal","{{namespace[intervals]}}state_id":13}],behaviors:{onmouseover:[{action:"set",status:"highlighted"}],onmouseout:[{action:"unset",status:"highlighted"}],onclick:[{action:"toggle",status:"selected",exclusive:!0}],onshiftclick:[{action:"toggle",status:"selected"}]},tooltip:n.Layouts.get("tooltip","standard_intervals",{unnamespaced:!0})}),n.Layouts.add("dashboard","standard_panel",{components:[{type:"remove_panel",position:"right",color:"red",group_position:"end"},{type:"move_panel_up",position:"right",group_position:"middle"},{type:"move_panel_down",position:"right",group_position:"start",style:{"margin-left":"0.75em"}}]}),n.Layouts.add("dashboard","standard_plot",{components:[{type:"title",title:"LocusZoom",subtitle:'v'+n.version+"",position:"left"},{type:"download",position:"right"}]});var o=n.Layouts.get("dashboard","standard_plot");o.components.push({type:"covariates_model",button_html:"Model",button_title:"Show and edit covariates currently in model",position:"left"}),n.Layouts.add("dashboard","covariates_model_plot",o);var r=n.Layouts.get("dashboard","standard_plot");r.components.push({type:"shift_region",step:5e5,button_html:">>",position:"right",group_position:"end"}),r.components.push({type:"shift_region",step:5e4,button_html:">",position:"right",group_position:"middle"}),r.components.push({type:"zoom_region",step:.2,position:"right",group_position:"middle"}),r.components.push({type:"zoom_region",step:-.2,position:"right",group_position:"middle"}),r.components.push({type:"shift_region",step:-5e4,button_html:"<",position:"right",group_position:"middle"}),r.components.push({type:"shift_region",step:-5e5,button_html:"<<",position:"right",group_position:"start"}),n.Layouts.add("dashboard","region_nav_plot",r),n.Layouts.add("panel","association",{id:"association",width:800,height:225,min_width:400,min_height:200,proportional_width:1,margin:{top:35,right:50,bottom:40,left:50},inner_border:"rgb(210, 210, 210)",dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"toggle_legend",position:"right"}),t}(),axes:{x:{label:"Chromosome {{chr}} (Mb)",label_offset:32,tick_format:"region",extent:"state"},y1:{label:"-log10 p-value",label_offset:28},y2:{label:"Recombination Rate (cM/Mb)",label_offset:40}},legend:{orientation:"vertical",origin:{x:55,y:40},hidden:!0},interaction:{drag_background_to_pan:!0,drag_x_ticks_to_scale:!0,drag_y1_ticks_to_scale:!0,drag_y2_ticks_to_scale:!0,scroll_to_zoom:!0,x_linked:!0},data_layers:[n.Layouts.get("data_layer","significance",{unnamespaced:!0}),n.Layouts.get("data_layer","recomb_rate",{unnamespaced:!0}),n.Layouts.get("data_layer","association_pvalues",{unnamespaced:!0})]}),n.Layouts.add("panel","genes",{id:"genes",width:800,height:225,min_width:400,min_height:112.5,proportional_width:1,margin:{top:20,right:50,bottom:20,left:50},axes:{},interaction:{drag_background_to_pan:!0,scroll_to_zoom:!0,x_linked:!0},dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"resize_to_data",position:"right"}),t}(),data_layers:[n.Layouts.get("data_layer","genes",{unnamespaced:!0})]}),n.Layouts.add("panel","phewas",{id:"phewas",width:800,height:300,min_width:800,min_height:300,proportional_width:1,margin:{top:20,right:50,bottom:120,left:50},inner_border:"rgb(210, 210, 210)",axes:{x:{ticks:{style:{"font-weight":"bold","font-size":"11px","text-anchor":"start"},transform:"rotate(50)",position:"left"}},y1:{label:"-log10 p-value",label_offset:28}},data_layers:[n.Layouts.get("data_layer","significance",{unnamespaced:!0}),n.Layouts.get("data_layer","phewas_pvalues",{unnamespaced:!0})]}),n.Layouts.add("panel","genome_legend",{id:"genome_legend",width:800,height:50,origin:{x:0,y:300},min_width:800,min_height:50,proportional_width:1,margin:{top:0,right:50,bottom:35,left:50},axes:{x:{label:"Genomic Position (number denotes chromosome)",label_offset:35,ticks:[{x:124625310,text:"1",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:370850307,text:"2",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:591461209,text:"3",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:786049562,text:"4",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:972084330,text:"5",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1148099493,text:"6",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1313226358,text:"7",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1465977701,text:"8",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1609766427,text:"9",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1748140516,text:"10",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:1883411148,text:"11",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2017840353,text:"12",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2142351240,text:"13",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2253610949,text:"14",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2358551415,text:"15",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2454994487,text:"16",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2540769469,text:"17",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2620405698,text:"18",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2689008813,text:"19",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2750086065,text:"20",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2805663772,text:"21",style:{fill:"rgb(120, 120, 186)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"},{x:2855381003,text:"22",style:{fill:"rgb(0, 0, 66)","text-anchor":"center","font-size":"13px","font-weight":"bold"},transform:"translate(0, 2)"}]}},data_layers:[n.Layouts.get("data_layer","genome_legend",{unnamespaced:!0})]}),n.Layouts.add("panel","intervals",{id:"intervals",width:1e3,height:50,min_width:500,min_height:50,margin:{top:25,right:150,bottom:5,left:50},dashboard:function(){var t=n.Layouts.get("dashboard","standard_panel",{unnamespaced:!0});return t.components.push({type:"toggle_split_tracks",data_layer_id:"intervals",position:"right"}),t}(),axes:{},interaction:{drag_background_to_pan:!0,scroll_to_zoom:!0,x_linked:!0},legend:{hidden:!0,orientation:"horizontal",origin:{x:50,y:0},pad_from_bottom:5},data_layers:[n.Layouts.get("data_layer","intervals",{unnamespaced:!0})]}),n.Layouts.add("plot","standard_association",{state:{},width:800,height:450,responsive_resize:!0,min_region_scale:2e4,max_region_scale:1e6,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","association",{unnamespaced:!0,proportional_height:.5}),n.Layouts.get("panel","genes",{unnamespaced:!0,proportional_height:.5})]}),n.StandardLayout=n.Layouts.get("plot","standard_association"),n.Layouts.add("plot","standard_phewas",{width:800,height:600,min_width:800,min_height:600,responsive_resize:!0,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","phewas",{unnamespaced:!0,proportional_height:.45}),n.Layouts.get("panel","genome_legend",{unnamespaced:!0,proportional_height:.1}),n.Layouts.get("panel","genes",{unnamespaced:!0,proportional_height:.45,margin:{bottom:40},axes:{x:{label:"Chromosome {{chr}} (Mb)",label_offset:32,tick_format:"region",extent:"state"}}})],mouse_guide:!1}),n.Layouts.add("plot","interval_association",{state:{},width:800,height:550,responsive_resize:!0,min_region_scale:2e4,max_region_scale:1e6,dashboard:n.Layouts.get("dashboard","standard_plot",{unnamespaced:!0}),panels:[n.Layouts.get("panel","association",{unnamespaced:!0,width:800,proportional_height:225/570}),n.Layouts.get("panel","intervals",{unnamespaced:!0,proportional_height:120/570}),n.Layouts.get("panel","genes",{ +unnamespaced:!0,width:800,proportional_height:225/570})]}),n.DataLayer=function(t,e){return this.initialized=!1,this.layout_idx=null,this.id=null,this.parent=e||null,this.svg={},this.parent_plot=null,"undefined"!=typeof e&&e instanceof n.Panel&&(this.parent_plot=e.parent),this.layout=n.Layouts.merge(t||{},n.DataLayer.DefaultLayout),this.layout.id&&(this.id=this.layout.id),this.layout.x_axis!=={}&&"number"!=typeof this.layout.x_axis.axis&&(this.layout.x_axis.axis=1),this.layout.y_axis!=={}&&"number"!=typeof this.layout.y_axis.axis&&(this.layout.y_axis.axis=1),this._base_layout=JSON.parse(JSON.stringify(this.layout)),this.state={},this.state_id=null,this.setDefaultState(),this.data=[],this.layout.tooltip&&(this.tooltips={}),this.global_statuses={highlighted:!1,selected:!1,faded:!1,hidden:!1},this},n.DataLayer.prototype.addField=function(t,e,a){if(!t||!e)throw"Must specify field name and namespace to use when adding field";var i=e+":"+t;if(a)if(i+="|","string"==typeof a)i+=a;else{if(!Array.isArray(a))throw"Must provide transformations as either a string or array of strings";i+=a.join("|")}var n=this.layout.fields;return n.indexOf(i)===-1&&n.push(i),i},n.DataLayer.prototype.setDefaultState=function(){this.parent&&(this.state=this.parent.state,this.state_id=this.parent.id+"."+this.id,this.state[this.state_id]=this.state[this.state_id]||{},n.DataLayer.Statuses.adjectives.forEach(function(t){this.state[this.state_id][t]=this.state[this.state_id][t]||[]}.bind(this)))},n.DataLayer.DefaultLayout={type:"",fields:[],x_axis:{},y_axis:{}},n.DataLayer.Statuses={verbs:["highlight","select","fade","hide"],adjectives:["highlighted","selected","faded","hidden"],menu_antiverbs:["unhighlight","deselect","unfade","show"]},n.DataLayer.prototype.getBaseId=function(){return this.parent_plot.id+"."+this.parent.id+"."+this.id},n.DataLayer.prototype.getAbsoluteDataHeight=function(){var t=this.svg.group.node().getBoundingClientRect();return t.height},n.DataLayer.prototype.canTransition=function(){return!!this.layout.transition&&!(this.parent_plot.panel_boundaries.dragging||this.parent_plot.interaction.panel_id)},n.DataLayer.prototype.getElementId=function(t){var e="element";if("string"==typeof t)e=t;else if("object"==typeof t){var a=this.layout.id_field||"id";if("undefined"==typeof t[a])throw"Unable to generate element ID";e=t[a].toString().replace(/\W/g,"")}return(this.getBaseId()+"-"+e).replace(/(:|\.|\[|\]|,)/g,"_")},n.DataLayer.prototype.getElementStatusNodeId=function(t){return null},n.DataLayer.prototype.getElementById=function(e){var a=t.select("#"+e.replace(/(:|\.|\[|\]|,)/g,"\\$1"));return!a.empty()&&a.data()&&a.data().length?a.data()[0]:null},n.DataLayer.prototype.applyDataMethods=function(){return this.data.forEach(function(t,e){this.data[e].toHTML=function(){var t=this.layout.id_field||"id",a="";return this.data[e][t]&&(a=this.data[e][t].toString()),a}.bind(this),this.data[e].getDataLayer=function(){return this}.bind(this),this.data[e].deselect=function(){var t=this.getDataLayer();t.unselectElement(this)}}.bind(this)),this.applyCustomDataMethods(),this},n.DataLayer.prototype.applyCustomDataMethods=function(){return this},n.DataLayer.prototype.initialize=function(){return this.svg.container=this.parent.svg.group.append("g").attr("class","lz-data_layer-container").attr("id",this.getBaseId()+".data_layer_container"),this.svg.clipRect=this.svg.container.append("clipPath").attr("id",this.getBaseId()+".clip").append("rect"),this.svg.group=this.svg.container.append("g").attr("id",this.getBaseId()+".data_layer").attr("clip-path","url(#"+this.getBaseId()+".clip)"),this},n.DataLayer.prototype.moveUp=function(){return this.parent.data_layer_ids_by_z_index[this.layout.z_index+1]&&(this.parent.data_layer_ids_by_z_index[this.layout.z_index]=this.parent.data_layer_ids_by_z_index[this.layout.z_index+1],this.parent.data_layer_ids_by_z_index[this.layout.z_index+1]=this.id,this.parent.resortDataLayers()),this},n.DataLayer.prototype.moveDown=function(){return this.parent.data_layer_ids_by_z_index[this.layout.z_index-1]&&(this.parent.data_layer_ids_by_z_index[this.layout.z_index]=this.parent.data_layer_ids_by_z_index[this.layout.z_index-1],this.parent.data_layer_ids_by_z_index[this.layout.z_index-1]=this.id,this.parent.resortDataLayers()),this},n.DataLayer.prototype.resolveScalableParameter=function(t,e){var a=null;if(Array.isArray(t))for(var i=0;null===a&&i":function(t,e){return t>e},">=":function(t,e){return t>=e},"%":function(t,e){return t%e}};return!!Array.isArray(e)&&(2===e.length?t[e[0]]===e[1]:!(3!==e.length||!a[e[1]])&&a[e[1]](t[e[0]],e[2]))},i=[];return this.data.forEach(function(n,s){var o=!0;t.forEach(function(t){a(n,t)||(o=!1)}),o&&i.push("indexes"===e?s:n)}),i},n.DataLayer.prototype.filterIndexes=function(t){return this.filter(t,"indexes")},n.DataLayer.prototype.filterElements=function(t){return this.filter(t,"elements")},n.DataLayer.Statuses.verbs.forEach(function(t,e){var a=n.DataLayer.Statuses.adjectives[e],i="un"+t;n.DataLayer.prototype[t+"Element"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatus(a,t,!0,e),this},n.DataLayer.prototype[i+"Element"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatus(a,t,!1,e),this},n.DataLayer.prototype[t+"ElementsByFilters"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatusByFilters(a,!0,t,e)},n.DataLayer.prototype[i+"ElementsByFilters"]=function(t,e){return e="undefined"!=typeof e&&!!e,this.setElementStatusByFilters(a,!1,t,e)},n.DataLayer.prototype[t+"AllElements"]=function(){return this.setAllElementStatus(a,!0),this},n.DataLayer.prototype[i+"AllElements"]=function(){return this.setAllElementStatus(a,!1),this}}),n.DataLayer.prototype.setElementStatus=function(e,a,i,s){if("undefined"==typeof e||n.DataLayer.Statuses.adjectives.indexOf(e)===-1)throw"Invalid status passed to DataLayer.setElementStatus()";if("undefined"==typeof a)throw"Invalid element passed to DataLayer.setElementStatus()";"undefined"==typeof i&&(i=!0);try{var o=this.getElementId(a)}catch(t){return this}s&&this.setAllElementStatus(e,!i),t.select("#"+o).classed("lz-data_layer-"+this.layout.type+"-"+e,i);var r=this.getElementStatusNodeId(a);null!==r&&t.select("#"+r).classed("lz-data_layer-"+this.layout.type+"-statusnode-"+e,i);var l=this.state[this.state_id][e].indexOf(o);return i&&l===-1&&this.state[this.state_id][e].push(o),i||l===-1||this.state[this.state_id][e].splice(l,1),this.showOrHideTooltip(a),this.parent.emit("layout_changed",!0),"selected"===e&&this.parent.emit("element_selection",{element:a,active:i},!0),this},n.DataLayer.prototype.setElementStatusByFilters=function(t,e,a,i){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setElementStatusByFilters()";return"undefined"==typeof this.state[this.state_id][t]?this:(e="undefined"==typeof e||!!e,i="undefined"!=typeof i&&!!i,Array.isArray(a)||(a=[]),i&&this.setAllElementStatus(t,!e),this.filterElements(a).forEach(function(a){this.setElementStatus(t,a,e)}.bind(this)),this)},n.DataLayer.prototype.setAllElementStatus=function(t,e){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setAllElementStatus()";if("undefined"==typeof this.state[this.state_id][t])return this;if("undefined"==typeof e&&(e=!0),e)this.data.forEach(function(e){this.setElementStatus(t,e,!0)}.bind(this));else{var a=this.state[this.state_id][t].slice();a.forEach(function(e){var a=this.getElementById(e);"object"==typeof a&&null!==a&&this.setElementStatus(t,a,!1)}.bind(this)),this.state[this.state_id][t]=[]}return this.global_statuses[t]=e,this},n.DataLayer.prototype.applyBehaviors=function(t){"object"==typeof this.layout.behaviors&&Object.keys(this.layout.behaviors).forEach(function(e){var a=/(click|mouseover|mouseout)/.exec(e);a&&t.on(a[0]+"."+e,this.executeBehaviors(e,this.layout.behaviors[e]))}.bind(this))},n.DataLayer.prototype.executeBehaviors=function(e,a){var i={ctrl:e.indexOf("ctrl")!==-1,shift:e.indexOf("shift")!==-1};return function(e){i.ctrl===!!t.event.ctrlKey&&i.shift===!!t.event.shiftKey&&a.forEach(function(t){if("object"==typeof t&&null!==t)switch(t.action){case"set":this.setElementStatus(t.status,e,!0,t.exclusive);break;case"unset":this.setElementStatus(t.status,e,!1,t.exclusive);break;case"toggle":var a=this.state[this.state_id][t.status].indexOf(this.getElementId(e))!==-1,i=t.exclusive&&!a;this.setElementStatus(t.status,e,!a,i);break;case"link":if("string"==typeof t.href){var s=n.parseFields(e,t.href);"string"==typeof t.target?window.open(s,t.target):window.location.href=s}}}.bind(this))}.bind(this)},n.DataLayer.prototype.getPageOrigin=function(){var t=this.parent.getPageOrigin();return{x:t.x+this.parent.layout.margin.left,y:t.y+this.parent.layout.margin.top}},n.DataLayer.prototype.exportData=function(t){var e="json";t=t||e,t="string"==typeof t?t.toLowerCase():e,["json","csv","tsv"].indexOf(t)===-1&&(t=e);var a;switch(t){case"json":try{a=JSON.stringify(this.data)}catch(t){a=null,console.error("Unable to export JSON data from data layer: "+this.getBaseId()+";",t)}break;case"tsv":case"csv":try{var i=JSON.parse(JSON.stringify(this.data));if("object"!=typeof i)a=i.toString();else if(Array.isArray(i)){var n="tsv"===t?"\t":",",s=this.layout.fields.map(function(t){return JSON.stringify(t)}).join(n)+"\n";a=s+i.map(function(t){return this.layout.fields.map(function(e){return"undefined"==typeof t[e]?JSON.stringify(null):"object"==typeof t[e]&&null!==t[e]?Array.isArray(t[e])?'"[Array('+t[e].length+')]"':'"[Object]"':JSON.stringify(t[e])}).join(n)}.bind(this)).join("\n")}else a="Object"}catch(t){a=null,console.error("Unable to export CSV data from data layer: "+this.getBaseId()+";",t)}}return a},n.DataLayer.prototype.draw=function(){return this.svg.container.attr("transform","translate("+this.parent.layout.cliparea.origin.x+","+this.parent.layout.cliparea.origin.y+")"),this.svg.clipRect.attr("width",this.parent.layout.cliparea.width).attr("height",this.parent.layout.cliparea.height),this.positionAllTooltips(),this},n.DataLayer.prototype.reMap=function(){this.destroyAllTooltips();var t=this.parent_plot.lzd.getData(this.state,this.layout.fields);return t.then(function(t){this.data=t.body,this.applyDataMethods(),this.initialized=!0}.bind(this)),t},n.DataLayers=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t]){if("object"!=typeof a)throw"invalid layout argument for data layer ["+t+"]";return new e[t](a,i)}throw"data layer ["+t+"] not found"}return null},t.set=function(t,a){if(a){if("function"!=typeof a)throw"unable to set data layer ["+t+"], argument provided is not a function";e[t]=a,e[t].prototype=new n.DataLayer}else delete e[t]},t.add=function(a,i){if(e[a])throw"data layer already exists with name: "+a;t.set(a,i)},t.extend=function(t,a,i){i=i||{};var s=e[t];if(!s)throw"Attempted to subclass an unknown or unregistered datalayer type";if("object"!=typeof i)throw"Must specify an object of properties and methods";var o=n.subclass(s,i);return e[a]=o,o},t.list=function(){return Object.keys(e)},t}(),n.DataLayers.add("annotation_track",function(t){if(this.DefaultLayout={color:"#000000",filters:[]},t=n.Layouts.merge(t,this.DefaultLayout),!Array.isArray(t.filters))throw"Annotation track must specify array of filters for selecting points to annotate";return n.DataLayer.apply(this,arguments),this.render=function(){var t=this,e=this.filter(this.layout.filters,"elements"),a=this.svg.group.selectAll("rect.lz-data_layer-"+t.layout.type).data(e,function(e){return e[t.layout.id_field]});a.enter().append("rect").attr("class","lz-data_layer-"+this.layout.type).attr("id",function(e){return t.getElementId(e)}),a.attr("x",function(e){return t.parent.x_scale(e[t.layout.x_axis.field])}).attr("width",1).attr("height",t.parent.layout.height).attr("fill",function(e){return t.resolveScalableParameter(t.layout.color,e)}),a.exit().remove(),this.applyBehaviors(a)},this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=7,l=1,h=l/2,d=this.getPageOrigin(),u=o.selector.node().getBoundingClientRect(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=this.parent.x_scale(o.data[this.layout.x_axis.field]),f=p/2,g=Math.max(u.width/2-y,0),_=Math.max(u.width/2+y-c,0);a=d.x+y-u.width/2-_+g,s=u.width/2-r+_-g-h,u.height+l+r>p-f?(e=d.y+f-(u.height+l+r),i="down",n=u.height-l):(e=d.y+f+l+r,i="up",n=0-l-r),o.selector.style("left",a+"px").style("top",e+"px"),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",s+"px").style("top",n+"px")},this}),n.DataLayers.add("forest",function(e){return this.DefaultLayout={point_size:40,point_shape:"square",color:"#888888",fill_opacity:1,y_axis:{axis:2},id_field:"id",confidence_intervals:{start_field:"ci_start",end_field:"ci_end"},show_no_significance_line:!0},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n=this.tooltips[t],s=this.resolveScalableParameter(this.layout.point_size,n.data),o=7,r=1,l=6,h=this.getPageOrigin(),d=this.parent.x_scale(n.data[this.layout.x_axis.field]),u="y"+this.layout.y_axis.axis+"_scale",p=this.parent[u](n.data[this.layout.y_axis.field]),c=n.selector.node().getBoundingClientRect(),y=Math.sqrt(s/Math.PI);d<=this.parent.layout.width/2?(e=h.x+d+y+o+r,a="left",i=-1*(o+r)):(e=h.x+d-c.width-y-o-r,a="right",i=c.width-r);var f,g,_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom);p-c.height/2<=0?(f=h.y+p-1.5*o-l,g=l):p+c.height/2>=_?(f=h.y+p+o+l-c.height,g=c.height-2*o-l):(f=h.y+p-c.height/2,g=c.height/2-o),n.selector.style("left",e+"px").style("top",f+"px"),n.arrow||(n.arrow=n.selector.append("div").style("position","absolute")),n.arrow.attr("class","lz-data_layer-tooltip-arrow_"+a).style("left",i+"px").style("top",g+"px")},this.render=function(){var e="x_scale",a="y"+this.layout.y_axis.axis+"_scale";if(this.layout.confidence_intervals&&this.layout.fields.indexOf(this.layout.confidence_intervals.start_field)!==-1&&this.layout.fields.indexOf(this.layout.confidence_intervals.end_field)!==-1){var i=this.svg.group.selectAll("rect.lz-data_layer-forest.lz-data_layer-forest-ci").data(this.data,function(t){return t[this.layout.id_field]}.bind(this));i.enter().append("rect").attr("class","lz-data_layer-forest lz-data_layer-forest-ci").attr("id",function(t){return this.getElementId(t)+"_ci"}.bind(this)).attr("transform","translate(0,"+(isNaN(this.parent.layout.height)?0:this.parent.layout.height)+")");var n=function(t){var i=this.parent[e](t[this.layout.confidence_intervals.start_field]),n=this.parent[a](t[this.layout.y_axis.field]);return isNaN(i)&&(i=-1e3),isNaN(n)&&(n=-1e3),"translate("+i+","+n+")"}.bind(this),s=function(t){return this.parent[e](t[this.layout.confidence_intervals.end_field])-this.parent[e](t[this.layout.confidence_intervals.start_field])}.bind(this),o=1;this.canTransition()?i.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",n).attr("width",s).attr("height",o):i.attr("transform",n).attr("width",s).attr("height",o),i.exit().remove()}var r=this.svg.group.selectAll("path.lz-data_layer-forest.lz-data_layer-forest-point").data(this.data,function(t){return t[this.layout.id_field]}.bind(this)),l=isNaN(this.parent.layout.height)?0:this.parent.layout.height;r.enter().append("path").attr("class","lz-data_layer-forest lz-data_layer-forest-point").attr("id",function(t){return this.getElementId(t)+"_point"}.bind(this)).attr("transform","translate(0,"+l+")");var h=function(t){var i=this.parent[e](t[this.layout.x_axis.field]),n=this.parent[a](t[this.layout.y_axis.field]);return isNaN(i)&&(i=-1e3),isNaN(n)&&(n=-1e3),"translate("+i+","+n+")"}.bind(this),d=function(t){return this.resolveScalableParameter(this.layout.color,t)}.bind(this),u=function(t){return this.resolveScalableParameter(this.layout.fill_opacity,t)}.bind(this),p=t.svg.symbol().size(function(t){return this.resolveScalableParameter(this.layout.point_size,t)}.bind(this)).type(function(t){return this.resolveScalableParameter(this.layout.point_shape,t)}.bind(this));this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p):r.attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p),r.exit().remove(),r.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t,!0)}.bind(this)),this.applyBehaviors(r)},this}),n.DataLayers.add("genes",function(e){return this.DefaultLayout={stroke:"rgb(54, 54, 150)",color:"#363696",label_font_size:12,label_exon_spacing:4,exon_height:16,bounding_box_padding:6,track_vertical_spacing:10},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.getElementStatusNodeId=function(t){return this.getElementId(t)+"-statusnode"},this.getTrackHeight=function(){return 2*this.layout.bounding_box_padding+this.layout.label_font_size+this.layout.label_exon_spacing+this.layout.exon_height+this.layout.track_vertical_spacing},this.transcript_idx=0,this.tracks=1,this.gene_track_index={1:[]},this.assignTracks=function(){return this.getLabelWidth=function(t,e){try{var a=this.svg.group.append("text").attr("x",0).attr("y",0).attr("class","lz-data_layer-genes lz-label").style("font-size",e).text(t+"→"),i=a.node().getBBox().width;return a.remove(),i}catch(t){return 0}},this.tracks=1,this.gene_track_index={1:[]},this.data.map(function(t,e){if(this.data[e].gene_id&&this.data[e].gene_id.indexOf(".")){var a=this.data[e].gene_id.split(".");this.data[e].gene_id=a[0],this.data[e].gene_version=a[1]}if(this.data[e].transcript_id=this.data[e].transcripts[this.transcript_idx].transcript_id,this.data[e].display_range={start:this.parent.x_scale(Math.max(t.start,this.state.start)),end:this.parent.x_scale(Math.min(t.end,this.state.end))},this.data[e].display_range.label_width=this.getLabelWidth(this.data[e].gene_name,this.layout.label_font_size),this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start,this.data[e].display_range.text_anchor="middle",this.data[e].display_range.widththis.state.end)this.data[e].display_range.start=this.data[e].display_range.end-this.data[e].display_range.label_width-this.layout.label_font_size,this.data[e].display_range.text_anchor="end";else{var i=(this.data[e].display_range.label_width-this.data[e].display_range.width)/2+this.layout.label_font_size;this.data[e].display_range.start-ithis.parent.x_scale(this.state.end)?(this.data[e].display_range.end=this.parent.x_scale(this.state.end),this.data[e].display_range.start=this.data[e].display_range.end-this.data[e].display_range.label_width,this.data[e].display_range.text_anchor="end"):(this.data[e].display_range.start-=i,this.data[e].display_range.end+=i)}this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start}this.data[e].display_range.start-=this.layout.bounding_box_padding,this.data[e].display_range.end+=this.layout.bounding_box_padding,this.data[e].display_range.width+=2*this.layout.bounding_box_padding,this.data[e].display_domain={start:this.parent.x_scale.invert(this.data[e].display_range.start),end:this.parent.x_scale.invert(this.data[e].display_range.end)},this.data[e].display_domain.width=this.data[e].display_domain.end-this.data[e].display_domain.start,this.data[e].track=null;for(var n=1;null===this.data[e].track;){var s=!1;this.gene_track_index[n].map(function(t){if(!s){var e=Math.min(t.display_range.start,this.display_range.start),a=Math.max(t.display_range.end,this.display_range.end);a-ethis.tracks&&(this.tracks=n,this.gene_track_index[n]=[])):(this.data[e].track=n,this.gene_track_index[n].push(this.data[e]))}this.data[e].parent=this,this.data[e].transcripts.map(function(t,a){this.data[e].transcripts[a].parent=this.data[e],this.data[e].transcripts[a].exons.map(function(t,i){this.data[e].transcripts[a].exons[i].parent=this.data[e].transcripts[a]}.bind(this))}.bind(this))}.bind(this)),this},this.render=function(){var e=this;this.assignTracks();var a,i,n,s,o=this.svg.group.selectAll("g.lz-data_layer-genes").data(this.data,function(t){return t.gene_name});o.enter().append("g").attr("class","lz-data_layer-genes"),o.attr("id",function(t){return this.getElementId(t)}.bind(this)).each(function(o){var r=o.parent,l=t.select(this).selectAll("rect.lz-data_layer-genes.lz-data_layer-genes-statusnode").data([o],function(t){return r.getElementStatusNodeId(t)});l.enter().append("rect").attr("class","lz-data_layer-genes lz-data_layer-genes-statusnode"),l.attr("id",function(t){return r.getElementStatusNodeId(t)}).attr("rx",function(){return r.layout.bounding_box_padding}).attr("ry",function(){return r.layout.bounding_box_padding}),a=function(t){return t.display_range.width},i=function(){return r.getTrackHeight()-r.layout.track_vertical_spacing},n=function(t){return t.display_range.start},s=function(t){return(t.track-1)*r.getTrackHeight()},r.canTransition()?l.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):l.attr("width",a).attr("height",i).attr("x",n).attr("y",s),l.exit().remove();var h=function(t){return e.resolveScalableParameter(e.layout.color,t)},d=function(t){return e.resolveScalableParameter(e.layout.stroke,t)},u=t.select(this).selectAll("rect.lz-data_layer-genes.lz-boundary").data([o],function(t){return t.gene_name+"_boundary"}).style({fill:h,stroke:d});u.enter().append("rect").attr("class","lz-data_layer-genes lz-boundary"),a=function(t){return r.parent.x_scale(t.end)-r.parent.x_scale(t.start)},i=function(){return 1},n=function(t){return r.parent.x_scale(t.start)},s=function(t){return(t.track-1)*r.getTrackHeight()+r.layout.bounding_box_padding+r.layout.label_font_size+r.layout.label_exon_spacing+Math.max(r.layout.exon_height,3)/2},r.canTransition()?u.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):u.attr("width",a).attr("height",i).attr("x",n).attr("y",s),u.exit().remove();var p=t.select(this).selectAll("text.lz-data_layer-genes.lz-label").data([o],function(t){return t.gene_name+"_label"});p.enter().append("text").attr("class","lz-data_layer-genes lz-label"),p.attr("text-anchor",function(t){return t.display_range.text_anchor}).text(function(t){return"+"===t.strand?t.gene_name+"→":"←"+t.gene_name}).style("font-size",o.parent.layout.label_font_size),n=function(t){return"middle"===t.display_range.text_anchor?t.display_range.start+t.display_range.width/2:"start"===t.display_range.text_anchor?t.display_range.start+r.layout.bounding_box_padding:"end"===t.display_range.text_anchor?t.display_range.end-r.layout.bounding_box_padding:void 0},s=function(t){return(t.track-1)*r.getTrackHeight()+r.layout.bounding_box_padding+r.layout.label_font_size},r.canTransition()?p.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("x",n).attr("y",s):p.attr("x",n).attr("y",s),p.exit().remove();var c=function(t){return e.resolveScalableParameter(e.layout.color,t.parent.parent)},y=function(t){return e.resolveScalableParameter(e.layout.stroke,t.parent.parent)},f=t.select(this).selectAll("rect.lz-data_layer-genes.lz-exon").data(o.transcripts[o.parent.transcript_idx].exons,function(t){return t.exon_id});f.enter().append("rect").attr("class","lz-data_layer-genes lz-exon"),f.style({fill:c,stroke:y}),a=function(t){return r.parent.x_scale(t.end)-r.parent.x_scale(t.start)},i=function(){return r.layout.exon_height},n=function(t){return r.parent.x_scale(t.start)},s=function(){return(o.track-1)*r.getTrackHeight()+r.layout.bounding_box_padding+r.layout.label_font_size+r.layout.label_exon_spacing},r.canTransition()?f.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):f.attr("width",a).attr("height",i).attr("x",n).attr("y",s),f.exit().remove();var g=t.select(this).selectAll("rect.lz-data_layer-genes.lz-clickarea").data([o],function(t){return t.gene_name+"_clickarea"});g.enter().append("rect").attr("class","lz-data_layer-genes lz-clickarea"),g.attr("id",function(t){return r.getElementId(t)+"_clickarea"}).attr("rx",function(){return r.layout.bounding_box_padding}).attr("ry",function(){return r.layout.bounding_box_padding}),a=function(t){return t.display_range.width},i=function(){return r.getTrackHeight()-r.layout.track_vertical_spacing},n=function(t){return t.display_range.start},s=function(t){return(t.track-1)*r.getTrackHeight()},r.canTransition()?g.transition().duration(r.layout.transition.duration||0).ease(r.layout.transition.ease||"cubic-in-out").attr("width",a).attr("height",i).attr("x",n).attr("y",s):g.attr("width",a).attr("height",i).attr("x",n).attr("y",s),g.exit().remove(),g.on("click.event_emitter",function(t){t.parent.parent.emit("element_clicked",t,!0)}),r.applyBehaviors(g)}),o.exit().remove()},this.positionTooltip=function(e){if("string"!=typeof e)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[e])throw"Unable to position tooltip: id does not point to a valid tooltip";var a,i,n,s=this.tooltips[e],o=7,r=1,l=this.getPageOrigin(),h=s.selector.node().getBoundingClientRect(),d=this.getElementStatusNodeId(s.data),u=t.select("#"+d).node().getBBox(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=(s.data.display_range.start+s.data.display_range.end)/2-this.layout.bounding_box_padding/2,f=Math.max(h.width/2-y,0),g=Math.max(h.width/2+y-c,0),_=l.x+y-h.width/2-g+f,m=h.width/2-o/2+g-f;h.height+r+o>p-(u.y+u.height)?(a=l.y+u.y-(h.height+r+o),i="down",n=h.height-r):(a=l.y+u.y+u.height+r+o,i="up",n=0-r-o),s.selector.style("left",_+"px").style("top",a+"px"),s.arrow||(s.arrow=s.selector.append("div").style("position","absolute")),s.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",m+"px").style("top",n+"px")},this}),n.DataLayers.add("genome_legend",function(t){ +return this.DefaultLayout={chromosome_fill_colors:{light:"rgb(155, 155, 188)",dark:"rgb(95, 95, 128)"},chromosome_label_colors:{light:"rgb(120, 120, 186)",dark:"rgb(0, 0, 66)"}},t=n.Layouts.merge(t,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.render=function(){var t=0;this.data.forEach(function(e,a){this.data[a].genome_start=t,this.data[a].genome_end=t+e["genome:base_pairs"],t+=e["genome:base_pairs"]}.bind(this));var e=this.svg.group.selectAll("rect.lz-data_layer-genome_legend").data(this.data,function(t){return t["genome:chr"]});e.enter().append("rect").attr("class","lz-data_layer-genome_legend");var a=this,i=this.parent;e.attr("fill",function(t){return t["genome:chr"]%2?a.layout.chromosome_fill_colors.light:a.layout.chromosome_fill_colors.dark}).attr("x",function(t){return i.x_scale(t.genome_start)}).attr("y",0).attr("width",function(t){return i.x_scale(t["genome:base_pairs"])}).attr("height",i.layout.cliparea.height),e.exit().remove();var n=/([^:]+):(\d+)(?:_.*)?/.exec(this.state.variant);if(!n)throw"Genome legend cannot understand the specified variant position";var s=n[1],o=n[2];t=+this.data[s-1].genome_start+ +o;var r=this.svg.group.selectAll("rect.lz-data_layer-genome_legend-marker").data([{start:t,end:t+1}]);r.enter().append("rect").attr("class","lz-data_layer-genome_legend-marker"),r.transition().duration(500).style({fill:"rgba(255, 250, 50, 0.8)",stroke:"rgba(255, 250, 50, 0.8)","stroke-width":"3px"}).attr("x",function(t){return i.x_scale(t.start)}).attr("y",0).attr("width",function(t){return i.x_scale(t.end-t.start)}).attr("height",i.layout.cliparea.height),r.exit().remove()},this}),n.DataLayers.add("intervals",function(e){return this.DefaultLayout={start_field:"start",end_field:"end",track_split_field:"state_id",track_split_order:"DESC",track_split_legend_to_y_axis:2,split_tracks:!0,track_height:15,track_vertical_spacing:3,bounding_box_padding:2,always_hide_legend:!1,color:"#B8B8B8",fill_opacity:1},e=n.Layouts.merge(e,this.DefaultLayout),n.DataLayer.apply(this,arguments),this.getElementStatusNodeId=function(t){return this.layout.split_tracks?(this.getBaseId()+"-statusnode-"+t[this.layout.track_split_field]).replace(/[:.[\],]/g,"_"):this.getElementId(t)+"-statusnode"}.bind(this),this.getTrackHeight=function(){return this.layout.track_height+this.layout.track_vertical_spacing+2*this.layout.bounding_box_padding},this.tracks=1,this.previous_tracks=1,this.interval_track_index={1:[]},this.assignTracks=function(){if(this.previous_tracks=this.tracks,this.tracks=0,this.interval_track_index={1:[]},this.track_split_field_index={},this.layout.track_split_field&&this.layout.split_tracks){this.data.map(function(t){this.track_split_field_index[t[this.layout.track_split_field]]=null}.bind(this));var t=Object.keys(this.track_split_field_index);"DESC"===this.layout.track_split_order&&t.reverse(),t.forEach(function(t){this.track_split_field_index[t]=this.tracks+1,this.interval_track_index[this.tracks+1]=[],this.tracks++}.bind(this))}return this.data.map(function(t,e){if(this.data[e].parent=this,this.data[e].display_range={start:this.parent.x_scale(Math.max(t[this.layout.start_field],this.state.start)),end:this.parent.x_scale(Math.min(t[this.layout.end_field],this.state.end))},this.data[e].display_range.width=this.data[e].display_range.end-this.data[e].display_range.start,this.data[e].display_domain={start:this.parent.x_scale.invert(this.data[e].display_range.start),end:this.parent.x_scale.invert(this.data[e].display_range.end)},this.data[e].display_domain.width=this.data[e].display_domain.end-this.data[e].display_domain.start,this.layout.track_split_field&&this.layout.split_tracks){var a=this.data[e][this.layout.track_split_field];this.data[e].track=this.track_split_field_index[a],this.interval_track_index[this.data[e].track].push(e)}else{this.tracks=1,this.data[e].track=null;for(var i=1;null===this.data[e].track;){var n=!1;this.interval_track_index[i].map(function(t){if(!n){var e=Math.min(t.display_range.start,this.display_range.start),a=Math.max(t.display_range.end,this.display_range.end);a-ethis.tracks&&(this.tracks=i,this.interval_track_index[i]=[])):(this.data[e].track=i,this.interval_track_index[i].push(this.data[e]))}}}.bind(this)),this},this.render=function(){this.assignTracks(),this.svg.group.selectAll(".lz-data_layer-intervals-statusnode.lz-data_layer-intervals-shared").remove(),Object.keys(this.track_split_field_index).forEach(function(t){var e={};e[this.layout.track_split_field]=t;var a={display:this.layout.split_tracks?null:"none"};this.svg.group.insert("rect",":first-child").attr("id",this.getElementStatusNodeId(e)).attr("class","lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-shared").attr("rx",this.layout.bounding_box_padding).attr("ry",this.layout.bounding_box_padding).attr("width",this.parent.layout.cliparea.width).attr("height",this.getTrackHeight()-this.layout.track_vertical_spacing).attr("x",0).attr("y",(this.track_split_field_index[t]-1)*this.getTrackHeight()).style(a)}.bind(this));var e,a,i,n,s,o,r=this.svg.group.selectAll("g.lz-data_layer-intervals").data(this.data,function(t){return t[this.layout.id_field]}.bind(this));return r.enter().append("g").attr("class","lz-data_layer-intervals"),r.attr("id",function(t){return this.getElementId(t)}.bind(this)).each(function(r){var l=r.parent,h={display:l.layout.split_tracks?"none":null},d=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-data_layer-intervals-statusnode.lz-data_layer-intervals-statusnode-discrete").data([r],function(t){return l.getElementId(t)+"-statusnode"});d.enter().insert("rect",":first-child").attr("class","lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-statusnode-discrete"),d.attr("id",function(t){return l.getElementId(t)+"-statusnode"}).attr("rx",function(){return l.layout.bounding_box_padding}).attr("ry",function(){return l.layout.bounding_box_padding}).style(h),e=function(t){return t.display_range.width+2*l.layout.bounding_box_padding},a=function(){return l.getTrackHeight()-l.layout.track_vertical_spacing},i=function(t){return t.display_range.start-l.layout.bounding_box_padding},n=function(t){return(t.track-1)*l.getTrackHeight()},l.canTransition()?d.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):d.attr("width",e).attr("height",a).attr("x",i).attr("y",n),d.exit().remove();var u=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-interval_rect").data([r],function(t){return t[l.layout.id_field]+"_interval_rect"});u.enter().append("rect").attr("class","lz-data_layer-intervals lz-interval_rect"),a=l.layout.track_height,e=function(t){return t.display_range.width},i=function(t){return t.display_range.start},n=function(t){return(t.track-1)*l.getTrackHeight()+l.layout.bounding_box_padding},s=function(t){return l.resolveScalableParameter(l.layout.color,t)},o=function(t){return l.resolveScalableParameter(l.layout.fill_opacity,t)},l.canTransition()?u.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n).attr("fill",s).attr("fill-opacity",o):u.attr("width",e).attr("height",a).attr("x",i).attr("y",n).attr("fill",s).attr("fill-opacity",o),u.exit().remove();var p=t.select(this).selectAll("rect.lz-data_layer-intervals.lz-clickarea").data([r],function(t){return t.interval_name+"_clickarea"});p.enter().append("rect").attr("class","lz-data_layer-intervals lz-clickarea"),p.attr("id",function(t){return l.getElementId(t)+"_clickarea"}).attr("rx",function(){return l.layout.bounding_box_padding}).attr("ry",function(){return l.layout.bounding_box_padding}),e=function(t){return t.display_range.width},a=function(){return l.getTrackHeight()-l.layout.track_vertical_spacing},i=function(t){return t.display_range.start},n=function(t){return(t.track-1)*l.getTrackHeight()},l.canTransition()?p.transition().duration(l.layout.transition.duration||0).ease(l.layout.transition.ease||"cubic-in-out").attr("width",e).attr("height",a).attr("x",i).attr("y",n):p.attr("width",e).attr("height",a).attr("x",i).attr("y",n),p.exit().remove(),p.on("click",function(t){t.parent.parent.emit("element_clicked",t,!0)}.bind(this)),l.applyBehaviors(p)}),r.exit().remove(),this.previous_tracks!==this.tracks&&this.updateSplitTrackAxis(),this},this.positionTooltip=function(e){if("string"!=typeof e)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[e])throw"Unable to position tooltip: id does not point to a valid tooltip";var a,i,n,s=this.tooltips[e],o=7,r=1,l=this.getPageOrigin(),h=s.selector.node().getBoundingClientRect(),d=t.select("#"+this.getElementStatusNodeId(s.data)).node().getBBox(),u=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),p=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),c=(s.data.display_range.start+s.data.display_range.end)/2-this.layout.bounding_box_padding/2,y=Math.max(h.width/2-c,0),f=Math.max(h.width/2+c-p,0),g=l.x+c-h.width/2-f+y,_=h.width/2-o/2+f-y;h.height+r+o>u-(d.y+d.height)?(a=l.y+d.y-(h.height+r+o),i="down",n=h.height-r):(a=l.y+d.y+d.height+r+o,i="up",n=0-r-o),s.selector.style("left",g+"px").style("top",a+"px"),s.arrow||(s.arrow=s.selector.append("div").style("position","absolute")),s.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",_+"px").style("top",n+"px")},this.updateSplitTrackAxis=function(){var t=!!this.layout.track_split_legend_to_y_axis&&"y"+this.layout.track_split_legend_to_y_axis;if(this.layout.split_tracks){var e=+this.tracks||0,a=+this.layout.track_height||0,i=2*(+this.layout.bounding_box_padding||0)+(+this.layout.track_vertical_spacing||0),n=e*a+(e-1)*i;this.parent.scaleHeightToData(n),t&&this.parent.legend&&(this.parent.legend.hide(),this.parent.layout.axes[t]={render:!0,ticks:[],range:{start:n-this.layout.track_height/2,end:this.layout.track_height/2}},this.layout.legend.forEach(function(a){var i=a[this.layout.track_split_field],n=this.track_split_field_index[i];n&&("DESC"===this.layout.track_split_order&&(n=Math.abs(n-e-1)),this.parent.layout.axes[t].ticks.push({y:n,text:a.label}))}.bind(this)),this.layout.y_axis={axis:this.layout.track_split_legend_to_y_axis,floor:1,ceiling:e},this.parent.render()),this.parent_plot.positionPanels()}else t&&this.parent.legend&&(this.layout.always_hide_legend||this.parent.legend.show(),this.parent.layout.axes[t]={render:!1},this.parent.render());return this},this.toggleSplitTracks=function(){return this.layout.split_tracks=!this.layout.split_tracks,this.parent.legend&&!this.layout.always_hide_legend&&(this.parent.layout.margin.bottom=5+(this.layout.split_tracks?0:this.parent.legend.layout.height+5)),this.render(),this.updateSplitTrackAxis(),this},this}),n.DataLayers.add("line",function(e){return this.DefaultLayout={style:{fill:"none","stroke-width":"2px"},interpolate:"linear",x_axis:{field:"x"},y_axis:{field:"y",axis:1},hitarea_width:5},e=n.Layouts.merge(e,this.DefaultLayout),this.mouse_event=null,this.line=null,this.tooltip_timeout=null,n.DataLayer.apply(this,arguments),this.getMouseDisplayAndData=function(){var e={display:{x:t.mouse(this.mouse_event)[0],y:null},data:{},slope:null},a=this.layout.x_axis.field,i=this.layout.y_axis.field,n="x_scale",s="y"+this.layout.y_axis.axis+"_scale";e.data[a]=this.parent[n].invert(e.display.x);var o=t.bisector(function(t){return+t[a]}).left,r=o(this.data,e.data[a])-1,l=this.data[r],h=this.data[r+1],d=t.interpolateNumber(+l[i],+h[i]),u=+h[a]-+l[a];return e.data[i]=d(e.data[a]%u/u),e.display.y=this.parent[s](e.data[i]),this.layout.tooltip.x_precision&&(e.data[a]=e.data[a].toPrecision(this.layout.tooltip.x_precision)),this.layout.tooltip.y_precision&&(e.data[i]=e.data[i].toPrecision(this.layout.tooltip.y_precision)),e.slope=(this.parent[s](h[i])-this.parent[s](l[i]))/(this.parent[n](h[a])-this.parent[n](l[a])),e},this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=o.selector.node().getBoundingClientRect(),l=7,h=6,d=parseFloat(this.layout.style["stroke-width"])||1,u=this.getPageOrigin(),p=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),c=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right),y=this.getMouseDisplayAndData();if(Math.abs(y.slope)>1)y.display.x<=this.parent.layout.width/2?(a=u.x+y.display.x+d+l+d,s="left",n=-1*(l+d)):(a=u.x+y.display.x-r.width-d-l-d,s="right",n=r.width-d),y.display.y-r.height/2<=0?(e=u.y+y.display.y-1.5*l-h,i=h):y.display.y+r.height/2>=p?(e=u.y+y.display.y+l+h-r.height,i=r.height-2*l-h):(e=u.y+y.display.y-r.height/2,i=r.height/2-l);else{var f=Math.max(r.width/2-y.display.x,0),g=Math.max(r.width/2+y.display.x-c,0);a=u.x+y.display.x-r.width/2-g+f;var _=l/2,m=r.width-2.5*l;n=r.width/2-l+g-f,n=Math.min(Math.max(n,_),m),r.height+d+l>y.display.y?(e=u.y+y.display.y+d+l,s="up",i=0-d-l):(e=u.y+y.display.y-(r.height+d+l),s="down",i=r.height-d)}o.selector.style({left:a+"px",top:e+"px"}),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+s).style({left:n+"px",top:i+"px"})},this.render=function(){var e=this,a=this.parent,i=this.layout.x_axis.field,n=this.layout.y_axis.field,s="x_scale",o="y"+this.layout.y_axis.axis+"_scale",r=this.svg.group.selectAll("path.lz-data_layer-line").data([this.data]);if(this.path=r.enter().append("path").attr("class","lz-data_layer-line"),this.line=t.svg.line().x(function(t){return parseFloat(a[s](t[i]))}).y(function(t){return parseFloat(a[o](t[n]))}).interpolate(this.layout.interpolate),this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("d",this.line).style(this.layout.style):r.attr("d",this.line).style(this.layout.style),this.layout.tooltip){var l=parseFloat(this.layout.hitarea_width).toString()+"px",h=this.svg.group.selectAll("path.lz-data_layer-line-hitarea").data([this.data]);h.enter().append("path").attr("class","lz-data_layer-line-hitarea").style("stroke-width",l);var d=t.svg.line().x(function(t){return parseFloat(a[s](t[i]))}).y(function(t){return parseFloat(a[o](t[n]))}).interpolate(this.layout.interpolate);h.attr("d",d).on("mouseover",function(){clearTimeout(e.tooltip_timeout),e.mouse_event=this;var t=e.getMouseDisplayAndData();e.createTooltip(t.data)}).on("mousemove",function(){clearTimeout(e.tooltip_timeout),e.mouse_event=this;var t=e.getMouseDisplayAndData();e.updateTooltip(t.data),e.positionTooltip(e.getElementId())}).on("mouseout",function(){e.tooltip_timeout=setTimeout(function(){e.mouse_event=null,e.destroyTooltip(e.getElementId())},300)}),h.exit().remove()}r.exit().remove()},this.setElementStatus=function(t,e,a){return this.setAllElementStatus(t,a)},this.setElementStatusByFilters=function(t,e){return this.setAllElementStatus(t,e)},this.setAllElementStatus=function(t,e){if("undefined"==typeof t||n.DataLayer.Statuses.adjectives.indexOf(t)===-1)throw"Invalid status passed to DataLayer.setAllElementStatus()";if("undefined"==typeof this.state[this.state_id][t])return this;"undefined"==typeof e&&(e=!0),this.global_statuses[t]=e;var a="lz-data_layer-line";return Object.keys(this.global_statuses).forEach(function(t){this.global_statuses[t]&&(a+=" lz-data_layer-line-"+t)}.bind(this)),this.path.attr("class",a),this.parent.emit("layout_changed",!0),this},this}),n.DataLayers.add("orthogonal_line",function(e){return this.DefaultLayout={style:{stroke:"#D3D3D3","stroke-width":"3px","stroke-dasharray":"10px 10px"},orientation:"horizontal",x_axis:{axis:1,decoupled:!0},y_axis:{axis:1,decoupled:!0},offset:0},e=n.Layouts.merge(e,this.DefaultLayout),["horizontal","vertical"].indexOf(e.orientation)===-1&&(e.orientation="horizontal"),this.data=[],this.line=null,n.DataLayer.apply(this,arguments),this.render=function(){var e=this.parent,a="x_scale",i="y"+this.layout.y_axis.axis+"_scale",n="x_extent",s="y"+this.layout.y_axis.axis+"_extent",o="x_range",r="y"+this.layout.y_axis.axis+"_range";"horizontal"===this.layout.orientation?this.data=[{x:e[n][0],y:this.layout.offset},{x:e[n][1],y:this.layout.offset}]:this.data=[{x:this.layout.offset,y:e[s][0]},{x:this.layout.offset,y:e[s][1]}];var l=this.svg.group.selectAll("path.lz-data_layer-line").data([this.data]);this.path=l.enter().append("path").attr("class","lz-data_layer-line"),this.line=t.svg.line().x(function(t,i){var n=parseFloat(e[a](t.x));return isNaN(n)?e[o][i]:n}).y(function(t,a){var n=parseFloat(e[i](t.y));return isNaN(n)?e[r][a]:n}).interpolate("linear"),this.canTransition()?l.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("d",this.line).style(this.layout.style):l.attr("d",this.line).style(this.layout.style),l.exit().remove()},this}),n.DataLayers.add("scatter",function(e){return this.DefaultLayout={point_size:40,point_shape:"circle",tooltip_positioning:"horizontal",color:"#888888",fill_opacity:1,y_axis:{axis:1},id_field:"id"},e=n.Layouts.merge(e,this.DefaultLayout),e.label&&isNaN(e.label.spacing)&&(e.label.spacing=4),n.DataLayer.apply(this,arguments),this.positionTooltip=function(t){if("string"!=typeof t)throw"Unable to position tooltip: id is not a string";if(!this.tooltips[t])throw"Unable to position tooltip: id does not point to a valid tooltip";var e,a,i,n,s,o=this.tooltips[t],r=this.resolveScalableParameter(this.layout.point_size,o.data),l=Math.sqrt(r/Math.PI),h=7,d=1,u=6,p=this.getPageOrigin(),c=this.parent.x_scale(o.data[this.layout.x_axis.field]),y="y"+this.layout.y_axis.axis+"_scale",f=this.parent[y](o.data[this.layout.y_axis.field]),g=o.selector.node().getBoundingClientRect(),_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),m=this.parent.layout.width-(this.parent.layout.margin.left+this.parent.layout.margin.right);if("vertical"===this.layout.tooltip_positioning){var b=Math.max(g.width/2-c,0),v=Math.max(g.width/2+c-m,0);a=p.x+c-g.width/2-v+b,s=g.width/2-h/2+v-b-l,g.height+d+h>_-(f+l)?(e=p.y+f-(l+g.height+d+h),i="down",n=g.height-d):(e=p.y+f+l+d+h,i="up",n=0-d-h)}else c<=this.parent.layout.width/2?(a=p.x+c+l+h+d,i="left",s=-1*(h+d)):(a=p.x+c-g.width-l-h-d,i="right",s=g.width-d),_=this.parent.layout.height-(this.parent.layout.margin.top+this.parent.layout.margin.bottom),f-g.height/2<=0?(e=p.y+f-1.5*h-u,n=u):f+g.height/2>=_?(e=p.y+f+h+u-g.height,n=g.height-2*h-u):(e=p.y+f-g.height/2,n=g.height/2-h);o.selector.style("left",a+"px").style("top",e+"px"),o.arrow||(o.arrow=o.selector.append("div").style("position","absolute")),o.arrow.attr("class","lz-data_layer-tooltip-arrow_"+i).style("left",s+"px").style("top",n+"px")},this.flip_labels=function(){var e=this,a=e.resolveScalableParameter(e.layout.point_size,{}),i=e.layout.label.spacing,n=Boolean(e.layout.label.lines),s=2*i,o=e.parent.layout.width-e.parent.layout.margin.left-e.parent.layout.margin.right-2*i,r=function(t,e){var s=+t.attr("x"),o=2*i+2*Math.sqrt(a);if(n)var r=+e.attr("x2"),l=i+2*Math.sqrt(a);"start"===t.style("text-anchor")?(t.style("text-anchor","end"),t.attr("x",s-o),n&&e.attr("x2",r-l)):(t.style("text-anchor","start"),t.attr("x",s+o),n&&e.attr("x2",r+l))};e.label_texts.each(function(a,s){var l=this,h=t.select(l),d=+h.attr("x"),u=h.node().getBoundingClientRect();if(d+u.width+i>o){var p=n?t.select(e.label_lines[0][s]):null;r(h,p)}}),e.label_texts.each(function(a,o){var l=this,h=t.select(l);if("end"!==h.style("text-anchor")){var d=+h.attr("x"),u=h.node().getBoundingClientRect(),p=n?t.select(e.label_lines[0][o]):null;e.label_texts.each(function(){var e=this,a=t.select(e),n=a.node().getBoundingClientRect(),o=u.leftn.left&&u.topn.top;o&&(r(h,p),d=+h.attr("x"),d-u.width-iu.left&&d.topu.top;if(p){n=!0;var c,y=h.attr("y"),f=d.topv?(c=_-+r,_=+r,m-=c):m+u.height/2>v&&(c=m-+y,m=+y,_-=c),o.attr("y",_),h.attr("y",m)}}}})}),n){if(e.layout.label.lines){var s=e.label_texts[0];e.label_lines.attr("y2",function(e,a){var i=t.select(s[a]);return i.attr("y")})}this.seperate_iterations<150&&setTimeout(function(){this.separate_labels()}.bind(this),1)}},this.render=function(){var e=this,a="x_scale",i="y"+this.layout.y_axis.axis+"_scale";if(this.layout.label){var s=this.data.filter(function(t){if(e.layout.label.filters){var a=!0;return e.layout.label.filters.forEach(function(e){var i=new n.Data.Field(e.field).resolve(t);if(isNaN(i))a=!1;else switch(e.operator){case"<":i":i>e.value||(a=!1);break;case">=":i>=e.value||(a=!1);break;case"=":i!==e.value&&(a=!1);break;default:a=!1}}),a}return!0}),o=this;this.label_groups=this.svg.group.selectAll("g.lz-data_layer-"+this.layout.type+"-label").data(s,function(t){return t[o.layout.id_field]+"_label"}),this.label_groups.enter().append("g").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_texts&&this.label_texts.remove(),this.label_texts=this.label_groups.append("text").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_texts.text(function(t){return n.parseFields(t,e.layout.label.text||"")}).style(e.layout.label.style||{}).attr({x:function(t){var i=e.parent[a](t[e.layout.x_axis.field])+Math.sqrt(e.resolveScalableParameter(e.layout.point_size,t))+e.layout.label.spacing;return isNaN(i)&&(i=-1e3),i},y:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a},"text-anchor":function(){return"start"}}),e.layout.label.lines&&(this.label_lines&&this.label_lines.remove(),this.label_lines=this.label_groups.append("line").attr("class","lz-data_layer-"+this.layout.type+"-label"),this.label_lines.style(e.layout.label.lines.style||{}).attr({x1:function(t){var i=e.parent[a](t[e.layout.x_axis.field]);return isNaN(i)&&(i=-1e3),i},y1:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a},x2:function(t){var i=e.parent[a](t[e.layout.x_axis.field])+Math.sqrt(e.resolveScalableParameter(e.layout.point_size,t))+e.layout.label.spacing/2;return isNaN(i)&&(i=-1e3),i},y2:function(t){var a=e.parent[i](t[e.layout.y_axis.field]);return isNaN(a)&&(a=-1e3),a}})),this.label_groups.exit().remove()}var r=this.svg.group.selectAll("path.lz-data_layer-"+this.layout.type).data(this.data,function(t){return t[this.layout.id_field]}.bind(this)),l=isNaN(this.parent.layout.height)?0:this.parent.layout.height;r.enter().append("path").attr("class","lz-data_layer-"+this.layout.type).attr("id",function(t){return this.getElementId(t)}.bind(this)).attr("transform","translate(0,"+l+")");var h=function(t){var e=this.parent[a](t[this.layout.x_axis.field]),n=this.parent[i](t[this.layout.y_axis.field]);return isNaN(e)&&(e=-1e3),isNaN(n)&&(n=-1e3),"translate("+e+","+n+")"}.bind(this),d=function(t){return this.resolveScalableParameter(this.layout.color,t)}.bind(this),u=function(t){return this.resolveScalableParameter(this.layout.fill_opacity,t)}.bind(this),p=t.svg.symbol().size(function(t){return this.resolveScalableParameter(this.layout.point_size,t)}.bind(this)).type(function(t){return this.resolveScalableParameter(this.layout.point_shape,t)}.bind(this));this.canTransition()?r.transition().duration(this.layout.transition.duration||0).ease(this.layout.transition.ease||"cubic-in-out").attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p):r.attr("transform",h).attr("fill",d).attr("fill-opacity",u).attr("d",p),r.exit().remove(),r.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t,!0)}.bind(this)),this.applyBehaviors(r),this.layout.label&&(this.flip_labels(),this.seperate_iterations=0,this.separate_labels(),this.label_texts.on("click.event_emitter",function(t){this.parent.emit("element_clicked",t,!0)}.bind(this)),this.applyBehaviors(this.label_texts))},this.makeLDReference=function(t){var e=null;if("undefined"==typeof t)throw"makeLDReference requires one argument of any type";e="object"==typeof t?this.layout.id_field&&"undefined"!=typeof t[this.layout.id_field]?t[this.layout.id_field].toString():"undefined"!=typeof t.id?t.id.toString():t.toString():t.toString(),this.parent_plot.applyState({ldrefvar:e})},this}),n.DataLayers.extend("scatter","category_scatter",{_prepareData:function(){var t=this.layout.x_axis.field||"x",e=this.layout.x_axis.category_field;if(!e)throw"Layout for "+this.layout.id+" must specify category_field";var a=this.data.sort(function(t,a){var i=t[e],n=a[e],s=i.toString?i.toString().toLowerCase():i,o=n.toString?n.toString().toLowerCase():n;return s===o?0:s1?function(t){for(var e=t,n=0;n1?Math.ceil(Math.log(a)/Math.LN10):Math.floor(Math.log(a)/Math.LN10),Math.abs(e)<=3?t.toFixed(3):t.toExponential(2).replace("+","").replace("e"," × 10^")}),n.TransformationFunctions.add("urlencode",function(t){return encodeURIComponent(t)}),n.TransformationFunctions.add("htmlescape",function(t){return t?(t+="",t.replace(/['"<>&`]/g,function(t){switch(t){case"'":return"'";case'"':return""";case"<":return"<";case">":return">";case"&":return"&";case"`":return"`"}})):""}),n.ScaleFunctions=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t])return"undefined"==typeof a&&"undefined"==typeof i?e[t]:e[t](a,i);throw"scale function ["+t+"] not found"}return null},t.set=function(t,a){a?e[t]=a:delete e[t]},t.add=function(a,i){if(e[a])throw"scale function already exists with name: "+a;t.set(a,i)},t.list=function(){return Object.keys(e)},t}(),n.ScaleFunctions.add("if",function(t,e){return"undefined"==typeof e||t.field_value!==e?"undefined"!=typeof t.else?t.else:null:t.then}),n.ScaleFunctions.add("numerical_bin",function(t,e){var a=t.breaks||[],i=t.values||[];if("undefined"==typeof e||null===e||isNaN(+e))return t.null_value?t.null_value:null;var n=a.reduce(function(t,a){return+e=t&&+e=e.breaks[e.breaks.length-1])return n[i.length-1];var o=null;if(i.forEach(function(t,e){e&&i[e-1]<=+a&&i[e]>=+a&&(o=e)}),null===o)return s;var r=(+a-i[o-1])/(i[o]-i[o-1]);return isFinite(r)?t.interpolate(n[o-1],n[o])(r):s}),n.Dashboard=function(t){if(!(t instanceof n.Plot||t instanceof n.Panel))throw"Unable to create dashboard, parent must be a locuszoom plot or panel";return this.parent=t,this.id=this.parent.getBaseId()+".dashboard",this.type=this.parent instanceof n.Plot?"plot":"panel",this.parent_plot="plot"===this.type?this.parent:this.parent.parent,this.selector=null,this.components=[],this.hide_timeout=null,this.persist=!1,this.initialize()},n.Dashboard.prototype.initialize=function(){return Array.isArray(this.parent.layout.dashboard.components)&&this.parent.layout.dashboard.components.forEach(function(t){ +try{var e=n.Dashboard.Components.get(t.type,t,this);this.components.push(e)}catch(t){console.warn(t)}}.bind(this)),"panel"===this.type&&(t.select(this.parent.parent.svg.node().parentNode).on("mouseover."+this.id,function(){clearTimeout(this.hide_timeout),this.selector&&"hidden"!==this.selector.style("visibility")||this.show()}.bind(this)),t.select(this.parent.parent.svg.node().parentNode).on("mouseout."+this.id,function(){clearTimeout(this.hide_timeout),this.hide_timeout=setTimeout(function(){this.hide()}.bind(this),300)}.bind(this))),this},n.Dashboard.prototype.shouldPersist=function(){if(this.persist)return!0;var t=!1;return this.components.forEach(function(e){t=t||e.shouldPersist()}),t=t||this.parent_plot.panel_boundaries.dragging||this.parent_plot.interaction.dragging,!!t},n.Dashboard.prototype.show=function(){if(!this.selector){switch(this.type){case"plot":this.selector=t.select(this.parent.svg.node().parentNode).insert("div",":first-child");break;case"panel":this.selector=t.select(this.parent.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip, .lz-dashboard-menu, .lz-curtain").classed("lz-panel-dashboard",!0)}this.selector.classed("lz-dashboard",!0).classed("lz-"+this.type+"-dashboard",!0).attr("id",this.id)}return this.components.forEach(function(t){t.show()}),this.selector.style({visibility:"visible"}),this.update()},n.Dashboard.prototype.update=function(){return this.selector?(this.components.forEach(function(t){t.update()}),this.position()):this},n.Dashboard.prototype.position=function(){if(!this.selector)return this;if("panel"===this.type){var t=this.parent.getPageOrigin(),e=(t.y+3.5).toString()+"px",a=t.x.toString()+"px",i=(this.parent.layout.width-4).toString()+"px";this.selector.style({position:"absolute",top:e,left:a,width:i})}return this.components.forEach(function(t){t.position()}),this},n.Dashboard.prototype.hide=function(){return!this.selector||this.shouldPersist()?this:(this.components.forEach(function(t){t.hide()}),this.selector.style({visibility:"hidden"}),this)},n.Dashboard.prototype.destroy=function(t){return"undefined"==typeof t&&(t=!1),this.selector?this.shouldPersist()&&!t?this:(this.components.forEach(function(t){t.destroy(!0)}),this.components=[],this.selector.remove(),this.selector=null,this):this},n.Dashboard.Component=function(t,e){return this.layout=t||{},this.layout.color||(this.layout.color="gray"),this.parent=e||null,this.parent_panel=null,this.parent_plot=null,this.parent_svg=null,this.parent instanceof n.Dashboard&&("panel"===this.parent.type?(this.parent_panel=this.parent.parent,this.parent_plot=this.parent.parent.parent,this.parent_svg=this.parent_panel):(this.parent_plot=this.parent.parent,this.parent_svg=this.parent_plot)),this.selector=null,this.button=null,this.persist=!1,this.layout.position||(this.layout.position="left"),this},n.Dashboard.Component.prototype.show=function(){if(this.parent&&this.parent.selector){if(!this.selector){var t=["start","middle","end"].indexOf(this.layout.group_position)!==-1?" lz-dashboard-group-"+this.layout.group_position:"";this.selector=this.parent.selector.append("div").attr("class","lz-dashboard-"+this.layout.position+t),this.layout.style&&this.selector.style(this.layout.style),"function"==typeof this.initialize&&this.initialize()}return this.button&&"highlighted"===this.button.status&&this.button.menu.show(),this.selector.style({visibility:"visible"}),this.update(),this.position()}},n.Dashboard.Component.prototype.update=function(){},n.Dashboard.Component.prototype.position=function(){return this.button&&this.button.menu.position(),this},n.Dashboard.Component.prototype.shouldPersist=function(){return!!this.persist||!(!this.button||!this.button.persist)},n.Dashboard.Component.prototype.hide=function(){return!this.selector||this.shouldPersist()?this:(this.button&&this.button.menu.hide(),this.selector.style({visibility:"hidden"}),this)},n.Dashboard.Component.prototype.destroy=function(t){return"undefined"==typeof t&&(t=!1),this.selector?this.shouldPersist()&&!t?this:(this.button&&this.button.menu&&this.button.menu.destroy(),this.selector.remove(),this.selector=null,this.button=null,this):this},n.Dashboard.Components=function(){var t={},e={};return t.get=function(t,a,i){if(t){if(e[t]){if("object"!=typeof a)throw"invalid layout argument for dashboard component ["+t+"]";return new e[t](a,i)}throw"dashboard component ["+t+"] not found"}return null},t.set=function(t,a){if(a){if("function"!=typeof a)throw"unable to set dashboard component ["+t+"], argument provided is not a function";e[t]=a,e[t].prototype=new n.Dashboard.Component}else delete e[t]},t.add=function(a,i){if(e[a])throw"dashboard component already exists with name: "+a;t.set(a,i)},t.list=function(){return Object.keys(e)},t}(),n.Dashboard.Component.Button=function(e){if(!(e instanceof n.Dashboard.Component))throw"Unable to create dashboard component button, invalid parent";this.parent=e,this.parent_panel=this.parent.parent_panel,this.parent_plot=this.parent.parent_plot,this.parent_svg=this.parent.parent_svg,this.parent_dashboard=this.parent.parent,this.selector=null,this.tag="a",this.setTag=function(t){return"undefined"!=typeof t&&(this.tag=t.toString()),this},this.html="",this.setHtml=function(t){return"undefined"!=typeof t&&(this.html=t.toString()),this},this.setText=this.setHTML,this.title="",this.setTitle=function(t){return"undefined"!=typeof t&&(this.title=t.toString()),this},this.color="gray",this.setColor=function(t){return"undefined"!=typeof t&&(["gray","red","orange","yellow","green","blue","purple"].indexOf(t)!==-1?this.color=t:this.color="gray"),this},this.style={},this.setStyle=function(t){return"undefined"!=typeof t&&(this.style=t),this},this.getClass=function(){var t=["start","middle","end"].indexOf(this.parent.layout.group_position)!==-1?" lz-dashboard-button-group-"+this.parent.layout.group_position:"";return"lz-dashboard-button lz-dashboard-button-"+this.color+(this.status?"-"+this.status:"")+t},this.persist=!1,this.permanent=!1,this.setPermanent=function(t){return t="undefined"==typeof t||Boolean(t),this.permanent=t,this.permanent&&(this.persist=!0),this},this.shouldPersist=function(){return this.permanent||this.persist},this.status="",this.setStatus=function(t){return"undefined"!=typeof t&&["","highlighted","disabled"].indexOf(t)!==-1&&(this.status=t),this.update()},this.highlight=function(t){return t="undefined"==typeof t||Boolean(t),t?this.setStatus("highlighted"):"highlighted"===this.status?this.setStatus(""):this},this.disable=function(t){return t="undefined"==typeof t||Boolean(t),t?this.setStatus("disabled"):"disabled"===this.status?this.setStatus(""):this},this.onmouseover=function(){},this.setOnMouseover=function(t){return"function"==typeof t?this.onmouseover=t:this.onmouseover=function(){},this},this.onmouseout=function(){},this.setOnMouseout=function(t){return"function"==typeof t?this.onmouseout=t:this.onmouseout=function(){},this},this.onclick=function(){},this.setOnclick=function(t){return"function"==typeof t?this.onclick=t:this.onclick=function(){},this},this.show=function(){if(this.parent)return this.selector||(this.selector=this.parent.selector.append(this.tag).attr("class",this.getClass())),this.update()},this.preUpdate=function(){return this},this.update=function(){return this.selector?(this.preUpdate(),this.selector.attr("class",this.getClass()).attr("title",this.title).style(this.style).on("mouseover","disabled"===this.status?null:this.onmouseover).on("mouseout","disabled"===this.status?null:this.onmouseout).on("click","disabled"===this.status?null:this.onclick).html(this.html),this.menu.update(),this.postUpdate(),this):this},this.postUpdate=function(){return this},this.hide=function(){return this.selector&&!this.shouldPersist()&&(this.selector.remove(),this.selector=null),this},this.menu={outer_selector:null,inner_selector:null,scroll_position:0,hidden:!0,show:function(){return this.menu.outer_selector||(this.menu.outer_selector=t.select(this.parent_plot.svg.node().parentNode).append("div").attr("class","lz-dashboard-menu lz-dashboard-menu-"+this.color).attr("id",this.parent_svg.getBaseId()+".dashboard.menu"),this.menu.inner_selector=this.menu.outer_selector.append("div").attr("class","lz-dashboard-menu-content"),this.menu.inner_selector.on("scroll",function(){this.menu.scroll_position=this.menu.inner_selector.node().scrollTop}.bind(this))),this.menu.outer_selector.style({visibility:"visible"}),this.menu.hidden=!1,this.menu.update()}.bind(this),update:function(){return this.menu.outer_selector?(this.menu.populate(),this.menu.inner_selector&&(this.menu.inner_selector.node().scrollTop=this.menu.scroll_position),this.menu.position()):this.menu}.bind(this),position:function(){if(!this.menu.outer_selector)return this.menu;this.menu.outer_selector.style({height:null});var t=3,e=20,a=14,i=this.parent_svg.getPageOrigin(),n=document.documentElement.scrollTop||document.body.scrollTop,s=this.parent_plot.getContainerOffset(),o=this.parent_dashboard.selector.node().getBoundingClientRect(),r=this.selector.node().getBoundingClientRect(),l=this.menu.outer_selector.node().getBoundingClientRect(),h=this.menu.inner_selector.node().scrollHeight,d=0,u=0;"panel"===this.parent_dashboard.type?(d=i.y+o.height+2*t,u=Math.max(i.x+this.parent_svg.layout.width-l.width-t,i.x+t)):(d=r.bottom+n+t-s.top,u=Math.max(r.left+r.width-l.width-s.left,i.x+t));var p=Math.max(this.parent_svg.layout.width-2*t-e,e),c=p,y=p-4*t,f=Math.max(this.parent_svg.layout.height-10*t-a,a),g=Math.min(h,f),_=f;return this.menu.outer_selector.style({top:d.toString()+"px",left:u.toString()+"px","max-width":c.toString()+"px","max-height":_.toString()+"px",height:g.toString()+"px"}),this.menu.inner_selector.style({"max-width":y.toString()+"px"}),this.menu.inner_selector.node().scrollTop=this.menu.scroll_position,this.menu}.bind(this),hide:function(){return this.menu.outer_selector?(this.menu.outer_selector.style({visibility:"hidden"}),this.menu.hidden=!0,this.menu):this.menu}.bind(this),destroy:function(){return this.menu.outer_selector?(this.menu.inner_selector.remove(),this.menu.outer_selector.remove(),this.menu.inner_selector=null,this.menu.outer_selector=null,this.menu):this.menu}.bind(this),populate:function(){}.bind(this),setPopulate:function(t){return"function"==typeof t?(this.menu.populate=t,this.setOnclick(function(){this.menu.hidden?(this.menu.show(),this.highlight().update(),this.persist=!0):(this.menu.hide(),this.highlight(!1).update(),this.permanent||(this.persist=!1))}.bind(this))):this.setOnclick(),this}.bind(this)}},n.Dashboard.Components.add("title",function(t){n.Dashboard.Component.apply(this,arguments),this.show=function(){return this.div_selector=this.parent.selector.append("div").attr("class","lz-dashboard-title lz-dashboard-"+this.layout.position),this.title_selector=this.div_selector.append("h3"),this.update()},this.update=function(){var e=t.title.toString();return this.layout.subtitle&&(e+=" "+this.layout.subtitle+""),this.title_selector.html(e),this}}),n.Dashboard.Components.add("dimensions",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){var e=this.parent_plot.layout.width.toString().indexOf(".")===-1?this.parent_plot.layout.width:this.parent_plot.layout.width.toFixed(2),a=this.parent_plot.layout.height.toString().indexOf(".")===-1?this.parent_plot.layout.height:this.parent_plot.layout.height.toFixed(2);return this.selector.html(e+"px × "+a+"px"),t.class&&this.selector.attr("class",t.class),t.style&&this.selector.style(t.style),this}}),n.Dashboard.Components.add("region_scale",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)||null===this.parent_plot.state.start||null===this.parent_plot.state.end?this.selector.style("display","none"):(this.selector.style("display",null),this.selector.html(n.positionIntToString(this.parent_plot.state.end-this.parent_plot.state.start,null,!0))),t.class&&this.selector.attr("class",t.class),t.style&&this.selector.style(t.style),this}}),n.Dashboard.Components.add("download",function(a){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(a.color).setHtml("Download Image").setTitle("Download image of the current plot as locuszoom.svg").setOnMouseover(function(){this.button.selector.classed("lz-dashboard-button-gray-disabled",!0).html("Preparing Image"),this.generateBase64SVG().then(function(t){this.button.selector.attr("href","data:image/svg+xml;base64,\n"+t).classed("lz-dashboard-button-gray-disabled",!1).classed("lz-dashboard-button-gray-highlighted",!0).html("Download Image")}.bind(this))}.bind(this)).setOnMouseout(function(){this.button.selector.classed("lz-dashboard-button-gray-highlighted",!1)}.bind(this)),this.button.show(),this.button.selector.attr("href-lang","image/svg+xml").attr("download","locuszoom.svg"),this)},this.css_string="";for(var i in Object.keys(document.styleSheets))if(null!==document.styleSheets[i].href&&document.styleSheets[i].href.indexOf("locuszoom.css")!==-1){n.createCORSPromise("GET",document.styleSheets[i].href).then(function(t){this.css_string=t.replace(/[\r\n]/g," ").replace(/\s+/g," "),this.css_string.indexOf("/* ! LocusZoom HTML Styles */")&&(this.css_string=this.css_string.substring(0,this.css_string.indexOf("/* ! LocusZoom HTML Styles */")))}.bind(this));break}this.generateBase64SVG=function(){return e.fcall(function(){var e=this.parent.selector.append("div").style("display","none").html(this.parent_plot.svg.node().outerHTML);e.selectAll("g.lz-curtain").remove(),e.selectAll("g.lz-mouse_guide").remove(),e.selectAll("g.tick text").each(function(){var e=10*+t.select(this).attr("dy").substring(-2).slice(0,-2);t.select(this).attr("dy",e)});var a=t.select(e.select("svg").node().parentNode).html(),i='",n=a.indexOf(">")+1;return a=a.slice(0,n)+i+a.slice(n),e.remove(),btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode("0x"+e)}))}.bind(this))}}),n.Dashboard.Components.add("remove_panel",function(e){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(e.color).setHtml("×").setTitle("Remove panel").setOnclick(function(){if(!e.suppress_confirm&&!confirm("Are you sure you want to remove this panel? This cannot be undone!"))return!1;var a=this.parent_panel;return a.dashboard.hide(!0),t.select(a.parent.svg.node().parentNode).on("mouseover."+a.getBaseId()+".dashboard",null),t.select(a.parent.svg.node().parentNode).on("mouseout."+a.getBaseId()+".dashboard",null),a.parent.removePanel(a.id)}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("move_panel_up",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){if(this.button){var e=0===this.parent_panel.layout.y_index;return this.button.disable(e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("▴").setTitle("Move panel up").setOnclick(function(){this.parent_panel.moveUp(),this.update()}.bind(this)),this.button.show(),this.update()}}),n.Dashboard.Components.add("move_panel_down",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){if(this.button){var e=this.parent_panel.layout.y_index===this.parent_plot.panel_ids_by_y_index.length-1;return this.button.disable(e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("▾").setTitle("Move panel down").setOnclick(function(){this.parent_panel.moveDown(),this.update()}.bind(this)),this.button.show(),this.update()}}),n.Dashboard.Components.add("shift_region",function(t){return n.Dashboard.Component.apply(this,arguments),isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)?(this.update=function(){},void console.warn("Unable to add shift_region dashboard component: plot state does not have region bounds")):((isNaN(t.step)||0===t.step)&&(t.step=5e4),"string"!=typeof t.button_html&&(t.button_html=t.step>0?">":"<"),"string"!=typeof t.button_title&&(t.button_title="Shift region by "+(t.step>0?"+":"-")+n.positionIntToString(Math.abs(t.step),null,!0)),void(this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){this.parent_plot.applyState({start:Math.max(this.parent_plot.state.start+t.step,1),end:this.parent_plot.state.end+t.step})}.bind(this)),this.button.show(),this)}))}),n.Dashboard.Components.add("zoom_region",function(t){return n.Dashboard.Component.apply(this,arguments),isNaN(this.parent_plot.state.start)||isNaN(this.parent_plot.state.end)?(this.update=function(){},void console.warn("Unable to add zoom_region dashboard component: plot state does not have region bounds")):((isNaN(t.step)||0===t.step)&&(t.step=.2),"string"!=typeof t.button_html&&(t.button_html=t.step>0?"z–":"z+"),"string"!=typeof t.button_title&&(t.button_title="Zoom region "+(t.step>0?"out":"in")+" by "+(100*Math.abs(t.step)).toFixed(1)+"%"),void(this.update=function(){if(this.button){var e=!0,a=this.parent_plot.state.end-this.parent_plot.state.start;return t.step>0&&!isNaN(this.parent_plot.layout.max_region_scale)&&a>=this.parent_plot.layout.max_region_scale&&(e=!1),t.step<0&&!isNaN(this.parent_plot.layout.min_region_scale)&&a<=this.parent_plot.layout.min_region_scale&&(e=!1),this.button.disable(!e),this}return this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){var e=this.parent_plot.state.end-this.parent_plot.state.start,a=1+t.step,i=e*a;isNaN(this.parent_plot.layout.max_region_scale)||(i=Math.min(i,this.parent_plot.layout.max_region_scale)),isNaN(this.parent_plot.layout.min_region_scale)||(i=Math.max(i,this.parent_plot.layout.min_region_scale));var n=Math.floor((i-e)/2);this.parent_plot.applyState({start:Math.max(this.parent_plot.state.start-n,1),end:this.parent_plot.state.end+n})}.bind(this)),this.button.show(),this}))}),n.Dashboard.Components.add("menu",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title),this.button.menu.setPopulate(function(){this.button.menu.inner_selector.html(t.menu_html)}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("covariates_model",function(t){n.Dashboard.Component.apply(this,arguments),this.initialize=function(){this.parent_plot.state.model=this.parent_plot.state.model||{},this.parent_plot.state.model.covariates=this.parent_plot.state.model.covariates||[],this.parent_plot.CovariatesModel={button:this,add:function(t){var e=JSON.parse(JSON.stringify(t));"object"==typeof t&&"string"!=typeof e.html&&(e.html="function"==typeof t.toHTML?t.toHTML():t.toString());for(var a=0;a1?"covariates":"covariate";t+=" ("+this.parent_plot.state.model.covariates.length+" "+e+")"}this.button.setHtml(t).disable(!1)}.bind(this),this.button.show(),this)}}),n.Dashboard.Components.add("toggle_split_tracks",function(t){if(n.Dashboard.Component.apply(this,arguments),t.data_layer_id||(t.data_layer_id="intervals"),!this.parent_panel.data_layers[t.data_layer_id])throw"Dashboard toggle split tracks component missing valid data layer ID";this.update=function(){var e=this.parent_panel.data_layers[t.data_layer_id],a=e.layout.split_tracks?"Merge Tracks":"Split Tracks";return this.button?(this.button.setHtml(a),this.button.show(),this.parent.position(),this):(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(a).setTitle("Toggle whether tracks are split apart or merged together").setOnclick(function(){e.toggleSplitTracks(),this.scale_timeout&&clearTimeout(this.scale_timeout);var t=e.layout.transition?+e.layout.transition.duration||0:0;this.scale_timeout=setTimeout(function(){this.parent_panel.scaleHeightToData(),this.parent_plot.positionPanels()}.bind(this),t),this.update()}.bind(this)),this.update())}}),n.Dashboard.Components.add("resize_to_data",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml("Resize to Data").setTitle("Automatically resize this panel to fit the data its currently showing").setOnclick(function(){this.parent_panel.scaleHeightToData(),this.update()}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("toggle_legend",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){var e=this.parent_panel.legend.layout.hidden?"Show Legend":"Hide Legend";return this.button?(this.button.setHtml(e).show(),this.parent.position(),this):(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setTitle("Show or hide the legend for this panel").setOnclick(function(){this.parent_panel.legend.layout.hidden=!this.parent_panel.legend.layout.hidden,this.parent_panel.legend.render(),this.update()}.bind(this)),this.update())}}),n.Dashboard.Components.add("data_layers",function(t){n.Dashboard.Component.apply(this,arguments),this.update=function(){return"string"!=typeof t.button_html&&(t.button_html="Data Layers"),"string"!=typeof t.button_title&&(t.button_title="Manipulate Data Layers (sort, dim, show/hide, etc.)"),this.button?this:(this.button=new n.Dashboard.Component.Button(this).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){this.button.menu.populate()}.bind(this)),this.button.menu.setPopulate(function(){this.button.menu.inner_selector.html("");var e=this.button.menu.inner_selector.append("table");return this.parent_panel.data_layer_ids_by_z_index.slice().reverse().forEach(function(a,i){var s=this.parent_panel.data_layers[a],o="string"!=typeof s.layout.name?s.id:s.layout.name,r=e.append("tr");r.append("td").html(o),t.statuses.forEach(function(t){var e,a,i,o=n.DataLayer.Statuses.adjectives.indexOf(t),l=n.DataLayer.Statuses.verbs[o];s.global_statuses[t]?(e=n.DataLayer.Statuses.menu_antiverbs[o],a="un"+l+"AllElements",i="-highlighted"):(e=n.DataLayer.Statuses.verbs[o],a=l+"AllElements",i=""),r.append("td").append("a").attr("class","lz-dashboard-button lz-dashboard-button-"+this.layout.color+i).style({"margin-left":"0em"}).on("click",function(){s[a](),this.button.menu.populate()}.bind(this)).html(e)}.bind(this));var l=0===i,h=i===this.parent_panel.data_layer_ids_by_z_index.length-1,d=r.append("td");d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-start lz-dashboard-button-"+this.layout.color+(h?"-disabled":"")).style({"margin-left":"0em"}).on("click",function(){s.moveDown(),this.button.menu.populate()}.bind(this)).html("▾").attr("title","Move layer down (further back)"),d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-middle lz-dashboard-button-"+this.layout.color+(l?"-disabled":"")).style({"margin-left":"0em"}).on("click",function(){s.moveUp(),this.button.menu.populate()}.bind(this)).html("▴").attr("title","Move layer up (further front)"),d.append("a").attr("class","lz-dashboard-button lz-dashboard-button-group-end lz-dashboard-button-red").style({"margin-left":"0em"}).on("click",function(){return confirm("Are you sure you want to remove the "+o+" layer? This cannot be undone!")&&s.parent.removeDataLayer(a),this.button.menu.populate()}.bind(this)).html("×").attr("title","Remove layer")}.bind(this)),this}.bind(this)),this.button.show(),this)}}),n.Dashboard.Components.add("display_options",function(t){"string"!=typeof t.button_html&&(t.button_html="Display options"),"string"!=typeof t.button_title&&(t.button_title="Control how plot items are displayed"),n.Dashboard.Component.apply(this,arguments);var e=t.fields_whitelist||["color","fill_opacity","label","legend","point_shape","point_size","tooltip","tooltip_positioning"],a=this.parent_panel.data_layers[t.layer_name],i=a.layout,s={};e.forEach(function(t){var e=i[t];e&&(s[t]=JSON.parse(JSON.stringify(e)))}),this._selected_item="default";var o=this;this.button=new n.Dashboard.Component.Button(o).setColor(t.color).setHtml(t.button_html).setTitle(t.button_title).setOnclick(function(){o.button.menu.populate()}),this.button.menu.setPopulate(function(){var t=Math.floor(1e4*Math.random()).toString();o.button.menu.inner_selector.html("");var e=o.button.menu.inner_selector.append("table"),i=o.layout,n=function(i,n,s){var r=e.append("tr");r.append("td").append("input").attr({type:"radio",name:"color-picker-"+t,value:s}).property("checked",s===o._selected_item).on("click",function(){Object.keys(n).forEach(function(t){a.layout[t]=n[t]}),o._selected_item=s,o.parent_panel.render();var t=o.parent_panel.legend;t&&n.legend&&t.render()}),r.append("td").text(i)},r=i.default_config_display_name||"Default style";return n(r,s,"default"),i.options.forEach(function(t,e){n(t.display_name,t.display,e)}),o}),this.update=function(){return this.button.show(),this}}),n.Legend=function(t){if(!(t instanceof n.Panel))throw"Unable to create legend, parent must be a locuszoom panel";return this.parent=t,this.id=this.parent.getBaseId()+".legend",this.parent.layout.legend=n.Layouts.merge(this.parent.layout.legend||{},n.Legend.DefaultLayout),this.layout=this.parent.layout.legend,this.selector=null,this.background_rect=null,this.elements=[],this.elements_group=null,this.hidden=!1,this.render()},n.Legend.DefaultLayout={orientation:"vertical",origin:{x:0,y:0},width:10,height:10,padding:5,label_size:12,hidden:!1},n.Legend.prototype.render=function(){this.selector||(this.selector=this.parent.svg.group.append("g").attr("id",this.parent.getBaseId()+".legend").attr("class","lz-legend")),this.background_rect||(this.background_rect=this.selector.append("rect").attr("width",100).attr("height",100).attr("class","lz-legend-background")),this.elements_group||(this.elements_group=this.selector.append("g")),this.elements.forEach(function(t){t.remove()}),this.elements=[];var e=+this.layout.padding||1,a=e,i=e,n=0;this.parent.data_layer_ids_by_z_index.slice().reverse().forEach(function(s){Array.isArray(this.parent.data_layers[s].layout.legend)&&this.parent.data_layers[s].layout.legend.forEach(function(s){var o=this.elements_group.append("g").attr("transform","translate("+a+","+i+")"),r=+s.label_size||+this.layout.label_size||12,l=0,h=r/2+e/2;if(n=Math.max(n,r+e),"line"===s.shape){var d=+s.length||16,u=r/4+e/2;o.append("path").attr("class",s.class||"").attr("d","M0,"+u+"L"+d+","+u).style(s.style||{}),l=d+e}else if("rect"===s.shape){var p=+s.width||16,c=+s.height||p;o.append("rect").attr("class",s.class||"").attr("width",p).attr("height",c).attr("fill",s.color||{}).style(s.style||{}),l=p+e,n=Math.max(n,c+e)}else if(t.svg.symbolTypes.indexOf(s.shape)!==-1){var y=+s.size||40,f=Math.ceil(Math.sqrt(y/Math.PI));o.append("path").attr("class",s.class||"").attr("d",t.svg.symbol().size(y).type(s.shape)).attr("transform","translate("+f+","+(f+e/2)+")").attr("fill",s.color||{}).style(s.style||{}),l=2*f+e,h=Math.max(2*f+e/2,h),n=Math.max(n,2*f+e)}o.append("text").attr("text-anchor","left").attr("class","lz-label").attr("x",l).attr("y",h).style({"font-size":r}).text(s.label);var g=o.node().getBoundingClientRect();if("vertical"===this.layout.orientation)i+=g.height+e,n=0;else{var _=this.layout.origin.x+a+g.width;a>e&&_>this.parent.layout.width&&(i+=n,a=e,o.attr("transform","translate("+a+","+i+")")),a+=g.width+3*e}this.elements.push(o)}.bind(this))}.bind(this));var s=this.elements_group.node().getBoundingClientRect();return this.layout.width=s.width+2*this.layout.padding,this.layout.height=s.height+2*this.layout.padding,this.background_rect.attr("width",this.layout.width).attr("height",this.layout.height),this.selector.style({visibility:this.layout.hidden?"hidden":"visible"}),this.position()},n.Legend.prototype.position=function(){if(!this.selector)return this;var t=this.selector.node().getBoundingClientRect();isNaN(+this.layout.pad_from_bottom)||(this.layout.origin.y=this.parent.layout.height-t.height-+this.layout.pad_from_bottom),isNaN(+this.layout.pad_from_right)||(this.layout.origin.x=this.parent.layout.width-t.width-+this.layout.pad_from_right),this.selector.attr("transform","translate("+this.layout.origin.x+","+this.layout.origin.y+")")},n.Legend.prototype.hide=function(){this.layout.hidden=!0,this.render()},n.Legend.prototype.show=function(){this.layout.hidden=!1,this.render()},n.Data=n.Data||{},n.DataSources=function(){this.sources={}},n.DataSources.prototype.addSource=function(t,e){return console.warn("Warning: .addSource() is deprecated. Use .add() instead"),this.add(t,e)},n.DataSources.prototype.add=function(t,e){return this.set(t,e)},n.DataSources.prototype.set=function(t,e){if(Array.isArray(e)){var a=n.KnownDataSources.create.apply(null,e);a.source_id=t,this.sources[t]=a}else null!==e?(e.source_id=t,this.sources[t]=e):delete this.sources[t];return this},n.DataSources.prototype.getSource=function(t){return console.warn("Warning: .getSource() is deprecated. Use .get() instead"),this.get(t)},n.DataSources.prototype.get=function(t){return this.sources[t]},n.DataSources.prototype.removeSource=function(t){return console.warn("Warning: .removeSource() is deprecated. Use .remove() instead"),this.remove(t)},n.DataSources.prototype.remove=function(t){return this.set(t,null)},n.DataSources.prototype.fromJSON=function(t){"string"==typeof t&&(t=JSON.parse(t));var e=this;return Object.keys(t).forEach(function(a){e.set(a,t[a])}),e},n.DataSources.prototype.keys=function(){return Object.keys(this.sources); +},n.DataSources.prototype.toJSON=function(){return this.sources},n.Data.Field=function(t){var e=/^(?:([^:]+):)?([^:|]*)(\|.+)*$/.exec(t);this.full_name=t,this.namespace=e[1]||null,this.name=e[2]||null,this.transformations=[],"string"==typeof e[3]&&e[3].length>1&&(this.transformations=e[3].substring(1).split("|"),this.transformations.forEach(function(t,e){this.transformations[e]=n.TransformationFunctions.get(t)}.bind(this))),this.applyTransformations=function(t){return this.transformations.forEach(function(e){t=e(t)}),t},this.resolve=function(t){if("undefined"==typeof t[this.full_name]){var e=null;"undefined"!=typeof t[this.namespace+":"+this.name]?e=t[this.namespace+":"+this.name]:"undefined"!=typeof t[this.name]&&(e=t[this.name]),t[this.full_name]=this.applyTransformations(e)}return t[this.full_name]}},n.Data.Requester=function(t){function a(t){var e={},a=/^(?:([^:]+):)?([^:|]*)(\|.+)*$/;return t.forEach(function(t){var i=a.exec(t),s=i[1]||"base",o=i[2],r=n.TransformationFunctions.get(i[3]);"undefined"==typeof e[s]&&(e[s]={outnames:[],fields:[],trans:[]}),e[s].outnames.push(t),e[s].fields.push(o),e[s].trans.push(r)}),e}this.getData=function(i,n){for(var s=a(n),o=Object.keys(s).map(function(e){if(!t.get(e))throw"Datasource for namespace "+e+" not found";return t.get(e).getData(i,s[e].fields,s[e].outnames,s[e].trans)}),r=e.when({header:{},body:{},discrete:{}}),l=0;l1&&(2!==e.length||e.indexOf("isrefvar")===-1))throw"LD does not know how to get all fields: "+e.join(", ")},n.Data.LDSource.prototype.findMergeFields=function(t){var e=function(t){return function(){for(var e=arguments,a=0;a0){var i=Object.keys(t.body[0]),n=e(i);a.id=a.id||n(/\bvariant\b/)||n(/\bid\b/),a.position=a.position||n(/\bposition\b/i,/\bpos\b/i),a.pvalue=a.pvalue||n(/\bpvalue\b/i,/\blog_pvalue\b/i),a._names_=i}return a},n.Data.LDSource.prototype.findRequestedFields=function(t,e){for(var a={},i=0;ii&&(i=t[s][e]*a,n=s);return n},n=t.ldrefsource||e.header.ldrefsource||1,s=this.findRequestedFields(a),o=s.ldin;if("state"===o&&(o=t.ldrefvar||e.header.ldrefvar||"best"),"best"===o){if(!e.body)throw"No association data found to find best pvalue";var r=this.findMergeFields(e);if(!r.pvalue||!r.id){var l="";throw r.id||(l+=(l.length?", ":"")+"id"),r.pvalue||(l+=(l.length?", ":"")+"pvalue"),"Unable to find necessary column(s) for merge: "+l+" (available: "+r._names_+")"}o=e.body[i(e.body,r.pvalue)][r.id]}return e.header||(e.header={}),e.header.ldrefvar=o,this.url+"results/?filter=reference eq "+n+" and chromosome2 eq '"+t.chr+"' and position2 ge "+t.start+" and position2 le "+t.end+" and variant1 eq '"+o+"'&fields=chr,pos,rsquare"},n.Data.LDSource.prototype.combineChainBody=function(t,e,a,i){var n=this.findMergeFields(e),s=this.findRequestedFields(a,i);if(!n.position)throw"Unable to find position field for merge: "+n._names_;var o=function(t,e,a,i){for(var s=0,o=0;s0&&parseFloat(this.panels[i].layout.proportional_height)>0&&(s=Math.max(s,this.panels[i].layout.min_height/this.panels[i].layout.proportional_height));if(this.layout.min_width=Math.max(n,1),this.layout.min_height=Math.max(s,1),t.select(this.svg.node().parentNode).style({"min-width":this.layout.min_width+"px","min-height":this.layout.min_height+"px"}),!isNaN(e)&&e>=0&&!isNaN(a)&&a>=0){this.layout.width=Math.max(Math.round(+e),this.layout.min_width),this.layout.height=Math.max(Math.round(+a),this.layout.min_height),this.layout.aspect_ratio=this.layout.width/this.layout.height,this.layout.responsive_resize&&(this.svg&&(this.layout.width=Math.max(this.svg.node().parentNode.getBoundingClientRect().width,this.layout.min_width)),this.layout.height=this.layout.width/this.layout.aspect_ratio,this.layout.height0)e.layout.y_index<0&&(e.layout.y_index=Math.max(this.panel_ids_by_y_index.length+e.layout.y_index,0)),this.panel_ids_by_y_index.splice(e.layout.y_index,0,e.id),this.applyPanelYIndexesToPanelLayouts();else{var a=this.panel_ids_by_y_index.push(e.id);this.panels[e.id].layout.y_index=a-1}var i=null;return this.layout.panels.forEach(function(t,a){t.id===e.id&&(i=a)}),null===i&&(i=this.layout.panels.push(this.panels[e.id].layout)-1),this.panels[e.id].layout_idx=i,this.initialized&&(this.positionPanels(),this.panels[e.id].initialize(),this.panels[e.id].reMap(),this.setDimensions(this.layout.width,this.layout.height)),this.panels[e.id]},n.Plot.prototype.clearPanelData=function(t,e){e=e||"wipe";var a;a=t?[t]:Object.keys(this.panels);var i=this;return a.forEach(function(t){i.panels[t].data_layer_ids_by_z_index.forEach(function(a){var n=i.panels[t].data_layers[a];n.destroyAllTooltips(),delete i.layout.state[t+"."+a],"reset"===e&&n.setDefaultState()})}),this},n.Plot.prototype.removePanel=function(t){if(!this.panels[t])throw"Unable to remove panel, ID not found: "+t;return this.panel_boundaries.hide(),this.clearPanelData(t),this.panels[t].loader.hide(),this.panels[t].dashboard.destroy(!0),this.panels[t].curtain.hide(),this.panels[t].svg.container&&this.panels[t].svg.container.remove(),this.layout.panels.splice(this.panels[t].layout_idx,1),delete this.panels[t],delete this.layout.state[t],this.layout.panels.forEach(function(t,e){this.panels[t.id].layout_idx=e}.bind(this)),this.panel_ids_by_y_index.splice(this.panel_ids_by_y_index.indexOf(t),1),this.applyPanelYIndexesToPanelLayouts(),this.initialized&&(this.layout.min_height=this._base_layout.min_height,this.layout.min_width=this._base_layout.min_width,this.positionPanels(),this.setDimensions(this.layout.width,this.layout.height)),this},n.Plot.prototype.positionPanels=function(){var t,e={left:0,right:0};for(t in this.panels)null===this.panels[t].layout.proportional_height&&(this.panels[t].layout.proportional_height=this.panels[t].layout.height/this.layout.height),null===this.panels[t].layout.proportional_width&&(this.panels[t].layout.proportional_width=1),this.panels[t].layout.interaction.x_linked&&(e.left=Math.max(e.left,this.panels[t].layout.margin.left),e.right=Math.max(e.right,this.panels[t].layout.margin.right));var a=this.sumProportional("height");if(!a)return this;var i=1/a;for(t in this.panels)this.panels[t].layout.proportional_height*=i;var n=0;this.panel_ids_by_y_index.forEach(function(t){if(this.panels[t].setOrigin(0,n),this.panels[t].layout.proportional_origin.x=0,n+=this.panels[t].layout.height,this.panels[t].layout.interaction.x_linked){var a=Math.max(e.left-this.panels[t].layout.margin.left,0)+Math.max(e.right-this.panels[t].layout.margin.right,0);this.panels[t].layout.width+=a,this.panels[t].layout.margin.left=e.left,this.panels[t].layout.margin.right=e.right,this.panels[t].layout.cliparea.origin.x=e.left}}.bind(this));var s=n;return this.panel_ids_by_y_index.forEach(function(t){this.panels[t].layout.proportional_origin.y=this.panels[t].layout.origin.y/s}.bind(this)),this.setDimensions(),this.panel_ids_by_y_index.forEach(function(t){this.panels[t].setDimensions(this.layout.width*this.panels[t].layout.proportional_width,this.layout.height*this.panels[t].layout.proportional_height)}.bind(this)),this},n.Plot.prototype.initialize=function(){if(this.layout.responsive_resize&&t.select(this.container).classed("lz-container-responsive",!0),this.layout.mouse_guide){var e=this.svg.append("g").attr("class","lz-mouse_guide").attr("id",this.id+".mouse_guide"),a=e.append("rect").attr("class","lz-mouse_guide-vertical").attr("x",-1),i=e.append("rect").attr("class","lz-mouse_guide-horizontal").attr("y",-1);this.mouse_guide={svg:e,vertical:a,horizontal:i}}this.curtain=n.generateCurtain.call(this),this.loader=n.generateLoader.call(this),this.panel_boundaries={parent:this,hide_timeout:null,showing:!1,dragging:!1,selectors:[],corner_selector:null,show:function(){if(!this.showing&&!this.parent.curtain.showing){this.showing=!0,this.parent.panel_ids_by_y_index.forEach(function(e,a){var i=t.select(this.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip").attr("class","lz-panel-boundary").attr("title","Resize panel");i.append("span");var n=t.behavior.drag();n.on("dragstart",function(){this.dragging=!0}.bind(this)),n.on("dragend",function(){this.dragging=!1}.bind(this)),n.on("drag",function(){var e=this.parent.panels[this.parent.panel_ids_by_y_index[a]],i=e.layout.height;e.setDimensions(e.layout.width,e.layout.height+t.event.dy);var n=e.layout.height-i,s=this.parent.layout.height+n;this.parent.panel_ids_by_y_index.forEach(function(t,e){var i=this.parent.panels[this.parent.panel_ids_by_y_index[e]];i.layout.proportional_height=i.layout.height/s,e>a&&(i.setOrigin(i.layout.origin.x,i.layout.origin.y+n),i.dashboard.position())}.bind(this)),this.parent.positionPanels(),this.position()}.bind(this)),i.call(n),this.parent.panel_boundaries.selectors.push(i)}.bind(this));var e=t.select(this.parent.svg.node().parentNode).insert("div",".lz-data_layer-tooltip").attr("class","lz-panel-corner-boundary").attr("title","Resize plot");e.append("span").attr("class","lz-panel-corner-boundary-outer"),e.append("span").attr("class","lz-panel-corner-boundary-inner");var a=t.behavior.drag();a.on("dragstart",function(){this.dragging=!0}.bind(this)),a.on("dragend",function(){this.dragging=!1}.bind(this)),a.on("drag",function(){this.setDimensions(this.layout.width+t.event.dx,this.layout.height+t.event.dy)}.bind(this.parent)),e.call(a),this.parent.panel_boundaries.corner_selector=e}return this.position()},position:function(){if(!this.showing)return this;var t=this.parent.getPageOrigin();this.selectors.forEach(function(e,a){var i=this.parent.panels[this.parent.panel_ids_by_y_index[a]].getPageOrigin(),n=t.x,s=i.y+this.parent.panels[this.parent.panel_ids_by_y_index[a]].layout.height-12,o=this.parent.layout.width-1;e.style({top:s+"px",left:n+"px",width:o+"px"}),e.select("span").style({width:o+"px"})}.bind(this));var e=10,a=16;return this.corner_selector.style({top:t.y+this.parent.layout.height-e-a+"px",left:t.x+this.parent.layout.width-e-a+"px"}),this},hide:function(){return this.showing?(this.showing=!1,this.selectors.forEach(function(t){t.remove()}),this.selectors=[],this.corner_selector.remove(),this.corner_selector=null,this):this}},this.layout.panel_boundaries&&(t.select(this.svg.node().parentNode).on("mouseover."+this.id+".panel_boundaries",function(){clearTimeout(this.panel_boundaries.hide_timeout),this.panel_boundaries.show()}.bind(this)),t.select(this.svg.node().parentNode).on("mouseout."+this.id+".panel_boundaries",function(){this.panel_boundaries.hide_timeout=setTimeout(function(){this.panel_boundaries.hide()}.bind(this),300)}.bind(this))),this.dashboard=new n.Dashboard(this).show();for(var s in this.panels)this.panels[s].initialize();var o="."+this.id;if(this.layout.mouse_guide){var r=function(){this.mouse_guide.vertical.attr("x",-1),this.mouse_guide.horizontal.attr("y",-1)}.bind(this),l=function(){var e=t.mouse(this.svg.node());this.mouse_guide.vertical.attr("x",e[0]),this.mouse_guide.horizontal.attr("y",e[1])}.bind(this);this.svg.on("mouseout"+o+"-mouse_guide",r).on("touchleave"+o+"-mouse_guide",r).on("mousemove"+o+"-mouse_guide",l)}var h=function(){this.stopDrag()}.bind(this),d=function(){if(this.interaction.dragging){var e=t.mouse(this.svg.node());t.event&&t.event.preventDefault(),this.interaction.dragging.dragged_x=e[0]-this.interaction.dragging.start_x,this.interaction.dragging.dragged_y=e[1]-this.interaction.dragging.start_y,this.panels[this.interaction.panel_id].render(),this.interaction.linked_panel_ids.forEach(function(t){this.panels[t].render()}.bind(this))}}.bind(this);this.svg.on("mouseup"+o,h).on("touchend"+o,h).on("mousemove"+o,d).on("touchmove"+o,d),t.select("body").empty()||t.select("body").on("mouseup"+o,h).on("touchend"+o,h),this.initialized=!0;var u=this.svg.node().getBoundingClientRect(),p=u.width?u.width:this.layout.width,c=u.height?u.height:this.layout.height;return this.setDimensions(p,c),this},n.Plot.prototype.refresh=function(){return this.applyState()},n.Plot.prototype.subscribeToData=function(t,e,a){a=a||{};var i=a.onerror||function(t){console.log("An error occurred while acting on an external callback",t)},n=this,s=function(){try{n.lzd.getData(n.state,t).then(function(t){e(a.discrete?t.discrete:t.body)}).catch(i)}catch(t){i(t)}};return this.on("data_rendered",s),s},n.Plot.prototype.applyState=function(t){if(t=t||{},"object"!=typeof t)throw"LocusZoom.applyState only accepts an object; "+typeof t+" given";var a=JSON.parse(JSON.stringify(this.state));for(var i in t)a[i]=t[i];a=n.validateState(a,this.layout);for(i in a)this.state[i]=a[i];this.emit("data_requested"),this.remap_promises=[],this.loading_data=!0;for(var s in this.panels)this.remap_promises.push(this.panels[s].reMap());return e.all(this.remap_promises).catch(function(t){console.error(t),this.curtain.drop(t),this.loading_data=!1}.bind(this)).then(function(){this.dashboard.update(),this.panel_ids_by_y_index.forEach(function(t){var e=this.panels[t];e.dashboard.update(),e.data_layer_ids_by_z_index.forEach(function(e){var a=this.data_layers[e],i=t+"."+e;for(var n in this.state[i])this.state[i].hasOwnProperty(n)&&Array.isArray(this.state[i][n])&&this.state[i][n].forEach(function(t){try{this.setElementStatus(n,this.getElementById(t),!0)}catch(t){console.error("Unable to apply state: "+i+", "+n)}}.bind(a))}.bind(e))}.bind(this)),this.emit("layout_changed"),this.emit("data_rendered"),this.emit("state_changed",t),this.loading_data=!1}.bind(this))},n.Plot.prototype.startDrag=function(e,a){e=e||null,a=a||null;var i=null;switch(a){case"background":case"x_tick":i="x";break;case"y1_tick":i="y1";break;case"y2_tick":i="y2"}if(!(e instanceof n.Panel&&i&&this.canInteract()))return this.stopDrag();var s=t.mouse(this.svg.node());return this.interaction={panel_id:e.id,linked_panel_ids:e.getLinkedPanelIds(i),dragging:{method:a,start_x:s[0],start_y:s[1],dragged_x:0,dragged_y:0,axis:i}},this.svg.style("cursor","all-scroll"),this},n.Plot.prototype.stopDrag=function(){if(!this.interaction.dragging)return this;if("object"!=typeof this.panels[this.interaction.panel_id])return this.interaction={},this;var t=this.panels[this.interaction.panel_id],e=function(e,a,i){t.data_layer_ids_by_z_index.forEach(function(n){t.data_layers[n].layout[e+"_axis"].axis===a&&(t.data_layers[n].layout[e+"_axis"].floor=i[0],t.data_layers[n].layout[e+"_axis"].ceiling=i[1],delete t.data_layers[n].layout[e+"_axis"].lower_buffer,delete t.data_layers[n].layout[e+"_axis"].upper_buffer,delete t.data_layers[n].layout[e+"_axis"].min_extent,delete t.data_layers[n].layout[e+"_axis"].ticks)})};switch(this.interaction.dragging.method){case"background":case"x_tick":0!==this.interaction.dragging.dragged_x&&(e("x",1,t.x_extent),this.applyState({start:t.x_extent[0],end:t.x_extent[1]}));break;case"y1_tick":case"y2_tick":if(0!==this.interaction.dragging.dragged_y){var a=parseInt(this.interaction.dragging.method[1]);e("y",a,t["y"+a+"_extent"])}}return this.interaction={},this.svg.style("cursor",null),this},n.Panel=function(t,e){if("object"!=typeof t)throw"Unable to create panel, invalid layout";if(this.parent=e||null,this.parent_plot=e,"string"==typeof t.id&&t.id.length){if(this.parent&&"undefined"!=typeof this.parent.panels[t.id])throw"Cannot create panel with id ["+t.id+"]; panel with that id already exists"}else if(this.parent){var a=null,i=function(){a="p"+Math.floor(Math.random()*Math.pow(10,8)),null!=a&&"undefined"==typeof this.parent.panels[a]||(a=i())}.bind(this);t.id=a}else t.id="p"+Math.floor(Math.random()*Math.pow(10,8));return this.id=t.id,this.initialized=!1,this.layout_idx=null,this.svg={},this.layout=n.Layouts.merge(t||{},n.Panel.DefaultLayout),this.parent?(this.state=this.parent.state,this.state_id=this.id,this.state[this.state_id]=this.state[this.state_id]||{}):(this.state=null,this.state_id=null),this.data_layers={},this.data_layer_ids_by_z_index=[],this.applyDataLayerZIndexesToDataLayerLayouts=function(){this.data_layer_ids_by_z_index.forEach(function(t,e){this.data_layers[t].layout.z_index=e}.bind(this))}.bind(this),this.data_promises=[],this.x_scale=null,this.y1_scale=null,this.y2_scale=null,this.x_extent=null,this.y1_extent=null,this.y2_extent=null,this.x_ticks=[],this.y1_ticks=[],this.y2_ticks=[],this.zoom_timeout=null,this.getBaseId=function(){return this.parent.id+"."+this.id},this.event_hooks={layout_changed:[],data_requested:[], +data_rendered:[],element_clicked:[],element_selection:[]},this.on=function(t,e){if(!Array.isArray(this.event_hooks[t]))throw"Unable to register event hook, invalid event: "+t.toString();if("function"!=typeof e)throw"Unable to register event hook, invalid hook function passed";return this.event_hooks[t].push(e),e},this.off=function(t,e){var a=this.event_hooks[t];if(!Array.isArray(a))throw"Unable to remove event hook, invalid event: "+t.toString();if(void 0===e)this.event_hooks[t]=[];else{var i=a.indexOf(e);if(i===-1)throw"The specified event listener is not registered and therefore cannot be removed";a.splice(i,1)}return this},this.emit=function(t,e,a){if(a=a||!1,!Array.isArray(this.event_hooks[t]))throw"LocusZoom attempted to throw an invalid event: "+t.toString();"boolean"==typeof e&&2===arguments.length&&(a=e,e=null);var i=this.getBaseId(),n=this,s={sourceID:i,data:e||null};return this.event_hooks[t].forEach(function(t){t.call(n,s)}),a&&this.parent&&this.parent.emit(t,s),this},this.getPageOrigin=function(){var t=this.parent.getPageOrigin();return{x:t.x+this.layout.origin.x,y:t.y+this.layout.origin.y}},this.initializeLayout(),this};n.Panel.DefaultLayout={title:{text:"",style:{},x:10,y:22},y_index:null,width:0,height:0,origin:{x:0,y:null},min_width:1,min_height:1,proportional_width:null,proportional_height:null,proportional_origin:{x:0,y:null},margin:{top:0,right:0,bottom:0,left:0},background_click:"clear_selections",dashboard:{components:[]},cliparea:{height:0,width:0,origin:{x:0,y:0}},axes:{x:{},y1:{},y2:{}},legend:null,interaction:{drag_background_to_pan:!1,drag_x_ticks_to_scale:!1,drag_y1_ticks_to_scale:!1,drag_y2_ticks_to_scale:!1,scroll_to_zoom:!1,x_linked:!1,y1_linked:!1,y2_linked:!1},data_layers:[]};n.Panel.prototype.initializeLayout=function(){if(0===this.layout.width&&null===this.layout.proportional_width&&(this.layout.proportional_width=1),0===this.layout.height&&null===this.layout.proportional_height){var t=Object.keys(this.parent.panels).length;t>0?this.layout.proportional_height=1/t:this.layout.proportional_height=1}return this.setDimensions(),this.setOrigin(),this.setMargin(),this.x_range=[0,this.layout.cliparea.width],this.y1_range=[this.layout.cliparea.height,0],this.y2_range=[this.layout.cliparea.height,0],["x","y1","y2"].forEach(function(t){Object.keys(this.layout.axes[t]).length&&this.layout.axes[t].render!==!1?(this.layout.axes[t].render=!0,this.layout.axes[t].label=this.layout.axes[t].label||null,this.layout.axes[t].label_function=this.layout.axes[t].label_function||null):this.layout.axes[t].render=!1}.bind(this)),this.layout.data_layers.forEach(function(t){this.addDataLayer(t)}.bind(this)),this},n.Panel.prototype.setDimensions=function(t,e){return"undefined"!=typeof t&&"undefined"!=typeof e?!isNaN(t)&&t>=0&&!isNaN(e)&&e>=0&&(this.layout.width=Math.max(Math.round(+t),this.layout.min_width),this.layout.height=Math.max(Math.round(+e),this.layout.min_height)):(null!==this.layout.proportional_width&&(this.layout.width=Math.max(this.layout.proportional_width*this.parent.layout.width,this.layout.min_width)),null!==this.layout.proportional_height&&(this.layout.height=Math.max(this.layout.proportional_height*this.parent.layout.height,this.layout.min_height))),this.layout.cliparea.width=Math.max(this.layout.width-(this.layout.margin.left+this.layout.margin.right),0),this.layout.cliparea.height=Math.max(this.layout.height-(this.layout.margin.top+this.layout.margin.bottom),0),this.svg.clipRect&&this.svg.clipRect.attr("width",this.layout.width).attr("height",this.layout.height),this.initialized&&(this.render(),this.curtain.update(),this.loader.update(),this.dashboard.update(),this.legend&&this.legend.position()),this},n.Panel.prototype.setOrigin=function(t,e){return!isNaN(t)&&t>=0&&(this.layout.origin.x=Math.max(Math.round(+t),0)),!isNaN(e)&&e>=0&&(this.layout.origin.y=Math.max(Math.round(+e),0)),this.initialized&&this.render(),this},n.Panel.prototype.setMargin=function(t,e,a,i){var n;return!isNaN(t)&&t>=0&&(this.layout.margin.top=Math.max(Math.round(+t),0)),!isNaN(e)&&e>=0&&(this.layout.margin.right=Math.max(Math.round(+e),0)),!isNaN(a)&&a>=0&&(this.layout.margin.bottom=Math.max(Math.round(+a),0)),!isNaN(i)&&i>=0&&(this.layout.margin.left=Math.max(Math.round(+i),0)),this.layout.margin.top+this.layout.margin.bottom>this.layout.height&&(n=Math.floor((this.layout.margin.top+this.layout.margin.bottom-this.layout.height)/2),this.layout.margin.top-=n,this.layout.margin.bottom-=n),this.layout.margin.left+this.layout.margin.right>this.layout.width&&(n=Math.floor((this.layout.margin.left+this.layout.margin.right-this.layout.width)/2),this.layout.margin.left-=n,this.layout.margin.right-=n),["top","right","bottom","left"].forEach(function(t){this.layout.margin[t]=Math.max(this.layout.margin[t],0)}.bind(this)),this.layout.cliparea.width=Math.max(this.layout.width-(this.layout.margin.left+this.layout.margin.right),0),this.layout.cliparea.height=Math.max(this.layout.height-(this.layout.margin.top+this.layout.margin.bottom),0),this.layout.cliparea.origin.x=this.layout.margin.left,this.layout.cliparea.origin.y=this.layout.margin.top,this.initialized&&this.render(),this},n.Panel.prototype.setTitle=function(t){if("string"==typeof this.layout.title){var e=this.layout.title;this.layout.title={text:e,x:0,y:0,style:{}}}return"string"==typeof t?this.layout.title.text=t:"object"==typeof t&&null!==t&&(this.layout.title=n.Layouts.merge(t,this.layout.title)),this.layout.title.text.length?this.title.attr("display",null).attr("x",parseFloat(this.layout.title.x)).attr("y",parseFloat(this.layout.title.y)).style(this.layout.title.style).text(this.layout.title.text):this.title.attr("display","none"),this},n.Panel.prototype.initialize=function(){this.svg.container=this.parent.svg.append("g").attr("id",this.getBaseId()+".panel_container").attr("transform","translate("+(this.layout.origin.x||0)+","+(this.layout.origin.y||0)+")");var t=this.svg.container.append("clipPath").attr("id",this.getBaseId()+".clip");if(this.svg.clipRect=t.append("rect").attr("width",this.layout.width).attr("height",this.layout.height),this.svg.group=this.svg.container.append("g").attr("id",this.getBaseId()+".panel").attr("clip-path","url(#"+this.getBaseId()+".clip)"),this.curtain=n.generateCurtain.call(this),this.loader=n.generateLoader.call(this),this.dashboard=new n.Dashboard(this),this.inner_border=this.svg.group.append("rect").attr("class","lz-panel-background").on("click",function(){"clear_selections"===this.layout.background_click&&this.clearSelections()}.bind(this)),this.title=this.svg.group.append("text").attr("class","lz-panel-title"),"undefined"!=typeof this.layout.title&&this.setTitle(),this.svg.x_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".x_axis").attr("class","lz-x lz-axis"),this.layout.axes.x.render&&(this.svg.x_axis_label=this.svg.x_axis.append("text").attr("class","lz-x lz-axis lz-label").attr("text-anchor","middle")),this.svg.y1_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".y1_axis").attr("class","lz-y lz-y1 lz-axis"),this.layout.axes.y1.render&&(this.svg.y1_axis_label=this.svg.y1_axis.append("text").attr("class","lz-y1 lz-axis lz-label").attr("text-anchor","middle")),this.svg.y2_axis=this.svg.group.append("g").attr("id",this.getBaseId()+".y2_axis").attr("class","lz-y lz-y2 lz-axis"),this.layout.axes.y2.render&&(this.svg.y2_axis_label=this.svg.y2_axis.append("text").attr("class","lz-y2 lz-axis lz-label").attr("text-anchor","middle")),this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].initialize()}.bind(this)),this.legend=null,this.layout.legend&&(this.legend=new n.Legend(this)),this.layout.interaction.drag_background_to_pan){var e="."+this.parent.id+"."+this.id+".interaction.drag",a=function(){this.parent.startDrag(this,"background")}.bind(this);this.svg.container.select(".lz-panel-background").on("mousedown"+e+".background",a).on("touchstart"+e+".background",a)}return this},n.Panel.prototype.resortDataLayers=function(){var e=[];this.data_layer_ids_by_z_index.forEach(function(t){e.push(this.data_layers[t].layout.z_index)}.bind(this)),this.svg.group.selectAll("g.lz-data_layer-container").data(e).sort(t.ascending),this.applyDataLayerZIndexesToDataLayerLayouts()},n.Panel.prototype.getLinkedPanelIds=function(t){t=t||null;var e=[];return["x","y1","y2"].indexOf(t)===-1?e:this.layout.interaction[t+"_linked"]?(this.parent.panel_ids_by_y_index.forEach(function(a){a!==this.id&&this.parent.panels[a].layout.interaction[t+"_linked"]&&e.push(a)}.bind(this)),e):e},n.Panel.prototype.moveUp=function(){return this.parent.panel_ids_by_y_index[this.layout.y_index-1]&&(this.parent.panel_ids_by_y_index[this.layout.y_index]=this.parent.panel_ids_by_y_index[this.layout.y_index-1],this.parent.panel_ids_by_y_index[this.layout.y_index-1]=this.id,this.parent.applyPanelYIndexesToPanelLayouts(),this.parent.positionPanels()),this},n.Panel.prototype.moveDown=function(){return this.parent.panel_ids_by_y_index[this.layout.y_index+1]&&(this.parent.panel_ids_by_y_index[this.layout.y_index]=this.parent.panel_ids_by_y_index[this.layout.y_index+1],this.parent.panel_ids_by_y_index[this.layout.y_index+1]=this.id,this.parent.applyPanelYIndexesToPanelLayouts(),this.parent.positionPanels()),this},n.Panel.prototype.addDataLayer=function(t){if("object"!=typeof t||"string"!=typeof t.id||!t.id.length)throw"Invalid data layer layout passed to LocusZoom.Panel.prototype.addDataLayer()";if("undefined"!=typeof this.data_layers[t.id])throw"Cannot create data_layer with id ["+t.id+"]; data layer with that id already exists in the panel";if("string"!=typeof t.type)throw"Invalid data layer type in layout passed to LocusZoom.Panel.prototype.addDataLayer()";"object"!=typeof t.y_axis||"undefined"!=typeof t.y_axis.axis&&[1,2].indexOf(t.y_axis.axis)!==-1||(t.y_axis.axis=1);var e=n.DataLayers.get(t.type,t,this);if(this.data_layers[e.id]=e,null!==e.layout.z_index&&!isNaN(e.layout.z_index)&&this.data_layer_ids_by_z_index.length>0)e.layout.z_index<0&&(e.layout.z_index=Math.max(this.data_layer_ids_by_z_index.length+e.layout.z_index,0)),this.data_layer_ids_by_z_index.splice(e.layout.z_index,0,e.id),this.data_layer_ids_by_z_index.forEach(function(t,e){this.data_layers[t].layout.z_index=e}.bind(this));else{var a=this.data_layer_ids_by_z_index.push(e.id);this.data_layers[e.id].layout.z_index=a-1}var i=null;return this.layout.data_layers.forEach(function(t,a){t.id===e.id&&(i=a)}),null===i&&(i=this.layout.data_layers.push(this.data_layers[e.id].layout)-1),this.data_layers[e.id].layout_idx=i,this.data_layers[e.id]},n.Panel.prototype.removeDataLayer=function(t){if(!this.data_layers[t])throw"Unable to remove data layer, ID not found: "+t;return this.data_layers[t].destroyAllTooltips(),this.data_layers[t].svg.container&&this.data_layers[t].svg.container.remove(),this.layout.data_layers.splice(this.data_layers[t].layout_idx,1),delete this.state[this.data_layers[t].state_id],delete this.data_layers[t],this.data_layer_ids_by_z_index.splice(this.data_layer_ids_by_z_index.indexOf(t),1),this.applyDataLayerZIndexesToDataLayerLayouts(),this.layout.data_layers.forEach(function(t,e){this.data_layers[t.id].layout_idx=e}.bind(this)),this},n.Panel.prototype.clearSelections=function(){return this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].setAllElementStatus("selected",!1)}.bind(this)),this},n.Panel.prototype.reMap=function(){this.emit("data_requested"),this.data_promises=[],this.curtain.hide();for(var t in this.data_layers)try{this.data_promises.push(this.data_layers[t].reMap())}catch(t){console.warn(t),this.curtain.show(t)}return e.all(this.data_promises).then(function(){this.initialized=!0,this.render(),this.emit("layout_changed",!0),this.emit("data_rendered")}.bind(this)).catch(function(t){console.warn(t),this.curtain.show(t)}.bind(this))},n.Panel.prototype.generateExtents=function(){["x","y1","y2"].forEach(function(t){this[t+"_extent"]=null}.bind(this));for(var e in this.data_layers){var a=this.data_layers[e];if(a.layout.x_axis&&!a.layout.x_axis.decoupled&&(this.x_extent=t.extent((this.x_extent||[]).concat(a.getAxisExtent("x")))),a.layout.y_axis&&!a.layout.y_axis.decoupled){var i="y"+a.layout.y_axis.axis;this[i+"_extent"]=t.extent((this[i+"_extent"]||[]).concat(a.getAxisExtent("y")))}}return this.layout.axes.x&&"state"===this.layout.axes.x.extent&&(this.x_extent=[this.state.start,this.state.end]),this},n.Panel.prototype.generateTicks=function(t){if(this.layout.axes[t].ticks){var e=this.layout.axes[t],a=e.ticks;if(Array.isArray(a))return a;if("object"==typeof a){var i=this,s={position:a.position},o=this.data_layer_ids_by_z_index.reduce(function(e,a){var n=i.data_layers[a];return e.concat(n.getTicks(t,s))},[]);return o.map(function(t){var e={};return e=n.Layouts.merge(e,a),n.Layouts.merge(e,t)})}}return this[t+"_extent"]?n.prettyTicks(this[t+"_extent"],"both"):[]},n.Panel.prototype.render=function(){this.svg.container.attr("transform","translate("+this.layout.origin.x+","+this.layout.origin.y+")"),this.svg.clipRect.attr("width",this.layout.width).attr("height",this.layout.height),this.inner_border.attr("x",this.layout.margin.left).attr("y",this.layout.margin.top).attr("width",this.layout.width-(this.layout.margin.left+this.layout.margin.right)).attr("height",this.layout.height-(this.layout.margin.top+this.layout.margin.bottom)),this.layout.inner_border&&this.inner_border.style({"stroke-width":1,stroke:this.layout.inner_border}),this.setTitle(),this.generateExtents();var e=function(t,e){var a=Math.pow(-10,e),i=Math.pow(-10,-e),n=Math.pow(10,-e),s=Math.pow(10,e);return t===1/0&&(t=s),t===-(1/0)&&(t=a),0===t&&(t=n),t>0&&(t=Math.max(Math.min(t,s),n)),t<0&&(t=Math.max(Math.min(t,i),a)),t},a={};if(this.x_extent){var i={start:0,end:this.layout.cliparea.width};this.layout.axes.x.range&&(i.start=this.layout.axes.x.range.start||i.start,i.end=this.layout.axes.x.range.end||i.end),a.x=[i.start,i.end],a.x_shifted=[i.start,i.end]}if(this.y1_extent){var n={start:this.layout.cliparea.height,end:0};this.layout.axes.y1.range&&(n.start=this.layout.axes.y1.range.start||n.start,n.end=this.layout.axes.y1.range.end||n.end),a.y1=[n.start,n.end],a.y1_shifted=[n.start,n.end]}if(this.y2_extent){var s={start:this.layout.cliparea.height,end:0};this.layout.axes.y2.range&&(s.start=this.layout.axes.y2.range.start||s.start,s.end=this.layout.axes.y2.range.end||s.end),a.y2=[s.start,s.end],a.y2_shifted=[s.start,s.end]}if(this.parent.interaction.panel_id&&(this.parent.interaction.panel_id===this.id||this.parent.interaction.linked_panel_ids.indexOf(this.id)!==-1)){var o,r=null;if(this.parent.interaction.zooming&&"function"==typeof this.x_scale){var l=Math.abs(this.x_extent[1]-this.x_extent[0]),h=Math.round(this.x_scale.invert(a.x_shifted[1]))-Math.round(this.x_scale.invert(a.x_shifted[0])),d=this.parent.interaction.zooming.scale,u=Math.floor(h*(1/d));d<1&&!isNaN(this.parent.layout.max_region_scale)?d=1/(Math.min(u,this.parent.layout.max_region_scale)/h):d>1&&!isNaN(this.parent.layout.min_region_scale)&&(d=1/(Math.max(u,this.parent.layout.min_region_scale)/h));var p=Math.floor(l*d);o=this.parent.interaction.zooming.center-this.layout.margin.left-this.layout.origin.x;var c=o/this.layout.cliparea.width,y=Math.max(Math.floor(this.x_scale.invert(a.x_shifted[0])-(p-h)*c),1);a.x_shifted=[this.x_scale(y),this.x_scale(y+p)]}else if(this.parent.interaction.dragging)switch(this.parent.interaction.dragging.method){case"background":a.x_shifted[0]=+this.parent.interaction.dragging.dragged_x,a.x_shifted[1]=this.layout.cliparea.width+this.parent.interaction.dragging.dragged_x;break;case"x_tick":t.event&&t.event.shiftKey?(a.x_shifted[0]=+this.parent.interaction.dragging.dragged_x,a.x_shifted[1]=this.layout.cliparea.width+this.parent.interaction.dragging.dragged_x):(o=this.parent.interaction.dragging.start_x-this.layout.margin.left-this.layout.origin.x,r=e(o/(o+this.parent.interaction.dragging.dragged_x),3),a.x_shifted[0]=0,a.x_shifted[1]=Math.max(this.layout.cliparea.width*(1/r),1));break;case"y1_tick":case"y2_tick":var f="y"+this.parent.interaction.dragging.method[1]+"_shifted";t.event&&t.event.shiftKey?(a[f][0]=this.layout.cliparea.height+this.parent.interaction.dragging.dragged_y,a[f][1]=+this.parent.interaction.dragging.dragged_y):(o=this.layout.cliparea.height-(this.parent.interaction.dragging.start_y-this.layout.margin.top-this.layout.origin.y),r=e(o/(o-this.parent.interaction.dragging.dragged_y),3),a[f][0]=this.layout.cliparea.height,a[f][1]=this.layout.cliparea.height-this.layout.cliparea.height*(1/r))}}if(["x","y1","y2"].forEach(function(e){this[e+"_extent"]&&(this[e+"_scale"]=t.scale.linear().domain(this[e+"_extent"]).range(a[e+"_shifted"]),this[e+"_extent"]=[this[e+"_scale"].invert(a[e][0]),this[e+"_scale"].invert(a[e][1])],this[e+"_scale"]=t.scale.linear().domain(this[e+"_extent"]).range(a[e]),this.renderAxis(e))}.bind(this)),this.layout.interaction.scroll_to_zoom){var g=function(){if(!t.event.shiftKey)return void(this.parent.canInteract(this.id)&&this.loader.show("Press [SHIFT] while scrolling to zoom").hide(1e3));if(t.event.preventDefault(),this.parent.canInteract(this.id)){var e=t.mouse(this.svg.container.node()),a=Math.max(-1,Math.min(1,t.event.wheelDelta||-t.event.detail||-t.event.deltaY));0!==a&&(this.parent.interaction={panel_id:this.id,linked_panel_ids:this.getLinkedPanelIds("x"),zooming:{scale:a<1?.9:1.1,center:e[0]}},this.render(),this.parent.interaction.linked_panel_ids.forEach(function(t){this.parent.panels[t].render()}.bind(this)),null!==this.zoom_timeout&&clearTimeout(this.zoom_timeout),this.zoom_timeout=setTimeout(function(){this.parent.interaction={},this.parent.applyState({start:this.x_extent[0],end:this.x_extent[1]})}.bind(this),500))}}.bind(this);this.zoom_listener=t.behavior.zoom(),this.svg.container.call(this.zoom_listener).on("wheel.zoom",g).on("mousewheel.zoom",g).on("DOMMouseScroll.zoom",g)}return this.data_layer_ids_by_z_index.forEach(function(t){this.data_layers[t].draw().render()}.bind(this)),this},n.Panel.prototype.renderAxis=function(e){if(["x","y1","y2"].indexOf(e)===-1)throw"Unable to render axis; invalid axis identifier: "+e;var a=this.layout.axes[e].render&&"function"==typeof this[e+"_scale"]&&!isNaN(this[e+"_scale"](0));if(this[e+"_axis"]&&this.svg.container.select("g.lz-axis.lz-"+e).style("display",a?null:"none"),!a)return this;var i={x:{position:"translate("+this.layout.margin.left+","+(this.layout.height-this.layout.margin.bottom)+")",orientation:"bottom",label_x:this.layout.cliparea.width/2,label_y:this.layout.axes[e].label_offset||0,label_rotate:null},y1:{position:"translate("+this.layout.margin.left+","+this.layout.margin.top+")",orientation:"left",label_x:-1*(this.layout.axes[e].label_offset||0),label_y:this.layout.cliparea.height/2,label_rotate:-90},y2:{position:"translate("+(this.layout.width-this.layout.margin.right)+","+this.layout.margin.top+")",orientation:"right",label_x:this.layout.axes[e].label_offset||0,label_y:this.layout.cliparea.height/2,label_rotate:-90}};this[e+"_ticks"]=this.generateTicks(e);var s=function(t){for(var e=0;e",">=","%","matches","filterIndexes","filterElements","verb","adjective","antiverb","setElementStatus","setElementStatusByFilters","setAllElementStatus","toggle","get_element_id_error","element_status_node_id","element_status_idx","splice","emit","active","status_ids","applyBehaviors","selection","event_match","executeBehaviors","requiredKeyStates","ctrl","ctrlKey","shiftKey","behavior","current_status_boolean","href","target","window","location","panel_origin","exportData","format","default_format","toLowerCase","e","jsonified","delimiter","record","draw","cliparea","reMap","lzd","getData","new_data","DataLayers","datalayers","datalayer","extend","parent_name","overrides","child","render","self","trackData","enter","exit","arrow_type","arrow_top","arrow_left","arrow_width","stroke_width","tooltip_box","data_layer_height","data_layer_width","x_center","x_scale","y_center","offset_right","offset_left","confidence_intervals","show_no_significance_line","border_radius","y_scale","sqrt","PI","ci_selection","ci_transform","ci_width","ci_height","duration","ease","points_selection","initial_y","symbol","element_data","label_font_size","label_exon_spacing","exon_height","bounding_box_padding","track_vertical_spacing","getTrackHeight","transcript_idx","tracks","gene_track_index","1","assignTracks","getLabelWidth","gene_name","font_size","temp_text","label_width","getBBox","g","gene_id","gene_version","transcript_id","transcripts","display_range","text_anchor","centered_margin","display_domain","invert","track","potential_track","collision_on_potential_track","placed_gene","min_start","max_end","t","exons","bboxes","boundary_fill","boundary_stroke","boundaries","labels","strand","exon_fill","exon_stroke","exon_id","clickareas","gene_bbox_id","gene_bbox","gene_center_x","chromosome_fill_colors","light","dark","chromosome_label_colors","genome_start","genome_end","chromosomes","variant_parts","variant","track_split_order","track_split_legend_to_y_axis","track_height","previous_tracks","interval_track_index","track_split_field_index","reverse","placed_interval","psuedoElement","sharedstatusnode_style","display","interval","statusnode_style","statusnodes","rects","interval_name","updateSplitTrackAxis","interval_bbox","interval_center_x","legend_axis","track_spacing","target_height","scaleHeightToData","toggleSplitTracks","interpolate","hitarea_width","mouse_event","line","tooltip_timeout","getMouseDisplayAndData","mouse","slope","x_field","y_field","bisect","bisector","datum","startDatum","endDatum","interpolateNumber","x_precision","toPrecision","y_precision","dd","min_arrow_left","max_arrow_left","path","hitarea","hitarea_line","path_class","global_status","decoupled","x_extent","y_extent","x_range","y_range","flip_labels","handle_lines","Boolean","min_x","max_x","flip","dn","dnl","dnx","text_swing","dnlx2","line_swing","label_texts","da","dax","abound","dal","label_lines","db","bbound","collision","separate_labels","seperate_iterations","alpha","again","delta","sign","adjust","new_a_y","new_b_y","min_y","max_y","label_elements","label_line","filtered_data","label_groups","x1","x2","makeLDReference","ref","applyState","ldrefvar","_prepareData","xField","sourceData","sort","ak","bk","av","bv","_generateCategoryBounds","uniqueCategories","item","category","bounds","categoryNames","_setDynamicColorScheme","colorParams","baseParams","parameters_categories_hash","every","colors","color_scale","scale","category10","category20","concat","categoryBounds","_categories","knownCategories","knownColors","xPos","diff","KnownDataSources","sources","findSourceByName","SOURCE_NAME","source","warn","source_name","newObj","params","Function","getAll","setAll","clear","TransformationFunctions","getTrans","fun","parseTrans","parseTransString","result","funs","substring","fn","ceil","toExponential","str","encodeURIComponent","s","functions","input","threshold","prev","curr","nullval","upper_idx","brk","normalized_input","isFinite","Dashboard","hide_timeout","persist","component","Components","shouldPersist","visibility","destroy","force","Component","parent_panel","parent_svg","button","menu","Button","parent_dashboard","tag","setTag","setHtml","setText","setHTML","setTitle","setColor","setStyle","getClass","permanent","setPermanent","bool","setStatus","highlight","disable","setOnMouseover","setOnMouseout","setOnclick","preUpdate","postUpdate","outer_selector","inner_selector","scroll_position","scrollTop","scrollbar_padding","menu_height_padding","page_scroll_top","document","documentElement","container_offset","getContainerOffset","dashboard_client_rect","button_client_rect","menu_client_rect","total_content_height","scrollHeight","base_max_width","container_max_width","content_max_width","base_max_height","max_height","setPopulate","menu_populate_function","div_selector","title_selector","display_width","display_height","generateBase64SVG","base64_string","css_string","stylesheet","styleSheets","fcall","outerHTML","dy","initial_html","style_def","insert_at","btoa","p1","String","fromCharCode","suppress_confirm","confirm","removePanel","is_at_top","y_index","is_at_bottom","panel_ids_by_y_index","can_zoom","current_region_scale","zoom_factor","new_region_scale","menu_html","model","covariates","CovariatesModel","element_reference","updateComponent","removeByIdx","removeAll","table","covariate","row","cov","scale_timeout","status_adj","status_idx","status_verb","at_top","at_bottom","td","removeDataLayer","allowed_fields","fields_whitelist","dataLayer","layer_name","dataLayerLayout","defaultConfig","configSlot","_selected_item","uniqueID","random","menuLayout","renderRow","display_name","display_options","row_id","field_name","defaultName","default_config_display_name","options","Legend","background_rect","elements","elements_group","label_size","line_height","label_x","label_y","path_y","symbolTypes","radius","bcr","right_x","pad_from_right","DataSources","addSource","ns","dsobj","source_id","getSource","removeSource","fromJSON","ds","toJSON","parts","full_name","applyTransformations","Requester","split_requests","requests","raw","trans","outnames","request_handles","when","discrete","Source","enableCache","dependentSource","parseInit","init","getCacheKey","chain","getURL","fetchRequest","getRequest","req","cacheKey","_cachedKey","_cachedResponse","preGetData","pre","resp","parseResponse","normalizeResponse","N","sameLength","records","j","prepareData","annotateData","extractFields","fieldFound","output_record","v","combineChainBody","json","standardized","one_source_body","new_body","parseArraysToObjects","standard","parseObjectsToObjects","parseData","constructorFun","uniqueName","getPrototypeOf","AssociationSource","unshift","analysis","LDSource","findMergeFields","exactMatch","arr","regexes","dataFields","position_field","pvalue","pvalue_field","_names_","names","nameMatch","findRequestedFields","isrefvarin","isrefvarout","ldin","ldout","findExtremeValue","pval","extremeVal","extremeIdx","refSource","ldrefsource","reqFields","refVar","columns","leftJoin","lfield","rfield","position2","tagRefVariant","refvar","idfield","outname","GeneSource","GeneConstraintSource","geneids","substr","Content-Type","constraint_fields","RecombinationRateSource","recombsource","IntervalSource","bedtracksource","StaticSource","_data","PheWASSource","build","ConnectorSource","_source_name_mapping","specified_ids","REQUIRED_SOURCES","chain_source_id","applyPanelYIndexesToPanelLayouts","pid","remap_promises","window_onresize","event_hooks","layout_changed","data_requested","data_rendered","element_clicked","element_selection","state_changed","hook","off","theseHooks","undefined","hookMatch","eventData","sourceID","hookToRun","eventContext","bounding_client_rect","x_offset","scrollLeft","y_offset","offsetParent","offsetTop","offsetLeft","canInteract","loading_data","zooming","initializeLayout","aspect_ratio","sumProportional","total","rescaleSVG","clientRect","panel_layout","addPanel","min-width","min-height","panel_width","panel_height","setOrigin","proportional_origin","clearPanelData","panelId","mode","panelsList","dlid","layer","x_linked_margins","total_proportional_height","proportional_adjustment","calculated_plot_height","mouse_guide_svg","mouse_guide_vertical_svg","mouse_guide_horizontal_svg","vertical","horizontal","selectors","corner_selector","panel_idx","panel_resize_drag","drag","this_panel","original_panel_height","panel_height_change","new_calculated_plot_height","loop_panel_id","loop_panel_idx","loop_panel","corner_drag","dx","plot_page_origin","panel_page_origin","corner_padding","corner_size","mouseout_mouse_guide","mousemove_mouse_guide","coords","mouseup","stopDrag","mousemove","preventDefault","dragged_x","start_x","dragged_y","start_y","linked_panel_ids","client_rect","subscribeToData","success_callback","opts","error_callback","onerror","err","listener","catch","state_changes","all","drop","startDrag","getLinkedPanelIds","overrideAxisLayout","axis_number","y_axis_number","generateID","applyDataLayerZIndexesToDataLayerLayouts","data_promises","y1_scale","y2_scale","y1_extent","y2_extent","x_ticks","y1_ticks","y2_ticks","zoom_timeout","bubble","plot_origin","background_click","y1_linked","y2_linked","panel_count","setMargin","y1_range","y2_range","label_function","data_layer_layout","addDataLayer","clipPath","clearSelections","x_axis_label","y1_axis","y1_axis_label","y2_axis","y2_axis_label","mousedown","ascending","generateExtents","generateTicks","baseTickConfig","combinedTicks","acc","nextLayer","itemConfig","constrain","limit_exponent","neg_min","neg_max","pos_min","pos_max","Infinity","ranges","base_x_range","x_shifted","base_y1_range","y1_shifted","base_y2_range","y2_shifted","anchor","scalar","current_extent_size","current_scaled_extent_size","potential_extent_size","new_extent_size","offset_ratio","new_x_extent_start","y_shifted","linear","domain","renderAxis","zoom_handler","wheelDelta","detail","deltaY","zoom_listener","zoom","canRender","axis_params","label_rotate","ticksAreAllNumbers","orient","tickPadding","tickValues","tickFormat","tick_selector","tick_mouseover","focus","cursor","dh","addBasicLoader","show_immediately","plugin_loading_error"],"mappings":"8qBAAC,SAAUA,EAAMC,GACS,kBAAXC,SAAyBA,OAAOC,IACvCD,QACI,KACA,KACD,SAAUE,EAAIC,GAEb,MAAOL,GAAKM,UAAYL,EAAQG,EAAIC,KAEf,gBAAXE,SAAuBA,OAAOC,QAE5CD,OAAOC,QAAUR,EAAKM,UAAYL,EAAQQ,QAAQ,MAAOA,QAAQ,MAGjET,EAAKM,UAAYL,EAAQD,EAAKI,GAAIJ,EAAKK,IAE7CK,KAAM,SAAUN,EAAIC,GAClB,GAAIM,GAAsB,SAAUC,EAAiBC,GAEjD,GAAIA,GAAmBD,EACnB,OAAO,CAGX,IAAIE,GAAwBF,EAAgBG,MAAM,KAC9CC,EAAwBH,EAAgBE,MAAM,KAC9CE,GAAgB,CAMpB,OALAH,GAAsBI,QAAQ,SAAUC,EAAGC,IAClCH,IAAkBD,EAAsBI,IAAMN,EAAsBM,KACrEH,GAAgB,KAGjBA,EAEX,KAEI,GAAII,GAAqB,OACzB,IAAiB,gBAANjB,GACP,KAAM,yCAEV,KAAKO,EAAoBU,EAAoBjB,EAAGkB,SAC5C,KAAM,2EAA6ED,EAAqB,sBAAwBjB,EAAGkB,QAAU,IAGjJ,IAAgB,kBAALjB,GACP,KAAM,wCCzClB,IAAAC,IACAgB,QAAA,QAYAhB,GAAAiB,SAAA,SAAAC,EAAAC,EAAAC,GACA,GAAA,mBAAAF,GACA,KAAA,yC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0BAAA/Y,QAAA,SAAAc,GACAtB,KAAAoW,YAAA9U,GAAA8b,oBAAAxV,EAAAyV,IACAxR,KAAA7L,QAGAJ,EAAAkX,UAAAiB,SAAAE,MAAAzX,QAAA,SAAAuc,EAAApD,GACA,GAAAqD,GAAApd,EAAAkX,UAAAiB,SAAAC,WAAA2B,GACAsD,EAAA,KAAAF,CAEAnd,GAAAqX,MAAAtJ,UAAAoP,EAAA,qBAAA,SAAA1J,EAAAZ,GAEA,MADAA,GAAA,mBAAAA,MAAAA,EACAzS,KAAAmd,0BAAAH,GAAA,EAAA3J,EAAAZ,IAEA7S,EAAAqX,MAAAtJ,UAAAsP,EAAA,qBAAA,SAAA5J,EAAAZ,GAEA,MADAA,GAAA,mBAAAA,MAAAA,EACAzS,KAAAmd,0BAAAH,GAAA,EAAA3J,EAAAZ,IAGA7S,EAAAqX,MAAAtJ,UAAAoP,EAAA,eAAA,WAEA,MADA/c,MAAAod,oBAAAJ,GAAA,GACAhd,MAEAJ,EAAAqX,MAAAtJ,UAAAsP,EAAA,eAAA,WAEA,MADAjd,MAAAod,oBAAAJ,GAAA,GACAhd,QAeAJ,EAAAqX,MAAAtJ,UAAA0+B,eAAA,SAAAC,GAWA,MAVA,mBAAAA,KAAAA,GAAA,GACAA,GACAtsC,KAAA4M,OAAAtB,KAAA,cAAA6B,UAEAnN,KAAA2L,GAAA,iBAAA,WACA3L,KAAA4M,OAAAtB,KAAA,cAAA6B,WACAtB,KAAA7L,OACAA,KAAA2L,GAAA,gBAAA,WACA3L,KAAA4M,OAAAhB,QACAC,KAAA7L,OACAA,MAzCAJ,MAAAA,GAAA0J,QAAAC,MAAA,2BACAgjC,GAAA,MAAA3sC","file":"locuszoom.app.min.js","sourcesContent":[null,"/**\n * @namespace\n */\nvar LocusZoom = {\n version: \"0.8.0\"\n};\n\n/**\n * Populate a single element with a LocusZoom plot.\n * selector can be a string for a DOM Query or a d3 selector.\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot} The newly created plot instance\n */\nLocusZoom.populate = function(selector, datasource, layout) {\n if (typeof selector == \"undefined\"){\n throw (\"LocusZoom.populate selector not defined\");\n }\n // Empty the selector of any existing content\n d3.select(selector).html(\"\");\n var plot;\n d3.select(selector).call(function(){\n // Require each containing element have an ID. If one isn't present, create one.\n if (typeof this.node().id == \"undefined\"){\n var iterator = 0;\n while (!d3.select(\"#lz-\" + iterator).empty()){ iterator++; }\n this.attr(\"id\", \"#lz-\" + iterator);\n }\n // Create the plot\n plot = new LocusZoom.Plot(this.node().id, datasource, layout);\n plot.container = this.node();\n // Detect data-region and fill in state values if present\n if (typeof this.node().dataset !== \"undefined\" && typeof this.node().dataset.region !== \"undefined\"){\n var parsed_state = LocusZoom.parsePositionQuery(this.node().dataset.region);\n Object.keys(parsed_state).forEach(function(key){\n plot.state[key] = parsed_state[key];\n });\n }\n // Add an SVG to the div and set its dimensions\n plot.svg = d3.select(\"div#\" + plot.id)\n .append(\"svg\")\n .attr(\"version\", \"1.1\")\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .attr(\"id\", plot.id + \"_svg\").attr(\"class\", \"lz-locuszoom\")\n .style(plot.layout.style);\n plot.setDimensions();\n plot.positionPanels();\n // Initialize the plot\n plot.initialize();\n // If the plot has defined data sources then trigger its first mapping based on state values\n if (typeof datasource == \"object\" && Object.keys(datasource).length){\n plot.refresh();\n }\n });\n return plot;\n};\n\n/**\n * Populate arbitrarily many elements each with a LocusZoom plot\n * using a common datasource and layout\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot[]}\n */\nLocusZoom.populateAll = function(selector, datasource, layout) {\n var plots = [];\n d3.selectAll(selector).each(function(d,i) {\n plots[i] = LocusZoom.populate(this, datasource, layout);\n });\n return plots;\n};\n\n/**\n * Convert an integer chromosome position to an SI string representation (e.g. 23423456 => \"23.42\" (Mb))\n * @param {Number} pos Position\n * @param {String} [exp] Exponent to use for the returned string, eg 6=> MB. If not specified, will attempt to guess\n * the most appropriate SI prefix based on the number provided.\n * @param {Boolean} [suffix=false] Whether or not to append a suffix (e.g. \"Mb\") to the end of the returned string\n * @returns {string}\n */\nLocusZoom.positionIntToString = function(pos, exp, suffix){\n var exp_symbols = { 0: \"\", 3: \"K\", 6: \"M\", 9: \"G\" };\n suffix = suffix || false;\n if (isNaN(exp) || exp === null){\n var log = Math.log(pos) / Math.LN10;\n exp = Math.min(Math.max(log - (log % 3), 0), 9);\n }\n var places_exp = exp - Math.floor((Math.log(pos) / Math.LN10).toFixed(exp + 3));\n var min_exp = Math.min(Math.max(exp, 0), 2);\n var places = Math.min(Math.max(places_exp, min_exp), 12);\n var ret = \"\" + (pos / Math.pow(10, exp)).toFixed(places);\n if (suffix && typeof exp_symbols[exp] !== \"undefined\"){\n ret += \" \" + exp_symbols[exp] + \"b\";\n }\n return ret;\n};\n\n/**\n * Convert an SI string chromosome position to an integer representation (e.g. \"5.8 Mb\" => 58000000)\n * @param {String} p The chromosome position\n * @returns {Number}\n */\nLocusZoom.positionStringToInt = function(p) {\n var val = p.toUpperCase();\n val = val.replace(/,/g, \"\");\n var suffixre = /([KMG])[B]*$/;\n var suffix = suffixre.exec(val);\n var mult = 1;\n if (suffix) {\n if (suffix[1]===\"M\") {\n mult = 1e6;\n } else if (suffix[1]===\"G\") {\n mult = 1e9;\n } else {\n mult = 1e3; //K\n }\n val = val.replace(suffixre,\"\");\n }\n val = Number(val) * mult;\n return val;\n};\n\n/**\n * Parse region queries into their constituent parts\n * TODO: handle genes (or send off to API)\n * @param {String} x A chromosome position query. May be any of the forms `chr:start-end`, `chr:center+offset`,\n * or `chr:pos`\n * @returns {{chr:*, start: *, end:*} | {chr:*, position:*}}\n */\nLocusZoom.parsePositionQuery = function(x) {\n var chrposoff = /^(\\w+):([\\d,.]+[kmgbKMGB]*)([-+])([\\d,.]+[kmgbKMGB]*)$/;\n var chrpos = /^(\\w+):([\\d,.]+[kmgbKMGB]*)$/;\n var match = chrposoff.exec(x);\n if (match) {\n if (match[3] === \"+\") {\n var center = LocusZoom.positionStringToInt(match[2]);\n var offset = LocusZoom.positionStringToInt(match[4]);\n return {\n chr:match[1],\n start: center - offset,\n end: center + offset\n };\n } else {\n return {\n chr: match[1],\n start: LocusZoom.positionStringToInt(match[2]),\n end: LocusZoom.positionStringToInt(match[4])\n };\n }\n }\n match = chrpos.exec(x);\n if (match) {\n return {\n chr:match[1],\n position: LocusZoom.positionStringToInt(match[2])\n };\n }\n return null;\n};\n\n/**\n * Generate a \"pretty\" set of ticks (multiples of 1, 2, or 5 on the same order of magnitude for the range)\n * Based on R's \"pretty\" function: https://github.com/wch/r-source/blob/b156e3a711967f58131e23c1b1dc1ea90e2f0c43/src/appl/pretty.c\n * @param {Number[]} range A two-item array specifying [low, high] values for the axis range\n * @param {('low'|'high'|'both'|'neither')} [clip_range='neither'] What to do if first and last generated ticks extend\n * beyond the range. Set this to \"low\", \"high\", \"both\", or \"neither\" to clip the first (low) or last (high) tick to\n * be inside the range or allow them to extend beyond.\n * e.g. \"low\" will clip the first (low) tick if it extends beyond the low end of the range but allow the\n * last (high) tick to extend beyond the range. \"both\" clips both ends, \"neither\" allows both to extend beyond.\n * @param {Number} [target_tick_count=5] The approximate number of ticks you would like to be returned; may not be exact\n * @returns {Number[]}\n */\nLocusZoom.prettyTicks = function(range, clip_range, target_tick_count){\n if (typeof target_tick_count == \"undefined\" || isNaN(parseInt(target_tick_count))){\n target_tick_count = 5;\n }\n target_tick_count = parseInt(target_tick_count);\n \n var min_n = target_tick_count / 3;\n var shrink_sml = 0.75;\n var high_u_bias = 1.5;\n var u5_bias = 0.5 + 1.5 * high_u_bias;\n \n var d = Math.abs(range[0] - range[1]);\n var c = d / target_tick_count;\n if ((Math.log(d) / Math.LN10) < -2){\n c = (Math.max(Math.abs(d)) * shrink_sml) / min_n;\n }\n \n var base = Math.pow(10, Math.floor(Math.log(c)/Math.LN10));\n var base_toFixed = 0;\n if (base < 1 && base !== 0){\n base_toFixed = Math.abs(Math.round(Math.log(base)/Math.LN10));\n }\n \n var unit = base;\n if ( ((2 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 2 * base;\n if ( ((5 * base) - c) < (u5_bias * (c - unit)) ){\n unit = 5 * base;\n if ( ((10 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 10 * base;\n }\n }\n }\n \n var ticks = [];\n var i = parseFloat( (Math.floor(range[0]/unit)*unit).toFixed(base_toFixed) );\n while (i < range[1]){\n ticks.push(i);\n i += unit;\n if (base_toFixed > 0){\n i = parseFloat(i.toFixed(base_toFixed));\n }\n }\n ticks.push(i);\n \n if (typeof clip_range == \"undefined\" || [\"low\", \"high\", \"both\", \"neither\"].indexOf(clip_range) === -1){\n clip_range = \"neither\";\n }\n if (clip_range === \"low\" || clip_range === \"both\"){\n if (ticks[0] < range[0]){ ticks = ticks.slice(1); }\n }\n if (clip_range === \"high\" || clip_range === \"both\"){\n if (ticks[ticks.length-1] > range[1]){ ticks.pop(); }\n }\n \n return ticks;\n};\n\n/**\n * Make an AJAX request and return a promise.\n * From http://www.html5rocks.com/en/tutorials/cors/\n * and with promises from https://gist.github.com/kriskowal/593076\n *\n * @param {String} method The HTTP verb\n * @param {String} url\n * @param {String} body The request body to send to the server\n * @param {Object} headers Object of custom request headers\n * @param {Number} [timeout] If provided, wait this long (in ms) before timing out\n * @returns {Promise}\n */\nLocusZoom.createCORSPromise = function (method, url, body, headers, timeout) {\n var response = Q.defer();\n var xhr = new XMLHttpRequest();\n if (\"withCredentials\" in xhr) {\n // Check if the XMLHttpRequest object has a \"withCredentials\" property.\n // \"withCredentials\" only exists on XMLHTTPRequest2 objects.\n xhr.open(method, url, true);\n } else if (typeof XDomainRequest != \"undefined\") {\n // Otherwise, check if XDomainRequest.\n // XDomainRequest only exists in IE, and is IE's way of making CORS requests.\n xhr = new XDomainRequest();\n xhr.open(method, url);\n } else {\n // Otherwise, CORS is not supported by the browser.\n xhr = null;\n }\n if (xhr) {\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200 || xhr.status === 0 ) {\n response.resolve(xhr.response);\n } else {\n response.reject(\"HTTP \" + xhr.status + \" for \" + url);\n }\n }\n };\n timeout && setTimeout(response.reject, timeout);\n body = typeof body !== \"undefined\" ? body : \"\";\n if (typeof headers !== \"undefined\"){\n for (var header in headers){\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n // Send the request\n xhr.send(body);\n } \n return response.promise;\n};\n\n/**\n * Validate a (presumed complete) plot state object against internal rules for consistency, and ensure the plot fits\n * within any constraints imposed by the layout.\n * @param {Object} new_state\n * @param {Number} new_state.start\n * @param {Number} new_state.end\n * @param {Object} layout\n * @returns {*|{}}\n */\nLocusZoom.validateState = function(new_state, layout){\n\n new_state = new_state || {};\n layout = layout || {};\n\n // If a \"chr\", \"start\", and \"end\" are present then resolve start and end\n // to numeric values that are not decimal, negative, or flipped\n var validated_region = false;\n if (typeof new_state.chr != \"undefined\" && typeof new_state.start != \"undefined\" && typeof new_state.end != \"undefined\"){\n // Determine a numeric scale and midpoint for the attempted region,\n var attempted_midpoint = null; var attempted_scale;\n new_state.start = Math.max(parseInt(new_state.start), 1);\n new_state.end = Math.max(parseInt(new_state.end), 1);\n if (isNaN(new_state.start) && isNaN(new_state.end)){\n new_state.start = 1;\n new_state.end = 1;\n attempted_midpoint = 0.5;\n attempted_scale = 0;\n } else if (isNaN(new_state.start) || isNaN(new_state.end)){\n attempted_midpoint = new_state.start || new_state.end;\n attempted_scale = 0;\n new_state.start = (isNaN(new_state.start) ? new_state.end : new_state.start);\n new_state.end = (isNaN(new_state.end) ? new_state.start : new_state.end);\n } else {\n attempted_midpoint = Math.round((new_state.start + new_state.end) / 2);\n attempted_scale = new_state.end - new_state.start;\n if (attempted_scale < 0){\n var temp = new_state.start;\n new_state.end = new_state.start;\n new_state.start = temp;\n attempted_scale = new_state.end - new_state.start;\n }\n if (attempted_midpoint < 0){\n new_state.start = 1;\n new_state.end = 1;\n attempted_scale = 0;\n }\n }\n validated_region = true;\n }\n\n // Constrain w/r/t layout-defined minimum region scale\n if (!isNaN(layout.min_region_scale) && validated_region && attempted_scale < layout.min_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.min_region_scale / 2), 1);\n new_state.end = new_state.start + layout.min_region_scale;\n }\n\n // Constrain w/r/t layout-defined maximum region scale\n if (!isNaN(layout.max_region_scale) && validated_region && attempted_scale > layout.max_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.max_region_scale / 2), 1);\n new_state.end = new_state.start + layout.max_region_scale;\n }\n\n return new_state;\n};\n\n//\n/**\n * Replace placeholders in an html string with field values defined in a data object\n * Only works on scalar values! Will ignore non-scalars.\n *\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @param {Object} data\n * @param {String} html A placeholder string in which to substitute fields. Supports several template options:\n * `{{field_name}}` is a variable placeholder for the value of `field_name` from the provided data\n * `{{#if {{field_name}} }} Conditional text {{/if}} will insert the contents of the tag only if the value exists.\n * Since this is only an existence check, **variables with a value of 0 will be evaluated as true**.\n * @returns {string}\n */\nLocusZoom.parseFields = function (data, html) {\n if (typeof data != \"object\"){\n throw (\"LocusZoom.parseFields invalid arguments: data is not an object\");\n }\n if (typeof html != \"string\"){\n throw (\"LocusZoom.parseFields invalid arguments: html is not a string\");\n }\n // `tokens` is like [token,...]\n // `token` is like {text: '...'} or {variable: 'foo|bar'} or {condition: 'foo|bar'} or {close: 'if'}\n var tokens = [];\n var regex = /\\{\\{(?:(#if )?([A-Za-z0-9_:|]+)|(\\/if))\\}\\}/;\n while (html.length > 0){\n var m = regex.exec(html);\n if (!m) { tokens.push({text: html}); html = \"\"; }\n else if (m.index !== 0) { tokens.push({text: html.slice(0, m.index)}); html = html.slice(m.index); }\n else if (m[1] === \"#if \") { tokens.push({condition: m[2]}); html = html.slice(m[0].length); }\n else if (m[2]) { tokens.push({variable: m[2]}); html = html.slice(m[0].length); }\n else if (m[3] === \"/if\") { tokens.push({close: \"if\"}); html = html.slice(m[0].length); }\n else {\n console.error(\"Error tokenizing tooltip when remaining template is \" + JSON.stringify(html) +\n \" and previous tokens are \" + JSON.stringify(tokens) +\n \" and current regex match is \" + JSON.stringify([m[1], m[2], m[3]]));\n html=html.slice(m[0].length);\n }\n }\n var astify = function() {\n var token = tokens.shift();\n if (typeof token.text !== \"undefined\" || token.variable) {\n return token;\n } else if (token.condition) {\n token.then = [];\n while(tokens.length > 0) {\n if (tokens[0].close === \"if\") { tokens.shift(); break; }\n token.then.push(astify());\n }\n return token;\n } else {\n console.error(\"Error making tooltip AST due to unknown token \" + JSON.stringify(token));\n return { text: \"\" };\n }\n };\n // `ast` is like [thing,...]\n // `thing` is like {text: \"...\"} or {variable:\"foo|bar\"} or {condition: \"foo|bar\", then:[thing,...]}\n var ast = [];\n while (tokens.length > 0) ast.push(astify());\n\n var resolve = function(variable) {\n if (!resolve.cache.hasOwnProperty(variable)) {\n resolve.cache[variable] = (new LocusZoom.Data.Field(variable)).resolve(data);\n }\n return resolve.cache[variable];\n };\n resolve.cache = {};\n var render_node = function(node) {\n if (typeof node.text !== \"undefined\") {\n return node.text;\n } else if (node.variable) {\n try {\n var value = resolve(node.variable);\n if ([\"string\",\"number\",\"boolean\"].indexOf(typeof value) !== -1) { return value; }\n if (value === null) { return \"\"; }\n } catch (error) { console.error(\"Error while processing variable \" + JSON.stringify(node.variable)); }\n return \"{{\" + node.variable + \"}}\";\n } else if (node.condition) {\n try {\n var condition = resolve(node.condition);\n if (condition || condition === 0) {\n return node.then.map(render_node).join(\"\");\n }\n } catch (error) { console.error(\"Error while processing condition \" + JSON.stringify(node.variable)); }\n return \"\";\n } else { console.error(\"Error rendering tooltip due to unknown AST node \" + JSON.stringify(node)); }\n };\n return ast.map(render_node).join(\"\");\n};\n\n/**\n * Shortcut method for getting the data bound to a tool tip.\n * @param {Element} node\n * @returns {*} The first element of data bound to the tooltip\n */\nLocusZoom.getToolTipData = function(node){\n if (typeof node != \"object\" || typeof node.parentNode == \"undefined\"){\n throw(\"Invalid node object\");\n }\n // If this node is a locuszoom tool tip then return its data\n var selector = d3.select(node);\n if (selector.classed(\"lz-data_layer-tooltip\") && typeof selector.data()[0] != \"undefined\"){\n return selector.data()[0];\n } else {\n return LocusZoom.getToolTipData(node.parentNode);\n }\n};\n\n/**\n * Shortcut method for getting a reference to the data layer that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.getToolTipDataLayer = function(node){\n var data = LocusZoom.getToolTipData(node);\n if (data.getDataLayer){ return data.getDataLayer(); }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the panel that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.getToolTipPanel = function(node){\n var data_layer = LocusZoom.getToolTipDataLayer(node);\n if (data_layer){ return data_layer.parent; }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the plot that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.getToolTipPlot = function(node){\n var panel = LocusZoom.getToolTipPanel(node);\n if (panel){ return panel.parent; }\n return null;\n};\n\n/**\n * Generate a curtain object for a plot, panel, or any other subdivision of a layout\n * The panel curtain, like the plot curtain is an HTML overlay that obscures the entire panel. It can be styled\n * arbitrarily and display arbitrary messages. It is useful for reporting error messages visually to an end user\n * when the error renders the panel unusable.\n * TODO: Improve type doc here\n * @returns {object}\n */\nLocusZoom.generateCurtain = function(){\n var curtain = {\n showing: false,\n selector: null,\n content_selector: null,\n hide_delay: null,\n\n /**\n * Generate the curtain. Any content (string) argument passed will be displayed in the curtain as raw HTML.\n * CSS (object) can be passed which will apply styles to the curtain and its content.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n show: function(content, css){\n if (!this.curtain.showing){\n this.curtain.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-curtain\").attr(\"id\", this.id + \".curtain\");\n this.curtain.content_selector = this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-content\");\n this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-dismiss\").html(\"Dismiss\")\n .on(\"click\", function(){\n this.curtain.hide();\n }.bind(this));\n this.curtain.showing = true;\n }\n return this.curtain.update(content, css);\n }.bind(this),\n\n /**\n * Update the content and css of the curtain that's currently being shown. This method also adjusts the size\n * and positioning of the curtain to ensure it still covers the entire panel with no overlap.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n update: function(content, css){\n if (!this.curtain.showing){ return this.curtain; }\n clearTimeout(this.curtain.hide_delay);\n // Apply CSS if provided\n if (typeof css == \"object\"){\n this.curtain.selector.style(css);\n }\n // Update size and position\n var page_origin = this.getPageOrigin();\n this.curtain.selector.style({\n top: page_origin.y + \"px\",\n left: page_origin.x + \"px\",\n width: this.layout.width + \"px\",\n height: this.layout.height + \"px\"\n });\n this.curtain.content_selector.style({\n \"max-width\": (this.layout.width - 40) + \"px\",\n \"max-height\": (this.layout.height - 40) + \"px\"\n });\n // Apply content if provided\n if (typeof content == \"string\"){\n this.curtain.content_selector.html(content);\n }\n return this.curtain;\n }.bind(this),\n\n /**\n * Remove the curtain\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.curtain.showing){ return this.curtain; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.curtain.hide_delay);\n this.curtain.hide_delay = setTimeout(this.curtain.hide, delay);\n return this.curtain;\n }\n // Remove curtain\n this.curtain.selector.remove();\n this.curtain.selector = null;\n this.curtain.content_selector = null;\n this.curtain.showing = false;\n return this.curtain;\n }.bind(this)\n };\n return curtain;\n};\n\n/**\n * Generate a loader object for a plot, panel, or any other subdivision of a layout\n *\n * The panel loader is a small HTML overlay that appears in the lower left corner of the panel. It cannot be styled\n * arbitrarily, but can show a custom message and show a minimalist loading bar that can be updated to specific\n * completion percentages or be animated.\n * TODO Improve type documentation\n * @returns {object}\n */\nLocusZoom.generateLoader = function(){\n var loader = {\n showing: false,\n selector: null,\n content_selector: null,\n progress_selector: null,\n cancel_selector: null,\n\n /**\n * Show a loading indicator\n * @param {string} [content='Loading...'] Loading message (displayed as raw HTML)\n */\n show: function(content){\n // Generate loader\n if (!this.loader.showing){\n this.loader.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-loader\").attr(\"id\", this.id + \".loader\");\n this.loader.content_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-content\");\n this.loader.progress_selector = this.loader.selector\n .append(\"div\").attr(\"class\", \"lz-loader-progress-container\")\n .append(\"div\").attr(\"class\", \"lz-loader-progress\");\n /* TODO: figure out how to make this cancel button work\n this.loader.cancel_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-cancel\").html(\"Cancel\")\n .on(\"click\", function(){\n this.loader.hide();\n }.bind(this));\n */\n this.loader.showing = true;\n if (typeof content == \"undefined\"){ content = \"Loading...\"; }\n }\n return this.loader.update(content);\n }.bind(this),\n\n /**\n * Update the currently displayed loader and ensure the new content is positioned correctly.\n * @param {string} content The text to display (as raw HTML). If not a string, will be ignored.\n * @param {number} [percent] A number from 1-100. If a value is specified, it will stop all animations\n * in progress.\n */\n update: function(content, percent){\n if (!this.loader.showing){ return this.loader; }\n clearTimeout(this.loader.hide_delay);\n // Apply content if provided\n if (typeof content == \"string\"){\n this.loader.content_selector.html(content);\n }\n // Update size and position\n var padding = 6; // is there a better place to store/define this?\n var page_origin = this.getPageOrigin();\n var loader_boundrect = this.loader.selector.node().getBoundingClientRect();\n this.loader.selector.style({\n top: (page_origin.y + this.layout.height - loader_boundrect.height - padding) + \"px\",\n left: (page_origin.x + padding) + \"px\"\n });\n /* Uncomment this code when a functional cancel button can be shown\n var cancel_boundrect = this.loader.cancel_selector.node().getBoundingClientRect();\n this.loader.content_selector.style({\n \"padding-right\": (cancel_boundrect.width + padding) + \"px\"\n });\n */\n // Apply percent if provided\n if (typeof percent == \"number\"){\n this.loader.progress_selector.style({\n width: (Math.min(Math.max(percent, 1), 100)) + \"%\"\n });\n }\n return this.loader;\n }.bind(this),\n\n /**\n * Adds a class to the loading bar that makes it loop infinitely in a loading animation. Useful when exact\n * percent progress is not available.\n */\n animate: function(){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", true);\n return this.loader;\n }.bind(this),\n\n /**\n * Sets the loading bar in the loader to percentage width equal to the percent (number) value passed. Percents\n * will automatically be limited to a range of 1 to 100. Will stop all animations in progress.\n */\n setPercentCompleted: function(percent){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", false);\n return this.loader.update(null, percent);\n }.bind(this),\n\n /**\n * Remove the loader\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.loader.showing){ return this.loader; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.loader.hide_delay);\n this.loader.hide_delay = setTimeout(this.loader.hide, delay);\n return this.loader;\n }\n // Remove loader\n this.loader.selector.remove();\n this.loader.selector = null;\n this.loader.content_selector = null;\n this.loader.progress_selector = null;\n this.loader.cancel_selector = null;\n this.loader.showing = false;\n return this.loader;\n }.bind(this)\n };\n return loader;\n};\n\n/**\n * Create a new subclass following classical inheritance patterns. Some registry singletons use this internally to\n * enable code reuse and customization of known LZ core functionality.\n *\n * @param {Function} parent A parent class constructor that will be extended by the child class\n * @param {Object} extra An object of additional properties and methods to add/override behavior for the child class.\n * The special \"constructor\" property can be used to specify a custom constructor, or it will call parent by default.\n * Implementer must manage super calls when overriding the constructor.\n * @returns {Function} The constructor for the new child class\n */\nLocusZoom.subclass = function(parent, extra) {\n if (typeof parent !== \"function\" ) {\n throw \"Parent must be a callable constructor\";\n }\n\n extra = extra || {};\n var Sub = extra.hasOwnProperty(\"constructor\") ? extra.constructor : function() {\n parent.apply(this, arguments);\n };\n\n Sub.prototype = Object.create(parent.prototype);\n Object.keys(extra).forEach(function(k) {\n Sub.prototype[k] = extra[k];\n });\n return Sub;\n};\n\n\n/**\n * LocusZoom optional extensions will live under this namespace.\n *\n * Extension code is not part of the core LocusZoom app.js bundle.\n * @namespace\n * @public\n */\nLocusZoom.ext = {};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * Manage known layouts for all parts of the LocusZoom plot\n *\n * This registry allows for layouts to be reused and customized many times on a page, using a common base pattern.\n * It handles the work of ensuring that each new instance of the layout has no shared state with other copies.\n *\n * @class\n */\nLocusZoom.Layouts = (function() {\n var obj = {};\n var layouts = {\n \"plot\": {},\n \"panel\": {},\n \"data_layer\": {},\n \"dashboard\": {},\n \"tooltip\": {}\n };\n\n /**\n * Generate a layout configuration object\n * @param {('plot'|'panel'|'data_layer'|'dashboard'|'tooltip')} type The type of layout to retrieve\n * @param {string} name Identifier of the predefined layout within the specified type\n * @param {object} [modifications] Custom properties that override default settings for this layout\n * @returns {object} A JSON-serializable object representation\n */\n obj.get = function(type, name, modifications) {\n if (typeof type != \"string\" || typeof name != \"string\") {\n throw(\"invalid arguments passed to LocusZoom.Layouts.get, requires string (layout type) and string (layout name)\");\n } else if (layouts[type][name]) {\n // Get the base layout\n var layout = LocusZoom.Layouts.merge(modifications || {}, layouts[type][name]);\n // If \"unnamespaced\" is true then strike that from the layout and return the layout without namespacing\n if (layout.unnamespaced){\n delete layout.unnamespaced;\n return JSON.parse(JSON.stringify(layout));\n }\n // Determine the default namespace for namespaced values\n var default_namespace = \"\";\n if (typeof layout.namespace == \"string\"){\n default_namespace = layout.namespace;\n } else if (typeof layout.namespace == \"object\" && Object.keys(layout.namespace).length){\n if (typeof layout.namespace.default != \"undefined\"){\n default_namespace = layout.namespace.default;\n } else {\n default_namespace = layout.namespace[Object.keys(layout.namespace)[0]].toString();\n }\n }\n default_namespace += default_namespace.length ? \":\" : \"\";\n // Apply namespaces to layout, recursively\n var applyNamespaces = function(element, namespace){\n if (namespace){\n if (typeof namespace == \"string\"){\n namespace = { default: namespace }; \n }\n } else {\n namespace = { default: \"\" };\n }\n if (typeof element == \"string\"){\n var re = /\\{\\{namespace(\\[[A-Za-z_0-9]+\\]|)\\}\\}/g;\n var match, base, key, resolved_namespace;\n var replace = [];\n while ((match = re.exec(element)) !== null){\n base = match[0];\n key = match[1].length ? match[1].replace(/(\\[|\\])/g,\"\") : null;\n resolved_namespace = default_namespace;\n if (namespace != null && typeof namespace == \"object\" && typeof namespace[key] != \"undefined\"){\n resolved_namespace = namespace[key] + (namespace[key].length ? \":\" : \"\");\n }\n replace.push({ base: base, namespace: resolved_namespace });\n }\n for (var r in replace){\n element = element.replace(replace[r].base, replace[r].namespace);\n }\n } else if (typeof element == \"object\" && element != null){\n if (typeof element.namespace != \"undefined\"){\n var merge_namespace = (typeof element.namespace == \"string\") ? { default: element.namespace } : element.namespace;\n namespace = LocusZoom.Layouts.merge(namespace, merge_namespace);\n }\n var namespaced_element, namespaced_property;\n for (var property in element) {\n if (property === \"namespace\"){ continue; }\n namespaced_element = applyNamespaces(element[property], namespace);\n namespaced_property = applyNamespaces(property, namespace);\n if (property !== namespaced_property){\n delete element[property];\n }\n element[namespaced_property] = namespaced_element;\n }\n }\n return element;\n };\n layout = applyNamespaces(layout, layout.namespace);\n // Return the layout as valid JSON only\n return JSON.parse(JSON.stringify(layout));\n } else {\n throw(\"layout type [\" + type + \"] name [\" + name + \"] not found\");\n }\n };\n\n /** @private */\n obj.set = function(type, name, layout) {\n if (typeof type != \"string\" || typeof name != \"string\" || typeof layout != \"object\"){\n throw (\"unable to set new layout; bad arguments passed to set()\");\n }\n if (!layouts[type]){\n layouts[type] = {};\n }\n if (layout){\n return (layouts[type][name] = JSON.parse(JSON.stringify(layout)));\n } else {\n delete layouts[type][name];\n return null;\n }\n };\n\n /**\n * Register a new layout definition by name.\n *\n * @param {string} type The type of layout to add. Usually, this will be one of the predefined LocusZoom types,\n * but if you pass a different name, this method will automatically create the new `type` bucket\n * @param {string} name The identifier of the newly added layout\n * @param {object} [layout] A JSON-serializable object containing configuration properties for this layout\n * @returns The JSON representation of the newly created layout\n */\n obj.add = function(type, name, layout) {\n return obj.set(type, name, layout);\n };\n\n /**\n * List all registered layouts\n * @param [type] Optionally narrow the list to only layouts of a specific type; else return all known layouts\n * @returns {*}\n */\n obj.list = function(type) {\n if (!layouts[type]){\n var list = {};\n Object.keys(layouts).forEach(function(type){\n list[type] = Object.keys(layouts[type]);\n });\n return list;\n } else {\n return Object.keys(layouts[type]);\n }\n };\n\n /**\n * A helper method used for merging two objects. If a key is present in both, takes the value from the first object\n * Values from `default_layout` will be cleanly copied over, ensuring no references or shared state.\n *\n * Frequently used for preparing custom layouts. Both objects should be JSON-serializable.\n *\n * @param {object} custom_layout An object containing configuration parameters that override or add to defaults\n * @param {object} default_layout An object containing default settings.\n * @returns The custom layout is modified in place and also returned from this method.\n */\n obj.merge = function (custom_layout, default_layout) {\n if (typeof custom_layout !== \"object\" || typeof default_layout !== \"object\"){\n throw(\"LocusZoom.Layouts.merge only accepts two layout objects; \" + (typeof custom_layout) + \", \" + (typeof default_layout) + \" given\");\n }\n for (var property in default_layout) {\n if (!default_layout.hasOwnProperty(property)){ continue; }\n // Get types for comparison. Treat nulls in the custom layout as undefined for simplicity.\n // (javascript treats nulls as \"object\" when we just want to overwrite them as if they're undefined)\n // Also separate arrays from objects as a discrete type.\n var custom_type = custom_layout[property] === null ? \"undefined\" : typeof custom_layout[property];\n var default_type = typeof default_layout[property];\n if (custom_type === \"object\" && Array.isArray(custom_layout[property])){ custom_type = \"array\"; }\n if (default_type === \"object\" && Array.isArray(default_layout[property])){ default_type = \"array\"; }\n // Unsupported property types: throw an exception\n if (custom_type === \"function\" || default_type === \"function\"){\n throw(\"LocusZoom.Layouts.merge encountered an unsupported property type\");\n }\n // Undefined custom value: pull the default value\n if (custom_type === \"undefined\"){\n custom_layout[property] = JSON.parse(JSON.stringify(default_layout[property]));\n continue;\n }\n // Both values are objects: merge recursively\n if (custom_type === \"object\" && default_type === \"object\"){\n custom_layout[property] = LocusZoom.Layouts.merge(custom_layout[property], default_layout[property]);\n continue;\n }\n }\n return custom_layout;\n };\n\n return obj;\n})();\n\n\n/**\n * Tooltip Layouts\n * @namespace LocusZoom.Layouts.tooltips\n */\n\n// TODO: Improve documentation of predefined types within layout namespaces\nLocusZoom.Layouts.add(\"tooltip\", \"standard_association\", {\n namespace: { \"assoc\": \"assoc\" },\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[assoc]}}variant}}
      \"\n + \"P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
      \"\n + \"Ref. Allele: {{{{namespace[assoc]}}ref_allele}}
      \"\n + \"Make LD Reference
      \"\n});\n\nvar covariates_model_association = LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true });\ncovariates_model_association.html += \"Condition on Variant
      \";\nLocusZoom.Layouts.add(\"tooltip\", \"covariates_model_association\", covariates_model_association);\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_genes\", {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"

      {{gene_name}}

      \"\n + \"
      Gene ID: {{gene_id}}
      \"\n + \"
      Transcript ID: {{transcript_id}}
      \"\n + \"
      \"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"
      ConstraintExpected variantsObserved variantsConst. Metric
      Synonymous{{exp_syn}}{{n_syn}}z = {{syn_z}}
      Missense{{exp_mis}}{{n_mis}}z = {{mis_z}}
      LoF{{exp_lof}}{{n_lof}}pLI = {{pLI}}
      \"\n + \"More data on ExAC\"\n});\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n closable: false,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[intervals]}}state_name}}
      {{{{namespace[intervals]}}start}}-{{{{namespace[intervals]}}end}}\"\n});\n\n/**\n * Data Layer Layouts: represent specific information from a data source\n * @namespace Layouts.data_layer\n*/\n\nLocusZoom.Layouts.add(\"data_layer\", \"significance\", {\n id: \"significance\",\n type: \"orthogonal_line\",\n orientation: \"horizontal\",\n offset: 4.522\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"recomb_rate\", {\n namespace: { \"recomb\": \"recomb\" },\n id: \"recombrate\",\n type: \"line\",\n fields: [\"{{namespace[recomb]}}position\", \"{{namespace[recomb]}}recomb_rate\"],\n z_index: 1,\n style: {\n \"stroke\": \"#0000FF\",\n \"stroke-width\": \"1.5px\"\n },\n x_axis: {\n field: \"{{namespace[recomb]}}position\"\n },\n y_axis: {\n axis: 2,\n field: \"{{namespace[recomb]}}recomb_rate\",\n floor: 0,\n ceiling: 100\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"association_pvalues\", {\n namespace: { \"assoc\": \"assoc\", \"ld\": \"ld\" },\n id: \"associationpvalues\",\n type: \"scatter\",\n point_shape: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"diamond\",\n else: \"circle\"\n }\n },\n point_size: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: 80,\n else: 40\n }\n },\n color: [\n {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"#9632b8\"\n }\n },\n {\n scale_function: \"numerical_bin\",\n field: \"{{namespace[ld]}}state\",\n parameters: {\n breaks: [0, 0.2, 0.4, 0.6, 0.8],\n values: [\"#357ebd\",\"#46b8da\",\"#5cb85c\",\"#eea236\",\"#d43f3a\"]\n }\n },\n \"#B8B8B8\"\n ],\n legend: [\n { shape: \"diamond\", color: \"#9632b8\", size: 40, label: \"LD Ref Var\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#d43f3a\", size: 40, label: \"1.0 > r² ≥ 0.8\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#eea236\", size: 40, label: \"0.8 > r² ≥ 0.6\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#5cb85c\", size: 40, label: \"0.6 > r² ≥ 0.4\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#46b8da\", size: 40, label: \"0.4 > r² ≥ 0.2\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#357ebd\", size: 40, label: \"0.2 > r² ≥ 0.0\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#B8B8B8\", size: 40, label: \"no r² data\", class: \"lz-data_layer-scatter\" }\n ],\n fields: [\"{{namespace[assoc]}}variant\", \"{{namespace[assoc]}}position\", \"{{namespace[assoc]}}log_pvalue\", \"{{namespace[assoc]}}log_pvalue|logtoscinotation\", \"{{namespace[assoc]}}ref_allele\", \"{{namespace[ld]}}state\", \"{{namespace[ld]}}isrefvar\"],\n id_field: \"{{namespace[assoc]}}variant\",\n z_index: 2,\n x_axis: {\n field: \"{{namespace[assoc]}}position\"\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[assoc]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.10,\n min_extent: [ 0, 10 ]\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"phewas_pvalues\", {\n namespace: {\"phewas\": \"phewas\"},\n id: \"phewaspvalues\",\n type: \"category_scatter\",\n point_shape: \"circle\",\n point_size: 70,\n tooltip_positioning: \"vertical\",\n id_field: \"{{namespace[phewas]}}id\",\n fields: [\"{{namespace[phewas]}}id\", \"{{namespace[phewas]}}log_pvalue\", \"{{namespace[phewas]}}trait_group\", \"{{namespace[phewas]}}trait_label\"],\n x_axis: {\n field: \"{{namespace[phewas]}}x\", // Synthetic/derived field added by `category_scatter` layer\n category_field: \"{{namespace[phewas]}}trait_group\",\n lower_buffer: 0.025,\n upper_buffer: 0.025\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[phewas]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.15\n },\n color: {\n field: \"{{namespace[phewas]}}trait_group\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [],\n values: [],\n null_value: \"#B8B8B8\"\n }\n },\n fill_opacity: 0.7,\n tooltip: {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: [\n \"Trait: {{{{namespace[phewas]}}trait_label|htmlescape}}
      \",\n \"Trait Category: {{{{namespace[phewas]}}trait_group|htmlescape}}
      \",\n \"P-value: {{{{namespace[phewas]}}log_pvalue|logtoscinotation|htmlescape}}
      \"\n ].join(\"\")\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n label: {\n text: \"{{{{namespace[phewas]}}trait_label}}\",\n spacing: 6,\n lines: {\n style: {\n \"stroke-width\": \"2px\",\n \"stroke\": \"#333333\",\n \"stroke-dasharray\": \"2px 2px\"\n }\n },\n filters: [\n {\n field: \"{{namespace[phewas]}}log_pvalue\",\n operator: \">=\",\n value: 20\n }\n ],\n style: {\n \"font-size\": \"14px\",\n \"font-weight\": \"bold\",\n \"fill\": \"#333333\"\n }\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genes\", {\n namespace: { \"gene\": \"gene\", \"constraint\": \"constraint\" },\n id: \"genes\",\n type: \"genes\",\n fields: [\"{{namespace[gene]}}all\", \"{{namespace[constraint]}}all\"],\n id_field: \"gene_id\",\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_genes\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genome_legend\", {\n namespace: { \"genome\": \"genome\" },\n id: \"genome_legend\",\n type: \"genome_legend\",\n fields: [\"{{namespace[genome]}}chr\", \"{{namespace[genome]}}base_pairs\"],\n x_axis: {\n floor: 0,\n ceiling: 2881033286\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n id: \"intervals\",\n type: \"intervals\",\n fields: [\"{{namespace[intervals]}}start\",\"{{namespace[intervals]}}end\",\"{{namespace[intervals]}}state_id\",\"{{namespace[intervals]}}state_name\"],\n id_field: \"{{namespace[intervals]}}start\",\n start_field: \"{{namespace[intervals]}}start\",\n end_field: \"{{namespace[intervals]}}end\",\n track_split_field: \"{{namespace[intervals]}}state_id\",\n split_tracks: true,\n always_hide_legend: false,\n color: {\n field: \"{{namespace[intervals]}}state_id\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [1,2,3,4,5,6,7,8,9,10,11,12,13],\n values: [\"rgb(212,63,58)\", \"rgb(250,120,105)\", \"rgb(252,168,139)\", \"rgb(240,189,66)\", \"rgb(250,224,105)\", \"rgb(240,238,84)\", \"rgb(244,252,23)\", \"rgb(23,232,252)\", \"rgb(32,191,17)\", \"rgb(23,166,77)\", \"rgb(32,191,17)\", \"rgb(162,133,166)\", \"rgb(212,212,212)\"],\n null_value: \"#B8B8B8\"\n }\n },\n legend: [\n { shape: \"rect\", color: \"rgb(212,63,58)\", width: 9, label: \"Active Promoter\", \"{{namespace[intervals]}}state_id\": 1 },\n { shape: \"rect\", color: \"rgb(250,120,105)\", width: 9, label: \"Weak Promoter\", \"{{namespace[intervals]}}state_id\": 2 },\n { shape: \"rect\", color: \"rgb(252,168,139)\", width: 9, label: \"Poised Promoter\", \"{{namespace[intervals]}}state_id\": 3 },\n { shape: \"rect\", color: \"rgb(240,189,66)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 4 },\n { shape: \"rect\", color: \"rgb(250,224,105)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 5 },\n { shape: \"rect\", color: \"rgb(240,238,84)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 6 },\n { shape: \"rect\", color: \"rgb(244,252,23)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 7 },\n { shape: \"rect\", color: \"rgb(23,232,252)\", width: 9, label: \"Insulator\", \"{{namespace[intervals]}}state_id\": 8 },\n { shape: \"rect\", color: \"rgb(32,191,17)\", width: 9, label: \"Transcriptional transition\", \"{{namespace[intervals]}}state_id\": 9 },\n { shape: \"rect\", color: \"rgb(23,166,77)\", width: 9, label: \"Transcriptional elongation\", \"{{namespace[intervals]}}state_id\": 10 },\n { shape: \"rect\", color: \"rgb(136,240,129)\", width: 9, label: \"Weak transcribed\", \"{{namespace[intervals]}}state_id\": 11 },\n { shape: \"rect\", color: \"rgb(162,133,166)\", width: 9, label: \"Polycomb-repressed\", \"{{namespace[intervals]}}state_id\": 12 },\n { shape: \"rect\", color: \"rgb(212,212,212)\", width: 9, label: \"Heterochromatin / low signal\", \"{{namespace[intervals]}}state_id\": 13 }\n ],\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_intervals\", { unnamespaced: true })\n});\n\n/**\n * Dashboard Layouts: toolbar buttons etc\n * @namespace Layouts.dashboard\n */\nLocusZoom.Layouts.add(\"dashboard\", \"standard_panel\", {\n components: [\n {\n type: \"remove_panel\",\n position: \"right\",\n color: \"red\",\n group_position: \"end\"\n },\n {\n type: \"move_panel_up\",\n position: \"right\",\n group_position: \"middle\"\n },\n {\n type: \"move_panel_down\",\n position: \"right\",\n group_position: \"start\",\n style: { \"margin-left\": \"0.75em\" }\n }\n ]\n}); \n\nLocusZoom.Layouts.add(\"dashboard\", \"standard_plot\", {\n components: [\n {\n type: \"title\",\n title: \"LocusZoom\",\n subtitle: \"v\" + LocusZoom.version + \"\",\n position: \"left\"\n },\n {\n type: \"dimensions\",\n position: \"right\"\n },\n {\n type: \"region_scale\",\n position: \"right\"\n },\n {\n type: \"download\",\n position: \"right\"\n }\n ]\n});\n\nvar covariates_model_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\ncovariates_model_plot_dashboard.components.push({\n type: \"covariates_model\",\n button_html: \"Model\",\n button_title: \"Show and edit covariates currently in model\",\n position: \"left\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"covariates_model_plot\", covariates_model_plot_dashboard);\n\nvar region_nav_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 500000,\n button_html: \">>\",\n position: \"right\",\n group_position: \"end\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 50000,\n button_html: \">\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: 0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: -0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -50000,\n button_html: \"<\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -500000,\n button_html: \"<<\",\n position: \"right\",\n group_position: \"start\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"region_nav_plot\", region_nav_plot_dashboard);\n\n/**\n * Panel Layouts\n * @namespace Layouts.panel\n */\n\nLocusZoom.Layouts.add(\"panel\", \"association\", {\n id: \"association\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 200,\n proportional_width: 1,\n margin: { top: 35, right: 50, bottom: 40, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_legend\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n },\n y2: {\n label: \"Recombination Rate (cM/Mb)\",\n label_offset: 40\n }\n },\n legend: {\n orientation: \"vertical\",\n origin: { x: 55, y: 40 },\n hidden: true\n },\n interaction: {\n drag_background_to_pan: true,\n drag_x_ticks_to_scale: true,\n drag_y1_ticks_to_scale: true,\n drag_y2_ticks_to_scale: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"recomb_rate\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"association_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genes\", {\n id: \"genes\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 112.5,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 20, left: 50 },\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"resize_to_data\",\n position: \"right\"\n });\n return l;\n })(), \n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genes\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"phewas\", {\n id: \"phewas\",\n width: 800,\n height: 300,\n min_width: 800,\n min_height: 300,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 120, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n axes: {\n x: {\n ticks: { // Object based config (shared defaults; allow layers to specify ticks)\n style: {\n \"font-weight\": \"bold\",\n \"font-size\": \"11px\",\n \"text-anchor\": \"start\"\n },\n transform: \"rotate(50)\",\n position: \"left\" // Special param recognized by `category_scatter` layers\n }\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"phewas_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genome_legend\", {\n id: \"genome_legend\",\n width: 800,\n height: 50,\n origin: { x: 0, y: 300 },\n min_width: 800,\n min_height: 50,\n proportional_width: 1,\n margin: { top: 0, right: 50, bottom: 35, left: 50 },\n axes: {\n x: {\n label: \"Genomic Position (number denotes chromosome)\",\n label_offset: 35,\n ticks: [\n {\n x: 124625310,\n text: \"1\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 370850307,\n text: \"2\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 591461209,\n text: \"3\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 786049562,\n text: \"4\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 972084330,\n text: \"5\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1148099493,\n text: \"6\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1313226358,\n text: \"7\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1465977701,\n text: \"8\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1609766427,\n text: \"9\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1748140516,\n text: \"10\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1883411148,\n text: \"11\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2017840353,\n text: \"12\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2142351240,\n text: \"13\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2253610949,\n text: \"14\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2358551415,\n text: \"15\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2454994487,\n text: \"16\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2540769469,\n text: \"17\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2620405698,\n text: \"18\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2689008813,\n text: \"19\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2750086065,\n text: \"20\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2805663772,\n text: \"21\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2855381003,\n text: \"22\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n }\n ]\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genome_legend\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"intervals\", {\n id: \"intervals\",\n width: 1000,\n height: 50,\n min_width: 500,\n min_height: 50,\n margin: { top: 25, right: 150, bottom: 5, left: 50 },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_split_tracks\",\n data_layer_id: \"intervals\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n legend: {\n hidden: true,\n orientation: \"horizontal\",\n origin: { x: 50, y: 0 },\n pad_from_bottom: 5\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"intervals\", { unnamespaced: true })\n ]\n});\n\n\n/**\n * Plot Layouts\n * @namespace Layouts.plot\n */\n\nLocusZoom.Layouts.add(\"plot\", \"standard_association\", {\n state: {},\n width: 800,\n height: 450,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, proportional_height: 0.5 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, proportional_height: 0.5 })\n ]\n});\n\n// Shortcut to \"StandardLayout\" for backward compatibility\nLocusZoom.StandardLayout = LocusZoom.Layouts.get(\"plot\", \"standard_association\");\n\nLocusZoom.Layouts.add(\"plot\", \"standard_phewas\", {\n width: 800,\n height: 600,\n min_width: 800,\n min_height: 600,\n responsive_resize: true,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true } ),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"phewas\", { unnamespaced: true, proportional_height: 0.45 }),\n LocusZoom.Layouts.get(\"panel\", \"genome_legend\", { unnamespaced: true, proportional_height: 0.1 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", {\n unnamespaced: true, proportional_height: 0.45,\n margin: { bottom: 40 },\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n }\n }\n })\n ],\n mouse_guide: false\n});\n\nLocusZoom.Layouts.add(\"plot\", \"interval_association\", {\n state: {},\n width: 800,\n height: 550,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, width: 800, proportional_height: (225/570) }),\n LocusZoom.Layouts.get(\"panel\", \"intervals\", { unnamespaced: true, proportional_height: (120/570) }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, width: 800, proportional_height: (225/570) })\n ]\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A data layer is an abstract class representing a data set and its graphical representation within a panel\n * @public\n * @class\n * @param {Object} layout A JSON-serializable object describing the layout for this layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n*/\nLocusZoom.DataLayer = function(layout, parent) {\n /** @member {Boolean} */\n this.initialized = false;\n /** @member {Number} */\n this.layout_idx = null;\n\n /** @member {String} */\n this.id = null;\n /** @member {LocusZoom.Panel} */\n this.parent = parent || null;\n /**\n * @member {{group: d3.selection, container: d3.selection, clipRect: d3.selection}}\n */\n this.svg = {};\n\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n if (typeof parent != \"undefined\" && parent instanceof LocusZoom.Panel){ this.parent_plot = parent.parent; }\n\n /** @member {Object} */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.DataLayer.DefaultLayout);\n if (this.layout.id){ this.id = this.layout.id; }\n\n // Ensure any axes defined in the layout have an explicit axis number (default: 1)\n if (this.layout.x_axis !== {} && typeof this.layout.x_axis.axis !== \"number\"){ this.layout.x_axis.axis = 1; }\n if (this.layout.y_axis !== {} && typeof this.layout.y_axis.axis !== \"number\"){ this.layout.y_axis.axis = 1; }\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original data layer state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n /** @member {Object} */\n this.state = {};\n /** @member {String} */\n this.state_id = null;\n\n this.setDefaultState();\n\n // Initialize parameters for storing data and tool tips\n /** @member {Array} */\n this.data = [];\n if (this.layout.tooltip){\n /** @member {Object} */\n this.tooltips = {};\n }\n\n // Initialize flags for tracking global statuses\n this.global_statuses = {\n \"highlighted\": false,\n \"selected\": false,\n \"faded\": false,\n \"hidden\": false\n };\n \n return this;\n\n};\n\n/**\n * Instruct this datalayer to begin tracking additional fields from data sources (does not guarantee that such a field actually exists)\n *\n * Custom plots can use this to dynamically extend datalayer functionality after the plot is drawn\n *\n * (since removing core fields may break layer functionality, there is presently no hook for the inverse behavior)\n * @param fieldName\n * @param namespace\n * @param {String|String[]} transformations The name (or array of names) of transformations to apply to this field\n * @returns {String} The raw string added to the fields array\n */\nLocusZoom.DataLayer.prototype.addField = function(fieldName, namespace, transformations) {\n if (!fieldName || !namespace) {\n throw \"Must specify field name and namespace to use when adding field\";\n }\n var fieldString = namespace + \":\" + fieldName;\n if (transformations) {\n fieldString += \"|\";\n if (typeof transformations === \"string\") {\n fieldString += transformations;\n } else if (Array.isArray(transformations)) {\n fieldString += transformations.join(\"|\");\n } else {\n throw \"Must provide transformations as either a string or array of strings\";\n }\n }\n var fields = this.layout.fields;\n if (fields.indexOf(fieldString) === -1) {\n fields.push(fieldString);\n }\n return fieldString;\n};\n\n/**\n * Define default state that should get tracked during the lifetime of this layer.\n *\n * In some special custom usages, it may be useful to completely reset a panel (eg \"click for\n * genome region\" links), plotting new data that invalidates any previously tracked state. This hook makes it\n * possible to reset without destroying the panel entirely. It is used by `Plot.clearPanelData`.\n */\nLocusZoom.DataLayer.prototype.setDefaultState = function() {\n // Define state parameters specific to this data layer. Within plot state, this will live under a key\n // `panel_name.layer_name`.\n if (this.parent){\n this.state = this.parent.state;\n this.state_id = this.parent.id + \".\" + this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n this.state[this.state_id][status] = this.state[this.state_id][status] || [];\n }.bind(this));\n }\n};\n\n/**\n * A basic description of keys expected in a layout. Not intended to be directly used or modified by an end user.\n * @protected\n * @type {{type: string, fields: Array, x_axis: {}, y_axis: {}}}\n */\nLocusZoom.DataLayer.DefaultLayout = {\n type: \"\",\n fields: [],\n x_axis: {},\n y_axis: {}\n};\n\n/**\n * Available statuses that individual elements can have. Each status is described by\n * a verb/antiverb and an adjective. Verbs and antiverbs are used to generate data layer\n * methods for updating the status on one or more elements. Adjectives are used in class\n * names and applied or removed from elements to have a visual representation of the status,\n * as well as used as keys in the state for tracking which elements are in which status(es)\n * @static\n * @type {{verbs: String[], adjectives: String[], menu_antiverbs: String[]}}\n */\nLocusZoom.DataLayer.Statuses = {\n verbs: [\"highlight\", \"select\", \"fade\", \"hide\"],\n adjectives: [\"highlighted\", \"selected\", \"faded\", \"hidden\"],\n menu_antiverbs: [\"unhighlight\", \"deselect\", \"unfade\", \"show\"]\n};\n\n/**\n * Get the fully qualified identifier for the data layer, prefixed by any parent or container elements\n *\n * @returns {string} A dot-delimited string of the format ..\n */\nLocusZoom.DataLayer.prototype.getBaseId = function(){\n return this.parent_plot.id + \".\" + this.parent.id + \".\" + this.id;\n};\n\n/**\n * Determine the pixel height of data-bound objects represented inside this data layer. (excluding elements such as axes)\n *\n * May be used by operations that resize the data layer to fit available data\n *\n * @public\n * @returns {number}\n */\nLocusZoom.DataLayer.prototype.getAbsoluteDataHeight = function(){\n var dataBCR = this.svg.group.node().getBoundingClientRect();\n return dataBCR.height;\n};\n\n/**\n * Whether transitions can be applied to this data layer\n * @returns {boolean}\n */\nLocusZoom.DataLayer.prototype.canTransition = function(){\n if (!this.layout.transition){ return false; }\n return !(this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.panel_id);\n};\n\n/**\n * Fetch the fully qualified ID to be associated with a specific visual element, based on the data to which that\n * element is bound. In general this element ID will be unique, allowing it to be addressed directly via selectors.\n * @param {String|Object} element\n * @returns {String}\n */\nLocusZoom.DataLayer.prototype.getElementId = function(element){\n var element_id = \"element\";\n if (typeof element == \"string\"){\n element_id = element;\n } else if (typeof element == \"object\"){\n var id_field = this.layout.id_field || \"id\";\n if (typeof element[id_field] == \"undefined\"){\n throw(\"Unable to generate element ID\");\n }\n element_id = element[id_field].toString().replace(/\\W/g,\"\");\n }\n return (this.getBaseId() + \"-\" + element_id).replace(/(:|\\.|\\[|\\]|,)/g, \"_\");\n};\n\n/**\n * Fetch an ID that may bind a data element to a separate visual node for displaying status\n * Examples of this might be seperate visual nodes to show select/highlight statuses, or\n * even a common/shared node to show status across many elements in a set.\n * Abstract method. It should be overridden by data layers that implement seperate status\n * nodes specifically to the use case of the data layer type.\n * @param {String|Object} element\n * @returns {String|null}\n */\nLocusZoom.DataLayer.prototype.getElementStatusNodeId = function(element){\n return null;\n};\n\n/**\n * Returns a reference to the underlying data associated with a single visual element in the data layer, as\n * referenced by the unique identifier for the element\n\n * @param {String} id The unique identifier for the element, as defined by `getElementId`\n * @returns {Object|null} The data bound to that element\n */\nLocusZoom.DataLayer.prototype.getElementById = function(id){\n var selector = d3.select(\"#\" + id.replace(/(:|\\.|\\[|\\]|,)/g, \"\\\\$1\"));\n if (!selector.empty() && selector.data() && selector.data().length){\n return selector.data()[0];\n } else {\n return null;\n }\n};\n\n/**\n * Basic method to apply arbitrary methods and properties to data elements.\n * This is called on all data immediately after being fetched.\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyDataMethods = function(){\n this.data.forEach(function(d, i){\n // Basic toHTML() method - return the stringified value in the id_field, if defined.\n this.data[i].toHTML = function(){\n var id_field = this.layout.id_field || \"id\";\n var html = \"\";\n if (this.data[i][id_field]){ html = this.data[i][id_field].toString(); }\n return html;\n }.bind(this);\n // getDataLayer() method - return a reference to the data layer\n this.data[i].getDataLayer = function(){\n return this;\n }.bind(this);\n // deselect() method - shortcut method to deselect the element\n this.data[i].deselect = function(){\n var data_layer = this.getDataLayer();\n data_layer.unselectElement(this);\n };\n }.bind(this));\n this.applyCustomDataMethods();\n return this;\n};\n\n/**\n * Hook that allows custom datalayers to apply additional methods and properties to data elements as needed\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyCustomDataMethods = function(){\n return this;\n};\n\n/**\n * Initialize a data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.initialize = function(){\n\n // Append a container group element to house the main data layer group element and the clip path\n this.svg.container = this.parent.svg.group.append(\"g\")\n .attr(\"class\", \"lz-data_layer-container\")\n .attr(\"id\", this.getBaseId() + \".data_layer_container\");\n \n // Append clip path to the container element\n this.svg.clipRect = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\")\n .append(\"rect\");\n \n // Append svg group for rendering all data layer elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".data_layer\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n return this;\n\n};\n\n/**\n * Move a data layer up relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveUp = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Move a data layer down relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveDown = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Apply scaling functions to an element or parameter as needed, based on its layout and the element's data\n * If the layout parameter is already a primitive type, simply return the value as given\n * @param {Array|Number|String|Object} layout\n * @param {*} data The value to be used with the filter\n * @returns {*} The transformed value\n */\nLocusZoom.DataLayer.prototype.resolveScalableParameter = function(layout, data){\n var ret = null;\n if (Array.isArray(layout)){\n var idx = 0;\n while (ret === null && idx < layout.length){\n ret = this.resolveScalableParameter(layout[idx], data);\n idx++;\n }\n } else {\n switch (typeof layout){\n case \"number\":\n case \"string\":\n ret = layout;\n break;\n case \"object\":\n if (layout.scale_function){\n if(layout.field) {\n var f = new LocusZoom.Data.Field(layout.field);\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, f.resolve(data));\n } else {\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, data);\n }\n }\n break;\n }\n }\n return ret;\n};\n\n/**\n * Generate dimension extent function based on layout parameters\n * @param {('x'|'y')} dimension\n */\nLocusZoom.DataLayer.prototype.getAxisExtent = function(dimension){\n\n if ([\"x\", \"y\"].indexOf(dimension) === -1){\n throw(\"Invalid dimension identifier passed to LocusZoom.DataLayer.getAxisExtent()\");\n }\n\n var axis_name = dimension + \"_axis\";\n var axis_layout = this.layout[axis_name];\n\n // If a floor AND a ceiling are explicitly defined then just return that extent and be done\n if (!isNaN(axis_layout.floor) && !isNaN(axis_layout.ceiling)){\n return [+axis_layout.floor, +axis_layout.ceiling];\n }\n\n // If a field is defined for the axis and the data layer has data then generate the extent from the data set\n var data_extent = [];\n if (axis_layout.field && this.data) {\n if (!this.data.length) {\n // If data has been fetched (but no points in region), enforce the min_extent (with no buffers,\n // because we don't need padding around an empty screen)\n data_extent = axis_layout.min_extent || [];\n return data_extent;\n } else {\n data_extent = d3.extent(this.data, function (d) {\n var f = new LocusZoom.Data.Field(axis_layout.field);\n return +f.resolve(d);\n });\n\n // Apply upper/lower buffers, if applicable\n var original_extent_span = data_extent[1] - data_extent[0];\n if (!isNaN(axis_layout.lower_buffer)) {\n data_extent[0] -= original_extent_span * axis_layout.lower_buffer;\n }\n if (!isNaN(axis_layout.upper_buffer)) {\n data_extent[1] += original_extent_span * axis_layout.upper_buffer;\n }\n\n if (typeof axis_layout.min_extent == \"object\") {\n // The data should span at least the range specified by min_extent, an array with [low, high]\n var range_min = axis_layout.min_extent[0];\n var range_max = axis_layout.min_extent[1];\n if (!isNaN(range_min) && !isNaN(range_max)) {\n data_extent[0] = Math.min(data_extent[0], range_min);\n }\n if (!isNaN(range_max)) {\n data_extent[1] = Math.max(data_extent[1], range_max);\n }\n }\n // If specified, floor and ceiling will override the actual data range\n return [\n isNaN(axis_layout.floor) ? data_extent[0] : axis_layout.floor,\n isNaN(axis_layout.ceiling) ? data_extent[1] : axis_layout.ceiling\n ];\n }\n }\n\n // If this is for the x axis and no extent could be generated yet but state has a defined start and end\n // then default to using the state-defined region as the extent\n if (dimension === \"x\" && !isNaN(this.state.start) && !isNaN(this.state.end)) {\n return [this.state.start, this.state.end];\n }\n\n // No conditions met for generating a valid extent, return an empty array\n return [];\n\n};\n\n/**\n * Allow this data layer to tell the panel what axis ticks it thinks it will require. The panel may choose whether\n * to use some, all, or none of these when rendering, either alone or in conjunction with other data layers.\n *\n * This method is a stub and should be overridden in data layers that need to specify custom behavior.\n *\n * @param {('x'|'y')} dimension\n * @param {Object} [config] Additional parameters for the panel to specify how it wants ticks to be drawn. The names\n * and meanings of these parameters may vary between different data layers.\n * @returns {Object[]}\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.DataLayer.prototype.getTicks = function (dimension, config) {\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw(\"Invalid dimension identifier\");\n }\n return [];\n};\n\n/**\n * Generate a tool tip for a given element\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.createTooltip = function(d, id){\n if (typeof this.layout.tooltip != \"object\"){\n throw (\"DataLayer [\" + this.id + \"] layout does not define a tooltip\");\n }\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n if (this.tooltips[id]){\n this.positionTooltip(id);\n return;\n }\n this.tooltips[id] = {\n data: d,\n arrow: null,\n selector: d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-data_layer-tooltip\")\n .attr(\"id\", id + \"-tooltip\")\n };\n this.updateTooltip(d);\n return this;\n};\n\n/**\n * Update a tool tip (generate its inner HTML)\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.updateTooltip = function(d, id){\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n // Empty the tooltip of all HTML (including its arrow!)\n this.tooltips[id].selector.html(\"\");\n this.tooltips[id].arrow = null;\n // Set the new HTML\n if (this.layout.tooltip.html){\n this.tooltips[id].selector.html(LocusZoom.parseFields(d, this.layout.tooltip.html));\n }\n // If the layout allows tool tips on this data layer to be closable then add the close button\n // and add padding to the tooltip to accommodate it\n if (this.layout.tooltip.closable){\n this.tooltips[id].selector.insert(\"button\", \":first-child\")\n .attr(\"class\", \"lz-tooltip-close-button\")\n .attr(\"title\", \"Close\")\n .text(\"×\")\n .on(\"click\", function(){\n this.destroyTooltip(id);\n }.bind(this));\n }\n // Apply data directly to the tool tip for easier retrieval by custom UI elements inside the tool tip\n this.tooltips[id].selector.data([d]);\n // Reposition and draw a new arrow\n this.positionTooltip(id);\n return this;\n};\n\n/**\n * Destroy tool tip - remove the tool tip element from the DOM and delete the tool tip's record on the data layer\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyTooltip = function(d, id){\n if (typeof d == \"string\"){\n id = d;\n } else if (typeof id == \"undefined\"){\n id = this.getElementId(d);\n }\n if (this.tooltips[id]){\n if (typeof this.tooltips[id].selector == \"object\"){\n this.tooltips[id].selector.remove();\n }\n delete this.tooltips[id];\n }\n return this;\n};\n\n/**\n * Loop through and destroy all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyAllTooltips = function(){\n for (var id in this.tooltips){\n this.destroyTooltip(id);\n }\n return this;\n};\n\n//\n/**\n * Position tool tip - naïve function to place a tool tip to the lower right of the current mouse element\n * Most data layers reimplement this method to position tool tips specifically for the data they display\n * @param {String} id The identifier of the tooltip to position\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n // Position the div itself\n this.tooltips[id].selector\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY) + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!this.tooltips[id].arrow){\n this.tooltips[id].arrow = this.tooltips[id].selector.append(\"div\")\n .style(\"position\", \"absolute\")\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_top_left\");\n }\n this.tooltips[id].arrow\n .style(\"left\", \"-1px\")\n .style(\"top\", \"-1px\");\n return this;\n};\n\n/**\n * Loop through and position all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionAllTooltips = function(){\n for (var id in this.tooltips){\n this.positionTooltip(id);\n }\n return this;\n};\n\n/**\n * Show or hide a tool tip by ID depending on directives in the layout and state values relative to the ID\n * @param {String|Object} element The element associated with the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.showOrHideTooltip = function(element){\n \n if (typeof this.layout.tooltip != \"object\"){ return; }\n var id = this.getElementId(element);\n\n var resolveStatus = function(statuses, directive, operator){\n var status = null;\n if (typeof statuses != \"object\" || statuses === null){ return null; }\n if (Array.isArray(directive)){\n if (typeof operator == \"undefined\"){ operator = \"and\"; }\n if (directive.length === 1){\n status = statuses[directive[0]];\n } else {\n status = directive.reduce(function(previousValue, currentValue) {\n if (operator === \"and\"){\n return statuses[previousValue] && statuses[currentValue];\n } else if (operator === \"or\"){\n return statuses[previousValue] || statuses[currentValue];\n }\n return null;\n });\n }\n } else if (typeof directive == \"object\"){\n var sub_status;\n for (var sub_operator in directive){\n sub_status = resolveStatus(statuses, directive[sub_operator], sub_operator);\n if (status === null){\n status = sub_status;\n } else if (operator === \"and\"){\n status = status && sub_status;\n } else if (operator === \"or\"){\n status = status || sub_status;\n }\n }\n }\n return status;\n };\n\n var show_directive = {};\n if (typeof this.layout.tooltip.show == \"string\"){\n show_directive = { and: [ this.layout.tooltip.show ] };\n } else if (typeof this.layout.tooltip.show == \"object\"){\n show_directive = this.layout.tooltip.show;\n }\n\n var hide_directive = {};\n if (typeof this.layout.tooltip.hide == \"string\"){\n hide_directive = { and: [ this.layout.tooltip.hide ] };\n } else if (typeof this.layout.tooltip.hide == \"object\"){\n hide_directive = this.layout.tooltip.hide;\n }\n\n var statuses = {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n var antistatus = \"un\" + status;\n statuses[status] = this.state[this.state_id][status].indexOf(id) !== -1;\n statuses[antistatus] = !statuses[status];\n }.bind(this));\n\n var show_resolved = resolveStatus(statuses, show_directive);\n var hide_resolved = resolveStatus(statuses, hide_directive);\n\n // Only show tooltip if the resolved logic explicitly shows and explicitly not hides the tool tip\n // Otherwise ensure tooltip does not exist\n if (show_resolved && !hide_resolved){\n this.createTooltip(element);\n } else {\n this.destroyTooltip(element);\n }\n\n return this;\n \n};\n\n/**\n * Find the elements (or indices) that match any of a set of provided filters\n * @protected\n * @param {Array[]} filters A list of filter entries: [field, value] (for equivalence testing) or\n * [field, operator, value] for other operators\n * @param {('indexes'|'elements')} [return_type='indexes'] Specify whether to return either the indices of the matching\n * elements, or references to the elements themselves\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filter = function(filters, return_type){\n if (typeof return_type == \"undefined\" || [\"indexes\",\"elements\"].indexOf(return_type) === -1){\n return_type = \"indexes\";\n }\n if (!Array.isArray(filters)){ return []; }\n var test = function(element, filter){\n var operators = {\n \"=\": function(a,b){ return a === b; },\n \"<\": function(a,b){ return a < b; },\n \"<=\": function(a,b){ return a <= b; },\n \">\": function(a,b){ return a > b; },\n \">=\": function(a,b){ return a >= b; },\n \"%\": function(a,b){ return a % b; }\n };\n if (!Array.isArray(filter)){ return false; }\n if (filter.length === 2){\n return element[filter[0]] === filter[1];\n } else if (filter.length === 3 && operators[filter[1]]){\n return operators[filter[1]](element[filter[0]], filter[2]);\n } else {\n return false;\n }\n };\n var matches = [];\n this.data.forEach(function(element, idx){\n var match = true;\n filters.forEach(function(filter){\n if (!test(element, filter)){ match = false; }\n });\n if (match){ matches.push(return_type === \"indexes\" ? idx : element); }\n });\n return matches;\n};\n\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterIndexes = function(filters){ return this.filter(filters, \"indexes\"); };\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterElements = function(filters){ return this.filter(filters, \"elements\"); };\n\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset a single element's status\n // TODO: Improve documentation for dynamically generated methods/properties\n LocusZoom.DataLayer.prototype[verb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, true, exclusive);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, false, exclusive);\n return this;\n };\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.DataLayer.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.DataLayer.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.DataLayer.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n/**\n * Toggle a status (e.g. highlighted, selected, identified) on an element\n * @param {String} status The name of a recognized status to be added/removed on an appropriate element\n * @param {String|Object} element The data bound to the element of interest\n * @param {Boolean} toggle True to add the status (and associated CSS styles); false to remove it\n * @param {Boolean} exclusive Whether to only allow a state for a single element at a time\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatus = function(status, element, toggle, exclusive){\n // Sanity checks\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatus()\");\n }\n if (typeof element == \"undefined\"){\n throw(\"Invalid element passed to DataLayer.setElementStatus()\");\n }\n if (typeof toggle == \"undefined\"){\n toggle = true;\n }\n\n // Get an ID for the element or return having changed nothing\n try {\n var element_id = this.getElementId(element);\n } catch (get_element_id_error){\n return this;\n }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Set/unset the proper status class on the appropriate DOM element(s)\n d3.select(\"#\" + element_id).classed(\"lz-data_layer-\" + this.layout.type + \"-\" + status, toggle);\n var element_status_node_id = this.getElementStatusNodeId(element);\n if (element_status_node_id !== null){\n d3.select(\"#\" + element_status_node_id).classed(\"lz-data_layer-\" + this.layout.type + \"-statusnode-\" + status, toggle);\n }\n \n // Track element ID in the proper status state array\n var element_status_idx = this.state[this.state_id][status].indexOf(element_id);\n if (toggle && element_status_idx === -1){\n this.state[this.state_id][status].push(element_id);\n }\n if (!toggle && element_status_idx !== -1){\n this.state[this.state_id][status].splice(element_status_idx, 1);\n }\n \n // Trigger tool tip show/hide logic\n this.showOrHideTooltip(element);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n if (status === \"selected\") {\n // Notify parents that a given element has been interacted with. For now, we will only notify on\n // \"selected\" type events, which is (usually) a toggle-able state. If elements are exclusive, two selection\n // events will be sent in short order as the previously selected element has to be de-selected first\n this.parent.emit(\"element_selection\", { element: element, active: toggle }, true);\n }\n return this;\n \n};\n\n/**\n * Toggle a status on elements in the data layer based on a set of filters\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatusByFilters()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; } else { toggle = !!toggle; }\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n if (!Array.isArray(filters)){ filters = []; }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Apply statuses\n this.filterElements(filters).forEach(function(element){\n this.setElementStatus(status, element, toggle);\n }.bind(this));\n \n return this;\n};\n\n/**\n * Toggle a status on all elements in the data layer\n * @param {String} status\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setAllElementStatus = function(status, toggle){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Apply statuses\n if (toggle){\n this.data.forEach(function(element){\n this.setElementStatus(status, element, true);\n }.bind(this));\n } else {\n var status_ids = this.state[this.state_id][status].slice();\n status_ids.forEach(function(id){\n var element = this.getElementById(id);\n if (typeof element == \"object\" && element !== null){\n this.setElementStatus(status, element, false);\n }\n }.bind(this));\n this.state[this.state_id][status] = [];\n }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n return this;\n};\n\n/**\n * Apply all layout-defined behaviors (DOM event handlers) to a selection of elements\n * @param {d3.selection} selection\n */\nLocusZoom.DataLayer.prototype.applyBehaviors = function(selection){\n if (typeof this.layout.behaviors != \"object\"){ return; }\n Object.keys(this.layout.behaviors).forEach(function(directive){\n var event_match = /(click|mouseover|mouseout)/.exec(directive);\n if (!event_match){ return; }\n selection.on(event_match[0] + \".\" + directive, this.executeBehaviors(directive, this.layout.behaviors[directive]));\n }.bind(this));\n};\n\n/**\n * Generate a function that executes an arbitrary list of behaviors on an element during an event\n * @param {String} directive The name of the event, as described in layout.behaviors for this datalayer\n * @param {Object} behaviors An object describing the behavior to attach to this single element\n * @param {string} behaviors.action The name of the action that would trigger this behavior (eg click, mouseover, etc)\n * @param {string} behaviors.status What status to apply to the element when this behavior is triggered (highlighted,\n * selected, etc)\n * @param {string} [behaviors.exclusive] Whether triggering the event for this element should unset the relevant status\n * for all other elements. Useful for, eg, click events that exclusively highlight one thing.\n * @returns {function(this:LocusZoom.DataLayer)} Return a function that handles the event in context with the behavior\n * and the element- can be attached as an event listener\n */\nLocusZoom.DataLayer.prototype.executeBehaviors = function(directive, behaviors) {\n\n // Determine the required state of control and shift keys during the event\n var requiredKeyStates = {\n \"ctrl\": (directive.indexOf(\"ctrl\") !== -1),\n \"shift\": (directive.indexOf(\"shift\") !== -1)\n };\n\n return function(element){\n\n // Do nothing if the required control and shift key presses (or lack thereof) doesn't match the event\n if (requiredKeyStates.ctrl !== !!d3.event.ctrlKey || requiredKeyStates.shift !== !!d3.event.shiftKey){ return; }\n\n // Loop through behaviors making each one go in succession\n behaviors.forEach(function(behavior){\n \n // Route first by the action, if defined\n if (typeof behavior != \"object\" || behavior === null){ return; }\n \n switch (behavior.action){\n \n // Set a status (set to true regardless of current status, optionally with exclusivity)\n case \"set\":\n this.setElementStatus(behavior.status, element, true, behavior.exclusive);\n break;\n \n // Unset a status (set to false regardless of current status, optionally with exclusivity)\n case \"unset\":\n this.setElementStatus(behavior.status, element, false, behavior.exclusive);\n break;\n \n // Toggle a status\n case \"toggle\":\n var current_status_boolean = (this.state[this.state_id][behavior.status].indexOf(this.getElementId(element)) !== -1);\n var exclusive = behavior.exclusive && !current_status_boolean;\n this.setElementStatus(behavior.status, element, !current_status_boolean, exclusive);\n break;\n \n // Link to a dynamic URL\n case \"link\":\n if (typeof behavior.href == \"string\"){\n var url = LocusZoom.parseFields(element, behavior.href);\n if (typeof behavior.target == \"string\"){\n window.open(url, behavior.target);\n } else {\n window.location.href = url;\n }\n }\n break;\n \n // Action not defined, just return\n default:\n break;\n \n }\n \n return;\n \n }.bind(this));\n\n }.bind(this);\n\n};\n\n/**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\nLocusZoom.DataLayer.prototype.getPageOrigin = function(){\n var panel_origin = this.parent.getPageOrigin();\n return {\n x: panel_origin.x + this.parent.layout.margin.left,\n y: panel_origin.y + this.parent.layout.margin.top\n };\n};\n\n/**\n * Get a data layer's current underlying data in a standard format (e.g. JSON or CSV)\n * @param {('csv'|'tsv'|'json')} format How to export the data\n * @returns {*}\n */\nLocusZoom.DataLayer.prototype.exportData = function(format){\n var default_format = \"json\";\n format = format || default_format;\n format = (typeof format == \"string\" ? format.toLowerCase() : default_format);\n if ([\"json\",\"csv\",\"tsv\"].indexOf(format) === -1){ format = default_format; }\n var ret;\n switch (format){\n case \"json\":\n try {\n ret = JSON.stringify(this.data);\n } catch (e){\n ret = null;\n console.error(\"Unable to export JSON data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n case \"tsv\":\n case \"csv\":\n try {\n var jsonified = JSON.parse(JSON.stringify(this.data));\n if (typeof jsonified != \"object\"){\n ret = jsonified.toString();\n } else if (!Array.isArray(jsonified)){\n ret = \"Object\";\n } else {\n var delimiter = (format === \"tsv\") ? \"\\t\" : \",\";\n var header = this.layout.fields.map(function(header){\n return JSON.stringify(header);\n }).join(delimiter) + \"\\n\";\n ret = header + jsonified.map(function(record){\n return this.layout.fields.map(function(field){\n if (typeof record[field] == \"undefined\"){\n return JSON.stringify(null);\n } else if (typeof record[field] == \"object\" && record[field] !== null){\n return Array.isArray(record[field]) ? \"\\\"[Array(\" + record[field].length + \")]\\\"\" : \"\\\"[Object]\\\"\";\n } else {\n return JSON.stringify(record[field]);\n }\n }).join(delimiter);\n }.bind(this)).join(\"\\n\");\n }\n } catch (e){\n ret = null;\n console.error(\"Unable to export CSV data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n }\n return ret;\n};\n\n/**\n * Position the datalayer and all tooltips\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.draw = function(){\n this.svg.container.attr(\"transform\", \"translate(\" + this.parent.layout.cliparea.origin.x + \",\" + this.parent.layout.cliparea.origin.y + \")\");\n this.svg.clipRect\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.parent.layout.cliparea.height);\n this.positionAllTooltips();\n return this;\n};\n\n\n/**\n * Re-Map a data layer to reflect changes in the state of a plot (such as viewing region/ chromosome range)\n * @return {Promise}\n */\nLocusZoom.DataLayer.prototype.reMap = function(){\n\n this.destroyAllTooltips(); // hack - only non-visible tooltips should be destroyed\n // and then recreated if returning to visibility\n\n // Fetch new data. Datalayers are only given access to the final consolidated data from the chain (not headers or raw payloads)\n var promise = this.parent_plot.lzd.getData(this.state, this.layout.fields);\n promise.then(function(new_data) {\n this.data = new_data.body;\n this.applyDataMethods();\n this.initialized = true;\n }.bind(this));\n\n return promise;\n};\n\n\n/**\n * The central registry of known data layer definitions (which may be stored in separate files due to length)\n * @namespace\n */\nLocusZoom.DataLayers = (function() {\n var obj = {};\n var datalayers = {};\n /**\n * @name LocusZoom.DataLayers.get\n * @param {String} name The name of the datalayer\n * @param {Object} layout The configuration object for this data layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n * @returns {LocusZoom.DataLayer}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (datalayers[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for data layer [\" + name + \"]\");\n } else {\n return new datalayers[name](layout, parent);\n }\n } else {\n throw(\"data layer [\" + name + \"] not found\");\n }\n };\n\n /**\n * @name LocusZoom.DataLayers.set\n * @protected\n * @param {String} name\n * @param {Function} datalayer Constructor for the datalayer\n */\n obj.set = function(name, datalayer) {\n if (datalayer) {\n if (typeof datalayer != \"function\"){\n throw(\"unable to set data layer [\" + name + \"], argument provided is not a function\");\n } else {\n datalayers[name] = datalayer;\n datalayers[name].prototype = new LocusZoom.DataLayer();\n }\n } else {\n delete datalayers[name];\n }\n };\n\n /**\n * Add a new type of datalayer to the registry of known layer types\n * @name LocusZoom.DataLayers.add\n * @param {String} name The name of the data layer to register\n * @param {Function} datalayer\n */\n obj.add = function(name, datalayer) {\n if (datalayers[name]) {\n throw(\"data layer already exists with name: \" + name);\n } else {\n obj.set(name, datalayer);\n }\n };\n\n /**\n * Register a new datalayer that inherits and extends basic behaviors from a known datalayer\n * @param {String} parent_name The name of the parent data layer whose behavior is to be extended\n * @param {String} name The name of the new datalayer to register\n * @param {Object} [overrides] Object of properties and methods to combine with the prototype of the parent datalayer\n * @returns {Function} The constructor for the new child class\n */\n obj.extend = function(parent_name, name, overrides) {\n // TODO: Consider exposing additional constructor argument, if there is a use case for very granular extension\n overrides = overrides || {};\n\n var parent = datalayers[parent_name];\n if (!parent) {\n throw \"Attempted to subclass an unknown or unregistered datalayer type\";\n }\n if (typeof overrides !== \"object\") {\n throw \"Must specify an object of properties and methods\";\n }\n var child = LocusZoom.subclass(parent, overrides);\n // Bypass .set() because we want a layer of inheritance below `DataLayer`\n datalayers[name] = child;\n return child;\n };\n\n /**\n * List the names of all known datalayers\n * @name LocusZoom.DataLayers.list\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(datalayers);\n };\n\n return obj;\n})();\n","\"use strict\";\n\n/**\n * Create a single continuous 2D track that provides information about each datapoint\n *\n * For example, this can be used to color by membership in a group, alongside information in other panels\n *\n * @class LocusZoom.DataLayers.annotation_track\n * @augments LocusZoom.DataLayer\n * @param {Object} layout\n * @param {Object|String} [layout.color]\n * @param {Array[]} An array of filter entries specifying which points to draw annotations for.\n * See `LocusZoom.DataLayer.filter` for details\n */\nLocusZoom.DataLayers.add(\"annotation_track\", function(layout) {\n // In the future we may add additional options for controlling marker size/ shape, based on user feedback\n this.DefaultLayout = {\n color: \"#000000\",\n filters: []\n };\n\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n if (!Array.isArray(layout.filters)) {\n throw \"Annotation track must specify array of filters for selecting points to annotate\";\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n this.render = function() {\n var self = this;\n // Only render points that currently satisfy all provided filter conditions.\n var trackData = this.filter(this.layout.filters, \"elements\");\n\n var selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-\" + self.layout.type)\n .data(trackData, function(d) { return d[self.layout.id_field]; });\n\n // Add new elements as needed\n selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function (d){ return self.getElementId(d); });\n // Update the set of elements to reflect new data\n selection\n .attr(\"x\", function (d) { return self.parent[\"x_scale\"](d[self.layout.x_axis.field]); })\n .attr(\"width\", 1) // TODO autocalc width of track? Based on datarange / pixel width presumably\n .attr(\"height\", self.parent.layout.height)\n .attr(\"fill\", function(d){ return self.resolveScalableParameter(self.layout.color, d); });\n // Remove unused elements\n selection.exit().remove();\n\n // Set up tooltips and mouse interaction\n this.applyBehaviors(selection);\n };\n\n // Reimplement the positionTooltip() method to be annotation-specific\n this.positionTooltip = function(id) {\n if (typeof id != \"string\") {\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]) {\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var offset = stroke_width / 2;\n var page_origin = this.getPageOrigin();\n\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_center = data_layer_height / 2;\n\n // Tooltip should be horizontally centered above the point to be annotated. (or below if space is limited)\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width) + offset_left - offset_right - offset;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - y_center) {\n top = page_origin.y + y_center - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow) {\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n return this;\n});\n","\"use strict\";\n\n/*********************\n Forest Data Layer\n Implements a standard forest plot\n*/\n\nLocusZoom.DataLayers.add(\"forest\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"square\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 2\n },\n id_field: \"id\",\n confidence_intervals: {\n start_field: \"ci_start\",\n end_field: \"ci_end\"\n },\n show_no_significance_line: true\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be forest-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n var offset = Math.sqrt(point_size / Math.PI);\n var left, arrow_type, arrow_left;\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var top, arrow_top;\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n } \n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Implement the main render function\n this.render = function(){\n\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate confidence interval paths if fields are defined\n if (this.layout.confidence_intervals\n && this.layout.fields.indexOf(this.layout.confidence_intervals.start_field) !== -1\n && this.layout.fields.indexOf(this.layout.confidence_intervals.end_field) !== -1){\n // Generate a selection for all forest plot confidence intervals\n var ci_selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-forest.lz-data_layer-forest-ci\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n // Create confidence interval rect elements\n ci_selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-ci\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_ci\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + (isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height) + \")\");\n // Apply position and size parameters using transition if necessary\n var ci_transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n var ci_width = function(d){\n return this.parent[x_scale](d[this.layout.confidence_intervals.end_field])\n - this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n }.bind(this);\n var ci_height = 1;\n if (this.canTransition()){\n ci_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n } else {\n ci_selection\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n }\n // Remove old elements as needed\n ci_selection.exit().remove();\n }\n \n // Generate a selection for all forest plot points\n var points_selection = this.svg.group\n .selectAll(\"path.lz-data_layer-forest.lz-data_layer-forest-point\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n points_selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-point\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_point\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n if (this.canTransition()){\n points_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n points_selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n points_selection.exit().remove();\n\n // Apply default event emitters to selection\n points_selection.on(\"click.event_emitter\", function(element_data){\n this.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n \n // Apply behaviors to points\n this.applyBehaviors(points_selection);\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Genes Data Layer\n * Implements a data layer that will render gene tracks\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"genes\", function(layout){\n /**\n * Define a default layout for this DataLayer type and merge it with the passed argument\n * @protected\n * @member {Object}\n * */\n this.DefaultLayout = {\n // Optionally specify different fill and stroke properties\n stroke: \"rgb(54, 54, 150)\",\n color: \"#363696\",\n label_font_size: 12,\n label_exon_spacing: 4,\n exon_height: 16,\n bounding_box_padding: 6,\n track_vertical_spacing: 10\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Generate a statusnode ID for a given element\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n return this.getElementId(element) + \"-statusnode\";\n };\n\n /**\n * Helper function to sum layout values to derive total height for a single gene track\n * @returns {number}\n */\n this.getTrackHeight = function(){\n return 2 * this.layout.bounding_box_padding\n + this.layout.label_font_size\n + this.layout.label_exon_spacing\n + this.layout.exon_height\n + this.layout.track_vertical_spacing;\n };\n\n /**\n * A gene may have arbitrarily many transcripts, but this data layer isn't set up to render them yet.\n * Stash a transcript_idx to point to the first transcript and use that for all transcript refs.\n * @member {number}\n * @type {number}\n */\n this.transcript_idx = 0;\n\n /**\n * An internal counter for the number of tracks in the data layer. Used as an internal counter for looping\n * over positions / assignments\n * @protected\n * @member {number}\n */\n this.tracks = 1;\n\n /**\n * Store information about genes in dataset, in a hash indexed by track number: {track_number: [gene_indices]}\n * @member {Object.}\n */\n this.gene_track_index = { 1: [] };\n\n /**\n * Ensure that genes in overlapping chromosome regions are positioned so that parts of different genes do not\n * overlap in the view. A track is a row used to vertically separate overlapping genes.\n * @returns {LocusZoom.DataLayer}\n */\n this.assignTracks = function(){\n /**\n * Function to get the width in pixels of a label given the text and layout attributes\n * TODO: Move to outer scope?\n * @param {String} gene_name\n * @param {number|string} font_size\n * @returns {number}\n */\n this.getLabelWidth = function(gene_name, font_size){\n try {\n var temp_text = this.svg.group.append(\"text\")\n .attr(\"x\", 0).attr(\"y\", 0).attr(\"class\", \"lz-data_layer-genes lz-label\")\n .style(\"font-size\", font_size)\n .text(gene_name + \"→\");\n var label_width = temp_text.node().getBBox().width;\n temp_text.remove();\n return label_width;\n } catch (e){\n return 0;\n }\n };\n\n // Reinitialize some metadata\n this.tracks = 1;\n this.gene_track_index = { 1: [] };\n\n this.data.map(function(d, g){\n\n // If necessary, split combined gene id / version fields into discrete fields.\n // NOTE: this may be an issue with CSG's genes data source that may eventually be solved upstream.\n if (this.data[g].gene_id && this.data[g].gene_id.indexOf(\".\")){\n var split = this.data[g].gene_id.split(\".\");\n this.data[g].gene_id = split[0];\n this.data[g].gene_version = split[1];\n }\n\n // Stash the transcript ID on the parent gene\n this.data[g].transcript_id = this.data[g].transcripts[this.transcript_idx].transcript_id;\n\n // Determine display range start and end, based on minimum allowable gene display width, bounded by what we can see\n // (range: values in terms of pixels on the screen)\n this.data[g].display_range = {\n start: this.parent.x_scale(Math.max(d.start, this.state.start)),\n end: this.parent.x_scale(Math.min(d.end, this.state.end))\n };\n this.data[g].display_range.label_width = this.getLabelWidth(this.data[g].gene_name, this.layout.label_font_size);\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n // Determine label text anchor (default to middle)\n this.data[g].display_range.text_anchor = \"middle\";\n if (this.data[g].display_range.width < this.data[g].display_range.label_width){\n if (d.start < this.state.start){\n this.data[g].display_range.end = this.data[g].display_range.start\n + this.data[g].display_range.label_width\n + this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"start\";\n } else if (d.end > this.state.end){\n this.data[g].display_range.start = this.data[g].display_range.end\n - this.data[g].display_range.label_width\n - this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n var centered_margin = ((this.data[g].display_range.label_width - this.data[g].display_range.width) / 2)\n + this.layout.label_font_size;\n if ((this.data[g].display_range.start - centered_margin) < this.parent.x_scale(this.state.start)){\n this.data[g].display_range.start = this.parent.x_scale(this.state.start);\n this.data[g].display_range.end = this.data[g].display_range.start + this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"start\";\n } else if ((this.data[g].display_range.end + centered_margin) > this.parent.x_scale(this.state.end)) {\n this.data[g].display_range.end = this.parent.x_scale(this.state.end);\n this.data[g].display_range.start = this.data[g].display_range.end - this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n this.data[g].display_range.start -= centered_margin;\n this.data[g].display_range.end += centered_margin;\n }\n }\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n }\n // Add bounding box padding to the calculated display range start, end, and width\n this.data[g].display_range.start -= this.layout.bounding_box_padding;\n this.data[g].display_range.end += this.layout.bounding_box_padding;\n this.data[g].display_range.width += 2 * this.layout.bounding_box_padding;\n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[g].display_domain = {\n start: this.parent.x_scale.invert(this.data[g].display_range.start),\n end: this.parent.x_scale.invert(this.data[g].display_range.end)\n };\n this.data[g].display_domain.width = this.data[g].display_domain.end - this.data[g].display_domain.start;\n\n // Using display range/domain data generated above cast each gene to tracks such that none overlap\n this.data[g].track = null;\n var potential_track = 1;\n while (this.data[g].track === null){\n var collision_on_potential_track = false;\n this.gene_track_index[potential_track].map(function(placed_gene){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_gene.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_gene.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_gene.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[g]));\n if (!collision_on_potential_track){\n this.data[g].track = potential_track;\n this.gene_track_index[potential_track].push(this.data[g]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.gene_track_index[potential_track] = [];\n }\n }\n }\n\n // Stash parent references on all genes, trascripts, and exons\n this.data[g].parent = this;\n this.data[g].transcripts.map(function(d, t){\n this.data[g].transcripts[t].parent = this.data[g];\n this.data[g].transcripts[t].exons.map(function(d, e){\n this.data[g].transcripts[t].exons[e].parent = this.data[g].transcripts[t];\n }.bind(this));\n }.bind(this));\n\n }.bind(this));\n return this;\n };\n\n /**\n * Main render function\n */\n this.render = function(){\n\n var self = this;\n this.assignTracks();\n\n var width, height, x, y;\n\n // Render gene groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-genes\")\n .data(this.data, function(d){ return d.gene_name; });\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-genes\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(gene){\n\n var data_layer = gene.parent;\n\n // Render gene bounding boxes (status nodes to show selected/highlighted)\n var bboxes = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-data_layer-genes-statusnode\")\n .data([gene], function(d){ return data_layer.getElementStatusNodeId(d); });\n\n bboxes.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-data_layer-genes-statusnode\");\n \n bboxes\n .attr(\"id\", function(d){\n return data_layer.getElementStatusNodeId(d);\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n bboxes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n bboxes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n bboxes.exit().remove();\n\n // Render gene boundaries\n var boundary_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d); };\n var boundary_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d); };\n var boundaries = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-boundary\")\n .data([gene], function(d){ return d.gene_name + \"_boundary\"; })\n .style({ fill: boundary_fill, stroke: boundary_stroke });\n\n boundaries.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-boundary\");\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return 1; // TODO: scale dynamically?\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing\n + (Math.max(data_layer.layout.exon_height, 3) / 2);\n };\n if (data_layer.canTransition()){\n boundaries\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n boundaries\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n \n boundaries.exit().remove();\n\n // Render gene labels\n var labels = d3.select(this).selectAll(\"text.lz-data_layer-genes.lz-label\")\n .data([gene], function(d){ return d.gene_name + \"_label\"; });\n\n labels.enter().append(\"text\")\n .attr(\"class\", \"lz-data_layer-genes lz-label\");\n\n labels\n .attr(\"text-anchor\", function(d){\n return d.display_range.text_anchor;\n })\n .text(function(d){\n return (d.strand === \"+\") ? d.gene_name + \"→\" : \"←\" + d.gene_name;\n })\n .style(\"font-size\", gene.parent.layout.label_font_size);\n\n x = function(d){\n if (d.display_range.text_anchor === \"middle\"){\n return d.display_range.start + (d.display_range.width / 2);\n } else if (d.display_range.text_anchor === \"start\"){\n return d.display_range.start + data_layer.layout.bounding_box_padding;\n } else if (d.display_range.text_anchor === \"end\"){\n return d.display_range.end - data_layer.layout.bounding_box_padding;\n }\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size;\n };\n if (data_layer.canTransition()){\n labels\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"x\", x).attr(\"y\", y);\n } else {\n labels\n .attr(\"x\", x).attr(\"y\", y);\n }\n\n labels.exit().remove();\n\n // Render exon rects (first transcript only, for now)\n // Exons: by default color on gene properties for consistency with the gene boundary track- hence color uses d.parent.parent\n var exon_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d.parent.parent); };\n var exon_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d.parent.parent); };\n\n var exons = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-exon\")\n .data(gene.transcripts[gene.parent.transcript_idx].exons, function(d){ return d.exon_id; });\n\n exons.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-exon\");\n\n exons\n .style({ fill: exon_fill, stroke: exon_stroke });\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return data_layer.layout.exon_height;\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(){\n return ((gene.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing;\n };\n if (data_layer.canTransition()){\n exons\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n exons\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n exons.exit().remove();\n\n // Render gene click area\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-clickarea\")\n .data([gene], function(d){ return d.gene_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click.event_emitter\", function(element){\n element.parent.parent.emit(\"element_clicked\", element, true);\n });\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n };\n\n /**\n * Reimplement the positionTooltip() method to be gene-specific\n * @param {String} id\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var gene_bbox_id = this.getElementStatusNodeId(tooltip.data);\n var gene_bbox = d3.select(\"#\" + gene_bbox_id).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the gene that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var gene_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - gene_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + gene_center_x - data_layer_width, 0);\n var left = page_origin.x + gene_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the gene unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (gene_bbox.y + gene_bbox.height)){\n top = page_origin.y + gene_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + gene_bbox.y + gene_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Genome Legend Data Layer\n Implements a data layer that will render a genome legend\n*/\n\n// Build a custom data layer for a genome legend\nLocusZoom.DataLayers.add(\"genome_legend\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n chromosome_fill_colors: {\n light: \"rgb(155, 155, 188)\",\n dark: \"rgb(95, 95, 128)\"\n },\n chromosome_label_colors: {\n light: \"rgb(120, 120, 186)\",\n dark: \"rgb(0, 0, 66)\"\n }\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Implement the main render function\n this.render = function(){\n\n // Iterate over data to generate genome-wide start/end values for each chromosome\n var position = 0;\n this.data.forEach(function(d, i){\n this.data[i].genome_start = position;\n this.data[i].genome_end = position + d[\"genome:base_pairs\"];\n position += d[\"genome:base_pairs\"];\n }.bind(this));\n\n var chromosomes = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend\")\n .data(this.data, function(d){ return d[\"genome:chr\"]; });\n\n // Create chromosome elements, apply class\n chromosomes.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend\");\n\n // Position and fill chromosome rects\n var data_layer = this;\n var panel = this.parent;\n\n chromosomes\n .attr(\"fill\", function(d){ return (d[\"genome:chr\"] % 2 ? data_layer.layout.chromosome_fill_colors.light : data_layer.layout.chromosome_fill_colors.dark); })\n .attr(\"x\", function(d){ return panel.x_scale(d.genome_start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d[\"genome:base_pairs\"]); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n // Remove old elements as needed\n chromosomes.exit().remove();\n\n // Parse current state variant into a position\n // Assumes that variant string is of the format 10:123352136_C/T or 10:123352136\n var variant_parts = /([^:]+):(\\d+)(?:_.*)?/.exec(this.state.variant);\n if (!variant_parts) {\n throw(\"Genome legend cannot understand the specified variant position\");\n }\n var chr = variant_parts[1];\n var offset = variant_parts[2];\n // TODO: How does this handle representation of X or Y chromosomes?\n position = +this.data[chr-1].genome_start + +offset;\n\n // Render the position\n var region = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend-marker\")\n .data([{ start: position, end: position + 1 }]);\n\n region.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend-marker\");\n\n region\n .transition()\n .duration(500)\n .style({\n \"fill\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke-width\": \"3px\"\n })\n .attr(\"x\", function(d){ return panel.x_scale(d.start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d.end - d.start); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n region.exit().remove();\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/**\n * Intervals Data Layer\n * Implements a data layer that will render interval annotation tracks (intervals must provide start and end values)\n * @class LocusZoom.DataLayers.intervals\n * @augments LocusZoom.DataLayer\n */\nLocusZoom.DataLayers.add(\"intervals\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n start_field: \"start\",\n end_field: \"end\",\n track_split_field: \"state_id\",\n track_split_order: \"DESC\",\n track_split_legend_to_y_axis: 2,\n split_tracks: true,\n track_height: 15,\n track_vertical_spacing: 3,\n bounding_box_padding: 2,\n always_hide_legend: false,\n color: \"#B8B8B8\",\n fill_opacity: 1\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n \n /**\n * To define shared highlighting on the track split field define the status node id override\n * to generate an ID common to the track when we're actively splitting data out to separate tracks\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n if (this.layout.split_tracks){\n return (this.getBaseId() + \"-statusnode-\" + element[this.layout.track_split_field]).replace(/[:.[\\],]/g, \"_\");\n }\n return this.getElementId(element) + \"-statusnode\";\n }.bind(this);\n \n // Helper function to sum layout values to derive total height for a single interval track\n this.getTrackHeight = function(){\n return this.layout.track_height\n + this.layout.track_vertical_spacing\n + (2 * this.layout.bounding_box_padding);\n };\n\n this.tracks = 1;\n this.previous_tracks = 1;\n \n // track-number-indexed object with arrays of interval indexes in the dataset\n this.interval_track_index = { 1: [] };\n\n // After we've loaded interval data interpret it to assign\n // each to a track so that they do not overlap in the view\n this.assignTracks = function(){\n\n // Reinitialize some metadata\n this.previous_tracks = this.tracks;\n this.tracks = 0;\n this.interval_track_index = { 1: [] };\n this.track_split_field_index = {};\n \n // If splitting tracks by a field's value then do a first pass determine\n // a value/track mapping that preserves the order of possible values\n if (this.layout.track_split_field && this.layout.split_tracks){\n this.data.map(function(d){\n this.track_split_field_index[d[this.layout.track_split_field]] = null;\n }.bind(this));\n var index = Object.keys(this.track_split_field_index);\n if (this.layout.track_split_order === \"DESC\"){ index.reverse(); }\n index.forEach(function(val){\n this.track_split_field_index[val] = this.tracks + 1;\n this.interval_track_index[this.tracks + 1] = [];\n this.tracks++;\n }.bind(this));\n }\n\n this.data.map(function(d, i){\n\n // Stash a parent reference on the interval\n this.data[i].parent = this;\n\n // Determine display range start and end, based on minimum allowable interval display width,\n // bounded by what we can see (range: values in terms of pixels on the screen)\n this.data[i].display_range = {\n start: this.parent.x_scale(Math.max(d[this.layout.start_field], this.state.start)),\n end: this.parent.x_scale(Math.min(d[this.layout.end_field], this.state.end))\n };\n this.data[i].display_range.width = this.data[i].display_range.end - this.data[i].display_range.start;\n \n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[i].display_domain = {\n start: this.parent.x_scale.invert(this.data[i].display_range.start),\n end: this.parent.x_scale.invert(this.data[i].display_range.end)\n };\n this.data[i].display_domain.width = this.data[i].display_domain.end - this.data[i].display_domain.start;\n\n // If splitting to tracks based on the value of the designated track split field\n // then don't bother with collision detection (intervals will be grouped on tracks\n // solely by the value of track_split_field)\n if (this.layout.track_split_field && this.layout.split_tracks){\n var val = this.data[i][this.layout.track_split_field];\n this.data[i].track = this.track_split_field_index[val];\n this.interval_track_index[this.data[i].track].push(i);\n } else {\n // If not splitting to tracks based on a field value then do so based on collision\n // detection (as how it's done for genes). Use display range/domain data generated\n // above and cast each interval to tracks such that none overlap\n this.tracks = 1;\n this.data[i].track = null;\n var potential_track = 1;\n while (this.data[i].track === null){\n var collision_on_potential_track = false;\n this.interval_track_index[potential_track].map(function(placed_interval){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_interval.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_interval.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_interval.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[i]));\n if (!collision_on_potential_track){\n this.data[i].track = potential_track;\n this.interval_track_index[potential_track].push(this.data[i]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.interval_track_index[potential_track] = [];\n }\n }\n }\n\n }\n\n }.bind(this));\n\n return this;\n };\n\n // Implement the main render function\n this.render = function(){\n\n this.assignTracks();\n\n // Remove any shared highlight nodes and re-render them if we're splitting on tracks\n // At most there will only be dozen or so nodes here (one per track) and each time\n // we render data we may have new tracks, so wiping/redrawing all is reasonable.\n this.svg.group.selectAll(\".lz-data_layer-intervals-statusnode.lz-data_layer-intervals-shared\").remove();\n Object.keys(this.track_split_field_index).forEach(function(key){\n // Make a psuedo-element so that we can generate an id for the shared node\n var psuedoElement = {};\n psuedoElement[this.layout.track_split_field] = key;\n // Insert the shared node\n var sharedstatusnode_style = {display: (this.layout.split_tracks ? null : \"none\")};\n this.svg.group.insert(\"rect\", \":first-child\")\n .attr(\"id\", this.getElementStatusNodeId(psuedoElement))\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-shared\")\n .attr(\"rx\", this.layout.bounding_box_padding).attr(\"ry\", this.layout.bounding_box_padding)\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.getTrackHeight() - this.layout.track_vertical_spacing)\n .attr(\"x\", 0)\n .attr(\"y\", (this.track_split_field_index[key]-1) * this.getTrackHeight())\n .style(sharedstatusnode_style);\n }.bind(this));\n\n var width, height, x, y, fill, fill_opacity;\n \n // Render interval groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-intervals\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-intervals\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(interval){\n\n var data_layer = interval.parent;\n\n // Render interval status nodes (displayed behind intervals to show highlight\n // without needing to modify interval display element(s))\n var statusnode_style = {display: (data_layer.layout.split_tracks ? \"none\" : null)};\n var statusnodes = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-data_layer-intervals-statusnode.lz-data_layer-intervals-statusnode-discrete\")\n .data([interval], function(d){ return data_layer.getElementId(d) + \"-statusnode\"; });\n statusnodes.enter().insert(\"rect\", \":first-child\")\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-statusnode-discrete\");\n statusnodes\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"-statusnode\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .style(statusnode_style);\n width = function(d){\n return d.display_range.width + (2 * data_layer.layout.bounding_box_padding);\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start - data_layer.layout.bounding_box_padding;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n statusnodes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n statusnodes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n statusnodes.exit().remove();\n\n // Render primary interval rects\n var rects = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-interval_rect\")\n .data([interval], function(d){ return d[data_layer.layout.id_field] + \"_interval_rect\"; });\n\n rects.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-interval_rect\");\n\n height = data_layer.layout.track_height;\n width = function(d){\n return d.display_range.width;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding;\n };\n fill = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.color, d);\n };\n fill_opacity = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.fill_opacity, d);\n };\n \n \n if (data_layer.canTransition()){\n rects\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n } else {\n rects\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n }\n \n rects.exit().remove();\n\n // Render interval click areas\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-clickarea\")\n .data([interval], function(d){ return d.interval_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click\", function(element_data){\n element_data.parent.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Update the legend axis if the number of ticks changed\n if (this.previous_tracks !== this.tracks){\n this.updateSplitTrackAxis();\n }\n\n return this;\n\n };\n \n // Reimplement the positionTooltip() method to be interval-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var interval_bbox = d3.select(\"#\" + this.getElementStatusNodeId(tooltip.data)).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the interval that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var interval_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - interval_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + interval_center_x - data_layer_width, 0);\n var left = page_origin.x + interval_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the interval unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (interval_bbox.y + interval_bbox.height)){\n top = page_origin.y + interval_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + interval_bbox.y + interval_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Redraw split track axis or hide it, and show/hide the legend, as determined\n // by current layout parameters and data\n this.updateSplitTrackAxis = function(){\n var legend_axis = this.layout.track_split_legend_to_y_axis ? \"y\" + this.layout.track_split_legend_to_y_axis : false;\n if (this.layout.split_tracks){\n var tracks = +this.tracks || 0;\n var track_height = +this.layout.track_height || 0;\n var track_spacing = 2 * (+this.layout.bounding_box_padding || 0) + (+this.layout.track_vertical_spacing || 0);\n var target_height = (tracks * track_height) + ((tracks - 1) * track_spacing);\n this.parent.scaleHeightToData(target_height);\n if (legend_axis && this.parent.legend){\n this.parent.legend.hide(); \n this.parent.layout.axes[legend_axis] = {\n render: true,\n ticks: [],\n range: {\n start: (target_height - (this.layout.track_height/2)),\n end: (this.layout.track_height/2)\n }\n };\n this.layout.legend.forEach(function(element){\n var key = element[this.layout.track_split_field];\n var track = this.track_split_field_index[key];\n if (track){\n if (this.layout.track_split_order === \"DESC\"){\n track = Math.abs(track - tracks - 1);\n }\n this.parent.layout.axes[legend_axis].ticks.push({\n y: track,\n text: element.label\n });\n }\n }.bind(this));\n this.layout.y_axis = {\n axis: this.layout.track_split_legend_to_y_axis,\n floor: 1,\n ceiling: tracks\n };\n this.parent.render();\n }\n this.parent_plot.positionPanels();\n } else {\n if (legend_axis && this.parent.legend){\n if (!this.layout.always_hide_legend){ this.parent.legend.show(); }\n this.parent.layout.axes[legend_axis] = { render: false };\n this.parent.render();\n }\n }\n return this;\n };\n\n // Method to not only toggle the split tracks boolean but also update\n // necessary display values to animate a complete merge/split\n this.toggleSplitTracks = function(){\n this.layout.split_tracks = !this.layout.split_tracks;\n if (this.parent.legend && !this.layout.always_hide_legend){\n this.parent.layout.margin.bottom = 5 + (this.layout.split_tracks ? 0 : this.parent.legend.layout.height + 5);\n }\n this.render();\n this.updateSplitTrackAxis();\n return this;\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Line Data Layer\n * Implements a standard line plot\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n /** @member {Object} */\n this.DefaultLayout = {\n style: {\n fill: \"none\",\n \"stroke-width\": \"2px\"\n },\n interpolate: \"linear\",\n x_axis: { field: \"x\" },\n y_axis: { field: \"y\", axis: 1 },\n hitarea_width: 5\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Var for storing mouse events for use in tool tip positioning\n /** @member {String} */\n this.mouse_event = null;\n\n /**\n * Var for storing the generated line function itself\n * @member {d3.svg.line}\n * */\n this.line = null;\n\n /**\n * The timeout identifier returned by setTimeout\n * @member {Number}\n */\n this.tooltip_timeout = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n\n /**\n * Helper function to get display and data objects representing\n * the x/y coordinates of the current mouse event with respect to the line in terms of the display\n * and the interpolated values of the x/y fields with respect to the line\n * @returns {{display: {x: *, y: null}, data: {}, slope: null}}\n */\n this.getMouseDisplayAndData = function(){\n var ret = {\n display: {\n x: d3.mouse(this.mouse_event)[0],\n y: null\n },\n data: {},\n slope: null\n };\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n ret.data[x_field] = this.parent[x_scale].invert(ret.display.x);\n var bisect = d3.bisector(function(datum) { return +datum[x_field]; }).left;\n var index = bisect(this.data, ret.data[x_field]) - 1;\n var startDatum = this.data[index];\n var endDatum = this.data[index + 1];\n var interpolate = d3.interpolateNumber(+startDatum[y_field], +endDatum[y_field]);\n var range = +endDatum[x_field] - +startDatum[x_field];\n ret.data[y_field] = interpolate((ret.data[x_field] % range) / range);\n ret.display.y = this.parent[y_scale](ret.data[y_field]);\n if (this.layout.tooltip.x_precision){\n ret.data[x_field] = ret.data[x_field].toPrecision(this.layout.tooltip.x_precision);\n }\n if (this.layout.tooltip.y_precision){\n ret.data[y_field] = ret.data[y_field].toPrecision(this.layout.tooltip.y_precision);\n }\n ret.slope = (this.parent[y_scale](endDatum[y_field]) - this.parent[y_scale](startDatum[y_field]))\n / (this.parent[x_scale](endDatum[x_field]) - this.parent[x_scale](startDatum[x_field]));\n return ret;\n };\n\n /**\n * Reimplement the positionTooltip() method to be line-specific\n * @param {String} id Identify the tooltip to be positioned\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var arrow_width = 7; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var stroke_width = parseFloat(this.layout.style[\"stroke-width\"]) || 1;\n var page_origin = this.getPageOrigin();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n var top, left, arrow_top, arrow_left, arrow_type;\n\n // Determine x/y coordinates for display and data\n var dd = this.getMouseDisplayAndData();\n\n // If the absolute value of the slope of the line at this point is above 1 (including Infinity)\n // then position the tool tip left/right. Otherwise position top/bottom.\n if (Math.abs(dd.slope) > 1){\n\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (dd.display.x <= this.parent.layout.width / 2){\n left = page_origin.x + dd.display.x + stroke_width + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + dd.display.x - tooltip_box.width - stroke_width - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n if (dd.display.y - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + dd.display.y - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (dd.display.y + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + dd.display.y + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + dd.display.y - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n\n } else {\n\n // Position horizontally: attempt to center on the mouse's x coordinate\n // pad to either side if bumping up against the edge of the data layer\n var offset_right = Math.max((tooltip_box.width / 2) - dd.display.x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + dd.display.x - data_layer_width, 0);\n left = page_origin.x + dd.display.x - (tooltip_box.width / 2) - offset_left + offset_right;\n var min_arrow_left = arrow_width / 2;\n var max_arrow_left = tooltip_box.width - (2.5 * arrow_width);\n arrow_left = (tooltip_box.width / 2) - arrow_width + offset_left - offset_right;\n arrow_left = Math.min(Math.max(arrow_left, min_arrow_left), max_arrow_left);\n\n // Position vertically above the line unless there's insufficient space\n if (tooltip_box.height + stroke_width + arrow_width > dd.display.y){\n top = page_origin.y + dd.display.y + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n } else {\n top = page_origin.y + dd.display.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n }\n }\n\n // Apply positions to the main div\n tooltip.selector.style({ left: left + \"px\", top: top + \"px\" });\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style({ \"left\": arrow_left + \"px\", top: arrow_top + \"px\" });\n\n };\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var data_layer = this;\n var panel = this.parent;\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Apply tooltip, etc\n if (this.layout.tooltip){\n // Generate an overlaying transparent \"hit area\" line for more intuitive mouse events\n var hitarea_width = parseFloat(this.layout.hitarea_width).toString() + \"px\";\n var hitarea = this.svg.group\n .selectAll(\"path.lz-data_layer-line-hitarea\")\n .data([this.data]);\n hitarea.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line-hitarea\")\n .style(\"stroke-width\", hitarea_width);\n var hitarea_line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n hitarea\n .attr(\"d\", hitarea_line)\n .on(\"mouseover\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.createTooltip(dd.data);\n })\n .on(\"mousemove\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.updateTooltip(dd.data);\n data_layer.positionTooltip(data_layer.getElementId());\n })\n .on(\"mouseout\", function(){\n data_layer.tooltip_timeout = setTimeout(function(){\n data_layer.mouse_event = null;\n data_layer.destroyTooltip(data_layer.getElementId());\n }, 300);\n });\n hitarea.exit().remove();\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n /**\n * Redefine setElementStatus family of methods as line data layers will only ever have a single path element\n * @param {String} status A member of `LocusZoom.DataLayer.Statuses.adjectives`\n * @param {String|Object} element\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\n this.setElementStatus = function(status, element, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setElementStatusByFilters = function(status, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setAllElementStatus = function(status, toggle){\n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n // Apply class to path based on global status flags\n var path_class = \"lz-data_layer-line\";\n Object.keys(this.global_statuses).forEach(function(global_status){\n if (this.global_statuses[global_status]){ path_class += \" lz-data_layer-line-\" + global_status; }\n }.bind(this));\n this.path.attr(\"class\", path_class);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n return this;\n };\n\n return this;\n\n});\n\n\n/***************************\n * Orthogonal Line Data Layer\n * Implements a horizontal or vertical line given an orientation and an offset in the layout\n * Does not require a data source\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"orthogonal_line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n style: {\n \"stroke\": \"#D3D3D3\",\n \"stroke-width\": \"3px\",\n \"stroke-dasharray\": \"10px 10px\"\n },\n orientation: \"horizontal\",\n x_axis: {\n axis: 1,\n decoupled: true\n },\n y_axis: {\n axis: 1,\n decoupled: true\n },\n offset: 0\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Require that orientation be \"horizontal\" or \"vertical\" only\n if ([\"horizontal\",\"vertical\"].indexOf(layout.orientation) === -1){\n layout.orientation = \"horizontal\";\n }\n\n // Vars for storing the data generated line\n /** @member {Array} */\n this.data = [];\n /** @member {d3.svg.line} */\n this.line = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var panel = this.parent;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n var x_extent = \"x_extent\";\n var y_extent = \"y\" + this.layout.y_axis.axis + \"_extent\";\n var x_range = \"x_range\";\n var y_range = \"y\" + this.layout.y_axis.axis + \"_range\";\n\n // Generate data using extents depending on orientation\n if (this.layout.orientation === \"horizontal\"){\n this.data = [\n { x: panel[x_extent][0], y: this.layout.offset },\n { x: panel[x_extent][1], y: this.layout.offset }\n ];\n } else {\n this.data = [\n { x: this.layout.offset, y: panel[y_extent][0] },\n { x: this.layout.offset, y: panel[y_extent][1] }\n ];\n }\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d, i) {\n var x = parseFloat(panel[x_scale](d[\"x\"]));\n return isNaN(x) ? panel[x_range][i] : x;\n })\n .y(function(d, i) {\n var y = parseFloat(panel[y_scale](d[\"y\"]));\n return isNaN(y) ? panel[y_range][i] : y;\n })\n .interpolate(\"linear\");\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Scatter Data Layer\n Implements a standard scatter plot\n*/\n\nLocusZoom.DataLayers.add(\"scatter\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"circle\",\n tooltip_positioning: \"horizontal\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 1\n },\n id_field: \"id\"\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Extra default for layout spacing\n // Not in default layout since that would make the label attribute always present\n if (layout.label && isNaN(layout.label.spacing)){\n layout.label.spacing = 4;\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be scatter-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var offset = Math.sqrt(point_size / Math.PI);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n if (this.layout.tooltip_positioning === \"vertical\"){\n // Position horizontally centered above the point\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right - offset;\n // Position vertically above the point unless there's insufficient space, then go below\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (y_center + offset)){\n top = page_origin.y + y_center - (offset + tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + offset + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n } else {\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Function to flip labels from being anchored at the start of the text to the end\n // Both to keep labels from running outside the data layer and also as a first\n // pass on recursive separation\n this.flip_labels = function(){\n var data_layer = this;\n var point_size = data_layer.resolveScalableParameter(data_layer.layout.point_size, {});\n var spacing = data_layer.layout.label.spacing;\n var handle_lines = Boolean(data_layer.layout.label.lines);\n var min_x = 2 * spacing;\n var max_x = data_layer.parent.layout.width - data_layer.parent.layout.margin.left - data_layer.parent.layout.margin.right - (2 * spacing);\n var flip = function(dn, dnl){\n var dnx = +dn.attr(\"x\");\n var text_swing = (2 * spacing) + (2 * Math.sqrt(point_size));\n if (handle_lines){\n var dnlx2 = +dnl.attr(\"x2\");\n var line_swing = spacing + (2 * Math.sqrt(point_size));\n }\n if (dn.style(\"text-anchor\") === \"start\"){\n dn.style(\"text-anchor\", \"end\");\n dn.attr(\"x\", dnx - text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 - line_swing); }\n } else {\n dn.style(\"text-anchor\", \"start\");\n dn.attr(\"x\", dnx + text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 + line_swing); }\n }\n };\n // Flip any going over the right edge from the right side to the left side\n // (all labels start on the right side)\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n if (dax + abound.width + spacing > max_x){\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n flip(da, dal);\n }\n });\n // Second pass to flip any others that haven't flipped yet if they collide with another label\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n if (da.style(\"text-anchor\") === \"end\") return;\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n data_layer.label_texts.each(function () {\n var b = this;\n var db = d3.select(b);\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (collision){\n flip(da, dal);\n // Double check that this flip didn't push the label past min_x. If it did, immediately flip back.\n dax = +da.attr(\"x\");\n if (dax - abound.width - spacing < min_x){\n flip(da, dal);\n }\n }\n return;\n });\n });\n };\n\n // Recursive function to space labels apart immediately after initial render\n // Adapted from thudfactor's fiddle here: https://jsfiddle.net/thudfactor/HdwTH/\n // TODO: Make labels also aware of data elements\n this.separate_labels = function(){\n this.seperate_iterations++;\n var data_layer = this;\n var alpha = 0.5;\n var spacing = this.layout.label.spacing;\n var again = false;\n data_layer.label_texts.each(function () {\n var a = this;\n var da = d3.select(a);\n var y1 = da.attr(\"y\");\n data_layer.label_texts.each(function () {\n var b = this;\n // a & b are the same element and don't collide.\n if (a === b) return;\n var db = d3.select(b);\n // a & b are on opposite sides of the chart and\n // don't collide\n if (da.attr(\"text-anchor\") !== db.attr(\"text-anchor\")) return;\n // Determine if the bounding rects for the two text elements collide\n var abound = da.node().getBoundingClientRect();\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (!collision) return;\n again = true;\n // If the labels collide, we'll push each\n // of the two labels up and down a little bit.\n var y2 = db.attr(\"y\");\n var sign = abound.top < bbound.top ? 1 : -1;\n var adjust = sign * alpha;\n var new_a_y = +y1 - adjust;\n var new_b_y = +y2 + adjust;\n // Keep new values from extending outside the data layer\n var min_y = 2 * spacing;\n var max_y = data_layer.parent.layout.height - data_layer.parent.layout.margin.top - data_layer.parent.layout.margin.bottom - (2 * spacing);\n var delta;\n if (new_a_y - (abound.height/2) < min_y){\n delta = +y1 - new_a_y;\n new_a_y = +y1;\n new_b_y += delta;\n } else if (new_b_y - (bbound.height/2) < min_y){\n delta = +y2 - new_b_y;\n new_b_y = +y2;\n new_a_y += delta;\n }\n if (new_a_y + (abound.height/2) > max_y){\n delta = new_a_y - +y1;\n new_a_y = +y1;\n new_b_y -= delta;\n } else if (new_b_y + (bbound.height/2) > max_y){\n delta = new_b_y - +y2;\n new_b_y = +y2;\n new_a_y -= delta;\n }\n da.attr(\"y\",new_a_y);\n db.attr(\"y\",new_b_y);\n });\n });\n if (again) {\n // Adjust lines to follow the labels\n if (data_layer.layout.label.lines){\n var label_elements = data_layer.label_texts[0];\n data_layer.label_lines.attr(\"y2\",function(d,i) {\n var label_line = d3.select(label_elements[i]);\n return label_line.attr(\"y\");\n });\n }\n // After ~150 iterations we're probably beyond diminising returns, so stop recursing\n if (this.seperate_iterations < 150){\n setTimeout(function(){\n this.separate_labels();\n }.bind(this), 1);\n }\n }\n };\n\n // Implement the main render function\n this.render = function(){\n\n var data_layer = this;\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate labels first (if defined)\n if (this.layout.label){\n // Apply filters to generate a filtered data set\n var filtered_data = this.data.filter(function(d){\n if (!data_layer.layout.label.filters){\n return true;\n } else {\n // Start by assuming a match, run through all filters to test if not a match on any one\n var match = true;\n data_layer.layout.label.filters.forEach(function(filter){\n var field_value = (new LocusZoom.Data.Field(filter.field)).resolve(d);\n if (isNaN(field_value)){\n match = false;\n } else {\n switch (filter.operator){\n case \"<\":\n if (!(field_value < filter.value)){ match = false; }\n break;\n case \"<=\":\n if (!(field_value <= filter.value)){ match = false; }\n break;\n case \">\":\n if (!(field_value > filter.value)){ match = false; }\n break;\n case \">=\":\n if (!(field_value >= filter.value)){ match = false; }\n break;\n case \"=\":\n if (!(field_value === filter.value)){ match = false; }\n break;\n default:\n // If we got here the operator is not valid, so the filter should fail\n match = false;\n break;\n }\n }\n });\n return match;\n }\n });\n // Render label groups\n var self = this;\n this.label_groups = this.svg.group\n .selectAll(\"g.lz-data_layer-\" + this.layout.type + \"-label\")\n .data(filtered_data, function(d){ return d[self.layout.id_field] + \"_label\"; });\n this.label_groups.enter()\n .append(\"g\")\n .attr(\"class\", \"lz-data_layer-\"+ this.layout.type + \"-label\");\n // Render label texts\n if (this.label_texts){ this.label_texts.remove(); }\n this.label_texts = this.label_groups.append(\"text\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_texts\n .text(function(d){\n return LocusZoom.parseFields(d, data_layer.layout.label.text || \"\");\n })\n .style(data_layer.layout.label.style || {})\n .attr({\n \"x\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + data_layer.layout.label.spacing;\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"text-anchor\": function(){\n return \"start\";\n }\n });\n // Render label lines\n if (data_layer.layout.label.lines){\n if (this.label_lines){ this.label_lines.remove(); }\n this.label_lines = this.label_groups.append(\"line\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_lines\n .style(data_layer.layout.label.lines.style || {})\n .attr({\n \"x1\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field]);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y1\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"x2\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + (data_layer.layout.label.spacing/2);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y2\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n }\n });\n }\n // Remove labels when they're no longer in the filtered data set\n this.label_groups.exit().remove();\n }\n \n // Generate main scatter data elements\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-\" + this.layout.type)\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Apply default event emitters to selection\n selection.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n \n // Apply mouse behaviors\n this.applyBehaviors(selection);\n \n // Apply method to keep labels from overlapping each other\n if (this.layout.label){\n this.flip_labels();\n this.seperate_iterations = 0;\n this.separate_labels();\n // Apply default event emitters to selection\n this.label_texts.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n // Extend mouse behaviors to labels\n this.applyBehaviors(this.label_texts);\n }\n \n };\n\n // Method to set a passed element as the LD reference in the plot-level state\n this.makeLDReference = function(element){\n var ref = null;\n if (typeof element == \"undefined\"){\n throw(\"makeLDReference requires one argument of any type\");\n } else if (typeof element == \"object\"){\n if (this.layout.id_field && typeof element[this.layout.id_field] != \"undefined\"){\n ref = element[this.layout.id_field].toString();\n } else if (typeof element[\"id\"] != \"undefined\"){\n ref = element[\"id\"].toString();\n } else {\n ref = element.toString();\n }\n } else {\n ref = element.toString();\n }\n this.parent_plot.applyState({ ldrefvar: ref });\n };\n \n return this;\n\n});\n\n/**\n * A scatter plot in which the x-axis represents categories, rather than individual positions.\n * For example, this can be used by PheWAS plots to show related groups. This plot allows the categories to be\n * determined dynamically when data is first loaded.\n *\n * @class LocusZoom.DataLayers.category_scatter\n * @augments LocusZoom.DataLayers.scatter\n */\nLocusZoom.DataLayers.extend(\"scatter\", \"category_scatter\", {\n /**\n * This plot layer makes certain assumptions about the data passed in. Transform the raw array of records from\n * the datasource to prepare it for plotting, as follows:\n * 1. The scatter plot assumes that all records are given in sequence (pre-grouped by `category_field`)\n * 2. It assumes that all records have an x coordinate for individual plotting\n * @private\n */\n _prepareData: function() {\n var xField = this.layout.x_axis.field || \"x\";\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n if (!category_field) {\n throw \"Layout for \" + this.layout.id + \" must specify category_field\";\n }\n // Sort the data so that things in the same category are adjacent (case-insensitive by specified field)\n var sourceData = this.data\n .sort(function(a, b) {\n var ak = a[category_field];\n var bk = b[category_field];\n var av = ak.toString ? ak.toString().toLowerCase() : ak;\n var bv = bk.toString ? bk.toString().toLowerCase() : bk;\n return (av === bv) ? 0 : (av < bv ? -1 : 1);});\n sourceData.forEach(function(d, i){\n // Implementation detail: Scatter plot requires specifying an x-axis value, and most datasources do not\n // specify plotting positions. If a point is missing this field, fill in a synthetic value.\n d[xField] = d[xField] || i;\n });\n return sourceData;\n },\n\n /**\n * Identify the unique categories on the plot, and update the layout with an appropriate color scheme.\n * Also identify the min and max x value associated with the category, which will be used to generate ticks\n * @private\n * @returns {Object.} Series of entries used to build category name ticks {category_name: [min_x, max_x]}\n */\n _generateCategoryBounds: function() {\n // TODO: API may return null values in category_field; should we add placeholder category label?\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n var xField = this.layout.x_axis.field || \"x\";\n var uniqueCategories = {};\n this.data.forEach(function(item) {\n var category = item[category_field];\n var x = item[xField];\n var bounds = uniqueCategories[category] || [x, x];\n uniqueCategories[category] = [Math.min(bounds[0], x), Math.max(bounds[1], x)];\n });\n\n var categoryNames = Object.keys(uniqueCategories);\n this._setDynamicColorScheme(categoryNames);\n\n return uniqueCategories;\n },\n\n /**\n * Automatically define a color scheme for the layer based on data returned from the server.\n * If part of the color scheme has been specified, it will fill in remaining missing information.\n *\n * There are three scenarios:\n * 1. The layout does not specify either category names or (color) values. Dynamically build both based on\n * the data and update the layout.\n * 2. The layout specifies colors, but not categories. Use that exact color information provided, and dynamically\n * determine what categories are present in the data. (cycle through the available colors, reusing if there\n * are a lot of categories)\n * 3. The layout specifies exactly what colors and categories to use (and they match the data!). This is useful to\n * specify an explicit mapping between color scheme and category names, when you want to be sure that the\n * plot matches a standard color scheme.\n * (If the layout specifies categories that do not match the data, the user specified categories will be ignored)\n *\n * This method will only act if the layout defines a `categorical_bin` scale function for coloring. It may be\n * overridden in a subclass to suit other types of coloring methods.\n *\n * @param {String[]} categoryNames\n * @private\n */\n _setDynamicColorScheme: function(categoryNames) {\n var colorParams = this.layout.color.parameters;\n var baseParams = this._base_layout.color.parameters;\n\n // If the layout does not use a supported coloring scheme, or is already complete, this method should do nothing\n if (this.layout.color.scale_function !== \"categorical_bin\") {\n throw \"This layer requires that coloring be specified as a `categorical_bin`\";\n }\n\n if (baseParams.categories.length && baseParams.values.length) {\n // If there are preset category/color combos, make sure that they apply to the actual dataset\n var parameters_categories_hash = {};\n baseParams.categories.forEach(function (category) { parameters_categories_hash[category] = 1; });\n if (categoryNames.every(function (name) { return parameters_categories_hash.hasOwnProperty(name); })) {\n // The layout doesn't have to specify categories in order, but make sure they are all there\n colorParams.categories = baseParams.categories;\n } else {\n colorParams.categories = categoryNames;\n }\n } else {\n colorParams.categories = categoryNames;\n }\n // Prefer user-specified colors if provided. Make sure that there are enough colors for all the categories.\n var colors;\n if (baseParams.values.length) {\n colors = baseParams.values;\n } else {\n var color_scale = categoryNames.length <= 10 ? d3.scale.category10 : d3.scale.category20;\n colors = color_scale().range();\n }\n while (colors.length < categoryNames.length) { colors = colors.concat(colors); }\n colors = colors.slice(0, categoryNames.length); // List of hex values, should be of same length as categories array\n colorParams.values = colors;\n },\n\n /**\n *\n * @param dimension\n * @param {Object} [config] Parameters that customize how ticks are calculated (not style)\n * @param {('left'|'center'|'right')} [config.position='left'] Align ticks with the center or edge of category\n * @returns {Array}\n */\n getTicks: function(dimension, config) { // Overrides parent method\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw \"Invalid dimension identifier\";\n }\n var position = config.position || \"left\";\n if ([\"left\", \"center\", \"right\"].indexOf(position) === -1) {\n throw \"Invalid tick position\";\n }\n\n var categoryBounds = this._categories;\n if (!categoryBounds || !Object.keys(categoryBounds).length) {\n return [];\n }\n\n if (dimension === \"y\") {\n return [];\n }\n\n if (dimension === \"x\") {\n // If colors have been defined by this layer, use them to make tick colors match scatterplot point colors\n var knownCategories = this.layout.color.parameters.categories || [];\n var knownColors = this.layout.color.parameters.values || [];\n\n return Object.keys(categoryBounds).map(function (category, index) {\n var bounds = categoryBounds[category];\n var xPos;\n\n switch(position) {\n case \"left\":\n xPos = bounds[0];\n break;\n case \"center\":\n // Center tick under one or many elements as appropriate\n var diff = bounds[1] - bounds[0];\n xPos = bounds[0] + (diff !== 0 ? diff : bounds[0]) / 2;\n break;\n case \"right\":\n xPos = bounds[1];\n break;\n }\n return {\n x: xPos,\n text: category,\n style: {\n \"fill\": knownColors[knownCategories.indexOf(category)] || \"#000000\"\n }\n };\n });\n }\n },\n\n applyCustomDataMethods: function() {\n this.data = this._prepareData();\n /**\n * Define category names and extents (boundaries) for plotting. TODO: properties in constructor\n * @member {Object.} Category names and extents, in the form {category_name: [min_x, max_x]}\n */\n this._categories = this._generateCategoryBounds();\n return this;\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n *\n * LocusZoom has various singleton objects that are used for registering functions or classes.\n * These objects provide safe, standard methods to redefine or delete existing functions/classes\n * as well as define new custom functions/classes to be used in a plot.\n *\n * @namespace Singletons\n */\n\n\n/*\n * The Collection of \"Known\" Data Sources. This registry is used internally by the `DataSources` class\n * @class\n * @static\n */\nLocusZoom.KnownDataSources = (function() {\n /** @lends LocusZoom.KnownDataSources */\n var obj = {};\n /* @member {function[]} */\n var sources = [];\n\n var findSourceByName = function(x) {\n for(var i=0; i 1) {\n return function(x) {\n var val = x;\n for(var i = 0; i 1) {\n log = Math.ceil(Math.log(abs) / Math.LN10);\n } else { // 0...1\n log = Math.floor(Math.log(abs) / Math.LN10);\n }\n if (Math.abs(log) <= 3){\n return x.toFixed(3);\n } else {\n return x.toExponential(2).replace(\"+\", \"\").replace(\"e\", \" × 10^\");\n }\n});\n\n/**\n * URL-encode the provided text, eg for constructing hyperlinks\n * @function urlencode\n * @param {String} str\n */\nLocusZoom.TransformationFunctions.add(\"urlencode\", function(str) {\n return encodeURIComponent(str);\n});\n\n/**\n * HTML-escape user entered values for use in constructed HTML fragments\n *\n * For example, this filter can be used on tooltips with custom HTML display\n * @function htmlescape\n * @param {String} str HTML-escape the provided value\n */\nLocusZoom.TransformationFunctions.add(\"htmlescape\", function(str) {\n if ( !str ) {\n return \"\";\n }\n str = str + \"\";\n\n return str.replace( /['\"<>&`]/g, function( s ) {\n switch ( s ) {\n case \"'\":\n return \"'\";\n case \"\\\"\":\n return \""\";\n case \"<\":\n return \"<\";\n case \">\":\n return \">\";\n case \"&\":\n return \"&\";\n case \"`\":\n return \"`\";\n }\n });\n});\n\n/**\n * Singleton for accessing/storing functions that will convert arbitrary data points to values in a given scale\n * Useful for anything that needs to scale discretely with data (e.g. color, point size, etc.)\n *\n * A Scale Function can be thought of as a modifier to a layout directive that adds extra logic to how a piece of data\n * can be resolved to a value.\n *\n * All scale functions must accept an object of parameters and a value to process.\n * @class\n * @static\n */\nLocusZoom.ScaleFunctions = (function() {\n /** @lends LocusZoom.ScaleFunctions */\n var obj = {};\n var functions = {};\n\n /**\n * Find a scale function and return it. If parameters and values are passed, calls the function directly; otherwise\n * returns a callable.\n * @param {String} name\n * @param {Object} [parameters] Configuration parameters specific to the specified scale function\n * @param {*} [value] The value to operate on\n * @returns {*}\n */\n obj.get = function(name, parameters, value) {\n if (!name) {\n return null;\n } else if (functions[name]) {\n if (typeof parameters === \"undefined\" && typeof value === \"undefined\"){\n return functions[name];\n } else {\n return functions[name](parameters, value);\n }\n } else {\n throw(\"scale function [\" + name + \"] not found\");\n }\n };\n\n /**\n * @protected\n * @param {String} name The name of the function to set/unset\n * @param {Function} [fn] The function to register. If blank, removes this function name from the registry.\n */\n obj.set = function(name, fn) {\n if (fn) {\n functions[name] = fn;\n } else {\n delete functions[name];\n }\n };\n\n /**\n * Add a new scale function to the registry\n * @param {String} name The name of the scale function\n * @param {function} fn A scale function that accepts two parameters: an object of configuration and a value\n */\n obj.add = function(name, fn) {\n if (functions[name]) {\n throw(\"scale function already exists with name: \" + name);\n } else {\n obj.set(name, fn);\n }\n };\n\n /**\n * List the names of all registered scale functions\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(functions);\n };\n\n return obj;\n})();\n\n/**\n * Basic conditional function to evaluate the value of the input field and return based on equality.\n * @param {Object} parameters\n * @param {*} parameters.field_value The value against which to test the input value.\n * @param {*} parameters.then The value to return if the input value matches the field value\n * @param {*} parameters.else The value to return if the input value does not match the field value. Optional. If not\n * defined this scale function will return null (or value of null_value parameter, if defined) when input value fails\n * to match field_value.\n * @param {*} input value\n */\nLocusZoom.ScaleFunctions.add(\"if\", function(parameters, input){\n if (typeof input == \"undefined\" || parameters.field_value !== input){\n if (typeof parameters.else != \"undefined\"){\n return parameters.else;\n } else {\n return null;\n }\n } else {\n return parameters.then;\n }\n});\n\n/**\n * Function to sort numerical values into bins based on numerical break points. Will only operate on numbers and\n * return null (or value of null_value parameter, if defined) if provided a non-numeric input value. Parameters:\n * @function numerical_bin\n * @param {Object} parameters\n * @param {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter. If the input value is greater than or equal to break n and less than\n * or equal to break n+1 (or break n+1 doesn't exist) then returned value is the nth entry in the values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against break points. Must be of\n * equal length to breaks parameter. Each entry n represents the value to return if the input value is greater than\n * or equal to break n and less than or equal to break n+1 (or break n+1 doesn't exist).\n * @param {*} null_value\n * @param {*} input value\n * @returns\n */\nLocusZoom.ScaleFunctions.add(\"numerical_bin\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){\n return (parameters.null_value ? parameters.null_value : null);\n }\n var threshold = breaks.reduce(function(prev, curr){\n if (+input < prev || (+input >= prev && +input < curr)){\n return prev;\n } else {\n return curr;\n }\n });\n return values[breaks.indexOf(threshold)];\n});\n\n/**\n * Function to sort values of any type into bins based on direct equality testing with a list of categories.\n * Will return null if provided an input value that does not match to a listed category.\n * @function categorical_bin\n * @param {Object} parameters\n * @param {Array} parameters.categories Array of values against which to evaluate the input value. Must be of equal\n * length to values parameter. If the input value is equal to category n then returned value is the nth entry in the\n * values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against categories. Must be of equal\n * length to categories parameter. Each entry n represents the value to return if the input value is equal to the nth\n * value in the categories parameter.\n * @param {*} parameters.null_value Value to return if the input value fails to match to any categories. Optional.\n */\nLocusZoom.ScaleFunctions.add(\"categorical_bin\", function(parameters, value){\n if (typeof value == \"undefined\" || parameters.categories.indexOf(value) === -1){\n return (parameters.null_value ? parameters.null_value : null); \n } else {\n return parameters.values[parameters.categories.indexOf(value)];\n }\n});\n\n/**\n * Function for continuous interpolation of numerical values along a gradient with arbitrarily many break points.\n * @function interpolate\n * @parameters {Object} parameters\n * @parameters {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter and contain at least two elements. Input value will be evaluated for\n * relative position between two break points n and n+1 and the returned value will be interpolated at a relative\n * position between values n and n+1.\n * @parameters {*[]} parameters.values Array of values to interpolate and return given evaluations against break\n * points. Must be of equal length to breaks parameter and contain at least two elements. Each entry n represents\n * the value to return if the input value matches the nth entry in breaks exactly. Note that this scale function\n * uses d3.interpolate to provide for effective interpolation of many different value types, including numbers,\n * colors, shapes, etc.\n * @parameters {*} parameters.null_value\n */\nLocusZoom.ScaleFunctions.add(\"interpolate\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n var nullval = (parameters.null_value ? parameters.null_value : null);\n if (breaks.length < 2 || breaks.length !== values.length){ return nullval; }\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){ return nullval; }\n if (+input <= parameters.breaks[0]){\n return values[0];\n } else if (+input >= parameters.breaks[parameters.breaks.length-1]){\n return values[breaks.length-1];\n } else {\n var upper_idx = null;\n breaks.forEach(function(brk, idx){\n if (!idx){ return; }\n if (breaks[idx-1] <= +input && breaks[idx] >= +input){ upper_idx = idx; }\n });\n if (upper_idx === null){ return nullval; }\n var normalized_input = (+input - breaks[upper_idx-1]) / (breaks[upper_idx] - breaks[upper_idx-1]);\n if (!isFinite(normalized_input)){ return nullval; }\n return d3.interpolate(values[upper_idx-1], values[upper_idx])(normalized_input);\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A Dashboard is an HTML element used for presenting arbitrary user interface components. Dashboards are anchored\n * to either the entire Plot or to individual Panels.\n *\n * Each dashboard is an HTML-based (read: not SVG) collection of components used to display information or provide\n * user interface. Dashboards can exist on entire plots, where their visibility is permanent and vertically adjacent\n * to the plot, or on individual panels, where their visibility is tied to a behavior (e.g. a mouseover) and is as\n * an overlay.\n * @class\n */\nLocusZoom.Dashboard = function(parent){\n // parent must be a locuszoom plot or panel\n if (!(parent instanceof LocusZoom.Plot) && !(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create dashboard, parent must be a locuszoom plot or panel\";\n }\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".dashboard\";\n /** @member {('plot'|'panel')} */\n this.type = (this.parent instanceof LocusZoom.Plot) ? \"plot\" : \"panel\";\n /** @member {LocusZoom.Plot} */\n this.parent_plot = this.type === \"plot\" ? this.parent : this.parent.parent;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {LocusZoom.Dashboard.Component[]} */\n this.components = [];\n /**\n * The timer identifier as returned by setTimeout\n * @member {Number}\n */\n this.hide_timeout = null;\n /**\n * Whether to hide the dashboard. Can be overridden by a child component. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n\n // TODO: Return value from constructor function?\n return this.initialize();\n};\n\n/**\n * Prepare the dashboard for first use: generate all component instances for this dashboard, based on the provided\n * layout of the parent. Connects event listeners and shows/hides as appropriate.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.initialize = function() {\n // Parse layout to generate component instances\n if (Array.isArray(this.parent.layout.dashboard.components)){\n this.parent.layout.dashboard.components.forEach(function(layout){\n try {\n var component = LocusZoom.Dashboard.Components.get(layout.type, layout, this);\n this.components.push(component);\n } catch (e) {\n console.warn(e);\n }\n }.bind(this));\n }\n\n // Add mouseover event handlers to show/hide panel dashboard\n if (this.type === \"panel\"){\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseover.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n if (!this.selector || this.selector.style(\"visibility\") === \"hidden\"){ this.show(); }\n }.bind(this));\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseout.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n this.hide_timeout = setTimeout(function(){ this.hide(); }.bind(this), 300);\n }.bind(this));\n }\n\n return this;\n\n};\n\n/**\n * Whether to persist the dashboard. Returns true if at least one component should persist, or if the panel is engaged\n * in an active drag event.\n * @returns {boolean}\n */\nLocusZoom.Dashboard.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n var persist = false;\n // Persist if at least one component should also persist\n this.components.forEach(function(component){\n persist = persist || component.shouldPersist();\n });\n // Persist if in a parent drag event\n persist = persist || (this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.dragging);\n return !!persist;\n};\n\n/**\n * Make the dashboard appear. If it doesn't exist yet create it, including creating/positioning all components within,\n * and make sure it is set to be visible.\n */\nLocusZoom.Dashboard.prototype.show = function(){\n if (!this.selector){\n switch (this.type){\n case \"plot\":\n this.selector = d3.select(this.parent.svg.node().parentNode)\n .insert(\"div\",\":first-child\");\n break;\n case \"panel\":\n this.selector = d3.select(this.parent.parent.svg.node().parentNode)\n .insert(\"div\", \".lz-data_layer-tooltip, .lz-dashboard-menu, .lz-curtain\").classed(\"lz-panel-dashboard\", true);\n break;\n }\n this.selector.classed(\"lz-dashboard\", true).classed(\"lz-\"+this.type+\"-dashboard\", true).attr(\"id\", this.id);\n }\n this.components.forEach(function(component){ component.show(); });\n this.selector.style({ visibility: \"visible\" });\n return this.update();\n};\n\n/**\n * Update the dashboard and rerender all child components. This can be called whenever plot state changes.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.update = function(){\n if (!this.selector){ return this; }\n this.components.forEach(function(component){ component.update(); });\n return this.position();\n};\n\n/**\n * Position the dashboard (and child components) within the panel\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.position = function(){\n if (!this.selector){ return this; }\n // Position the dashboard itself (panel only)\n if (this.type === \"panel\"){\n var page_origin = this.parent.getPageOrigin();\n var top = (page_origin.y + 3.5).toString() + \"px\";\n var left = page_origin.x.toString() + \"px\";\n var width = (this.parent.layout.width - 4).toString() + \"px\";\n this.selector.style({ position: \"absolute\", top: top, left: left, width: width });\n }\n // Recursively position components\n this.components.forEach(function(component){ component.position(); });\n return this;\n};\n\n/**\n * Hide the dashboard (make invisible but do not destroy). Will do nothing if `shouldPersist` returns true.\n *\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n this.components.forEach(function(component){ component.hide(); });\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n\n/**\n * Completely remove dashboard and all child components. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n this.components.forEach(function(component){ component.destroy(true); });\n this.components = [];\n this.selector.remove();\n this.selector = null;\n return this;\n};\n\n/**\n *\n * A dashboard component is an empty div rendered on a dashboard that can display custom\n * html of user interface elements. LocusZoom.Dashboard.Components is a singleton used to\n * define and manage an extendable collection of dashboard components.\n * (e.g. by LocusZoom.Dashboard.Components.add())\n * @class\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @param {('left'|'right')} [layout.position='left'] Whether to float the component left or right.\n * @param {('start'|'middle'|'end')} [layout.group_position] Buttons can optionally be gathered into a visually\n * distinctive group whose elements are closer together. If a button is identified as the start or end of a group,\n * it will be drawn with rounded corners and an extra margin of spacing from any button not part of the group.\n * For example, the region_nav_plot dashboard is a defined as a group.\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple'} [layout.color='gray'] Color scheme for the\n * component. Applies to buttons and menus.\n * @param {LocusZoom.Dashboard} parent The dashboard that contains this component\n*/\nLocusZoom.Dashboard.Component = function(layout, parent) {\n /** @member {Object} */\n this.layout = layout || {};\n if (!this.layout.color){ this.layout.color = \"gray\"; }\n\n /** @member {LocusZoom.Dashboard|*} */\n this.parent = parent || null;\n /**\n * Some dashboards are attached to a panel, rather than directly to a plot\n * @member {LocusZoom.Panel|null}\n */\n this.parent_panel = null;\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n /**\n * This is a reference to either the panel or the plot, depending on what the dashboard is\n * tied to. Useful when absolutely positioning dashboard components relative to their SVG anchor.\n * @member {LocusZoom.Plot|LocusZoom.Panel}\n */\n this.parent_svg = null;\n if (this.parent instanceof LocusZoom.Dashboard){\n // TODO: when is the immediate parent *not* a dashboard?\n if (this.parent.type === \"panel\"){\n this.parent_panel = this.parent.parent;\n this.parent_plot = this.parent.parent.parent;\n this.parent_svg = this.parent_panel;\n } else {\n this.parent_plot = this.parent.parent;\n this.parent_svg = this.parent_plot;\n }\n }\n /** @member {d3.selection} */\n this.selector = null;\n /**\n * If this is an interactive component, it will contain a button or menu instance that handles the interactivity.\n * There is a 1-to-1 relationship of dashboard component to button\n * @member {null|LocusZoom.Dashboard.Component.Button}\n */\n this.button = null;\n /**\n * If any single component is marked persistent, it will bubble up to prevent automatic hide behavior on a\n * component's parent dashboard. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n if (!this.layout.position){ this.layout.position = \"left\"; }\n\n // TODO: Return value in constructor\n return this;\n};\n/**\n * Perform all rendering of component, including toggling visibility to true. Will initialize and create SVG element\n * if necessary, as well as updating with new data and performing layout actions.\n */\nLocusZoom.Dashboard.Component.prototype.show = function(){\n if (!this.parent || !this.parent.selector){ return; }\n if (!this.selector){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.layout.group_position) !== -1 ? \" lz-dashboard-group-\" + this.layout.group_position : \"\");\n this.selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-\" + this.layout.position + group_position);\n if (this.layout.style){ this.selector.style(this.layout.style); }\n if (typeof this.initialize == \"function\"){ this.initialize(); }\n }\n if (this.button && this.button.status === \"highlighted\"){ this.button.menu.show(); }\n this.selector.style({ visibility: \"visible\" });\n this.update();\n return this.position();\n};\n/**\n * Update the dashboard component with any new data or plot state as appropriate. This method performs all\n * necessary rendering steps.\n */\nLocusZoom.Dashboard.Component.prototype.update = function(){ /* stub */ };\n/**\n * Place the component correctly in the plot\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.position = function(){\n if (this.button){ this.button.menu.position(); }\n return this;\n};\n/**\n * Determine whether the component should persist (will bubble up to parent dashboard)\n * @returns {boolean}\n */\nLocusZoom.Dashboard.Component.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n if (this.button && this.button.persist){ return true; }\n return false;\n};\n/**\n * Toggle visibility to hidden, unless marked as persistent\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n if (this.button){ this.button.menu.hide(); }\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n/**\n * Completely remove component and button. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.Component.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n if (this.button && this.button.menu){ this.button.menu.destroy(); }\n this.selector.remove();\n this.selector = null;\n this.button = null;\n return this;\n};\n\n/**\n * Singleton registry of all known components\n * @class\n * @static\n */\nLocusZoom.Dashboard.Components = (function() {\n /** @lends LocusZoom.Dashboard.Components */\n var obj = {};\n var components = {};\n\n /**\n * Create a new component instance by name\n * @param {String} name The string identifier of the desired component\n * @param {Object} layout The layout to use to create the component\n * @param {LocusZoom.Dashboard} parent The containing dashboard to use when creating the component\n * @returns {LocusZoom.Dashboard.Component}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (components[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for dashboard component [\" + name + \"]\");\n } else {\n return new components[name](layout, parent);\n }\n } else {\n throw(\"dashboard component [\" + name + \"] not found\");\n }\n };\n /**\n * Add a new component constructor to the registry and ensure that it extends the correct parent class\n * @protected\n * @param name\n * @param component\n */\n obj.set = function(name, component) {\n if (component) {\n if (typeof component != \"function\"){\n throw(\"unable to set dashboard component [\" + name + \"], argument provided is not a function\");\n } else {\n components[name] = component;\n components[name].prototype = new LocusZoom.Dashboard.Component();\n }\n } else {\n delete components[name];\n }\n };\n\n /**\n * Register a new component constructor by name\n * @param {String} name\n * @param {function} component The component constructor\n */\n obj.add = function(name, component) {\n if (components[name]) {\n throw(\"dashboard component already exists with name: \" + name);\n } else {\n obj.set(name, component);\n }\n };\n\n /**\n * List the names of all registered components\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(components);\n };\n\n return obj;\n})();\n\n/**\n * Plots and panels may have a \"dashboard\" element suited for showing HTML components that may be interactive.\n * When components need to incorporate a generic button, or additionally a button that generates a menu, this\n * class provides much of the necessary framework.\n * @class\n * @param {LocusZoom.Dashboard.Component} parent\n */\nLocusZoom.Dashboard.Component.Button = function(parent) { \n \n if (!(parent instanceof LocusZoom.Dashboard.Component)){\n throw \"Unable to create dashboard component button, invalid parent\";\n }\n /** @member {LocusZoom.Dashboard.Component} */\n this.parent = parent;\n /** @member {LocusZoom.Dashboard.Panel} */\n this.parent_panel = this.parent.parent_panel;\n /** @member {LocusZoom.Dashboard.Plot} */\n this.parent_plot = this.parent.parent_plot;\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent_svg = this.parent.parent_svg;\n\n /** @member {LocusZoom.Dashboard|null|*} */\n this.parent_dashboard = this.parent.parent;\n /** @member {d3.selection} */\n this.selector = null;\n\n /**\n * Tag to use for the button (default: a)\n * @member {String}\n */\n this.tag = \"a\";\n\n /**\n * TODO This method does not appear to be used anywhere\n * @param {String} tag\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTag = function(tag){\n if (typeof tag != \"undefined\"){ this.tag = tag.toString(); }\n return this;\n };\n\n /**\n * HTML for the button to show.\n * @protected\n * @member {String}\n */\n this.html = \"\";\n /**\n * Specify the HTML content of this button.\n * WARNING: The string provided will be inserted into the document as raw markup; XSS mitigation is the\n * responsibility of each button implementation.\n * @param {String} html\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setHtml = function(html){\n if (typeof html != \"undefined\"){ this.html = html.toString(); }\n return this;\n };\n /**\n * @deprecated since 0.5.6; use setHTML instead\n */\n this.setText = this.setHTML;\n\n /**\n * Mouseover title text for the button to show\n * @protected\n * @member {String}\n */\n this.title = \"\";\n /**\n * Set the mouseover title text for the button (if any)\n * @param {String} title Simple text to display\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTitle = function(title){\n if (typeof title != \"undefined\"){ this.title = title.toString(); }\n return this;\n };\n\n /**\n * Color of the button\n * @member {String}\n */\n this.color = \"gray\";\n\n /**\n * Set the color associated with this button\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple')} color Any selection not in the preset list\n * will be replaced with gray.\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setColor = function(color){\n if (typeof color != \"undefined\"){\n if ([\"gray\", \"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"purple\"].indexOf(color) !== -1){ this.color = color; }\n else { this.color = \"gray\"; }\n }\n return this;\n };\n\n /**\n * Hash of arbitrary button styles to apply as {name: value} entries\n * @protected\n * @member {Object}\n */\n this.style = {};\n /**\n * Set a collection of custom styles to be used by the button\n * @param {Object} style Hash of {name:value} entries\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setStyle = function(style){\n if (typeof style != \"undefined\"){ this.style = style; }\n return this;\n };\n\n //\n /**\n * Method to generate a CSS class string\n * @returns {string}\n */\n this.getClass = function(){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.parent.layout.group_position) !== -1 ? \" lz-dashboard-button-group-\" + this.parent.layout.group_position : \"\");\n return \"lz-dashboard-button lz-dashboard-button-\" + this.color + (this.status ? \"-\" + this.status : \"\") + group_position;\n };\n\n // Permanence\n /**\n * Track internal state on whether to keep showing the button/ menu contents at the moment\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n /**\n * Configuration when defining a button: track whether this component should be allowed to keep open\n * menu/button contents in response to certain events\n * @protected\n * @member {Boolean}\n */\n this.permanent = false;\n /**\n * Allow code to change whether the button is allowed to be `permanent`\n * @param {boolean} bool\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setPermanent = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n this.permanent = bool;\n if (this.permanent){ this.persist = true; }\n return this;\n };\n /**\n * Determine whether the button/menu contents should persist in response to a specific event\n * @returns {Boolean}\n */\n this.shouldPersist = function(){\n return this.permanent || this.persist;\n };\n\n /**\n * Button status (highlighted / disabled/ etc)\n * @protected\n * @member {String}\n */\n this.status = \"\";\n /**\n * Change button state\n * @param {('highlighted'|'disabled'|'')} status\n */\n this.setStatus = function(status){\n if (typeof status != \"undefined\" && [\"\", \"highlighted\", \"disabled\"].indexOf(status) !== -1){ this.status = status; }\n return this.update();\n };\n /**\n * Toggle whether the button is highlighted\n * @param {boolean} bool If provided, explicitly set highlighted state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.highlight = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"highlighted\"); }\n else if (this.status === \"highlighted\"){ return this.setStatus(\"\"); }\n return this;\n };\n /**\n * Toggle whether the button is disabled\n * @param {boolean} bool If provided, explicitly set disabled state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.disable = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"disabled\"); }\n else if (this.status === \"disabled\"){ return this.setStatus(\"\"); }\n return this;\n };\n\n // Mouse events\n /** @member {function} */\n this.onmouseover = function(){};\n this.setOnMouseover = function(onmouseover){\n if (typeof onmouseover == \"function\"){ this.onmouseover = onmouseover; }\n else { this.onmouseover = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onmouseout = function(){};\n this.setOnMouseout = function(onmouseout){\n if (typeof onmouseout == \"function\"){ this.onmouseout = onmouseout; }\n else { this.onmouseout = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onclick = function(){};\n this.setOnclick = function(onclick){\n if (typeof onclick == \"function\"){ this.onclick = onclick; }\n else { this.onclick = function(){}; }\n return this;\n };\n \n // Primary behavior functions\n /**\n * Show the button, including creating DOM elements if necessary for first render\n */\n this.show = function(){\n if (!this.parent){ return; }\n if (!this.selector){\n this.selector = this.parent.selector.append(this.tag).attr(\"class\", this.getClass());\n }\n return this.update();\n };\n /**\n * Hook for any actions or state cleanup to be performed before rerendering\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.preUpdate = function(){ return this; };\n /**\n * Update button state and contents, and fully rerender\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.update = function(){\n if (!this.selector){ return this; }\n this.preUpdate();\n this.selector\n .attr(\"class\", this.getClass())\n .attr(\"title\", this.title).style(this.style)\n .on(\"mouseover\", (this.status === \"disabled\") ? null : this.onmouseover)\n .on(\"mouseout\", (this.status === \"disabled\") ? null : this.onmouseout)\n .on(\"click\", (this.status === \"disabled\") ? null : this.onclick)\n .html(this.html);\n this.menu.update();\n this.postUpdate();\n return this;\n };\n /**\n * Hook for any behavior to be added/changed after the button has been re-rendered\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.postUpdate = function(){ return this; };\n /**\n * Hide the button by removing it from the DOM (may be overridden by current persistence setting)\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.hide = function(){\n if (this.selector && !this.shouldPersist()){\n this.selector.remove();\n this.selector = null;\n }\n return this;\n }; \n\n /**\n * Button Menu Object\n * The menu is an HTML overlay that can appear below a button. It can contain arbitrary HTML and\n * has logic to be automatically positioned and sized to behave more or less like a dropdown menu.\n * @member {Object}\n */\n this.menu = {\n outer_selector: null,\n inner_selector: null,\n scroll_position: 0,\n hidden: true,\n /**\n * Show the button menu, including setting up any DOM elements needed for first rendering\n */\n show: function(){\n if (!this.menu.outer_selector){\n this.menu.outer_selector = d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu lz-dashboard-menu-\" + this.color)\n .attr(\"id\", this.parent_svg.getBaseId() + \".dashboard.menu\");\n this.menu.inner_selector = this.menu.outer_selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu-content\");\n this.menu.inner_selector.on(\"scroll\", function(){\n this.menu.scroll_position = this.menu.inner_selector.node().scrollTop;\n }.bind(this));\n }\n this.menu.outer_selector.style({ visibility: \"visible\" });\n this.menu.hidden = false;\n return this.menu.update();\n }.bind(this),\n /**\n * Update the rendering of the menu\n */\n update: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.populate(); // This function is stubbed for all buttons by default and custom implemented in component definition\n if (this.menu.inner_selector){ this.menu.inner_selector.node().scrollTop = this.menu.scroll_position; }\n return this.menu.position();\n }.bind(this),\n position: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n // Unset any explicitly defined outer selector height so that menus dynamically shrink if content is removed\n this.menu.outer_selector.style({ height: null });\n var padding = 3;\n var scrollbar_padding = 20;\n var menu_height_padding = 14; // 14: 2x 6px padding, 2x 1px border\n var page_origin = this.parent_svg.getPageOrigin();\n var page_scroll_top = document.documentElement.scrollTop || document.body.scrollTop;\n var container_offset = this.parent_plot.getContainerOffset();\n var dashboard_client_rect = this.parent_dashboard.selector.node().getBoundingClientRect();\n var button_client_rect = this.selector.node().getBoundingClientRect();\n var menu_client_rect = this.menu.outer_selector.node().getBoundingClientRect();\n var total_content_height = this.menu.inner_selector.node().scrollHeight;\n var top = 0; var left = 0;\n if (this.parent_dashboard.type === \"panel\"){\n top = (page_origin.y + dashboard_client_rect.height + (2 * padding));\n left = Math.max(page_origin.x + this.parent_svg.layout.width - menu_client_rect.width - padding, page_origin.x + padding);\n } else {\n top = button_client_rect.bottom + page_scroll_top + padding - container_offset.top;\n left = Math.max(button_client_rect.left + button_client_rect.width - menu_client_rect.width - container_offset.left, page_origin.x + padding);\n }\n var base_max_width = Math.max(this.parent_svg.layout.width - (2 * padding) - scrollbar_padding, scrollbar_padding);\n var container_max_width = base_max_width;\n var content_max_width = (base_max_width - (4 * padding));\n var base_max_height = Math.max(this.parent_svg.layout.height - (10 * padding) - menu_height_padding, menu_height_padding);\n var height = Math.min(total_content_height, base_max_height);\n var max_height = base_max_height;\n this.menu.outer_selector.style({\n \"top\": top.toString() + \"px\",\n \"left\": left.toString() + \"px\",\n \"max-width\": container_max_width.toString() + \"px\",\n \"max-height\": max_height.toString() + \"px\",\n \"height\": height.toString() + \"px\"\n });\n this.menu.inner_selector.style({ \"max-width\": content_max_width.toString() + \"px\" });\n this.menu.inner_selector.node().scrollTop = this.menu.scroll_position;\n return this.menu;\n }.bind(this),\n hide: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.outer_selector.style({ visibility: \"hidden\" });\n this.menu.hidden = true;\n return this.menu;\n }.bind(this),\n destroy: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.inner_selector.remove();\n this.menu.outer_selector.remove();\n this.menu.inner_selector = null;\n this.menu.outer_selector = null;\n return this.menu;\n }.bind(this),\n /**\n * Internal method definition\n * By convention populate() does nothing and should be reimplemented with each dashboard button definition\n * Reimplement by way of Dashboard.Component.Button.menu.setPopulate to define the populate method and hook\n * up standard menu click-toggle behavior prototype.\n * @protected\n */\n populate: function(){ /* stub */ }.bind(this),\n /**\n * Define how the menu is populated with items, and set up click and display properties as appropriate\n * @public\n */\n setPopulate: function(menu_populate_function){\n if (typeof menu_populate_function == \"function\"){\n this.menu.populate = menu_populate_function;\n this.setOnclick(function(){\n if (this.menu.hidden){\n this.menu.show();\n this.highlight().update();\n this.persist = true;\n } else {\n this.menu.hide();\n this.highlight(false).update();\n if (!this.permanent){ this.persist = false; }\n }\n }.bind(this));\n } else {\n this.setOnclick();\n }\n return this;\n }.bind(this)\n };\n\n};\n\n/**\n * Renders arbitrary text with title formatting\n * @class LocusZoom.Dashboard.Components.title\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.title Text to render\n */\nLocusZoom.Dashboard.Components.add(\"title\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.show = function(){\n this.div_selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-title lz-dashboard-\" + this.layout.position);\n this.title_selector = this.div_selector.append(\"h3\");\n return this.update();\n };\n this.update = function(){\n var title = layout.title.toString();\n if (this.layout.subtitle){ title += \" \" + this.layout.subtitle + \"\"; }\n this.title_selector.html(title);\n return this;\n };\n});\n\n/**\n * Renders text to display the current dimensions of the plot. Automatically updated as plot dimensions change\n * @class LocusZoom.Dashboard.Components.dimensions\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"dimensions\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var display_width = this.parent_plot.layout.width.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.width : this.parent_plot.layout.width.toFixed(2);\n var display_height = this.parent_plot.layout.height.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.height : this.parent_plot.layout.height.toFixed(2);\n this.selector.html(display_width + \"px × \" + display_height + \"px\");\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Display the current scale of the genome region displayed in the plot, as defined by the difference between\n * `state.end` and `state.start`.\n * @class LocusZoom.Dashboard.Components.region_scale\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"region_scale\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (!isNaN(this.parent_plot.state.start) && !isNaN(this.parent_plot.state.end)\n && this.parent_plot.state.start !== null && this.parent_plot.state.end !== null){\n this.selector.style(\"display\", null);\n this.selector.html(LocusZoom.positionIntToString(this.parent_plot.state.end - this.parent_plot.state.start, null, true));\n } else {\n this.selector.style(\"display\", \"none\");\n }\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Button to export current plot to an SVG image\n * @class LocusZoom.Dashboard.Components.download\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"download\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Download Image\").setTitle(\"Download image of the current plot as locuszoom.svg\")\n .setOnMouseover(function() {\n this.button.selector\n .classed(\"lz-dashboard-button-gray-disabled\", true)\n .html(\"Preparing Image\");\n this.generateBase64SVG().then(function(base64_string){\n this.button.selector\n .attr(\"href\", \"data:image/svg+xml;base64,\\n\" + base64_string)\n .classed(\"lz-dashboard-button-gray-disabled\", false)\n .classed(\"lz-dashboard-button-gray-highlighted\", true)\n .html(\"Download Image\");\n }.bind(this));\n }.bind(this))\n .setOnMouseout(function() {\n this.button.selector.classed(\"lz-dashboard-button-gray-highlighted\", false);\n }.bind(this));\n this.button.show();\n this.button.selector.attr(\"href-lang\", \"image/svg+xml\").attr(\"download\", \"locuszoom.svg\");\n return this;\n };\n this.css_string = \"\";\n for (var stylesheet in Object.keys(document.styleSheets)){\n if ( document.styleSheets[stylesheet].href !== null\n && document.styleSheets[stylesheet].href.indexOf(\"locuszoom.css\") !== -1){\n // TODO: \"Download image\" button will render the image incorrectly if the stylesheet has been renamed or concatenated\n LocusZoom.createCORSPromise(\"GET\", document.styleSheets[stylesheet].href)\n .then(function(response){\n this.css_string = response.replace(/[\\r\\n]/g,\" \").replace(/\\s+/g,\" \");\n if (this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\")){\n this.css_string = this.css_string.substring(0, this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\"));\n }\n }.bind(this));\n break;\n }\n } \n this.generateBase64SVG = function(){\n return Q.fcall(function () {\n // Insert a hidden div, clone the node into that so we can modify it with d3\n var container = this.parent.selector.append(\"div\").style(\"display\", \"none\")\n .html(this.parent_plot.svg.node().outerHTML);\n // Remove unnecessary elements\n container.selectAll(\"g.lz-curtain\").remove();\n container.selectAll(\"g.lz-mouse_guide\").remove();\n // Convert units on axis tick dy attributes from ems to pixels\n container.selectAll(\"g.tick text\").each(function(){\n var dy = +(d3.select(this).attr(\"dy\").substring(-2).slice(0,-2))*10;\n d3.select(this).attr(\"dy\", dy);\n });\n // Pull the svg into a string and add the contents of the locuszoom stylesheet\n // Don't add this with d3 because it will escape the CDATA declaration incorrectly\n var initial_html = d3.select(container.select(\"svg\").node().parentNode).html();\n var style_def = \"\";\n var insert_at = initial_html.indexOf(\">\") + 1;\n initial_html = initial_html.slice(0,insert_at) + style_def + initial_html.slice(insert_at);\n // Delete the container node\n container.remove();\n // Base64-encode the string and return it\n return btoa(encodeURIComponent(initial_html).replace(/%([0-9A-F]{2})/g, function(match, p1) {\n return String.fromCharCode(\"0x\" + p1);\n }));\n }.bind(this));\n };\n});\n\n/**\n * Button to remove panel from plot.\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.remove_panel\n * @augments LocusZoom.Dashboard.Component\n * @param {Boolean} [layout.suppress_confirm=false] If true, removes the panel without prompting user for confirmation\n */\nLocusZoom.Dashboard.Components.add(\"remove_panel\", function(layout) {\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function() {\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"×\").setTitle(\"Remove panel\")\n .setOnclick(function(){\n if (!layout.suppress_confirm && !confirm(\"Are you sure you want to remove this panel? This cannot be undone!\")){\n return false;\n }\n var panel = this.parent_panel;\n panel.dashboard.hide(true);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseover.\" + panel.getBaseId() + \".dashboard\", null);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseout.\" + panel.getBaseId() + \".dashboard\", null);\n return panel.parent.removePanel(panel.id);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to move panel up relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_up\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_up\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_top = (this.parent_panel.layout.y_index === 0);\n this.button.disable(is_at_top);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▴\").setTitle(\"Move panel up\")\n .setOnclick(function(){\n this.parent_panel.moveUp();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to move panel down relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_down\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_down\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_bottom = (this.parent_panel.layout.y_index === this.parent_plot.panel_ids_by_y_index.length-1);\n this.button.disable(is_at_bottom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▾\").setTitle(\"Move panel down\")\n .setOnclick(function(){\n this.parent_panel.moveDown();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to shift plot region forwards or back by a `step` increment provided in the layout\n * @class LocusZoom.Dashboard.Components.shift_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=50000] The stepsize to change the region by\n * @param {string} [layout.button_html]\n * @param {string} [layout.button_title]\n */\nLocusZoom.Dashboard.Components.add(\"shift_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add shift_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 50000; }\n if (typeof layout.button_html !== \"string\"){ layout.button_html = layout.step > 0 ? \">\" : \"<\"; }\n if (typeof layout.button_title !== \"string\"){\n layout.button_title = \"Shift region by \" + (layout.step > 0 ? \"+\" : \"-\") + LocusZoom.positionIntToString(Math.abs(layout.step),null,true);\n }\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start + layout.step, 1),\n end: this.parent_plot.state.end + layout.step\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Zoom in or out on the plot, centered on the middle of the plot region, by the specified amount\n * @class LocusZoom.Dashboard.Components.zoom_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=0.2] The amount to zoom in by (where 1 indicates 100%)\n */\nLocusZoom.Dashboard.Components.add(\"zoom_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add zoom_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 0.2; }\n if (typeof layout.button_html != \"string\"){ layout.button_html = layout.step > 0 ? \"z–\" : \"z+\"; }\n if (typeof layout.button_title != \"string\"){\n layout.button_title = \"Zoom region \" + (layout.step > 0 ? \"out\" : \"in\") + \" by \" + (Math.abs(layout.step)*100).toFixed(1) + \"%\";\n }\n this.update = function(){\n if (this.button){\n var can_zoom = true;\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n if (layout.step > 0 && !isNaN(this.parent_plot.layout.max_region_scale) && current_region_scale >= this.parent_plot.layout.max_region_scale){\n can_zoom = false;\n }\n if (layout.step < 0 && !isNaN(this.parent_plot.layout.min_region_scale) && current_region_scale <= this.parent_plot.layout.min_region_scale){\n can_zoom = false;\n }\n this.button.disable(!can_zoom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n var zoom_factor = 1 + layout.step;\n var new_region_scale = current_region_scale * zoom_factor;\n if (!isNaN(this.parent_plot.layout.max_region_scale)){\n new_region_scale = Math.min(new_region_scale, this.parent_plot.layout.max_region_scale);\n }\n if (!isNaN(this.parent_plot.layout.min_region_scale)){\n new_region_scale = Math.max(new_region_scale, this.parent_plot.layout.min_region_scale);\n }\n var delta = Math.floor((new_region_scale - current_region_scale) / 2);\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start - delta, 1),\n end: this.parent_plot.state.end + delta\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Renders button with arbitrary text that, when clicked, shows a dropdown containing arbitrary HTML\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @class LocusZoom.Dashboard.Components.menu\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n * @param {string} layout.menu_html The HTML content of the dropdown menu\n */\nLocusZoom.Dashboard.Components.add(\"menu\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title);\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(layout.menu_html);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Special button/menu to allow model building by tracking individual covariants. Will track a list of covariate\n * objects and store them in the special `model.covariates` field of plot `state`.\n * @class LocusZoom.Dashboard.Components.covariates_model\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n */\nLocusZoom.Dashboard.Components.add(\"covariates_model\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.initialize = function(){\n // Initialize state.model.covariates\n this.parent_plot.state.model = this.parent_plot.state.model || {};\n this.parent_plot.state.model.covariates = this.parent_plot.state.model.covariates || [];\n // Create an object at the plot level for easy access to interface methods in custom client-side JS\n /**\n * When a covariates model dashboard element is present, create (one) object at the plot level that exposes\n * component data and state for custom interactions with other plot elements.\n * @class LocusZoom.Plot.CovariatesModel\n */\n this.parent_plot.CovariatesModel = {\n /** @member {LocusZoom.Dashboard.Component.Button} */\n button: this,\n /**\n * Add an element to the model and show a representation of it in the dashboard component menu. If the\n * element is already part of the model, do nothing (to avoid adding duplicates).\n * When plot state is changed, this will automatically trigger requests for new data accordingly.\n * @param {string|object} element_reference Can be any value that can be put through JSON.stringify()\n * to create a serialized representation of itself.\n */\n add: function(element_reference){\n var element = JSON.parse(JSON.stringify(element_reference));\n if (typeof element_reference == \"object\" && typeof element.html != \"string\"){\n element.html = ( (typeof element_reference.toHTML == \"function\") ? element_reference.toHTML() : element_reference.toString());\n }\n // Check if the element is already in the model covariates array and return if it is.\n for (var i = 0; i < this.state.model.covariates.length; i++) {\n if (JSON.stringify(this.state.model.covariates[i]) === JSON.stringify(element)) {\n return this;\n }\n }\n this.state.model.covariates.push(element);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Remove an element from `state.model.covariates` (and from the dashboard component menu's\n * representation of the state model). When plot state is changed, this will automatically trigger\n * requests for new data accordingly.\n * @param {number} idx Array index of the element, in the `state.model.covariates array`.\n */\n removeByIdx: function(idx){\n if (typeof this.state.model.covariates[idx] == \"undefined\"){\n throw(\"Unable to remove model covariate, invalid index: \" + idx.toString());\n }\n this.state.model.covariates.splice(idx, 1);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Empty the `state.model.covariates` array (and dashboard component menu representation thereof) of all\n * elements. When plot state is changed, this will automatically trigger requests for new data accordingly\n */\n removeAll: function(){\n this.state.model.covariates = [];\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Manually trigger the update methods on the dashboard component's button and menu elements to force\n * display of most up-to-date content. Can be used to force the dashboard to reflect changes made, eg if\n * modifying `state.model.covariates` directly instead of via `plot.CovariatesModel`\n */\n updateComponent: function(){\n this.button.update();\n this.button.menu.update();\n }.bind(this)\n };\n }.bind(this);\n\n this.update = function(){\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n var selector = this.button.menu.inner_selector;\n selector.html(\"\");\n // General model HTML representation\n if (typeof this.parent_plot.state.model.html != \"undefined\"){\n selector.append(\"div\").html(this.parent_plot.state.model.html);\n }\n // Model covariates table\n if (!this.parent_plot.state.model.covariates.length){\n selector.append(\"i\").html(\"no covariates in model\");\n } else {\n selector.append(\"h5\").html(\"Model Covariates (\" + this.parent_plot.state.model.covariates.length + \")\");\n var table = selector.append(\"table\");\n this.parent_plot.state.model.covariates.forEach(function(covariate, idx){\n var html = ( (typeof covariate == \"object\" && typeof covariate.html == \"string\") ? covariate.html : covariate.toString() );\n var row = table.append(\"tr\");\n row.append(\"td\").append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeByIdx(idx);\n }.bind(this))\n .html(\"×\");\n row.append(\"td\").html(html);\n }.bind(this));\n selector.append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"4px\" }).html(\"× Remove All Covariates\")\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeAll();\n }.bind(this));\n }\n }.bind(this));\n\n this.button.preUpdate = function(){\n var html = \"Model\";\n if (this.parent_plot.state.model.covariates.length){\n var cov = this.parent_plot.state.model.covariates.length > 1 ? \"covariates\" : \"covariate\";\n html += \" (\" + this.parent_plot.state.model.covariates.length + \" \" + cov + \")\";\n }\n this.button.setHtml(html).disable(false);\n }.bind(this);\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Button to toggle split tracks\n * @class LocusZoom.Dashboard.Components.toggle_split_tracks\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_split_tracks\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (!layout.data_layer_id){ layout.data_layer_id = \"intervals\"; }\n if (!this.parent_panel.data_layers[layout.data_layer_id]){\n throw (\"Dashboard toggle split tracks component missing valid data layer ID\");\n }\n this.update = function(){\n var data_layer = this.parent_panel.data_layers[layout.data_layer_id];\n var html = data_layer.layout.split_tracks ? \"Merge Tracks\" : \"Split Tracks\";\n if (this.button){\n this.button.setHtml(html);\n this.button.show();\n this.parent.position();\n return this;\n } else {\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(html)\n .setTitle(\"Toggle whether tracks are split apart or merged together\")\n .setOnclick(function(){\n data_layer.toggleSplitTracks();\n if (this.scale_timeout){ clearTimeout(this.scale_timeout); }\n var timeout = data_layer.layout.transition ? +data_layer.layout.transition.duration || 0 : 0;\n this.scale_timeout = setTimeout(function(){\n this.parent_panel.scaleHeightToData();\n this.parent_plot.positionPanels();\n }.bind(this), timeout);\n this.update();\n }.bind(this));\n return this.update();\n }\n };\n});\n\n/**\n * Button to resize panel height to fit available data (eg when showing a list of tracks)\n * @class LocusZoom.Dashboard.Components.resize_to_data\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"resize_to_data\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Resize to Data\")\n .setTitle(\"Automatically resize this panel to fit the data its currently showing\")\n .setOnclick(function(){\n this.parent_panel.scaleHeightToData();\n this.update();\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to toggle legend\n * @class LocusZoom.Dashboard.Components.toggle_legend\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_legend\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var html = this.parent_panel.legend.layout.hidden ? \"Show Legend\" : \"Hide Legend\";\n if (this.button){\n this.button.setHtml(html).show();\n this.parent.position();\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color)\n .setTitle(\"Show or hide the legend for this panel\")\n .setOnclick(function(){\n this.parent_panel.legend.layout.hidden = !this.parent_panel.legend.layout.hidden;\n this.parent_panel.legend.render();\n this.update();\n }.bind(this));\n return this.update();\n };\n});\n\n/**\n * Menu for manipulating multiple data layers in a single panel: show/hide, change order, etc.\n * @class LocusZoom.Dashboard.Components.data_layers\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"data_layers\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.update = function(){\n\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Data Layers\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Manipulate Data Layers (sort, dim, show/hide, etc.)\"; }\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(\"\");\n var table = this.button.menu.inner_selector.append(\"table\");\n this.parent_panel.data_layer_ids_by_z_index.slice().reverse().forEach(function(id, idx){\n var data_layer = this.parent_panel.data_layers[id];\n var name = (typeof data_layer.layout.name != \"string\") ? data_layer.id : data_layer.layout.name;\n var row = table.append(\"tr\");\n // Layer name\n row.append(\"td\").html(name);\n // Status toggle buttons\n layout.statuses.forEach(function(status_adj){\n var status_idx = LocusZoom.DataLayer.Statuses.adjectives.indexOf(status_adj);\n var status_verb = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n var html, onclick, highlight;\n if (data_layer.global_statuses[status_adj]){\n html = LocusZoom.DataLayer.Statuses.menu_antiverbs[status_idx];\n onclick = \"un\" + status_verb + \"AllElements\";\n highlight = \"-highlighted\";\n } else {\n html = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n onclick = status_verb + \"AllElements\";\n highlight = \"\";\n }\n row.append(\"td\").append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color + highlight)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer[onclick](); this.button.menu.populate(); }.bind(this))\n .html(html);\n }.bind(this));\n // Sort layer buttons\n var at_top = (idx === 0);\n var at_bottom = (idx === (this.parent_panel.data_layer_ids_by_z_index.length - 1));\n var td = row.append(\"td\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-start lz-dashboard-button-\" + this.layout.color + (at_bottom ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveDown(); this.button.menu.populate(); }.bind(this))\n .html(\"▾\").attr(\"title\", \"Move layer down (further back)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-middle lz-dashboard-button-\" + this.layout.color + (at_top ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveUp(); this.button.menu.populate(); }.bind(this))\n .html(\"▴\").attr(\"title\", \"Move layer up (further front)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-end lz-dashboard-button-red\")\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n if (confirm(\"Are you sure you want to remove the \" + name + \" layer? This cannot be undone!\")){\n data_layer.parent.removeDataLayer(id);\n }\n return this.button.menu.populate();\n }.bind(this))\n .html(\"×\").attr(\"title\", \"Remove layer\");\n }.bind(this));\n return this;\n }.bind(this));\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Dropdown menu allowing the user to choose between different display options for a single specific data layer\n * within a panel.\n *\n * This allows controlling how points on a datalayer can be displayed- any display options supported via the layout for the target datalayer. This includes point\n * size/shape, coloring, etc.\n *\n * This button intentionally limits display options it can control to those available on common plot types.\n * Although the list of options it sets can be overridden (to control very special custom plot types), this\n * capability should be used sparingly if at all.\n *\n * @class LocusZoom.Dashboard.Components.display_options\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {String} [layout.button_html=\"Display options\"] Text to display on the toolbar button\n * @param {String} [layout.button_title=\"Control how plot items are displayed\"] Hover text for the toolbar button\n * @param {string} layout.layer_name Specify the datalayer that this button should affect\n * @param {string} [layout.default_config_display_name] Store the default configuration for this datalayer\n * configuration, and show a button to revert to the \"default\" (listing the human-readable display name provided)\n * @param {Array} [layout.fields_whitelist='see code'] The list of presentation fields that this button can control.\n * This can be overridden if this button needs to be used on a custom layer type with special options.\n * @typedef {{display_name: string, display: Object}} DisplayOptionsButtonConfigField\n * @param {DisplayOptionsButtonConfigField[]} layout.options Specify a label and set of layout directives associated\n * with this `display` option. Display field should include all changes to datalayer presentation options.\n */\nLocusZoom.Dashboard.Components.add(\"display_options\", function (layout) {\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Display options\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Control how plot items are displayed\"; }\n\n // Call parent constructor\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n // List of layout fields that this button is allowed to control. This ensures that we don't override any other\n // information (like plot height etc) while changing point rendering\n var allowed_fields = layout.fields_whitelist || [\"color\", \"fill_opacity\", \"label\", \"legend\",\n \"point_shape\", \"point_size\", \"tooltip\", \"tooltip_positioning\"];\n\n var dataLayer = this.parent_panel.data_layers[layout.layer_name];\n var dataLayerLayout = dataLayer.layout;\n\n // Store default configuration for the layer as a clean deep copy, so we may revert later\n var defaultConfig = {};\n allowed_fields.forEach(function(name) {\n var configSlot = dataLayerLayout[name];\n if (configSlot) {\n defaultConfig[name] = JSON.parse(JSON.stringify(configSlot));\n }\n });\n\n /**\n * Which item in the menu is currently selected. (track for rerendering menu)\n * @member {String}\n * @private\n */\n this._selected_item = \"default\";\n\n // Define the button + menu that provides the real functionality for this dashboard component\n var self = this;\n this.button = new LocusZoom.Dashboard.Component.Button(self)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function () {\n self.button.menu.populate();\n });\n this.button.menu.setPopulate(function () {\n // Multiple copies of this button might be used on a single LZ page; append unique IDs where needed\n var uniqueID = Math.floor(Math.random() * 1e4).toString();\n\n self.button.menu.inner_selector.html(\"\");\n var table = self.button.menu.inner_selector.append(\"table\");\n\n var menuLayout = self.layout;\n\n var renderRow = function(display_name, display_options, row_id) { // Helper method\n var row = table.append(\"tr\");\n row.append(\"td\")\n .append(\"input\")\n .attr({type: \"radio\", name: \"color-picker-\" + uniqueID, value: row_id})\n .property(\"checked\", (row_id === self._selected_item))\n .on(\"click\", function () {\n Object.keys(display_options).forEach(function(field_name) {\n dataLayer.layout[field_name] = display_options[field_name];\n });\n self._selected_item = row_id;\n self.parent_panel.render();\n var legend = self.parent_panel.legend;\n if (legend && display_options.legend) {\n // Update the legend only if necessary\n legend.render();\n }\n });\n row.append(\"td\").text(display_name);\n };\n // Render the \"display options\" menu: default and special custom options\n var defaultName = menuLayout.default_config_display_name || \"Default style\";\n renderRow(defaultName, defaultConfig, \"default\");\n menuLayout.options.forEach(function (item, index) {\n renderRow(item.display_name, item.display, index);\n });\n return self;\n });\n\n this.update = function () {\n this.button.show();\n return this;\n };\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * An SVG object used to display contextual information about a panel.\n * Panel layouts determine basic features of a legend - its position in the panel, orientation, title, etc.\n * Layouts of child data layers of the panel determine the actual content of the legend.\n *\n * @class\n * @param {LocusZoom.Panel} parent\n*/\nLocusZoom.Legend = function(parent){\n if (!(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create legend, parent must be a locuszoom panel\";\n }\n /** @member {LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".legend\";\n\n this.parent.layout.legend = LocusZoom.Layouts.merge(this.parent.layout.legend || {}, LocusZoom.Legend.DefaultLayout);\n /** @member {Object} */\n this.layout = this.parent.layout.legend;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {d3.selection} */\n this.background_rect = null;\n /** @member {d3.selection[]} */\n this.elements = [];\n /**\n * SVG selector for the group containing all elements in the legend\n * @protected\n * @member {d3.selection|null}\n */\n this.elements_group = null;\n\n /**\n * TODO: Not sure if this property is used; the external-facing methods are setting `layout.hidden` instead. Tentatively mark deprecated.\n * @deprecated\n * @protected\n * @member {Boolean}\n */\n this.hidden = false;\n\n // TODO Revisit constructor return value; see https://stackoverflow.com/a/3350364/1422268\n return this.render();\n};\n\n/**\n * The default layout used by legends (used internally)\n * @protected\n * @member {Object}\n */\nLocusZoom.Legend.DefaultLayout = {\n orientation: \"vertical\",\n origin: { x: 0, y: 0 },\n width: 10,\n height: 10,\n padding: 5,\n label_size: 12,\n hidden: false\n};\n\n/**\n * Render the legend in the parent panel\n */\nLocusZoom.Legend.prototype.render = function(){\n\n // Get a legend group selector if not yet defined\n if (!this.selector){\n this.selector = this.parent.svg.group.append(\"g\")\n .attr(\"id\", this.parent.getBaseId() + \".legend\").attr(\"class\", \"lz-legend\");\n }\n\n // Get a legend background rect selector if not yet defined\n if (!this.background_rect){\n this.background_rect = this.selector.append(\"rect\")\n .attr(\"width\", 100).attr(\"height\", 100).attr(\"class\", \"lz-legend-background\");\n }\n\n // Get a legend elements group selector if not yet defined\n if (!this.elements_group){\n this.elements_group = this.selector.append(\"g\");\n }\n\n // Remove all elements from the document and re-render from scratch\n this.elements.forEach(function(element){\n element.remove();\n });\n this.elements = [];\n\n // Gather all elements from data layers in order (top to bottom) and render them\n var padding = +this.layout.padding || 1;\n var x = padding;\n var y = padding;\n var line_height = 0;\n this.parent.data_layer_ids_by_z_index.slice().reverse().forEach(function(id){\n if (Array.isArray(this.parent.data_layers[id].layout.legend)){\n this.parent.data_layers[id].layout.legend.forEach(function(element){\n var selector = this.elements_group.append(\"g\")\n .attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n var label_size = +element.label_size || +this.layout.label_size || 12;\n var label_x = 0;\n var label_y = (label_size/2) + (padding/2);\n line_height = Math.max(line_height, label_size + padding);\n // Draw the legend element symbol (line, rect, shape, etc)\n if (element.shape === \"line\"){\n // Line symbol\n var length = +element.length || 16;\n var path_y = (label_size/4) + (padding/2);\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", \"M0,\" + path_y + \"L\" + length + \",\" + path_y)\n .style(element.style || {});\n label_x = length + padding;\n } else if (element.shape === \"rect\"){\n // Rect symbol\n var width = +element.width || 16;\n var height = +element.height || width;\n selector.append(\"rect\").attr(\"class\", element.class || \"\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = width + padding;\n line_height = Math.max(line_height, height + padding);\n } else if (d3.svg.symbolTypes.indexOf(element.shape) !== -1) {\n // Shape symbol (circle, diamond, etc.)\n var size = +element.size || 40;\n var radius = Math.ceil(Math.sqrt(size/Math.PI));\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", d3.svg.symbol().size(size).type(element.shape))\n .attr(\"transform\", \"translate(\" + radius + \",\" + (radius+(padding/2)) + \")\")\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = (2*radius) + padding;\n label_y = Math.max((2*radius)+(padding/2), label_y);\n line_height = Math.max(line_height, (2*radius) + padding);\n }\n // Draw the legend element label\n selector.append(\"text\").attr(\"text-anchor\", \"left\").attr(\"class\", \"lz-label\")\n .attr(\"x\", label_x).attr(\"y\", label_y).style({\"font-size\": label_size}).text(element.label);\n // Position the legend element group based on legend layout orientation\n var bcr = selector.node().getBoundingClientRect();\n if (this.layout.orientation === \"vertical\"){\n y += bcr.height + padding;\n line_height = 0;\n } else {\n // Ensure this element does not exceed the panel width\n // (E.g. drop to the next line if it does, but only if it's not the only element on this line)\n var right_x = this.layout.origin.x + x + bcr.width;\n if (x > padding && right_x > this.parent.layout.width){\n y += line_height;\n x = padding;\n selector.attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n }\n x += bcr.width + (3*padding);\n }\n // Store the element\n this.elements.push(selector);\n }.bind(this));\n }\n }.bind(this));\n\n // Scale the background rect to the elements in the legend\n var bcr = this.elements_group.node().getBoundingClientRect();\n this.layout.width = bcr.width + (2*this.layout.padding);\n this.layout.height = bcr.height + (2*this.layout.padding);\n this.background_rect\n .attr(\"width\", this.layout.width)\n .attr(\"height\", this.layout.height);\n\n // Set the visibility on the legend from the \"hidden\" flag\n // TODO: `show()` and `hide()` call a full rerender; might be able to make this more lightweight?\n this.selector.style({ visibility: this.layout.hidden ? \"hidden\" : \"visible\" });\n\n // TODO: Annotate return type and make consistent\n return this.position();\n};\n\n/**\n * Place the legend in position relative to the panel, as specified in the layout configuration\n * @returns {LocusZoom.Legend | null}\n * TODO: should this always be chainable?\n */\nLocusZoom.Legend.prototype.position = function(){\n if (!this.selector){ return this; }\n var bcr = this.selector.node().getBoundingClientRect();\n if (!isNaN(+this.layout.pad_from_bottom)){\n this.layout.origin.y = this.parent.layout.height - bcr.height - +this.layout.pad_from_bottom;\n }\n if (!isNaN(+this.layout.pad_from_right)){\n this.layout.origin.x = this.parent.layout.width - bcr.width - +this.layout.pad_from_right;\n }\n this.selector.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n};\n\n/**\n * Hide the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.hide = function(){\n this.layout.hidden = true;\n this.render();\n};\n\n/**\n * Show the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.show = function(){\n this.layout.hidden = false;\n this.render();\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * LocusZoom functionality used for data parsing and retrieval\n * @namespace\n * @public\n */\nLocusZoom.Data = LocusZoom.Data || {};\n\n/**\n * Create and coordinate an ensemble of (namespaced) data source instances\n * @public\n * @class\n */\nLocusZoom.DataSources = function() {\n /** @member {Object.} */\n this.sources = {};\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.addSource = function(ns, x) {\n console.warn(\"Warning: .addSource() is deprecated. Use .add() instead\");\n return this.add(ns, x);\n};\n\n/**\n * Add a (namespaced) datasource to the plot\n * @public\n * @param {String} ns A namespace used for fields from this data source\n * @param {LocusZoom.Data.Source|Array|null} x An instantiated datasource, or an array of arguments that can be used to\n * create a known datasource type.\n */\nLocusZoom.DataSources.prototype.add = function(ns, x) {\n return this.set(ns, x);\n};\n\n/** @protected */\nLocusZoom.DataSources.prototype.set = function(ns, x) {\n if (Array.isArray(x)) {\n // If passed array of source name and options, make the source\n var dsobj = LocusZoom.KnownDataSources.create.apply(null, x);\n // Each datasource in the chain should be aware of its assigned namespace\n dsobj.source_id = ns;\n this.sources[ns] = dsobj;\n } else {\n // If passed the already-created source object\n if (x !== null) {\n x.source_id = ns;\n this.sources[ns] = x;\n } else {\n delete this.sources[ns];\n }\n }\n return this;\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.getSource = function(ns) {\n console.warn(\"Warning: .getSource() is deprecated. Use .get() instead\");\n return this.get(ns);\n};\n\n/**\n * Return the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n * @returns {LocusZoom.Data.Source}\n */\nLocusZoom.DataSources.prototype.get = function(ns) {\n return this.sources[ns];\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.removeSource = function(ns) {\n console.warn(\"Warning: .removeSource() is deprecated. Use .remove() instead\");\n return this.remove(ns);\n};\n\n/**\n * Remove the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n */\nLocusZoom.DataSources.prototype.remove = function(ns) {\n return this.set(ns, null);\n};\n\n/**\n * Populate a list of datasources specified as a JSON object\n * @public\n * @param {String|Object} x An object or JSON representation containing {ns: configArray} entries\n * @returns {LocusZoom.DataSources}\n */\nLocusZoom.DataSources.prototype.fromJSON = function(x) {\n if (typeof x === \"string\") {\n x = JSON.parse(x);\n }\n var ds = this;\n Object.keys(x).forEach(function(ns) {\n ds.set(ns, x[ns]);\n });\n return ds;\n};\n\n/**\n * Return the names of all currently recognized datasources\n * @public\n * @returns {Array}\n */\nLocusZoom.DataSources.prototype.keys = function() {\n return Object.keys(this.sources);\n};\n\n/**\n * Datasources can be instantiated from a JSON object instead of code. This represents existing sources in that format.\n * For example, this can be helpful when sharing plots, or to share settings with others when debugging\n * @public\n */\nLocusZoom.DataSources.prototype.toJSON = function() {\n return this.sources;\n};\n\n/**\n * Represents an addressable unit of data from a namespaced datasource, subject to specified value transformations.\n *\n * When used by a data layer, fields will automatically be re-fetched from the appropriate data source whenever the\n * state of a plot fetches, eg pan or zoom operations that would affect what data is displayed.\n *\n * @public\n * @class\n * @param {String} field A string representing the namespace of the datasource, the name of the desired field to fetch\n * from that datasource, and arbitrarily many transformations to apply to the value. The namespace and\n * transformation(s) are optional and information is delimited according to the general syntax\n * `[namespace:]name[|transformation][|transformation]`. For example, `association:pvalue|neglog10`\n */\nLocusZoom.Data.Field = function(field){\n \n var parts = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/.exec(field);\n /** @member {String} */\n this.full_name = field;\n /** @member {String} */\n this.namespace = parts[1] || null;\n /** @member {String} */\n this.name = parts[2] || null;\n /** @member {Array} */\n this.transformations = [];\n \n if (typeof parts[3] == \"string\" && parts[3].length > 1){\n this.transformations = parts[3].substring(1).split(\"|\");\n this.transformations.forEach(function(transform, i){\n this.transformations[i] = LocusZoom.TransformationFunctions.get(transform);\n }.bind(this));\n }\n\n this.applyTransformations = function(val){\n this.transformations.forEach(function(transform){\n val = transform(val);\n });\n return val;\n };\n\n // Resolve the field for a given data element.\n // First look for a full match with transformations already applied by the data requester.\n // Otherwise prefer a namespace match and fall back to just a name match, applying transformations on the fly.\n this.resolve = function(d){\n if (typeof d[this.full_name] == \"undefined\"){\n var val = null;\n if (typeof (d[this.namespace+\":\"+this.name]) != \"undefined\"){ val = d[this.namespace+\":\"+this.name]; }\n else if (typeof d[this.name] != \"undefined\"){ val = d[this.name]; }\n d[this.full_name] = this.applyTransformations(val);\n }\n return d[this.full_name];\n };\n \n};\n\n/**\n * The Requester manages fetching of data across multiple data sources. It is used internally by LocusZoom data layers.\n * It passes state information and ensures that data is formatted in the manner expected by the plot.\n *\n * It is also responsible for constructing a \"chain\" of dependent requests, by requesting each datasource\n * sequentially in the order specified in the datalayer `fields` array. Data sources are only chained within a\n * data layer, and only if that layer requests more than one kind of data source.\n * @param {LocusZoom.DataSources} sources An object of {ns: LocusZoom.Data.Source} instances\n * @class\n */\nLocusZoom.Data.Requester = function(sources) {\n\n function split_requests(fields) {\n // Given a fields array, return an object specifying what datasource names the data layer should make requests\n // to, and how to handle the returned data\n var requests = {};\n // Regular expression finds namespace:field|trans\n var re = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/;\n fields.forEach(function(raw) {\n var parts = re.exec(raw);\n var ns = parts[1] || \"base\";\n var field = parts[2];\n var trans = LocusZoom.TransformationFunctions.get(parts[3]);\n if (typeof requests[ns] ==\"undefined\") {\n requests[ns] = {outnames:[], fields:[], trans:[]};\n }\n requests[ns].outnames.push(raw);\n requests[ns].fields.push(field);\n requests[ns].trans.push(trans);\n });\n return requests;\n }\n\n /**\n * Fetch data, and create a chain that only connects two data sources if they depend on each other\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields The list of data fields specified in the `layout` for a specific data layer\n * @returns {Promise}\n */\n this.getData = function(state, fields) {\n var requests = split_requests(fields);\n // Create an array of functions that, when called, will trigger the request to the specified datasource\n var request_handles = Object.keys(requests).map(function(key) {\n if (!sources.get(key)) {\n throw(\"Datasource for namespace \" + key + \" not found\");\n }\n return sources.get(key).getData(state, requests[key].fields, \n requests[key].outnames, requests[key].trans);\n });\n //assume the fields are requested in dependent order\n //TODO: better manage dependencies\n var ret = Q.when({header:{}, body:{}, discrete: {}});\n for(var i=0; i < request_handles.length; i++) {\n // If a single datalayer uses multiple sources, perform the next request when the previous one completes\n ret = ret.then(request_handles[i]);\n }\n return ret;\n };\n};\n\n/**\n * Base class for LocusZoom data sources\n * This can be extended with .extend() to create custom data sources\n * @class\n * @public\n */\nLocusZoom.Data.Source = function() {\n /**\n * Whether this source should enable caching\n * @member {Boolean}\n */\n this.enableCache = true;\n /**\n * Whether this data source type is dependent on previous requests- for example, the LD source cannot annotate\n * association data if no data was found for that region.\n * @member {boolean}\n */\n this.dependentSource = false;\n};\n\n/**\n * A default constructor that can be used when creating new data sources\n * @param {String|Object} init Basic configuration- either a url, or a config object\n * @param {String} [init.url] The datasource URL\n * @param {String} [init.params] Initial config params for the datasource\n */\nLocusZoom.Data.Source.prototype.parseInit = function(init) {\n if (typeof init === \"string\") {\n /** @member {String} */\n this.url = init;\n /** @member {String} */\n this.params = {};\n } else {\n this.url = init.url;\n this.params = init.params || {};\n }\n if (!this.url) {\n throw(\"Source not initialized with required URL\");\n }\n\n};\n\n/**\n * A unique identifier that indicates whether cached data is valid for this request\n * @protected\n * @param state\n * @param chain\n * @param fields\n * @returns {String|undefined}\n */\nLocusZoom.Data.Source.prototype.getCacheKey = function(state, chain, fields) {\n return this.getURL && this.getURL(state, chain, fields);\n};\n\n/**\n * Stub: build the URL for any requests made by this source.\n */\nLocusZoom.Data.Source.prototype.getURL = function(state, chain, fields) { return this.url; };\n\n/**\n * Perform a network request to fetch data for this source\n * @protected\n * @param {Object} state The state of the parent plot\n * @param chain\n * @param fields\n */\nLocusZoom.Data.Source.prototype.fetchRequest = function(state, chain, fields) {\n var url = this.getURL(state, chain, fields);\n return LocusZoom.createCORSPromise(\"GET\", url); \n};\n\n/**\n * Gets the data for just this source, typically via a network request (caching where possible)\n * @protected\n */\nLocusZoom.Data.Source.prototype.getRequest = function(state, chain, fields) {\n var req;\n var cacheKey = this.getCacheKey(state, chain, fields);\n if (this.enableCache && typeof(cacheKey) !== \"undefined\" && cacheKey === this._cachedKey) {\n req = Q.when(this._cachedResponse);\n } else {\n req = this.fetchRequest(state, chain, fields);\n if (this.enableCache) {\n req = req.then(function(x) {\n this._cachedKey = cacheKey;\n return this._cachedResponse = x;\n }.bind(this));\n }\n }\n return req;\n};\n\n/**\n * Fetch the data from the specified data source, and apply transformations requested by an external consumer.\n * This is the public-facing datasource method that will most commonly be called by external code.\n *\n * @public\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the \"namespace\" prefix)\n * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the\n * originally requested field name, including the namespace. This must be an array with the same length as `fields`\n * @param {Function[]} trans The collection of transformation functions to be run on selected fields.\n * This must be an array with the same length as `fields`\n * @returns {function} A callable operation that can be used as part of the data chain\n */\nLocusZoom.Data.Source.prototype.getData = function(state, fields, outnames, trans) {\n if (this.preGetData) {\n var pre = this.preGetData(state, fields, outnames, trans);\n if(this.pre) {\n state = pre.state || state;\n fields = pre.fields || fields;\n outnames = pre.outnames || outnames;\n trans = pre.trans || trans;\n }\n }\n\n var self = this;\n return function (chain) {\n if (self.dependentSource && chain && chain.body && !chain.body.length) {\n // A \"dependent\" source should not attempt to fire a request if there is no data for it to act on.\n // Therefore, it should simply return the previous data chain.\n return Q.when(chain);\n }\n\n return self.getRequest(state, chain, fields).then(function(resp) {\n return self.parseResponse(resp, chain, fields, outnames, trans);\n });\n };\n};\n\n/**\n * Ensure the server response is in a canonical form, an array of one object per record. [ {field: oneval} ].\n * If the server response contains columns, reformats the response from {column1: [], column2: []} to the above.\n *\n * Does not apply namespacing or transformations.\n *\n * May be overridden by data sources that inherently return more complex payloads, or that exist to annotate other\n * sources.\n *\n * @param {Object[]|Object} data The original parsed server response\n * @protected\n */\nLocusZoom.Data.Source.prototype.normalizeResponse = function (data) {\n if (Array.isArray(data)) {\n // Already in the desired form\n return data;\n }\n\n // Otherwise, assume the server response is an object representing columns of data.\n // Each array should have the same length (verify), and a given array index corresponds to a single row.\n var keys = Object.keys(data);\n var N = data[keys[0]].length;\n var sameLength = keys.every(function(key) {\n var item = data[key];\n return item.length === N;\n });\n if (!sameLength) {\n throw this.constructor.SOURCE_NAME + \" expects a response in which all arrays of data are the same length\";\n }\n\n // Go down the rows, and create an object for each record\n var records = [];\n var fields = Object.keys(data);\n for(var i = 0; i < N; i++) {\n var record = {};\n for(var j = 0; j < fields.length; j++) {\n record[fields[j]] = data[fields[j]][i];\n }\n records.push(record);\n }\n return records;\n};\n\n/** @deprecated */\nLocusZoom.Data.Source.prototype.prepareData = function (records) {\n console.warn(\"Warning: .prepareData() is deprecated. Use .annotateData() instead\");\n return this.annotateData(records);\n};\n\n/**\n * Hook to post-process the data returned by this source with new, additional behavior.\n * (eg cleaning up API values or performing complex calculations on the returned data)\n *\n * @param {Object[]} records The parsed data from the source (eg standardized api response)\n * @param {Object} chain The data chain object. For example, chain.headers may provide useful annotation metadata\n * @returns {Object[]|Promise} The modified set of records\n */\nLocusZoom.Data.Source.prototype.annotateData = function(records, chain) {\n // Default behavior: no transformations\n return records;\n};\n\n/**\n * Clean up the server records for use by datalayers: extract only certain fields, with the specified names.\n * Apply per-field transformations as appropriate.\n *\n * This hook can be overridden, eg to create a source that always returns all records and ignores the \"fields\" array.\n * This is particularly common for sources at the end of a chain- many \"dependent\" sources do not allow\n * cherry-picking individual fields, in which case by **convention** the fields array specifies \"last_source_name:all\"\n *\n * @param {Object[]} data One record object per element\n * @param {String[]} fields The names of fields to extract (as named in the source data). Eg \"afield\"\n * @param {String[]} outnames How to represent the source fields in the output. Eg \"namespace:afield|atransform\"\n * @param {function[]} trans An array of transformation functions (if any). One function per data element, or null.\n * @protected\n */\nLocusZoom.Data.Source.prototype.extractFields = function (data, fields, outnames, trans) {\n //intended for an array of objects\n // [ {\"id\":1, \"val\":5}, {\"id\":2, \"val\":10}]\n // Since a number of sources exist that do not obey this format, we will provide a convenient pass-through\n if (!Array.isArray(data)) {\n return data;\n }\n\n var fieldFound = [];\n for (var k=0; k1) {\n if (fields.length!==2 || fields.indexOf(\"isrefvar\")===-1) {\n throw(\"LD does not know how to get all fields: \" + fields.join(\", \"));\n }\n }\n};\n\nLocusZoom.Data.LDSource.prototype.findMergeFields = function(chain) {\n // since LD may be shared across sources with different namespaces\n // we use regex to find columns to join on rather than \n // requiring exact matches\n var exactMatch = function(arr) {return function() {\n var regexes = arguments;\n for(var i=0; i0) {\n var names = Object.keys(chain.body[0]);\n var nameMatch = exactMatch(names);\n dataFields.id = dataFields.id || nameMatch(/\\bvariant\\b/) || nameMatch(/\\bid\\b/);\n dataFields.position = dataFields.position || nameMatch(/\\bposition\\b/i, /\\bpos\\b/i);\n dataFields.pvalue = dataFields.pvalue || nameMatch(/\\bpvalue\\b/i, /\\blog_pvalue\\b/i);\n dataFields._names_ = names;\n }\n return dataFields;\n};\n\nLocusZoom.Data.LDSource.prototype.findRequestedFields = function(fields, outnames) {\n var obj = {};\n for(var i=0; i extremeVal) {\n extremeVal = x[i][pval] * sign;\n extremeIdx = i;\n }\n }\n return extremeIdx;\n };\n\n var refSource = state.ldrefsource || chain.header.ldrefsource || 1;\n var reqFields = this.findRequestedFields(fields);\n var refVar = reqFields.ldin;\n if (refVar === \"state\") {\n refVar = state.ldrefvar || chain.header.ldrefvar || \"best\";\n }\n if (refVar === \"best\") {\n if (!chain.body) {\n throw(\"No association data found to find best pvalue\");\n }\n var keys = this.findMergeFields(chain);\n if (!keys.pvalue || !keys.id) {\n var columns = \"\";\n if (!keys.id){ columns += (columns.length ? \", \" : \"\") + \"id\"; }\n if (!keys.pvalue){ columns += (columns.length ? \", \" : \"\") + \"pvalue\"; }\n throw(\"Unable to find necessary column(s) for merge: \" + columns + \" (available: \" + keys._names_ + \")\");\n }\n refVar = chain.body[findExtremeValue(chain.body, keys.pvalue)][keys.id];\n }\n if (!chain.header) {chain.header = {};}\n chain.header.ldrefvar = refVar;\n return this.url + \"results/?filter=reference eq \" + refSource + \n \" and chromosome2 eq '\" + state.chr + \"'\" + \n \" and position2 ge \" + state.start + \n \" and position2 le \" + state.end + \n \" and variant1 eq '\" + refVar + \"'\" + \n \"&fields=chr,pos,rsquare\";\n};\n\nLocusZoom.Data.LDSource.prototype.combineChainBody = function (data, chain, fields, outnames) {\n var keys = this.findMergeFields(chain);\n var reqFields = this.findRequestedFields(fields, outnames);\n if (!keys.position) {\n throw(\"Unable to find position field for merge: \" + keys._names_);\n }\n var leftJoin = function(left, right, lfield, rfield) {\n var i=0, j=0;\n while (i < left.length && j < right.position2.length) {\n if (left[i][keys.position] === right.position2[j]) {\n left[i][lfield] = right[rfield][j];\n i++;\n j++;\n } else if (left[i][keys.position] < right.position2[j]) {\n i++;\n } else {\n j++;\n }\n }\n };\n var tagRefVariant = function(data, refvar, idfield, outname) {\n for(var i=0; i} */\n this.panels = {};\n /**\n * TODO: This is currently used by external classes that manipulate the parent and may indicate room for a helper method in the api to coordinate boilerplate\n * @protected\n * @member {String[]}\n */\n this.panel_ids_by_y_index = [];\n\n /**\n * Notify each child panel of the plot of changes in panel ordering/ arrangement\n */\n this.applyPanelYIndexesToPanelLayouts = function(){\n this.panel_ids_by_y_index.forEach(function(pid, idx){\n this.panels[pid].layout.y_index = idx;\n }.bind(this));\n };\n\n /**\n * Get the qualified ID pathname for the plot\n * @returns {String}\n */\n this.getBaseId = function(){\n return this.id;\n };\n\n /**\n * Track update operations (reMap) performed on all child panels, and notify the parent plot when complete\n * TODO: Reconsider whether we need to be tracking this as global state outside of context of specific operations\n * @protected\n * @member {Promise[]}\n */\n this.remap_promises = [];\n\n if (typeof layout == \"undefined\"){\n /**\n * The layout is a serializable object used to describe the composition of the Plot\n * If no layout was passed, use the Standard Association Layout\n * Otherwise merge whatever was passed with the Default Layout\n * TODO: Review description; we *always* merge with default layout?\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge({}, LocusZoom.Layouts.get(\"plot\", \"standard_association\"));\n } else {\n this.layout = layout;\n }\n LocusZoom.Layouts.merge(this.layout, LocusZoom.Plot.DefaultLayout);\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original plot state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n\n /**\n * Create a shortcut to the state in the layout on the Plot. Tracking in the layout allows the plot to be created\n * with initial state/setup.\n *\n * Tracks state of the plot, eg start and end position\n * @member {Object}\n */\n this.state = this.layout.state;\n\n /** @member {LocusZoom.Data.Requester} */\n this.lzd = new LocusZoom.Data.Requester(datasource);\n\n /**\n * Window.onresize listener (responsive layouts only)\n * TODO: .on appears to return a selection, not a listener? Check logic here\n * https://github.com/d3/d3-selection/blob/00b904b9bcec4dfaf154ae0bbc777b1fc1d7bc08/test/selection/on-test.js#L11\n * @deprecated\n * @member {d3.selection}\n */\n this.window_onresize = null;\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": [],\n \"state_changed\": [] // Only triggered when a state change causes rerender\n };\n\n /**\n * @callback eventCallback\n * @param {object} eventData A description of the event\n * @param {String|null} eventData.sourceID The unique identifier (eg plot or parent name) of the element that\n * triggered the event. Will be automatically filled in if not explicitly provided.\n * @param {Object|null} eventData.context Any additional information to be passed to the callback, eg the data\n * associated with a clicked plot element\n */\n\n /**\n * There are several events that a LocusZoom plot can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following plot-level events are currently supported:\n * - `layout_changed` - context: plot - Any aspect of the plot's layout (including dimensions or state) has changed.\n * - `data_requested` - context: plot - A request for new data from any data source used in the plot has been made.\n * - `data_rendered` - context: plot - Data from a request has been received and rendered in the plot.\n * - `element_clicked` - context: plot - A data element in any of the plot's data layers has been clicked.\n * - `element_selection` - context: plot - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `plot.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * plot itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Plot}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n * @param {string} event A known event name\n * @param {*} eventData Data or event description that will be passed to the event listener\n * @returns {LocusZoom.Plot}\n */\n this.emit = function(event, eventData) {\n // TODO: there are small differences between the emit implementation between plots and panels. In the future,\n // DRY this code via mixins, and make sure to keep the interfaces compatible when refactoring.\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n var sourceID = this.getBaseId();\n var self = this;\n this.event_hooks[event].forEach(function(hookToRun) {\n var eventContext;\n if (eventData && eventData.sourceID) {\n // If we detect that an event originated elsewhere (via bubbling or externally), preserve the context\n // when re-emitting the event to plot-level listeners\n eventContext = eventData;\n } else {\n eventContext = {sourceID: sourceID, data: eventData || null};\n }\n // By default, any handlers fired here (either directly, or bubbled) will see the plot as the\n // value of `this`. If a bound function is registered as a handler, the previously bound `this` will\n // override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the plot's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the plot\n * @returns {{x: Number, y: Number, width: Number, height: Number}}\n */\n this.getPageOrigin = function(){\n var bounding_client_rect = this.svg.node().getBoundingClientRect();\n var x_offset = document.documentElement.scrollLeft || document.body.scrollLeft;\n var y_offset = document.documentElement.scrollTop || document.body.scrollTop;\n var container = this.svg.node();\n while (container.parentNode !== null){\n container = container.parentNode;\n if (container !== document && d3.select(container).style(\"position\") !== \"static\"){\n x_offset = -1 * container.getBoundingClientRect().left;\n y_offset = -1 * container.getBoundingClientRect().top;\n break;\n }\n }\n return {\n x: x_offset + bounding_client_rect.left,\n y: y_offset + bounding_client_rect.top,\n width: bounding_client_rect.width,\n height: bounding_client_rect.height\n };\n };\n\n /**\n * Get the top and left offset values for the plot's container element (the div that was populated)\n * @returns {{top: number, left: number}}\n */\n this.getContainerOffset = function(){\n var offset = { top: 0, left: 0 };\n var container = this.container.offsetParent || null;\n while (container !== null){\n offset.top += container.offsetTop;\n offset.left += container.offsetLeft;\n container = container.offsetParent || null;\n }\n return offset;\n };\n\n //\n /**\n * Event information describing interaction (e.g. panning and zooming) is stored on the plot\n * TODO: Add/ document details of interaction structure as we expand\n * @member {{panel_id: String, linked_panel_ids: Array, x_linked: *, dragging: *, zooming: *}}\n * @returns {LocusZoom.Plot}\n */\n this.interaction = {};\n\n /**\n * Track whether the target panel can respond to mouse interaction events\n * @param {String} panel_id\n * @returns {boolean}\n */\n this.canInteract = function(panel_id){\n panel_id = panel_id || null;\n if (panel_id){\n return ((typeof this.interaction.panel_id == \"undefined\" || this.interaction.panel_id === panel_id) && !this.loading_data);\n } else {\n return !(this.interaction.dragging || this.interaction.zooming || this.loading_data);\n }\n };\n\n // Initialize the layout\n this.initializeLayout();\n // TODO: Possibly superfluous return from constructor\n return this;\n};\n\n/**\n * Default/ expected configuration parameters for basic plotting; most plots will override\n *\n * @protected\n * @static\n * @type {Object}\n */\nLocusZoom.Plot.DefaultLayout = {\n state: {},\n width: 1,\n height: 1,\n min_width: 1,\n min_height: 1,\n responsive_resize: false,\n aspect_ratio: 1,\n panels: [],\n dashboard: {\n components: []\n },\n panel_boundaries: true,\n mouse_guide: true\n};\n\n/**\n * Helper method to sum the proportional dimensions of panels, a value that's checked often as panels are added/removed\n * @param {('Height'|'Width')} dimension\n * @returns {number}\n */\nLocusZoom.Plot.prototype.sumProportional = function(dimension){\n if (dimension !== \"height\" && dimension !== \"width\"){\n throw (\"Bad dimension value passed to LocusZoom.Plot.prototype.sumProportional\");\n }\n var total = 0;\n for (var id in this.panels){\n // Ensure every panel contributing to the sum has a non-zero proportional dimension\n if (!this.panels[id].layout[\"proportional_\" + dimension]){\n this.panels[id].layout[\"proportional_\" + dimension] = 1 / Object.keys(this.panels).length;\n }\n total += this.panels[id].layout[\"proportional_\" + dimension];\n }\n return total;\n};\n\n/**\n * Resize the plot to fit the bounding container\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.rescaleSVG = function(){\n var clientRect = this.svg.node().getBoundingClientRect();\n this.setDimensions(clientRect.width, clientRect.height);\n return this;\n};\n\n/**\n * Prepare the plot for first use by performing parameter validation, setting up panels, and calculating dimensions\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initializeLayout = function(){\n\n // Sanity check layout values\n // TODO: Find a way to generally abstract this, maybe into an object that models allowed layout values?\n if (isNaN(this.layout.width) || this.layout.width <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.height) || this.layout.height <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.aspect_ratio) || this.layout.aspect_ratio <= 0){\n throw (\"Plot layout parameter `aspect_ratio` must be a positive number\");\n }\n\n // If this is a responsive layout then set a namespaced/unique onresize event listener on the window\n if (this.layout.responsive_resize){\n this.window_onresize = d3.select(window).on(\"resize.lz-\"+this.id, function(){\n this.rescaleSVG();\n }.bind(this));\n // Forcing one additional setDimensions() call after the page is loaded clears up\n // any disagreements between the initial layout and the loaded responsive container's size\n d3.select(window).on(\"load.lz-\"+this.id, function(){\n this.setDimensions();\n }.bind(this));\n }\n\n // Add panels\n this.layout.panels.forEach(function(panel_layout){\n this.addPanel(panel_layout);\n }.bind(this));\n\n return this;\n};\n\n/**\n * Set the dimensions for a plot, and ensure that panels are sized and positioned correctly.\n *\n * If dimensions are provided, resizes each panel proportionally to match the new plot dimensions. Otherwise,\n * calculates the appropriate plot dimensions based on all panels.\n * @param {Number} [width] If provided and larger than minimum size, set plot to this width\n * @param {Number} [height] If provided and larger than minimum size, set plot to this height\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.setDimensions = function(width, height){\n\n var id;\n\n // Update minimum allowable width and height by aggregating minimums from panels, then apply minimums to containing element.\n var min_width = parseFloat(this.layout.min_width) || 0;\n var min_height = parseFloat(this.layout.min_height) || 0;\n for (id in this.panels){\n min_width = Math.max(min_width, this.panels[id].layout.min_width);\n if (parseFloat(this.panels[id].layout.min_height) > 0 && parseFloat(this.panels[id].layout.proportional_height) > 0){\n min_height = Math.max(min_height, (this.panels[id].layout.min_height / this.panels[id].layout.proportional_height));\n }\n }\n this.layout.min_width = Math.max(min_width, 1);\n this.layout.min_height = Math.max(min_height, 1);\n d3.select(this.svg.node().parentNode).style({\n \"min-width\": this.layout.min_width + \"px\",\n \"min-height\": this.layout.min_height + \"px\"\n });\n\n // If width and height arguments were passed then adjust them against plot minimums if necessary.\n // Then resize the plot and proportionally resize panels to fit inside the new plot dimensions.\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n // Override discrete values if resizing responsively\n if (this.layout.responsive_resize){\n if (this.svg){\n this.layout.width = Math.max(this.svg.node().parentNode.getBoundingClientRect().width, this.layout.min_width);\n }\n this.layout.height = this.layout.width / this.layout.aspect_ratio;\n if (this.layout.height < this.layout.min_height){\n this.layout.height = this.layout.min_height;\n this.layout.width = this.layout.height * this.layout.aspect_ratio;\n }\n }\n // Resize/reposition panels to fit, update proportional origins if necessary\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel_width = this.layout.width;\n var panel_height = this.panels[panel_id].layout.proportional_height * this.layout.height;\n this.panels[panel_id].setDimensions(panel_width, panel_height);\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n this.panels[panel_id].layout.proportional_origin.y = y_offset / this.layout.height;\n y_offset += panel_height;\n this.panels[panel_id].dashboard.update();\n }.bind(this));\n }\n\n // If width and height arguments were NOT passed (and panels exist) then determine the plot dimensions\n // by making it conform to panel dimensions, assuming panels are already positioned correctly.\n else if (Object.keys(this.panels).length) {\n this.layout.width = 0;\n this.layout.height = 0;\n for (id in this.panels){\n this.layout.width = Math.max(this.panels[id].layout.width, this.layout.width);\n this.layout.height += this.panels[id].layout.height;\n }\n this.layout.width = Math.max(this.layout.width, this.layout.min_width);\n this.layout.height = Math.max(this.layout.height, this.layout.min_height);\n }\n\n // Keep aspect ratio in agreement with dimensions\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n\n // Apply layout width and height as discrete values or viewbox values\n if (this.svg !== null){\n if (this.layout.responsive_resize){\n this.svg\n .attr(\"viewBox\", \"0 0 \" + this.layout.width + \" \" + this.layout.height)\n .attr(\"preserveAspectRatio\", \"xMinYMin meet\");\n } else {\n this.svg.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n }\n\n // If the plot has been initialized then trigger some necessary render functions\n if (this.initialized){\n this.panel_boundaries.position();\n this.dashboard.update();\n this.curtain.update();\n this.loader.update();\n }\n\n return this.emit(\"layout_changed\");\n};\n\n/**\n * Create a new panel from a layout, and handle the work of initializing and placing the panel on the plot\n * @param {Object} layout\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Plot.prototype.addPanel = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\"){\n throw \"Invalid panel layout passed to LocusZoom.Plot.prototype.addPanel()\";\n }\n\n // Create the Panel and set its parent\n var panel = new LocusZoom.Panel(layout, this);\n\n // Store the Panel on the Plot\n this.panels[panel.id] = panel;\n\n // If a discrete y_index was set in the layout then adjust other panel y_index values to accommodate this one\n if (panel.layout.y_index !== null && !isNaN(panel.layout.y_index)\n && this.panel_ids_by_y_index.length > 0){\n // Negative y_index values should count backwards from the end, so convert negatives to appropriate values here\n if (panel.layout.y_index < 0){\n panel.layout.y_index = Math.max(this.panel_ids_by_y_index.length + panel.layout.y_index, 0);\n }\n this.panel_ids_by_y_index.splice(panel.layout.y_index, 0, panel.id);\n this.applyPanelYIndexesToPanelLayouts();\n } else {\n var length = this.panel_ids_by_y_index.push(panel.id);\n this.panels[panel.id].layout.y_index = length - 1;\n }\n\n // Determine if this panel was already in the layout.panels array.\n // If it wasn't, add it. Either way store the layout.panels array index on the panel.\n var layout_idx = null;\n this.layout.panels.forEach(function(panel_layout, idx){\n if (panel_layout.id === panel.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.panels.push(this.panels[panel.id].layout) - 1;\n }\n this.panels[panel.id].layout_idx = layout_idx;\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n this.positionPanels();\n // Initialize and load data into the new panel\n this.panels[panel.id].initialize();\n this.panels[panel.id].reMap();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this.panels[panel.id];\n};\n\n\n/**\n * Clear all state, tooltips, and other persisted data associated with one (or all) panel(s) in the plot\n *\n * This is useful when reloading an existing plot with new data, eg \"click for genome region\" links.\n * This is a utility method for custom usage. It is not fired automatically during normal rerender of existing panels\n * @param {String} [panelId] If provided, clear state for only this panel. Otherwise, clear state for all panels.\n * @param {('wipe'|'reset')} [mode='wipe'] Optionally specify how state should be cleared. `wipe` deletes all data\n * and is useful for when the panel is being removed; `reset` is best when the panel will be reused in place.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.clearPanelData = function(panelId, mode) {\n mode = mode || \"wipe\";\n\n // TODO: Add unit tests for this method\n var panelsList;\n if (panelId) {\n panelsList = [panelId];\n } else {\n panelsList = Object.keys(this.panels);\n }\n var self = this;\n panelsList.forEach(function(pid) {\n self.panels[pid].data_layer_ids_by_z_index.forEach(function(dlid){\n var layer = self.panels[pid].data_layers[dlid];\n layer.destroyAllTooltips();\n\n delete self.layout.state[pid + \".\" + dlid];\n if(mode === \"reset\") {\n layer.setDefaultState();\n }\n });\n });\n return this;\n};\n\n/**\n * Remove the panel from the plot, and clear any state, tooltips, or other visual elements belonging to nested content\n * @param {String} id\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.removePanel = function(id){\n if (!this.panels[id]){\n throw (\"Unable to remove panel, ID not found: \" + id);\n }\n\n // Hide all panel boundaries\n this.panel_boundaries.hide();\n\n // Destroy all tooltips and state vars for all data layers on the panel\n this.clearPanelData(id);\n\n // Remove all panel-level HTML overlay elements\n this.panels[id].loader.hide();\n this.panels[id].dashboard.destroy(true);\n this.panels[id].curtain.hide();\n\n // Remove the svg container for the panel if it exists\n if (this.panels[id].svg.container){\n this.panels[id].svg.container.remove();\n }\n\n // Delete the panel and its presence in the plot layout and state\n this.layout.panels.splice(this.panels[id].layout_idx, 1);\n delete this.panels[id];\n delete this.layout.state[id];\n\n // Update layout_idx values for all remaining panels\n this.layout.panels.forEach(function(panel_layout, idx){\n this.panels[panel_layout.id].layout_idx = idx;\n }.bind(this));\n\n // Remove the panel id from the y_index array\n this.panel_ids_by_y_index.splice(this.panel_ids_by_y_index.indexOf(id), 1);\n this.applyPanelYIndexesToPanelLayouts();\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n // Allow the plot to shrink when panels are removed, by forcing it to recalculate min dimensions from scratch\n this.layout.min_height = this._base_layout.min_height;\n this.layout.min_width = this._base_layout.min_width;\n\n this.positionPanels();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this;\n};\n\n\n/**\n * Automatically position panels based on panel positioning rules and values.\n * Keep panels from overlapping vertically by adjusting origins, and keep the sum of proportional heights at 1.\n *\n * TODO: This logic currently only supports dynamic positioning of panels to prevent overlap in a VERTICAL orientation.\n * Some framework exists for positioning panels in horizontal orientations as well (width, proportional_width, origin.x, etc.)\n * but the logic for keeping these user-definable values straight approaches the complexity of a 2D box-packing algorithm.\n * That's complexity we don't need right now, and may not ever need, so it's on hiatus until a use case materializes.\n */\nLocusZoom.Plot.prototype.positionPanels = function(){\n\n var id;\n\n // We want to enforce that all x-linked panels have consistent horizontal margins\n // (to ensure that aligned items stay aligned despite inconsistent initial layout parameters)\n // NOTE: This assumes panels have consistent widths already. That should probably be enforced too!\n var x_linked_margins = { left: 0, right: 0 };\n\n // Proportional heights for newly added panels default to null unless explicitly set, so determine appropriate\n // proportional heights for all panels with a null value from discretely set dimensions.\n // Likewise handle default nulls for proportional widths, but instead just force a value of 1 (full width)\n for (id in this.panels){\n if (this.panels[id].layout.proportional_height === null){\n this.panels[id].layout.proportional_height = this.panels[id].layout.height / this.layout.height;\n }\n if (this.panels[id].layout.proportional_width === null){\n this.panels[id].layout.proportional_width = 1;\n }\n if (this.panels[id].layout.interaction.x_linked){\n x_linked_margins.left = Math.max(x_linked_margins.left, this.panels[id].layout.margin.left);\n x_linked_margins.right = Math.max(x_linked_margins.right, this.panels[id].layout.margin.right);\n }\n }\n\n // Sum the proportional heights and then adjust all proportionally so that the sum is exactly 1\n var total_proportional_height = this.sumProportional(\"height\");\n if (!total_proportional_height){\n return this;\n }\n var proportional_adjustment = 1 / total_proportional_height;\n for (id in this.panels){\n this.panels[id].layout.proportional_height *= proportional_adjustment;\n }\n\n // Update origins on all panels without changing plot-level dimensions yet\n // Also apply x-linked margins to x-linked panels, updating widths as needed\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n y_offset += this.panels[panel_id].layout.height;\n if (this.panels[panel_id].layout.interaction.x_linked){\n var delta = Math.max(x_linked_margins.left - this.panels[panel_id].layout.margin.left, 0)\n + Math.max(x_linked_margins.right - this.panels[panel_id].layout.margin.right, 0);\n this.panels[panel_id].layout.width += delta;\n this.panels[panel_id].layout.margin.left = x_linked_margins.left;\n this.panels[panel_id].layout.margin.right = x_linked_margins.right;\n this.panels[panel_id].layout.cliparea.origin.x = x_linked_margins.left;\n }\n }.bind(this));\n var calculated_plot_height = y_offset;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].layout.proportional_origin.y = this.panels[panel_id].layout.origin.y / calculated_plot_height;\n }.bind(this));\n\n // Update dimensions on the plot to accommodate repositioned panels\n this.setDimensions();\n\n // Set dimensions on all panels using newly set plot-level dimensions and panel-level proportional dimensions\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setDimensions(this.layout.width * this.panels[panel_id].layout.proportional_width,\n this.layout.height * this.panels[panel_id].layout.proportional_height);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Prepare the first rendering of the plot. This includes initializing the individual panels, but also creates shared\n * elements such as mouse events, panel guides/boundaries, and loader/curtain.\n *\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initialize = function(){\n\n // Ensure proper responsive class is present on the containing node if called for\n if (this.layout.responsive_resize){\n d3.select(this.container).classed(\"lz-container-responsive\", true);\n }\n\n // Create an element/layer for containing mouse guides\n if (this.layout.mouse_guide) {\n var mouse_guide_svg = this.svg.append(\"g\")\n .attr(\"class\", \"lz-mouse_guide\").attr(\"id\", this.id + \".mouse_guide\");\n var mouse_guide_vertical_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-vertical\").attr(\"x\",-1);\n var mouse_guide_horizontal_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-horizontal\").attr(\"y\",-1);\n this.mouse_guide = {\n svg: mouse_guide_svg,\n vertical: mouse_guide_vertical_svg,\n horizontal: mouse_guide_horizontal_svg\n };\n }\n\n // Add curtain and loader prototpyes to the plot\n this.curtain = LocusZoom.generateCurtain.call(this);\n this.loader = LocusZoom.generateLoader.call(this);\n\n // Create the panel_boundaries object with show/position/hide methods\n this.panel_boundaries = {\n parent: this,\n hide_timeout: null,\n showing: false,\n dragging: false,\n selectors: [],\n corner_selector: null,\n show: function(){\n // Generate panel boundaries\n if (!this.showing && !this.parent.curtain.showing){\n this.showing = true;\n // Loop through all panels to create a horizontal boundary for each\n this.parent.panel_ids_by_y_index.forEach(function(panel_id, panel_idx){\n var selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-boundary\")\n .attr(\"title\", \"Resize panel\");\n selector.append(\"span\");\n var panel_resize_drag = d3.behavior.drag();\n panel_resize_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n panel_resize_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n panel_resize_drag.on(\"drag\", function(){\n // First set the dimensions on the panel we're resizing\n var this_panel = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]];\n var original_panel_height = this_panel.layout.height;\n this_panel.setDimensions(this_panel.layout.width, this_panel.layout.height + d3.event.dy);\n var panel_height_change = this_panel.layout.height - original_panel_height;\n var new_calculated_plot_height = this.parent.layout.height + panel_height_change;\n // Next loop through all panels.\n // Update proportional dimensions for all panels including the one we've resized using discrete heights.\n // Reposition panels with a greater y-index than this panel to their appropriate new origin.\n this.parent.panel_ids_by_y_index.forEach(function(loop_panel_id, loop_panel_idx){\n var loop_panel = this.parent.panels[this.parent.panel_ids_by_y_index[loop_panel_idx]];\n loop_panel.layout.proportional_height = loop_panel.layout.height / new_calculated_plot_height;\n if (loop_panel_idx > panel_idx){\n loop_panel.setOrigin(loop_panel.layout.origin.x, loop_panel.layout.origin.y + panel_height_change);\n loop_panel.dashboard.position();\n }\n }.bind(this));\n // Reset dimensions on the entire plot and reposition panel boundaries\n this.parent.positionPanels();\n this.position();\n }.bind(this));\n selector.call(panel_resize_drag);\n this.parent.panel_boundaries.selectors.push(selector);\n }.bind(this));\n // Create a corner boundary / resize element on the bottom-most panel that resizes the entire plot\n var corner_selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-corner-boundary\")\n .attr(\"title\", \"Resize plot\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-outer\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-inner\");\n var corner_drag = d3.behavior.drag();\n corner_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n corner_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n corner_drag.on(\"drag\", function(){\n this.setDimensions(this.layout.width + d3.event.dx, this.layout.height + d3.event.dy);\n }.bind(this.parent));\n corner_selector.call(corner_drag);\n this.parent.panel_boundaries.corner_selector = corner_selector;\n }\n return this.position();\n },\n position: function(){\n if (!this.showing){ return this; }\n // Position panel boundaries\n var plot_page_origin = this.parent.getPageOrigin();\n this.selectors.forEach(function(selector, panel_idx){\n var panel_page_origin = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].getPageOrigin();\n var left = plot_page_origin.x;\n var top = panel_page_origin.y + this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].layout.height - 12;\n var width = this.parent.layout.width - 1;\n selector.style({\n top: top + \"px\",\n left: left + \"px\",\n width: width + \"px\"\n });\n selector.select(\"span\").style({\n width: width + \"px\"\n });\n }.bind(this));\n // Position corner selector\n var corner_padding = 10;\n var corner_size = 16;\n this.corner_selector.style({\n top: (plot_page_origin.y + this.parent.layout.height - corner_padding - corner_size) + \"px\",\n left: (plot_page_origin.x + this.parent.layout.width - corner_padding - corner_size) + \"px\"\n });\n return this;\n },\n hide: function(){\n if (!this.showing){ return this; }\n this.showing = false;\n // Remove panel boundaries\n this.selectors.forEach(function(selector){ selector.remove(); });\n this.selectors = [];\n // Remove corner boundary\n this.corner_selector.remove();\n this.corner_selector = null;\n return this;\n }\n };\n\n // Show panel boundaries stipulated by the layout (basic toggle, only show on mouse over plot)\n if (this.layout.panel_boundaries){\n d3.select(this.svg.node().parentNode).on(\"mouseover.\" + this.id + \".panel_boundaries\", function(){\n clearTimeout(this.panel_boundaries.hide_timeout);\n this.panel_boundaries.show();\n }.bind(this));\n d3.select(this.svg.node().parentNode).on(\"mouseout.\" + this.id + \".panel_boundaries\", function(){\n this.panel_boundaries.hide_timeout = setTimeout(function(){\n this.panel_boundaries.hide();\n }.bind(this), 300);\n }.bind(this));\n }\n\n // Create the dashboard object and immediately show it\n this.dashboard = new LocusZoom.Dashboard(this).show();\n\n // Initialize all panels\n for (var id in this.panels){\n this.panels[id].initialize();\n }\n\n // Define plot-level mouse events\n var namespace = \".\" + this.id;\n if (this.layout.mouse_guide) {\n var mouseout_mouse_guide = function(){\n this.mouse_guide.vertical.attr(\"x\", -1);\n this.mouse_guide.horizontal.attr(\"y\", -1);\n }.bind(this);\n var mousemove_mouse_guide = function(){\n var coords = d3.mouse(this.svg.node());\n this.mouse_guide.vertical.attr(\"x\", coords[0]);\n this.mouse_guide.horizontal.attr(\"y\", coords[1]);\n }.bind(this);\n this.svg\n .on(\"mouseout\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"touchleave\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"mousemove\" + namespace + \"-mouse_guide\", mousemove_mouse_guide);\n }\n var mouseup = function(){\n this.stopDrag();\n }.bind(this);\n var mousemove = function(){\n if (this.interaction.dragging){\n var coords = d3.mouse(this.svg.node());\n if (d3.event){ d3.event.preventDefault(); }\n this.interaction.dragging.dragged_x = coords[0] - this.interaction.dragging.start_x;\n this.interaction.dragging.dragged_y = coords[1] - this.interaction.dragging.start_y;\n this.panels[this.interaction.panel_id].render();\n this.interaction.linked_panel_ids.forEach(function(panel_id){\n this.panels[panel_id].render();\n }.bind(this));\n }\n }.bind(this);\n this.svg\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup)\n .on(\"mousemove\" + namespace, mousemove)\n .on(\"touchmove\" + namespace, mousemove);\n\n // Add an extra namespaced mouseup handler to the containing body, if there is one\n // This helps to stop interaction events gracefully when dragging outside of the plot element\n if (!d3.select(\"body\").empty()){\n d3.select(\"body\")\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup);\n }\n\n this.initialized = true;\n\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n var client_rect = this.svg.node().getBoundingClientRect();\n var width = client_rect.width ? client_rect.width : this.layout.width;\n var height = client_rect.height ? client_rect.height : this.layout.height;\n this.setDimensions(width, height);\n\n return this;\n\n};\n\n/**\n * Refresh (or fetch) a plot's data from sources, regardless of whether position or state has changed\n * @returns {Promise}\n */\nLocusZoom.Plot.prototype.refresh = function(){\n return this.applyState();\n};\n\n\n/**\n * A user-defined callback function that can receive (and potentially act on) new plot data.\n * @callback externalDataCallback\n * @param {Object} new_data The body resulting from a data request. This represents the same information that would be passed to\n * a data layer making an equivalent request.\n */\n\n/**\n * A user-defined callback function that can respond to errors received during a previous operation\n * @callback externalErrorCallback\n * @param err A representation of the error that occurred\n */\n\n/**\n * Allow newly fetched data to be made available outside the LocusZoom plot. For example, a callback could be\n * registered to draw an HTML table of top GWAS hits, and update that table whenever the plot region changes.\n *\n * This is a convenience method for external hooks. It registers an event listener and returns parsed data,\n * using the same fields syntax and underlying methods as data layers.\n *\n * @param {String[]} fields An array of field names and transforms, in the same syntax used by a data layer.\n * Different data sources should be prefixed by the source name.\n * @param {externalDataCallback} success_callback Used defined function that is automatically called any time that\n * new data is received by the plot.\n * @param {Object} [opts] Options\n * @param {externalErrorCallback} [opts.onerror] User defined function that is automatically called if a problem\n * occurs during the data request or subsequent callback operations\n * @param {boolean} [opts.discrete=false] Normally the callback will subscribe to the combined body from the chain,\n * which may not be in a format that matches what the external callback wants to do. If discrete=true, returns the\n * uncombined record info\n * @return {function} The newly created event listener, to allow for later cleanup/removal\n */\nLocusZoom.Plot.prototype.subscribeToData = function(fields, success_callback, opts) {\n opts = opts || {};\n\n // Register an event listener that is notified whenever new data has been rendered\n var error_callback = opts.onerror || function(err) {\n console.log(\"An error occurred while acting on an external callback\", err);\n };\n var self = this;\n\n var listener = function() {\n try {\n self.lzd.getData(self.state, fields)\n .then(function (new_data) {\n success_callback(opts.discrete ? new_data.discrete : new_data.body);\n }).catch(error_callback);\n } catch (error) {\n // In certain cases, errors are thrown before a promise can be generated, and LZ error display seems to rely on these errors bubbling up\n error_callback(error);\n }\n };\n this.on(\"data_rendered\", listener);\n return listener;\n};\n\n/**\n * Update state values and trigger a pull for fresh data on all data sources for all data layers\n * @param state_changes\n * @returns {Promise} A promise that resolves when all data fetch and update operations are complete\n */\nLocusZoom.Plot.prototype.applyState = function(state_changes){\n state_changes = state_changes || {};\n if (typeof state_changes != \"object\"){\n throw(\"LocusZoom.applyState only accepts an object; \" + (typeof state_changes) + \" given\");\n }\n\n // First make a copy of the current (old) state to work with\n var new_state = JSON.parse(JSON.stringify(this.state));\n\n // Apply changes by top-level property to the new state\n for (var property in state_changes) {\n new_state[property] = state_changes[property];\n }\n\n // Validate the new state (may do nothing, may do a lot, depends on how the user has things set up)\n new_state = LocusZoom.validateState(new_state, this.layout);\n\n // Apply new state to the actual state\n for (property in new_state) {\n this.state[property] = new_state[property];\n }\n\n // Generate requests for all panels given new state\n this.emit(\"data_requested\");\n this.remap_promises = [];\n this.loading_data = true;\n for (var id in this.panels){\n this.remap_promises.push(this.panels[id].reMap());\n }\n\n return Q.all(this.remap_promises)\n .catch(function(error){\n console.error(error);\n this.curtain.drop(error);\n this.loading_data = false;\n }.bind(this))\n .then(function(){\n // TODO: Check logic here; in some promise implementations, this would cause the error to be considered handled, and \"then\" would always fire. (may or may not be desired behavior)\n // Update dashboard / components\n this.dashboard.update();\n\n // Apply panel-level state values\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel = this.panels[panel_id];\n panel.dashboard.update();\n // Apply data-layer-level state values\n panel.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n var data_layer = this.data_layers[data_layer_id];\n var state_id = panel_id + \".\" + data_layer_id;\n for (var property in this.state[state_id]){\n if (!this.state[state_id].hasOwnProperty(property)){ continue; }\n if (Array.isArray(this.state[state_id][property])){\n this.state[state_id][property].forEach(function(element_id){\n try {\n this.setElementStatus(property, this.getElementById(element_id), true);\n } catch (e){\n console.error(\"Unable to apply state: \" + state_id + \", \" + property);\n }\n }.bind(data_layer));\n }\n }\n }.bind(panel));\n }.bind(this));\n\n // Emit events\n this.emit(\"layout_changed\");\n this.emit(\"data_rendered\");\n this.emit(\"state_changed\", state_changes);\n\n this.loading_data = false;\n\n }.bind(this));\n};\n\n/**\n * Register interactions along the specified axis, provided that the target panel allows interaction.\n *\n * @param {LocusZoom.Panel} panel\n * @param {('x_tick'|'y1_tick'|'y2_tick')} method The direction (axis) along which dragging is being performed.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.startDrag = function(panel, method){\n\n panel = panel || null;\n method = method || null;\n\n var axis = null;\n switch (method){\n case \"background\":\n case \"x_tick\":\n axis = \"x\";\n break;\n case \"y1_tick\":\n axis = \"y1\";\n break;\n case \"y2_tick\":\n axis = \"y2\";\n break;\n }\n\n if (!(panel instanceof LocusZoom.Panel) || !axis || !this.canInteract()){ return this.stopDrag(); }\n\n var coords = d3.mouse(this.svg.node());\n this.interaction = {\n panel_id: panel.id,\n linked_panel_ids: panel.getLinkedPanelIds(axis),\n dragging: {\n method: method,\n start_x: coords[0],\n start_y: coords[1],\n dragged_x: 0,\n dragged_y: 0,\n axis: axis\n }\n };\n\n this.svg.style(\"cursor\", \"all-scroll\");\n\n return this;\n\n};\n\n/**\n * Process drag interactions across the target panel and synchronize plot state across other panels in sync;\n * clear the event when complete\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.stopDrag = function(){\n\n if (!this.interaction.dragging){ return this; }\n\n if (typeof this.panels[this.interaction.panel_id] != \"object\"){\n this.interaction = {};\n return this;\n }\n var panel = this.panels[this.interaction.panel_id];\n\n // Helper function to find the appropriate axis layouts on child data layers\n // Once found, apply the extent as floor/ceiling and remove all other directives\n // This forces all associated axes to conform to the extent generated by a drag action\n var overrideAxisLayout = function(axis, axis_number, extent){\n panel.data_layer_ids_by_z_index.forEach(function(id){\n if (panel.data_layers[id].layout[axis+\"_axis\"].axis === axis_number){\n panel.data_layers[id].layout[axis+\"_axis\"].floor = extent[0];\n panel.data_layers[id].layout[axis+\"_axis\"].ceiling = extent[1];\n delete panel.data_layers[id].layout[axis+\"_axis\"].lower_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].upper_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].min_extent;\n delete panel.data_layers[id].layout[axis+\"_axis\"].ticks;\n }\n });\n };\n\n switch(this.interaction.dragging.method){\n case \"background\":\n case \"x_tick\":\n if (this.interaction.dragging.dragged_x !== 0){\n overrideAxisLayout(\"x\", 1, panel.x_extent);\n this.applyState({ start: panel.x_extent[0], end: panel.x_extent[1] });\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n if (this.interaction.dragging.dragged_y !== 0){\n // TODO: Hardcoded assumption of only two possible axes with single-digit #s (switch/case)\n var y_axis_number = parseInt(this.interaction.dragging.method[1]);\n overrideAxisLayout(\"y\", y_axis_number, panel[\"y\"+y_axis_number+\"_extent\"]);\n }\n break;\n }\n\n this.interaction = {};\n this.svg.style(\"cursor\", null);\n\n return this;\n\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A panel is an abstract class representing a subdivision of the LocusZoom stage\n * to display a distinct data representation as a collection of data layers.\n * @class\n * @param {Object} layout\n * @param {LocusZoom.Plot|null} parent\n*/\nLocusZoom.Panel = function(layout, parent) {\n\n if (typeof layout !== \"object\"){\n throw \"Unable to create panel, invalid layout\";\n }\n\n /** @member {LocusZoom.Plot|null} */\n this.parent = parent || null;\n /** @member {LocusZoom.Plot|null} */\n this.parent_plot = parent;\n\n // Ensure a valid ID is present. If there is no valid ID then generate one\n if (typeof layout.id !== \"string\" || !layout.id.length){\n if (!this.parent){\n layout.id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n } else {\n var id = null;\n var generateID = function(){\n id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n if (id == null || typeof this.parent.panels[id] != \"undefined\"){\n id = generateID();\n }\n }.bind(this);\n layout.id = id;\n }\n } else if (this.parent) {\n if (typeof this.parent.panels[layout.id] !== \"undefined\"){\n throw \"Cannot create panel with id [\" + layout.id + \"]; panel with that id already exists\";\n }\n }\n /** @member {String} */\n this.id = layout.id;\n\n /** @member {Boolean} */\n this.initialized = false;\n /**\n * The index of this panel in the parent plot's `layout.panels`\n * @member {number}\n * */\n this.layout_idx = null;\n /** @member {Object} */\n this.svg = {};\n\n /**\n * A JSON-serializable object used to describe the composition of the Panel\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.Panel.DefaultLayout);\n\n // Define state parameters specific to this panel\n if (this.parent){\n /** @member {Object} */\n this.state = this.parent.state;\n\n /** @member {String} */\n this.state_id = this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n } else {\n this.state = null;\n this.state_id = null;\n }\n\n /** @member {Object} */\n this.data_layers = {};\n /** @member {String[]} */\n this.data_layer_ids_by_z_index = [];\n\n /** @protected */\n this.applyDataLayerZIndexesToDataLayerLayouts = function(){\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n }.bind(this);\n\n /**\n * Track data requests in progress\n * @member {Promise[]}\n * @protected\n */\n this.data_promises = [];\n\n /** @member {d3.scale} */\n this.x_scale = null;\n /** @member {d3.scale} */\n this.y1_scale = null;\n /** @member {d3.scale} */\n this.y2_scale = null;\n\n /** @member {d3.extent} */\n this.x_extent = null;\n /** @member {d3.extent} */\n this.y1_extent = null;\n /** @member {d3.extent} */\n this.y2_extent = null;\n\n /** @member {Number[]} */\n this.x_ticks = [];\n /** @member {Number[]} */\n this.y1_ticks = [];\n /** @member {Number[]} */\n this.y2_ticks = [];\n\n /**\n * A timeout ID as returned by setTimeout\n * @protected\n * @member {number}\n */\n this.zoom_timeout = null;\n\n /** @returns {string} */\n this.getBaseId = function(){\n return this.parent.id + \".\" + this.id;\n };\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": []\n };\n /**\n * There are several events that a LocusZoom panel can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following panel-level events are currently supported:\n * - `layout_changed` - context: panel - Any aspect of the panel's layout (including dimensions or state) has changed.\n * - `data_requested` - context: panel - A request for new data from any data source used in the panel has been made.\n * - `data_rendered` - context: panel - Data from a request has been received and rendered in the panel.\n * - `element_clicked` - context: panel - A data element in any of the panel's data layers has been clicked.\n * - `element_selection` - context: panel - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `panel.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * panel itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of the event (as defined in `event_hooks`)\n * @param {function} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n // TODO: Dry plot and panel event code into a shared mixin\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Panel}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n *\n * There is a shorter overloaded form of this method: if the event does not have any data, the second\n * argument can be a boolean to control bubbling\n *\n * @param {string} event A known event name\n * @param {*} [eventData] Data or event description that will be passed to the event listener\n * @param {boolean} [bubble=false] Whether to bubble the event to the parent\n * @returns {LocusZoom.Panel}\n */\n this.emit = function(event, eventData, bubble) {\n bubble = bubble || false;\n\n // TODO: DRY this with the parent plot implementation. Ensure interfaces remain compatible.\n // TODO: Improve documentation for overloaded method signature (JSDoc may have trouble here)\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n if (typeof eventData === \"boolean\" && arguments.length === 2) {\n // Overloaded method signature: emit(event, bubble)\n bubble = eventData;\n eventData = null;\n }\n var sourceID = this.getBaseId();\n var self = this;\n var eventContext = {sourceID: sourceID, data: eventData || null};\n this.event_hooks[event].forEach(function(hookToRun) {\n // By default, any handlers fired here will see the panel as the value of `this`. If a bound function is\n // registered as a handler, the previously bound `this` will override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n if (bubble && this.parent) {\n this.parent.emit(event, eventContext);\n }\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\n this.getPageOrigin = function(){\n var plot_origin = this.parent.getPageOrigin();\n return {\n x: plot_origin.x + this.layout.origin.x,\n y: plot_origin.y + this.layout.origin.y\n };\n };\n\n // Initialize the layout\n this.initializeLayout();\n\n return this;\n\n};\n\n/**\n * Default panel layout\n * @static\n * @type {Object}\n */\nLocusZoom.Panel.DefaultLayout = {\n title: { text: \"\", style: {}, x: 10, y: 22 },\n y_index: null,\n width: 0,\n height: 0,\n origin: { x: 0, y: null },\n min_width: 1,\n min_height: 1,\n proportional_width: null,\n proportional_height: null,\n proportional_origin: { x: 0, y: null },\n margin: { top: 0, right: 0, bottom: 0, left: 0 },\n background_click: \"clear_selections\",\n dashboard: {\n components: []\n },\n cliparea: {\n height: 0,\n width: 0,\n origin: { x: 0, y: 0 }\n },\n axes: { // These are the only axes supported!!\n x: {},\n y1: {},\n y2: {}\n },\n legend: null,\n interaction: {\n drag_background_to_pan: false,\n drag_x_ticks_to_scale: false,\n drag_y1_ticks_to_scale: false,\n drag_y2_ticks_to_scale: false,\n scroll_to_zoom: false,\n x_linked: false,\n y1_linked: false,\n y2_linked: false\n },\n data_layers: []\n};\n\n/**\n * Prepare the panel for first use by performing parameter validation, creating axes, setting default dimensions,\n * and preparing / positioning data layers as appropriate.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initializeLayout = function(){\n\n // If the layout is missing BOTH width and proportional width then set the proportional width to 1.\n // This will default the panel to taking up the full width of the plot.\n if (this.layout.width === 0 && this.layout.proportional_width === null){\n this.layout.proportional_width = 1;\n }\n\n // If the layout is missing BOTH height and proportional height then set the proportional height to\n // an equal share of the plot's current height.\n if (this.layout.height === 0 && this.layout.proportional_height === null){\n var panel_count = Object.keys(this.parent.panels).length;\n if (panel_count > 0){\n this.layout.proportional_height = (1 / panel_count);\n } else {\n this.layout.proportional_height = 1;\n }\n }\n\n // Set panel dimensions, origin, and margin\n this.setDimensions();\n this.setOrigin();\n this.setMargin();\n\n // Set ranges\n // TODO: Define stub values in constructor\n this.x_range = [0, this.layout.cliparea.width];\n this.y1_range = [this.layout.cliparea.height, 0];\n this.y2_range = [this.layout.cliparea.height, 0];\n\n // Initialize panel axes\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!Object.keys(this.layout.axes[axis]).length || this.layout.axes[axis].render ===false){\n // The default layout sets the axis to an empty object, so set its render boolean here\n this.layout.axes[axis].render = false;\n } else {\n this.layout.axes[axis].render = true;\n this.layout.axes[axis].label = this.layout.axes[axis].label || null;\n this.layout.axes[axis].label_function = this.layout.axes[axis].label_function || null;\n }\n }.bind(this));\n\n // Add data layers (which define x and y extents)\n this.layout.data_layers.forEach(function(data_layer_layout){\n this.addDataLayer(data_layer_layout);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Set the dimensions for the panel. If passed with no arguments will calculate optimal size based on layout\n * directives and the available area within the plot. If passed discrete width (number) and height (number) will\n * attempt to resize the panel to them, but may be limited by minimum dimensions defined on the plot or panel.\n *\n * @public\n * @param {number} [width]\n * @param {number} [height]\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setDimensions = function(width, height){\n if (typeof width != \"undefined\" && typeof height != \"undefined\"){\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n }\n } else {\n if (this.layout.proportional_width !== null){\n this.layout.width = Math.max(this.layout.proportional_width * this.parent.layout.width, this.layout.min_width);\n }\n if (this.layout.proportional_height !== null){\n this.layout.height = Math.max(this.layout.proportional_height * this.parent.layout.height, this.layout.min_height);\n }\n }\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n if (this.svg.clipRect){\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n if (this.initialized){\n this.render();\n this.curtain.update();\n this.loader.update();\n this.dashboard.update();\n if (this.legend){ this.legend.position(); }\n }\n return this;\n};\n\n/**\n * Set panel origin on the plot, and re-render as appropriate\n *\n * @public\n * @param {number} x\n * @param {number} y\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setOrigin = function(x, y){\n if (!isNaN(x) && x >= 0){ this.layout.origin.x = Math.max(Math.round(+x), 0); }\n if (!isNaN(y) && y >= 0){ this.layout.origin.y = Math.max(Math.round(+y), 0); }\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set margins around this panel\n * @public\n * @param {number} top\n * @param {number} right\n * @param {number} bottom\n * @param {number} left\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setMargin = function(top, right, bottom, left){\n var extra;\n if (!isNaN(top) && top >= 0){ this.layout.margin.top = Math.max(Math.round(+top), 0); }\n if (!isNaN(right) && right >= 0){ this.layout.margin.right = Math.max(Math.round(+right), 0); }\n if (!isNaN(bottom) && bottom >= 0){ this.layout.margin.bottom = Math.max(Math.round(+bottom), 0); }\n if (!isNaN(left) && left >= 0){ this.layout.margin.left = Math.max(Math.round(+left), 0); }\n if (this.layout.margin.top + this.layout.margin.bottom > this.layout.height){\n extra = Math.floor(((this.layout.margin.top + this.layout.margin.bottom) - this.layout.height) / 2);\n this.layout.margin.top -= extra;\n this.layout.margin.bottom -= extra;\n }\n if (this.layout.margin.left + this.layout.margin.right > this.layout.width){\n extra = Math.floor(((this.layout.margin.left + this.layout.margin.right) - this.layout.width) / 2);\n this.layout.margin.left -= extra;\n this.layout.margin.right -= extra;\n }\n [\"top\", \"right\", \"bottom\", \"left\"].forEach(function(m){\n this.layout.margin[m] = Math.max(this.layout.margin[m], 0);\n }.bind(this));\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n this.layout.cliparea.origin.x = this.layout.margin.left;\n this.layout.cliparea.origin.y = this.layout.margin.top;\n\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set the title for the panel. If passed an object, will merge the object with the existing layout configuration, so\n * that all or only some of the title layout object's parameters can be customized. If passed null, false, or an empty\n * string, the title DOM element will be set to display: none.\n *\n * @param {string|object|null} title The title text, or an object with additional configuration\n * @param {string} title.text Text to display. Since titles are rendered as SVG text, HTML and newlines will not be rendered.\n * @param {number} title.x X-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n * @param {number} title.y Y-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n NOTE: SVG y values go from the top down, so the SVG origin of (0,0) is in the top left corner.\n * @param {object} title.style CSS styles object to be applied to the title's DOM element.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setTitle = function(title){\n if (typeof this.layout.title == \"string\"){\n var text = this.layout.title;\n this.layout.title = { text: text, x: 0, y: 0, style: {} };\n }\n if (typeof title == \"string\"){\n this.layout.title.text = title;\n } else if (typeof title == \"object\" && title !== null){\n this.layout.title = LocusZoom.Layouts.merge(title, this.layout.title);\n }\n if (this.layout.title.text.length){\n this.title.attr(\"display\", null)\n .attr(\"x\", parseFloat(this.layout.title.x))\n .attr(\"y\", parseFloat(this.layout.title.y))\n .style(this.layout.title.style)\n .text(this.layout.title.text);\n } else {\n this.title.attr(\"display\", \"none\");\n }\n return this;\n};\n\n\n/**\n * Prepare the first rendering of the panel. This includes drawing the individual data layers, but also creates shared\n * elements such as axes, title, and loader/curtain.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initialize = function(){\n\n // Append a container group element to house the main panel group element and the clip path\n // Position with initial layout parameters\n this.svg.container = this.parent.svg.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel_container\")\n .attr(\"transform\", \"translate(\" + (this.layout.origin.x || 0) + \",\" + (this.layout.origin.y || 0) + \")\");\n\n // Append clip path to the parent svg element, size with initial layout parameters\n var clipPath = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\");\n this.svg.clipRect = clipPath.append(\"rect\")\n .attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Append svg group for rendering all panel child elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n // Add curtain and loader prototypes to the panel\n /** @member {Object} */\n this.curtain = LocusZoom.generateCurtain.call(this);\n /** @member {Object} */\n this.loader = LocusZoom.generateLoader.call(this);\n\n /**\n * Create the dashboard object and hang components on it as defined by panel layout\n * @member {LocusZoom.Dashboard}\n */\n this.dashboard = new LocusZoom.Dashboard(this);\n\n // Inner border\n this.inner_border = this.svg.group.append(\"rect\")\n .attr(\"class\", \"lz-panel-background\")\n .on(\"click\", function(){\n if (this.layout.background_click === \"clear_selections\"){ this.clearSelections(); }\n }.bind(this));\n\n // Add the title\n /** @member {Element} */\n this.title = this.svg.group.append(\"text\").attr(\"class\", \"lz-panel-title\");\n if (typeof this.layout.title != \"undefined\"){ this.setTitle(); }\n\n // Initialize Axes\n this.svg.x_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".x_axis\").attr(\"class\", \"lz-x lz-axis\");\n if (this.layout.axes.x.render){\n this.svg.x_axis_label = this.svg.x_axis.append(\"text\")\n .attr(\"class\", \"lz-x lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y1_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y1_axis\").attr(\"class\", \"lz-y lz-y1 lz-axis\");\n if (this.layout.axes.y1.render){\n this.svg.y1_axis_label = this.svg.y1_axis.append(\"text\")\n .attr(\"class\", \"lz-y1 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y2_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y2_axis\").attr(\"class\", \"lz-y lz-y2 lz-axis\");\n if (this.layout.axes.y2.render){\n this.svg.y2_axis_label = this.svg.y2_axis.append(\"text\")\n .attr(\"class\", \"lz-y2 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n\n // Initialize child Data Layers\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].initialize();\n }.bind(this));\n\n /**\n * Legend object, as defined by panel layout and child data layer layouts\n * @member {LocusZoom.Legend}\n * */\n this.legend = null;\n if (this.layout.legend){\n this.legend = new LocusZoom.Legend(this);\n }\n\n // Establish panel background drag interaction mousedown event handler (on the panel background)\n if (this.layout.interaction.drag_background_to_pan){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var mousedown = function(){\n this.parent.startDrag(this, \"background\");\n }.bind(this);\n this.svg.container.select(\".lz-panel-background\")\n .on(\"mousedown\" + namespace + \".background\", mousedown)\n .on(\"touchstart\" + namespace + \".background\", mousedown);\n }\n\n return this;\n\n};\n\n/**\n * Refresh the sort order of all data layers (called by data layer moveUp and moveDown methods)\n */\nLocusZoom.Panel.prototype.resortDataLayers = function(){\n var sort = [];\n this.data_layer_ids_by_z_index.forEach(function(id){\n sort.push(this.data_layers[id].layout.z_index);\n }.bind(this));\n this.svg.group.selectAll(\"g.lz-data_layer-container\").data(sort).sort(d3.ascending);\n this.applyDataLayerZIndexesToDataLayerLayouts();\n};\n\n/**\n * Get an array of panel IDs that are axis-linked to this panel\n * @param {('x'|'y1'|'y2')} axis\n * @returns {Array}\n */\nLocusZoom.Panel.prototype.getLinkedPanelIds = function(axis){\n axis = axis || null;\n var linked_panel_ids = [];\n if ([\"x\",\"y1\",\"y2\"].indexOf(axis) === -1){ return linked_panel_ids; }\n if (!this.layout.interaction[axis + \"_linked\"]){ return linked_panel_ids; }\n this.parent.panel_ids_by_y_index.forEach(function(panel_id){\n if (panel_id !== this.id && this.parent.panels[panel_id].layout.interaction[axis + \"_linked\"]){\n linked_panel_ids.push(panel_id);\n }\n }.bind(this));\n return linked_panel_ids;\n};\n\n/**\n * Move a panel up relative to others by y-index\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveUp = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index - 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index - 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index - 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Move a panel down (y-axis) relative to others in the plot\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveDown = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index + 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index + 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index + 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Create a new data layer from a provided layout object. Should have the keys specified in `DefaultLayout`\n * Will automatically add at the top (depth/z-index) of the panel unless explicitly directed differently\n * in the layout provided.\n * @param {object} layout\n * @returns {*}\n */\nLocusZoom.Panel.prototype.addDataLayer = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\" || typeof layout.id !== \"string\" || !layout.id.length){\n throw \"Invalid data layer layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n if (typeof this.data_layers[layout.id] !== \"undefined\"){\n throw \"Cannot create data_layer with id [\" + layout.id + \"]; data layer with that id already exists in the panel\";\n }\n if (typeof layout.type !== \"string\"){\n throw \"Invalid data layer type in layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n\n // If the layout defines a y axis make sure the axis number is set and is 1 or 2 (default to 1)\n if (typeof layout.y_axis == \"object\" && (typeof layout.y_axis.axis == \"undefined\" || [1,2].indexOf(layout.y_axis.axis) === -1)){\n layout.y_axis.axis = 1;\n }\n\n // Create the Data Layer\n var data_layer = LocusZoom.DataLayers.get(layout.type, layout, this);\n\n // Store the Data Layer on the Panel\n this.data_layers[data_layer.id] = data_layer;\n\n // If a discrete z_index was set in the layout then adjust other data layer z_index values to accommodate this one\n if (data_layer.layout.z_index !== null && !isNaN(data_layer.layout.z_index)\n && this.data_layer_ids_by_z_index.length > 0){\n // Negative z_index values should count backwards from the end, so convert negatives to appropriate values here\n if (data_layer.layout.z_index < 0){\n data_layer.layout.z_index = Math.max(this.data_layer_ids_by_z_index.length + data_layer.layout.z_index, 0);\n }\n this.data_layer_ids_by_z_index.splice(data_layer.layout.z_index, 0, data_layer.id);\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n } else {\n var length = this.data_layer_ids_by_z_index.push(data_layer.id);\n this.data_layers[data_layer.id].layout.z_index = length - 1;\n }\n\n // Determine if this data layer was already in the layout.data_layers array.\n // If it wasn't, add it. Either way store the layout.data_layers array index on the data_layer.\n var layout_idx = null;\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n if (data_layer_layout.id === data_layer.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.data_layers.push(this.data_layers[data_layer.id].layout) - 1;\n }\n this.data_layers[data_layer.id].layout_idx = layout_idx;\n\n return this.data_layers[data_layer.id];\n};\n\n/**\n * Remove a data layer by id\n * @param {string} id\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.removeDataLayer = function(id){\n if (!this.data_layers[id]){\n throw (\"Unable to remove data layer, ID not found: \" + id);\n }\n\n // Destroy all tooltips for the data layer\n this.data_layers[id].destroyAllTooltips();\n\n // Remove the svg container for the data layer if it exists\n if (this.data_layers[id].svg.container){\n this.data_layers[id].svg.container.remove();\n }\n\n // Delete the data layer and its presence in the panel layout and state\n this.layout.data_layers.splice(this.data_layers[id].layout_idx, 1);\n delete this.state[this.data_layers[id].state_id];\n delete this.data_layers[id];\n\n // Remove the data_layer id from the z_index array\n this.data_layer_ids_by_z_index.splice(this.data_layer_ids_by_z_index.indexOf(id), 1);\n\n // Update layout_idx and layout.z_index values for all remaining data_layers\n this.applyDataLayerZIndexesToDataLayerLayouts();\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n this.data_layers[data_layer_layout.id].layout_idx = idx;\n }.bind(this));\n\n return this;\n};\n\n/**\n * Clear all selections on all data layers\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.clearSelections = function(){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(\"selected\", false);\n }.bind(this));\n return this;\n};\n\n/**\n * When the parent plot changes state, adjust the panel accordingly. For example, this may include fetching new data\n * from the API as the viewing region changes\n * @returns {Promise}\n */\nLocusZoom.Panel.prototype.reMap = function(){\n this.emit(\"data_requested\");\n this.data_promises = [];\n\n // Remove any previous error messages before attempting to load new data\n this.curtain.hide();\n // Trigger reMap on each Data Layer\n for (var id in this.data_layers){\n try {\n this.data_promises.push(this.data_layers[id].reMap());\n } catch (error) {\n console.warn(error);\n this.curtain.show(error);\n }\n }\n // When all finished trigger a render\n return Q.all(this.data_promises)\n .then(function(){\n this.initialized = true;\n this.render();\n this.emit(\"layout_changed\", true);\n this.emit(\"data_rendered\");\n }.bind(this))\n .catch(function(error){\n console.warn(error);\n this.curtain.show(error);\n }.bind(this));\n};\n\n/**\n * Iterate over data layers to generate panel axis extents\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.generateExtents = function(){\n\n // Reset extents\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n this[axis + \"_extent\"] = null;\n }.bind(this));\n\n // Loop through the data layers\n for (var id in this.data_layers){\n\n var data_layer = this.data_layers[id];\n\n // If defined and not decoupled, merge the x extent of the data layer with the panel's x extent\n if (data_layer.layout.x_axis && !data_layer.layout.x_axis.decoupled){\n this.x_extent = d3.extent((this.x_extent || []).concat(data_layer.getAxisExtent(\"x\")));\n }\n\n // If defined and not decoupled, merge the y extent of the data layer with the panel's appropriate y extent\n if (data_layer.layout.y_axis && !data_layer.layout.y_axis.decoupled){\n var y_axis = \"y\" + data_layer.layout.y_axis.axis;\n this[y_axis+\"_extent\"] = d3.extent((this[y_axis+\"_extent\"] || []).concat(data_layer.getAxisExtent(\"y\")));\n }\n\n }\n\n // Override x_extent from state if explicitly defined to do so\n if (this.layout.axes.x && this.layout.axes.x.extent === \"state\"){\n this.x_extent = [ this.state.start, this.state.end ];\n }\n\n return this;\n\n};\n\n/**\n * Generate an array of ticks for an axis. These ticks are generated in one of three ways (highest wins):\n * 1. An array of specific tick marks\n * 2. Query each data layer for what ticks are appropriate, and allow a panel-level tick configuration parameter\n * object to override the layer's default presentation settings\n * 3. Generate generic tick marks based on the extent of the data\n * @param {('x'|'y1'|'y2')} axis The string identifier of the axis\n * @returns {Number[]|Object[]} TODO: number format?\n * An array of numbers: interpreted as an array of axis value offsets for positioning.\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.Panel.prototype.generateTicks = function(axis){\n\n // Parse an explicit 'ticks' attribute in the axis layout\n if (this.layout.axes[axis].ticks){\n var layout = this.layout.axes[axis];\n\n var baseTickConfig = layout.ticks;\n if (Array.isArray(baseTickConfig)){\n // Array of specific ticks hard-coded into a panel will override any ticks that an individual layer might specify\n return baseTickConfig;\n }\n\n if (typeof baseTickConfig === \"object\") {\n // If the layout specifies base configuration for ticks- but without specific positions- then ask each\n // data layer to report the tick marks that it thinks it needs\n // TODO: Few layers currently need to specify custom ticks (which is ok!). But if it becomes common, consider adding mechanisms to deduplicate ticks across layers\n var self = this;\n\n // Pass any layer-specific customizations for how ticks are calculated. (styles are overridden separately)\n var config = { position: baseTickConfig.position };\n\n var combinedTicks = this.data_layer_ids_by_z_index.reduce(function(acc, data_layer_id) {\n var nextLayer = self.data_layers[data_layer_id];\n return acc.concat(nextLayer.getTicks(axis, config));\n }, []);\n\n return combinedTicks.map(function(item) {\n // The layer makes suggestions, but tick configuration params specified on the panel take precedence\n var itemConfig = {};\n itemConfig = LocusZoom.Layouts.merge(itemConfig, baseTickConfig);\n return LocusZoom.Layouts.merge(itemConfig, item);\n });\n }\n }\n\n // If no other configuration is provided, attempt to generate ticks from the extent\n if (this[axis + \"_extent\"]) {\n return LocusZoom.prettyTicks(this[axis + \"_extent\"], \"both\");\n }\n return [];\n};\n\n/**\n * Update rendering of this panel whenever an event triggers a redraw. Assumes that the panel has already been\n * prepared the first time via `initialize`\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.render = function(){\n\n // Position the panel container\n this.svg.container.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n\n // Set size on the clip rect\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Set and position the inner border, style if necessary\n this.inner_border\n .attr(\"x\", this.layout.margin.left).attr(\"y\", this.layout.margin.top)\n .attr(\"width\", this.layout.width - (this.layout.margin.left + this.layout.margin.right))\n .attr(\"height\", this.layout.height - (this.layout.margin.top + this.layout.margin.bottom));\n if (this.layout.inner_border){\n this.inner_border.style({ \"stroke-width\": 1, \"stroke\": this.layout.inner_border });\n }\n\n // Set/update panel title if necessary\n this.setTitle();\n\n // Regenerate all extents\n this.generateExtents();\n\n // Helper function to constrain any procedurally generated vectors (e.g. ranges, extents)\n // Constraints applied here keep vectors from going to infinity or beyond a definable power of ten\n var constrain = function(value, limit_exponent){\n var neg_min = Math.pow(-10, limit_exponent);\n var neg_max = Math.pow(-10, -limit_exponent);\n var pos_min = Math.pow(10, -limit_exponent);\n var pos_max = Math.pow(10, limit_exponent);\n if (value === Infinity){ value = pos_max; }\n if (value === -Infinity){ value = neg_min; }\n if (value === 0){ value = pos_min; }\n if (value > 0){ value = Math.max(Math.min(value, pos_max), pos_min); }\n if (value < 0){ value = Math.max(Math.min(value, neg_max), neg_min); }\n return value;\n };\n\n // Define default and shifted ranges for all axes\n var ranges = {};\n if (this.x_extent){\n var base_x_range = { start: 0, end: this.layout.cliparea.width };\n if (this.layout.axes.x.range){\n base_x_range.start = this.layout.axes.x.range.start || base_x_range.start;\n base_x_range.end = this.layout.axes.x.range.end || base_x_range.end;\n }\n ranges.x = [base_x_range.start, base_x_range.end];\n ranges.x_shifted = [base_x_range.start, base_x_range.end];\n }\n if (this.y1_extent){\n var base_y1_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y1.range){\n base_y1_range.start = this.layout.axes.y1.range.start || base_y1_range.start;\n base_y1_range.end = this.layout.axes.y1.range.end || base_y1_range.end;\n }\n ranges.y1 = [base_y1_range.start, base_y1_range.end];\n ranges.y1_shifted = [base_y1_range.start, base_y1_range.end];\n }\n if (this.y2_extent){\n var base_y2_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y2.range){\n base_y2_range.start = this.layout.axes.y2.range.start || base_y2_range.start;\n base_y2_range.end = this.layout.axes.y2.range.end || base_y2_range.end;\n }\n ranges.y2 = [base_y2_range.start, base_y2_range.end];\n ranges.y2_shifted = [base_y2_range.start, base_y2_range.end];\n }\n\n // Shift ranges based on any drag or zoom interactions currently underway\n if (this.parent.interaction.panel_id && (this.parent.interaction.panel_id === this.id || this.parent.interaction.linked_panel_ids.indexOf(this.id) !== -1)){\n var anchor, scalar = null;\n if (this.parent.interaction.zooming && typeof this.x_scale == \"function\"){\n var current_extent_size = Math.abs(this.x_extent[1] - this.x_extent[0]);\n var current_scaled_extent_size = Math.round(this.x_scale.invert(ranges.x_shifted[1])) - Math.round(this.x_scale.invert(ranges.x_shifted[0]));\n var zoom_factor = this.parent.interaction.zooming.scale;\n var potential_extent_size = Math.floor(current_scaled_extent_size * (1 / zoom_factor));\n if (zoom_factor < 1 && !isNaN(this.parent.layout.max_region_scale)){\n zoom_factor = 1 /(Math.min(potential_extent_size, this.parent.layout.max_region_scale) / current_scaled_extent_size);\n } else if (zoom_factor > 1 && !isNaN(this.parent.layout.min_region_scale)){\n zoom_factor = 1 / (Math.max(potential_extent_size, this.parent.layout.min_region_scale) / current_scaled_extent_size);\n }\n var new_extent_size = Math.floor(current_extent_size * zoom_factor);\n anchor = this.parent.interaction.zooming.center - this.layout.margin.left - this.layout.origin.x;\n var offset_ratio = anchor / this.layout.cliparea.width;\n var new_x_extent_start = Math.max(Math.floor(this.x_scale.invert(ranges.x_shifted[0]) - ((new_extent_size - current_scaled_extent_size) * offset_ratio)), 1);\n ranges.x_shifted = [ this.x_scale(new_x_extent_start), this.x_scale(new_x_extent_start + new_extent_size) ];\n } else if (this.parent.interaction.dragging){\n switch (this.parent.interaction.dragging.method){\n case \"background\":\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n break;\n case \"x_tick\":\n if (d3.event && d3.event.shiftKey){\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n } else {\n anchor = this.parent.interaction.dragging.start_x - this.layout.margin.left - this.layout.origin.x;\n scalar = constrain(anchor / (anchor + this.parent.interaction.dragging.dragged_x), 3);\n ranges.x_shifted[0] = 0;\n ranges.x_shifted[1] = Math.max(this.layout.cliparea.width * (1 / scalar), 1);\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n var y_shifted = \"y\" + this.parent.interaction.dragging.method[1] + \"_shifted\";\n if (d3.event && d3.event.shiftKey){\n ranges[y_shifted][0] = this.layout.cliparea.height + this.parent.interaction.dragging.dragged_y;\n ranges[y_shifted][1] = +this.parent.interaction.dragging.dragged_y;\n } else {\n anchor = this.layout.cliparea.height - (this.parent.interaction.dragging.start_y - this.layout.margin.top - this.layout.origin.y);\n scalar = constrain(anchor / (anchor - this.parent.interaction.dragging.dragged_y), 3);\n ranges[y_shifted][0] = this.layout.cliparea.height;\n ranges[y_shifted][1] = this.layout.cliparea.height - (this.layout.cliparea.height * (1 / scalar));\n }\n }\n }\n }\n\n // Generate scales and ticks for all axes, then render them\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!this[axis + \"_extent\"]){ return; }\n\n // Base Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"])\n .range(ranges[axis + \"_shifted\"]);\n\n // Shift the extent\n this[axis + \"_extent\"] = [\n this[axis + \"_scale\"].invert(ranges[axis][0]),\n this[axis + \"_scale\"].invert(ranges[axis][1])\n ];\n\n // Finalize Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"]).range(ranges[axis]);\n\n // Render axis (and generate ticks as needed)\n this.renderAxis(axis);\n }.bind(this));\n\n // Establish mousewheel zoom event handers on the panel (namespacing not passed through by d3, so not used here)\n if (this.layout.interaction.scroll_to_zoom){\n var zoom_handler = function(){\n // Look for a shift key press while scrolling to execute.\n // If not present, gracefully raise a notification and allow conventional scrolling\n if (!d3.event.shiftKey){\n if (this.parent.canInteract(this.id)){\n this.loader.show(\"Press [SHIFT] while scrolling to zoom\").hide(1000);\n }\n return;\n }\n d3.event.preventDefault();\n if (!this.parent.canInteract(this.id)){ return; }\n var coords = d3.mouse(this.svg.container.node());\n var delta = Math.max(-1, Math.min(1, (d3.event.wheelDelta || -d3.event.detail || -d3.event.deltaY)));\n if (delta === 0){ return; }\n this.parent.interaction = {\n panel_id: this.id,\n linked_panel_ids: this.getLinkedPanelIds(\"x\"),\n zooming: {\n scale: (delta < 1) ? 0.9 : 1.1,\n center: coords[0]\n }\n };\n this.render();\n this.parent.interaction.linked_panel_ids.forEach(function(panel_id){\n this.parent.panels[panel_id].render();\n }.bind(this));\n if (this.zoom_timeout !== null){ clearTimeout(this.zoom_timeout); }\n this.zoom_timeout = setTimeout(function(){\n this.parent.interaction = {};\n this.parent.applyState({ start: this.x_extent[0], end: this.x_extent[1] });\n }.bind(this), 500);\n }.bind(this);\n this.zoom_listener = d3.behavior.zoom();\n this.svg.container.call(this.zoom_listener)\n .on(\"wheel.zoom\", zoom_handler)\n .on(\"mousewheel.zoom\", zoom_handler)\n .on(\"DOMMouseScroll.zoom\", zoom_handler);\n }\n\n // Render data layers in order by z-index\n this.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n this.data_layers[data_layer_id].draw().render();\n }.bind(this));\n\n return this;\n};\n\n\n/**\n * Render ticks for a particular axis\n * @param {('x'|'y1'|'y2')} axis The identifier of the axes\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.renderAxis = function(axis){\n\n if ([\"x\", \"y1\", \"y2\"].indexOf(axis) === -1){\n throw(\"Unable to render axis; invalid axis identifier: \" + axis);\n }\n\n var canRender = this.layout.axes[axis].render\n && typeof this[axis + \"_scale\"] == \"function\"\n && !isNaN(this[axis + \"_scale\"](0));\n\n // If the axis has already been rendered then check if we can/can't render it\n // Make sure the axis element is shown/hidden to suit\n if (this[axis+\"_axis\"]){\n this.svg.container.select(\"g.lz-axis.lz-\"+axis).style(\"display\", canRender ? null : \"none\");\n }\n\n if (!canRender){ return this; }\n\n // Axis-specific values to plug in where needed\n var axis_params = {\n x: {\n position: \"translate(\" + this.layout.margin.left + \",\" + (this.layout.height - this.layout.margin.bottom) + \")\",\n orientation: \"bottom\",\n label_x: this.layout.cliparea.width / 2,\n label_y: (this.layout.axes[axis].label_offset || 0),\n label_rotate: null\n },\n y1: {\n position: \"translate(\" + this.layout.margin.left + \",\" + this.layout.margin.top + \")\",\n orientation: \"left\",\n label_x: -1 * (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n },\n y2: {\n position: \"translate(\" + (this.layout.width - this.layout.margin.right) + \",\" + this.layout.margin.top + \")\",\n orientation: \"right\",\n label_x: (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n }\n };\n\n // Generate Ticks\n this[axis + \"_ticks\"] = this.generateTicks(axis);\n\n // Determine if the ticks are all numbers (d3-automated tick rendering) or not (manual tick rendering)\n var ticksAreAllNumbers = (function(ticks){\n for (var i = 0; i < ticks.length; i++){\n if (isNaN(ticks[i])){\n return false;\n }\n }\n return true;\n })(this[axis+\"_ticks\"]);\n\n // Initialize the axis; set scale and orientation\n this[axis+\"_axis\"] = d3.svg.axis().scale(this[axis+\"_scale\"]).orient(axis_params[axis].orientation).tickPadding(3);\n\n // Set tick values and format\n if (ticksAreAllNumbers){\n this[axis+\"_axis\"].tickValues(this[axis+\"_ticks\"]);\n if (this.layout.axes[axis].tick_format === \"region\"){\n this[axis+\"_axis\"].tickFormat(function(d) { return LocusZoom.positionIntToString(d, 6); });\n }\n } else {\n var ticks = this[axis+\"_ticks\"].map(function(t){\n return(t[axis.substr(0,1)]);\n });\n this[axis+\"_axis\"].tickValues(ticks)\n .tickFormat(function(t, i) { return this[axis+\"_ticks\"][i].text; }.bind(this));\n }\n\n // Position the axis in the SVG and apply the axis construct\n this.svg[axis+\"_axis\"]\n .attr(\"transform\", axis_params[axis].position)\n .call(this[axis+\"_axis\"]);\n\n // If necessary manually apply styles and transforms to ticks as specified by the layout\n if (!ticksAreAllNumbers){\n var tick_selector = d3.selectAll(\"g#\" + this.getBaseId().replace(\".\",\"\\\\.\") + \"\\\\.\" + axis + \"_axis g.tick\");\n var panel = this;\n tick_selector.each(function(d, i){\n var selector = d3.select(this).select(\"text\");\n if (panel[axis+\"_ticks\"][i].style){\n selector.style(panel[axis+\"_ticks\"][i].style);\n }\n if (panel[axis+\"_ticks\"][i].transform){\n selector.attr(\"transform\", panel[axis+\"_ticks\"][i].transform);\n }\n });\n }\n\n // Render the axis label if necessary\n var label = this.layout.axes[axis].label || null;\n if (label !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"x\", axis_params[axis].label_x).attr(\"y\", axis_params[axis].label_y)\n .text(LocusZoom.parseFields(this.state, label));\n if (axis_params[axis].label_rotate !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"transform\", \"rotate(\" + axis_params[axis].label_rotate + \" \" + axis_params[axis].label_x + \",\" + axis_params[axis].label_y + \")\");\n }\n }\n\n // Attach interactive handlers to ticks as needed\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (this.layout.interaction[\"drag_\" + axis + \"_ticks_to_scale\"]){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var tick_mouseover = function(){\n if (typeof d3.select(this).node().focus == \"function\"){ d3.select(this).node().focus(); }\n var cursor = (axis === \"x\") ? \"ew-resize\" : \"ns-resize\";\n if (d3.event && d3.event.shiftKey){ cursor = \"move\"; }\n d3.select(this)\n .style({\"font-weight\": \"bold\", \"cursor\": cursor})\n .on(\"keydown\" + namespace, tick_mouseover)\n .on(\"keyup\" + namespace, tick_mouseover);\n };\n this.svg.container.selectAll(\".lz-axis.lz-\" + axis + \" .tick text\")\n .attr(\"tabindex\", 0) // necessary to make the tick focusable so keypress events can be captured\n .on(\"mouseover\" + namespace, tick_mouseover)\n .on(\"mouseout\" + namespace, function(){\n d3.select(this).style({\"font-weight\": \"normal\"});\n d3.select(this).on(\"keydown\" + namespace, null).on(\"keyup\" + namespace, null);\n })\n .on(\"mousedown\" + namespace, function(){\n this.parent.startDrag(this, axis + \"_tick\");\n }.bind(this));\n }\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Force the height of this panel to the largest absolute height of the data in\n * all child data layers (if not null for any child data layers)\n * @param {number} [target_height] A target height, which will be used in situations when the expected height can be\n * pre-calculated (eg when the layers are transitioning)\n */\nLocusZoom.Panel.prototype.scaleHeightToData = function(target_height){\n target_height = +target_height || null;\n if (target_height === null){\n this.data_layer_ids_by_z_index.forEach(function(id){\n var dh = this.data_layers[id].getAbsoluteDataHeight();\n if (+dh){\n if (target_height === null){ target_height = +dh; }\n else { target_height = Math.max(target_height, +dh); }\n }\n }.bind(this));\n }\n if (+target_height){\n target_height += +this.layout.margin.top + +this.layout.margin.bottom;\n this.setDimensions(this.layout.width, target_height);\n this.parent.setDimensions();\n this.parent.panel_ids_by_y_index.forEach(function(id){\n this.parent.panels[id].layout.proportional_height = null;\n }.bind(this));\n this.parent.positionPanels();\n }\n};\n\n/**\n * Methods to set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n */\nLocusZoom.Panel.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setElementStatusByFilters(status, toggle, filters, exclusive);\n }.bind(this));\n};\n/**\n * Set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n */\nLocusZoom.Panel.prototype.setAllElementStatus = function(status, toggle){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(status, toggle);\n }.bind(this));\n};\n// TODO: Capture documentation for dynamically generated methods\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.Panel.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.Panel.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.Panel.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.Panel.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n\n/**\n * Add a \"basic\" loader to a panel\n * This method is just a shortcut for adding the most commonly used type of loading indicator, which appears when\n * data is requested, animates (e.g. shows an infinitely cycling progress bar as opposed to one that loads from\n * 0-100% based on actual load progress), and disappears when new data is loaded and rendered.\n *\n *\n * @param {Boolean} show_immediately\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.addBasicLoader = function(show_immediately){\n if (typeof show_immediately != \"undefined\"){ show_immediately = true; }\n if (show_immediately){\n this.loader.show(\"Loading...\").animate();\n }\n this.on(\"data_requested\", function(){\n this.loader.show(\"Loading...\").animate();\n }.bind(this));\n this.on(\"data_rendered\", function(){\n this.loader.hide();\n }.bind(this));\n return this;\n};\n"]} \ No newline at end of file +{"version":3,"sources":["locuszoom.app.min.js","LocusZoom.js","Layouts.js","DataLayer.js","annotation_track.js","forest.js","genes.js","genome_legend.js","intervals.js","line.js","scatter.js","Singletons.js","Dashboard.js","Legend.js","Data.js","Plot.js","Panel.js"],"names":["root","factory","define","amd","d3","Q","LocusZoom","module","exports","require","this","semanticVersionIsOk","minimum_version","current_version","minimum_version_array","split","current_version_array","version_is_ok","forEach","d","i","minimum_d3_version","version","populate","selector","datasource","layout","select","html","plot","call","node","id","iterator","empty","attr","Plot","container","dataset","region","parsed_state","parsePositionQuery","Object","keys","key","state","svg","append","style","setDimensions","positionPanels","initialize","length","refresh","populateAll","plots","selectAll","each","positionIntToString","pos","exp","suffix","exp_symbols","0","3","6","9","isNaN","log","Math","LN10","min","max","places_exp","floor","toFixed","min_exp","places","ret","pow","positionStringToInt","p","val","toUpperCase","replace","suffixre","exec","mult","Number","x","chrposoff","chrpos","match","center","offset","chr","start","end","position","prettyTicks","range","clip_range","target_tick_count","parseInt","min_n","shrink_sml","high_u_bias","u5_bias","abs","c","base","base_toFixed","round","unit","ticks","parseFloat","push","indexOf","slice","pop","createCORSPromise","method","url","body","headers","timeout","response","defer","xhr","XMLHttpRequest","open","XDomainRequest","onreadystatechange","readyState","status","resolve","reject","setTimeout","header","setRequestHeader","send","promise","validateState","new_state","validated_region","attempted_scale","attempted_midpoint","temp","min_region_scale","max_region_scale","parseFields","data","tokens","regex","m","index","text","condition","variable","close","console","error","JSON","stringify","astify","token","shift","then","ast","cache","hasOwnProperty","Data","Field","render_node","value","map","join","getToolTipData","parentNode","classed","getToolTipDataLayer","getDataLayer","getToolTipPanel","data_layer","parent","getToolTipPlot","panel","generateCurtain","curtain","showing","content_selector","hide_delay","show","content","css","parent_plot","insert","on","hide","bind","update","clearTimeout","page_origin","getPageOrigin","top","y","left","width","height","max-width","max-height","delay","remove","generateLoader","loader","progress_selector","cancel_selector","percent","padding","loader_boundrect","getBoundingClientRect","animate","setPercentCompleted","subclass","extra","Sub","constructor","apply","arguments","prototype","create","k","ext","Layouts","obj","layouts","dashboard","tooltip","get","type","name","modifications","merge","unnamespaced","parse","default_namespace","namespace","default","toString","applyNamespaces","element","resolved_namespace","re","r","merge_namespace","namespaced_element","namespaced_property","property","set","add","list","custom_layout","default_layout","custom_type","default_type","Array","isArray","assoc","closable","or","and","covariates_model_association","intervals","orientation","recomb","fields","z_index","stroke","stroke-width","x_axis","field","y_axis","axis","ceiling","ld","point_shape","scale_function","parameters","field_value","else","point_size","color","breaks","values","legend","shape","size","label","class","id_field","upper_buffer","min_extent","behaviors","onmouseover","action","onmouseout","onclick","exclusive","onshiftclick","phewas","tooltip_positioning","category_field","lower_buffer","categories","null_value","fill_opacity","spacing","lines","stroke-dasharray","filters","operator","font-size","font-weight","fill","gene","constraint","genome","start_field","end_field","track_split_field","split_tracks","always_hide_legend","{{namespace[intervals]}}state_id","components","group_position","margin-left","title","subtitle","covariates_model_plot_dashboard","button_html","button_title","region_nav_plot_dashboard","step","min_width","min_height","proportional_width","margin","right","bottom","inner_border","l","axes","label_offset","tick_format","extent","y1","y2","origin","hidden","interaction","drag_background_to_pan","drag_x_ticks_to_scale","drag_y1_ticks_to_scale","drag_y2_ticks_to_scale","scroll_to_zoom","x_linked","data_layers","text-anchor","transform","data_layer_id","pad_from_bottom","responsive_resize","panels","proportional_height","StandardLayout","mouse_guide","DataLayer","initialized","layout_idx","Panel","DefaultLayout","_base_layout","state_id","setDefaultState","tooltips","global_statuses","highlighted","selected","faded","addField","fieldName","transformations","fieldString","Statuses","adjectives","verbs","menu_antiverbs","getBaseId","getAbsoluteDataHeight","dataBCR","group","canTransition","transition","panel_boundaries","dragging","panel_id","getElementId","element_id","getElementStatusNodeId","getElementById","applyDataMethods","toHTML","deselect","unselectElement","applyCustomDataMethods","clipRect","moveUp","data_layer_ids_by_z_index","resortDataLayers","moveDown","resolveScalableParameter","idx","f","ScaleFunctions","getAxisExtent","dimension","axis_name","axis_layout","data_extent","original_extent_span","range_min","range_max","getTicks","config","createTooltip","positionTooltip","arrow","updateTooltip","destroyTooltip","destroyAllTooltips","event","pageX","pageY","positionAllTooltips","showOrHideTooltip","resolveStatus","statuses","directive","reduce","previousValue","currentValue","sub_status","sub_operator","show_directive","hide_directive","antistatus","show_resolved","hide_resolved","filter","return_type","test","operators","=","a","b","<","<=",">",">=","%","matches","filterIndexes","filterElements","verb","adjective","antiverb","setElementStatus","setElementStatusByFilters","setAllElementStatus","toggle","get_element_id_error","element_status_node_id","element_status_idx","splice","emit","active","status_ids","applyBehaviors","selection","event_match","executeBehaviors","requiredKeyStates","ctrl","ctrlKey","shiftKey","behavior","current_status_boolean","href","target","window","location","panel_origin","exportData","format","default_format","toLowerCase","e","jsonified","delimiter","record","draw","cliparea","reMap","lzd","getData","new_data","DataLayers","datalayers","datalayer","extend","parent_name","overrides","child","render","self","trackData","enter","exit","arrow_type","arrow_top","arrow_left","arrow_width","stroke_width","tooltip_box","data_layer_height","data_layer_width","x_center","x_scale","y_center","offset_right","offset_left","confidence_intervals","show_no_significance_line","border_radius","y_scale","sqrt","PI","ci_selection","ci_transform","ci_width","ci_height","duration","ease","points_selection","initial_y","symbol","element_data","label_font_size","label_exon_spacing","exon_height","bounding_box_padding","track_vertical_spacing","getTrackHeight","transcript_idx","tracks","gene_track_index","1","assignTracks","getLabelWidth","gene_name","font_size","temp_text","label_width","getBBox","g","gene_id","gene_version","transcript_id","transcripts","display_range","text_anchor","centered_margin","display_domain","invert","track","potential_track","collision_on_potential_track","placed_gene","min_start","max_end","t","exons","bboxes","boundary_fill","boundary_stroke","boundaries","labels","strand","exon_fill","exon_stroke","exon_id","clickareas","gene_bbox_id","gene_bbox","gene_center_x","chromosome_fill_colors","light","dark","chromosome_label_colors","genome_start","genome_end","chromosomes","variant_parts","variant","track_split_order","track_split_legend_to_y_axis","track_height","previous_tracks","interval_track_index","track_split_field_index","reverse","placed_interval","psuedoElement","sharedstatusnode_style","display","interval","statusnode_style","statusnodes","rects","interval_name","updateSplitTrackAxis","interval_bbox","interval_center_x","legend_axis","track_spacing","target_height","scaleHeightToData","toggleSplitTracks","interpolate","hitarea_width","mouse_event","line","tooltip_timeout","getMouseDisplayAndData","mouse","slope","x_field","y_field","bisect","bisector","datum","startDatum","endDatum","interpolateNumber","x_precision","toPrecision","y_precision","dd","min_arrow_left","max_arrow_left","path","hitarea","hitarea_line","path_class","global_status","decoupled","x_extent","y_extent","x_range","y_range","flip_labels","handle_lines","Boolean","min_x","max_x","flip","dn","dnl","dnx","text_swing","dnlx2","line_swing","label_texts","da","dax","abound","dal","label_lines","db","bbound","collision","separate_labels","seperate_iterations","alpha","again","delta","sign","adjust","new_a_y","new_b_y","min_y","max_y","label_elements","label_line","filtered_data","label_groups","x1","x2","makeLDReference","ref","applyState","ldrefvar","_prepareData","xField","sourceData","sort","ak","bk","av","bv","_generateCategoryBounds","uniqueCategories","item","category","bounds","categoryNames","_setDynamicColorScheme","colorParams","baseParams","parameters_categories_hash","every","colors","color_scale","scale","category10","category20","concat","categoryBounds","_categories","knownCategories","knownColors","xPos","diff","KnownDataSources","sources","findSourceByName","SOURCE_NAME","source","warn","source_name","newObj","params","Function","getAll","setAll","clear","TransformationFunctions","getTrans","fun","parseTrans","parseTransString","result","funs","substring","fn","ceil","toExponential","str","encodeURIComponent","s","functions","input","threshold","prev","curr","nullval","upper_idx","brk","normalized_input","isFinite","Dashboard","hide_timeout","persist","component","Components","shouldPersist","visibility","destroy","force","Component","parent_panel","parent_svg","button","menu","Button","parent_dashboard","tag","setTag","setHtml","setText","setHTML","setTitle","setColor","setStyle","getClass","permanent","setPermanent","bool","setStatus","highlight","disable","setOnMouseover","setOnMouseout","setOnclick","preUpdate","postUpdate","outer_selector","inner_selector","scroll_position","scrollTop","scrollbar_padding","menu_height_padding","page_scroll_top","document","documentElement","container_offset","getContainerOffset","dashboard_client_rect","button_client_rect","menu_client_rect","total_content_height","scrollHeight","base_max_width","container_max_width","content_max_width","base_max_height","max_height","setPopulate","menu_populate_function","div_selector","title_selector","display_width","display_height","generateBase64SVG","base64_string","css_string","stylesheet","styleSheets","fcall","outerHTML","dy","initial_html","style_def","insert_at","btoa","p1","String","fromCharCode","suppress_confirm","confirm","removePanel","is_at_top","y_index","is_at_bottom","panel_ids_by_y_index","can_zoom","current_region_scale","zoom_factor","new_region_scale","menu_html","model","covariates","CovariatesModel","element_reference","updateComponent","removeByIdx","removeAll","table","covariate","row","cov","scale_timeout","status_adj","status_idx","status_verb","at_top","at_bottom","td","removeDataLayer","allowed_fields","fields_whitelist","dataLayer","layer_name","dataLayerLayout","defaultConfig","configSlot","_selected_item","uniqueID","random","menuLayout","renderRow","display_name","display_options","row_id","field_name","defaultName","default_config_display_name","options","Legend","background_rect","elements","elements_group","label_size","line_height","label_x","label_y","path_y","symbolTypes","radius","bcr","right_x","pad_from_right","DataSources","addSource","ns","dsobj","source_id","getSource","removeSource","fromJSON","ds","toJSON","parts","full_name","applyTransformations","Requester","split_requests","requests","raw","trans","outnames","request_handles","when","discrete","Source","enableCache","dependentSource","parseInit","init","getCacheKey","chain","getURL","fetchRequest","getRequest","req","cacheKey","_cachedKey","_cachedResponse","preGetData","pre","resp","parseResponse","normalizeResponse","N","sameLength","records","j","prepareData","annotateData","extractFields","fieldFound","output_record","v","combineChainBody","json","standardized","one_source_body","new_body","parseArraysToObjects","standard","parseObjectsToObjects","parseData","constructorFun","uniqueName","getPrototypeOf","AssociationSource","unshift","analysis","LDSource","findMergeFields","exactMatch","arr","regexes","dataFields","position_field","pvalue","pvalue_field","_names_","names","nameMatch","findRequestedFields","isrefvarin","isrefvarout","ldin","ldout","findExtremeValue","pval","extremeVal","extremeIdx","refSource","ldrefsource","reqFields","refVar","columns","leftJoin","lfield","rfield","position2","tagRefVariant","refvar","idfield","outname","GeneSource","GeneConstraintSource","geneids","substr","Content-Type","constraint_fields","RecombinationRateSource","recombsource","IntervalSource","bedtracksource","StaticSource","_data","PheWASSource","build","ConnectorSource","_source_name_mapping","specified_ids","REQUIRED_SOURCES","chain_source_id","applyPanelYIndexesToPanelLayouts","pid","remap_promises","window_onresize","event_hooks","layout_changed","data_requested","data_rendered","element_clicked","element_selection","state_changed","hook","off","theseHooks","undefined","hookMatch","eventData","sourceID","hookToRun","eventContext","bounding_client_rect","x_offset","scrollLeft","y_offset","offsetParent","offsetTop","offsetLeft","canInteract","loading_data","zooming","initializeLayout","aspect_ratio","sumProportional","total","rescaleSVG","clientRect","panel_layout","addPanel","min-width","min-height","panel_width","panel_height","setOrigin","proportional_origin","clearPanelData","panelId","mode","panelsList","dlid","layer","x_linked_margins","total_proportional_height","proportional_adjustment","calculated_plot_height","mouse_guide_svg","mouse_guide_vertical_svg","mouse_guide_horizontal_svg","vertical","horizontal","selectors","corner_selector","panel_idx","panel_resize_drag","drag","this_panel","original_panel_height","panel_height_change","new_calculated_plot_height","loop_panel_id","loop_panel_idx","loop_panel","corner_drag","dx","plot_page_origin","panel_page_origin","corner_padding","corner_size","mouseout_mouse_guide","mousemove_mouse_guide","coords","mouseup","stopDrag","mousemove","preventDefault","dragged_x","start_x","dragged_y","start_y","linked_panel_ids","client_rect","subscribeToData","success_callback","opts","error_callback","onerror","err","listener","catch","state_changes","all","drop","startDrag","getLinkedPanelIds","overrideAxisLayout","axis_number","y_axis_number","generateID","applyDataLayerZIndexesToDataLayerLayouts","data_promises","y1_scale","y2_scale","y1_extent","y2_extent","x_ticks","y1_ticks","y2_ticks","zoom_timeout","bubble","plot_origin","background_click","y1_linked","y2_linked","panel_count","setMargin","y1_range","y2_range","label_function","data_layer_layout","addDataLayer","clipPath","clearSelections","x_axis_label","y1_axis","y1_axis_label","y2_axis","y2_axis_label","mousedown","ascending","generateExtents","generateTicks","baseTickConfig","combinedTicks","acc","nextLayer","itemConfig","constrain","limit_exponent","neg_min","neg_max","pos_min","pos_max","Infinity","ranges","base_x_range","x_shifted","base_y1_range","y1_shifted","base_y2_range","y2_shifted","anchor","scalar","current_extent_size","current_scaled_extent_size","potential_extent_size","new_extent_size","offset_ratio","new_x_extent_start","y_shifted","linear","domain","renderAxis","zoom_handler","wheelDelta","detail","deltaY","zoom_listener","zoom","canRender","axis_params","label_rotate","ticksAreAllNumbers","orient","tickPadding","tickValues","tickFormat","tick_selector","tick_mouseover","focus","cursor","dh","addBasicLoader","show_immediately","plugin_loading_error"],"mappings":"8qBAAC,SAAUA,EAAMC,GACS,kBAAXC,SAAyBA,OAAOC,IACvCD,QACI,KACA,KACD,SAAUE,EAAIC,GAEb,MAAOL,GAAKM,UAAYL,EAAQG,EAAIC,KAEf,gBAAXE,SAAuBA,OAAOC,QAE5CD,OAAOC,QAAUR,EAAKM,UAAYL,EAAQQ,QAAQ,MAAOA,QAAQ,MAGjET,EAAKM,UAAYL,EAAQD,EAAKI,GAAIJ,EAAKK,IAE7CK,KAAM,SAAUN,EAAIC,GAClB,GAAIM,GAAsB,SAAUC,EAAiBC,GAEjD,GAAIA,GAAmBD,EACnB,OAAO,CAGX,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,KAAA,cAAA6B,UAEAnN,KAAA2L,GAAA,iBAAA,WACA3L,KAAA4M,OAAAtB,KAAA,cAAA6B,WACAtB,KAAA7L,OACAA,KAAA2L,GAAA,gBAAA,WACA3L,KAAA4M,OAAAhB,QACAC,KAAA7L,OACAA,MAzCAJ,MAAAA,GAAA0J,QAAAC,MAAA,2BACAgjC,GAAA,MAAA3sC","file":"locuszoom.app.min.js","sourcesContent":[null,"/**\n * @namespace\n */\nvar LocusZoom = {\n version: \"0.8.0\"\n};\n\n/**\n * Populate a single element with a LocusZoom plot.\n * selector can be a string for a DOM Query or a d3 selector.\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot} The newly created plot instance\n */\nLocusZoom.populate = function(selector, datasource, layout) {\n if (typeof selector == \"undefined\"){\n throw (\"LocusZoom.populate selector not defined\");\n }\n // Empty the selector of any existing content\n d3.select(selector).html(\"\");\n var plot;\n d3.select(selector).call(function(){\n // Require each containing element have an ID. If one isn't present, create one.\n if (typeof this.node().id == \"undefined\"){\n var iterator = 0;\n while (!d3.select(\"#lz-\" + iterator).empty()){ iterator++; }\n this.attr(\"id\", \"#lz-\" + iterator);\n }\n // Create the plot\n plot = new LocusZoom.Plot(this.node().id, datasource, layout);\n plot.container = this.node();\n // Detect data-region and fill in state values if present\n if (typeof this.node().dataset !== \"undefined\" && typeof this.node().dataset.region !== \"undefined\"){\n var parsed_state = LocusZoom.parsePositionQuery(this.node().dataset.region);\n Object.keys(parsed_state).forEach(function(key){\n plot.state[key] = parsed_state[key];\n });\n }\n // Add an SVG to the div and set its dimensions\n plot.svg = d3.select(\"div#\" + plot.id)\n .append(\"svg\")\n .attr(\"version\", \"1.1\")\n .attr(\"xmlns\", \"http://www.w3.org/2000/svg\")\n .attr(\"id\", plot.id + \"_svg\").attr(\"class\", \"lz-locuszoom\")\n .style(plot.layout.style);\n plot.setDimensions();\n plot.positionPanels();\n // Initialize the plot\n plot.initialize();\n // If the plot has defined data sources then trigger its first mapping based on state values\n if (typeof datasource == \"object\" && Object.keys(datasource).length){\n plot.refresh();\n }\n });\n return plot;\n};\n\n/**\n * Populate arbitrarily many elements each with a LocusZoom plot\n * using a common datasource and layout\n * @param {String} selector CSS selector for the container element where the plot will be mounted. Any pre-existing\n * content in the container will be completely replaced.\n * @param {LocusZoom.DataSources} datasource Ensemble of data providers used by the plot\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @returns {LocusZoom.Plot[]}\n */\nLocusZoom.populateAll = function(selector, datasource, layout) {\n var plots = [];\n d3.selectAll(selector).each(function(d,i) {\n plots[i] = LocusZoom.populate(this, datasource, layout);\n });\n return plots;\n};\n\n/**\n * Convert an integer chromosome position to an SI string representation (e.g. 23423456 => \"23.42\" (Mb))\n * @param {Number} pos Position\n * @param {String} [exp] Exponent to use for the returned string, eg 6=> MB. If not specified, will attempt to guess\n * the most appropriate SI prefix based on the number provided.\n * @param {Boolean} [suffix=false] Whether or not to append a suffix (e.g. \"Mb\") to the end of the returned string\n * @returns {string}\n */\nLocusZoom.positionIntToString = function(pos, exp, suffix){\n var exp_symbols = { 0: \"\", 3: \"K\", 6: \"M\", 9: \"G\" };\n suffix = suffix || false;\n if (isNaN(exp) || exp === null){\n var log = Math.log(pos) / Math.LN10;\n exp = Math.min(Math.max(log - (log % 3), 0), 9);\n }\n var places_exp = exp - Math.floor((Math.log(pos) / Math.LN10).toFixed(exp + 3));\n var min_exp = Math.min(Math.max(exp, 0), 2);\n var places = Math.min(Math.max(places_exp, min_exp), 12);\n var ret = \"\" + (pos / Math.pow(10, exp)).toFixed(places);\n if (suffix && typeof exp_symbols[exp] !== \"undefined\"){\n ret += \" \" + exp_symbols[exp] + \"b\";\n }\n return ret;\n};\n\n/**\n * Convert an SI string chromosome position to an integer representation (e.g. \"5.8 Mb\" => 58000000)\n * @param {String} p The chromosome position\n * @returns {Number}\n */\nLocusZoom.positionStringToInt = function(p) {\n var val = p.toUpperCase();\n val = val.replace(/,/g, \"\");\n var suffixre = /([KMG])[B]*$/;\n var suffix = suffixre.exec(val);\n var mult = 1;\n if (suffix) {\n if (suffix[1]===\"M\") {\n mult = 1e6;\n } else if (suffix[1]===\"G\") {\n mult = 1e9;\n } else {\n mult = 1e3; //K\n }\n val = val.replace(suffixre,\"\");\n }\n val = Number(val) * mult;\n return val;\n};\n\n/**\n * Parse region queries into their constituent parts\n * TODO: handle genes (or send off to API)\n * @param {String} x A chromosome position query. May be any of the forms `chr:start-end`, `chr:center+offset`,\n * or `chr:pos`\n * @returns {{chr:*, start: *, end:*} | {chr:*, position:*}}\n */\nLocusZoom.parsePositionQuery = function(x) {\n var chrposoff = /^(\\w+):([\\d,.]+[kmgbKMGB]*)([-+])([\\d,.]+[kmgbKMGB]*)$/;\n var chrpos = /^(\\w+):([\\d,.]+[kmgbKMGB]*)$/;\n var match = chrposoff.exec(x);\n if (match) {\n if (match[3] === \"+\") {\n var center = LocusZoom.positionStringToInt(match[2]);\n var offset = LocusZoom.positionStringToInt(match[4]);\n return {\n chr:match[1],\n start: center - offset,\n end: center + offset\n };\n } else {\n return {\n chr: match[1],\n start: LocusZoom.positionStringToInt(match[2]),\n end: LocusZoom.positionStringToInt(match[4])\n };\n }\n }\n match = chrpos.exec(x);\n if (match) {\n return {\n chr:match[1],\n position: LocusZoom.positionStringToInt(match[2])\n };\n }\n return null;\n};\n\n/**\n * Generate a \"pretty\" set of ticks (multiples of 1, 2, or 5 on the same order of magnitude for the range)\n * Based on R's \"pretty\" function: https://github.com/wch/r-source/blob/b156e3a711967f58131e23c1b1dc1ea90e2f0c43/src/appl/pretty.c\n * @param {Number[]} range A two-item array specifying [low, high] values for the axis range\n * @param {('low'|'high'|'both'|'neither')} [clip_range='neither'] What to do if first and last generated ticks extend\n * beyond the range. Set this to \"low\", \"high\", \"both\", or \"neither\" to clip the first (low) or last (high) tick to\n * be inside the range or allow them to extend beyond.\n * e.g. \"low\" will clip the first (low) tick if it extends beyond the low end of the range but allow the\n * last (high) tick to extend beyond the range. \"both\" clips both ends, \"neither\" allows both to extend beyond.\n * @param {Number} [target_tick_count=5] The approximate number of ticks you would like to be returned; may not be exact\n * @returns {Number[]}\n */\nLocusZoom.prettyTicks = function(range, clip_range, target_tick_count){\n if (typeof target_tick_count == \"undefined\" || isNaN(parseInt(target_tick_count))){\n target_tick_count = 5;\n }\n target_tick_count = parseInt(target_tick_count);\n \n var min_n = target_tick_count / 3;\n var shrink_sml = 0.75;\n var high_u_bias = 1.5;\n var u5_bias = 0.5 + 1.5 * high_u_bias;\n \n var d = Math.abs(range[0] - range[1]);\n var c = d / target_tick_count;\n if ((Math.log(d) / Math.LN10) < -2){\n c = (Math.max(Math.abs(d)) * shrink_sml) / min_n;\n }\n \n var base = Math.pow(10, Math.floor(Math.log(c)/Math.LN10));\n var base_toFixed = 0;\n if (base < 1 && base !== 0){\n base_toFixed = Math.abs(Math.round(Math.log(base)/Math.LN10));\n }\n \n var unit = base;\n if ( ((2 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 2 * base;\n if ( ((5 * base) - c) < (u5_bias * (c - unit)) ){\n unit = 5 * base;\n if ( ((10 * base) - c) < (high_u_bias * (c - unit)) ){\n unit = 10 * base;\n }\n }\n }\n \n var ticks = [];\n var i = parseFloat( (Math.floor(range[0]/unit)*unit).toFixed(base_toFixed) );\n while (i < range[1]){\n ticks.push(i);\n i += unit;\n if (base_toFixed > 0){\n i = parseFloat(i.toFixed(base_toFixed));\n }\n }\n ticks.push(i);\n \n if (typeof clip_range == \"undefined\" || [\"low\", \"high\", \"both\", \"neither\"].indexOf(clip_range) === -1){\n clip_range = \"neither\";\n }\n if (clip_range === \"low\" || clip_range === \"both\"){\n if (ticks[0] < range[0]){ ticks = ticks.slice(1); }\n }\n if (clip_range === \"high\" || clip_range === \"both\"){\n if (ticks[ticks.length-1] > range[1]){ ticks.pop(); }\n }\n \n return ticks;\n};\n\n/**\n * Make an AJAX request and return a promise.\n * From http://www.html5rocks.com/en/tutorials/cors/\n * and with promises from https://gist.github.com/kriskowal/593076\n *\n * @param {String} method The HTTP verb\n * @param {String} url\n * @param {String} body The request body to send to the server\n * @param {Object} headers Object of custom request headers\n * @param {Number} [timeout] If provided, wait this long (in ms) before timing out\n * @returns {Promise}\n */\nLocusZoom.createCORSPromise = function (method, url, body, headers, timeout) {\n var response = Q.defer();\n var xhr = new XMLHttpRequest();\n if (\"withCredentials\" in xhr) {\n // Check if the XMLHttpRequest object has a \"withCredentials\" property.\n // \"withCredentials\" only exists on XMLHTTPRequest2 objects.\n xhr.open(method, url, true);\n } else if (typeof XDomainRequest != \"undefined\") {\n // Otherwise, check if XDomainRequest.\n // XDomainRequest only exists in IE, and is IE's way of making CORS requests.\n xhr = new XDomainRequest();\n xhr.open(method, url);\n } else {\n // Otherwise, CORS is not supported by the browser.\n xhr = null;\n }\n if (xhr) {\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200 || xhr.status === 0 ) {\n response.resolve(xhr.response);\n } else {\n response.reject(\"HTTP \" + xhr.status + \" for \" + url);\n }\n }\n };\n timeout && setTimeout(response.reject, timeout);\n body = typeof body !== \"undefined\" ? body : \"\";\n if (typeof headers !== \"undefined\"){\n for (var header in headers){\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n // Send the request\n xhr.send(body);\n } \n return response.promise;\n};\n\n/**\n * Validate a (presumed complete) plot state object against internal rules for consistency, and ensure the plot fits\n * within any constraints imposed by the layout.\n * @param {Object} new_state\n * @param {Number} new_state.start\n * @param {Number} new_state.end\n * @param {Object} layout\n * @returns {*|{}}\n */\nLocusZoom.validateState = function(new_state, layout){\n\n new_state = new_state || {};\n layout = layout || {};\n\n // If a \"chr\", \"start\", and \"end\" are present then resolve start and end\n // to numeric values that are not decimal, negative, or flipped\n var validated_region = false;\n if (typeof new_state.chr != \"undefined\" && typeof new_state.start != \"undefined\" && typeof new_state.end != \"undefined\"){\n // Determine a numeric scale and midpoint for the attempted region,\n var attempted_midpoint = null; var attempted_scale;\n new_state.start = Math.max(parseInt(new_state.start), 1);\n new_state.end = Math.max(parseInt(new_state.end), 1);\n if (isNaN(new_state.start) && isNaN(new_state.end)){\n new_state.start = 1;\n new_state.end = 1;\n attempted_midpoint = 0.5;\n attempted_scale = 0;\n } else if (isNaN(new_state.start) || isNaN(new_state.end)){\n attempted_midpoint = new_state.start || new_state.end;\n attempted_scale = 0;\n new_state.start = (isNaN(new_state.start) ? new_state.end : new_state.start);\n new_state.end = (isNaN(new_state.end) ? new_state.start : new_state.end);\n } else {\n attempted_midpoint = Math.round((new_state.start + new_state.end) / 2);\n attempted_scale = new_state.end - new_state.start;\n if (attempted_scale < 0){\n var temp = new_state.start;\n new_state.end = new_state.start;\n new_state.start = temp;\n attempted_scale = new_state.end - new_state.start;\n }\n if (attempted_midpoint < 0){\n new_state.start = 1;\n new_state.end = 1;\n attempted_scale = 0;\n }\n }\n validated_region = true;\n }\n\n // Constrain w/r/t layout-defined minimum region scale\n if (!isNaN(layout.min_region_scale) && validated_region && attempted_scale < layout.min_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.min_region_scale / 2), 1);\n new_state.end = new_state.start + layout.min_region_scale;\n }\n\n // Constrain w/r/t layout-defined maximum region scale\n if (!isNaN(layout.max_region_scale) && validated_region && attempted_scale > layout.max_region_scale){\n new_state.start = Math.max(attempted_midpoint - Math.floor(layout.max_region_scale / 2), 1);\n new_state.end = new_state.start + layout.max_region_scale;\n }\n\n return new_state;\n};\n\n//\n/**\n * Replace placeholders in an html string with field values defined in a data object\n * Only works on scalar values! Will ignore non-scalars.\n *\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @param {Object} data\n * @param {String} html A placeholder string in which to substitute fields. Supports several template options:\n * `{{field_name}}` is a variable placeholder for the value of `field_name` from the provided data\n * `{{#if {{field_name}} }} Conditional text {{/if}} will insert the contents of the tag only if the value exists.\n * Since this is only an existence check, **variables with a value of 0 will be evaluated as true**.\n * @returns {string}\n */\nLocusZoom.parseFields = function (data, html) {\n if (typeof data != \"object\"){\n throw (\"LocusZoom.parseFields invalid arguments: data is not an object\");\n }\n if (typeof html != \"string\"){\n throw (\"LocusZoom.parseFields invalid arguments: html is not a string\");\n }\n // `tokens` is like [token,...]\n // `token` is like {text: '...'} or {variable: 'foo|bar'} or {condition: 'foo|bar'} or {close: 'if'}\n var tokens = [];\n var regex = /\\{\\{(?:(#if )?([A-Za-z0-9_:|]+)|(\\/if))\\}\\}/;\n while (html.length > 0){\n var m = regex.exec(html);\n if (!m) { tokens.push({text: html}); html = \"\"; }\n else if (m.index !== 0) { tokens.push({text: html.slice(0, m.index)}); html = html.slice(m.index); }\n else if (m[1] === \"#if \") { tokens.push({condition: m[2]}); html = html.slice(m[0].length); }\n else if (m[2]) { tokens.push({variable: m[2]}); html = html.slice(m[0].length); }\n else if (m[3] === \"/if\") { tokens.push({close: \"if\"}); html = html.slice(m[0].length); }\n else {\n console.error(\"Error tokenizing tooltip when remaining template is \" + JSON.stringify(html) +\n \" and previous tokens are \" + JSON.stringify(tokens) +\n \" and current regex match is \" + JSON.stringify([m[1], m[2], m[3]]));\n html=html.slice(m[0].length);\n }\n }\n var astify = function() {\n var token = tokens.shift();\n if (typeof token.text !== \"undefined\" || token.variable) {\n return token;\n } else if (token.condition) {\n token.then = [];\n while(tokens.length > 0) {\n if (tokens[0].close === \"if\") { tokens.shift(); break; }\n token.then.push(astify());\n }\n return token;\n } else {\n console.error(\"Error making tooltip AST due to unknown token \" + JSON.stringify(token));\n return { text: \"\" };\n }\n };\n // `ast` is like [thing,...]\n // `thing` is like {text: \"...\"} or {variable:\"foo|bar\"} or {condition: \"foo|bar\", then:[thing,...]}\n var ast = [];\n while (tokens.length > 0) ast.push(astify());\n\n var resolve = function(variable) {\n if (!resolve.cache.hasOwnProperty(variable)) {\n resolve.cache[variable] = (new LocusZoom.Data.Field(variable)).resolve(data);\n }\n return resolve.cache[variable];\n };\n resolve.cache = {};\n var render_node = function(node) {\n if (typeof node.text !== \"undefined\") {\n return node.text;\n } else if (node.variable) {\n try {\n var value = resolve(node.variable);\n if ([\"string\",\"number\",\"boolean\"].indexOf(typeof value) !== -1) { return value; }\n if (value === null) { return \"\"; }\n } catch (error) { console.error(\"Error while processing variable \" + JSON.stringify(node.variable)); }\n return \"{{\" + node.variable + \"}}\";\n } else if (node.condition) {\n try {\n var condition = resolve(node.condition);\n if (condition || condition === 0) {\n return node.then.map(render_node).join(\"\");\n }\n } catch (error) { console.error(\"Error while processing condition \" + JSON.stringify(node.variable)); }\n return \"\";\n } else { console.error(\"Error rendering tooltip due to unknown AST node \" + JSON.stringify(node)); }\n };\n return ast.map(render_node).join(\"\");\n};\n\n/**\n * Shortcut method for getting the data bound to a tool tip.\n * @param {Element} node\n * @returns {*} The first element of data bound to the tooltip\n */\nLocusZoom.getToolTipData = function(node){\n if (typeof node != \"object\" || typeof node.parentNode == \"undefined\"){\n throw(\"Invalid node object\");\n }\n // If this node is a locuszoom tool tip then return its data\n var selector = d3.select(node);\n if (selector.classed(\"lz-data_layer-tooltip\") && typeof selector.data()[0] != \"undefined\"){\n return selector.data()[0];\n } else {\n return LocusZoom.getToolTipData(node.parentNode);\n }\n};\n\n/**\n * Shortcut method for getting a reference to the data layer that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.getToolTipDataLayer = function(node){\n var data = LocusZoom.getToolTipData(node);\n if (data.getDataLayer){ return data.getDataLayer(); }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the panel that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.getToolTipPanel = function(node){\n var data_layer = LocusZoom.getToolTipDataLayer(node);\n if (data_layer){ return data_layer.parent; }\n return null;\n};\n\n/**\n * Shortcut method for getting a reference to the plot that generated a tool tip.\n * @param {Element} node The element associated with the tooltip, or any element contained inside the tooltip\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.getToolTipPlot = function(node){\n var panel = LocusZoom.getToolTipPanel(node);\n if (panel){ return panel.parent; }\n return null;\n};\n\n/**\n * Generate a curtain object for a plot, panel, or any other subdivision of a layout\n * The panel curtain, like the plot curtain is an HTML overlay that obscures the entire panel. It can be styled\n * arbitrarily and display arbitrary messages. It is useful for reporting error messages visually to an end user\n * when the error renders the panel unusable.\n * TODO: Improve type doc here\n * @returns {object}\n */\nLocusZoom.generateCurtain = function(){\n var curtain = {\n showing: false,\n selector: null,\n content_selector: null,\n hide_delay: null,\n\n /**\n * Generate the curtain. Any content (string) argument passed will be displayed in the curtain as raw HTML.\n * CSS (object) can be passed which will apply styles to the curtain and its content.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n show: function(content, css){\n if (!this.curtain.showing){\n this.curtain.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-curtain\").attr(\"id\", this.id + \".curtain\");\n this.curtain.content_selector = this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-content\");\n this.curtain.selector.append(\"div\").attr(\"class\", \"lz-curtain-dismiss\").html(\"Dismiss\")\n .on(\"click\", function(){\n this.curtain.hide();\n }.bind(this));\n this.curtain.showing = true;\n }\n return this.curtain.update(content, css);\n }.bind(this),\n\n /**\n * Update the content and css of the curtain that's currently being shown. This method also adjusts the size\n * and positioning of the curtain to ensure it still covers the entire panel with no overlap.\n * @param {string} content Content to be displayed on the curtain (as raw HTML)\n * @param {object} css Apply the specified styles to the curtain and its contents\n */\n update: function(content, css){\n if (!this.curtain.showing){ return this.curtain; }\n clearTimeout(this.curtain.hide_delay);\n // Apply CSS if provided\n if (typeof css == \"object\"){\n this.curtain.selector.style(css);\n }\n // Update size and position\n var page_origin = this.getPageOrigin();\n this.curtain.selector.style({\n top: page_origin.y + \"px\",\n left: page_origin.x + \"px\",\n width: this.layout.width + \"px\",\n height: this.layout.height + \"px\"\n });\n this.curtain.content_selector.style({\n \"max-width\": (this.layout.width - 40) + \"px\",\n \"max-height\": (this.layout.height - 40) + \"px\"\n });\n // Apply content if provided\n if (typeof content == \"string\"){\n this.curtain.content_selector.html(content);\n }\n return this.curtain;\n }.bind(this),\n\n /**\n * Remove the curtain\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.curtain.showing){ return this.curtain; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.curtain.hide_delay);\n this.curtain.hide_delay = setTimeout(this.curtain.hide, delay);\n return this.curtain;\n }\n // Remove curtain\n this.curtain.selector.remove();\n this.curtain.selector = null;\n this.curtain.content_selector = null;\n this.curtain.showing = false;\n return this.curtain;\n }.bind(this)\n };\n return curtain;\n};\n\n/**\n * Generate a loader object for a plot, panel, or any other subdivision of a layout\n *\n * The panel loader is a small HTML overlay that appears in the lower left corner of the panel. It cannot be styled\n * arbitrarily, but can show a custom message and show a minimalist loading bar that can be updated to specific\n * completion percentages or be animated.\n * TODO Improve type documentation\n * @returns {object}\n */\nLocusZoom.generateLoader = function(){\n var loader = {\n showing: false,\n selector: null,\n content_selector: null,\n progress_selector: null,\n cancel_selector: null,\n\n /**\n * Show a loading indicator\n * @param {string} [content='Loading...'] Loading message (displayed as raw HTML)\n */\n show: function(content){\n // Generate loader\n if (!this.loader.showing){\n this.loader.selector = d3.select(this.parent_plot.svg.node().parentNode).insert(\"div\")\n .attr(\"class\", \"lz-loader\").attr(\"id\", this.id + \".loader\");\n this.loader.content_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-content\");\n this.loader.progress_selector = this.loader.selector\n .append(\"div\").attr(\"class\", \"lz-loader-progress-container\")\n .append(\"div\").attr(\"class\", \"lz-loader-progress\");\n /* TODO: figure out how to make this cancel button work\n this.loader.cancel_selector = this.loader.selector.append(\"div\")\n .attr(\"class\", \"lz-loader-cancel\").html(\"Cancel\")\n .on(\"click\", function(){\n this.loader.hide();\n }.bind(this));\n */\n this.loader.showing = true;\n if (typeof content == \"undefined\"){ content = \"Loading...\"; }\n }\n return this.loader.update(content);\n }.bind(this),\n\n /**\n * Update the currently displayed loader and ensure the new content is positioned correctly.\n * @param {string} content The text to display (as raw HTML). If not a string, will be ignored.\n * @param {number} [percent] A number from 1-100. If a value is specified, it will stop all animations\n * in progress.\n */\n update: function(content, percent){\n if (!this.loader.showing){ return this.loader; }\n clearTimeout(this.loader.hide_delay);\n // Apply content if provided\n if (typeof content == \"string\"){\n this.loader.content_selector.html(content);\n }\n // Update size and position\n var padding = 6; // is there a better place to store/define this?\n var page_origin = this.getPageOrigin();\n var loader_boundrect = this.loader.selector.node().getBoundingClientRect();\n this.loader.selector.style({\n top: (page_origin.y + this.layout.height - loader_boundrect.height - padding) + \"px\",\n left: (page_origin.x + padding) + \"px\"\n });\n /* Uncomment this code when a functional cancel button can be shown\n var cancel_boundrect = this.loader.cancel_selector.node().getBoundingClientRect();\n this.loader.content_selector.style({\n \"padding-right\": (cancel_boundrect.width + padding) + \"px\"\n });\n */\n // Apply percent if provided\n if (typeof percent == \"number\"){\n this.loader.progress_selector.style({\n width: (Math.min(Math.max(percent, 1), 100)) + \"%\"\n });\n }\n return this.loader;\n }.bind(this),\n\n /**\n * Adds a class to the loading bar that makes it loop infinitely in a loading animation. Useful when exact\n * percent progress is not available.\n */\n animate: function(){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", true);\n return this.loader;\n }.bind(this),\n\n /**\n * Sets the loading bar in the loader to percentage width equal to the percent (number) value passed. Percents\n * will automatically be limited to a range of 1 to 100. Will stop all animations in progress.\n */\n setPercentCompleted: function(percent){\n this.loader.progress_selector.classed(\"lz-loader-progress-animated\", false);\n return this.loader.update(null, percent);\n }.bind(this),\n\n /**\n * Remove the loader\n * @param {number} delay Time to wait (in ms)\n */\n hide: function(delay){\n if (!this.loader.showing){ return this.loader; }\n // If a delay was passed then defer to a timeout\n if (typeof delay == \"number\"){\n clearTimeout(this.loader.hide_delay);\n this.loader.hide_delay = setTimeout(this.loader.hide, delay);\n return this.loader;\n }\n // Remove loader\n this.loader.selector.remove();\n this.loader.selector = null;\n this.loader.content_selector = null;\n this.loader.progress_selector = null;\n this.loader.cancel_selector = null;\n this.loader.showing = false;\n return this.loader;\n }.bind(this)\n };\n return loader;\n};\n\n/**\n * Create a new subclass following classical inheritance patterns. Some registry singletons use this internally to\n * enable code reuse and customization of known LZ core functionality.\n *\n * @param {Function} parent A parent class constructor that will be extended by the child class\n * @param {Object} extra An object of additional properties and methods to add/override behavior for the child class.\n * The special \"constructor\" property can be used to specify a custom constructor, or it will call parent by default.\n * Implementer must manage super calls when overriding the constructor.\n * @returns {Function} The constructor for the new child class\n */\nLocusZoom.subclass = function(parent, extra) {\n if (typeof parent !== \"function\" ) {\n throw \"Parent must be a callable constructor\";\n }\n\n extra = extra || {};\n var Sub = extra.hasOwnProperty(\"constructor\") ? extra.constructor : function() {\n parent.apply(this, arguments);\n };\n\n Sub.prototype = Object.create(parent.prototype);\n Object.keys(extra).forEach(function(k) {\n Sub.prototype[k] = extra[k];\n });\n return Sub;\n};\n\n\n/**\n * LocusZoom optional extensions will live under this namespace.\n *\n * Extension code is not part of the core LocusZoom app.js bundle.\n * @namespace\n * @public\n */\nLocusZoom.ext = {};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * Manage known layouts for all parts of the LocusZoom plot\n *\n * This registry allows for layouts to be reused and customized many times on a page, using a common base pattern.\n * It handles the work of ensuring that each new instance of the layout has no shared state with other copies.\n *\n * @class\n */\nLocusZoom.Layouts = (function() {\n var obj = {};\n var layouts = {\n \"plot\": {},\n \"panel\": {},\n \"data_layer\": {},\n \"dashboard\": {},\n \"tooltip\": {}\n };\n\n /**\n * Generate a layout configuration object\n * @param {('plot'|'panel'|'data_layer'|'dashboard'|'tooltip')} type The type of layout to retrieve\n * @param {string} name Identifier of the predefined layout within the specified type\n * @param {object} [modifications] Custom properties that override default settings for this layout\n * @returns {object} A JSON-serializable object representation\n */\n obj.get = function(type, name, modifications) {\n if (typeof type != \"string\" || typeof name != \"string\") {\n throw(\"invalid arguments passed to LocusZoom.Layouts.get, requires string (layout type) and string (layout name)\");\n } else if (layouts[type][name]) {\n // Get the base layout\n var layout = LocusZoom.Layouts.merge(modifications || {}, layouts[type][name]);\n // If \"unnamespaced\" is true then strike that from the layout and return the layout without namespacing\n if (layout.unnamespaced){\n delete layout.unnamespaced;\n return JSON.parse(JSON.stringify(layout));\n }\n // Determine the default namespace for namespaced values\n var default_namespace = \"\";\n if (typeof layout.namespace == \"string\"){\n default_namespace = layout.namespace;\n } else if (typeof layout.namespace == \"object\" && Object.keys(layout.namespace).length){\n if (typeof layout.namespace.default != \"undefined\"){\n default_namespace = layout.namespace.default;\n } else {\n default_namespace = layout.namespace[Object.keys(layout.namespace)[0]].toString();\n }\n }\n default_namespace += default_namespace.length ? \":\" : \"\";\n // Apply namespaces to layout, recursively\n var applyNamespaces = function(element, namespace){\n if (namespace){\n if (typeof namespace == \"string\"){\n namespace = { default: namespace }; \n }\n } else {\n namespace = { default: \"\" };\n }\n if (typeof element == \"string\"){\n var re = /\\{\\{namespace(\\[[A-Za-z_0-9]+\\]|)\\}\\}/g;\n var match, base, key, resolved_namespace;\n var replace = [];\n while ((match = re.exec(element)) !== null){\n base = match[0];\n key = match[1].length ? match[1].replace(/(\\[|\\])/g,\"\") : null;\n resolved_namespace = default_namespace;\n if (namespace != null && typeof namespace == \"object\" && typeof namespace[key] != \"undefined\"){\n resolved_namespace = namespace[key] + (namespace[key].length ? \":\" : \"\");\n }\n replace.push({ base: base, namespace: resolved_namespace });\n }\n for (var r in replace){\n element = element.replace(replace[r].base, replace[r].namespace);\n }\n } else if (typeof element == \"object\" && element != null){\n if (typeof element.namespace != \"undefined\"){\n var merge_namespace = (typeof element.namespace == \"string\") ? { default: element.namespace } : element.namespace;\n namespace = LocusZoom.Layouts.merge(namespace, merge_namespace);\n }\n var namespaced_element, namespaced_property;\n for (var property in element) {\n if (property === \"namespace\"){ continue; }\n namespaced_element = applyNamespaces(element[property], namespace);\n namespaced_property = applyNamespaces(property, namespace);\n if (property !== namespaced_property){\n delete element[property];\n }\n element[namespaced_property] = namespaced_element;\n }\n }\n return element;\n };\n layout = applyNamespaces(layout, layout.namespace);\n // Return the layout as valid JSON only\n return JSON.parse(JSON.stringify(layout));\n } else {\n throw(\"layout type [\" + type + \"] name [\" + name + \"] not found\");\n }\n };\n\n /** @private */\n obj.set = function(type, name, layout) {\n if (typeof type != \"string\" || typeof name != \"string\" || typeof layout != \"object\"){\n throw (\"unable to set new layout; bad arguments passed to set()\");\n }\n if (!layouts[type]){\n layouts[type] = {};\n }\n if (layout){\n return (layouts[type][name] = JSON.parse(JSON.stringify(layout)));\n } else {\n delete layouts[type][name];\n return null;\n }\n };\n\n /**\n * Register a new layout definition by name.\n *\n * @param {string} type The type of layout to add. Usually, this will be one of the predefined LocusZoom types,\n * but if you pass a different name, this method will automatically create the new `type` bucket\n * @param {string} name The identifier of the newly added layout\n * @param {object} [layout] A JSON-serializable object containing configuration properties for this layout\n * @returns The JSON representation of the newly created layout\n */\n obj.add = function(type, name, layout) {\n return obj.set(type, name, layout);\n };\n\n /**\n * List all registered layouts\n * @param [type] Optionally narrow the list to only layouts of a specific type; else return all known layouts\n * @returns {*}\n */\n obj.list = function(type) {\n if (!layouts[type]){\n var list = {};\n Object.keys(layouts).forEach(function(type){\n list[type] = Object.keys(layouts[type]);\n });\n return list;\n } else {\n return Object.keys(layouts[type]);\n }\n };\n\n /**\n * A helper method used for merging two objects. If a key is present in both, takes the value from the first object\n * Values from `default_layout` will be cleanly copied over, ensuring no references or shared state.\n *\n * Frequently used for preparing custom layouts. Both objects should be JSON-serializable.\n *\n * @param {object} custom_layout An object containing configuration parameters that override or add to defaults\n * @param {object} default_layout An object containing default settings.\n * @returns The custom layout is modified in place and also returned from this method.\n */\n obj.merge = function (custom_layout, default_layout) {\n if (typeof custom_layout !== \"object\" || typeof default_layout !== \"object\"){\n throw(\"LocusZoom.Layouts.merge only accepts two layout objects; \" + (typeof custom_layout) + \", \" + (typeof default_layout) + \" given\");\n }\n for (var property in default_layout) {\n if (!default_layout.hasOwnProperty(property)){ continue; }\n // Get types for comparison. Treat nulls in the custom layout as undefined for simplicity.\n // (javascript treats nulls as \"object\" when we just want to overwrite them as if they're undefined)\n // Also separate arrays from objects as a discrete type.\n var custom_type = custom_layout[property] === null ? \"undefined\" : typeof custom_layout[property];\n var default_type = typeof default_layout[property];\n if (custom_type === \"object\" && Array.isArray(custom_layout[property])){ custom_type = \"array\"; }\n if (default_type === \"object\" && Array.isArray(default_layout[property])){ default_type = \"array\"; }\n // Unsupported property types: throw an exception\n if (custom_type === \"function\" || default_type === \"function\"){\n throw(\"LocusZoom.Layouts.merge encountered an unsupported property type\");\n }\n // Undefined custom value: pull the default value\n if (custom_type === \"undefined\"){\n custom_layout[property] = JSON.parse(JSON.stringify(default_layout[property]));\n continue;\n }\n // Both values are objects: merge recursively\n if (custom_type === \"object\" && default_type === \"object\"){\n custom_layout[property] = LocusZoom.Layouts.merge(custom_layout[property], default_layout[property]);\n continue;\n }\n }\n return custom_layout;\n };\n\n return obj;\n})();\n\n\n/**\n * Tooltip Layouts\n * @namespace LocusZoom.Layouts.tooltips\n */\n\n// TODO: Improve documentation of predefined types within layout namespaces\nLocusZoom.Layouts.add(\"tooltip\", \"standard_association\", {\n namespace: { \"assoc\": \"assoc\" },\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[assoc]}}variant}}
      \"\n + \"P Value: {{{{namespace[assoc]}}log_pvalue|logtoscinotation}}
      \"\n + \"Ref. Allele: {{{{namespace[assoc]}}ref_allele}}
      \"\n + \"Make LD Reference
      \"\n});\n\nvar covariates_model_association = LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true });\ncovariates_model_association.html += \"Condition on Variant
      \";\nLocusZoom.Layouts.add(\"tooltip\", \"covariates_model_association\", covariates_model_association);\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_genes\", {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"

      {{gene_name}}

      \"\n + \"
      Gene ID: {{gene_id}}
      \"\n + \"
      Transcript ID: {{transcript_id}}
      \"\n + \"
      \"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"
      ConstraintExpected variantsObserved variantsConst. Metric
      Synonymous{{exp_syn}}{{n_syn}}z = {{syn_z}}
      Missense{{exp_mis}}{{n_mis}}z = {{mis_z}}
      LoF{{exp_lof}}{{n_lof}}pLI = {{pLI}}
      \"\n + \"More data on ExAC\"\n});\n\nLocusZoom.Layouts.add(\"tooltip\", \"standard_intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n closable: false,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: \"{{{{namespace[intervals]}}state_name}}
      {{{{namespace[intervals]}}start}}-{{{{namespace[intervals]}}end}}\"\n});\n\n/**\n * Data Layer Layouts: represent specific information from a data source\n * @namespace Layouts.data_layer\n*/\n\nLocusZoom.Layouts.add(\"data_layer\", \"significance\", {\n id: \"significance\",\n type: \"orthogonal_line\",\n orientation: \"horizontal\",\n offset: 4.522\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"recomb_rate\", {\n namespace: { \"recomb\": \"recomb\" },\n id: \"recombrate\",\n type: \"line\",\n fields: [\"{{namespace[recomb]}}position\", \"{{namespace[recomb]}}recomb_rate\"],\n z_index: 1,\n style: {\n \"stroke\": \"#0000FF\",\n \"stroke-width\": \"1.5px\"\n },\n x_axis: {\n field: \"{{namespace[recomb]}}position\"\n },\n y_axis: {\n axis: 2,\n field: \"{{namespace[recomb]}}recomb_rate\",\n floor: 0,\n ceiling: 100\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"association_pvalues\", {\n namespace: { \"assoc\": \"assoc\", \"ld\": \"ld\" },\n id: \"associationpvalues\",\n type: \"scatter\",\n point_shape: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"diamond\",\n else: \"circle\"\n }\n },\n point_size: {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: 80,\n else: 40\n }\n },\n color: [\n {\n scale_function: \"if\",\n field: \"{{namespace[ld]}}isrefvar\",\n parameters: {\n field_value: 1,\n then: \"#9632b8\"\n }\n },\n {\n scale_function: \"numerical_bin\",\n field: \"{{namespace[ld]}}state\",\n parameters: {\n breaks: [0, 0.2, 0.4, 0.6, 0.8],\n values: [\"#357ebd\",\"#46b8da\",\"#5cb85c\",\"#eea236\",\"#d43f3a\"]\n }\n },\n \"#B8B8B8\"\n ],\n legend: [\n { shape: \"diamond\", color: \"#9632b8\", size: 40, label: \"LD Ref Var\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#d43f3a\", size: 40, label: \"1.0 > r² ≥ 0.8\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#eea236\", size: 40, label: \"0.8 > r² ≥ 0.6\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#5cb85c\", size: 40, label: \"0.6 > r² ≥ 0.4\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#46b8da\", size: 40, label: \"0.4 > r² ≥ 0.2\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#357ebd\", size: 40, label: \"0.2 > r² ≥ 0.0\", class: \"lz-data_layer-scatter\" },\n { shape: \"circle\", color: \"#B8B8B8\", size: 40, label: \"no r² data\", class: \"lz-data_layer-scatter\" }\n ],\n fields: [\"{{namespace[assoc]}}variant\", \"{{namespace[assoc]}}position\", \"{{namespace[assoc]}}log_pvalue\", \"{{namespace[assoc]}}log_pvalue|logtoscinotation\", \"{{namespace[assoc]}}ref_allele\", \"{{namespace[ld]}}state\", \"{{namespace[ld]}}isrefvar\"],\n id_field: \"{{namespace[assoc]}}variant\",\n z_index: 2,\n x_axis: {\n field: \"{{namespace[assoc]}}position\"\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[assoc]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.10,\n min_extent: [ 0, 10 ]\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_association\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"phewas_pvalues\", {\n namespace: {\"phewas\": \"phewas\"},\n id: \"phewaspvalues\",\n type: \"category_scatter\",\n point_shape: \"circle\",\n point_size: 70,\n tooltip_positioning: \"vertical\",\n id_field: \"{{namespace[phewas]}}id\",\n fields: [\"{{namespace[phewas]}}id\", \"{{namespace[phewas]}}log_pvalue\", \"{{namespace[phewas]}}trait_group\", \"{{namespace[phewas]}}trait_label\"],\n x_axis: {\n field: \"{{namespace[phewas]}}x\", // Synthetic/derived field added by `category_scatter` layer\n category_field: \"{{namespace[phewas]}}trait_group\",\n lower_buffer: 0.025,\n upper_buffer: 0.025\n },\n y_axis: {\n axis: 1,\n field: \"{{namespace[phewas]}}log_pvalue\",\n floor: 0,\n upper_buffer: 0.15\n },\n color: {\n field: \"{{namespace[phewas]}}trait_group\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [],\n values: [],\n null_value: \"#B8B8B8\"\n }\n },\n fill_opacity: 0.7,\n tooltip: {\n closable: true,\n show: { or: [\"highlighted\", \"selected\"] },\n hide: { and: [\"unhighlighted\", \"unselected\"] },\n html: [\n \"Trait: {{{{namespace[phewas]}}trait_label|htmlescape}}
      \",\n \"Trait Category: {{{{namespace[phewas]}}trait_group|htmlescape}}
      \",\n \"P-value: {{{{namespace[phewas]}}log_pvalue|logtoscinotation|htmlescape}}
      \"\n ].join(\"\")\n },\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n label: {\n text: \"{{{{namespace[phewas]}}trait_label}}\",\n spacing: 6,\n lines: {\n style: {\n \"stroke-width\": \"2px\",\n \"stroke\": \"#333333\",\n \"stroke-dasharray\": \"2px 2px\"\n }\n },\n filters: [\n {\n field: \"{{namespace[phewas]}}log_pvalue\",\n operator: \">=\",\n value: 20\n }\n ],\n style: {\n \"font-size\": \"14px\",\n \"font-weight\": \"bold\",\n \"fill\": \"#333333\"\n }\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genes\", {\n namespace: { \"gene\": \"gene\", \"constraint\": \"constraint\" },\n id: \"genes\",\n type: \"genes\",\n fields: [\"{{namespace[gene]}}all\", \"{{namespace[constraint]}}all\"],\n id_field: \"gene_id\",\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_genes\", { unnamespaced: true })\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"genome_legend\", {\n namespace: { \"genome\": \"genome\" },\n id: \"genome_legend\",\n type: \"genome_legend\",\n fields: [\"{{namespace[genome]}}chr\", \"{{namespace[genome]}}base_pairs\"],\n x_axis: {\n floor: 0,\n ceiling: 2881033286\n }\n});\n\nLocusZoom.Layouts.add(\"data_layer\", \"intervals\", {\n namespace: { \"intervals\": \"intervals\" },\n id: \"intervals\",\n type: \"intervals\",\n fields: [\"{{namespace[intervals]}}start\",\"{{namespace[intervals]}}end\",\"{{namespace[intervals]}}state_id\",\"{{namespace[intervals]}}state_name\"],\n id_field: \"{{namespace[intervals]}}start\",\n start_field: \"{{namespace[intervals]}}start\",\n end_field: \"{{namespace[intervals]}}end\",\n track_split_field: \"{{namespace[intervals]}}state_id\",\n split_tracks: true,\n always_hide_legend: false,\n color: {\n field: \"{{namespace[intervals]}}state_id\",\n scale_function: \"categorical_bin\",\n parameters: {\n categories: [1,2,3,4,5,6,7,8,9,10,11,12,13],\n values: [\"rgb(212,63,58)\", \"rgb(250,120,105)\", \"rgb(252,168,139)\", \"rgb(240,189,66)\", \"rgb(250,224,105)\", \"rgb(240,238,84)\", \"rgb(244,252,23)\", \"rgb(23,232,252)\", \"rgb(32,191,17)\", \"rgb(23,166,77)\", \"rgb(32,191,17)\", \"rgb(162,133,166)\", \"rgb(212,212,212)\"],\n null_value: \"#B8B8B8\"\n }\n },\n legend: [\n { shape: \"rect\", color: \"rgb(212,63,58)\", width: 9, label: \"Active Promoter\", \"{{namespace[intervals]}}state_id\": 1 },\n { shape: \"rect\", color: \"rgb(250,120,105)\", width: 9, label: \"Weak Promoter\", \"{{namespace[intervals]}}state_id\": 2 },\n { shape: \"rect\", color: \"rgb(252,168,139)\", width: 9, label: \"Poised Promoter\", \"{{namespace[intervals]}}state_id\": 3 },\n { shape: \"rect\", color: \"rgb(240,189,66)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 4 },\n { shape: \"rect\", color: \"rgb(250,224,105)\", width: 9, label: \"Strong enhancer\", \"{{namespace[intervals]}}state_id\": 5 },\n { shape: \"rect\", color: \"rgb(240,238,84)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 6 },\n { shape: \"rect\", color: \"rgb(244,252,23)\", width: 9, label: \"Weak enhancer\", \"{{namespace[intervals]}}state_id\": 7 },\n { shape: \"rect\", color: \"rgb(23,232,252)\", width: 9, label: \"Insulator\", \"{{namespace[intervals]}}state_id\": 8 },\n { shape: \"rect\", color: \"rgb(32,191,17)\", width: 9, label: \"Transcriptional transition\", \"{{namespace[intervals]}}state_id\": 9 },\n { shape: \"rect\", color: \"rgb(23,166,77)\", width: 9, label: \"Transcriptional elongation\", \"{{namespace[intervals]}}state_id\": 10 },\n { shape: \"rect\", color: \"rgb(136,240,129)\", width: 9, label: \"Weak transcribed\", \"{{namespace[intervals]}}state_id\": 11 },\n { shape: \"rect\", color: \"rgb(162,133,166)\", width: 9, label: \"Polycomb-repressed\", \"{{namespace[intervals]}}state_id\": 12 },\n { shape: \"rect\", color: \"rgb(212,212,212)\", width: 9, label: \"Heterochromatin / low signal\", \"{{namespace[intervals]}}state_id\": 13 }\n ],\n behaviors: {\n onmouseover: [\n { action: \"set\", status: \"highlighted\" }\n ],\n onmouseout: [\n { action: \"unset\", status: \"highlighted\" }\n ],\n onclick: [\n { action: \"toggle\", status: \"selected\", exclusive: true }\n ],\n onshiftclick: [\n { action: \"toggle\", status: \"selected\" }\n ]\n },\n tooltip: LocusZoom.Layouts.get(\"tooltip\", \"standard_intervals\", { unnamespaced: true })\n});\n\n/**\n * Dashboard Layouts: toolbar buttons etc\n * @namespace Layouts.dashboard\n */\nLocusZoom.Layouts.add(\"dashboard\", \"standard_panel\", {\n components: [\n {\n type: \"remove_panel\",\n position: \"right\",\n color: \"red\",\n group_position: \"end\"\n },\n {\n type: \"move_panel_up\",\n position: \"right\",\n group_position: \"middle\"\n },\n {\n type: \"move_panel_down\",\n position: \"right\",\n group_position: \"start\",\n style: { \"margin-left\": \"0.75em\" }\n }\n ]\n}); \n\nLocusZoom.Layouts.add(\"dashboard\", \"standard_plot\", {\n components: [\n {\n type: \"title\",\n title: \"LocusZoom\",\n subtitle: \"v\" + LocusZoom.version + \"\",\n position: \"left\"\n },\n {\n type: \"download\",\n position: \"right\"\n }\n ]\n});\n\nvar covariates_model_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\ncovariates_model_plot_dashboard.components.push({\n type: \"covariates_model\",\n button_html: \"Model\",\n button_title: \"Show and edit covariates currently in model\",\n position: \"left\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"covariates_model_plot\", covariates_model_plot_dashboard);\n\nvar region_nav_plot_dashboard = LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\");\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 500000,\n button_html: \">>\",\n position: \"right\",\n group_position: \"end\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: 50000,\n button_html: \">\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: 0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"zoom_region\",\n step: -0.2,\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -50000,\n button_html: \"<\",\n position: \"right\",\n group_position: \"middle\"\n});\nregion_nav_plot_dashboard.components.push({\n type: \"shift_region\",\n step: -500000,\n button_html: \"<<\",\n position: \"right\",\n group_position: \"start\"\n});\nLocusZoom.Layouts.add(\"dashboard\", \"region_nav_plot\", region_nav_plot_dashboard);\n\n/**\n * Panel Layouts\n * @namespace Layouts.panel\n */\n\nLocusZoom.Layouts.add(\"panel\", \"association\", {\n id: \"association\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 200,\n proportional_width: 1,\n margin: { top: 35, right: 50, bottom: 40, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_legend\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n },\n y2: {\n label: \"Recombination Rate (cM/Mb)\",\n label_offset: 40\n }\n },\n legend: {\n orientation: \"vertical\",\n origin: { x: 55, y: 40 },\n hidden: true\n },\n interaction: {\n drag_background_to_pan: true,\n drag_x_ticks_to_scale: true,\n drag_y1_ticks_to_scale: true,\n drag_y2_ticks_to_scale: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"recomb_rate\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"association_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genes\", {\n id: \"genes\",\n width: 800,\n height: 225,\n min_width: 400,\n min_height: 112.5,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 20, left: 50 },\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"resize_to_data\",\n position: \"right\"\n });\n return l;\n })(), \n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genes\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"phewas\", {\n id: \"phewas\",\n width: 800,\n height: 300,\n min_width: 800,\n min_height: 300,\n proportional_width: 1,\n margin: { top: 20, right: 50, bottom: 120, left: 50 },\n inner_border: \"rgb(210, 210, 210)\",\n axes: {\n x: {\n ticks: { // Object based config (shared defaults; allow layers to specify ticks)\n style: {\n \"font-weight\": \"bold\",\n \"font-size\": \"11px\",\n \"text-anchor\": \"start\"\n },\n transform: \"rotate(50)\",\n position: \"left\" // Special param recognized by `category_scatter` layers\n }\n },\n y1: {\n label: \"-log10 p-value\",\n label_offset: 28\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"significance\", { unnamespaced: true }),\n LocusZoom.Layouts.get(\"data_layer\", \"phewas_pvalues\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"genome_legend\", {\n id: \"genome_legend\",\n width: 800,\n height: 50,\n origin: { x: 0, y: 300 },\n min_width: 800,\n min_height: 50,\n proportional_width: 1,\n margin: { top: 0, right: 50, bottom: 35, left: 50 },\n axes: {\n x: {\n label: \"Genomic Position (number denotes chromosome)\",\n label_offset: 35,\n ticks: [\n {\n x: 124625310,\n text: \"1\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 370850307,\n text: \"2\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 591461209,\n text: \"3\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 786049562,\n text: \"4\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 972084330,\n text: \"5\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1148099493,\n text: \"6\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1313226358,\n text: \"7\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1465977701,\n text: \"8\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1609766427,\n text: \"9\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1748140516,\n text: \"10\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 1883411148,\n text: \"11\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2017840353,\n text: \"12\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2142351240,\n text: \"13\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2253610949,\n text: \"14\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2358551415,\n text: \"15\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2454994487,\n text: \"16\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2540769469,\n text: \"17\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2620405698,\n text: \"18\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2689008813,\n text: \"19\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2750086065,\n text: \"20\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2805663772,\n text: \"21\",\n style: {\n \"fill\": \"rgb(120, 120, 186)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n },\n {\n x: 2855381003,\n text: \"22\",\n style: {\n \"fill\": \"rgb(0, 0, 66)\",\n \"text-anchor\": \"center\",\n \"font-size\": \"13px\",\n \"font-weight\": \"bold\"\n },\n transform: \"translate(0, 2)\"\n }\n ]\n }\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"genome_legend\", { unnamespaced: true })\n ]\n});\n\nLocusZoom.Layouts.add(\"panel\", \"intervals\", {\n id: \"intervals\",\n width: 1000,\n height: 50,\n min_width: 500,\n min_height: 50,\n margin: { top: 25, right: 150, bottom: 5, left: 50 },\n dashboard: (function(){\n var l = LocusZoom.Layouts.get(\"dashboard\", \"standard_panel\", { unnamespaced: true });\n l.components.push({\n type: \"toggle_split_tracks\",\n data_layer_id: \"intervals\",\n position: \"right\"\n });\n return l;\n })(),\n axes: {},\n interaction: {\n drag_background_to_pan: true,\n scroll_to_zoom: true,\n x_linked: true\n },\n legend: {\n hidden: true,\n orientation: \"horizontal\",\n origin: { x: 50, y: 0 },\n pad_from_bottom: 5\n },\n data_layers: [\n LocusZoom.Layouts.get(\"data_layer\", \"intervals\", { unnamespaced: true })\n ]\n});\n\n\n/**\n * Plot Layouts\n * @namespace Layouts.plot\n */\n\nLocusZoom.Layouts.add(\"plot\", \"standard_association\", {\n state: {},\n width: 800,\n height: 450,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, proportional_height: 0.5 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, proportional_height: 0.5 })\n ]\n});\n\n// Shortcut to \"StandardLayout\" for backward compatibility\nLocusZoom.StandardLayout = LocusZoom.Layouts.get(\"plot\", \"standard_association\");\n\nLocusZoom.Layouts.add(\"plot\", \"standard_phewas\", {\n width: 800,\n height: 600,\n min_width: 800,\n min_height: 600,\n responsive_resize: true,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true } ),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"phewas\", { unnamespaced: true, proportional_height: 0.45 }),\n LocusZoom.Layouts.get(\"panel\", \"genome_legend\", { unnamespaced: true, proportional_height: 0.1 }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", {\n unnamespaced: true, proportional_height: 0.45,\n margin: { bottom: 40 },\n axes: {\n x: {\n label: \"Chromosome {{chr}} (Mb)\",\n label_offset: 32,\n tick_format: \"region\",\n extent: \"state\"\n }\n }\n })\n ],\n mouse_guide: false\n});\n\nLocusZoom.Layouts.add(\"plot\", \"interval_association\", {\n state: {},\n width: 800,\n height: 550,\n responsive_resize: true,\n min_region_scale: 20000,\n max_region_scale: 1000000,\n dashboard: LocusZoom.Layouts.get(\"dashboard\", \"standard_plot\", { unnamespaced: true }),\n panels: [\n LocusZoom.Layouts.get(\"panel\", \"association\", { unnamespaced: true, width: 800, proportional_height: (225/570) }),\n LocusZoom.Layouts.get(\"panel\", \"intervals\", { unnamespaced: true, proportional_height: (120/570) }),\n LocusZoom.Layouts.get(\"panel\", \"genes\", { unnamespaced: true, width: 800, proportional_height: (225/570) })\n ]\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A data layer is an abstract class representing a data set and its graphical representation within a panel\n * @public\n * @class\n * @param {Object} layout A JSON-serializable object describing the layout for this layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n*/\nLocusZoom.DataLayer = function(layout, parent) {\n /** @member {Boolean} */\n this.initialized = false;\n /** @member {Number} */\n this.layout_idx = null;\n\n /** @member {String} */\n this.id = null;\n /** @member {LocusZoom.Panel} */\n this.parent = parent || null;\n /**\n * @member {{group: d3.selection, container: d3.selection, clipRect: d3.selection}}\n */\n this.svg = {};\n\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n if (typeof parent != \"undefined\" && parent instanceof LocusZoom.Panel){ this.parent_plot = parent.parent; }\n\n /** @member {Object} */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.DataLayer.DefaultLayout);\n if (this.layout.id){ this.id = this.layout.id; }\n\n // Ensure any axes defined in the layout have an explicit axis number (default: 1)\n if (this.layout.x_axis !== {} && typeof this.layout.x_axis.axis !== \"number\"){ this.layout.x_axis.axis = 1; }\n if (this.layout.y_axis !== {} && typeof this.layout.y_axis.axis !== \"number\"){ this.layout.y_axis.axis = 1; }\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original data layer state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n /** @member {Object} */\n this.state = {};\n /** @member {String} */\n this.state_id = null;\n\n this.setDefaultState();\n\n // Initialize parameters for storing data and tool tips\n /** @member {Array} */\n this.data = [];\n if (this.layout.tooltip){\n /** @member {Object} */\n this.tooltips = {};\n }\n\n // Initialize flags for tracking global statuses\n this.global_statuses = {\n \"highlighted\": false,\n \"selected\": false,\n \"faded\": false,\n \"hidden\": false\n };\n \n return this;\n\n};\n\n/**\n * Instruct this datalayer to begin tracking additional fields from data sources (does not guarantee that such a field actually exists)\n *\n * Custom plots can use this to dynamically extend datalayer functionality after the plot is drawn\n *\n * (since removing core fields may break layer functionality, there is presently no hook for the inverse behavior)\n * @param fieldName\n * @param namespace\n * @param {String|String[]} transformations The name (or array of names) of transformations to apply to this field\n * @returns {String} The raw string added to the fields array\n */\nLocusZoom.DataLayer.prototype.addField = function(fieldName, namespace, transformations) {\n if (!fieldName || !namespace) {\n throw \"Must specify field name and namespace to use when adding field\";\n }\n var fieldString = namespace + \":\" + fieldName;\n if (transformations) {\n fieldString += \"|\";\n if (typeof transformations === \"string\") {\n fieldString += transformations;\n } else if (Array.isArray(transformations)) {\n fieldString += transformations.join(\"|\");\n } else {\n throw \"Must provide transformations as either a string or array of strings\";\n }\n }\n var fields = this.layout.fields;\n if (fields.indexOf(fieldString) === -1) {\n fields.push(fieldString);\n }\n return fieldString;\n};\n\n/**\n * Define default state that should get tracked during the lifetime of this layer.\n *\n * In some special custom usages, it may be useful to completely reset a panel (eg \"click for\n * genome region\" links), plotting new data that invalidates any previously tracked state. This hook makes it\n * possible to reset without destroying the panel entirely. It is used by `Plot.clearPanelData`.\n */\nLocusZoom.DataLayer.prototype.setDefaultState = function() {\n // Define state parameters specific to this data layer. Within plot state, this will live under a key\n // `panel_name.layer_name`.\n if (this.parent){\n this.state = this.parent.state;\n this.state_id = this.parent.id + \".\" + this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n this.state[this.state_id][status] = this.state[this.state_id][status] || [];\n }.bind(this));\n }\n};\n\n/**\n * A basic description of keys expected in a layout. Not intended to be directly used or modified by an end user.\n * @protected\n * @type {{type: string, fields: Array, x_axis: {}, y_axis: {}}}\n */\nLocusZoom.DataLayer.DefaultLayout = {\n type: \"\",\n fields: [],\n x_axis: {},\n y_axis: {}\n};\n\n/**\n * Available statuses that individual elements can have. Each status is described by\n * a verb/antiverb and an adjective. Verbs and antiverbs are used to generate data layer\n * methods for updating the status on one or more elements. Adjectives are used in class\n * names and applied or removed from elements to have a visual representation of the status,\n * as well as used as keys in the state for tracking which elements are in which status(es)\n * @static\n * @type {{verbs: String[], adjectives: String[], menu_antiverbs: String[]}}\n */\nLocusZoom.DataLayer.Statuses = {\n verbs: [\"highlight\", \"select\", \"fade\", \"hide\"],\n adjectives: [\"highlighted\", \"selected\", \"faded\", \"hidden\"],\n menu_antiverbs: [\"unhighlight\", \"deselect\", \"unfade\", \"show\"]\n};\n\n/**\n * Get the fully qualified identifier for the data layer, prefixed by any parent or container elements\n *\n * @returns {string} A dot-delimited string of the format ..\n */\nLocusZoom.DataLayer.prototype.getBaseId = function(){\n return this.parent_plot.id + \".\" + this.parent.id + \".\" + this.id;\n};\n\n/**\n * Determine the pixel height of data-bound objects represented inside this data layer. (excluding elements such as axes)\n *\n * May be used by operations that resize the data layer to fit available data\n *\n * @public\n * @returns {number}\n */\nLocusZoom.DataLayer.prototype.getAbsoluteDataHeight = function(){\n var dataBCR = this.svg.group.node().getBoundingClientRect();\n return dataBCR.height;\n};\n\n/**\n * Whether transitions can be applied to this data layer\n * @returns {boolean}\n */\nLocusZoom.DataLayer.prototype.canTransition = function(){\n if (!this.layout.transition){ return false; }\n return !(this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.panel_id);\n};\n\n/**\n * Fetch the fully qualified ID to be associated with a specific visual element, based on the data to which that\n * element is bound. In general this element ID will be unique, allowing it to be addressed directly via selectors.\n * @param {String|Object} element\n * @returns {String}\n */\nLocusZoom.DataLayer.prototype.getElementId = function(element){\n var element_id = \"element\";\n if (typeof element == \"string\"){\n element_id = element;\n } else if (typeof element == \"object\"){\n var id_field = this.layout.id_field || \"id\";\n if (typeof element[id_field] == \"undefined\"){\n throw(\"Unable to generate element ID\");\n }\n element_id = element[id_field].toString().replace(/\\W/g,\"\");\n }\n return (this.getBaseId() + \"-\" + element_id).replace(/(:|\\.|\\[|\\]|,)/g, \"_\");\n};\n\n/**\n * Fetch an ID that may bind a data element to a separate visual node for displaying status\n * Examples of this might be seperate visual nodes to show select/highlight statuses, or\n * even a common/shared node to show status across many elements in a set.\n * Abstract method. It should be overridden by data layers that implement seperate status\n * nodes specifically to the use case of the data layer type.\n * @param {String|Object} element\n * @returns {String|null}\n */\nLocusZoom.DataLayer.prototype.getElementStatusNodeId = function(element){\n return null;\n};\n\n/**\n * Returns a reference to the underlying data associated with a single visual element in the data layer, as\n * referenced by the unique identifier for the element\n\n * @param {String} id The unique identifier for the element, as defined by `getElementId`\n * @returns {Object|null} The data bound to that element\n */\nLocusZoom.DataLayer.prototype.getElementById = function(id){\n var selector = d3.select(\"#\" + id.replace(/(:|\\.|\\[|\\]|,)/g, \"\\\\$1\"));\n if (!selector.empty() && selector.data() && selector.data().length){\n return selector.data()[0];\n } else {\n return null;\n }\n};\n\n/**\n * Basic method to apply arbitrary methods and properties to data elements.\n * This is called on all data immediately after being fetched.\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyDataMethods = function(){\n this.data.forEach(function(d, i){\n // Basic toHTML() method - return the stringified value in the id_field, if defined.\n this.data[i].toHTML = function(){\n var id_field = this.layout.id_field || \"id\";\n var html = \"\";\n if (this.data[i][id_field]){ html = this.data[i][id_field].toString(); }\n return html;\n }.bind(this);\n // getDataLayer() method - return a reference to the data layer\n this.data[i].getDataLayer = function(){\n return this;\n }.bind(this);\n // deselect() method - shortcut method to deselect the element\n this.data[i].deselect = function(){\n var data_layer = this.getDataLayer();\n data_layer.unselectElement(this);\n };\n }.bind(this));\n this.applyCustomDataMethods();\n return this;\n};\n\n/**\n * Hook that allows custom datalayers to apply additional methods and properties to data elements as needed\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.applyCustomDataMethods = function(){\n return this;\n};\n\n/**\n * Initialize a data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.initialize = function(){\n\n // Append a container group element to house the main data layer group element and the clip path\n this.svg.container = this.parent.svg.group.append(\"g\")\n .attr(\"class\", \"lz-data_layer-container\")\n .attr(\"id\", this.getBaseId() + \".data_layer_container\");\n \n // Append clip path to the container element\n this.svg.clipRect = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\")\n .append(\"rect\");\n \n // Append svg group for rendering all data layer elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".data_layer\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n return this;\n\n};\n\n/**\n * Move a data layer up relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveUp = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index + 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Move a data layer down relative to others by z-index\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.moveDown = function(){\n if (this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1]){\n this.parent.data_layer_ids_by_z_index[this.layout.z_index] = this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1];\n this.parent.data_layer_ids_by_z_index[this.layout.z_index - 1] = this.id;\n this.parent.resortDataLayers();\n }\n return this;\n};\n\n/**\n * Apply scaling functions to an element or parameter as needed, based on its layout and the element's data\n * If the layout parameter is already a primitive type, simply return the value as given\n * @param {Array|Number|String|Object} layout\n * @param {*} data The value to be used with the filter\n * @returns {*} The transformed value\n */\nLocusZoom.DataLayer.prototype.resolveScalableParameter = function(layout, data){\n var ret = null;\n if (Array.isArray(layout)){\n var idx = 0;\n while (ret === null && idx < layout.length){\n ret = this.resolveScalableParameter(layout[idx], data);\n idx++;\n }\n } else {\n switch (typeof layout){\n case \"number\":\n case \"string\":\n ret = layout;\n break;\n case \"object\":\n if (layout.scale_function){\n if(layout.field) {\n var f = new LocusZoom.Data.Field(layout.field);\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, f.resolve(data));\n } else {\n ret = LocusZoom.ScaleFunctions.get(layout.scale_function, layout.parameters || {}, data);\n }\n }\n break;\n }\n }\n return ret;\n};\n\n/**\n * Generate dimension extent function based on layout parameters\n * @param {('x'|'y')} dimension\n */\nLocusZoom.DataLayer.prototype.getAxisExtent = function(dimension){\n\n if ([\"x\", \"y\"].indexOf(dimension) === -1){\n throw(\"Invalid dimension identifier passed to LocusZoom.DataLayer.getAxisExtent()\");\n }\n\n var axis_name = dimension + \"_axis\";\n var axis_layout = this.layout[axis_name];\n\n // If a floor AND a ceiling are explicitly defined then just return that extent and be done\n if (!isNaN(axis_layout.floor) && !isNaN(axis_layout.ceiling)){\n return [+axis_layout.floor, +axis_layout.ceiling];\n }\n\n // If a field is defined for the axis and the data layer has data then generate the extent from the data set\n var data_extent = [];\n if (axis_layout.field && this.data) {\n if (!this.data.length) {\n // If data has been fetched (but no points in region), enforce the min_extent (with no buffers,\n // because we don't need padding around an empty screen)\n data_extent = axis_layout.min_extent || [];\n return data_extent;\n } else {\n data_extent = d3.extent(this.data, function (d) {\n var f = new LocusZoom.Data.Field(axis_layout.field);\n return +f.resolve(d);\n });\n\n // Apply upper/lower buffers, if applicable\n var original_extent_span = data_extent[1] - data_extent[0];\n if (!isNaN(axis_layout.lower_buffer)) {\n data_extent[0] -= original_extent_span * axis_layout.lower_buffer;\n }\n if (!isNaN(axis_layout.upper_buffer)) {\n data_extent[1] += original_extent_span * axis_layout.upper_buffer;\n }\n\n if (typeof axis_layout.min_extent == \"object\") {\n // The data should span at least the range specified by min_extent, an array with [low, high]\n var range_min = axis_layout.min_extent[0];\n var range_max = axis_layout.min_extent[1];\n if (!isNaN(range_min) && !isNaN(range_max)) {\n data_extent[0] = Math.min(data_extent[0], range_min);\n }\n if (!isNaN(range_max)) {\n data_extent[1] = Math.max(data_extent[1], range_max);\n }\n }\n // If specified, floor and ceiling will override the actual data range\n return [\n isNaN(axis_layout.floor) ? data_extent[0] : axis_layout.floor,\n isNaN(axis_layout.ceiling) ? data_extent[1] : axis_layout.ceiling\n ];\n }\n }\n\n // If this is for the x axis and no extent could be generated yet but state has a defined start and end\n // then default to using the state-defined region as the extent\n if (dimension === \"x\" && !isNaN(this.state.start) && !isNaN(this.state.end)) {\n return [this.state.start, this.state.end];\n }\n\n // No conditions met for generating a valid extent, return an empty array\n return [];\n\n};\n\n/**\n * Allow this data layer to tell the panel what axis ticks it thinks it will require. The panel may choose whether\n * to use some, all, or none of these when rendering, either alone or in conjunction with other data layers.\n *\n * This method is a stub and should be overridden in data layers that need to specify custom behavior.\n *\n * @param {('x'|'y')} dimension\n * @param {Object} [config] Additional parameters for the panel to specify how it wants ticks to be drawn. The names\n * and meanings of these parameters may vary between different data layers.\n * @returns {Object[]}\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.DataLayer.prototype.getTicks = function (dimension, config) {\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw(\"Invalid dimension identifier\");\n }\n return [];\n};\n\n/**\n * Generate a tool tip for a given element\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.createTooltip = function(d, id){\n if (typeof this.layout.tooltip != \"object\"){\n throw (\"DataLayer [\" + this.id + \"] layout does not define a tooltip\");\n }\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n if (this.tooltips[id]){\n this.positionTooltip(id);\n return;\n }\n this.tooltips[id] = {\n data: d,\n arrow: null,\n selector: d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-data_layer-tooltip\")\n .attr(\"id\", id + \"-tooltip\")\n };\n this.updateTooltip(d);\n return this;\n};\n\n/**\n * Update a tool tip (generate its inner HTML)\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n */\nLocusZoom.DataLayer.prototype.updateTooltip = function(d, id){\n if (typeof id == \"undefined\"){ id = this.getElementId(d); }\n // Empty the tooltip of all HTML (including its arrow!)\n this.tooltips[id].selector.html(\"\");\n this.tooltips[id].arrow = null;\n // Set the new HTML\n if (this.layout.tooltip.html){\n this.tooltips[id].selector.html(LocusZoom.parseFields(d, this.layout.tooltip.html));\n }\n // If the layout allows tool tips on this data layer to be closable then add the close button\n // and add padding to the tooltip to accommodate it\n if (this.layout.tooltip.closable){\n this.tooltips[id].selector.insert(\"button\", \":first-child\")\n .attr(\"class\", \"lz-tooltip-close-button\")\n .attr(\"title\", \"Close\")\n .text(\"×\")\n .on(\"click\", function(){\n this.destroyTooltip(id);\n }.bind(this));\n }\n // Apply data directly to the tool tip for easier retrieval by custom UI elements inside the tool tip\n this.tooltips[id].selector.data([d]);\n // Reposition and draw a new arrow\n this.positionTooltip(id);\n return this;\n};\n\n/**\n * Destroy tool tip - remove the tool tip element from the DOM and delete the tool tip's record on the data layer\n * @param {String|Object} d The element associated with the tooltip\n * @param {String} [id] An identifier to the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyTooltip = function(d, id){\n if (typeof d == \"string\"){\n id = d;\n } else if (typeof id == \"undefined\"){\n id = this.getElementId(d);\n }\n if (this.tooltips[id]){\n if (typeof this.tooltips[id].selector == \"object\"){\n this.tooltips[id].selector.remove();\n }\n delete this.tooltips[id];\n }\n return this;\n};\n\n/**\n * Loop through and destroy all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.destroyAllTooltips = function(){\n for (var id in this.tooltips){\n this.destroyTooltip(id);\n }\n return this;\n};\n\n//\n/**\n * Position tool tip - naïve function to place a tool tip to the lower right of the current mouse element\n * Most data layers reimplement this method to position tool tips specifically for the data they display\n * @param {String} id The identifier of the tooltip to position\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n // Position the div itself\n this.tooltips[id].selector\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY) + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!this.tooltips[id].arrow){\n this.tooltips[id].arrow = this.tooltips[id].selector.append(\"div\")\n .style(\"position\", \"absolute\")\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_top_left\");\n }\n this.tooltips[id].arrow\n .style(\"left\", \"-1px\")\n .style(\"top\", \"-1px\");\n return this;\n};\n\n/**\n * Loop through and position all tool tips on this data layer\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.positionAllTooltips = function(){\n for (var id in this.tooltips){\n this.positionTooltip(id);\n }\n return this;\n};\n\n/**\n * Show or hide a tool tip by ID depending on directives in the layout and state values relative to the ID\n * @param {String|Object} element The element associated with the tooltip\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.showOrHideTooltip = function(element){\n \n if (typeof this.layout.tooltip != \"object\"){ return; }\n var id = this.getElementId(element);\n\n var resolveStatus = function(statuses, directive, operator){\n var status = null;\n if (typeof statuses != \"object\" || statuses === null){ return null; }\n if (Array.isArray(directive)){\n if (typeof operator == \"undefined\"){ operator = \"and\"; }\n if (directive.length === 1){\n status = statuses[directive[0]];\n } else {\n status = directive.reduce(function(previousValue, currentValue) {\n if (operator === \"and\"){\n return statuses[previousValue] && statuses[currentValue];\n } else if (operator === \"or\"){\n return statuses[previousValue] || statuses[currentValue];\n }\n return null;\n });\n }\n } else if (typeof directive == \"object\"){\n var sub_status;\n for (var sub_operator in directive){\n sub_status = resolveStatus(statuses, directive[sub_operator], sub_operator);\n if (status === null){\n status = sub_status;\n } else if (operator === \"and\"){\n status = status && sub_status;\n } else if (operator === \"or\"){\n status = status || sub_status;\n }\n }\n }\n return status;\n };\n\n var show_directive = {};\n if (typeof this.layout.tooltip.show == \"string\"){\n show_directive = { and: [ this.layout.tooltip.show ] };\n } else if (typeof this.layout.tooltip.show == \"object\"){\n show_directive = this.layout.tooltip.show;\n }\n\n var hide_directive = {};\n if (typeof this.layout.tooltip.hide == \"string\"){\n hide_directive = { and: [ this.layout.tooltip.hide ] };\n } else if (typeof this.layout.tooltip.hide == \"object\"){\n hide_directive = this.layout.tooltip.hide;\n }\n\n var statuses = {};\n LocusZoom.DataLayer.Statuses.adjectives.forEach(function(status){\n var antistatus = \"un\" + status;\n statuses[status] = this.state[this.state_id][status].indexOf(id) !== -1;\n statuses[antistatus] = !statuses[status];\n }.bind(this));\n\n var show_resolved = resolveStatus(statuses, show_directive);\n var hide_resolved = resolveStatus(statuses, hide_directive);\n\n // Only show tooltip if the resolved logic explicitly shows and explicitly not hides the tool tip\n // Otherwise ensure tooltip does not exist\n if (show_resolved && !hide_resolved){\n this.createTooltip(element);\n } else {\n this.destroyTooltip(element);\n }\n\n return this;\n \n};\n\n/**\n * Find the elements (or indices) that match any of a set of provided filters\n * @protected\n * @param {Array[]} filters A list of filter entries: [field, value] (for equivalence testing) or\n * [field, operator, value] for other operators\n * @param {('indexes'|'elements')} [return_type='indexes'] Specify whether to return either the indices of the matching\n * elements, or references to the elements themselves\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filter = function(filters, return_type){\n if (typeof return_type == \"undefined\" || [\"indexes\",\"elements\"].indexOf(return_type) === -1){\n return_type = \"indexes\";\n }\n if (!Array.isArray(filters)){ return []; }\n var test = function(element, filter){\n var operators = {\n \"=\": function(a,b){ return a === b; },\n \"<\": function(a,b){ return a < b; },\n \"<=\": function(a,b){ return a <= b; },\n \">\": function(a,b){ return a > b; },\n \">=\": function(a,b){ return a >= b; },\n \"%\": function(a,b){ return a % b; }\n };\n if (!Array.isArray(filter)){ return false; }\n if (filter.length === 2){\n return element[filter[0]] === filter[1];\n } else if (filter.length === 3 && operators[filter[1]]){\n return operators[filter[1]](element[filter[0]], filter[2]);\n } else {\n return false;\n }\n };\n var matches = [];\n this.data.forEach(function(element, idx){\n var match = true;\n filters.forEach(function(filter){\n if (!test(element, filter)){ match = false; }\n });\n if (match){ matches.push(return_type === \"indexes\" ? idx : element); }\n });\n return matches;\n};\n\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterIndexes = function(filters){ return this.filter(filters, \"indexes\"); };\n/**\n * @param filters\n * @returns {Array}\n */\nLocusZoom.DataLayer.prototype.filterElements = function(filters){ return this.filter(filters, \"elements\"); };\n\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset a single element's status\n // TODO: Improve documentation for dynamically generated methods/properties\n LocusZoom.DataLayer.prototype[verb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, true, exclusive);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"Element\"] = function(element, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n this.setElementStatus(adjective, element, false, exclusive);\n return this;\n };\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.DataLayer.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.DataLayer.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.DataLayer.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.DataLayer.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n/**\n * Toggle a status (e.g. highlighted, selected, identified) on an element\n * @param {String} status The name of a recognized status to be added/removed on an appropriate element\n * @param {String|Object} element The data bound to the element of interest\n * @param {Boolean} toggle True to add the status (and associated CSS styles); false to remove it\n * @param {Boolean} exclusive Whether to only allow a state for a single element at a time\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatus = function(status, element, toggle, exclusive){\n // Sanity checks\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatus()\");\n }\n if (typeof element == \"undefined\"){\n throw(\"Invalid element passed to DataLayer.setElementStatus()\");\n }\n if (typeof toggle == \"undefined\"){\n toggle = true;\n }\n\n // Get an ID for the element or return having changed nothing\n try {\n var element_id = this.getElementId(element);\n } catch (get_element_id_error){\n return this;\n }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Set/unset the proper status class on the appropriate DOM element(s)\n d3.select(\"#\" + element_id).classed(\"lz-data_layer-\" + this.layout.type + \"-\" + status, toggle);\n var element_status_node_id = this.getElementStatusNodeId(element);\n if (element_status_node_id !== null){\n d3.select(\"#\" + element_status_node_id).classed(\"lz-data_layer-\" + this.layout.type + \"-statusnode-\" + status, toggle);\n }\n \n // Track element ID in the proper status state array\n var element_status_idx = this.state[this.state_id][status].indexOf(element_id);\n if (toggle && element_status_idx === -1){\n this.state[this.state_id][status].push(element_id);\n }\n if (!toggle && element_status_idx !== -1){\n this.state[this.state_id][status].splice(element_status_idx, 1);\n }\n \n // Trigger tool tip show/hide logic\n this.showOrHideTooltip(element);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n if (status === \"selected\") {\n // Notify parents that a given element has been interacted with. For now, we will only notify on\n // \"selected\" type events, which is (usually) a toggle-able state. If elements are exclusive, two selection\n // events will be sent in short order as the previously selected element has to be de-selected first\n this.parent.emit(\"element_selection\", { element: element, active: toggle }, true);\n }\n return this;\n \n};\n\n/**\n * Toggle a status on elements in the data layer based on a set of filters\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setElementStatusByFilters()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; } else { toggle = !!toggle; }\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n if (!Array.isArray(filters)){ filters = []; }\n\n // Enforce exclusivity (force all elements to have the opposite of toggle first)\n if (exclusive){\n this.setAllElementStatus(status, !toggle);\n }\n \n // Apply statuses\n this.filterElements(filters).forEach(function(element){\n this.setElementStatus(status, element, toggle);\n }.bind(this));\n \n return this;\n};\n\n/**\n * Toggle a status on all elements in the data layer\n * @param {String} status\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.setAllElementStatus = function(status, toggle){\n \n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Apply statuses\n if (toggle){\n this.data.forEach(function(element){\n this.setElementStatus(status, element, true);\n }.bind(this));\n } else {\n var status_ids = this.state[this.state_id][status].slice();\n status_ids.forEach(function(id){\n var element = this.getElementById(id);\n if (typeof element == \"object\" && element !== null){\n this.setElementStatus(status, element, false);\n }\n }.bind(this));\n this.state[this.state_id][status] = [];\n }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n return this;\n};\n\n/**\n * Apply all layout-defined behaviors (DOM event handlers) to a selection of elements\n * @param {d3.selection} selection\n */\nLocusZoom.DataLayer.prototype.applyBehaviors = function(selection){\n if (typeof this.layout.behaviors != \"object\"){ return; }\n Object.keys(this.layout.behaviors).forEach(function(directive){\n var event_match = /(click|mouseover|mouseout)/.exec(directive);\n if (!event_match){ return; }\n selection.on(event_match[0] + \".\" + directive, this.executeBehaviors(directive, this.layout.behaviors[directive]));\n }.bind(this));\n};\n\n/**\n * Generate a function that executes an arbitrary list of behaviors on an element during an event\n * @param {String} directive The name of the event, as described in layout.behaviors for this datalayer\n * @param {Object} behaviors An object describing the behavior to attach to this single element\n * @param {string} behaviors.action The name of the action that would trigger this behavior (eg click, mouseover, etc)\n * @param {string} behaviors.status What status to apply to the element when this behavior is triggered (highlighted,\n * selected, etc)\n * @param {string} [behaviors.exclusive] Whether triggering the event for this element should unset the relevant status\n * for all other elements. Useful for, eg, click events that exclusively highlight one thing.\n * @returns {function(this:LocusZoom.DataLayer)} Return a function that handles the event in context with the behavior\n * and the element- can be attached as an event listener\n */\nLocusZoom.DataLayer.prototype.executeBehaviors = function(directive, behaviors) {\n\n // Determine the required state of control and shift keys during the event\n var requiredKeyStates = {\n \"ctrl\": (directive.indexOf(\"ctrl\") !== -1),\n \"shift\": (directive.indexOf(\"shift\") !== -1)\n };\n\n return function(element){\n\n // Do nothing if the required control and shift key presses (or lack thereof) doesn't match the event\n if (requiredKeyStates.ctrl !== !!d3.event.ctrlKey || requiredKeyStates.shift !== !!d3.event.shiftKey){ return; }\n\n // Loop through behaviors making each one go in succession\n behaviors.forEach(function(behavior){\n \n // Route first by the action, if defined\n if (typeof behavior != \"object\" || behavior === null){ return; }\n \n switch (behavior.action){\n \n // Set a status (set to true regardless of current status, optionally with exclusivity)\n case \"set\":\n this.setElementStatus(behavior.status, element, true, behavior.exclusive);\n break;\n \n // Unset a status (set to false regardless of current status, optionally with exclusivity)\n case \"unset\":\n this.setElementStatus(behavior.status, element, false, behavior.exclusive);\n break;\n \n // Toggle a status\n case \"toggle\":\n var current_status_boolean = (this.state[this.state_id][behavior.status].indexOf(this.getElementId(element)) !== -1);\n var exclusive = behavior.exclusive && !current_status_boolean;\n this.setElementStatus(behavior.status, element, !current_status_boolean, exclusive);\n break;\n \n // Link to a dynamic URL\n case \"link\":\n if (typeof behavior.href == \"string\"){\n var url = LocusZoom.parseFields(element, behavior.href);\n if (typeof behavior.target == \"string\"){\n window.open(url, behavior.target);\n } else {\n window.location.href = url;\n }\n }\n break;\n \n // Action not defined, just return\n default:\n break;\n \n }\n \n return;\n \n }.bind(this));\n\n }.bind(this);\n\n};\n\n/**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\nLocusZoom.DataLayer.prototype.getPageOrigin = function(){\n var panel_origin = this.parent.getPageOrigin();\n return {\n x: panel_origin.x + this.parent.layout.margin.left,\n y: panel_origin.y + this.parent.layout.margin.top\n };\n};\n\n/**\n * Get a data layer's current underlying data in a standard format (e.g. JSON or CSV)\n * @param {('csv'|'tsv'|'json')} format How to export the data\n * @returns {*}\n */\nLocusZoom.DataLayer.prototype.exportData = function(format){\n var default_format = \"json\";\n format = format || default_format;\n format = (typeof format == \"string\" ? format.toLowerCase() : default_format);\n if ([\"json\",\"csv\",\"tsv\"].indexOf(format) === -1){ format = default_format; }\n var ret;\n switch (format){\n case \"json\":\n try {\n ret = JSON.stringify(this.data);\n } catch (e){\n ret = null;\n console.error(\"Unable to export JSON data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n case \"tsv\":\n case \"csv\":\n try {\n var jsonified = JSON.parse(JSON.stringify(this.data));\n if (typeof jsonified != \"object\"){\n ret = jsonified.toString();\n } else if (!Array.isArray(jsonified)){\n ret = \"Object\";\n } else {\n var delimiter = (format === \"tsv\") ? \"\\t\" : \",\";\n var header = this.layout.fields.map(function(header){\n return JSON.stringify(header);\n }).join(delimiter) + \"\\n\";\n ret = header + jsonified.map(function(record){\n return this.layout.fields.map(function(field){\n if (typeof record[field] == \"undefined\"){\n return JSON.stringify(null);\n } else if (typeof record[field] == \"object\" && record[field] !== null){\n return Array.isArray(record[field]) ? \"\\\"[Array(\" + record[field].length + \")]\\\"\" : \"\\\"[Object]\\\"\";\n } else {\n return JSON.stringify(record[field]);\n }\n }).join(delimiter);\n }.bind(this)).join(\"\\n\");\n }\n } catch (e){\n ret = null;\n console.error(\"Unable to export CSV data from data layer: \" + this.getBaseId() + \";\", e);\n }\n break;\n }\n return ret;\n};\n\n/**\n * Position the datalayer and all tooltips\n * @returns {LocusZoom.DataLayer}\n */\nLocusZoom.DataLayer.prototype.draw = function(){\n this.svg.container.attr(\"transform\", \"translate(\" + this.parent.layout.cliparea.origin.x + \",\" + this.parent.layout.cliparea.origin.y + \")\");\n this.svg.clipRect\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.parent.layout.cliparea.height);\n this.positionAllTooltips();\n return this;\n};\n\n\n/**\n * Re-Map a data layer to reflect changes in the state of a plot (such as viewing region/ chromosome range)\n * @return {Promise}\n */\nLocusZoom.DataLayer.prototype.reMap = function(){\n\n this.destroyAllTooltips(); // hack - only non-visible tooltips should be destroyed\n // and then recreated if returning to visibility\n\n // Fetch new data. Datalayers are only given access to the final consolidated data from the chain (not headers or raw payloads)\n var promise = this.parent_plot.lzd.getData(this.state, this.layout.fields);\n promise.then(function(new_data) {\n this.data = new_data.body;\n this.applyDataMethods();\n this.initialized = true;\n }.bind(this));\n\n return promise;\n};\n\n\n/**\n * The central registry of known data layer definitions (which may be stored in separate files due to length)\n * @namespace\n */\nLocusZoom.DataLayers = (function() {\n var obj = {};\n var datalayers = {};\n /**\n * @name LocusZoom.DataLayers.get\n * @param {String} name The name of the datalayer\n * @param {Object} layout The configuration object for this data layer\n * @param {LocusZoom.DataLayer|LocusZoom.Panel} parent Where this layout is used\n * @returns {LocusZoom.DataLayer}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (datalayers[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for data layer [\" + name + \"]\");\n } else {\n return new datalayers[name](layout, parent);\n }\n } else {\n throw(\"data layer [\" + name + \"] not found\");\n }\n };\n\n /**\n * @name LocusZoom.DataLayers.set\n * @protected\n * @param {String} name\n * @param {Function} datalayer Constructor for the datalayer\n */\n obj.set = function(name, datalayer) {\n if (datalayer) {\n if (typeof datalayer != \"function\"){\n throw(\"unable to set data layer [\" + name + \"], argument provided is not a function\");\n } else {\n datalayers[name] = datalayer;\n datalayers[name].prototype = new LocusZoom.DataLayer();\n }\n } else {\n delete datalayers[name];\n }\n };\n\n /**\n * Add a new type of datalayer to the registry of known layer types\n * @name LocusZoom.DataLayers.add\n * @param {String} name The name of the data layer to register\n * @param {Function} datalayer\n */\n obj.add = function(name, datalayer) {\n if (datalayers[name]) {\n throw(\"data layer already exists with name: \" + name);\n } else {\n obj.set(name, datalayer);\n }\n };\n\n /**\n * Register a new datalayer that inherits and extends basic behaviors from a known datalayer\n * @param {String} parent_name The name of the parent data layer whose behavior is to be extended\n * @param {String} name The name of the new datalayer to register\n * @param {Object} [overrides] Object of properties and methods to combine with the prototype of the parent datalayer\n * @returns {Function} The constructor for the new child class\n */\n obj.extend = function(parent_name, name, overrides) {\n // TODO: Consider exposing additional constructor argument, if there is a use case for very granular extension\n overrides = overrides || {};\n\n var parent = datalayers[parent_name];\n if (!parent) {\n throw \"Attempted to subclass an unknown or unregistered datalayer type\";\n }\n if (typeof overrides !== \"object\") {\n throw \"Must specify an object of properties and methods\";\n }\n var child = LocusZoom.subclass(parent, overrides);\n // Bypass .set() because we want a layer of inheritance below `DataLayer`\n datalayers[name] = child;\n return child;\n };\n\n /**\n * List the names of all known datalayers\n * @name LocusZoom.DataLayers.list\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(datalayers);\n };\n\n return obj;\n})();\n","\"use strict\";\n\n/**\n * Create a single continuous 2D track that provides information about each datapoint\n *\n * For example, this can be used to color by membership in a group, alongside information in other panels\n *\n * @class LocusZoom.DataLayers.annotation_track\n * @augments LocusZoom.DataLayer\n * @param {Object} layout\n * @param {Object|String} [layout.color]\n * @param {Array[]} An array of filter entries specifying which points to draw annotations for.\n * See `LocusZoom.DataLayer.filter` for details\n */\nLocusZoom.DataLayers.add(\"annotation_track\", function(layout) {\n // In the future we may add additional options for controlling marker size/ shape, based on user feedback\n this.DefaultLayout = {\n color: \"#000000\",\n filters: []\n };\n\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n if (!Array.isArray(layout.filters)) {\n throw \"Annotation track must specify array of filters for selecting points to annotate\";\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n this.render = function() {\n var self = this;\n // Only render points that currently satisfy all provided filter conditions.\n var trackData = this.filter(this.layout.filters, \"elements\");\n\n var selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-\" + self.layout.type)\n .data(trackData, function(d) { return d[self.layout.id_field]; });\n\n // Add new elements as needed\n selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function (d){ return self.getElementId(d); });\n // Update the set of elements to reflect new data\n selection\n .attr(\"x\", function (d) { return self.parent[\"x_scale\"](d[self.layout.x_axis.field]); })\n .attr(\"width\", 1) // TODO autocalc width of track? Based on datarange / pixel width presumably\n .attr(\"height\", self.parent.layout.height)\n .attr(\"fill\", function(d){ return self.resolveScalableParameter(self.layout.color, d); });\n // Remove unused elements\n selection.exit().remove();\n\n // Set up tooltips and mouse interaction\n this.applyBehaviors(selection);\n };\n\n // Reimplement the positionTooltip() method to be annotation-specific\n this.positionTooltip = function(id) {\n if (typeof id != \"string\") {\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]) {\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var offset = stroke_width / 2;\n var page_origin = this.getPageOrigin();\n\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_center = data_layer_height / 2;\n\n // Tooltip should be horizontally centered above the point to be annotated. (or below if space is limited)\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width) + offset_left - offset_right - offset;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - y_center) {\n top = page_origin.y + y_center - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow) {\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n return this;\n});\n","\"use strict\";\n\n/*********************\n Forest Data Layer\n Implements a standard forest plot\n*/\n\nLocusZoom.DataLayers.add(\"forest\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"square\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 2\n },\n id_field: \"id\",\n confidence_intervals: {\n start_field: \"ci_start\",\n end_field: \"ci_end\"\n },\n show_no_significance_line: true\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be forest-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n var offset = Math.sqrt(point_size / Math.PI);\n var left, arrow_type, arrow_left;\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var top, arrow_top;\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n } \n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Implement the main render function\n this.render = function(){\n\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate confidence interval paths if fields are defined\n if (this.layout.confidence_intervals\n && this.layout.fields.indexOf(this.layout.confidence_intervals.start_field) !== -1\n && this.layout.fields.indexOf(this.layout.confidence_intervals.end_field) !== -1){\n // Generate a selection for all forest plot confidence intervals\n var ci_selection = this.svg.group\n .selectAll(\"rect.lz-data_layer-forest.lz-data_layer-forest-ci\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n // Create confidence interval rect elements\n ci_selection.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-ci\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_ci\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + (isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height) + \")\");\n // Apply position and size parameters using transition if necessary\n var ci_transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n var ci_width = function(d){\n return this.parent[x_scale](d[this.layout.confidence_intervals.end_field])\n - this.parent[x_scale](d[this.layout.confidence_intervals.start_field]);\n }.bind(this);\n var ci_height = 1;\n if (this.canTransition()){\n ci_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n } else {\n ci_selection\n .attr(\"transform\", ci_transform)\n .attr(\"width\", ci_width).attr(\"height\", ci_height);\n }\n // Remove old elements as needed\n ci_selection.exit().remove();\n }\n \n // Generate a selection for all forest plot points\n var points_selection = this.svg.group\n .selectAll(\"path.lz-data_layer-forest.lz-data_layer-forest-point\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n points_selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-forest lz-data_layer-forest-point\")\n .attr(\"id\", function(d){ return this.getElementId(d) + \"_point\"; }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n if (this.canTransition()){\n points_selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n points_selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n points_selection.exit().remove();\n\n // Apply default event emitters to selection\n points_selection.on(\"click.event_emitter\", function(element_data){\n this.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n \n // Apply behaviors to points\n this.applyBehaviors(points_selection);\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Genes Data Layer\n * Implements a data layer that will render gene tracks\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"genes\", function(layout){\n /**\n * Define a default layout for this DataLayer type and merge it with the passed argument\n * @protected\n * @member {Object}\n * */\n this.DefaultLayout = {\n // Optionally specify different fill and stroke properties\n stroke: \"rgb(54, 54, 150)\",\n color: \"#363696\",\n label_font_size: 12,\n label_exon_spacing: 4,\n exon_height: 16,\n bounding_box_padding: 6,\n track_vertical_spacing: 10\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Generate a statusnode ID for a given element\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n return this.getElementId(element) + \"-statusnode\";\n };\n\n /**\n * Helper function to sum layout values to derive total height for a single gene track\n * @returns {number}\n */\n this.getTrackHeight = function(){\n return 2 * this.layout.bounding_box_padding\n + this.layout.label_font_size\n + this.layout.label_exon_spacing\n + this.layout.exon_height\n + this.layout.track_vertical_spacing;\n };\n\n /**\n * A gene may have arbitrarily many transcripts, but this data layer isn't set up to render them yet.\n * Stash a transcript_idx to point to the first transcript and use that for all transcript refs.\n * @member {number}\n * @type {number}\n */\n this.transcript_idx = 0;\n\n /**\n * An internal counter for the number of tracks in the data layer. Used as an internal counter for looping\n * over positions / assignments\n * @protected\n * @member {number}\n */\n this.tracks = 1;\n\n /**\n * Store information about genes in dataset, in a hash indexed by track number: {track_number: [gene_indices]}\n * @member {Object.}\n */\n this.gene_track_index = { 1: [] };\n\n /**\n * Ensure that genes in overlapping chromosome regions are positioned so that parts of different genes do not\n * overlap in the view. A track is a row used to vertically separate overlapping genes.\n * @returns {LocusZoom.DataLayer}\n */\n this.assignTracks = function(){\n /**\n * Function to get the width in pixels of a label given the text and layout attributes\n * TODO: Move to outer scope?\n * @param {String} gene_name\n * @param {number|string} font_size\n * @returns {number}\n */\n this.getLabelWidth = function(gene_name, font_size){\n try {\n var temp_text = this.svg.group.append(\"text\")\n .attr(\"x\", 0).attr(\"y\", 0).attr(\"class\", \"lz-data_layer-genes lz-label\")\n .style(\"font-size\", font_size)\n .text(gene_name + \"→\");\n var label_width = temp_text.node().getBBox().width;\n temp_text.remove();\n return label_width;\n } catch (e){\n return 0;\n }\n };\n\n // Reinitialize some metadata\n this.tracks = 1;\n this.gene_track_index = { 1: [] };\n\n this.data.map(function(d, g){\n\n // If necessary, split combined gene id / version fields into discrete fields.\n // NOTE: this may be an issue with CSG's genes data source that may eventually be solved upstream.\n if (this.data[g].gene_id && this.data[g].gene_id.indexOf(\".\")){\n var split = this.data[g].gene_id.split(\".\");\n this.data[g].gene_id = split[0];\n this.data[g].gene_version = split[1];\n }\n\n // Stash the transcript ID on the parent gene\n this.data[g].transcript_id = this.data[g].transcripts[this.transcript_idx].transcript_id;\n\n // Determine display range start and end, based on minimum allowable gene display width, bounded by what we can see\n // (range: values in terms of pixels on the screen)\n this.data[g].display_range = {\n start: this.parent.x_scale(Math.max(d.start, this.state.start)),\n end: this.parent.x_scale(Math.min(d.end, this.state.end))\n };\n this.data[g].display_range.label_width = this.getLabelWidth(this.data[g].gene_name, this.layout.label_font_size);\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n // Determine label text anchor (default to middle)\n this.data[g].display_range.text_anchor = \"middle\";\n if (this.data[g].display_range.width < this.data[g].display_range.label_width){\n if (d.start < this.state.start){\n this.data[g].display_range.end = this.data[g].display_range.start\n + this.data[g].display_range.label_width\n + this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"start\";\n } else if (d.end > this.state.end){\n this.data[g].display_range.start = this.data[g].display_range.end\n - this.data[g].display_range.label_width\n - this.layout.label_font_size;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n var centered_margin = ((this.data[g].display_range.label_width - this.data[g].display_range.width) / 2)\n + this.layout.label_font_size;\n if ((this.data[g].display_range.start - centered_margin) < this.parent.x_scale(this.state.start)){\n this.data[g].display_range.start = this.parent.x_scale(this.state.start);\n this.data[g].display_range.end = this.data[g].display_range.start + this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"start\";\n } else if ((this.data[g].display_range.end + centered_margin) > this.parent.x_scale(this.state.end)) {\n this.data[g].display_range.end = this.parent.x_scale(this.state.end);\n this.data[g].display_range.start = this.data[g].display_range.end - this.data[g].display_range.label_width;\n this.data[g].display_range.text_anchor = \"end\";\n } else {\n this.data[g].display_range.start -= centered_margin;\n this.data[g].display_range.end += centered_margin;\n }\n }\n this.data[g].display_range.width = this.data[g].display_range.end - this.data[g].display_range.start;\n }\n // Add bounding box padding to the calculated display range start, end, and width\n this.data[g].display_range.start -= this.layout.bounding_box_padding;\n this.data[g].display_range.end += this.layout.bounding_box_padding;\n this.data[g].display_range.width += 2 * this.layout.bounding_box_padding;\n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[g].display_domain = {\n start: this.parent.x_scale.invert(this.data[g].display_range.start),\n end: this.parent.x_scale.invert(this.data[g].display_range.end)\n };\n this.data[g].display_domain.width = this.data[g].display_domain.end - this.data[g].display_domain.start;\n\n // Using display range/domain data generated above cast each gene to tracks such that none overlap\n this.data[g].track = null;\n var potential_track = 1;\n while (this.data[g].track === null){\n var collision_on_potential_track = false;\n this.gene_track_index[potential_track].map(function(placed_gene){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_gene.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_gene.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_gene.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[g]));\n if (!collision_on_potential_track){\n this.data[g].track = potential_track;\n this.gene_track_index[potential_track].push(this.data[g]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.gene_track_index[potential_track] = [];\n }\n }\n }\n\n // Stash parent references on all genes, trascripts, and exons\n this.data[g].parent = this;\n this.data[g].transcripts.map(function(d, t){\n this.data[g].transcripts[t].parent = this.data[g];\n this.data[g].transcripts[t].exons.map(function(d, e){\n this.data[g].transcripts[t].exons[e].parent = this.data[g].transcripts[t];\n }.bind(this));\n }.bind(this));\n\n }.bind(this));\n return this;\n };\n\n /**\n * Main render function\n */\n this.render = function(){\n\n var self = this;\n this.assignTracks();\n\n var width, height, x, y;\n\n // Render gene groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-genes\")\n .data(this.data, function(d){ return d.gene_name; });\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-genes\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(gene){\n\n var data_layer = gene.parent;\n\n // Render gene bounding boxes (status nodes to show selected/highlighted)\n var bboxes = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-data_layer-genes-statusnode\")\n .data([gene], function(d){ return data_layer.getElementStatusNodeId(d); });\n\n bboxes.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-data_layer-genes-statusnode\");\n \n bboxes\n .attr(\"id\", function(d){\n return data_layer.getElementStatusNodeId(d);\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n bboxes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n bboxes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n bboxes.exit().remove();\n\n // Render gene boundaries\n var boundary_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d); };\n var boundary_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d); };\n var boundaries = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-boundary\")\n .data([gene], function(d){ return d.gene_name + \"_boundary\"; })\n .style({ fill: boundary_fill, stroke: boundary_stroke });\n\n boundaries.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-boundary\");\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return 1; // TODO: scale dynamically?\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing\n + (Math.max(data_layer.layout.exon_height, 3) / 2);\n };\n if (data_layer.canTransition()){\n boundaries\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n boundaries\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n \n boundaries.exit().remove();\n\n // Render gene labels\n var labels = d3.select(this).selectAll(\"text.lz-data_layer-genes.lz-label\")\n .data([gene], function(d){ return d.gene_name + \"_label\"; });\n\n labels.enter().append(\"text\")\n .attr(\"class\", \"lz-data_layer-genes lz-label\");\n\n labels\n .attr(\"text-anchor\", function(d){\n return d.display_range.text_anchor;\n })\n .text(function(d){\n return (d.strand === \"+\") ? d.gene_name + \"→\" : \"←\" + d.gene_name;\n })\n .style(\"font-size\", gene.parent.layout.label_font_size);\n\n x = function(d){\n if (d.display_range.text_anchor === \"middle\"){\n return d.display_range.start + (d.display_range.width / 2);\n } else if (d.display_range.text_anchor === \"start\"){\n return d.display_range.start + data_layer.layout.bounding_box_padding;\n } else if (d.display_range.text_anchor === \"end\"){\n return d.display_range.end - data_layer.layout.bounding_box_padding;\n }\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size;\n };\n if (data_layer.canTransition()){\n labels\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"x\", x).attr(\"y\", y);\n } else {\n labels\n .attr(\"x\", x).attr(\"y\", y);\n }\n\n labels.exit().remove();\n\n // Render exon rects (first transcript only, for now)\n // Exons: by default color on gene properties for consistency with the gene boundary track- hence color uses d.parent.parent\n var exon_fill = function(d){ return self.resolveScalableParameter(self.layout.color, d.parent.parent); };\n var exon_stroke = function(d){ return self.resolveScalableParameter(self.layout.stroke, d.parent.parent); };\n\n var exons = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-exon\")\n .data(gene.transcripts[gene.parent.transcript_idx].exons, function(d){ return d.exon_id; });\n\n exons.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-exon\");\n\n exons\n .style({ fill: exon_fill, stroke: exon_stroke });\n\n width = function(d){\n return data_layer.parent.x_scale(d.end) - data_layer.parent.x_scale(d.start);\n };\n height = function(){\n return data_layer.layout.exon_height;\n };\n x = function(d){\n return data_layer.parent.x_scale(d.start);\n };\n y = function(){\n return ((gene.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding\n + data_layer.layout.label_font_size\n + data_layer.layout.label_exon_spacing;\n };\n if (data_layer.canTransition()){\n exons\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n exons\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n exons.exit().remove();\n\n // Render gene click area\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-genes.lz-clickarea\")\n .data([gene], function(d){ return d.gene_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genes lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click.event_emitter\", function(element){\n element.parent.parent.emit(\"element_clicked\", element, true);\n });\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n };\n\n /**\n * Reimplement the positionTooltip() method to be gene-specific\n * @param {String} id\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var gene_bbox_id = this.getElementStatusNodeId(tooltip.data);\n var gene_bbox = d3.select(\"#\" + gene_bbox_id).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the gene that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var gene_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - gene_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + gene_center_x - data_layer_width, 0);\n var left = page_origin.x + gene_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the gene unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (gene_bbox.y + gene_bbox.height)){\n top = page_origin.y + gene_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + gene_bbox.y + gene_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Genome Legend Data Layer\n Implements a data layer that will render a genome legend\n*/\n\n// Build a custom data layer for a genome legend\nLocusZoom.DataLayers.add(\"genome_legend\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n chromosome_fill_colors: {\n light: \"rgb(155, 155, 188)\",\n dark: \"rgb(95, 95, 128)\"\n },\n chromosome_label_colors: {\n light: \"rgb(120, 120, 186)\",\n dark: \"rgb(0, 0, 66)\"\n }\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Implement the main render function\n this.render = function(){\n\n // Iterate over data to generate genome-wide start/end values for each chromosome\n var position = 0;\n this.data.forEach(function(d, i){\n this.data[i].genome_start = position;\n this.data[i].genome_end = position + d[\"genome:base_pairs\"];\n position += d[\"genome:base_pairs\"];\n }.bind(this));\n\n var chromosomes = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend\")\n .data(this.data, function(d){ return d[\"genome:chr\"]; });\n\n // Create chromosome elements, apply class\n chromosomes.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend\");\n\n // Position and fill chromosome rects\n var data_layer = this;\n var panel = this.parent;\n\n chromosomes\n .attr(\"fill\", function(d){ return (d[\"genome:chr\"] % 2 ? data_layer.layout.chromosome_fill_colors.light : data_layer.layout.chromosome_fill_colors.dark); })\n .attr(\"x\", function(d){ return panel.x_scale(d.genome_start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d[\"genome:base_pairs\"]); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n // Remove old elements as needed\n chromosomes.exit().remove();\n\n // Parse current state variant into a position\n // Assumes that variant string is of the format 10:123352136_C/T or 10:123352136\n var variant_parts = /([^:]+):(\\d+)(?:_.*)?/.exec(this.state.variant);\n if (!variant_parts) {\n throw(\"Genome legend cannot understand the specified variant position\");\n }\n var chr = variant_parts[1];\n var offset = variant_parts[2];\n // TODO: How does this handle representation of X or Y chromosomes?\n position = +this.data[chr-1].genome_start + +offset;\n\n // Render the position\n var region = this.svg.group\n .selectAll(\"rect.lz-data_layer-genome_legend-marker\")\n .data([{ start: position, end: position + 1 }]);\n\n region.enter()\n .append(\"rect\")\n .attr(\"class\", \"lz-data_layer-genome_legend-marker\");\n\n region\n .transition()\n .duration(500)\n .style({\n \"fill\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke\": \"rgba(255, 250, 50, 0.8)\",\n \"stroke-width\": \"3px\"\n })\n .attr(\"x\", function(d){ return panel.x_scale(d.start); })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return panel.x_scale(d.end - d.start); })\n .attr(\"height\", panel.layout.cliparea.height);\n\n region.exit().remove();\n \n };\n \n return this;\n\n});\n","\"use strict\";\n\n/**\n * Intervals Data Layer\n * Implements a data layer that will render interval annotation tracks (intervals must provide start and end values)\n * @class LocusZoom.DataLayers.intervals\n * @augments LocusZoom.DataLayer\n */\nLocusZoom.DataLayers.add(\"intervals\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n start_field: \"start\",\n end_field: \"end\",\n track_split_field: \"state_id\",\n track_split_order: \"DESC\",\n track_split_legend_to_y_axis: 2,\n split_tracks: true,\n track_height: 15,\n track_vertical_spacing: 3,\n bounding_box_padding: 2,\n always_hide_legend: false,\n color: \"#B8B8B8\",\n fill_opacity: 1\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n \n /**\n * To define shared highlighting on the track split field define the status node id override\n * to generate an ID common to the track when we're actively splitting data out to separate tracks\n * @override\n * @returns {String}\n */\n this.getElementStatusNodeId = function(element){\n if (this.layout.split_tracks){\n return (this.getBaseId() + \"-statusnode-\" + element[this.layout.track_split_field]).replace(/[:.[\\],]/g, \"_\");\n }\n return this.getElementId(element) + \"-statusnode\";\n }.bind(this);\n \n // Helper function to sum layout values to derive total height for a single interval track\n this.getTrackHeight = function(){\n return this.layout.track_height\n + this.layout.track_vertical_spacing\n + (2 * this.layout.bounding_box_padding);\n };\n\n this.tracks = 1;\n this.previous_tracks = 1;\n \n // track-number-indexed object with arrays of interval indexes in the dataset\n this.interval_track_index = { 1: [] };\n\n // After we've loaded interval data interpret it to assign\n // each to a track so that they do not overlap in the view\n this.assignTracks = function(){\n\n // Reinitialize some metadata\n this.previous_tracks = this.tracks;\n this.tracks = 0;\n this.interval_track_index = { 1: [] };\n this.track_split_field_index = {};\n \n // If splitting tracks by a field's value then do a first pass determine\n // a value/track mapping that preserves the order of possible values\n if (this.layout.track_split_field && this.layout.split_tracks){\n this.data.map(function(d){\n this.track_split_field_index[d[this.layout.track_split_field]] = null;\n }.bind(this));\n var index = Object.keys(this.track_split_field_index);\n if (this.layout.track_split_order === \"DESC\"){ index.reverse(); }\n index.forEach(function(val){\n this.track_split_field_index[val] = this.tracks + 1;\n this.interval_track_index[this.tracks + 1] = [];\n this.tracks++;\n }.bind(this));\n }\n\n this.data.map(function(d, i){\n\n // Stash a parent reference on the interval\n this.data[i].parent = this;\n\n // Determine display range start and end, based on minimum allowable interval display width,\n // bounded by what we can see (range: values in terms of pixels on the screen)\n this.data[i].display_range = {\n start: this.parent.x_scale(Math.max(d[this.layout.start_field], this.state.start)),\n end: this.parent.x_scale(Math.min(d[this.layout.end_field], this.state.end))\n };\n this.data[i].display_range.width = this.data[i].display_range.end - this.data[i].display_range.start;\n \n // Convert and stash display range values into domain values\n // (domain: values in terms of the data set, e.g. megabases)\n this.data[i].display_domain = {\n start: this.parent.x_scale.invert(this.data[i].display_range.start),\n end: this.parent.x_scale.invert(this.data[i].display_range.end)\n };\n this.data[i].display_domain.width = this.data[i].display_domain.end - this.data[i].display_domain.start;\n\n // If splitting to tracks based on the value of the designated track split field\n // then don't bother with collision detection (intervals will be grouped on tracks\n // solely by the value of track_split_field)\n if (this.layout.track_split_field && this.layout.split_tracks){\n var val = this.data[i][this.layout.track_split_field];\n this.data[i].track = this.track_split_field_index[val];\n this.interval_track_index[this.data[i].track].push(i);\n } else {\n // If not splitting to tracks based on a field value then do so based on collision\n // detection (as how it's done for genes). Use display range/domain data generated\n // above and cast each interval to tracks such that none overlap\n this.tracks = 1;\n this.data[i].track = null;\n var potential_track = 1;\n while (this.data[i].track === null){\n var collision_on_potential_track = false;\n this.interval_track_index[potential_track].map(function(placed_interval){\n if (!collision_on_potential_track){\n var min_start = Math.min(placed_interval.display_range.start, this.display_range.start);\n var max_end = Math.max(placed_interval.display_range.end, this.display_range.end);\n if ((max_end - min_start) < (placed_interval.display_range.width + this.display_range.width)){\n collision_on_potential_track = true;\n }\n }\n }.bind(this.data[i]));\n if (!collision_on_potential_track){\n this.data[i].track = potential_track;\n this.interval_track_index[potential_track].push(this.data[i]);\n } else {\n potential_track++;\n if (potential_track > this.tracks){\n this.tracks = potential_track;\n this.interval_track_index[potential_track] = [];\n }\n }\n }\n\n }\n\n }.bind(this));\n\n return this;\n };\n\n // Implement the main render function\n this.render = function(){\n\n this.assignTracks();\n\n // Remove any shared highlight nodes and re-render them if we're splitting on tracks\n // At most there will only be dozen or so nodes here (one per track) and each time\n // we render data we may have new tracks, so wiping/redrawing all is reasonable.\n this.svg.group.selectAll(\".lz-data_layer-intervals-statusnode.lz-data_layer-intervals-shared\").remove();\n Object.keys(this.track_split_field_index).forEach(function(key){\n // Make a psuedo-element so that we can generate an id for the shared node\n var psuedoElement = {};\n psuedoElement[this.layout.track_split_field] = key;\n // Insert the shared node\n var sharedstatusnode_style = {display: (this.layout.split_tracks ? null : \"none\")};\n this.svg.group.insert(\"rect\", \":first-child\")\n .attr(\"id\", this.getElementStatusNodeId(psuedoElement))\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-shared\")\n .attr(\"rx\", this.layout.bounding_box_padding).attr(\"ry\", this.layout.bounding_box_padding)\n .attr(\"width\", this.parent.layout.cliparea.width)\n .attr(\"height\", this.getTrackHeight() - this.layout.track_vertical_spacing)\n .attr(\"x\", 0)\n .attr(\"y\", (this.track_split_field_index[key]-1) * this.getTrackHeight())\n .style(sharedstatusnode_style);\n }.bind(this));\n\n var width, height, x, y, fill, fill_opacity;\n \n // Render interval groups\n var selection = this.svg.group.selectAll(\"g.lz-data_layer-intervals\")\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n selection.enter().append(\"g\")\n .attr(\"class\", \"lz-data_layer-intervals\");\n \n selection.attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .each(function(interval){\n\n var data_layer = interval.parent;\n\n // Render interval status nodes (displayed behind intervals to show highlight\n // without needing to modify interval display element(s))\n var statusnode_style = {display: (data_layer.layout.split_tracks ? \"none\" : null)};\n var statusnodes = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-data_layer-intervals-statusnode.lz-data_layer-intervals-statusnode-discrete\")\n .data([interval], function(d){ return data_layer.getElementId(d) + \"-statusnode\"; });\n statusnodes.enter().insert(\"rect\", \":first-child\")\n .attr(\"class\", \"lz-data_layer-intervals lz-data_layer-intervals-statusnode lz-data_layer-intervals-statusnode-discrete\");\n statusnodes\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"-statusnode\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .style(statusnode_style);\n width = function(d){\n return d.display_range.width + (2 * data_layer.layout.bounding_box_padding);\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start - data_layer.layout.bounding_box_padding;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n statusnodes\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n statusnodes\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n statusnodes.exit().remove();\n\n // Render primary interval rects\n var rects = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-interval_rect\")\n .data([interval], function(d){ return d[data_layer.layout.id_field] + \"_interval_rect\"; });\n\n rects.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-interval_rect\");\n\n height = data_layer.layout.track_height;\n width = function(d){\n return d.display_range.width;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight())\n + data_layer.layout.bounding_box_padding;\n };\n fill = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.color, d);\n };\n fill_opacity = function(d){\n return data_layer.resolveScalableParameter(data_layer.layout.fill_opacity, d);\n };\n \n \n if (data_layer.canTransition()){\n rects\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n } else {\n rects\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"x\", x).attr(\"y\", y)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity);\n }\n \n rects.exit().remove();\n\n // Render interval click areas\n var clickareas = d3.select(this).selectAll(\"rect.lz-data_layer-intervals.lz-clickarea\")\n .data([interval], function(d){ return d.interval_name + \"_clickarea\"; });\n\n clickareas.enter().append(\"rect\")\n .attr(\"class\", \"lz-data_layer-intervals lz-clickarea\");\n\n clickareas\n .attr(\"id\", function(d){\n return data_layer.getElementId(d) + \"_clickarea\";\n })\n .attr(\"rx\", function(){\n return data_layer.layout.bounding_box_padding;\n })\n .attr(\"ry\", function(){\n return data_layer.layout.bounding_box_padding;\n });\n\n width = function(d){\n return d.display_range.width;\n };\n height = function(){\n return data_layer.getTrackHeight() - data_layer.layout.track_vertical_spacing;\n };\n x = function(d){\n return d.display_range.start;\n };\n y = function(d){\n return ((d.track-1) * data_layer.getTrackHeight());\n };\n if (data_layer.canTransition()){\n clickareas\n .transition()\n .duration(data_layer.layout.transition.duration || 0)\n .ease(data_layer.layout.transition.ease || \"cubic-in-out\")\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n } else {\n clickareas\n .attr(\"width\", width).attr(\"height\", height).attr(\"x\", x).attr(\"y\", y);\n }\n\n // Remove old clickareas as needed\n clickareas.exit().remove();\n\n // Apply default event emitters to clickareas\n clickareas.on(\"click\", function(element_data){\n element_data.parent.parent.emit(\"element_clicked\", element_data, true);\n }.bind(this));\n\n // Apply mouse behaviors to clickareas\n data_layer.applyBehaviors(clickareas);\n\n });\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Update the legend axis if the number of ticks changed\n if (this.previous_tracks !== this.tracks){\n this.updateSplitTrackAxis();\n }\n\n return this;\n\n };\n \n // Reimplement the positionTooltip() method to be interval-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var interval_bbox = d3.select(\"#\" + this.getElementStatusNodeId(tooltip.data)).node().getBBox();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n // Position horizontally: attempt to center on the portion of the interval that's visible,\n // pad to either side if bumping up against the edge of the data layer\n var interval_center_x = ((tooltip.data.display_range.start + tooltip.data.display_range.end) / 2) - (this.layout.bounding_box_padding / 2);\n var offset_right = Math.max((tooltip_box.width / 2) - interval_center_x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + interval_center_x - data_layer_width, 0);\n var left = page_origin.x + interval_center_x - (tooltip_box.width / 2) - offset_left + offset_right;\n var arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right;\n // Position vertically below the interval unless there's insufficient space\n var top, arrow_type, arrow_top;\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (interval_bbox.y + interval_bbox.height)){\n top = page_origin.y + interval_bbox.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + interval_bbox.y + interval_bbox.height + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Redraw split track axis or hide it, and show/hide the legend, as determined\n // by current layout parameters and data\n this.updateSplitTrackAxis = function(){\n var legend_axis = this.layout.track_split_legend_to_y_axis ? \"y\" + this.layout.track_split_legend_to_y_axis : false;\n if (this.layout.split_tracks){\n var tracks = +this.tracks || 0;\n var track_height = +this.layout.track_height || 0;\n var track_spacing = 2 * (+this.layout.bounding_box_padding || 0) + (+this.layout.track_vertical_spacing || 0);\n var target_height = (tracks * track_height) + ((tracks - 1) * track_spacing);\n this.parent.scaleHeightToData(target_height);\n if (legend_axis && this.parent.legend){\n this.parent.legend.hide(); \n this.parent.layout.axes[legend_axis] = {\n render: true,\n ticks: [],\n range: {\n start: (target_height - (this.layout.track_height/2)),\n end: (this.layout.track_height/2)\n }\n };\n this.layout.legend.forEach(function(element){\n var key = element[this.layout.track_split_field];\n var track = this.track_split_field_index[key];\n if (track){\n if (this.layout.track_split_order === \"DESC\"){\n track = Math.abs(track - tracks - 1);\n }\n this.parent.layout.axes[legend_axis].ticks.push({\n y: track,\n text: element.label\n });\n }\n }.bind(this));\n this.layout.y_axis = {\n axis: this.layout.track_split_legend_to_y_axis,\n floor: 1,\n ceiling: tracks\n };\n this.parent.render();\n }\n this.parent_plot.positionPanels();\n } else {\n if (legend_axis && this.parent.legend){\n if (!this.layout.always_hide_legend){ this.parent.legend.show(); }\n this.parent.layout.axes[legend_axis] = { render: false };\n this.parent.render();\n }\n }\n return this;\n };\n\n // Method to not only toggle the split tracks boolean but also update\n // necessary display values to animate a complete merge/split\n this.toggleSplitTracks = function(){\n this.layout.split_tracks = !this.layout.split_tracks;\n if (this.parent.legend && !this.layout.always_hide_legend){\n this.parent.layout.margin.bottom = 5 + (this.layout.split_tracks ? 0 : this.parent.legend.layout.height + 5);\n }\n this.render();\n this.updateSplitTrackAxis();\n return this;\n };\n \n return this;\n\n});\n","\"use strict\";\n\n/*********************\n * Line Data Layer\n * Implements a standard line plot\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n /** @member {Object} */\n this.DefaultLayout = {\n style: {\n fill: \"none\",\n \"stroke-width\": \"2px\"\n },\n interpolate: \"linear\",\n x_axis: { field: \"x\" },\n y_axis: { field: \"y\", axis: 1 },\n hitarea_width: 5\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Var for storing mouse events for use in tool tip positioning\n /** @member {String} */\n this.mouse_event = null;\n\n /**\n * Var for storing the generated line function itself\n * @member {d3.svg.line}\n * */\n this.line = null;\n\n /**\n * The timeout identifier returned by setTimeout\n * @member {Number}\n */\n this.tooltip_timeout = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n\n /**\n * Helper function to get display and data objects representing\n * the x/y coordinates of the current mouse event with respect to the line in terms of the display\n * and the interpolated values of the x/y fields with respect to the line\n * @returns {{display: {x: *, y: null}, data: {}, slope: null}}\n */\n this.getMouseDisplayAndData = function(){\n var ret = {\n display: {\n x: d3.mouse(this.mouse_event)[0],\n y: null\n },\n data: {},\n slope: null\n };\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n ret.data[x_field] = this.parent[x_scale].invert(ret.display.x);\n var bisect = d3.bisector(function(datum) { return +datum[x_field]; }).left;\n var index = bisect(this.data, ret.data[x_field]) - 1;\n var startDatum = this.data[index];\n var endDatum = this.data[index + 1];\n var interpolate = d3.interpolateNumber(+startDatum[y_field], +endDatum[y_field]);\n var range = +endDatum[x_field] - +startDatum[x_field];\n ret.data[y_field] = interpolate((ret.data[x_field] % range) / range);\n ret.display.y = this.parent[y_scale](ret.data[y_field]);\n if (this.layout.tooltip.x_precision){\n ret.data[x_field] = ret.data[x_field].toPrecision(this.layout.tooltip.x_precision);\n }\n if (this.layout.tooltip.y_precision){\n ret.data[y_field] = ret.data[y_field].toPrecision(this.layout.tooltip.y_precision);\n }\n ret.slope = (this.parent[y_scale](endDatum[y_field]) - this.parent[y_scale](startDatum[y_field]))\n / (this.parent[x_scale](endDatum[x_field]) - this.parent[x_scale](startDatum[x_field]));\n return ret;\n };\n\n /**\n * Reimplement the positionTooltip() method to be line-specific\n * @param {String} id Identify the tooltip to be positioned\n */\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var tooltip = this.tooltips[id];\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var arrow_width = 7; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var stroke_width = parseFloat(this.layout.style[\"stroke-width\"]) || 1;\n var page_origin = this.getPageOrigin();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n var top, left, arrow_top, arrow_left, arrow_type;\n\n // Determine x/y coordinates for display and data\n var dd = this.getMouseDisplayAndData();\n\n // If the absolute value of the slope of the line at this point is above 1 (including Infinity)\n // then position the tool tip left/right. Otherwise position top/bottom.\n if (Math.abs(dd.slope) > 1){\n\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (dd.display.x <= this.parent.layout.width / 2){\n left = page_origin.x + dd.display.x + stroke_width + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + dd.display.x - tooltip_box.width - stroke_width - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n if (dd.display.y - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + dd.display.y - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (dd.display.y + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + dd.display.y + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + dd.display.y - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n\n } else {\n\n // Position horizontally: attempt to center on the mouse's x coordinate\n // pad to either side if bumping up against the edge of the data layer\n var offset_right = Math.max((tooltip_box.width / 2) - dd.display.x, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + dd.display.x - data_layer_width, 0);\n left = page_origin.x + dd.display.x - (tooltip_box.width / 2) - offset_left + offset_right;\n var min_arrow_left = arrow_width / 2;\n var max_arrow_left = tooltip_box.width - (2.5 * arrow_width);\n arrow_left = (tooltip_box.width / 2) - arrow_width + offset_left - offset_right;\n arrow_left = Math.min(Math.max(arrow_left, min_arrow_left), max_arrow_left);\n\n // Position vertically above the line unless there's insufficient space\n if (tooltip_box.height + stroke_width + arrow_width > dd.display.y){\n top = page_origin.y + dd.display.y + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n } else {\n top = page_origin.y + dd.display.y - (tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n }\n }\n\n // Apply positions to the main div\n tooltip.selector.style({ left: left + \"px\", top: top + \"px\" });\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style({ \"left\": arrow_left + \"px\", top: arrow_top + \"px\" });\n\n };\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var data_layer = this;\n var panel = this.parent;\n var x_field = this.layout.x_axis.field;\n var y_field = this.layout.y_axis.field;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Apply tooltip, etc\n if (this.layout.tooltip){\n // Generate an overlaying transparent \"hit area\" line for more intuitive mouse events\n var hitarea_width = parseFloat(this.layout.hitarea_width).toString() + \"px\";\n var hitarea = this.svg.group\n .selectAll(\"path.lz-data_layer-line-hitarea\")\n .data([this.data]);\n hitarea.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line-hitarea\")\n .style(\"stroke-width\", hitarea_width);\n var hitarea_line = d3.svg.line()\n .x(function(d) { return parseFloat(panel[x_scale](d[x_field])); })\n .y(function(d) { return parseFloat(panel[y_scale](d[y_field])); })\n .interpolate(this.layout.interpolate);\n hitarea\n .attr(\"d\", hitarea_line)\n .on(\"mouseover\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.createTooltip(dd.data);\n })\n .on(\"mousemove\", function(){\n clearTimeout(data_layer.tooltip_timeout);\n data_layer.mouse_event = this;\n var dd = data_layer.getMouseDisplayAndData();\n data_layer.updateTooltip(dd.data);\n data_layer.positionTooltip(data_layer.getElementId());\n })\n .on(\"mouseout\", function(){\n data_layer.tooltip_timeout = setTimeout(function(){\n data_layer.mouse_event = null;\n data_layer.destroyTooltip(data_layer.getElementId());\n }, 300);\n });\n hitarea.exit().remove();\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n /**\n * Redefine setElementStatus family of methods as line data layers will only ever have a single path element\n * @param {String} status A member of `LocusZoom.DataLayer.Statuses.adjectives`\n * @param {String|Object} element\n * @param {Boolean} toggle\n * @returns {LocusZoom.DataLayer}\n */\n this.setElementStatus = function(status, element, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setElementStatusByFilters = function(status, toggle){\n return this.setAllElementStatus(status, toggle);\n };\n this.setAllElementStatus = function(status, toggle){\n // Sanity check\n if (typeof status == \"undefined\" || LocusZoom.DataLayer.Statuses.adjectives.indexOf(status) === -1){\n throw(\"Invalid status passed to DataLayer.setAllElementStatus()\");\n }\n if (typeof this.state[this.state_id][status] == \"undefined\"){ return this; }\n if (typeof toggle == \"undefined\"){ toggle = true; }\n\n // Update global status flag\n this.global_statuses[status] = toggle;\n\n // Apply class to path based on global status flags\n var path_class = \"lz-data_layer-line\";\n Object.keys(this.global_statuses).forEach(function(global_status){\n if (this.global_statuses[global_status]){ path_class += \" lz-data_layer-line-\" + global_status; }\n }.bind(this));\n this.path.attr(\"class\", path_class);\n\n // Trigger layout changed event hook\n this.parent.emit(\"layout_changed\", true);\n return this;\n };\n\n return this;\n\n});\n\n\n/***************************\n * Orthogonal Line Data Layer\n * Implements a horizontal or vertical line given an orientation and an offset in the layout\n * Does not require a data source\n * @class\n * @augments LocusZoom.DataLayer\n*/\nLocusZoom.DataLayers.add(\"orthogonal_line\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n style: {\n \"stroke\": \"#D3D3D3\",\n \"stroke-width\": \"3px\",\n \"stroke-dasharray\": \"10px 10px\"\n },\n orientation: \"horizontal\",\n x_axis: {\n axis: 1,\n decoupled: true\n },\n y_axis: {\n axis: 1,\n decoupled: true\n },\n offset: 0\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Require that orientation be \"horizontal\" or \"vertical\" only\n if ([\"horizontal\",\"vertical\"].indexOf(layout.orientation) === -1){\n layout.orientation = \"horizontal\";\n }\n\n // Vars for storing the data generated line\n /** @member {Array} */\n this.data = [];\n /** @member {d3.svg.line} */\n this.line = null;\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n /**\n * Implement the main render function\n */\n this.render = function(){\n\n // Several vars needed to be in scope\n var panel = this.parent;\n var x_scale = \"x_scale\";\n var y_scale = \"y\" + this.layout.y_axis.axis + \"_scale\";\n var x_extent = \"x_extent\";\n var y_extent = \"y\" + this.layout.y_axis.axis + \"_extent\";\n var x_range = \"x_range\";\n var y_range = \"y\" + this.layout.y_axis.axis + \"_range\";\n\n // Generate data using extents depending on orientation\n if (this.layout.orientation === \"horizontal\"){\n this.data = [\n { x: panel[x_extent][0], y: this.layout.offset },\n { x: panel[x_extent][1], y: this.layout.offset }\n ];\n } else {\n this.data = [\n { x: this.layout.offset, y: panel[y_extent][0] },\n { x: this.layout.offset, y: panel[y_extent][1] }\n ];\n }\n\n // Join data to the line selection\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-line\")\n .data([this.data]);\n\n // Create path element, apply class\n this.path = selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-line\");\n\n // Generate the line\n this.line = d3.svg.line()\n .x(function(d, i) {\n var x = parseFloat(panel[x_scale](d[\"x\"]));\n return isNaN(x) ? panel[x_range][i] : x;\n })\n .y(function(d, i) {\n var y = parseFloat(panel[y_scale](d[\"y\"]));\n return isNaN(y) ? panel[y_range][i] : y;\n })\n .interpolate(\"linear\");\n\n // Apply line and style\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"d\", this.line)\n .style(this.layout.style);\n } else {\n selection\n .attr(\"d\", this.line)\n .style(this.layout.style);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n \n };\n\n return this;\n\n});\n","\"use strict\";\n\n/*********************\n Scatter Data Layer\n Implements a standard scatter plot\n*/\n\nLocusZoom.DataLayers.add(\"scatter\", function(layout){\n\n // Define a default layout for this DataLayer type and merge it with the passed argument\n this.DefaultLayout = {\n point_size: 40,\n point_shape: \"circle\",\n tooltip_positioning: \"horizontal\",\n color: \"#888888\",\n fill_opacity: 1,\n y_axis: {\n axis: 1\n },\n id_field: \"id\"\n };\n layout = LocusZoom.Layouts.merge(layout, this.DefaultLayout);\n\n // Extra default for layout spacing\n // Not in default layout since that would make the label attribute always present\n if (layout.label && isNaN(layout.label.spacing)){\n layout.label.spacing = 4;\n }\n\n // Apply the arguments to set LocusZoom.DataLayer as the prototype\n LocusZoom.DataLayer.apply(this, arguments);\n\n // Reimplement the positionTooltip() method to be scatter-specific\n this.positionTooltip = function(id){\n if (typeof id != \"string\"){\n throw (\"Unable to position tooltip: id is not a string\");\n }\n if (!this.tooltips[id]){\n throw (\"Unable to position tooltip: id does not point to a valid tooltip\");\n }\n var top, left, arrow_type, arrow_top, arrow_left;\n var tooltip = this.tooltips[id];\n var point_size = this.resolveScalableParameter(this.layout.point_size, tooltip.data);\n var offset = Math.sqrt(point_size / Math.PI);\n var arrow_width = 7; // as defined in the default stylesheet\n var stroke_width = 1; // as defined in the default stylesheet\n var border_radius = 6; // as defined in the default stylesheet\n var page_origin = this.getPageOrigin();\n var x_center = this.parent.x_scale(tooltip.data[this.layout.x_axis.field]);\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n var y_center = this.parent[y_scale](tooltip.data[this.layout.y_axis.field]);\n var tooltip_box = tooltip.selector.node().getBoundingClientRect();\n var data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n var data_layer_width = this.parent.layout.width - (this.parent.layout.margin.left + this.parent.layout.margin.right);\n if (this.layout.tooltip_positioning === \"vertical\"){\n // Position horizontally centered above the point\n var offset_right = Math.max((tooltip_box.width / 2) - x_center, 0);\n var offset_left = Math.max((tooltip_box.width / 2) + x_center - data_layer_width, 0);\n left = page_origin.x + x_center - (tooltip_box.width / 2) - offset_left + offset_right;\n arrow_left = (tooltip_box.width / 2) - (arrow_width / 2) + offset_left - offset_right - offset;\n // Position vertically above the point unless there's insufficient space, then go below\n if (tooltip_box.height + stroke_width + arrow_width > data_layer_height - (y_center + offset)){\n top = page_origin.y + y_center - (offset + tooltip_box.height + stroke_width + arrow_width);\n arrow_type = \"down\";\n arrow_top = tooltip_box.height - stroke_width;\n } else {\n top = page_origin.y + y_center + offset + stroke_width + arrow_width;\n arrow_type = \"up\";\n arrow_top = 0 - stroke_width - arrow_width;\n }\n } else {\n // Position horizontally on the left or the right depending on which side of the plot the point is on\n if (x_center <= this.parent.layout.width / 2){\n left = page_origin.x + x_center + offset + arrow_width + stroke_width;\n arrow_type = \"left\";\n arrow_left = -1 * (arrow_width + stroke_width);\n } else {\n left = page_origin.x + x_center - tooltip_box.width - offset - arrow_width - stroke_width;\n arrow_type = \"right\";\n arrow_left = tooltip_box.width - stroke_width;\n }\n // Position vertically centered unless we're at the top or bottom of the plot\n data_layer_height = this.parent.layout.height - (this.parent.layout.margin.top + this.parent.layout.margin.bottom);\n if (y_center - (tooltip_box.height / 2) <= 0){ // Too close to the top, push it down\n top = page_origin.y + y_center - (1.5 * arrow_width) - border_radius;\n arrow_top = border_radius;\n } else if (y_center + (tooltip_box.height / 2) >= data_layer_height){ // Too close to the bottom, pull it up\n top = page_origin.y + y_center + arrow_width + border_radius - tooltip_box.height;\n arrow_top = tooltip_box.height - (2 * arrow_width) - border_radius;\n } else { // vertically centered\n top = page_origin.y + y_center - (tooltip_box.height / 2);\n arrow_top = (tooltip_box.height / 2) - arrow_width;\n }\n }\n // Apply positions to the main div\n tooltip.selector.style(\"left\", left + \"px\").style(\"top\", top + \"px\");\n // Create / update position on arrow connecting tooltip to data\n if (!tooltip.arrow){\n tooltip.arrow = tooltip.selector.append(\"div\").style(\"position\", \"absolute\");\n }\n tooltip.arrow\n .attr(\"class\", \"lz-data_layer-tooltip-arrow_\" + arrow_type)\n .style(\"left\", arrow_left + \"px\")\n .style(\"top\", arrow_top + \"px\");\n };\n\n // Function to flip labels from being anchored at the start of the text to the end\n // Both to keep labels from running outside the data layer and also as a first\n // pass on recursive separation\n this.flip_labels = function(){\n var data_layer = this;\n var point_size = data_layer.resolveScalableParameter(data_layer.layout.point_size, {});\n var spacing = data_layer.layout.label.spacing;\n var handle_lines = Boolean(data_layer.layout.label.lines);\n var min_x = 2 * spacing;\n var max_x = data_layer.parent.layout.width - data_layer.parent.layout.margin.left - data_layer.parent.layout.margin.right - (2 * spacing);\n var flip = function(dn, dnl){\n var dnx = +dn.attr(\"x\");\n var text_swing = (2 * spacing) + (2 * Math.sqrt(point_size));\n if (handle_lines){\n var dnlx2 = +dnl.attr(\"x2\");\n var line_swing = spacing + (2 * Math.sqrt(point_size));\n }\n if (dn.style(\"text-anchor\") === \"start\"){\n dn.style(\"text-anchor\", \"end\");\n dn.attr(\"x\", dnx - text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 - line_swing); }\n } else {\n dn.style(\"text-anchor\", \"start\");\n dn.attr(\"x\", dnx + text_swing);\n if (handle_lines){ dnl.attr(\"x2\", dnlx2 + line_swing); }\n }\n };\n // Flip any going over the right edge from the right side to the left side\n // (all labels start on the right side)\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n if (dax + abound.width + spacing > max_x){\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n flip(da, dal);\n }\n });\n // Second pass to flip any others that haven't flipped yet if they collide with another label\n data_layer.label_texts.each(function (d, i) {\n var a = this;\n var da = d3.select(a);\n if (da.style(\"text-anchor\") === \"end\") return;\n var dax = +da.attr(\"x\");\n var abound = da.node().getBoundingClientRect();\n var dal = handle_lines ? d3.select(data_layer.label_lines[0][i]) : null;\n data_layer.label_texts.each(function () {\n var b = this;\n var db = d3.select(b);\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (collision){\n flip(da, dal);\n // Double check that this flip didn't push the label past min_x. If it did, immediately flip back.\n dax = +da.attr(\"x\");\n if (dax - abound.width - spacing < min_x){\n flip(da, dal);\n }\n }\n return;\n });\n });\n };\n\n // Recursive function to space labels apart immediately after initial render\n // Adapted from thudfactor's fiddle here: https://jsfiddle.net/thudfactor/HdwTH/\n // TODO: Make labels also aware of data elements\n this.separate_labels = function(){\n this.seperate_iterations++;\n var data_layer = this;\n var alpha = 0.5;\n var spacing = this.layout.label.spacing;\n var again = false;\n data_layer.label_texts.each(function () {\n var a = this;\n var da = d3.select(a);\n var y1 = da.attr(\"y\");\n data_layer.label_texts.each(function () {\n var b = this;\n // a & b are the same element and don't collide.\n if (a === b) return;\n var db = d3.select(b);\n // a & b are on opposite sides of the chart and\n // don't collide\n if (da.attr(\"text-anchor\") !== db.attr(\"text-anchor\")) return;\n // Determine if the bounding rects for the two text elements collide\n var abound = da.node().getBoundingClientRect();\n var bbound = db.node().getBoundingClientRect();\n var collision = abound.left < bbound.left + bbound.width + (2*spacing) &&\n abound.left + abound.width + (2*spacing) > bbound.left &&\n abound.top < bbound.top + bbound.height + (2*spacing) &&\n abound.height + abound.top + (2*spacing) > bbound.top;\n if (!collision) return;\n again = true;\n // If the labels collide, we'll push each\n // of the two labels up and down a little bit.\n var y2 = db.attr(\"y\");\n var sign = abound.top < bbound.top ? 1 : -1;\n var adjust = sign * alpha;\n var new_a_y = +y1 - adjust;\n var new_b_y = +y2 + adjust;\n // Keep new values from extending outside the data layer\n var min_y = 2 * spacing;\n var max_y = data_layer.parent.layout.height - data_layer.parent.layout.margin.top - data_layer.parent.layout.margin.bottom - (2 * spacing);\n var delta;\n if (new_a_y - (abound.height/2) < min_y){\n delta = +y1 - new_a_y;\n new_a_y = +y1;\n new_b_y += delta;\n } else if (new_b_y - (bbound.height/2) < min_y){\n delta = +y2 - new_b_y;\n new_b_y = +y2;\n new_a_y += delta;\n }\n if (new_a_y + (abound.height/2) > max_y){\n delta = new_a_y - +y1;\n new_a_y = +y1;\n new_b_y -= delta;\n } else if (new_b_y + (bbound.height/2) > max_y){\n delta = new_b_y - +y2;\n new_b_y = +y2;\n new_a_y -= delta;\n }\n da.attr(\"y\",new_a_y);\n db.attr(\"y\",new_b_y);\n });\n });\n if (again) {\n // Adjust lines to follow the labels\n if (data_layer.layout.label.lines){\n var label_elements = data_layer.label_texts[0];\n data_layer.label_lines.attr(\"y2\",function(d,i) {\n var label_line = d3.select(label_elements[i]);\n return label_line.attr(\"y\");\n });\n }\n // After ~150 iterations we're probably beyond diminising returns, so stop recursing\n if (this.seperate_iterations < 150){\n setTimeout(function(){\n this.separate_labels();\n }.bind(this), 1);\n }\n }\n };\n\n // Implement the main render function\n this.render = function(){\n\n var data_layer = this;\n var x_scale = \"x_scale\";\n var y_scale = \"y\"+this.layout.y_axis.axis+\"_scale\";\n\n // Generate labels first (if defined)\n if (this.layout.label){\n // Apply filters to generate a filtered data set\n var filtered_data = this.data.filter(function(d){\n if (!data_layer.layout.label.filters){\n return true;\n } else {\n // Start by assuming a match, run through all filters to test if not a match on any one\n var match = true;\n data_layer.layout.label.filters.forEach(function(filter){\n var field_value = (new LocusZoom.Data.Field(filter.field)).resolve(d);\n if (isNaN(field_value)){\n match = false;\n } else {\n switch (filter.operator){\n case \"<\":\n if (!(field_value < filter.value)){ match = false; }\n break;\n case \"<=\":\n if (!(field_value <= filter.value)){ match = false; }\n break;\n case \">\":\n if (!(field_value > filter.value)){ match = false; }\n break;\n case \">=\":\n if (!(field_value >= filter.value)){ match = false; }\n break;\n case \"=\":\n if (!(field_value === filter.value)){ match = false; }\n break;\n default:\n // If we got here the operator is not valid, so the filter should fail\n match = false;\n break;\n }\n }\n });\n return match;\n }\n });\n // Render label groups\n var self = this;\n this.label_groups = this.svg.group\n .selectAll(\"g.lz-data_layer-\" + this.layout.type + \"-label\")\n .data(filtered_data, function(d){ return d[self.layout.id_field] + \"_label\"; });\n this.label_groups.enter()\n .append(\"g\")\n .attr(\"class\", \"lz-data_layer-\"+ this.layout.type + \"-label\");\n // Render label texts\n if (this.label_texts){ this.label_texts.remove(); }\n this.label_texts = this.label_groups.append(\"text\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_texts\n .text(function(d){\n return LocusZoom.parseFields(d, data_layer.layout.label.text || \"\");\n })\n .style(data_layer.layout.label.style || {})\n .attr({\n \"x\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + data_layer.layout.label.spacing;\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"text-anchor\": function(){\n return \"start\";\n }\n });\n // Render label lines\n if (data_layer.layout.label.lines){\n if (this.label_lines){ this.label_lines.remove(); }\n this.label_lines = this.label_groups.append(\"line\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type + \"-label\");\n this.label_lines\n .style(data_layer.layout.label.lines.style || {})\n .attr({\n \"x1\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field]);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y1\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n },\n \"x2\": function(d){\n var x = data_layer.parent[x_scale](d[data_layer.layout.x_axis.field])\n + Math.sqrt(data_layer.resolveScalableParameter(data_layer.layout.point_size, d))\n + (data_layer.layout.label.spacing/2);\n if (isNaN(x)){ x = -1000; }\n return x;\n },\n \"y2\": function(d){\n var y = data_layer.parent[y_scale](d[data_layer.layout.y_axis.field]);\n if (isNaN(y)){ y = -1000; }\n return y;\n }\n });\n }\n // Remove labels when they're no longer in the filtered data set\n this.label_groups.exit().remove();\n }\n \n // Generate main scatter data elements\n var selection = this.svg.group\n .selectAll(\"path.lz-data_layer-\" + this.layout.type)\n .data(this.data, function(d){ return d[this.layout.id_field]; }.bind(this));\n\n // Create elements, apply class, ID, and initial position\n var initial_y = isNaN(this.parent.layout.height) ? 0 : this.parent.layout.height;\n selection.enter()\n .append(\"path\")\n .attr(\"class\", \"lz-data_layer-\" + this.layout.type)\n .attr(\"id\", function(d){ return this.getElementId(d); }.bind(this))\n .attr(\"transform\", \"translate(0,\" + initial_y + \")\");\n\n // Generate new values (or functions for them) for position, color, size, and shape\n var transform = function(d) {\n var x = this.parent[x_scale](d[this.layout.x_axis.field]);\n var y = this.parent[y_scale](d[this.layout.y_axis.field]);\n if (isNaN(x)){ x = -1000; }\n if (isNaN(y)){ y = -1000; }\n return \"translate(\" + x + \",\" + y + \")\";\n }.bind(this);\n\n var fill = function(d){ return this.resolveScalableParameter(this.layout.color, d); }.bind(this);\n var fill_opacity = function(d){ return this.resolveScalableParameter(this.layout.fill_opacity, d); }.bind(this);\n\n var shape = d3.svg.symbol()\n .size(function(d){ return this.resolveScalableParameter(this.layout.point_size, d); }.bind(this))\n .type(function(d){ return this.resolveScalableParameter(this.layout.point_shape, d); }.bind(this));\n\n // Apply position and color, using a transition if necessary\n\n if (this.canTransition()){\n selection\n .transition()\n .duration(this.layout.transition.duration || 0)\n .ease(this.layout.transition.ease || \"cubic-in-out\")\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n } else {\n selection\n .attr(\"transform\", transform)\n .attr(\"fill\", fill)\n .attr(\"fill-opacity\", fill_opacity)\n .attr(\"d\", shape);\n }\n\n // Remove old elements as needed\n selection.exit().remove();\n\n // Apply default event emitters to selection\n selection.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n \n // Apply mouse behaviors\n this.applyBehaviors(selection);\n \n // Apply method to keep labels from overlapping each other\n if (this.layout.label){\n this.flip_labels();\n this.seperate_iterations = 0;\n this.separate_labels();\n // Apply default event emitters to selection\n this.label_texts.on(\"click.event_emitter\", function(element){\n this.parent.emit(\"element_clicked\", element, true);\n }.bind(this));\n // Extend mouse behaviors to labels\n this.applyBehaviors(this.label_texts);\n }\n \n };\n\n // Method to set a passed element as the LD reference in the plot-level state\n this.makeLDReference = function(element){\n var ref = null;\n if (typeof element == \"undefined\"){\n throw(\"makeLDReference requires one argument of any type\");\n } else if (typeof element == \"object\"){\n if (this.layout.id_field && typeof element[this.layout.id_field] != \"undefined\"){\n ref = element[this.layout.id_field].toString();\n } else if (typeof element[\"id\"] != \"undefined\"){\n ref = element[\"id\"].toString();\n } else {\n ref = element.toString();\n }\n } else {\n ref = element.toString();\n }\n this.parent_plot.applyState({ ldrefvar: ref });\n };\n \n return this;\n\n});\n\n/**\n * A scatter plot in which the x-axis represents categories, rather than individual positions.\n * For example, this can be used by PheWAS plots to show related groups. This plot allows the categories to be\n * determined dynamically when data is first loaded.\n *\n * @class LocusZoom.DataLayers.category_scatter\n * @augments LocusZoom.DataLayers.scatter\n */\nLocusZoom.DataLayers.extend(\"scatter\", \"category_scatter\", {\n /**\n * This plot layer makes certain assumptions about the data passed in. Transform the raw array of records from\n * the datasource to prepare it for plotting, as follows:\n * 1. The scatter plot assumes that all records are given in sequence (pre-grouped by `category_field`)\n * 2. It assumes that all records have an x coordinate for individual plotting\n * @private\n */\n _prepareData: function() {\n var xField = this.layout.x_axis.field || \"x\";\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n if (!category_field) {\n throw \"Layout for \" + this.layout.id + \" must specify category_field\";\n }\n // Sort the data so that things in the same category are adjacent (case-insensitive by specified field)\n var sourceData = this.data\n .sort(function(a, b) {\n var ak = a[category_field];\n var bk = b[category_field];\n var av = ak.toString ? ak.toString().toLowerCase() : ak;\n var bv = bk.toString ? bk.toString().toLowerCase() : bk;\n return (av === bv) ? 0 : (av < bv ? -1 : 1);});\n sourceData.forEach(function(d, i){\n // Implementation detail: Scatter plot requires specifying an x-axis value, and most datasources do not\n // specify plotting positions. If a point is missing this field, fill in a synthetic value.\n d[xField] = d[xField] || i;\n });\n return sourceData;\n },\n\n /**\n * Identify the unique categories on the plot, and update the layout with an appropriate color scheme.\n * Also identify the min and max x value associated with the category, which will be used to generate ticks\n * @private\n * @returns {Object.} Series of entries used to build category name ticks {category_name: [min_x, max_x]}\n */\n _generateCategoryBounds: function() {\n // TODO: API may return null values in category_field; should we add placeholder category label?\n // The (namespaced) field from `this.data` that will be used to assign datapoints to a given category & color\n var category_field = this.layout.x_axis.category_field;\n var xField = this.layout.x_axis.field || \"x\";\n var uniqueCategories = {};\n this.data.forEach(function(item) {\n var category = item[category_field];\n var x = item[xField];\n var bounds = uniqueCategories[category] || [x, x];\n uniqueCategories[category] = [Math.min(bounds[0], x), Math.max(bounds[1], x)];\n });\n\n var categoryNames = Object.keys(uniqueCategories);\n this._setDynamicColorScheme(categoryNames);\n\n return uniqueCategories;\n },\n\n /**\n * Automatically define a color scheme for the layer based on data returned from the server.\n * If part of the color scheme has been specified, it will fill in remaining missing information.\n *\n * There are three scenarios:\n * 1. The layout does not specify either category names or (color) values. Dynamically build both based on\n * the data and update the layout.\n * 2. The layout specifies colors, but not categories. Use that exact color information provided, and dynamically\n * determine what categories are present in the data. (cycle through the available colors, reusing if there\n * are a lot of categories)\n * 3. The layout specifies exactly what colors and categories to use (and they match the data!). This is useful to\n * specify an explicit mapping between color scheme and category names, when you want to be sure that the\n * plot matches a standard color scheme.\n * (If the layout specifies categories that do not match the data, the user specified categories will be ignored)\n *\n * This method will only act if the layout defines a `categorical_bin` scale function for coloring. It may be\n * overridden in a subclass to suit other types of coloring methods.\n *\n * @param {String[]} categoryNames\n * @private\n */\n _setDynamicColorScheme: function(categoryNames) {\n var colorParams = this.layout.color.parameters;\n var baseParams = this._base_layout.color.parameters;\n\n // If the layout does not use a supported coloring scheme, or is already complete, this method should do nothing\n if (this.layout.color.scale_function !== \"categorical_bin\") {\n throw \"This layer requires that coloring be specified as a `categorical_bin`\";\n }\n\n if (baseParams.categories.length && baseParams.values.length) {\n // If there are preset category/color combos, make sure that they apply to the actual dataset\n var parameters_categories_hash = {};\n baseParams.categories.forEach(function (category) { parameters_categories_hash[category] = 1; });\n if (categoryNames.every(function (name) { return parameters_categories_hash.hasOwnProperty(name); })) {\n // The layout doesn't have to specify categories in order, but make sure they are all there\n colorParams.categories = baseParams.categories;\n } else {\n colorParams.categories = categoryNames;\n }\n } else {\n colorParams.categories = categoryNames;\n }\n // Prefer user-specified colors if provided. Make sure that there are enough colors for all the categories.\n var colors;\n if (baseParams.values.length) {\n colors = baseParams.values;\n } else {\n var color_scale = categoryNames.length <= 10 ? d3.scale.category10 : d3.scale.category20;\n colors = color_scale().range();\n }\n while (colors.length < categoryNames.length) { colors = colors.concat(colors); }\n colors = colors.slice(0, categoryNames.length); // List of hex values, should be of same length as categories array\n colorParams.values = colors;\n },\n\n /**\n *\n * @param dimension\n * @param {Object} [config] Parameters that customize how ticks are calculated (not style)\n * @param {('left'|'center'|'right')} [config.position='left'] Align ticks with the center or edge of category\n * @returns {Array}\n */\n getTicks: function(dimension, config) { // Overrides parent method\n if ([\"x\", \"y\"].indexOf(dimension) === -1) {\n throw \"Invalid dimension identifier\";\n }\n var position = config.position || \"left\";\n if ([\"left\", \"center\", \"right\"].indexOf(position) === -1) {\n throw \"Invalid tick position\";\n }\n\n var categoryBounds = this._categories;\n if (!categoryBounds || !Object.keys(categoryBounds).length) {\n return [];\n }\n\n if (dimension === \"y\") {\n return [];\n }\n\n if (dimension === \"x\") {\n // If colors have been defined by this layer, use them to make tick colors match scatterplot point colors\n var knownCategories = this.layout.color.parameters.categories || [];\n var knownColors = this.layout.color.parameters.values || [];\n\n return Object.keys(categoryBounds).map(function (category, index) {\n var bounds = categoryBounds[category];\n var xPos;\n\n switch(position) {\n case \"left\":\n xPos = bounds[0];\n break;\n case \"center\":\n // Center tick under one or many elements as appropriate\n var diff = bounds[1] - bounds[0];\n xPos = bounds[0] + (diff !== 0 ? diff : bounds[0]) / 2;\n break;\n case \"right\":\n xPos = bounds[1];\n break;\n }\n return {\n x: xPos,\n text: category,\n style: {\n \"fill\": knownColors[knownCategories.indexOf(category)] || \"#000000\"\n }\n };\n });\n }\n },\n\n applyCustomDataMethods: function() {\n this.data = this._prepareData();\n /**\n * Define category names and extents (boundaries) for plotting. TODO: properties in constructor\n * @member {Object.} Category names and extents, in the form {category_name: [min_x, max_x]}\n */\n this._categories = this._generateCategoryBounds();\n return this;\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n *\n * LocusZoom has various singleton objects that are used for registering functions or classes.\n * These objects provide safe, standard methods to redefine or delete existing functions/classes\n * as well as define new custom functions/classes to be used in a plot.\n *\n * @namespace Singletons\n */\n\n\n/*\n * The Collection of \"Known\" Data Sources. This registry is used internally by the `DataSources` class\n * @class\n * @static\n */\nLocusZoom.KnownDataSources = (function() {\n /** @lends LocusZoom.KnownDataSources */\n var obj = {};\n /* @member {function[]} */\n var sources = [];\n\n var findSourceByName = function(x) {\n for(var i=0; i 1) {\n return function(x) {\n var val = x;\n for(var i = 0; i 1) {\n log = Math.ceil(Math.log(abs) / Math.LN10);\n } else { // 0...1\n log = Math.floor(Math.log(abs) / Math.LN10);\n }\n if (Math.abs(log) <= 3){\n return x.toFixed(3);\n } else {\n return x.toExponential(2).replace(\"+\", \"\").replace(\"e\", \" × 10^\");\n }\n});\n\n/**\n * URL-encode the provided text, eg for constructing hyperlinks\n * @function urlencode\n * @param {String} str\n */\nLocusZoom.TransformationFunctions.add(\"urlencode\", function(str) {\n return encodeURIComponent(str);\n});\n\n/**\n * HTML-escape user entered values for use in constructed HTML fragments\n *\n * For example, this filter can be used on tooltips with custom HTML display\n * @function htmlescape\n * @param {String} str HTML-escape the provided value\n */\nLocusZoom.TransformationFunctions.add(\"htmlescape\", function(str) {\n if ( !str ) {\n return \"\";\n }\n str = str + \"\";\n\n return str.replace( /['\"<>&`]/g, function( s ) {\n switch ( s ) {\n case \"'\":\n return \"'\";\n case \"\\\"\":\n return \""\";\n case \"<\":\n return \"<\";\n case \">\":\n return \">\";\n case \"&\":\n return \"&\";\n case \"`\":\n return \"`\";\n }\n });\n});\n\n/**\n * Singleton for accessing/storing functions that will convert arbitrary data points to values in a given scale\n * Useful for anything that needs to scale discretely with data (e.g. color, point size, etc.)\n *\n * A Scale Function can be thought of as a modifier to a layout directive that adds extra logic to how a piece of data\n * can be resolved to a value.\n *\n * All scale functions must accept an object of parameters and a value to process.\n * @class\n * @static\n */\nLocusZoom.ScaleFunctions = (function() {\n /** @lends LocusZoom.ScaleFunctions */\n var obj = {};\n var functions = {};\n\n /**\n * Find a scale function and return it. If parameters and values are passed, calls the function directly; otherwise\n * returns a callable.\n * @param {String} name\n * @param {Object} [parameters] Configuration parameters specific to the specified scale function\n * @param {*} [value] The value to operate on\n * @returns {*}\n */\n obj.get = function(name, parameters, value) {\n if (!name) {\n return null;\n } else if (functions[name]) {\n if (typeof parameters === \"undefined\" && typeof value === \"undefined\"){\n return functions[name];\n } else {\n return functions[name](parameters, value);\n }\n } else {\n throw(\"scale function [\" + name + \"] not found\");\n }\n };\n\n /**\n * @protected\n * @param {String} name The name of the function to set/unset\n * @param {Function} [fn] The function to register. If blank, removes this function name from the registry.\n */\n obj.set = function(name, fn) {\n if (fn) {\n functions[name] = fn;\n } else {\n delete functions[name];\n }\n };\n\n /**\n * Add a new scale function to the registry\n * @param {String} name The name of the scale function\n * @param {function} fn A scale function that accepts two parameters: an object of configuration and a value\n */\n obj.add = function(name, fn) {\n if (functions[name]) {\n throw(\"scale function already exists with name: \" + name);\n } else {\n obj.set(name, fn);\n }\n };\n\n /**\n * List the names of all registered scale functions\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(functions);\n };\n\n return obj;\n})();\n\n/**\n * Basic conditional function to evaluate the value of the input field and return based on equality.\n * @param {Object} parameters\n * @param {*} parameters.field_value The value against which to test the input value.\n * @param {*} parameters.then The value to return if the input value matches the field value\n * @param {*} parameters.else The value to return if the input value does not match the field value. Optional. If not\n * defined this scale function will return null (or value of null_value parameter, if defined) when input value fails\n * to match field_value.\n * @param {*} input value\n */\nLocusZoom.ScaleFunctions.add(\"if\", function(parameters, input){\n if (typeof input == \"undefined\" || parameters.field_value !== input){\n if (typeof parameters.else != \"undefined\"){\n return parameters.else;\n } else {\n return null;\n }\n } else {\n return parameters.then;\n }\n});\n\n/**\n * Function to sort numerical values into bins based on numerical break points. Will only operate on numbers and\n * return null (or value of null_value parameter, if defined) if provided a non-numeric input value. Parameters:\n * @function numerical_bin\n * @param {Object} parameters\n * @param {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter. If the input value is greater than or equal to break n and less than\n * or equal to break n+1 (or break n+1 doesn't exist) then returned value is the nth entry in the values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against break points. Must be of\n * equal length to breaks parameter. Each entry n represents the value to return if the input value is greater than\n * or equal to break n and less than or equal to break n+1 (or break n+1 doesn't exist).\n * @param {*} null_value\n * @param {*} input value\n * @returns\n */\nLocusZoom.ScaleFunctions.add(\"numerical_bin\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){\n return (parameters.null_value ? parameters.null_value : null);\n }\n var threshold = breaks.reduce(function(prev, curr){\n if (+input < prev || (+input >= prev && +input < curr)){\n return prev;\n } else {\n return curr;\n }\n });\n return values[breaks.indexOf(threshold)];\n});\n\n/**\n * Function to sort values of any type into bins based on direct equality testing with a list of categories.\n * Will return null if provided an input value that does not match to a listed category.\n * @function categorical_bin\n * @param {Object} parameters\n * @param {Array} parameters.categories Array of values against which to evaluate the input value. Must be of equal\n * length to values parameter. If the input value is equal to category n then returned value is the nth entry in the\n * values parameter.\n * @param {Array} parameters.values Array of values to return given evaluations against categories. Must be of equal\n * length to categories parameter. Each entry n represents the value to return if the input value is equal to the nth\n * value in the categories parameter.\n * @param {*} parameters.null_value Value to return if the input value fails to match to any categories. Optional.\n */\nLocusZoom.ScaleFunctions.add(\"categorical_bin\", function(parameters, value){\n if (typeof value == \"undefined\" || parameters.categories.indexOf(value) === -1){\n return (parameters.null_value ? parameters.null_value : null); \n } else {\n return parameters.values[parameters.categories.indexOf(value)];\n }\n});\n\n/**\n * Function for continuous interpolation of numerical values along a gradient with arbitrarily many break points.\n * @function interpolate\n * @parameters {Object} parameters\n * @parameters {Number[]} parameters.breaks Array of numerical break points against which to evaluate the input value.\n * Must be of equal length to values parameter and contain at least two elements. Input value will be evaluated for\n * relative position between two break points n and n+1 and the returned value will be interpolated at a relative\n * position between values n and n+1.\n * @parameters {*[]} parameters.values Array of values to interpolate and return given evaluations against break\n * points. Must be of equal length to breaks parameter and contain at least two elements. Each entry n represents\n * the value to return if the input value matches the nth entry in breaks exactly. Note that this scale function\n * uses d3.interpolate to provide for effective interpolation of many different value types, including numbers,\n * colors, shapes, etc.\n * @parameters {*} parameters.null_value\n */\nLocusZoom.ScaleFunctions.add(\"interpolate\", function(parameters, input){\n var breaks = parameters.breaks || [];\n var values = parameters.values || [];\n var nullval = (parameters.null_value ? parameters.null_value : null);\n if (breaks.length < 2 || breaks.length !== values.length){ return nullval; }\n if (typeof input == \"undefined\" || input === null || isNaN(+input)){ return nullval; }\n if (+input <= parameters.breaks[0]){\n return values[0];\n } else if (+input >= parameters.breaks[parameters.breaks.length-1]){\n return values[breaks.length-1];\n } else {\n var upper_idx = null;\n breaks.forEach(function(brk, idx){\n if (!idx){ return; }\n if (breaks[idx-1] <= +input && breaks[idx] >= +input){ upper_idx = idx; }\n });\n if (upper_idx === null){ return nullval; }\n var normalized_input = (+input - breaks[upper_idx-1]) / (breaks[upper_idx] - breaks[upper_idx-1]);\n if (!isFinite(normalized_input)){ return nullval; }\n return d3.interpolate(values[upper_idx-1], values[upper_idx])(normalized_input);\n }\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A Dashboard is an HTML element used for presenting arbitrary user interface components. Dashboards are anchored\n * to either the entire Plot or to individual Panels.\n *\n * Each dashboard is an HTML-based (read: not SVG) collection of components used to display information or provide\n * user interface. Dashboards can exist on entire plots, where their visibility is permanent and vertically adjacent\n * to the plot, or on individual panels, where their visibility is tied to a behavior (e.g. a mouseover) and is as\n * an overlay.\n * @class\n */\nLocusZoom.Dashboard = function(parent){\n // parent must be a locuszoom plot or panel\n if (!(parent instanceof LocusZoom.Plot) && !(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create dashboard, parent must be a locuszoom plot or panel\";\n }\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".dashboard\";\n /** @member {('plot'|'panel')} */\n this.type = (this.parent instanceof LocusZoom.Plot) ? \"plot\" : \"panel\";\n /** @member {LocusZoom.Plot} */\n this.parent_plot = this.type === \"plot\" ? this.parent : this.parent.parent;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {LocusZoom.Dashboard.Component[]} */\n this.components = [];\n /**\n * The timer identifier as returned by setTimeout\n * @member {Number}\n */\n this.hide_timeout = null;\n /**\n * Whether to hide the dashboard. Can be overridden by a child component. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n\n // TODO: Return value from constructor function?\n return this.initialize();\n};\n\n/**\n * Prepare the dashboard for first use: generate all component instances for this dashboard, based on the provided\n * layout of the parent. Connects event listeners and shows/hides as appropriate.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.initialize = function() {\n // Parse layout to generate component instances\n if (Array.isArray(this.parent.layout.dashboard.components)){\n this.parent.layout.dashboard.components.forEach(function(layout){\n try {\n var component = LocusZoom.Dashboard.Components.get(layout.type, layout, this);\n this.components.push(component);\n } catch (e) {\n console.warn(e);\n }\n }.bind(this));\n }\n\n // Add mouseover event handlers to show/hide panel dashboard\n if (this.type === \"panel\"){\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseover.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n if (!this.selector || this.selector.style(\"visibility\") === \"hidden\"){ this.show(); }\n }.bind(this));\n d3.select(this.parent.parent.svg.node().parentNode).on(\"mouseout.\" + this.id, function(){\n clearTimeout(this.hide_timeout);\n this.hide_timeout = setTimeout(function(){ this.hide(); }.bind(this), 300);\n }.bind(this));\n }\n\n return this;\n\n};\n\n/**\n * Whether to persist the dashboard. Returns true if at least one component should persist, or if the panel is engaged\n * in an active drag event.\n * @returns {boolean}\n */\nLocusZoom.Dashboard.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n var persist = false;\n // Persist if at least one component should also persist\n this.components.forEach(function(component){\n persist = persist || component.shouldPersist();\n });\n // Persist if in a parent drag event\n persist = persist || (this.parent_plot.panel_boundaries.dragging || this.parent_plot.interaction.dragging);\n return !!persist;\n};\n\n/**\n * Make the dashboard appear. If it doesn't exist yet create it, including creating/positioning all components within,\n * and make sure it is set to be visible.\n */\nLocusZoom.Dashboard.prototype.show = function(){\n if (!this.selector){\n switch (this.type){\n case \"plot\":\n this.selector = d3.select(this.parent.svg.node().parentNode)\n .insert(\"div\",\":first-child\");\n break;\n case \"panel\":\n this.selector = d3.select(this.parent.parent.svg.node().parentNode)\n .insert(\"div\", \".lz-data_layer-tooltip, .lz-dashboard-menu, .lz-curtain\").classed(\"lz-panel-dashboard\", true);\n break;\n }\n this.selector.classed(\"lz-dashboard\", true).classed(\"lz-\"+this.type+\"-dashboard\", true).attr(\"id\", this.id);\n }\n this.components.forEach(function(component){ component.show(); });\n this.selector.style({ visibility: \"visible\" });\n return this.update();\n};\n\n/**\n * Update the dashboard and rerender all child components. This can be called whenever plot state changes.\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.update = function(){\n if (!this.selector){ return this; }\n this.components.forEach(function(component){ component.update(); });\n return this.position();\n};\n\n/**\n * Position the dashboard (and child components) within the panel\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.position = function(){\n if (!this.selector){ return this; }\n // Position the dashboard itself (panel only)\n if (this.type === \"panel\"){\n var page_origin = this.parent.getPageOrigin();\n var top = (page_origin.y + 3.5).toString() + \"px\";\n var left = page_origin.x.toString() + \"px\";\n var width = (this.parent.layout.width - 4).toString() + \"px\";\n this.selector.style({ position: \"absolute\", top: top, left: left, width: width });\n }\n // Recursively position components\n this.components.forEach(function(component){ component.position(); });\n return this;\n};\n\n/**\n * Hide the dashboard (make invisible but do not destroy). Will do nothing if `shouldPersist` returns true.\n *\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n this.components.forEach(function(component){ component.hide(); });\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n\n/**\n * Completely remove dashboard and all child components. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n this.components.forEach(function(component){ component.destroy(true); });\n this.components = [];\n this.selector.remove();\n this.selector = null;\n return this;\n};\n\n/**\n *\n * A dashboard component is an empty div rendered on a dashboard that can display custom\n * html of user interface elements. LocusZoom.Dashboard.Components is a singleton used to\n * define and manage an extendable collection of dashboard components.\n * (e.g. by LocusZoom.Dashboard.Components.add())\n * @class\n * @param {Object} layout A JSON-serializable object of layout configuration parameters\n * @param {('left'|'right')} [layout.position='left'] Whether to float the component left or right.\n * @param {('start'|'middle'|'end')} [layout.group_position] Buttons can optionally be gathered into a visually\n * distinctive group whose elements are closer together. If a button is identified as the start or end of a group,\n * it will be drawn with rounded corners and an extra margin of spacing from any button not part of the group.\n * For example, the region_nav_plot dashboard is a defined as a group.\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple'} [layout.color='gray'] Color scheme for the\n * component. Applies to buttons and menus.\n * @param {LocusZoom.Dashboard} parent The dashboard that contains this component\n*/\nLocusZoom.Dashboard.Component = function(layout, parent) {\n /** @member {Object} */\n this.layout = layout || {};\n if (!this.layout.color){ this.layout.color = \"gray\"; }\n\n /** @member {LocusZoom.Dashboard|*} */\n this.parent = parent || null;\n /**\n * Some dashboards are attached to a panel, rather than directly to a plot\n * @member {LocusZoom.Panel|null}\n */\n this.parent_panel = null;\n /** @member {LocusZoom.Plot} */\n this.parent_plot = null;\n /**\n * This is a reference to either the panel or the plot, depending on what the dashboard is\n * tied to. Useful when absolutely positioning dashboard components relative to their SVG anchor.\n * @member {LocusZoom.Plot|LocusZoom.Panel}\n */\n this.parent_svg = null;\n if (this.parent instanceof LocusZoom.Dashboard){\n // TODO: when is the immediate parent *not* a dashboard?\n if (this.parent.type === \"panel\"){\n this.parent_panel = this.parent.parent;\n this.parent_plot = this.parent.parent.parent;\n this.parent_svg = this.parent_panel;\n } else {\n this.parent_plot = this.parent.parent;\n this.parent_svg = this.parent_plot;\n }\n }\n /** @member {d3.selection} */\n this.selector = null;\n /**\n * If this is an interactive component, it will contain a button or menu instance that handles the interactivity.\n * There is a 1-to-1 relationship of dashboard component to button\n * @member {null|LocusZoom.Dashboard.Component.Button}\n */\n this.button = null;\n /**\n * If any single component is marked persistent, it will bubble up to prevent automatic hide behavior on a\n * component's parent dashboard. Check via `shouldPersist`\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n if (!this.layout.position){ this.layout.position = \"left\"; }\n\n // TODO: Return value in constructor\n return this;\n};\n/**\n * Perform all rendering of component, including toggling visibility to true. Will initialize and create SVG element\n * if necessary, as well as updating with new data and performing layout actions.\n */\nLocusZoom.Dashboard.Component.prototype.show = function(){\n if (!this.parent || !this.parent.selector){ return; }\n if (!this.selector){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.layout.group_position) !== -1 ? \" lz-dashboard-group-\" + this.layout.group_position : \"\");\n this.selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-\" + this.layout.position + group_position);\n if (this.layout.style){ this.selector.style(this.layout.style); }\n if (typeof this.initialize == \"function\"){ this.initialize(); }\n }\n if (this.button && this.button.status === \"highlighted\"){ this.button.menu.show(); }\n this.selector.style({ visibility: \"visible\" });\n this.update();\n return this.position();\n};\n/**\n * Update the dashboard component with any new data or plot state as appropriate. This method performs all\n * necessary rendering steps.\n */\nLocusZoom.Dashboard.Component.prototype.update = function(){ /* stub */ };\n/**\n * Place the component correctly in the plot\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.position = function(){\n if (this.button){ this.button.menu.position(); }\n return this;\n};\n/**\n * Determine whether the component should persist (will bubble up to parent dashboard)\n * @returns {boolean}\n */\nLocusZoom.Dashboard.Component.prototype.shouldPersist = function(){\n if (this.persist){ return true; }\n if (this.button && this.button.persist){ return true; }\n return false;\n};\n/**\n * Toggle visibility to hidden, unless marked as persistent\n * @returns {LocusZoom.Dashboard.Component}\n */\nLocusZoom.Dashboard.Component.prototype.hide = function(){\n if (!this.selector || this.shouldPersist()){ return this; }\n if (this.button){ this.button.menu.hide(); }\n this.selector.style({ visibility: \"hidden\" });\n return this;\n};\n/**\n * Completely remove component and button. (may be overridden by persistence settings)\n * @param {Boolean} [force=false] If true, will ignore persistence settings and always destroy the dashboard\n * @returns {LocusZoom.Dashboard}\n */\nLocusZoom.Dashboard.Component.prototype.destroy = function(force){\n if (typeof force == \"undefined\"){ force = false; }\n if (!this.selector){ return this; }\n if (this.shouldPersist() && !force){ return this; }\n if (this.button && this.button.menu){ this.button.menu.destroy(); }\n this.selector.remove();\n this.selector = null;\n this.button = null;\n return this;\n};\n\n/**\n * Singleton registry of all known components\n * @class\n * @static\n */\nLocusZoom.Dashboard.Components = (function() {\n /** @lends LocusZoom.Dashboard.Components */\n var obj = {};\n var components = {};\n\n /**\n * Create a new component instance by name\n * @param {String} name The string identifier of the desired component\n * @param {Object} layout The layout to use to create the component\n * @param {LocusZoom.Dashboard} parent The containing dashboard to use when creating the component\n * @returns {LocusZoom.Dashboard.Component}\n */\n obj.get = function(name, layout, parent) {\n if (!name) {\n return null;\n } else if (components[name]) {\n if (typeof layout != \"object\"){\n throw(\"invalid layout argument for dashboard component [\" + name + \"]\");\n } else {\n return new components[name](layout, parent);\n }\n } else {\n throw(\"dashboard component [\" + name + \"] not found\");\n }\n };\n /**\n * Add a new component constructor to the registry and ensure that it extends the correct parent class\n * @protected\n * @param name\n * @param component\n */\n obj.set = function(name, component) {\n if (component) {\n if (typeof component != \"function\"){\n throw(\"unable to set dashboard component [\" + name + \"], argument provided is not a function\");\n } else {\n components[name] = component;\n components[name].prototype = new LocusZoom.Dashboard.Component();\n }\n } else {\n delete components[name];\n }\n };\n\n /**\n * Register a new component constructor by name\n * @param {String} name\n * @param {function} component The component constructor\n */\n obj.add = function(name, component) {\n if (components[name]) {\n throw(\"dashboard component already exists with name: \" + name);\n } else {\n obj.set(name, component);\n }\n };\n\n /**\n * List the names of all registered components\n * @returns {String[]}\n */\n obj.list = function() {\n return Object.keys(components);\n };\n\n return obj;\n})();\n\n/**\n * Plots and panels may have a \"dashboard\" element suited for showing HTML components that may be interactive.\n * When components need to incorporate a generic button, or additionally a button that generates a menu, this\n * class provides much of the necessary framework.\n * @class\n * @param {LocusZoom.Dashboard.Component} parent\n */\nLocusZoom.Dashboard.Component.Button = function(parent) { \n \n if (!(parent instanceof LocusZoom.Dashboard.Component)){\n throw \"Unable to create dashboard component button, invalid parent\";\n }\n /** @member {LocusZoom.Dashboard.Component} */\n this.parent = parent;\n /** @member {LocusZoom.Dashboard.Panel} */\n this.parent_panel = this.parent.parent_panel;\n /** @member {LocusZoom.Dashboard.Plot} */\n this.parent_plot = this.parent.parent_plot;\n /** @member {LocusZoom.Plot|LocusZoom.Panel} */\n this.parent_svg = this.parent.parent_svg;\n\n /** @member {LocusZoom.Dashboard|null|*} */\n this.parent_dashboard = this.parent.parent;\n /** @member {d3.selection} */\n this.selector = null;\n\n /**\n * Tag to use for the button (default: a)\n * @member {String}\n */\n this.tag = \"a\";\n\n /**\n * TODO This method does not appear to be used anywhere\n * @param {String} tag\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTag = function(tag){\n if (typeof tag != \"undefined\"){ this.tag = tag.toString(); }\n return this;\n };\n\n /**\n * HTML for the button to show.\n * @protected\n * @member {String}\n */\n this.html = \"\";\n /**\n * Specify the HTML content of this button.\n * WARNING: The string provided will be inserted into the document as raw markup; XSS mitigation is the\n * responsibility of each button implementation.\n * @param {String} html\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setHtml = function(html){\n if (typeof html != \"undefined\"){ this.html = html.toString(); }\n return this;\n };\n /**\n * @deprecated since 0.5.6; use setHTML instead\n */\n this.setText = this.setHTML;\n\n /**\n * Mouseover title text for the button to show\n * @protected\n * @member {String}\n */\n this.title = \"\";\n /**\n * Set the mouseover title text for the button (if any)\n * @param {String} title Simple text to display\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setTitle = function(title){\n if (typeof title != \"undefined\"){ this.title = title.toString(); }\n return this;\n };\n\n /**\n * Color of the button\n * @member {String}\n */\n this.color = \"gray\";\n\n /**\n * Set the color associated with this button\n * @param {('gray'|'red'|'orange'|'yellow'|'green'|'blue'|'purple')} color Any selection not in the preset list\n * will be replaced with gray.\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setColor = function(color){\n if (typeof color != \"undefined\"){\n if ([\"gray\", \"red\", \"orange\", \"yellow\", \"green\", \"blue\", \"purple\"].indexOf(color) !== -1){ this.color = color; }\n else { this.color = \"gray\"; }\n }\n return this;\n };\n\n /**\n * Hash of arbitrary button styles to apply as {name: value} entries\n * @protected\n * @member {Object}\n */\n this.style = {};\n /**\n * Set a collection of custom styles to be used by the button\n * @param {Object} style Hash of {name:value} entries\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setStyle = function(style){\n if (typeof style != \"undefined\"){ this.style = style; }\n return this;\n };\n\n //\n /**\n * Method to generate a CSS class string\n * @returns {string}\n */\n this.getClass = function(){\n var group_position = ([\"start\",\"middle\",\"end\"].indexOf(this.parent.layout.group_position) !== -1 ? \" lz-dashboard-button-group-\" + this.parent.layout.group_position : \"\");\n return \"lz-dashboard-button lz-dashboard-button-\" + this.color + (this.status ? \"-\" + this.status : \"\") + group_position;\n };\n\n // Permanence\n /**\n * Track internal state on whether to keep showing the button/ menu contents at the moment\n * @protected\n * @member {Boolean}\n */\n this.persist = false;\n /**\n * Configuration when defining a button: track whether this component should be allowed to keep open\n * menu/button contents in response to certain events\n * @protected\n * @member {Boolean}\n */\n this.permanent = false;\n /**\n * Allow code to change whether the button is allowed to be `permanent`\n * @param {boolean} bool\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.setPermanent = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n this.permanent = bool;\n if (this.permanent){ this.persist = true; }\n return this;\n };\n /**\n * Determine whether the button/menu contents should persist in response to a specific event\n * @returns {Boolean}\n */\n this.shouldPersist = function(){\n return this.permanent || this.persist;\n };\n\n /**\n * Button status (highlighted / disabled/ etc)\n * @protected\n * @member {String}\n */\n this.status = \"\";\n /**\n * Change button state\n * @param {('highlighted'|'disabled'|'')} status\n */\n this.setStatus = function(status){\n if (typeof status != \"undefined\" && [\"\", \"highlighted\", \"disabled\"].indexOf(status) !== -1){ this.status = status; }\n return this.update();\n };\n /**\n * Toggle whether the button is highlighted\n * @param {boolean} bool If provided, explicitly set highlighted state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.highlight = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"highlighted\"); }\n else if (this.status === \"highlighted\"){ return this.setStatus(\"\"); }\n return this;\n };\n /**\n * Toggle whether the button is disabled\n * @param {boolean} bool If provided, explicitly set disabled state\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.disable = function(bool){\n if (typeof bool == \"undefined\"){ bool = true; } else { bool = Boolean(bool); }\n if (bool){ return this.setStatus(\"disabled\"); }\n else if (this.status === \"disabled\"){ return this.setStatus(\"\"); }\n return this;\n };\n\n // Mouse events\n /** @member {function} */\n this.onmouseover = function(){};\n this.setOnMouseover = function(onmouseover){\n if (typeof onmouseover == \"function\"){ this.onmouseover = onmouseover; }\n else { this.onmouseover = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onmouseout = function(){};\n this.setOnMouseout = function(onmouseout){\n if (typeof onmouseout == \"function\"){ this.onmouseout = onmouseout; }\n else { this.onmouseout = function(){}; }\n return this;\n };\n /** @member {function} */\n this.onclick = function(){};\n this.setOnclick = function(onclick){\n if (typeof onclick == \"function\"){ this.onclick = onclick; }\n else { this.onclick = function(){}; }\n return this;\n };\n \n // Primary behavior functions\n /**\n * Show the button, including creating DOM elements if necessary for first render\n */\n this.show = function(){\n if (!this.parent){ return; }\n if (!this.selector){\n this.selector = this.parent.selector.append(this.tag).attr(\"class\", this.getClass());\n }\n return this.update();\n };\n /**\n * Hook for any actions or state cleanup to be performed before rerendering\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.preUpdate = function(){ return this; };\n /**\n * Update button state and contents, and fully rerender\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.update = function(){\n if (!this.selector){ return this; }\n this.preUpdate();\n this.selector\n .attr(\"class\", this.getClass())\n .attr(\"title\", this.title).style(this.style)\n .on(\"mouseover\", (this.status === \"disabled\") ? null : this.onmouseover)\n .on(\"mouseout\", (this.status === \"disabled\") ? null : this.onmouseout)\n .on(\"click\", (this.status === \"disabled\") ? null : this.onclick)\n .html(this.html);\n this.menu.update();\n this.postUpdate();\n return this;\n };\n /**\n * Hook for any behavior to be added/changed after the button has been re-rendered\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.postUpdate = function(){ return this; };\n /**\n * Hide the button by removing it from the DOM (may be overridden by current persistence setting)\n * @returns {LocusZoom.Dashboard.Component.Button}\n */\n this.hide = function(){\n if (this.selector && !this.shouldPersist()){\n this.selector.remove();\n this.selector = null;\n }\n return this;\n }; \n\n /**\n * Button Menu Object\n * The menu is an HTML overlay that can appear below a button. It can contain arbitrary HTML and\n * has logic to be automatically positioned and sized to behave more or less like a dropdown menu.\n * @member {Object}\n */\n this.menu = {\n outer_selector: null,\n inner_selector: null,\n scroll_position: 0,\n hidden: true,\n /**\n * Show the button menu, including setting up any DOM elements needed for first rendering\n */\n show: function(){\n if (!this.menu.outer_selector){\n this.menu.outer_selector = d3.select(this.parent_plot.svg.node().parentNode).append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu lz-dashboard-menu-\" + this.color)\n .attr(\"id\", this.parent_svg.getBaseId() + \".dashboard.menu\");\n this.menu.inner_selector = this.menu.outer_selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-menu-content\");\n this.menu.inner_selector.on(\"scroll\", function(){\n this.menu.scroll_position = this.menu.inner_selector.node().scrollTop;\n }.bind(this));\n }\n this.menu.outer_selector.style({ visibility: \"visible\" });\n this.menu.hidden = false;\n return this.menu.update();\n }.bind(this),\n /**\n * Update the rendering of the menu\n */\n update: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.populate(); // This function is stubbed for all buttons by default and custom implemented in component definition\n if (this.menu.inner_selector){ this.menu.inner_selector.node().scrollTop = this.menu.scroll_position; }\n return this.menu.position();\n }.bind(this),\n position: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n // Unset any explicitly defined outer selector height so that menus dynamically shrink if content is removed\n this.menu.outer_selector.style({ height: null });\n var padding = 3;\n var scrollbar_padding = 20;\n var menu_height_padding = 14; // 14: 2x 6px padding, 2x 1px border\n var page_origin = this.parent_svg.getPageOrigin();\n var page_scroll_top = document.documentElement.scrollTop || document.body.scrollTop;\n var container_offset = this.parent_plot.getContainerOffset();\n var dashboard_client_rect = this.parent_dashboard.selector.node().getBoundingClientRect();\n var button_client_rect = this.selector.node().getBoundingClientRect();\n var menu_client_rect = this.menu.outer_selector.node().getBoundingClientRect();\n var total_content_height = this.menu.inner_selector.node().scrollHeight;\n var top = 0; var left = 0;\n if (this.parent_dashboard.type === \"panel\"){\n top = (page_origin.y + dashboard_client_rect.height + (2 * padding));\n left = Math.max(page_origin.x + this.parent_svg.layout.width - menu_client_rect.width - padding, page_origin.x + padding);\n } else {\n top = button_client_rect.bottom + page_scroll_top + padding - container_offset.top;\n left = Math.max(button_client_rect.left + button_client_rect.width - menu_client_rect.width - container_offset.left, page_origin.x + padding);\n }\n var base_max_width = Math.max(this.parent_svg.layout.width - (2 * padding) - scrollbar_padding, scrollbar_padding);\n var container_max_width = base_max_width;\n var content_max_width = (base_max_width - (4 * padding));\n var base_max_height = Math.max(this.parent_svg.layout.height - (10 * padding) - menu_height_padding, menu_height_padding);\n var height = Math.min(total_content_height, base_max_height);\n var max_height = base_max_height;\n this.menu.outer_selector.style({\n \"top\": top.toString() + \"px\",\n \"left\": left.toString() + \"px\",\n \"max-width\": container_max_width.toString() + \"px\",\n \"max-height\": max_height.toString() + \"px\",\n \"height\": height.toString() + \"px\"\n });\n this.menu.inner_selector.style({ \"max-width\": content_max_width.toString() + \"px\" });\n this.menu.inner_selector.node().scrollTop = this.menu.scroll_position;\n return this.menu;\n }.bind(this),\n hide: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.outer_selector.style({ visibility: \"hidden\" });\n this.menu.hidden = true;\n return this.menu;\n }.bind(this),\n destroy: function(){\n if (!this.menu.outer_selector){ return this.menu; }\n this.menu.inner_selector.remove();\n this.menu.outer_selector.remove();\n this.menu.inner_selector = null;\n this.menu.outer_selector = null;\n return this.menu;\n }.bind(this),\n /**\n * Internal method definition\n * By convention populate() does nothing and should be reimplemented with each dashboard button definition\n * Reimplement by way of Dashboard.Component.Button.menu.setPopulate to define the populate method and hook\n * up standard menu click-toggle behavior prototype.\n * @protected\n */\n populate: function(){ /* stub */ }.bind(this),\n /**\n * Define how the menu is populated with items, and set up click and display properties as appropriate\n * @public\n */\n setPopulate: function(menu_populate_function){\n if (typeof menu_populate_function == \"function\"){\n this.menu.populate = menu_populate_function;\n this.setOnclick(function(){\n if (this.menu.hidden){\n this.menu.show();\n this.highlight().update();\n this.persist = true;\n } else {\n this.menu.hide();\n this.highlight(false).update();\n if (!this.permanent){ this.persist = false; }\n }\n }.bind(this));\n } else {\n this.setOnclick();\n }\n return this;\n }.bind(this)\n };\n\n};\n\n/**\n * Renders arbitrary text with title formatting\n * @class LocusZoom.Dashboard.Components.title\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.title Text to render\n */\nLocusZoom.Dashboard.Components.add(\"title\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.show = function(){\n this.div_selector = this.parent.selector.append(\"div\")\n .attr(\"class\", \"lz-dashboard-title lz-dashboard-\" + this.layout.position);\n this.title_selector = this.div_selector.append(\"h3\");\n return this.update();\n };\n this.update = function(){\n var title = layout.title.toString();\n if (this.layout.subtitle){ title += \" \" + this.layout.subtitle + \"\"; }\n this.title_selector.html(title);\n return this;\n };\n});\n\n/**\n * Renders text to display the current dimensions of the plot. Automatically updated as plot dimensions change\n * @class LocusZoom.Dashboard.Components.dimensions\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"dimensions\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var display_width = this.parent_plot.layout.width.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.width : this.parent_plot.layout.width.toFixed(2);\n var display_height = this.parent_plot.layout.height.toString().indexOf(\".\") === -1 ? this.parent_plot.layout.height : this.parent_plot.layout.height.toFixed(2);\n this.selector.html(display_width + \"px × \" + display_height + \"px\");\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Display the current scale of the genome region displayed in the plot, as defined by the difference between\n * `state.end` and `state.start`.\n * @class LocusZoom.Dashboard.Components.region_scale\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"region_scale\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (!isNaN(this.parent_plot.state.start) && !isNaN(this.parent_plot.state.end)\n && this.parent_plot.state.start !== null && this.parent_plot.state.end !== null){\n this.selector.style(\"display\", null);\n this.selector.html(LocusZoom.positionIntToString(this.parent_plot.state.end - this.parent_plot.state.start, null, true));\n } else {\n this.selector.style(\"display\", \"none\");\n }\n if (layout.class){ this.selector.attr(\"class\", layout.class); }\n if (layout.style){ this.selector.style(layout.style); }\n return this;\n };\n});\n\n/**\n * Button to export current plot to an SVG image\n * @class LocusZoom.Dashboard.Components.download\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"download\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Download Image\").setTitle(\"Download image of the current plot as locuszoom.svg\")\n .setOnMouseover(function() {\n this.button.selector\n .classed(\"lz-dashboard-button-gray-disabled\", true)\n .html(\"Preparing Image\");\n this.generateBase64SVG().then(function(base64_string){\n this.button.selector\n .attr(\"href\", \"data:image/svg+xml;base64,\\n\" + base64_string)\n .classed(\"lz-dashboard-button-gray-disabled\", false)\n .classed(\"lz-dashboard-button-gray-highlighted\", true)\n .html(\"Download Image\");\n }.bind(this));\n }.bind(this))\n .setOnMouseout(function() {\n this.button.selector.classed(\"lz-dashboard-button-gray-highlighted\", false);\n }.bind(this));\n this.button.show();\n this.button.selector.attr(\"href-lang\", \"image/svg+xml\").attr(\"download\", \"locuszoom.svg\");\n return this;\n };\n this.css_string = \"\";\n for (var stylesheet in Object.keys(document.styleSheets)){\n if ( document.styleSheets[stylesheet].href !== null\n && document.styleSheets[stylesheet].href.indexOf(\"locuszoom.css\") !== -1){\n // TODO: \"Download image\" button will render the image incorrectly if the stylesheet has been renamed or concatenated\n LocusZoom.createCORSPromise(\"GET\", document.styleSheets[stylesheet].href)\n .then(function(response){\n this.css_string = response.replace(/[\\r\\n]/g,\" \").replace(/\\s+/g,\" \");\n if (this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\")){\n this.css_string = this.css_string.substring(0, this.css_string.indexOf(\"/* ! LocusZoom HTML Styles */\"));\n }\n }.bind(this));\n break;\n }\n } \n this.generateBase64SVG = function(){\n return Q.fcall(function () {\n // Insert a hidden div, clone the node into that so we can modify it with d3\n var container = this.parent.selector.append(\"div\").style(\"display\", \"none\")\n .html(this.parent_plot.svg.node().outerHTML);\n // Remove unnecessary elements\n container.selectAll(\"g.lz-curtain\").remove();\n container.selectAll(\"g.lz-mouse_guide\").remove();\n // Convert units on axis tick dy attributes from ems to pixels\n container.selectAll(\"g.tick text\").each(function(){\n var dy = +(d3.select(this).attr(\"dy\").substring(-2).slice(0,-2))*10;\n d3.select(this).attr(\"dy\", dy);\n });\n // Pull the svg into a string and add the contents of the locuszoom stylesheet\n // Don't add this with d3 because it will escape the CDATA declaration incorrectly\n var initial_html = d3.select(container.select(\"svg\").node().parentNode).html();\n var style_def = \"\";\n var insert_at = initial_html.indexOf(\">\") + 1;\n initial_html = initial_html.slice(0,insert_at) + style_def + initial_html.slice(insert_at);\n // Delete the container node\n container.remove();\n // Base64-encode the string and return it\n return btoa(encodeURIComponent(initial_html).replace(/%([0-9A-F]{2})/g, function(match, p1) {\n return String.fromCharCode(\"0x\" + p1);\n }));\n }.bind(this));\n };\n});\n\n/**\n * Button to remove panel from plot.\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.remove_panel\n * @augments LocusZoom.Dashboard.Component\n * @param {Boolean} [layout.suppress_confirm=false] If true, removes the panel without prompting user for confirmation\n */\nLocusZoom.Dashboard.Components.add(\"remove_panel\", function(layout) {\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function() {\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"×\").setTitle(\"Remove panel\")\n .setOnclick(function(){\n if (!layout.suppress_confirm && !confirm(\"Are you sure you want to remove this panel? This cannot be undone!\")){\n return false;\n }\n var panel = this.parent_panel;\n panel.dashboard.hide(true);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseover.\" + panel.getBaseId() + \".dashboard\", null);\n d3.select(panel.parent.svg.node().parentNode).on(\"mouseout.\" + panel.getBaseId() + \".dashboard\", null);\n return panel.parent.removePanel(panel.id);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to move panel up relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_up\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_up\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_top = (this.parent_panel.layout.y_index === 0);\n this.button.disable(is_at_top);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▴\").setTitle(\"Move panel up\")\n .setOnclick(function(){\n this.parent_panel.moveUp();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to move panel down relative to other panels (in terms of y-index on the page)\n * NOTE: Will only work on panel dashboards.\n * @class LocusZoom.Dashboard.Components.move_panel_down\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"move_panel_down\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){\n var is_at_bottom = (this.parent_panel.layout.y_index === this.parent_plot.panel_ids_by_y_index.length-1);\n this.button.disable(is_at_bottom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"▾\").setTitle(\"Move panel down\")\n .setOnclick(function(){\n this.parent_panel.moveDown();\n this.update();\n }.bind(this));\n this.button.show();\n return this.update();\n };\n});\n\n/**\n * Button to shift plot region forwards or back by a `step` increment provided in the layout\n * @class LocusZoom.Dashboard.Components.shift_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=50000] The stepsize to change the region by\n * @param {string} [layout.button_html]\n * @param {string} [layout.button_title]\n */\nLocusZoom.Dashboard.Components.add(\"shift_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add shift_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 50000; }\n if (typeof layout.button_html !== \"string\"){ layout.button_html = layout.step > 0 ? \">\" : \"<\"; }\n if (typeof layout.button_title !== \"string\"){\n layout.button_title = \"Shift region by \" + (layout.step > 0 ? \"+\" : \"-\") + LocusZoom.positionIntToString(Math.abs(layout.step),null,true);\n }\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start + layout.step, 1),\n end: this.parent_plot.state.end + layout.step\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Zoom in or out on the plot, centered on the middle of the plot region, by the specified amount\n * @class LocusZoom.Dashboard.Components.zoom_region\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {number} [layout.step=0.2] The amount to zoom in by (where 1 indicates 100%)\n */\nLocusZoom.Dashboard.Components.add(\"zoom_region\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (isNaN(this.parent_plot.state.start) || isNaN(this.parent_plot.state.end)){\n this.update = function(){};\n console.warn(\"Unable to add zoom_region dashboard component: plot state does not have region bounds\");\n return;\n }\n if (isNaN(layout.step) || layout.step === 0){ layout.step = 0.2; }\n if (typeof layout.button_html != \"string\"){ layout.button_html = layout.step > 0 ? \"z–\" : \"z+\"; }\n if (typeof layout.button_title != \"string\"){\n layout.button_title = \"Zoom region \" + (layout.step > 0 ? \"out\" : \"in\") + \" by \" + (Math.abs(layout.step)*100).toFixed(1) + \"%\";\n }\n this.update = function(){\n if (this.button){\n var can_zoom = true;\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n if (layout.step > 0 && !isNaN(this.parent_plot.layout.max_region_scale) && current_region_scale >= this.parent_plot.layout.max_region_scale){\n can_zoom = false;\n }\n if (layout.step < 0 && !isNaN(this.parent_plot.layout.min_region_scale) && current_region_scale <= this.parent_plot.layout.min_region_scale){\n can_zoom = false;\n }\n this.button.disable(!can_zoom);\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n var current_region_scale = this.parent_plot.state.end - this.parent_plot.state.start;\n var zoom_factor = 1 + layout.step;\n var new_region_scale = current_region_scale * zoom_factor;\n if (!isNaN(this.parent_plot.layout.max_region_scale)){\n new_region_scale = Math.min(new_region_scale, this.parent_plot.layout.max_region_scale);\n }\n if (!isNaN(this.parent_plot.layout.min_region_scale)){\n new_region_scale = Math.max(new_region_scale, this.parent_plot.layout.min_region_scale);\n }\n var delta = Math.floor((new_region_scale - current_region_scale) / 2);\n this.parent_plot.applyState({\n start: Math.max(this.parent_plot.state.start - delta, 1),\n end: this.parent_plot.state.end + delta\n });\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Renders button with arbitrary text that, when clicked, shows a dropdown containing arbitrary HTML\n * NOTE: Trusts content exactly as given. XSS prevention is the responsibility of the implementer.\n * @class LocusZoom.Dashboard.Components.menu\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n * @param {string} layout.menu_html The HTML content of the dropdown menu\n */\nLocusZoom.Dashboard.Components.add(\"menu\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title);\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(layout.menu_html);\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Special button/menu to allow model building by tracking individual covariants. Will track a list of covariate\n * objects and store them in the special `model.covariates` field of plot `state`.\n * @class LocusZoom.Dashboard.Components.covariates_model\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {string} layout.button_html The HTML to render inside the button\n * @param {string} layout.button_title Text to display as a tooltip when hovering over the button\n */\nLocusZoom.Dashboard.Components.add(\"covariates_model\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.initialize = function(){\n // Initialize state.model.covariates\n this.parent_plot.state.model = this.parent_plot.state.model || {};\n this.parent_plot.state.model.covariates = this.parent_plot.state.model.covariates || [];\n // Create an object at the plot level for easy access to interface methods in custom client-side JS\n /**\n * When a covariates model dashboard element is present, create (one) object at the plot level that exposes\n * component data and state for custom interactions with other plot elements.\n * @class LocusZoom.Plot.CovariatesModel\n */\n this.parent_plot.CovariatesModel = {\n /** @member {LocusZoom.Dashboard.Component.Button} */\n button: this,\n /**\n * Add an element to the model and show a representation of it in the dashboard component menu. If the\n * element is already part of the model, do nothing (to avoid adding duplicates).\n * When plot state is changed, this will automatically trigger requests for new data accordingly.\n * @param {string|object} element_reference Can be any value that can be put through JSON.stringify()\n * to create a serialized representation of itself.\n */\n add: function(element_reference){\n var element = JSON.parse(JSON.stringify(element_reference));\n if (typeof element_reference == \"object\" && typeof element.html != \"string\"){\n element.html = ( (typeof element_reference.toHTML == \"function\") ? element_reference.toHTML() : element_reference.toString());\n }\n // Check if the element is already in the model covariates array and return if it is.\n for (var i = 0; i < this.state.model.covariates.length; i++) {\n if (JSON.stringify(this.state.model.covariates[i]) === JSON.stringify(element)) {\n return this;\n }\n }\n this.state.model.covariates.push(element);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Remove an element from `state.model.covariates` (and from the dashboard component menu's\n * representation of the state model). When plot state is changed, this will automatically trigger\n * requests for new data accordingly.\n * @param {number} idx Array index of the element, in the `state.model.covariates array`.\n */\n removeByIdx: function(idx){\n if (typeof this.state.model.covariates[idx] == \"undefined\"){\n throw(\"Unable to remove model covariate, invalid index: \" + idx.toString());\n }\n this.state.model.covariates.splice(idx, 1);\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Empty the `state.model.covariates` array (and dashboard component menu representation thereof) of all\n * elements. When plot state is changed, this will automatically trigger requests for new data accordingly\n */\n removeAll: function(){\n this.state.model.covariates = [];\n this.applyState();\n this.CovariatesModel.updateComponent();\n return this;\n }.bind(this.parent_plot),\n /**\n * Manually trigger the update methods on the dashboard component's button and menu elements to force\n * display of most up-to-date content. Can be used to force the dashboard to reflect changes made, eg if\n * modifying `state.model.covariates` directly instead of via `plot.CovariatesModel`\n */\n updateComponent: function(){\n this.button.update();\n this.button.menu.update();\n }.bind(this)\n };\n }.bind(this);\n\n this.update = function(){\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n var selector = this.button.menu.inner_selector;\n selector.html(\"\");\n // General model HTML representation\n if (typeof this.parent_plot.state.model.html != \"undefined\"){\n selector.append(\"div\").html(this.parent_plot.state.model.html);\n }\n // Model covariates table\n if (!this.parent_plot.state.model.covariates.length){\n selector.append(\"i\").html(\"no covariates in model\");\n } else {\n selector.append(\"h5\").html(\"Model Covariates (\" + this.parent_plot.state.model.covariates.length + \")\");\n var table = selector.append(\"table\");\n this.parent_plot.state.model.covariates.forEach(function(covariate, idx){\n var html = ( (typeof covariate == \"object\" && typeof covariate.html == \"string\") ? covariate.html : covariate.toString() );\n var row = table.append(\"tr\");\n row.append(\"td\").append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeByIdx(idx);\n }.bind(this))\n .html(\"×\");\n row.append(\"td\").html(html);\n }.bind(this));\n selector.append(\"button\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color)\n .style({ \"margin-left\": \"4px\" }).html(\"× Remove All Covariates\")\n .on(\"click\", function(){\n this.parent_plot.CovariatesModel.removeAll();\n }.bind(this));\n }\n }.bind(this));\n\n this.button.preUpdate = function(){\n var html = \"Model\";\n if (this.parent_plot.state.model.covariates.length){\n var cov = this.parent_plot.state.model.covariates.length > 1 ? \"covariates\" : \"covariate\";\n html += \" (\" + this.parent_plot.state.model.covariates.length + \" \" + cov + \")\";\n }\n this.button.setHtml(html).disable(false);\n }.bind(this);\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Button to toggle split tracks\n * @class LocusZoom.Dashboard.Components.toggle_split_tracks\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_split_tracks\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n if (!layout.data_layer_id){ layout.data_layer_id = \"intervals\"; }\n if (!this.parent_panel.data_layers[layout.data_layer_id]){\n throw (\"Dashboard toggle split tracks component missing valid data layer ID\");\n }\n this.update = function(){\n var data_layer = this.parent_panel.data_layers[layout.data_layer_id];\n var html = data_layer.layout.split_tracks ? \"Merge Tracks\" : \"Split Tracks\";\n if (this.button){\n this.button.setHtml(html);\n this.button.show();\n this.parent.position();\n return this;\n } else {\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(html)\n .setTitle(\"Toggle whether tracks are split apart or merged together\")\n .setOnclick(function(){\n data_layer.toggleSplitTracks();\n if (this.scale_timeout){ clearTimeout(this.scale_timeout); }\n var timeout = data_layer.layout.transition ? +data_layer.layout.transition.duration || 0 : 0;\n this.scale_timeout = setTimeout(function(){\n this.parent_panel.scaleHeightToData();\n this.parent_plot.positionPanels();\n }.bind(this), timeout);\n this.update();\n }.bind(this));\n return this.update();\n }\n };\n});\n\n/**\n * Button to resize panel height to fit available data (eg when showing a list of tracks)\n * @class LocusZoom.Dashboard.Components.resize_to_data\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"resize_to_data\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n if (this.button){ return this; }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(\"Resize to Data\")\n .setTitle(\"Automatically resize this panel to fit the data its currently showing\")\n .setOnclick(function(){\n this.parent_panel.scaleHeightToData();\n this.update();\n }.bind(this));\n this.button.show();\n return this;\n };\n});\n\n/**\n * Button to toggle legend\n * @class LocusZoom.Dashboard.Components.toggle_legend\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"toggle_legend\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n this.update = function(){\n var html = this.parent_panel.legend.layout.hidden ? \"Show Legend\" : \"Hide Legend\";\n if (this.button){\n this.button.setHtml(html).show();\n this.parent.position();\n return this;\n }\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color)\n .setTitle(\"Show or hide the legend for this panel\")\n .setOnclick(function(){\n this.parent_panel.legend.layout.hidden = !this.parent_panel.legend.layout.hidden;\n this.parent_panel.legend.render();\n this.update();\n }.bind(this));\n return this.update();\n };\n});\n\n/**\n * Menu for manipulating multiple data layers in a single panel: show/hide, change order, etc.\n * @class LocusZoom.Dashboard.Components.data_layers\n * @augments LocusZoom.Dashboard.Component\n */\nLocusZoom.Dashboard.Components.add(\"data_layers\", function(layout){\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n this.update = function(){\n\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Data Layers\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Manipulate Data Layers (sort, dim, show/hide, etc.)\"; }\n\n if (this.button){ return this; }\n\n this.button = new LocusZoom.Dashboard.Component.Button(this)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function(){\n this.button.menu.populate();\n }.bind(this));\n\n this.button.menu.setPopulate(function(){\n this.button.menu.inner_selector.html(\"\");\n var table = this.button.menu.inner_selector.append(\"table\");\n this.parent_panel.data_layer_ids_by_z_index.slice().reverse().forEach(function(id, idx){\n var data_layer = this.parent_panel.data_layers[id];\n var name = (typeof data_layer.layout.name != \"string\") ? data_layer.id : data_layer.layout.name;\n var row = table.append(\"tr\");\n // Layer name\n row.append(\"td\").html(name);\n // Status toggle buttons\n layout.statuses.forEach(function(status_adj){\n var status_idx = LocusZoom.DataLayer.Statuses.adjectives.indexOf(status_adj);\n var status_verb = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n var html, onclick, highlight;\n if (data_layer.global_statuses[status_adj]){\n html = LocusZoom.DataLayer.Statuses.menu_antiverbs[status_idx];\n onclick = \"un\" + status_verb + \"AllElements\";\n highlight = \"-highlighted\";\n } else {\n html = LocusZoom.DataLayer.Statuses.verbs[status_idx];\n onclick = status_verb + \"AllElements\";\n highlight = \"\";\n }\n row.append(\"td\").append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-\" + this.layout.color + highlight)\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer[onclick](); this.button.menu.populate(); }.bind(this))\n .html(html);\n }.bind(this));\n // Sort layer buttons\n var at_top = (idx === 0);\n var at_bottom = (idx === (this.parent_panel.data_layer_ids_by_z_index.length - 1));\n var td = row.append(\"td\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-start lz-dashboard-button-\" + this.layout.color + (at_bottom ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveDown(); this.button.menu.populate(); }.bind(this))\n .html(\"▾\").attr(\"title\", \"Move layer down (further back)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-middle lz-dashboard-button-\" + this.layout.color + (at_top ? \"-disabled\" : \"\"))\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){ data_layer.moveUp(); this.button.menu.populate(); }.bind(this))\n .html(\"▴\").attr(\"title\", \"Move layer up (further front)\");\n td.append(\"a\")\n .attr(\"class\", \"lz-dashboard-button lz-dashboard-button-group-end lz-dashboard-button-red\")\n .style({ \"margin-left\": \"0em\" })\n .on(\"click\", function(){\n if (confirm(\"Are you sure you want to remove the \" + name + \" layer? This cannot be undone!\")){\n data_layer.parent.removeDataLayer(id);\n }\n return this.button.menu.populate();\n }.bind(this))\n .html(\"×\").attr(\"title\", \"Remove layer\");\n }.bind(this));\n return this;\n }.bind(this));\n\n this.button.show();\n\n return this;\n };\n});\n\n/**\n * Dropdown menu allowing the user to choose between different display options for a single specific data layer\n * within a panel.\n *\n * This allows controlling how points on a datalayer can be displayed- any display options supported via the layout for the target datalayer. This includes point\n * size/shape, coloring, etc.\n *\n * This button intentionally limits display options it can control to those available on common plot types.\n * Although the list of options it sets can be overridden (to control very special custom plot types), this\n * capability should be used sparingly if at all.\n *\n * @class LocusZoom.Dashboard.Components.display_options\n * @augments LocusZoom.Dashboard.Component\n * @param {object} layout\n * @param {String} [layout.button_html=\"Display options\"] Text to display on the toolbar button\n * @param {String} [layout.button_title=\"Control how plot items are displayed\"] Hover text for the toolbar button\n * @param {string} layout.layer_name Specify the datalayer that this button should affect\n * @param {string} [layout.default_config_display_name] Store the default configuration for this datalayer\n * configuration, and show a button to revert to the \"default\" (listing the human-readable display name provided)\n * @param {Array} [layout.fields_whitelist='see code'] The list of presentation fields that this button can control.\n * This can be overridden if this button needs to be used on a custom layer type with special options.\n * @typedef {{display_name: string, display: Object}} DisplayOptionsButtonConfigField\n * @param {DisplayOptionsButtonConfigField[]} layout.options Specify a label and set of layout directives associated\n * with this `display` option. Display field should include all changes to datalayer presentation options.\n */\nLocusZoom.Dashboard.Components.add(\"display_options\", function (layout) {\n if (typeof layout.button_html != \"string\"){ layout.button_html = \"Display options\"; }\n if (typeof layout.button_title != \"string\"){ layout.button_title = \"Control how plot items are displayed\"; }\n\n // Call parent constructor\n LocusZoom.Dashboard.Component.apply(this, arguments);\n\n // List of layout fields that this button is allowed to control. This ensures that we don't override any other\n // information (like plot height etc) while changing point rendering\n var allowed_fields = layout.fields_whitelist || [\"color\", \"fill_opacity\", \"label\", \"legend\",\n \"point_shape\", \"point_size\", \"tooltip\", \"tooltip_positioning\"];\n\n var dataLayer = this.parent_panel.data_layers[layout.layer_name];\n var dataLayerLayout = dataLayer.layout;\n\n // Store default configuration for the layer as a clean deep copy, so we may revert later\n var defaultConfig = {};\n allowed_fields.forEach(function(name) {\n var configSlot = dataLayerLayout[name];\n if (configSlot) {\n defaultConfig[name] = JSON.parse(JSON.stringify(configSlot));\n }\n });\n\n /**\n * Which item in the menu is currently selected. (track for rerendering menu)\n * @member {String}\n * @private\n */\n this._selected_item = \"default\";\n\n // Define the button + menu that provides the real functionality for this dashboard component\n var self = this;\n this.button = new LocusZoom.Dashboard.Component.Button(self)\n .setColor(layout.color).setHtml(layout.button_html).setTitle(layout.button_title)\n .setOnclick(function () {\n self.button.menu.populate();\n });\n this.button.menu.setPopulate(function () {\n // Multiple copies of this button might be used on a single LZ page; append unique IDs where needed\n var uniqueID = Math.floor(Math.random() * 1e4).toString();\n\n self.button.menu.inner_selector.html(\"\");\n var table = self.button.menu.inner_selector.append(\"table\");\n\n var menuLayout = self.layout;\n\n var renderRow = function(display_name, display_options, row_id) { // Helper method\n var row = table.append(\"tr\");\n row.append(\"td\")\n .append(\"input\")\n .attr({type: \"radio\", name: \"color-picker-\" + uniqueID, value: row_id})\n .property(\"checked\", (row_id === self._selected_item))\n .on(\"click\", function () {\n Object.keys(display_options).forEach(function(field_name) {\n dataLayer.layout[field_name] = display_options[field_name];\n });\n self._selected_item = row_id;\n self.parent_panel.render();\n var legend = self.parent_panel.legend;\n if (legend && display_options.legend) {\n // Update the legend only if necessary\n legend.render();\n }\n });\n row.append(\"td\").text(display_name);\n };\n // Render the \"display options\" menu: default and special custom options\n var defaultName = menuLayout.default_config_display_name || \"Default style\";\n renderRow(defaultName, defaultConfig, \"default\");\n menuLayout.options.forEach(function (item, index) {\n renderRow(item.display_name, item.display, index);\n });\n return self;\n });\n\n this.update = function () {\n this.button.show();\n return this;\n };\n});\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * An SVG object used to display contextual information about a panel.\n * Panel layouts determine basic features of a legend - its position in the panel, orientation, title, etc.\n * Layouts of child data layers of the panel determine the actual content of the legend.\n *\n * @class\n * @param {LocusZoom.Panel} parent\n*/\nLocusZoom.Legend = function(parent){\n if (!(parent instanceof LocusZoom.Panel)){\n throw \"Unable to create legend, parent must be a locuszoom panel\";\n }\n /** @member {LocusZoom.Panel} */\n this.parent = parent;\n /** @member {String} */\n this.id = this.parent.getBaseId() + \".legend\";\n\n this.parent.layout.legend = LocusZoom.Layouts.merge(this.parent.layout.legend || {}, LocusZoom.Legend.DefaultLayout);\n /** @member {Object} */\n this.layout = this.parent.layout.legend;\n\n /** @member {d3.selection} */\n this.selector = null;\n /** @member {d3.selection} */\n this.background_rect = null;\n /** @member {d3.selection[]} */\n this.elements = [];\n /**\n * SVG selector for the group containing all elements in the legend\n * @protected\n * @member {d3.selection|null}\n */\n this.elements_group = null;\n\n /**\n * TODO: Not sure if this property is used; the external-facing methods are setting `layout.hidden` instead. Tentatively mark deprecated.\n * @deprecated\n * @protected\n * @member {Boolean}\n */\n this.hidden = false;\n\n // TODO Revisit constructor return value; see https://stackoverflow.com/a/3350364/1422268\n return this.render();\n};\n\n/**\n * The default layout used by legends (used internally)\n * @protected\n * @member {Object}\n */\nLocusZoom.Legend.DefaultLayout = {\n orientation: \"vertical\",\n origin: { x: 0, y: 0 },\n width: 10,\n height: 10,\n padding: 5,\n label_size: 12,\n hidden: false\n};\n\n/**\n * Render the legend in the parent panel\n */\nLocusZoom.Legend.prototype.render = function(){\n\n // Get a legend group selector if not yet defined\n if (!this.selector){\n this.selector = this.parent.svg.group.append(\"g\")\n .attr(\"id\", this.parent.getBaseId() + \".legend\").attr(\"class\", \"lz-legend\");\n }\n\n // Get a legend background rect selector if not yet defined\n if (!this.background_rect){\n this.background_rect = this.selector.append(\"rect\")\n .attr(\"width\", 100).attr(\"height\", 100).attr(\"class\", \"lz-legend-background\");\n }\n\n // Get a legend elements group selector if not yet defined\n if (!this.elements_group){\n this.elements_group = this.selector.append(\"g\");\n }\n\n // Remove all elements from the document and re-render from scratch\n this.elements.forEach(function(element){\n element.remove();\n });\n this.elements = [];\n\n // Gather all elements from data layers in order (top to bottom) and render them\n var padding = +this.layout.padding || 1;\n var x = padding;\n var y = padding;\n var line_height = 0;\n this.parent.data_layer_ids_by_z_index.slice().reverse().forEach(function(id){\n if (Array.isArray(this.parent.data_layers[id].layout.legend)){\n this.parent.data_layers[id].layout.legend.forEach(function(element){\n var selector = this.elements_group.append(\"g\")\n .attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n var label_size = +element.label_size || +this.layout.label_size || 12;\n var label_x = 0;\n var label_y = (label_size/2) + (padding/2);\n line_height = Math.max(line_height, label_size + padding);\n // Draw the legend element symbol (line, rect, shape, etc)\n if (element.shape === \"line\"){\n // Line symbol\n var length = +element.length || 16;\n var path_y = (label_size/4) + (padding/2);\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", \"M0,\" + path_y + \"L\" + length + \",\" + path_y)\n .style(element.style || {});\n label_x = length + padding;\n } else if (element.shape === \"rect\"){\n // Rect symbol\n var width = +element.width || 16;\n var height = +element.height || width;\n selector.append(\"rect\").attr(\"class\", element.class || \"\")\n .attr(\"width\", width).attr(\"height\", height)\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = width + padding;\n line_height = Math.max(line_height, height + padding);\n } else if (d3.svg.symbolTypes.indexOf(element.shape) !== -1) {\n // Shape symbol (circle, diamond, etc.)\n var size = +element.size || 40;\n var radius = Math.ceil(Math.sqrt(size/Math.PI));\n selector.append(\"path\").attr(\"class\", element.class || \"\")\n .attr(\"d\", d3.svg.symbol().size(size).type(element.shape))\n .attr(\"transform\", \"translate(\" + radius + \",\" + (radius+(padding/2)) + \")\")\n .attr(\"fill\", element.color || {})\n .style(element.style || {});\n label_x = (2*radius) + padding;\n label_y = Math.max((2*radius)+(padding/2), label_y);\n line_height = Math.max(line_height, (2*radius) + padding);\n }\n // Draw the legend element label\n selector.append(\"text\").attr(\"text-anchor\", \"left\").attr(\"class\", \"lz-label\")\n .attr(\"x\", label_x).attr(\"y\", label_y).style({\"font-size\": label_size}).text(element.label);\n // Position the legend element group based on legend layout orientation\n var bcr = selector.node().getBoundingClientRect();\n if (this.layout.orientation === \"vertical\"){\n y += bcr.height + padding;\n line_height = 0;\n } else {\n // Ensure this element does not exceed the panel width\n // (E.g. drop to the next line if it does, but only if it's not the only element on this line)\n var right_x = this.layout.origin.x + x + bcr.width;\n if (x > padding && right_x > this.parent.layout.width){\n y += line_height;\n x = padding;\n selector.attr(\"transform\", \"translate(\" + x + \",\" + y + \")\");\n }\n x += bcr.width + (3*padding);\n }\n // Store the element\n this.elements.push(selector);\n }.bind(this));\n }\n }.bind(this));\n\n // Scale the background rect to the elements in the legend\n var bcr = this.elements_group.node().getBoundingClientRect();\n this.layout.width = bcr.width + (2*this.layout.padding);\n this.layout.height = bcr.height + (2*this.layout.padding);\n this.background_rect\n .attr(\"width\", this.layout.width)\n .attr(\"height\", this.layout.height);\n\n // Set the visibility on the legend from the \"hidden\" flag\n // TODO: `show()` and `hide()` call a full rerender; might be able to make this more lightweight?\n this.selector.style({ visibility: this.layout.hidden ? \"hidden\" : \"visible\" });\n\n // TODO: Annotate return type and make consistent\n return this.position();\n};\n\n/**\n * Place the legend in position relative to the panel, as specified in the layout configuration\n * @returns {LocusZoom.Legend | null}\n * TODO: should this always be chainable?\n */\nLocusZoom.Legend.prototype.position = function(){\n if (!this.selector){ return this; }\n var bcr = this.selector.node().getBoundingClientRect();\n if (!isNaN(+this.layout.pad_from_bottom)){\n this.layout.origin.y = this.parent.layout.height - bcr.height - +this.layout.pad_from_bottom;\n }\n if (!isNaN(+this.layout.pad_from_right)){\n this.layout.origin.x = this.parent.layout.width - bcr.width - +this.layout.pad_from_right;\n }\n this.selector.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n};\n\n/**\n * Hide the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.hide = function(){\n this.layout.hidden = true;\n this.render();\n};\n\n/**\n * Show the legend (triggers a re-render)\n * @public\n */\nLocusZoom.Legend.prototype.show = function(){\n this.layout.hidden = false;\n this.render();\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * LocusZoom functionality used for data parsing and retrieval\n * @namespace\n * @public\n */\nLocusZoom.Data = LocusZoom.Data || {};\n\n/**\n * Create and coordinate an ensemble of (namespaced) data source instances\n * @public\n * @class\n */\nLocusZoom.DataSources = function() {\n /** @member {Object.} */\n this.sources = {};\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.addSource = function(ns, x) {\n console.warn(\"Warning: .addSource() is deprecated. Use .add() instead\");\n return this.add(ns, x);\n};\n\n/**\n * Add a (namespaced) datasource to the plot\n * @public\n * @param {String} ns A namespace used for fields from this data source\n * @param {LocusZoom.Data.Source|Array|null} x An instantiated datasource, or an array of arguments that can be used to\n * create a known datasource type.\n */\nLocusZoom.DataSources.prototype.add = function(ns, x) {\n return this.set(ns, x);\n};\n\n/** @protected */\nLocusZoom.DataSources.prototype.set = function(ns, x) {\n if (Array.isArray(x)) {\n // If passed array of source name and options, make the source\n var dsobj = LocusZoom.KnownDataSources.create.apply(null, x);\n // Each datasource in the chain should be aware of its assigned namespace\n dsobj.source_id = ns;\n this.sources[ns] = dsobj;\n } else {\n // If passed the already-created source object\n if (x !== null) {\n x.source_id = ns;\n this.sources[ns] = x;\n } else {\n delete this.sources[ns];\n }\n }\n return this;\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.getSource = function(ns) {\n console.warn(\"Warning: .getSource() is deprecated. Use .get() instead\");\n return this.get(ns);\n};\n\n/**\n * Return the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n * @returns {LocusZoom.Data.Source}\n */\nLocusZoom.DataSources.prototype.get = function(ns) {\n return this.sources[ns];\n};\n\n/** @deprecated */\nLocusZoom.DataSources.prototype.removeSource = function(ns) {\n console.warn(\"Warning: .removeSource() is deprecated. Use .remove() instead\");\n return this.remove(ns);\n};\n\n/**\n * Remove the datasource associated with a given namespace\n * @public\n * @param {String} ns Namespace\n */\nLocusZoom.DataSources.prototype.remove = function(ns) {\n return this.set(ns, null);\n};\n\n/**\n * Populate a list of datasources specified as a JSON object\n * @public\n * @param {String|Object} x An object or JSON representation containing {ns: configArray} entries\n * @returns {LocusZoom.DataSources}\n */\nLocusZoom.DataSources.prototype.fromJSON = function(x) {\n if (typeof x === \"string\") {\n x = JSON.parse(x);\n }\n var ds = this;\n Object.keys(x).forEach(function(ns) {\n ds.set(ns, x[ns]);\n });\n return ds;\n};\n\n/**\n * Return the names of all currently recognized datasources\n * @public\n * @returns {Array}\n */\nLocusZoom.DataSources.prototype.keys = function() {\n return Object.keys(this.sources);\n};\n\n/**\n * Datasources can be instantiated from a JSON object instead of code. This represents existing sources in that format.\n * For example, this can be helpful when sharing plots, or to share settings with others when debugging\n * @public\n */\nLocusZoom.DataSources.prototype.toJSON = function() {\n return this.sources;\n};\n\n/**\n * Represents an addressable unit of data from a namespaced datasource, subject to specified value transformations.\n *\n * When used by a data layer, fields will automatically be re-fetched from the appropriate data source whenever the\n * state of a plot fetches, eg pan or zoom operations that would affect what data is displayed.\n *\n * @public\n * @class\n * @param {String} field A string representing the namespace of the datasource, the name of the desired field to fetch\n * from that datasource, and arbitrarily many transformations to apply to the value. The namespace and\n * transformation(s) are optional and information is delimited according to the general syntax\n * `[namespace:]name[|transformation][|transformation]`. For example, `association:pvalue|neglog10`\n */\nLocusZoom.Data.Field = function(field){\n \n var parts = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/.exec(field);\n /** @member {String} */\n this.full_name = field;\n /** @member {String} */\n this.namespace = parts[1] || null;\n /** @member {String} */\n this.name = parts[2] || null;\n /** @member {Array} */\n this.transformations = [];\n \n if (typeof parts[3] == \"string\" && parts[3].length > 1){\n this.transformations = parts[3].substring(1).split(\"|\");\n this.transformations.forEach(function(transform, i){\n this.transformations[i] = LocusZoom.TransformationFunctions.get(transform);\n }.bind(this));\n }\n\n this.applyTransformations = function(val){\n this.transformations.forEach(function(transform){\n val = transform(val);\n });\n return val;\n };\n\n // Resolve the field for a given data element.\n // First look for a full match with transformations already applied by the data requester.\n // Otherwise prefer a namespace match and fall back to just a name match, applying transformations on the fly.\n this.resolve = function(d){\n if (typeof d[this.full_name] == \"undefined\"){\n var val = null;\n if (typeof (d[this.namespace+\":\"+this.name]) != \"undefined\"){ val = d[this.namespace+\":\"+this.name]; }\n else if (typeof d[this.name] != \"undefined\"){ val = d[this.name]; }\n d[this.full_name] = this.applyTransformations(val);\n }\n return d[this.full_name];\n };\n \n};\n\n/**\n * The Requester manages fetching of data across multiple data sources. It is used internally by LocusZoom data layers.\n * It passes state information and ensures that data is formatted in the manner expected by the plot.\n *\n * It is also responsible for constructing a \"chain\" of dependent requests, by requesting each datasource\n * sequentially in the order specified in the datalayer `fields` array. Data sources are only chained within a\n * data layer, and only if that layer requests more than one kind of data source.\n * @param {LocusZoom.DataSources} sources An object of {ns: LocusZoom.Data.Source} instances\n * @class\n */\nLocusZoom.Data.Requester = function(sources) {\n\n function split_requests(fields) {\n // Given a fields array, return an object specifying what datasource names the data layer should make requests\n // to, and how to handle the returned data\n var requests = {};\n // Regular expression finds namespace:field|trans\n var re = /^(?:([^:]+):)?([^:|]*)(\\|.+)*$/;\n fields.forEach(function(raw) {\n var parts = re.exec(raw);\n var ns = parts[1] || \"base\";\n var field = parts[2];\n var trans = LocusZoom.TransformationFunctions.get(parts[3]);\n if (typeof requests[ns] ==\"undefined\") {\n requests[ns] = {outnames:[], fields:[], trans:[]};\n }\n requests[ns].outnames.push(raw);\n requests[ns].fields.push(field);\n requests[ns].trans.push(trans);\n });\n return requests;\n }\n\n /**\n * Fetch data, and create a chain that only connects two data sources if they depend on each other\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields The list of data fields specified in the `layout` for a specific data layer\n * @returns {Promise}\n */\n this.getData = function(state, fields) {\n var requests = split_requests(fields);\n // Create an array of functions that, when called, will trigger the request to the specified datasource\n var request_handles = Object.keys(requests).map(function(key) {\n if (!sources.get(key)) {\n throw(\"Datasource for namespace \" + key + \" not found\");\n }\n return sources.get(key).getData(state, requests[key].fields, \n requests[key].outnames, requests[key].trans);\n });\n //assume the fields are requested in dependent order\n //TODO: better manage dependencies\n var ret = Q.when({header:{}, body:{}, discrete: {}});\n for(var i=0; i < request_handles.length; i++) {\n // If a single datalayer uses multiple sources, perform the next request when the previous one completes\n ret = ret.then(request_handles[i]);\n }\n return ret;\n };\n};\n\n/**\n * Base class for LocusZoom data sources\n * This can be extended with .extend() to create custom data sources\n * @class\n * @public\n */\nLocusZoom.Data.Source = function() {\n /**\n * Whether this source should enable caching\n * @member {Boolean}\n */\n this.enableCache = true;\n /**\n * Whether this data source type is dependent on previous requests- for example, the LD source cannot annotate\n * association data if no data was found for that region.\n * @member {boolean}\n */\n this.dependentSource = false;\n};\n\n/**\n * A default constructor that can be used when creating new data sources\n * @param {String|Object} init Basic configuration- either a url, or a config object\n * @param {String} [init.url] The datasource URL\n * @param {String} [init.params] Initial config params for the datasource\n */\nLocusZoom.Data.Source.prototype.parseInit = function(init) {\n if (typeof init === \"string\") {\n /** @member {String} */\n this.url = init;\n /** @member {String} */\n this.params = {};\n } else {\n this.url = init.url;\n this.params = init.params || {};\n }\n if (!this.url) {\n throw(\"Source not initialized with required URL\");\n }\n\n};\n\n/**\n * A unique identifier that indicates whether cached data is valid for this request\n * @protected\n * @param state\n * @param chain\n * @param fields\n * @returns {String|undefined}\n */\nLocusZoom.Data.Source.prototype.getCacheKey = function(state, chain, fields) {\n return this.getURL && this.getURL(state, chain, fields);\n};\n\n/**\n * Stub: build the URL for any requests made by this source.\n */\nLocusZoom.Data.Source.prototype.getURL = function(state, chain, fields) { return this.url; };\n\n/**\n * Perform a network request to fetch data for this source\n * @protected\n * @param {Object} state The state of the parent plot\n * @param chain\n * @param fields\n */\nLocusZoom.Data.Source.prototype.fetchRequest = function(state, chain, fields) {\n var url = this.getURL(state, chain, fields);\n return LocusZoom.createCORSPromise(\"GET\", url); \n};\n\n/**\n * Gets the data for just this source, typically via a network request (caching where possible)\n * @protected\n */\nLocusZoom.Data.Source.prototype.getRequest = function(state, chain, fields) {\n var req;\n var cacheKey = this.getCacheKey(state, chain, fields);\n if (this.enableCache && typeof(cacheKey) !== \"undefined\" && cacheKey === this._cachedKey) {\n req = Q.when(this._cachedResponse);\n } else {\n req = this.fetchRequest(state, chain, fields);\n if (this.enableCache) {\n req = req.then(function(x) {\n this._cachedKey = cacheKey;\n return this._cachedResponse = x;\n }.bind(this));\n }\n }\n return req;\n};\n\n/**\n * Fetch the data from the specified data source, and apply transformations requested by an external consumer.\n * This is the public-facing datasource method that will most commonly be called by external code.\n *\n * @public\n * @param {Object} state The current \"state\" of the plot, such as chromosome and start/end positions\n * @param {String[]} fields Array of field names that the plot has requested from this data source. (without the \"namespace\" prefix)\n * @param {String[]} outnames Array describing how the output data should refer to this field. This represents the\n * originally requested field name, including the namespace. This must be an array with the same length as `fields`\n * @param {Function[]} trans The collection of transformation functions to be run on selected fields.\n * This must be an array with the same length as `fields`\n * @returns {function} A callable operation that can be used as part of the data chain\n */\nLocusZoom.Data.Source.prototype.getData = function(state, fields, outnames, trans) {\n if (this.preGetData) {\n var pre = this.preGetData(state, fields, outnames, trans);\n if(this.pre) {\n state = pre.state || state;\n fields = pre.fields || fields;\n outnames = pre.outnames || outnames;\n trans = pre.trans || trans;\n }\n }\n\n var self = this;\n return function (chain) {\n if (self.dependentSource && chain && chain.body && !chain.body.length) {\n // A \"dependent\" source should not attempt to fire a request if there is no data for it to act on.\n // Therefore, it should simply return the previous data chain.\n return Q.when(chain);\n }\n\n return self.getRequest(state, chain, fields).then(function(resp) {\n return self.parseResponse(resp, chain, fields, outnames, trans);\n });\n };\n};\n\n/**\n * Ensure the server response is in a canonical form, an array of one object per record. [ {field: oneval} ].\n * If the server response contains columns, reformats the response from {column1: [], column2: []} to the above.\n *\n * Does not apply namespacing or transformations.\n *\n * May be overridden by data sources that inherently return more complex payloads, or that exist to annotate other\n * sources.\n *\n * @param {Object[]|Object} data The original parsed server response\n * @protected\n */\nLocusZoom.Data.Source.prototype.normalizeResponse = function (data) {\n if (Array.isArray(data)) {\n // Already in the desired form\n return data;\n }\n\n // Otherwise, assume the server response is an object representing columns of data.\n // Each array should have the same length (verify), and a given array index corresponds to a single row.\n var keys = Object.keys(data);\n var N = data[keys[0]].length;\n var sameLength = keys.every(function(key) {\n var item = data[key];\n return item.length === N;\n });\n if (!sameLength) {\n throw this.constructor.SOURCE_NAME + \" expects a response in which all arrays of data are the same length\";\n }\n\n // Go down the rows, and create an object for each record\n var records = [];\n var fields = Object.keys(data);\n for(var i = 0; i < N; i++) {\n var record = {};\n for(var j = 0; j < fields.length; j++) {\n record[fields[j]] = data[fields[j]][i];\n }\n records.push(record);\n }\n return records;\n};\n\n/** @deprecated */\nLocusZoom.Data.Source.prototype.prepareData = function (records) {\n console.warn(\"Warning: .prepareData() is deprecated. Use .annotateData() instead\");\n return this.annotateData(records);\n};\n\n/**\n * Hook to post-process the data returned by this source with new, additional behavior.\n * (eg cleaning up API values or performing complex calculations on the returned data)\n *\n * @param {Object[]} records The parsed data from the source (eg standardized api response)\n * @param {Object} chain The data chain object. For example, chain.headers may provide useful annotation metadata\n * @returns {Object[]|Promise} The modified set of records\n */\nLocusZoom.Data.Source.prototype.annotateData = function(records, chain) {\n // Default behavior: no transformations\n return records;\n};\n\n/**\n * Clean up the server records for use by datalayers: extract only certain fields, with the specified names.\n * Apply per-field transformations as appropriate.\n *\n * This hook can be overridden, eg to create a source that always returns all records and ignores the \"fields\" array.\n * This is particularly common for sources at the end of a chain- many \"dependent\" sources do not allow\n * cherry-picking individual fields, in which case by **convention** the fields array specifies \"last_source_name:all\"\n *\n * @param {Object[]} data One record object per element\n * @param {String[]} fields The names of fields to extract (as named in the source data). Eg \"afield\"\n * @param {String[]} outnames How to represent the source fields in the output. Eg \"namespace:afield|atransform\"\n * @param {function[]} trans An array of transformation functions (if any). One function per data element, or null.\n * @protected\n */\nLocusZoom.Data.Source.prototype.extractFields = function (data, fields, outnames, trans) {\n //intended for an array of objects\n // [ {\"id\":1, \"val\":5}, {\"id\":2, \"val\":10}]\n // Since a number of sources exist that do not obey this format, we will provide a convenient pass-through\n if (!Array.isArray(data)) {\n return data;\n }\n\n var fieldFound = [];\n for (var k=0; k1) {\n if (fields.length!==2 || fields.indexOf(\"isrefvar\")===-1) {\n throw(\"LD does not know how to get all fields: \" + fields.join(\", \"));\n }\n }\n};\n\nLocusZoom.Data.LDSource.prototype.findMergeFields = function(chain) {\n // since LD may be shared across sources with different namespaces\n // we use regex to find columns to join on rather than \n // requiring exact matches\n var exactMatch = function(arr) {return function() {\n var regexes = arguments;\n for(var i=0; i0) {\n var names = Object.keys(chain.body[0]);\n var nameMatch = exactMatch(names);\n dataFields.id = dataFields.id || nameMatch(/\\bvariant\\b/) || nameMatch(/\\bid\\b/);\n dataFields.position = dataFields.position || nameMatch(/\\bposition\\b/i, /\\bpos\\b/i);\n dataFields.pvalue = dataFields.pvalue || nameMatch(/\\bpvalue\\b/i, /\\blog_pvalue\\b/i);\n dataFields._names_ = names;\n }\n return dataFields;\n};\n\nLocusZoom.Data.LDSource.prototype.findRequestedFields = function(fields, outnames) {\n var obj = {};\n for(var i=0; i extremeVal) {\n extremeVal = x[i][pval] * sign;\n extremeIdx = i;\n }\n }\n return extremeIdx;\n };\n\n var refSource = state.ldrefsource || chain.header.ldrefsource || 1;\n var reqFields = this.findRequestedFields(fields);\n var refVar = reqFields.ldin;\n if (refVar === \"state\") {\n refVar = state.ldrefvar || chain.header.ldrefvar || \"best\";\n }\n if (refVar === \"best\") {\n if (!chain.body) {\n throw(\"No association data found to find best pvalue\");\n }\n var keys = this.findMergeFields(chain);\n if (!keys.pvalue || !keys.id) {\n var columns = \"\";\n if (!keys.id){ columns += (columns.length ? \", \" : \"\") + \"id\"; }\n if (!keys.pvalue){ columns += (columns.length ? \", \" : \"\") + \"pvalue\"; }\n throw(\"Unable to find necessary column(s) for merge: \" + columns + \" (available: \" + keys._names_ + \")\");\n }\n refVar = chain.body[findExtremeValue(chain.body, keys.pvalue)][keys.id];\n }\n if (!chain.header) {chain.header = {};}\n chain.header.ldrefvar = refVar;\n return this.url + \"results/?filter=reference eq \" + refSource + \n \" and chromosome2 eq '\" + state.chr + \"'\" + \n \" and position2 ge \" + state.start + \n \" and position2 le \" + state.end + \n \" and variant1 eq '\" + refVar + \"'\" + \n \"&fields=chr,pos,rsquare\";\n};\n\nLocusZoom.Data.LDSource.prototype.combineChainBody = function (data, chain, fields, outnames) {\n var keys = this.findMergeFields(chain);\n var reqFields = this.findRequestedFields(fields, outnames);\n if (!keys.position) {\n throw(\"Unable to find position field for merge: \" + keys._names_);\n }\n var leftJoin = function(left, right, lfield, rfield) {\n var i=0, j=0;\n while (i < left.length && j < right.position2.length) {\n if (left[i][keys.position] === right.position2[j]) {\n left[i][lfield] = right[rfield][j];\n i++;\n j++;\n } else if (left[i][keys.position] < right.position2[j]) {\n i++;\n } else {\n j++;\n }\n }\n };\n var tagRefVariant = function(data, refvar, idfield, outname) {\n for(var i=0; i} */\n this.panels = {};\n /**\n * TODO: This is currently used by external classes that manipulate the parent and may indicate room for a helper method in the api to coordinate boilerplate\n * @protected\n * @member {String[]}\n */\n this.panel_ids_by_y_index = [];\n\n /**\n * Notify each child panel of the plot of changes in panel ordering/ arrangement\n */\n this.applyPanelYIndexesToPanelLayouts = function(){\n this.panel_ids_by_y_index.forEach(function(pid, idx){\n this.panels[pid].layout.y_index = idx;\n }.bind(this));\n };\n\n /**\n * Get the qualified ID pathname for the plot\n * @returns {String}\n */\n this.getBaseId = function(){\n return this.id;\n };\n\n /**\n * Track update operations (reMap) performed on all child panels, and notify the parent plot when complete\n * TODO: Reconsider whether we need to be tracking this as global state outside of context of specific operations\n * @protected\n * @member {Promise[]}\n */\n this.remap_promises = [];\n\n if (typeof layout == \"undefined\"){\n /**\n * The layout is a serializable object used to describe the composition of the Plot\n * If no layout was passed, use the Standard Association Layout\n * Otherwise merge whatever was passed with the Default Layout\n * TODO: Review description; we *always* merge with default layout?\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge({}, LocusZoom.Layouts.get(\"plot\", \"standard_association\"));\n } else {\n this.layout = layout;\n }\n LocusZoom.Layouts.merge(this.layout, LocusZoom.Plot.DefaultLayout);\n\n /**\n * Values in the layout object may change during rendering etc. Retain a copy of the original plot state\n * @member {Object}\n */\n this._base_layout = JSON.parse(JSON.stringify(this.layout));\n\n\n /**\n * Create a shortcut to the state in the layout on the Plot. Tracking in the layout allows the plot to be created\n * with initial state/setup.\n *\n * Tracks state of the plot, eg start and end position\n * @member {Object}\n */\n this.state = this.layout.state;\n\n /** @member {LocusZoom.Data.Requester} */\n this.lzd = new LocusZoom.Data.Requester(datasource);\n\n /**\n * Window.onresize listener (responsive layouts only)\n * TODO: .on appears to return a selection, not a listener? Check logic here\n * https://github.com/d3/d3-selection/blob/00b904b9bcec4dfaf154ae0bbc777b1fc1d7bc08/test/selection/on-test.js#L11\n * @deprecated\n * @member {d3.selection}\n */\n this.window_onresize = null;\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": [],\n \"state_changed\": [] // Only triggered when a state change causes rerender\n };\n\n /**\n * @callback eventCallback\n * @param {object} eventData A description of the event\n * @param {String|null} eventData.sourceID The unique identifier (eg plot or parent name) of the element that\n * triggered the event. Will be automatically filled in if not explicitly provided.\n * @param {Object|null} eventData.context Any additional information to be passed to the callback, eg the data\n * associated with a clicked plot element\n */\n\n /**\n * There are several events that a LocusZoom plot can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following plot-level events are currently supported:\n * - `layout_changed` - context: plot - Any aspect of the plot's layout (including dimensions or state) has changed.\n * - `data_requested` - context: plot - A request for new data from any data source used in the plot has been made.\n * - `data_rendered` - context: plot - Data from a request has been received and rendered in the plot.\n * - `element_clicked` - context: plot - A data element in any of the plot's data layers has been clicked.\n * - `element_selection` - context: plot - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `plot.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * plot itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Plot}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n * @param {string} event A known event name\n * @param {*} eventData Data or event description that will be passed to the event listener\n * @returns {LocusZoom.Plot}\n */\n this.emit = function(event, eventData) {\n // TODO: there are small differences between the emit implementation between plots and panels. In the future,\n // DRY this code via mixins, and make sure to keep the interfaces compatible when refactoring.\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n var sourceID = this.getBaseId();\n var self = this;\n this.event_hooks[event].forEach(function(hookToRun) {\n var eventContext;\n if (eventData && eventData.sourceID) {\n // If we detect that an event originated elsewhere (via bubbling or externally), preserve the context\n // when re-emitting the event to plot-level listeners\n eventContext = eventData;\n } else {\n eventContext = {sourceID: sourceID, data: eventData || null};\n }\n // By default, any handlers fired here (either directly, or bubbled) will see the plot as the\n // value of `this`. If a bound function is registered as a handler, the previously bound `this` will\n // override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the plot's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the plot\n * @returns {{x: Number, y: Number, width: Number, height: Number}}\n */\n this.getPageOrigin = function(){\n var bounding_client_rect = this.svg.node().getBoundingClientRect();\n var x_offset = document.documentElement.scrollLeft || document.body.scrollLeft;\n var y_offset = document.documentElement.scrollTop || document.body.scrollTop;\n var container = this.svg.node();\n while (container.parentNode !== null){\n container = container.parentNode;\n if (container !== document && d3.select(container).style(\"position\") !== \"static\"){\n x_offset = -1 * container.getBoundingClientRect().left;\n y_offset = -1 * container.getBoundingClientRect().top;\n break;\n }\n }\n return {\n x: x_offset + bounding_client_rect.left,\n y: y_offset + bounding_client_rect.top,\n width: bounding_client_rect.width,\n height: bounding_client_rect.height\n };\n };\n\n /**\n * Get the top and left offset values for the plot's container element (the div that was populated)\n * @returns {{top: number, left: number}}\n */\n this.getContainerOffset = function(){\n var offset = { top: 0, left: 0 };\n var container = this.container.offsetParent || null;\n while (container !== null){\n offset.top += container.offsetTop;\n offset.left += container.offsetLeft;\n container = container.offsetParent || null;\n }\n return offset;\n };\n\n //\n /**\n * Event information describing interaction (e.g. panning and zooming) is stored on the plot\n * TODO: Add/ document details of interaction structure as we expand\n * @member {{panel_id: String, linked_panel_ids: Array, x_linked: *, dragging: *, zooming: *}}\n * @returns {LocusZoom.Plot}\n */\n this.interaction = {};\n\n /**\n * Track whether the target panel can respond to mouse interaction events\n * @param {String} panel_id\n * @returns {boolean}\n */\n this.canInteract = function(panel_id){\n panel_id = panel_id || null;\n if (panel_id){\n return ((typeof this.interaction.panel_id == \"undefined\" || this.interaction.panel_id === panel_id) && !this.loading_data);\n } else {\n return !(this.interaction.dragging || this.interaction.zooming || this.loading_data);\n }\n };\n\n // Initialize the layout\n this.initializeLayout();\n // TODO: Possibly superfluous return from constructor\n return this;\n};\n\n/**\n * Default/ expected configuration parameters for basic plotting; most plots will override\n *\n * @protected\n * @static\n * @type {Object}\n */\nLocusZoom.Plot.DefaultLayout = {\n state: {},\n width: 1,\n height: 1,\n min_width: 1,\n min_height: 1,\n responsive_resize: false,\n aspect_ratio: 1,\n panels: [],\n dashboard: {\n components: []\n },\n panel_boundaries: true,\n mouse_guide: true\n};\n\n/**\n * Helper method to sum the proportional dimensions of panels, a value that's checked often as panels are added/removed\n * @param {('Height'|'Width')} dimension\n * @returns {number}\n */\nLocusZoom.Plot.prototype.sumProportional = function(dimension){\n if (dimension !== \"height\" && dimension !== \"width\"){\n throw (\"Bad dimension value passed to LocusZoom.Plot.prototype.sumProportional\");\n }\n var total = 0;\n for (var id in this.panels){\n // Ensure every panel contributing to the sum has a non-zero proportional dimension\n if (!this.panels[id].layout[\"proportional_\" + dimension]){\n this.panels[id].layout[\"proportional_\" + dimension] = 1 / Object.keys(this.panels).length;\n }\n total += this.panels[id].layout[\"proportional_\" + dimension];\n }\n return total;\n};\n\n/**\n * Resize the plot to fit the bounding container\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.rescaleSVG = function(){\n var clientRect = this.svg.node().getBoundingClientRect();\n this.setDimensions(clientRect.width, clientRect.height);\n return this;\n};\n\n/**\n * Prepare the plot for first use by performing parameter validation, setting up panels, and calculating dimensions\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initializeLayout = function(){\n\n // Sanity check layout values\n // TODO: Find a way to generally abstract this, maybe into an object that models allowed layout values?\n if (isNaN(this.layout.width) || this.layout.width <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.height) || this.layout.height <= 0){\n throw (\"Plot layout parameter `width` must be a positive number\");\n }\n if (isNaN(this.layout.aspect_ratio) || this.layout.aspect_ratio <= 0){\n throw (\"Plot layout parameter `aspect_ratio` must be a positive number\");\n }\n\n // If this is a responsive layout then set a namespaced/unique onresize event listener on the window\n if (this.layout.responsive_resize){\n this.window_onresize = d3.select(window).on(\"resize.lz-\"+this.id, function(){\n this.rescaleSVG();\n }.bind(this));\n // Forcing one additional setDimensions() call after the page is loaded clears up\n // any disagreements between the initial layout and the loaded responsive container's size\n d3.select(window).on(\"load.lz-\"+this.id, function(){\n this.setDimensions();\n }.bind(this));\n }\n\n // Add panels\n this.layout.panels.forEach(function(panel_layout){\n this.addPanel(panel_layout);\n }.bind(this));\n\n return this;\n};\n\n/**\n * Set the dimensions for a plot, and ensure that panels are sized and positioned correctly.\n *\n * If dimensions are provided, resizes each panel proportionally to match the new plot dimensions. Otherwise,\n * calculates the appropriate plot dimensions based on all panels.\n * @param {Number} [width] If provided and larger than minimum size, set plot to this width\n * @param {Number} [height] If provided and larger than minimum size, set plot to this height\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.setDimensions = function(width, height){\n\n var id;\n\n // Update minimum allowable width and height by aggregating minimums from panels, then apply minimums to containing element.\n var min_width = parseFloat(this.layout.min_width) || 0;\n var min_height = parseFloat(this.layout.min_height) || 0;\n for (id in this.panels){\n min_width = Math.max(min_width, this.panels[id].layout.min_width);\n if (parseFloat(this.panels[id].layout.min_height) > 0 && parseFloat(this.panels[id].layout.proportional_height) > 0){\n min_height = Math.max(min_height, (this.panels[id].layout.min_height / this.panels[id].layout.proportional_height));\n }\n }\n this.layout.min_width = Math.max(min_width, 1);\n this.layout.min_height = Math.max(min_height, 1);\n d3.select(this.svg.node().parentNode).style({\n \"min-width\": this.layout.min_width + \"px\",\n \"min-height\": this.layout.min_height + \"px\"\n });\n\n // If width and height arguments were passed then adjust them against plot minimums if necessary.\n // Then resize the plot and proportionally resize panels to fit inside the new plot dimensions.\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n // Override discrete values if resizing responsively\n if (this.layout.responsive_resize){\n if (this.svg){\n this.layout.width = Math.max(this.svg.node().parentNode.getBoundingClientRect().width, this.layout.min_width);\n }\n this.layout.height = this.layout.width / this.layout.aspect_ratio;\n if (this.layout.height < this.layout.min_height){\n this.layout.height = this.layout.min_height;\n this.layout.width = this.layout.height * this.layout.aspect_ratio;\n }\n }\n // Resize/reposition panels to fit, update proportional origins if necessary\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel_width = this.layout.width;\n var panel_height = this.panels[panel_id].layout.proportional_height * this.layout.height;\n this.panels[panel_id].setDimensions(panel_width, panel_height);\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n this.panels[panel_id].layout.proportional_origin.y = y_offset / this.layout.height;\n y_offset += panel_height;\n this.panels[panel_id].dashboard.update();\n }.bind(this));\n }\n\n // If width and height arguments were NOT passed (and panels exist) then determine the plot dimensions\n // by making it conform to panel dimensions, assuming panels are already positioned correctly.\n else if (Object.keys(this.panels).length) {\n this.layout.width = 0;\n this.layout.height = 0;\n for (id in this.panels){\n this.layout.width = Math.max(this.panels[id].layout.width, this.layout.width);\n this.layout.height += this.panels[id].layout.height;\n }\n this.layout.width = Math.max(this.layout.width, this.layout.min_width);\n this.layout.height = Math.max(this.layout.height, this.layout.min_height);\n }\n\n // Keep aspect ratio in agreement with dimensions\n this.layout.aspect_ratio = this.layout.width / this.layout.height;\n\n // Apply layout width and height as discrete values or viewbox values\n if (this.svg !== null){\n if (this.layout.responsive_resize){\n this.svg\n .attr(\"viewBox\", \"0 0 \" + this.layout.width + \" \" + this.layout.height)\n .attr(\"preserveAspectRatio\", \"xMinYMin meet\");\n } else {\n this.svg.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n }\n\n // If the plot has been initialized then trigger some necessary render functions\n if (this.initialized){\n this.panel_boundaries.position();\n this.dashboard.update();\n this.curtain.update();\n this.loader.update();\n }\n\n return this.emit(\"layout_changed\");\n};\n\n/**\n * Create a new panel from a layout, and handle the work of initializing and placing the panel on the plot\n * @param {Object} layout\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Plot.prototype.addPanel = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\"){\n throw \"Invalid panel layout passed to LocusZoom.Plot.prototype.addPanel()\";\n }\n\n // Create the Panel and set its parent\n var panel = new LocusZoom.Panel(layout, this);\n\n // Store the Panel on the Plot\n this.panels[panel.id] = panel;\n\n // If a discrete y_index was set in the layout then adjust other panel y_index values to accommodate this one\n if (panel.layout.y_index !== null && !isNaN(panel.layout.y_index)\n && this.panel_ids_by_y_index.length > 0){\n // Negative y_index values should count backwards from the end, so convert negatives to appropriate values here\n if (panel.layout.y_index < 0){\n panel.layout.y_index = Math.max(this.panel_ids_by_y_index.length + panel.layout.y_index, 0);\n }\n this.panel_ids_by_y_index.splice(panel.layout.y_index, 0, panel.id);\n this.applyPanelYIndexesToPanelLayouts();\n } else {\n var length = this.panel_ids_by_y_index.push(panel.id);\n this.panels[panel.id].layout.y_index = length - 1;\n }\n\n // Determine if this panel was already in the layout.panels array.\n // If it wasn't, add it. Either way store the layout.panels array index on the panel.\n var layout_idx = null;\n this.layout.panels.forEach(function(panel_layout, idx){\n if (panel_layout.id === panel.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.panels.push(this.panels[panel.id].layout) - 1;\n }\n this.panels[panel.id].layout_idx = layout_idx;\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n this.positionPanels();\n // Initialize and load data into the new panel\n this.panels[panel.id].initialize();\n this.panels[panel.id].reMap();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this.panels[panel.id];\n};\n\n\n/**\n * Clear all state, tooltips, and other persisted data associated with one (or all) panel(s) in the plot\n *\n * This is useful when reloading an existing plot with new data, eg \"click for genome region\" links.\n * This is a utility method for custom usage. It is not fired automatically during normal rerender of existing panels\n * @param {String} [panelId] If provided, clear state for only this panel. Otherwise, clear state for all panels.\n * @param {('wipe'|'reset')} [mode='wipe'] Optionally specify how state should be cleared. `wipe` deletes all data\n * and is useful for when the panel is being removed; `reset` is best when the panel will be reused in place.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.clearPanelData = function(panelId, mode) {\n mode = mode || \"wipe\";\n\n // TODO: Add unit tests for this method\n var panelsList;\n if (panelId) {\n panelsList = [panelId];\n } else {\n panelsList = Object.keys(this.panels);\n }\n var self = this;\n panelsList.forEach(function(pid) {\n self.panels[pid].data_layer_ids_by_z_index.forEach(function(dlid){\n var layer = self.panels[pid].data_layers[dlid];\n layer.destroyAllTooltips();\n\n delete self.layout.state[pid + \".\" + dlid];\n if(mode === \"reset\") {\n layer.setDefaultState();\n }\n });\n });\n return this;\n};\n\n/**\n * Remove the panel from the plot, and clear any state, tooltips, or other visual elements belonging to nested content\n * @param {String} id\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.removePanel = function(id){\n if (!this.panels[id]){\n throw (\"Unable to remove panel, ID not found: \" + id);\n }\n\n // Hide all panel boundaries\n this.panel_boundaries.hide();\n\n // Destroy all tooltips and state vars for all data layers on the panel\n this.clearPanelData(id);\n\n // Remove all panel-level HTML overlay elements\n this.panels[id].loader.hide();\n this.panels[id].dashboard.destroy(true);\n this.panels[id].curtain.hide();\n\n // Remove the svg container for the panel if it exists\n if (this.panels[id].svg.container){\n this.panels[id].svg.container.remove();\n }\n\n // Delete the panel and its presence in the plot layout and state\n this.layout.panels.splice(this.panels[id].layout_idx, 1);\n delete this.panels[id];\n delete this.layout.state[id];\n\n // Update layout_idx values for all remaining panels\n this.layout.panels.forEach(function(panel_layout, idx){\n this.panels[panel_layout.id].layout_idx = idx;\n }.bind(this));\n\n // Remove the panel id from the y_index array\n this.panel_ids_by_y_index.splice(this.panel_ids_by_y_index.indexOf(id), 1);\n this.applyPanelYIndexesToPanelLayouts();\n\n // Call positionPanels() to keep panels from overlapping and ensure filling all available vertical space\n if (this.initialized){\n // Allow the plot to shrink when panels are removed, by forcing it to recalculate min dimensions from scratch\n this.layout.min_height = this._base_layout.min_height;\n this.layout.min_width = this._base_layout.min_width;\n\n this.positionPanels();\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n this.setDimensions(this.layout.width, this.layout.height);\n }\n\n return this;\n};\n\n\n/**\n * Automatically position panels based on panel positioning rules and values.\n * Keep panels from overlapping vertically by adjusting origins, and keep the sum of proportional heights at 1.\n *\n * TODO: This logic currently only supports dynamic positioning of panels to prevent overlap in a VERTICAL orientation.\n * Some framework exists for positioning panels in horizontal orientations as well (width, proportional_width, origin.x, etc.)\n * but the logic for keeping these user-definable values straight approaches the complexity of a 2D box-packing algorithm.\n * That's complexity we don't need right now, and may not ever need, so it's on hiatus until a use case materializes.\n */\nLocusZoom.Plot.prototype.positionPanels = function(){\n\n var id;\n\n // We want to enforce that all x-linked panels have consistent horizontal margins\n // (to ensure that aligned items stay aligned despite inconsistent initial layout parameters)\n // NOTE: This assumes panels have consistent widths already. That should probably be enforced too!\n var x_linked_margins = { left: 0, right: 0 };\n\n // Proportional heights for newly added panels default to null unless explicitly set, so determine appropriate\n // proportional heights for all panels with a null value from discretely set dimensions.\n // Likewise handle default nulls for proportional widths, but instead just force a value of 1 (full width)\n for (id in this.panels){\n if (this.panels[id].layout.proportional_height === null){\n this.panels[id].layout.proportional_height = this.panels[id].layout.height / this.layout.height;\n }\n if (this.panels[id].layout.proportional_width === null){\n this.panels[id].layout.proportional_width = 1;\n }\n if (this.panels[id].layout.interaction.x_linked){\n x_linked_margins.left = Math.max(x_linked_margins.left, this.panels[id].layout.margin.left);\n x_linked_margins.right = Math.max(x_linked_margins.right, this.panels[id].layout.margin.right);\n }\n }\n\n // Sum the proportional heights and then adjust all proportionally so that the sum is exactly 1\n var total_proportional_height = this.sumProportional(\"height\");\n if (!total_proportional_height){\n return this;\n }\n var proportional_adjustment = 1 / total_proportional_height;\n for (id in this.panels){\n this.panels[id].layout.proportional_height *= proportional_adjustment;\n }\n\n // Update origins on all panels without changing plot-level dimensions yet\n // Also apply x-linked margins to x-linked panels, updating widths as needed\n var y_offset = 0;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setOrigin(0, y_offset);\n this.panels[panel_id].layout.proportional_origin.x = 0;\n y_offset += this.panels[panel_id].layout.height;\n if (this.panels[panel_id].layout.interaction.x_linked){\n var delta = Math.max(x_linked_margins.left - this.panels[panel_id].layout.margin.left, 0)\n + Math.max(x_linked_margins.right - this.panels[panel_id].layout.margin.right, 0);\n this.panels[panel_id].layout.width += delta;\n this.panels[panel_id].layout.margin.left = x_linked_margins.left;\n this.panels[panel_id].layout.margin.right = x_linked_margins.right;\n this.panels[panel_id].layout.cliparea.origin.x = x_linked_margins.left;\n }\n }.bind(this));\n var calculated_plot_height = y_offset;\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].layout.proportional_origin.y = this.panels[panel_id].layout.origin.y / calculated_plot_height;\n }.bind(this));\n\n // Update dimensions on the plot to accommodate repositioned panels\n this.setDimensions();\n\n // Set dimensions on all panels using newly set plot-level dimensions and panel-level proportional dimensions\n this.panel_ids_by_y_index.forEach(function(panel_id){\n this.panels[panel_id].setDimensions(this.layout.width * this.panels[panel_id].layout.proportional_width,\n this.layout.height * this.panels[panel_id].layout.proportional_height);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Prepare the first rendering of the plot. This includes initializing the individual panels, but also creates shared\n * elements such as mouse events, panel guides/boundaries, and loader/curtain.\n *\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.initialize = function(){\n\n // Ensure proper responsive class is present on the containing node if called for\n if (this.layout.responsive_resize){\n d3.select(this.container).classed(\"lz-container-responsive\", true);\n }\n\n // Create an element/layer for containing mouse guides\n if (this.layout.mouse_guide) {\n var mouse_guide_svg = this.svg.append(\"g\")\n .attr(\"class\", \"lz-mouse_guide\").attr(\"id\", this.id + \".mouse_guide\");\n var mouse_guide_vertical_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-vertical\").attr(\"x\",-1);\n var mouse_guide_horizontal_svg = mouse_guide_svg.append(\"rect\")\n .attr(\"class\", \"lz-mouse_guide-horizontal\").attr(\"y\",-1);\n this.mouse_guide = {\n svg: mouse_guide_svg,\n vertical: mouse_guide_vertical_svg,\n horizontal: mouse_guide_horizontal_svg\n };\n }\n\n // Add curtain and loader prototpyes to the plot\n this.curtain = LocusZoom.generateCurtain.call(this);\n this.loader = LocusZoom.generateLoader.call(this);\n\n // Create the panel_boundaries object with show/position/hide methods\n this.panel_boundaries = {\n parent: this,\n hide_timeout: null,\n showing: false,\n dragging: false,\n selectors: [],\n corner_selector: null,\n show: function(){\n // Generate panel boundaries\n if (!this.showing && !this.parent.curtain.showing){\n this.showing = true;\n // Loop through all panels to create a horizontal boundary for each\n this.parent.panel_ids_by_y_index.forEach(function(panel_id, panel_idx){\n var selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-boundary\")\n .attr(\"title\", \"Resize panel\");\n selector.append(\"span\");\n var panel_resize_drag = d3.behavior.drag();\n panel_resize_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n panel_resize_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n panel_resize_drag.on(\"drag\", function(){\n // First set the dimensions on the panel we're resizing\n var this_panel = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]];\n var original_panel_height = this_panel.layout.height;\n this_panel.setDimensions(this_panel.layout.width, this_panel.layout.height + d3.event.dy);\n var panel_height_change = this_panel.layout.height - original_panel_height;\n var new_calculated_plot_height = this.parent.layout.height + panel_height_change;\n // Next loop through all panels.\n // Update proportional dimensions for all panels including the one we've resized using discrete heights.\n // Reposition panels with a greater y-index than this panel to their appropriate new origin.\n this.parent.panel_ids_by_y_index.forEach(function(loop_panel_id, loop_panel_idx){\n var loop_panel = this.parent.panels[this.parent.panel_ids_by_y_index[loop_panel_idx]];\n loop_panel.layout.proportional_height = loop_panel.layout.height / new_calculated_plot_height;\n if (loop_panel_idx > panel_idx){\n loop_panel.setOrigin(loop_panel.layout.origin.x, loop_panel.layout.origin.y + panel_height_change);\n loop_panel.dashboard.position();\n }\n }.bind(this));\n // Reset dimensions on the entire plot and reposition panel boundaries\n this.parent.positionPanels();\n this.position();\n }.bind(this));\n selector.call(panel_resize_drag);\n this.parent.panel_boundaries.selectors.push(selector);\n }.bind(this));\n // Create a corner boundary / resize element on the bottom-most panel that resizes the entire plot\n var corner_selector = d3.select(this.parent.svg.node().parentNode).insert(\"div\", \".lz-data_layer-tooltip\")\n .attr(\"class\", \"lz-panel-corner-boundary\")\n .attr(\"title\", \"Resize plot\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-outer\");\n corner_selector.append(\"span\").attr(\"class\", \"lz-panel-corner-boundary-inner\");\n var corner_drag = d3.behavior.drag();\n corner_drag.on(\"dragstart\", function(){ this.dragging = true; }.bind(this));\n corner_drag.on(\"dragend\", function(){ this.dragging = false; }.bind(this));\n corner_drag.on(\"drag\", function(){\n this.setDimensions(this.layout.width + d3.event.dx, this.layout.height + d3.event.dy);\n }.bind(this.parent));\n corner_selector.call(corner_drag);\n this.parent.panel_boundaries.corner_selector = corner_selector;\n }\n return this.position();\n },\n position: function(){\n if (!this.showing){ return this; }\n // Position panel boundaries\n var plot_page_origin = this.parent.getPageOrigin();\n this.selectors.forEach(function(selector, panel_idx){\n var panel_page_origin = this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].getPageOrigin();\n var left = plot_page_origin.x;\n var top = panel_page_origin.y + this.parent.panels[this.parent.panel_ids_by_y_index[panel_idx]].layout.height - 12;\n var width = this.parent.layout.width - 1;\n selector.style({\n top: top + \"px\",\n left: left + \"px\",\n width: width + \"px\"\n });\n selector.select(\"span\").style({\n width: width + \"px\"\n });\n }.bind(this));\n // Position corner selector\n var corner_padding = 10;\n var corner_size = 16;\n this.corner_selector.style({\n top: (plot_page_origin.y + this.parent.layout.height - corner_padding - corner_size) + \"px\",\n left: (plot_page_origin.x + this.parent.layout.width - corner_padding - corner_size) + \"px\"\n });\n return this;\n },\n hide: function(){\n if (!this.showing){ return this; }\n this.showing = false;\n // Remove panel boundaries\n this.selectors.forEach(function(selector){ selector.remove(); });\n this.selectors = [];\n // Remove corner boundary\n this.corner_selector.remove();\n this.corner_selector = null;\n return this;\n }\n };\n\n // Show panel boundaries stipulated by the layout (basic toggle, only show on mouse over plot)\n if (this.layout.panel_boundaries){\n d3.select(this.svg.node().parentNode).on(\"mouseover.\" + this.id + \".panel_boundaries\", function(){\n clearTimeout(this.panel_boundaries.hide_timeout);\n this.panel_boundaries.show();\n }.bind(this));\n d3.select(this.svg.node().parentNode).on(\"mouseout.\" + this.id + \".panel_boundaries\", function(){\n this.panel_boundaries.hide_timeout = setTimeout(function(){\n this.panel_boundaries.hide();\n }.bind(this), 300);\n }.bind(this));\n }\n\n // Create the dashboard object and immediately show it\n this.dashboard = new LocusZoom.Dashboard(this).show();\n\n // Initialize all panels\n for (var id in this.panels){\n this.panels[id].initialize();\n }\n\n // Define plot-level mouse events\n var namespace = \".\" + this.id;\n if (this.layout.mouse_guide) {\n var mouseout_mouse_guide = function(){\n this.mouse_guide.vertical.attr(\"x\", -1);\n this.mouse_guide.horizontal.attr(\"y\", -1);\n }.bind(this);\n var mousemove_mouse_guide = function(){\n var coords = d3.mouse(this.svg.node());\n this.mouse_guide.vertical.attr(\"x\", coords[0]);\n this.mouse_guide.horizontal.attr(\"y\", coords[1]);\n }.bind(this);\n this.svg\n .on(\"mouseout\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"touchleave\" + namespace + \"-mouse_guide\", mouseout_mouse_guide)\n .on(\"mousemove\" + namespace + \"-mouse_guide\", mousemove_mouse_guide);\n }\n var mouseup = function(){\n this.stopDrag();\n }.bind(this);\n var mousemove = function(){\n if (this.interaction.dragging){\n var coords = d3.mouse(this.svg.node());\n if (d3.event){ d3.event.preventDefault(); }\n this.interaction.dragging.dragged_x = coords[0] - this.interaction.dragging.start_x;\n this.interaction.dragging.dragged_y = coords[1] - this.interaction.dragging.start_y;\n this.panels[this.interaction.panel_id].render();\n this.interaction.linked_panel_ids.forEach(function(panel_id){\n this.panels[panel_id].render();\n }.bind(this));\n }\n }.bind(this);\n this.svg\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup)\n .on(\"mousemove\" + namespace, mousemove)\n .on(\"touchmove\" + namespace, mousemove);\n\n // Add an extra namespaced mouseup handler to the containing body, if there is one\n // This helps to stop interaction events gracefully when dragging outside of the plot element\n if (!d3.select(\"body\").empty()){\n d3.select(\"body\")\n .on(\"mouseup\" + namespace, mouseup)\n .on(\"touchend\" + namespace, mouseup);\n }\n\n this.initialized = true;\n\n // An extra call to setDimensions with existing discrete dimensions fixes some rounding errors with tooltip\n // positioning. TODO: make this additional call unnecessary.\n var client_rect = this.svg.node().getBoundingClientRect();\n var width = client_rect.width ? client_rect.width : this.layout.width;\n var height = client_rect.height ? client_rect.height : this.layout.height;\n this.setDimensions(width, height);\n\n return this;\n\n};\n\n/**\n * Refresh (or fetch) a plot's data from sources, regardless of whether position or state has changed\n * @returns {Promise}\n */\nLocusZoom.Plot.prototype.refresh = function(){\n return this.applyState();\n};\n\n\n/**\n * A user-defined callback function that can receive (and potentially act on) new plot data.\n * @callback externalDataCallback\n * @param {Object} new_data The body resulting from a data request. This represents the same information that would be passed to\n * a data layer making an equivalent request.\n */\n\n/**\n * A user-defined callback function that can respond to errors received during a previous operation\n * @callback externalErrorCallback\n * @param err A representation of the error that occurred\n */\n\n/**\n * Allow newly fetched data to be made available outside the LocusZoom plot. For example, a callback could be\n * registered to draw an HTML table of top GWAS hits, and update that table whenever the plot region changes.\n *\n * This is a convenience method for external hooks. It registers an event listener and returns parsed data,\n * using the same fields syntax and underlying methods as data layers.\n *\n * @param {String[]} fields An array of field names and transforms, in the same syntax used by a data layer.\n * Different data sources should be prefixed by the source name.\n * @param {externalDataCallback} success_callback Used defined function that is automatically called any time that\n * new data is received by the plot.\n * @param {Object} [opts] Options\n * @param {externalErrorCallback} [opts.onerror] User defined function that is automatically called if a problem\n * occurs during the data request or subsequent callback operations\n * @param {boolean} [opts.discrete=false] Normally the callback will subscribe to the combined body from the chain,\n * which may not be in a format that matches what the external callback wants to do. If discrete=true, returns the\n * uncombined record info\n * @return {function} The newly created event listener, to allow for later cleanup/removal\n */\nLocusZoom.Plot.prototype.subscribeToData = function(fields, success_callback, opts) {\n opts = opts || {};\n\n // Register an event listener that is notified whenever new data has been rendered\n var error_callback = opts.onerror || function(err) {\n console.log(\"An error occurred while acting on an external callback\", err);\n };\n var self = this;\n\n var listener = function() {\n try {\n self.lzd.getData(self.state, fields)\n .then(function (new_data) {\n success_callback(opts.discrete ? new_data.discrete : new_data.body);\n }).catch(error_callback);\n } catch (error) {\n // In certain cases, errors are thrown before a promise can be generated, and LZ error display seems to rely on these errors bubbling up\n error_callback(error);\n }\n };\n this.on(\"data_rendered\", listener);\n return listener;\n};\n\n/**\n * Update state values and trigger a pull for fresh data on all data sources for all data layers\n * @param state_changes\n * @returns {Promise} A promise that resolves when all data fetch and update operations are complete\n */\nLocusZoom.Plot.prototype.applyState = function(state_changes){\n state_changes = state_changes || {};\n if (typeof state_changes != \"object\"){\n throw(\"LocusZoom.applyState only accepts an object; \" + (typeof state_changes) + \" given\");\n }\n\n // First make a copy of the current (old) state to work with\n var new_state = JSON.parse(JSON.stringify(this.state));\n\n // Apply changes by top-level property to the new state\n for (var property in state_changes) {\n new_state[property] = state_changes[property];\n }\n\n // Validate the new state (may do nothing, may do a lot, depends on how the user has things set up)\n new_state = LocusZoom.validateState(new_state, this.layout);\n\n // Apply new state to the actual state\n for (property in new_state) {\n this.state[property] = new_state[property];\n }\n\n // Generate requests for all panels given new state\n this.emit(\"data_requested\");\n this.remap_promises = [];\n this.loading_data = true;\n for (var id in this.panels){\n this.remap_promises.push(this.panels[id].reMap());\n }\n\n return Q.all(this.remap_promises)\n .catch(function(error){\n console.error(error);\n this.curtain.drop(error);\n this.loading_data = false;\n }.bind(this))\n .then(function(){\n // TODO: Check logic here; in some promise implementations, this would cause the error to be considered handled, and \"then\" would always fire. (may or may not be desired behavior)\n // Update dashboard / components\n this.dashboard.update();\n\n // Apply panel-level state values\n this.panel_ids_by_y_index.forEach(function(panel_id){\n var panel = this.panels[panel_id];\n panel.dashboard.update();\n // Apply data-layer-level state values\n panel.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n var data_layer = this.data_layers[data_layer_id];\n var state_id = panel_id + \".\" + data_layer_id;\n for (var property in this.state[state_id]){\n if (!this.state[state_id].hasOwnProperty(property)){ continue; }\n if (Array.isArray(this.state[state_id][property])){\n this.state[state_id][property].forEach(function(element_id){\n try {\n this.setElementStatus(property, this.getElementById(element_id), true);\n } catch (e){\n console.error(\"Unable to apply state: \" + state_id + \", \" + property);\n }\n }.bind(data_layer));\n }\n }\n }.bind(panel));\n }.bind(this));\n\n // Emit events\n this.emit(\"layout_changed\");\n this.emit(\"data_rendered\");\n this.emit(\"state_changed\", state_changes);\n\n this.loading_data = false;\n\n }.bind(this));\n};\n\n/**\n * Register interactions along the specified axis, provided that the target panel allows interaction.\n *\n * @param {LocusZoom.Panel} panel\n * @param {('x_tick'|'y1_tick'|'y2_tick')} method The direction (axis) along which dragging is being performed.\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.startDrag = function(panel, method){\n\n panel = panel || null;\n method = method || null;\n\n var axis = null;\n switch (method){\n case \"background\":\n case \"x_tick\":\n axis = \"x\";\n break;\n case \"y1_tick\":\n axis = \"y1\";\n break;\n case \"y2_tick\":\n axis = \"y2\";\n break;\n }\n\n if (!(panel instanceof LocusZoom.Panel) || !axis || !this.canInteract()){ return this.stopDrag(); }\n\n var coords = d3.mouse(this.svg.node());\n this.interaction = {\n panel_id: panel.id,\n linked_panel_ids: panel.getLinkedPanelIds(axis),\n dragging: {\n method: method,\n start_x: coords[0],\n start_y: coords[1],\n dragged_x: 0,\n dragged_y: 0,\n axis: axis\n }\n };\n\n this.svg.style(\"cursor\", \"all-scroll\");\n\n return this;\n\n};\n\n/**\n * Process drag interactions across the target panel and synchronize plot state across other panels in sync;\n * clear the event when complete\n * @returns {LocusZoom.Plot}\n */\nLocusZoom.Plot.prototype.stopDrag = function(){\n\n if (!this.interaction.dragging){ return this; }\n\n if (typeof this.panels[this.interaction.panel_id] != \"object\"){\n this.interaction = {};\n return this;\n }\n var panel = this.panels[this.interaction.panel_id];\n\n // Helper function to find the appropriate axis layouts on child data layers\n // Once found, apply the extent as floor/ceiling and remove all other directives\n // This forces all associated axes to conform to the extent generated by a drag action\n var overrideAxisLayout = function(axis, axis_number, extent){\n panel.data_layer_ids_by_z_index.forEach(function(id){\n if (panel.data_layers[id].layout[axis+\"_axis\"].axis === axis_number){\n panel.data_layers[id].layout[axis+\"_axis\"].floor = extent[0];\n panel.data_layers[id].layout[axis+\"_axis\"].ceiling = extent[1];\n delete panel.data_layers[id].layout[axis+\"_axis\"].lower_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].upper_buffer;\n delete panel.data_layers[id].layout[axis+\"_axis\"].min_extent;\n delete panel.data_layers[id].layout[axis+\"_axis\"].ticks;\n }\n });\n };\n\n switch(this.interaction.dragging.method){\n case \"background\":\n case \"x_tick\":\n if (this.interaction.dragging.dragged_x !== 0){\n overrideAxisLayout(\"x\", 1, panel.x_extent);\n this.applyState({ start: panel.x_extent[0], end: panel.x_extent[1] });\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n if (this.interaction.dragging.dragged_y !== 0){\n // TODO: Hardcoded assumption of only two possible axes with single-digit #s (switch/case)\n var y_axis_number = parseInt(this.interaction.dragging.method[1]);\n overrideAxisLayout(\"y\", y_axis_number, panel[\"y\"+y_axis_number+\"_extent\"]);\n }\n break;\n }\n\n this.interaction = {};\n this.svg.style(\"cursor\", null);\n\n return this;\n\n};\n","/* global LocusZoom */\n\"use strict\";\n\n/**\n * A panel is an abstract class representing a subdivision of the LocusZoom stage\n * to display a distinct data representation as a collection of data layers.\n * @class\n * @param {Object} layout\n * @param {LocusZoom.Plot|null} parent\n*/\nLocusZoom.Panel = function(layout, parent) {\n\n if (typeof layout !== \"object\"){\n throw \"Unable to create panel, invalid layout\";\n }\n\n /** @member {LocusZoom.Plot|null} */\n this.parent = parent || null;\n /** @member {LocusZoom.Plot|null} */\n this.parent_plot = parent;\n\n // Ensure a valid ID is present. If there is no valid ID then generate one\n if (typeof layout.id !== \"string\" || !layout.id.length){\n if (!this.parent){\n layout.id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n } else {\n var id = null;\n var generateID = function(){\n id = \"p\" + Math.floor(Math.random()*Math.pow(10,8));\n if (id == null || typeof this.parent.panels[id] != \"undefined\"){\n id = generateID();\n }\n }.bind(this);\n layout.id = id;\n }\n } else if (this.parent) {\n if (typeof this.parent.panels[layout.id] !== \"undefined\"){\n throw \"Cannot create panel with id [\" + layout.id + \"]; panel with that id already exists\";\n }\n }\n /** @member {String} */\n this.id = layout.id;\n\n /** @member {Boolean} */\n this.initialized = false;\n /**\n * The index of this panel in the parent plot's `layout.panels`\n * @member {number}\n * */\n this.layout_idx = null;\n /** @member {Object} */\n this.svg = {};\n\n /**\n * A JSON-serializable object used to describe the composition of the Panel\n * @member {Object}\n */\n this.layout = LocusZoom.Layouts.merge(layout || {}, LocusZoom.Panel.DefaultLayout);\n\n // Define state parameters specific to this panel\n if (this.parent){\n /** @member {Object} */\n this.state = this.parent.state;\n\n /** @member {String} */\n this.state_id = this.id;\n this.state[this.state_id] = this.state[this.state_id] || {};\n } else {\n this.state = null;\n this.state_id = null;\n }\n\n /** @member {Object} */\n this.data_layers = {};\n /** @member {String[]} */\n this.data_layer_ids_by_z_index = [];\n\n /** @protected */\n this.applyDataLayerZIndexesToDataLayerLayouts = function(){\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n }.bind(this);\n\n /**\n * Track data requests in progress\n * @member {Promise[]}\n * @protected\n */\n this.data_promises = [];\n\n /** @member {d3.scale} */\n this.x_scale = null;\n /** @member {d3.scale} */\n this.y1_scale = null;\n /** @member {d3.scale} */\n this.y2_scale = null;\n\n /** @member {d3.extent} */\n this.x_extent = null;\n /** @member {d3.extent} */\n this.y1_extent = null;\n /** @member {d3.extent} */\n this.y2_extent = null;\n\n /** @member {Number[]} */\n this.x_ticks = [];\n /** @member {Number[]} */\n this.y1_ticks = [];\n /** @member {Number[]} */\n this.y2_ticks = [];\n\n /**\n * A timeout ID as returned by setTimeout\n * @protected\n * @member {number}\n */\n this.zoom_timeout = null;\n\n /** @returns {string} */\n this.getBaseId = function(){\n return this.parent.id + \".\" + this.id;\n };\n\n /**\n * Known event hooks that the panel can respond to\n * @protected\n * @member {Object}\n */\n this.event_hooks = {\n \"layout_changed\": [],\n \"data_requested\": [],\n \"data_rendered\": [],\n \"element_clicked\": [],\n \"element_selection\": []\n };\n /**\n * There are several events that a LocusZoom panel can \"emit\" when appropriate, and LocusZoom supports registering\n * \"hooks\" for these events which are essentially custom functions intended to fire at certain times.\n *\n * The following panel-level events are currently supported:\n * - `layout_changed` - context: panel - Any aspect of the panel's layout (including dimensions or state) has changed.\n * - `data_requested` - context: panel - A request for new data from any data source used in the panel has been made.\n * - `data_rendered` - context: panel - Data from a request has been received and rendered in the panel.\n * - `element_clicked` - context: panel - A data element in any of the panel's data layers has been clicked.\n * - `element_selection` - context: panel - Triggered when an element changes \"selection\" status, and identifies\n * whether the element is being selected or deselected.\n *\n * To register a hook for any of these events use `panel.on('event_name', function() {})`.\n *\n * There can be arbitrarily many functions registered to the same event. They will be executed in the order they\n * were registered. The this context bound to each event hook function is dependent on the type of event, as\n * denoted above. For example, when data_requested is emitted the context for this in the event hook will be the\n * panel itself, but when element_clicked is emitted the context for this in the event hook will be the element\n * that was clicked.\n *\n * @param {String} event The name of the event (as defined in `event_hooks`)\n * @param {function} hook\n * @returns {function} The registered event listener\n */\n this.on = function(event, hook){\n // TODO: Dry plot and panel event code into a shared mixin\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"Unable to register event hook, invalid event: \" + event.toString());\n }\n if (typeof hook != \"function\"){\n throw(\"Unable to register event hook, invalid hook function passed\");\n }\n this.event_hooks[event].push(hook);\n return hook;\n };\n /**\n * Remove one or more previously defined event listeners\n * @param {String} event The name of an event (as defined in `event_hooks`)\n * @param {eventCallback} [hook] The callback to deregister\n * @returns {LocusZoom.Panel}\n */\n this.off = function(event, hook) {\n var theseHooks = this.event_hooks[event];\n if (typeof \"event\" != \"string\" || !Array.isArray(theseHooks)){\n throw(\"Unable to remove event hook, invalid event: \" + event.toString());\n }\n if (hook === undefined) {\n // Deregistering all hooks for this event may break basic functionality, and should only be used during\n // cleanup operations (eg to prevent memory leaks)\n this.event_hooks[event] = [];\n } else {\n var hookMatch = theseHooks.indexOf(hook);\n if (hookMatch !== -1) {\n theseHooks.splice(hookMatch, 1);\n } else {\n throw(\"The specified event listener is not registered and therefore cannot be removed\");\n }\n }\n return this;\n };\n /**\n * Handle running of event hooks when an event is emitted\n *\n * There is a shorter overloaded form of this method: if the event does not have any data, the second\n * argument can be a boolean to control bubbling\n *\n * @param {string} event A known event name\n * @param {*} [eventData] Data or event description that will be passed to the event listener\n * @param {boolean} [bubble=false] Whether to bubble the event to the parent\n * @returns {LocusZoom.Panel}\n */\n this.emit = function(event, eventData, bubble) {\n bubble = bubble || false;\n\n // TODO: DRY this with the parent plot implementation. Ensure interfaces remain compatible.\n // TODO: Improve documentation for overloaded method signature (JSDoc may have trouble here)\n if (typeof \"event\" != \"string\" || !Array.isArray(this.event_hooks[event])){\n throw(\"LocusZoom attempted to throw an invalid event: \" + event.toString());\n }\n if (typeof eventData === \"boolean\" && arguments.length === 2) {\n // Overloaded method signature: emit(event, bubble)\n bubble = eventData;\n eventData = null;\n }\n var sourceID = this.getBaseId();\n var self = this;\n var eventContext = {sourceID: sourceID, data: eventData || null};\n this.event_hooks[event].forEach(function(hookToRun) {\n // By default, any handlers fired here will see the panel as the value of `this`. If a bound function is\n // registered as a handler, the previously bound `this` will override anything provided to `call` below.\n hookToRun.call(self, eventContext);\n });\n if (bubble && this.parent) {\n this.parent.emit(event, eventContext);\n }\n return this;\n };\n\n /**\n * Get an object with the x and y coordinates of the panel's origin in terms of the entire page\n * Necessary for positioning any HTML elements over the panel\n * @returns {{x: Number, y: Number}}\n */\n this.getPageOrigin = function(){\n var plot_origin = this.parent.getPageOrigin();\n return {\n x: plot_origin.x + this.layout.origin.x,\n y: plot_origin.y + this.layout.origin.y\n };\n };\n\n // Initialize the layout\n this.initializeLayout();\n\n return this;\n\n};\n\n/**\n * Default panel layout\n * @static\n * @type {Object}\n */\nLocusZoom.Panel.DefaultLayout = {\n title: { text: \"\", style: {}, x: 10, y: 22 },\n y_index: null,\n width: 0,\n height: 0,\n origin: { x: 0, y: null },\n min_width: 1,\n min_height: 1,\n proportional_width: null,\n proportional_height: null,\n proportional_origin: { x: 0, y: null },\n margin: { top: 0, right: 0, bottom: 0, left: 0 },\n background_click: \"clear_selections\",\n dashboard: {\n components: []\n },\n cliparea: {\n height: 0,\n width: 0,\n origin: { x: 0, y: 0 }\n },\n axes: { // These are the only axes supported!!\n x: {},\n y1: {},\n y2: {}\n },\n legend: null,\n interaction: {\n drag_background_to_pan: false,\n drag_x_ticks_to_scale: false,\n drag_y1_ticks_to_scale: false,\n drag_y2_ticks_to_scale: false,\n scroll_to_zoom: false,\n x_linked: false,\n y1_linked: false,\n y2_linked: false\n },\n data_layers: []\n};\n\n/**\n * Prepare the panel for first use by performing parameter validation, creating axes, setting default dimensions,\n * and preparing / positioning data layers as appropriate.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initializeLayout = function(){\n\n // If the layout is missing BOTH width and proportional width then set the proportional width to 1.\n // This will default the panel to taking up the full width of the plot.\n if (this.layout.width === 0 && this.layout.proportional_width === null){\n this.layout.proportional_width = 1;\n }\n\n // If the layout is missing BOTH height and proportional height then set the proportional height to\n // an equal share of the plot's current height.\n if (this.layout.height === 0 && this.layout.proportional_height === null){\n var panel_count = Object.keys(this.parent.panels).length;\n if (panel_count > 0){\n this.layout.proportional_height = (1 / panel_count);\n } else {\n this.layout.proportional_height = 1;\n }\n }\n\n // Set panel dimensions, origin, and margin\n this.setDimensions();\n this.setOrigin();\n this.setMargin();\n\n // Set ranges\n // TODO: Define stub values in constructor\n this.x_range = [0, this.layout.cliparea.width];\n this.y1_range = [this.layout.cliparea.height, 0];\n this.y2_range = [this.layout.cliparea.height, 0];\n\n // Initialize panel axes\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!Object.keys(this.layout.axes[axis]).length || this.layout.axes[axis].render ===false){\n // The default layout sets the axis to an empty object, so set its render boolean here\n this.layout.axes[axis].render = false;\n } else {\n this.layout.axes[axis].render = true;\n this.layout.axes[axis].label = this.layout.axes[axis].label || null;\n this.layout.axes[axis].label_function = this.layout.axes[axis].label_function || null;\n }\n }.bind(this));\n\n // Add data layers (which define x and y extents)\n this.layout.data_layers.forEach(function(data_layer_layout){\n this.addDataLayer(data_layer_layout);\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Set the dimensions for the panel. If passed with no arguments will calculate optimal size based on layout\n * directives and the available area within the plot. If passed discrete width (number) and height (number) will\n * attempt to resize the panel to them, but may be limited by minimum dimensions defined on the plot or panel.\n *\n * @public\n * @param {number} [width]\n * @param {number} [height]\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setDimensions = function(width, height){\n if (typeof width != \"undefined\" && typeof height != \"undefined\"){\n if (!isNaN(width) && width >= 0 && !isNaN(height) && height >= 0){\n this.layout.width = Math.max(Math.round(+width), this.layout.min_width);\n this.layout.height = Math.max(Math.round(+height), this.layout.min_height);\n }\n } else {\n if (this.layout.proportional_width !== null){\n this.layout.width = Math.max(this.layout.proportional_width * this.parent.layout.width, this.layout.min_width);\n }\n if (this.layout.proportional_height !== null){\n this.layout.height = Math.max(this.layout.proportional_height * this.parent.layout.height, this.layout.min_height);\n }\n }\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n if (this.svg.clipRect){\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n }\n if (this.initialized){\n this.render();\n this.curtain.update();\n this.loader.update();\n this.dashboard.update();\n if (this.legend){ this.legend.position(); }\n }\n return this;\n};\n\n/**\n * Set panel origin on the plot, and re-render as appropriate\n *\n * @public\n * @param {number} x\n * @param {number} y\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setOrigin = function(x, y){\n if (!isNaN(x) && x >= 0){ this.layout.origin.x = Math.max(Math.round(+x), 0); }\n if (!isNaN(y) && y >= 0){ this.layout.origin.y = Math.max(Math.round(+y), 0); }\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set margins around this panel\n * @public\n * @param {number} top\n * @param {number} right\n * @param {number} bottom\n * @param {number} left\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setMargin = function(top, right, bottom, left){\n var extra;\n if (!isNaN(top) && top >= 0){ this.layout.margin.top = Math.max(Math.round(+top), 0); }\n if (!isNaN(right) && right >= 0){ this.layout.margin.right = Math.max(Math.round(+right), 0); }\n if (!isNaN(bottom) && bottom >= 0){ this.layout.margin.bottom = Math.max(Math.round(+bottom), 0); }\n if (!isNaN(left) && left >= 0){ this.layout.margin.left = Math.max(Math.round(+left), 0); }\n if (this.layout.margin.top + this.layout.margin.bottom > this.layout.height){\n extra = Math.floor(((this.layout.margin.top + this.layout.margin.bottom) - this.layout.height) / 2);\n this.layout.margin.top -= extra;\n this.layout.margin.bottom -= extra;\n }\n if (this.layout.margin.left + this.layout.margin.right > this.layout.width){\n extra = Math.floor(((this.layout.margin.left + this.layout.margin.right) - this.layout.width) / 2);\n this.layout.margin.left -= extra;\n this.layout.margin.right -= extra;\n }\n [\"top\", \"right\", \"bottom\", \"left\"].forEach(function(m){\n this.layout.margin[m] = Math.max(this.layout.margin[m], 0);\n }.bind(this));\n this.layout.cliparea.width = Math.max(this.layout.width - (this.layout.margin.left + this.layout.margin.right), 0);\n this.layout.cliparea.height = Math.max(this.layout.height - (this.layout.margin.top + this.layout.margin.bottom), 0);\n this.layout.cliparea.origin.x = this.layout.margin.left;\n this.layout.cliparea.origin.y = this.layout.margin.top;\n\n if (this.initialized){ this.render(); }\n return this;\n};\n\n/**\n * Set the title for the panel. If passed an object, will merge the object with the existing layout configuration, so\n * that all or only some of the title layout object's parameters can be customized. If passed null, false, or an empty\n * string, the title DOM element will be set to display: none.\n *\n * @param {string|object|null} title The title text, or an object with additional configuration\n * @param {string} title.text Text to display. Since titles are rendered as SVG text, HTML and newlines will not be rendered.\n * @param {number} title.x X-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n * @param {number} title.y Y-offset, in pixels, for the title's text anchor (default left) relative to the top-left corner of the panel.\n NOTE: SVG y values go from the top down, so the SVG origin of (0,0) is in the top left corner.\n * @param {object} title.style CSS styles object to be applied to the title's DOM element.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.setTitle = function(title){\n if (typeof this.layout.title == \"string\"){\n var text = this.layout.title;\n this.layout.title = { text: text, x: 0, y: 0, style: {} };\n }\n if (typeof title == \"string\"){\n this.layout.title.text = title;\n } else if (typeof title == \"object\" && title !== null){\n this.layout.title = LocusZoom.Layouts.merge(title, this.layout.title);\n }\n if (this.layout.title.text.length){\n this.title.attr(\"display\", null)\n .attr(\"x\", parseFloat(this.layout.title.x))\n .attr(\"y\", parseFloat(this.layout.title.y))\n .style(this.layout.title.style)\n .text(this.layout.title.text);\n } else {\n this.title.attr(\"display\", \"none\");\n }\n return this;\n};\n\n\n/**\n * Prepare the first rendering of the panel. This includes drawing the individual data layers, but also creates shared\n * elements such as axes, title, and loader/curtain.\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.initialize = function(){\n\n // Append a container group element to house the main panel group element and the clip path\n // Position with initial layout parameters\n this.svg.container = this.parent.svg.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel_container\")\n .attr(\"transform\", \"translate(\" + (this.layout.origin.x || 0) + \",\" + (this.layout.origin.y || 0) + \")\");\n\n // Append clip path to the parent svg element, size with initial layout parameters\n var clipPath = this.svg.container.append(\"clipPath\")\n .attr(\"id\", this.getBaseId() + \".clip\");\n this.svg.clipRect = clipPath.append(\"rect\")\n .attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Append svg group for rendering all panel child elements, clipped by the clip path\n this.svg.group = this.svg.container.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".panel\")\n .attr(\"clip-path\", \"url(#\" + this.getBaseId() + \".clip)\");\n\n // Add curtain and loader prototypes to the panel\n /** @member {Object} */\n this.curtain = LocusZoom.generateCurtain.call(this);\n /** @member {Object} */\n this.loader = LocusZoom.generateLoader.call(this);\n\n /**\n * Create the dashboard object and hang components on it as defined by panel layout\n * @member {LocusZoom.Dashboard}\n */\n this.dashboard = new LocusZoom.Dashboard(this);\n\n // Inner border\n this.inner_border = this.svg.group.append(\"rect\")\n .attr(\"class\", \"lz-panel-background\")\n .on(\"click\", function(){\n if (this.layout.background_click === \"clear_selections\"){ this.clearSelections(); }\n }.bind(this));\n\n // Add the title\n /** @member {Element} */\n this.title = this.svg.group.append(\"text\").attr(\"class\", \"lz-panel-title\");\n if (typeof this.layout.title != \"undefined\"){ this.setTitle(); }\n\n // Initialize Axes\n this.svg.x_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".x_axis\").attr(\"class\", \"lz-x lz-axis\");\n if (this.layout.axes.x.render){\n this.svg.x_axis_label = this.svg.x_axis.append(\"text\")\n .attr(\"class\", \"lz-x lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y1_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y1_axis\").attr(\"class\", \"lz-y lz-y1 lz-axis\");\n if (this.layout.axes.y1.render){\n this.svg.y1_axis_label = this.svg.y1_axis.append(\"text\")\n .attr(\"class\", \"lz-y1 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n this.svg.y2_axis = this.svg.group.append(\"g\")\n .attr(\"id\", this.getBaseId() + \".y2_axis\").attr(\"class\", \"lz-y lz-y2 lz-axis\");\n if (this.layout.axes.y2.render){\n this.svg.y2_axis_label = this.svg.y2_axis.append(\"text\")\n .attr(\"class\", \"lz-y2 lz-axis lz-label\")\n .attr(\"text-anchor\", \"middle\");\n }\n\n // Initialize child Data Layers\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].initialize();\n }.bind(this));\n\n /**\n * Legend object, as defined by panel layout and child data layer layouts\n * @member {LocusZoom.Legend}\n * */\n this.legend = null;\n if (this.layout.legend){\n this.legend = new LocusZoom.Legend(this);\n }\n\n // Establish panel background drag interaction mousedown event handler (on the panel background)\n if (this.layout.interaction.drag_background_to_pan){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var mousedown = function(){\n this.parent.startDrag(this, \"background\");\n }.bind(this);\n this.svg.container.select(\".lz-panel-background\")\n .on(\"mousedown\" + namespace + \".background\", mousedown)\n .on(\"touchstart\" + namespace + \".background\", mousedown);\n }\n\n return this;\n\n};\n\n/**\n * Refresh the sort order of all data layers (called by data layer moveUp and moveDown methods)\n */\nLocusZoom.Panel.prototype.resortDataLayers = function(){\n var sort = [];\n this.data_layer_ids_by_z_index.forEach(function(id){\n sort.push(this.data_layers[id].layout.z_index);\n }.bind(this));\n this.svg.group.selectAll(\"g.lz-data_layer-container\").data(sort).sort(d3.ascending);\n this.applyDataLayerZIndexesToDataLayerLayouts();\n};\n\n/**\n * Get an array of panel IDs that are axis-linked to this panel\n * @param {('x'|'y1'|'y2')} axis\n * @returns {Array}\n */\nLocusZoom.Panel.prototype.getLinkedPanelIds = function(axis){\n axis = axis || null;\n var linked_panel_ids = [];\n if ([\"x\",\"y1\",\"y2\"].indexOf(axis) === -1){ return linked_panel_ids; }\n if (!this.layout.interaction[axis + \"_linked\"]){ return linked_panel_ids; }\n this.parent.panel_ids_by_y_index.forEach(function(panel_id){\n if (panel_id !== this.id && this.parent.panels[panel_id].layout.interaction[axis + \"_linked\"]){\n linked_panel_ids.push(panel_id);\n }\n }.bind(this));\n return linked_panel_ids;\n};\n\n/**\n * Move a panel up relative to others by y-index\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveUp = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index - 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index - 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index - 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Move a panel down (y-axis) relative to others in the plot\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.moveDown = function(){\n if (this.parent.panel_ids_by_y_index[this.layout.y_index + 1]){\n this.parent.panel_ids_by_y_index[this.layout.y_index] = this.parent.panel_ids_by_y_index[this.layout.y_index + 1];\n this.parent.panel_ids_by_y_index[this.layout.y_index + 1] = this.id;\n this.parent.applyPanelYIndexesToPanelLayouts();\n this.parent.positionPanels();\n }\n return this;\n};\n\n/**\n * Create a new data layer from a provided layout object. Should have the keys specified in `DefaultLayout`\n * Will automatically add at the top (depth/z-index) of the panel unless explicitly directed differently\n * in the layout provided.\n * @param {object} layout\n * @returns {*}\n */\nLocusZoom.Panel.prototype.addDataLayer = function(layout){\n\n // Sanity checks\n if (typeof layout !== \"object\" || typeof layout.id !== \"string\" || !layout.id.length){\n throw \"Invalid data layer layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n if (typeof this.data_layers[layout.id] !== \"undefined\"){\n throw \"Cannot create data_layer with id [\" + layout.id + \"]; data layer with that id already exists in the panel\";\n }\n if (typeof layout.type !== \"string\"){\n throw \"Invalid data layer type in layout passed to LocusZoom.Panel.prototype.addDataLayer()\";\n }\n\n // If the layout defines a y axis make sure the axis number is set and is 1 or 2 (default to 1)\n if (typeof layout.y_axis == \"object\" && (typeof layout.y_axis.axis == \"undefined\" || [1,2].indexOf(layout.y_axis.axis) === -1)){\n layout.y_axis.axis = 1;\n }\n\n // Create the Data Layer\n var data_layer = LocusZoom.DataLayers.get(layout.type, layout, this);\n\n // Store the Data Layer on the Panel\n this.data_layers[data_layer.id] = data_layer;\n\n // If a discrete z_index was set in the layout then adjust other data layer z_index values to accommodate this one\n if (data_layer.layout.z_index !== null && !isNaN(data_layer.layout.z_index)\n && this.data_layer_ids_by_z_index.length > 0){\n // Negative z_index values should count backwards from the end, so convert negatives to appropriate values here\n if (data_layer.layout.z_index < 0){\n data_layer.layout.z_index = Math.max(this.data_layer_ids_by_z_index.length + data_layer.layout.z_index, 0);\n }\n this.data_layer_ids_by_z_index.splice(data_layer.layout.z_index, 0, data_layer.id);\n this.data_layer_ids_by_z_index.forEach(function(dlid, idx){\n this.data_layers[dlid].layout.z_index = idx;\n }.bind(this));\n } else {\n var length = this.data_layer_ids_by_z_index.push(data_layer.id);\n this.data_layers[data_layer.id].layout.z_index = length - 1;\n }\n\n // Determine if this data layer was already in the layout.data_layers array.\n // If it wasn't, add it. Either way store the layout.data_layers array index on the data_layer.\n var layout_idx = null;\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n if (data_layer_layout.id === data_layer.id){ layout_idx = idx; }\n });\n if (layout_idx === null){\n layout_idx = this.layout.data_layers.push(this.data_layers[data_layer.id].layout) - 1;\n }\n this.data_layers[data_layer.id].layout_idx = layout_idx;\n\n return this.data_layers[data_layer.id];\n};\n\n/**\n * Remove a data layer by id\n * @param {string} id\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.removeDataLayer = function(id){\n if (!this.data_layers[id]){\n throw (\"Unable to remove data layer, ID not found: \" + id);\n }\n\n // Destroy all tooltips for the data layer\n this.data_layers[id].destroyAllTooltips();\n\n // Remove the svg container for the data layer if it exists\n if (this.data_layers[id].svg.container){\n this.data_layers[id].svg.container.remove();\n }\n\n // Delete the data layer and its presence in the panel layout and state\n this.layout.data_layers.splice(this.data_layers[id].layout_idx, 1);\n delete this.state[this.data_layers[id].state_id];\n delete this.data_layers[id];\n\n // Remove the data_layer id from the z_index array\n this.data_layer_ids_by_z_index.splice(this.data_layer_ids_by_z_index.indexOf(id), 1);\n\n // Update layout_idx and layout.z_index values for all remaining data_layers\n this.applyDataLayerZIndexesToDataLayerLayouts();\n this.layout.data_layers.forEach(function(data_layer_layout, idx){\n this.data_layers[data_layer_layout.id].layout_idx = idx;\n }.bind(this));\n\n return this;\n};\n\n/**\n * Clear all selections on all data layers\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.clearSelections = function(){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(\"selected\", false);\n }.bind(this));\n return this;\n};\n\n/**\n * When the parent plot changes state, adjust the panel accordingly. For example, this may include fetching new data\n * from the API as the viewing region changes\n * @returns {Promise}\n */\nLocusZoom.Panel.prototype.reMap = function(){\n this.emit(\"data_requested\");\n this.data_promises = [];\n\n // Remove any previous error messages before attempting to load new data\n this.curtain.hide();\n // Trigger reMap on each Data Layer\n for (var id in this.data_layers){\n try {\n this.data_promises.push(this.data_layers[id].reMap());\n } catch (error) {\n console.warn(error);\n this.curtain.show(error);\n }\n }\n // When all finished trigger a render\n return Q.all(this.data_promises)\n .then(function(){\n this.initialized = true;\n this.render();\n this.emit(\"layout_changed\", true);\n this.emit(\"data_rendered\");\n }.bind(this))\n .catch(function(error){\n console.warn(error);\n this.curtain.show(error);\n }.bind(this));\n};\n\n/**\n * Iterate over data layers to generate panel axis extents\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.generateExtents = function(){\n\n // Reset extents\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n this[axis + \"_extent\"] = null;\n }.bind(this));\n\n // Loop through the data layers\n for (var id in this.data_layers){\n\n var data_layer = this.data_layers[id];\n\n // If defined and not decoupled, merge the x extent of the data layer with the panel's x extent\n if (data_layer.layout.x_axis && !data_layer.layout.x_axis.decoupled){\n this.x_extent = d3.extent((this.x_extent || []).concat(data_layer.getAxisExtent(\"x\")));\n }\n\n // If defined and not decoupled, merge the y extent of the data layer with the panel's appropriate y extent\n if (data_layer.layout.y_axis && !data_layer.layout.y_axis.decoupled){\n var y_axis = \"y\" + data_layer.layout.y_axis.axis;\n this[y_axis+\"_extent\"] = d3.extent((this[y_axis+\"_extent\"] || []).concat(data_layer.getAxisExtent(\"y\")));\n }\n\n }\n\n // Override x_extent from state if explicitly defined to do so\n if (this.layout.axes.x && this.layout.axes.x.extent === \"state\"){\n this.x_extent = [ this.state.start, this.state.end ];\n }\n\n return this;\n\n};\n\n/**\n * Generate an array of ticks for an axis. These ticks are generated in one of three ways (highest wins):\n * 1. An array of specific tick marks\n * 2. Query each data layer for what ticks are appropriate, and allow a panel-level tick configuration parameter\n * object to override the layer's default presentation settings\n * 3. Generate generic tick marks based on the extent of the data\n * @param {('x'|'y1'|'y2')} axis The string identifier of the axis\n * @returns {Number[]|Object[]} TODO: number format?\n * An array of numbers: interpreted as an array of axis value offsets for positioning.\n * An array of objects: each object must have an 'x' attribute to position the tick.\n * Other supported object keys:\n * * text: string to render for a given tick\n * * style: d3-compatible CSS style object\n * * transform: SVG transform attribute string\n * * color: string or LocusZoom scalable parameter object\n */\nLocusZoom.Panel.prototype.generateTicks = function(axis){\n\n // Parse an explicit 'ticks' attribute in the axis layout\n if (this.layout.axes[axis].ticks){\n var layout = this.layout.axes[axis];\n\n var baseTickConfig = layout.ticks;\n if (Array.isArray(baseTickConfig)){\n // Array of specific ticks hard-coded into a panel will override any ticks that an individual layer might specify\n return baseTickConfig;\n }\n\n if (typeof baseTickConfig === \"object\") {\n // If the layout specifies base configuration for ticks- but without specific positions- then ask each\n // data layer to report the tick marks that it thinks it needs\n // TODO: Few layers currently need to specify custom ticks (which is ok!). But if it becomes common, consider adding mechanisms to deduplicate ticks across layers\n var self = this;\n\n // Pass any layer-specific customizations for how ticks are calculated. (styles are overridden separately)\n var config = { position: baseTickConfig.position };\n\n var combinedTicks = this.data_layer_ids_by_z_index.reduce(function(acc, data_layer_id) {\n var nextLayer = self.data_layers[data_layer_id];\n return acc.concat(nextLayer.getTicks(axis, config));\n }, []);\n\n return combinedTicks.map(function(item) {\n // The layer makes suggestions, but tick configuration params specified on the panel take precedence\n var itemConfig = {};\n itemConfig = LocusZoom.Layouts.merge(itemConfig, baseTickConfig);\n return LocusZoom.Layouts.merge(itemConfig, item);\n });\n }\n }\n\n // If no other configuration is provided, attempt to generate ticks from the extent\n if (this[axis + \"_extent\"]) {\n return LocusZoom.prettyTicks(this[axis + \"_extent\"], \"both\");\n }\n return [];\n};\n\n/**\n * Update rendering of this panel whenever an event triggers a redraw. Assumes that the panel has already been\n * prepared the first time via `initialize`\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.render = function(){\n\n // Position the panel container\n this.svg.container.attr(\"transform\", \"translate(\" + this.layout.origin.x + \",\" + this.layout.origin.y + \")\");\n\n // Set size on the clip rect\n this.svg.clipRect.attr(\"width\", this.layout.width).attr(\"height\", this.layout.height);\n\n // Set and position the inner border, style if necessary\n this.inner_border\n .attr(\"x\", this.layout.margin.left).attr(\"y\", this.layout.margin.top)\n .attr(\"width\", this.layout.width - (this.layout.margin.left + this.layout.margin.right))\n .attr(\"height\", this.layout.height - (this.layout.margin.top + this.layout.margin.bottom));\n if (this.layout.inner_border){\n this.inner_border.style({ \"stroke-width\": 1, \"stroke\": this.layout.inner_border });\n }\n\n // Set/update panel title if necessary\n this.setTitle();\n\n // Regenerate all extents\n this.generateExtents();\n\n // Helper function to constrain any procedurally generated vectors (e.g. ranges, extents)\n // Constraints applied here keep vectors from going to infinity or beyond a definable power of ten\n var constrain = function(value, limit_exponent){\n var neg_min = Math.pow(-10, limit_exponent);\n var neg_max = Math.pow(-10, -limit_exponent);\n var pos_min = Math.pow(10, -limit_exponent);\n var pos_max = Math.pow(10, limit_exponent);\n if (value === Infinity){ value = pos_max; }\n if (value === -Infinity){ value = neg_min; }\n if (value === 0){ value = pos_min; }\n if (value > 0){ value = Math.max(Math.min(value, pos_max), pos_min); }\n if (value < 0){ value = Math.max(Math.min(value, neg_max), neg_min); }\n return value;\n };\n\n // Define default and shifted ranges for all axes\n var ranges = {};\n if (this.x_extent){\n var base_x_range = { start: 0, end: this.layout.cliparea.width };\n if (this.layout.axes.x.range){\n base_x_range.start = this.layout.axes.x.range.start || base_x_range.start;\n base_x_range.end = this.layout.axes.x.range.end || base_x_range.end;\n }\n ranges.x = [base_x_range.start, base_x_range.end];\n ranges.x_shifted = [base_x_range.start, base_x_range.end];\n }\n if (this.y1_extent){\n var base_y1_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y1.range){\n base_y1_range.start = this.layout.axes.y1.range.start || base_y1_range.start;\n base_y1_range.end = this.layout.axes.y1.range.end || base_y1_range.end;\n }\n ranges.y1 = [base_y1_range.start, base_y1_range.end];\n ranges.y1_shifted = [base_y1_range.start, base_y1_range.end];\n }\n if (this.y2_extent){\n var base_y2_range = { start: this.layout.cliparea.height, end: 0 };\n if (this.layout.axes.y2.range){\n base_y2_range.start = this.layout.axes.y2.range.start || base_y2_range.start;\n base_y2_range.end = this.layout.axes.y2.range.end || base_y2_range.end;\n }\n ranges.y2 = [base_y2_range.start, base_y2_range.end];\n ranges.y2_shifted = [base_y2_range.start, base_y2_range.end];\n }\n\n // Shift ranges based on any drag or zoom interactions currently underway\n if (this.parent.interaction.panel_id && (this.parent.interaction.panel_id === this.id || this.parent.interaction.linked_panel_ids.indexOf(this.id) !== -1)){\n var anchor, scalar = null;\n if (this.parent.interaction.zooming && typeof this.x_scale == \"function\"){\n var current_extent_size = Math.abs(this.x_extent[1] - this.x_extent[0]);\n var current_scaled_extent_size = Math.round(this.x_scale.invert(ranges.x_shifted[1])) - Math.round(this.x_scale.invert(ranges.x_shifted[0]));\n var zoom_factor = this.parent.interaction.zooming.scale;\n var potential_extent_size = Math.floor(current_scaled_extent_size * (1 / zoom_factor));\n if (zoom_factor < 1 && !isNaN(this.parent.layout.max_region_scale)){\n zoom_factor = 1 /(Math.min(potential_extent_size, this.parent.layout.max_region_scale) / current_scaled_extent_size);\n } else if (zoom_factor > 1 && !isNaN(this.parent.layout.min_region_scale)){\n zoom_factor = 1 / (Math.max(potential_extent_size, this.parent.layout.min_region_scale) / current_scaled_extent_size);\n }\n var new_extent_size = Math.floor(current_extent_size * zoom_factor);\n anchor = this.parent.interaction.zooming.center - this.layout.margin.left - this.layout.origin.x;\n var offset_ratio = anchor / this.layout.cliparea.width;\n var new_x_extent_start = Math.max(Math.floor(this.x_scale.invert(ranges.x_shifted[0]) - ((new_extent_size - current_scaled_extent_size) * offset_ratio)), 1);\n ranges.x_shifted = [ this.x_scale(new_x_extent_start), this.x_scale(new_x_extent_start + new_extent_size) ];\n } else if (this.parent.interaction.dragging){\n switch (this.parent.interaction.dragging.method){\n case \"background\":\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n break;\n case \"x_tick\":\n if (d3.event && d3.event.shiftKey){\n ranges.x_shifted[0] = +this.parent.interaction.dragging.dragged_x;\n ranges.x_shifted[1] = this.layout.cliparea.width + this.parent.interaction.dragging.dragged_x;\n } else {\n anchor = this.parent.interaction.dragging.start_x - this.layout.margin.left - this.layout.origin.x;\n scalar = constrain(anchor / (anchor + this.parent.interaction.dragging.dragged_x), 3);\n ranges.x_shifted[0] = 0;\n ranges.x_shifted[1] = Math.max(this.layout.cliparea.width * (1 / scalar), 1);\n }\n break;\n case \"y1_tick\":\n case \"y2_tick\":\n var y_shifted = \"y\" + this.parent.interaction.dragging.method[1] + \"_shifted\";\n if (d3.event && d3.event.shiftKey){\n ranges[y_shifted][0] = this.layout.cliparea.height + this.parent.interaction.dragging.dragged_y;\n ranges[y_shifted][1] = +this.parent.interaction.dragging.dragged_y;\n } else {\n anchor = this.layout.cliparea.height - (this.parent.interaction.dragging.start_y - this.layout.margin.top - this.layout.origin.y);\n scalar = constrain(anchor / (anchor - this.parent.interaction.dragging.dragged_y), 3);\n ranges[y_shifted][0] = this.layout.cliparea.height;\n ranges[y_shifted][1] = this.layout.cliparea.height - (this.layout.cliparea.height * (1 / scalar));\n }\n }\n }\n }\n\n // Generate scales and ticks for all axes, then render them\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (!this[axis + \"_extent\"]){ return; }\n\n // Base Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"])\n .range(ranges[axis + \"_shifted\"]);\n\n // Shift the extent\n this[axis + \"_extent\"] = [\n this[axis + \"_scale\"].invert(ranges[axis][0]),\n this[axis + \"_scale\"].invert(ranges[axis][1])\n ];\n\n // Finalize Scale\n this[axis + \"_scale\"] = d3.scale.linear()\n .domain(this[axis + \"_extent\"]).range(ranges[axis]);\n\n // Render axis (and generate ticks as needed)\n this.renderAxis(axis);\n }.bind(this));\n\n // Establish mousewheel zoom event handers on the panel (namespacing not passed through by d3, so not used here)\n if (this.layout.interaction.scroll_to_zoom){\n var zoom_handler = function(){\n // Look for a shift key press while scrolling to execute.\n // If not present, gracefully raise a notification and allow conventional scrolling\n if (!d3.event.shiftKey){\n if (this.parent.canInteract(this.id)){\n this.loader.show(\"Press [SHIFT] while scrolling to zoom\").hide(1000);\n }\n return;\n }\n d3.event.preventDefault();\n if (!this.parent.canInteract(this.id)){ return; }\n var coords = d3.mouse(this.svg.container.node());\n var delta = Math.max(-1, Math.min(1, (d3.event.wheelDelta || -d3.event.detail || -d3.event.deltaY)));\n if (delta === 0){ return; }\n this.parent.interaction = {\n panel_id: this.id,\n linked_panel_ids: this.getLinkedPanelIds(\"x\"),\n zooming: {\n scale: (delta < 1) ? 0.9 : 1.1,\n center: coords[0]\n }\n };\n this.render();\n this.parent.interaction.linked_panel_ids.forEach(function(panel_id){\n this.parent.panels[panel_id].render();\n }.bind(this));\n if (this.zoom_timeout !== null){ clearTimeout(this.zoom_timeout); }\n this.zoom_timeout = setTimeout(function(){\n this.parent.interaction = {};\n this.parent.applyState({ start: this.x_extent[0], end: this.x_extent[1] });\n }.bind(this), 500);\n }.bind(this);\n this.zoom_listener = d3.behavior.zoom();\n this.svg.container.call(this.zoom_listener)\n .on(\"wheel.zoom\", zoom_handler)\n .on(\"mousewheel.zoom\", zoom_handler)\n .on(\"DOMMouseScroll.zoom\", zoom_handler);\n }\n\n // Render data layers in order by z-index\n this.data_layer_ids_by_z_index.forEach(function(data_layer_id){\n this.data_layers[data_layer_id].draw().render();\n }.bind(this));\n\n return this;\n};\n\n\n/**\n * Render ticks for a particular axis\n * @param {('x'|'y1'|'y2')} axis The identifier of the axes\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.renderAxis = function(axis){\n\n if ([\"x\", \"y1\", \"y2\"].indexOf(axis) === -1){\n throw(\"Unable to render axis; invalid axis identifier: \" + axis);\n }\n\n var canRender = this.layout.axes[axis].render\n && typeof this[axis + \"_scale\"] == \"function\"\n && !isNaN(this[axis + \"_scale\"](0));\n\n // If the axis has already been rendered then check if we can/can't render it\n // Make sure the axis element is shown/hidden to suit\n if (this[axis+\"_axis\"]){\n this.svg.container.select(\"g.lz-axis.lz-\"+axis).style(\"display\", canRender ? null : \"none\");\n }\n\n if (!canRender){ return this; }\n\n // Axis-specific values to plug in where needed\n var axis_params = {\n x: {\n position: \"translate(\" + this.layout.margin.left + \",\" + (this.layout.height - this.layout.margin.bottom) + \")\",\n orientation: \"bottom\",\n label_x: this.layout.cliparea.width / 2,\n label_y: (this.layout.axes[axis].label_offset || 0),\n label_rotate: null\n },\n y1: {\n position: \"translate(\" + this.layout.margin.left + \",\" + this.layout.margin.top + \")\",\n orientation: \"left\",\n label_x: -1 * (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n },\n y2: {\n position: \"translate(\" + (this.layout.width - this.layout.margin.right) + \",\" + this.layout.margin.top + \")\",\n orientation: \"right\",\n label_x: (this.layout.axes[axis].label_offset || 0),\n label_y: this.layout.cliparea.height / 2,\n label_rotate: -90\n }\n };\n\n // Generate Ticks\n this[axis + \"_ticks\"] = this.generateTicks(axis);\n\n // Determine if the ticks are all numbers (d3-automated tick rendering) or not (manual tick rendering)\n var ticksAreAllNumbers = (function(ticks){\n for (var i = 0; i < ticks.length; i++){\n if (isNaN(ticks[i])){\n return false;\n }\n }\n return true;\n })(this[axis+\"_ticks\"]);\n\n // Initialize the axis; set scale and orientation\n this[axis+\"_axis\"] = d3.svg.axis().scale(this[axis+\"_scale\"]).orient(axis_params[axis].orientation).tickPadding(3);\n\n // Set tick values and format\n if (ticksAreAllNumbers){\n this[axis+\"_axis\"].tickValues(this[axis+\"_ticks\"]);\n if (this.layout.axes[axis].tick_format === \"region\"){\n this[axis+\"_axis\"].tickFormat(function(d) { return LocusZoom.positionIntToString(d, 6); });\n }\n } else {\n var ticks = this[axis+\"_ticks\"].map(function(t){\n return(t[axis.substr(0,1)]);\n });\n this[axis+\"_axis\"].tickValues(ticks)\n .tickFormat(function(t, i) { return this[axis+\"_ticks\"][i].text; }.bind(this));\n }\n\n // Position the axis in the SVG and apply the axis construct\n this.svg[axis+\"_axis\"]\n .attr(\"transform\", axis_params[axis].position)\n .call(this[axis+\"_axis\"]);\n\n // If necessary manually apply styles and transforms to ticks as specified by the layout\n if (!ticksAreAllNumbers){\n var tick_selector = d3.selectAll(\"g#\" + this.getBaseId().replace(\".\",\"\\\\.\") + \"\\\\.\" + axis + \"_axis g.tick\");\n var panel = this;\n tick_selector.each(function(d, i){\n var selector = d3.select(this).select(\"text\");\n if (panel[axis+\"_ticks\"][i].style){\n selector.style(panel[axis+\"_ticks\"][i].style);\n }\n if (panel[axis+\"_ticks\"][i].transform){\n selector.attr(\"transform\", panel[axis+\"_ticks\"][i].transform);\n }\n });\n }\n\n // Render the axis label if necessary\n var label = this.layout.axes[axis].label || null;\n if (label !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"x\", axis_params[axis].label_x).attr(\"y\", axis_params[axis].label_y)\n .text(LocusZoom.parseFields(this.state, label));\n if (axis_params[axis].label_rotate !== null){\n this.svg[axis+\"_axis_label\"]\n .attr(\"transform\", \"rotate(\" + axis_params[axis].label_rotate + \" \" + axis_params[axis].label_x + \",\" + axis_params[axis].label_y + \")\");\n }\n }\n\n // Attach interactive handlers to ticks as needed\n [\"x\", \"y1\", \"y2\"].forEach(function(axis){\n if (this.layout.interaction[\"drag_\" + axis + \"_ticks_to_scale\"]){\n var namespace = \".\" + this.parent.id + \".\" + this.id + \".interaction.drag\";\n var tick_mouseover = function(){\n if (typeof d3.select(this).node().focus == \"function\"){ d3.select(this).node().focus(); }\n var cursor = (axis === \"x\") ? \"ew-resize\" : \"ns-resize\";\n if (d3.event && d3.event.shiftKey){ cursor = \"move\"; }\n d3.select(this)\n .style({\"font-weight\": \"bold\", \"cursor\": cursor})\n .on(\"keydown\" + namespace, tick_mouseover)\n .on(\"keyup\" + namespace, tick_mouseover);\n };\n this.svg.container.selectAll(\".lz-axis.lz-\" + axis + \" .tick text\")\n .attr(\"tabindex\", 0) // necessary to make the tick focusable so keypress events can be captured\n .on(\"mouseover\" + namespace, tick_mouseover)\n .on(\"mouseout\" + namespace, function(){\n d3.select(this).style({\"font-weight\": \"normal\"});\n d3.select(this).on(\"keydown\" + namespace, null).on(\"keyup\" + namespace, null);\n })\n .on(\"mousedown\" + namespace, function(){\n this.parent.startDrag(this, axis + \"_tick\");\n }.bind(this));\n }\n }.bind(this));\n\n return this;\n\n};\n\n/**\n * Force the height of this panel to the largest absolute height of the data in\n * all child data layers (if not null for any child data layers)\n * @param {number} [target_height] A target height, which will be used in situations when the expected height can be\n * pre-calculated (eg when the layers are transitioning)\n */\nLocusZoom.Panel.prototype.scaleHeightToData = function(target_height){\n target_height = +target_height || null;\n if (target_height === null){\n this.data_layer_ids_by_z_index.forEach(function(id){\n var dh = this.data_layers[id].getAbsoluteDataHeight();\n if (+dh){\n if (target_height === null){ target_height = +dh; }\n else { target_height = Math.max(target_height, +dh); }\n }\n }.bind(this));\n }\n if (+target_height){\n target_height += +this.layout.margin.top + +this.layout.margin.bottom;\n this.setDimensions(this.layout.width, target_height);\n this.parent.setDimensions();\n this.parent.panel_ids_by_y_index.forEach(function(id){\n this.parent.panels[id].layout.proportional_height = null;\n }.bind(this));\n this.parent.positionPanels();\n }\n};\n\n/**\n * Methods to set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n * @param {Array} filters\n * @param {Boolean} exclusive\n */\nLocusZoom.Panel.prototype.setElementStatusByFilters = function(status, toggle, filters, exclusive){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setElementStatusByFilters(status, toggle, filters, exclusive);\n }.bind(this));\n};\n/**\n * Set/unset element statuses across all data layers\n * @param {String} status\n * @param {Boolean} toggle\n */\nLocusZoom.Panel.prototype.setAllElementStatus = function(status, toggle){\n this.data_layer_ids_by_z_index.forEach(function(id){\n this.data_layers[id].setAllElementStatus(status, toggle);\n }.bind(this));\n};\n// TODO: Capture documentation for dynamically generated methods\nLocusZoom.DataLayer.Statuses.verbs.forEach(function(verb, idx){\n var adjective = LocusZoom.DataLayer.Statuses.adjectives[idx];\n var antiverb = \"un\" + verb;\n // Set/unset status for arbitrarily many elements given a set of filters\n LocusZoom.Panel.prototype[verb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, true, filters, exclusive);\n };\n LocusZoom.Panel.prototype[antiverb + \"ElementsByFilters\"] = function(filters, exclusive){\n if (typeof exclusive == \"undefined\"){ exclusive = false; } else { exclusive = !!exclusive; }\n return this.setElementStatusByFilters(adjective, false, filters, exclusive);\n };\n // Set/unset status for all elements\n LocusZoom.Panel.prototype[verb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, true);\n return this;\n };\n LocusZoom.Panel.prototype[antiverb + \"AllElements\"] = function(){\n this.setAllElementStatus(adjective, false);\n return this;\n };\n});\n\n\n/**\n * Add a \"basic\" loader to a panel\n * This method is just a shortcut for adding the most commonly used type of loading indicator, which appears when\n * data is requested, animates (e.g. shows an infinitely cycling progress bar as opposed to one that loads from\n * 0-100% based on actual load progress), and disappears when new data is loaded and rendered.\n *\n *\n * @param {Boolean} show_immediately\n * @returns {LocusZoom.Panel}\n */\nLocusZoom.Panel.prototype.addBasicLoader = function(show_immediately){\n if (typeof show_immediately != \"undefined\"){ show_immediately = true; }\n if (show_immediately){\n this.loader.show(\"Loading...\").animate();\n }\n this.on(\"data_requested\", function(){\n this.loader.show(\"Loading...\").animate();\n }.bind(this));\n this.on(\"data_rendered\", function(){\n this.loader.hide();\n }.bind(this));\n return this;\n};\n"]} \ No newline at end of file diff --git a/index.html b/index.html index 7f3ce613..377e8616 100644 --- a/index.html +++ b/index.html @@ -63,7 +63,7 @@

      Top Hits

      Get LocusZoom.js

      -
      Current stable release: v0.7.2
      +
      Current stable release: v0.8.0

      To use LocusZoom.js in your application you will need both LocusZoom's compiled Javascript and CSS and two third-party Javascript libraries (available here in a single vendor bundle).

      @@ -84,7 +84,7 @@
      Javascript
      CSS
      @@ -97,7 +97,7 @@
      CSS
      Dependencies
      diff --git a/package.json b/package.json index 850211b6..cb4fdb16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "locuszoom", - "version": "0.7.2", + "version": "0.8.0", "description": "Generate interactive visualizations of statistical genetic data", "keywords": [ "visualization",