';
- }
-
-}
-
-?>
\ No newline at end of file
diff --git a/classes/activity.class.php b/classes/activity.class.php
deleted file mode 100644
index be9272d..0000000
--- a/classes/activity.class.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- */
-class activity {
-
- /**
- * Prints json array with 'active' value of XML file in $path path
- * @param String $path
- */
- public static function isactivated($path) {
- $doc = new DOMDocument();
- $doc->load($path);
- $isactivated = $doc->firstChild;
- $is = $isactivated->nodeValue;
- $json = array('active' => $is);
- echo json_encode($json);
- }
-
- /**
- * Tests if XML File has value true (hence app is On)
- * @param String $path
- * @return boolean
- */
- public static function isactivated2($path) {
- $doc = new DOMDocument();
- $doc->load($path);
- $isactivated = $doc->firstChild;
- $is = $isactivated->nodeValue;
- if ($is == "true") {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Toggles activity - swithces app On/Off
- * @param Path $path
- */
- public static function toggleactivity($path) {
- $doc = new DOMDocument();
- $doc->load($path);
- $isactivated = $doc->firstChild;
- $is = $isactivated->nodeValue;
- if ($is == "true") {
- $zmienna = '';
- $zmienna.='
';
- }
- file_put_contents("../../activity/active.xml", $zmienna);
- $json = array('active' => $is);
- echo json_encode($json);
- }
-
- /**
- * Returns Error message in way formed by jQuery UI
- * @param String $message
- * @return String
- */
- public static function errormessage($message) {
- return '
';
- }
-
-}
-
-?>
diff --git a/classes/login.class.php b/classes/login.class.php
deleted file mode 100644
index cb33a48..0000000
--- a/classes/login.class.php
+++ /dev/null
@@ -1,39 +0,0 @@
-
- */
-class login {
-
- const password = '85baf8d8d517ab142292d8814be41a60a5e27bc8ba001ac8';
- const login = 'admin';
-
- /**
- * Returns true if login and hash are correct, false otherwise
- * @param String $login
- * @param String $password
- * @return boolean
- */
- public static function validate($login = '', $password = '') {
- if ((login::login == $login) && (login::password == login::encrypt($password))) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Hashes the string with some hash and salt
- * @param String $password
- * @return String
- */
- public static function encrypt($password) {
- return hash('tiger192,4', $password . 'thisisthesalt');
- }
-
-}
-
-?>
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..da2f88e
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,32 @@
+{
+ "name": "pbaczek/simplex",
+ "description": "Library that solves Simplex problems using Dantzig's BigM Simplex algorithm",
+ "license": "MIT",
+ "require": {
+ "php": "8.3.*",
+ "ext-gmp": "*",
+ "pbaczek/fraction": "1.0.*",
+ "ramsey/collection": "2.1.*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "10.5.*"
+ },
+ "autoload": {
+ "psr-4": {
+ "pbaczek\\simplex\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "pbaczek\\simplex\\tests\\": "tests/"
+ }
+ },
+ "config": {
+ "optimize-autoloader": true
+ },
+ "scripts": {
+ "test": [
+ "./vendor/bin/phpunit --testdox ./tests/"
+ ]
+ }
+}
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 0000000..93f28ef
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,1761 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "36224f05247a4cd9b52746193114c1c8",
+ "packages": [
+ {
+ "name": "pbaczek/fraction",
+ "version": "v1.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/piotrbaczek/fraction.git",
+ "reference": "551eb6a806b0f9c3b897b17343b3d5b7c1ee21ad"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/piotrbaczek/fraction/zipball/551eb6a806b0f9c3b897b17343b3d5b7c1ee21ad",
+ "reference": "551eb6a806b0f9c3b897b17343b3d5b7c1ee21ad",
+ "shasum": ""
+ },
+ "require": {
+ "ext-gmp": "*",
+ "php": "8.3.*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "12.0.7"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "pbaczek\\fraction\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Library that handles fractions as nominator/denominator",
+ "support": {
+ "issues": "https://github.com/piotrbaczek/fraction/issues",
+ "source": "https://github.com/piotrbaczek/fraction/tree/v1.0.5"
+ },
+ "time": "2025-04-14T14:53:27+00:00"
+ },
+ {
+ "name": "ramsey/collection",
+ "version": "2.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ramsey/collection.git",
+ "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2",
+ "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^8.1"
+ },
+ "require-dev": {
+ "captainhook/plugin-composer": "^5.3",
+ "ergebnis/composer-normalize": "^2.45",
+ "fakerphp/faker": "^1.24",
+ "hamcrest/hamcrest-php": "^2.0",
+ "jangregor/phpstan-prophecy": "^2.1",
+ "mockery/mockery": "^1.6",
+ "php-parallel-lint/php-console-highlighter": "^1.0",
+ "php-parallel-lint/php-parallel-lint": "^1.4",
+ "phpspec/prophecy-phpunit": "^2.3",
+ "phpstan/extension-installer": "^1.4",
+ "phpstan/phpstan": "^2.1",
+ "phpstan/phpstan-mockery": "^2.0",
+ "phpstan/phpstan-phpunit": "^2.0",
+ "phpunit/phpunit": "^10.5",
+ "ramsey/coding-standard": "^2.3",
+ "ramsey/conventional-commits": "^1.6",
+ "roave/security-advisories": "dev-latest"
+ },
+ "type": "library",
+ "extra": {
+ "captainhook": {
+ "force-install": true
+ },
+ "ramsey/conventional-commits": {
+ "configFile": "conventional-commits.json"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Ramsey\\Collection\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ben Ramsey",
+ "email": "ben@benramsey.com",
+ "homepage": "https://benramsey.com"
+ }
+ ],
+ "description": "A PHP library for representing and manipulating collections.",
+ "keywords": [
+ "array",
+ "collection",
+ "hash",
+ "map",
+ "queue",
+ "set"
+ ],
+ "support": {
+ "issues": "https://github.com/ramsey/collection/issues",
+ "source": "https://github.com/ramsey/collection/tree/2.1.1"
+ },
+ "time": "2025-03-22T05:38:12+00:00"
+ }
+ ],
+ "packages-dev": [
+ {
+ "name": "myclabs/deep-copy",
+ "version": "1.13.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/myclabs/DeepCopy.git",
+ "reference": "024473a478be9df5fdaca2c793f2232fe788e414"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414",
+ "reference": "024473a478be9df5fdaca2c793f2232fe788e414",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "conflict": {
+ "doctrine/collections": "<1.6.8",
+ "doctrine/common": "<2.13.3 || >=3 <3.2.2"
+ },
+ "require-dev": {
+ "doctrine/collections": "^1.6.8",
+ "doctrine/common": "^2.13.3 || ^3.2.2",
+ "phpspec/prophecy": "^1.10",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "src/DeepCopy/deep_copy.php"
+ ],
+ "psr-4": {
+ "DeepCopy\\": "src/DeepCopy/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Create deep copies (clones) of your objects",
+ "keywords": [
+ "clone",
+ "copy",
+ "duplicate",
+ "object",
+ "object graph"
+ ],
+ "support": {
+ "issues": "https://github.com/myclabs/DeepCopy/issues",
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0"
+ },
+ "funding": [
+ {
+ "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2025-02-12T12:17:51+00:00"
+ },
+ {
+ "name": "nikic/php-parser",
+ "version": "v5.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nikic/PHP-Parser.git",
+ "reference": "447a020a1f875a434d62f2a401f53b82a396e494"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494",
+ "reference": "447a020a1f875a434d62f2a401f53b82a396e494",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-json": "*",
+ "ext-tokenizer": "*",
+ "php": ">=7.4"
+ },
+ "require-dev": {
+ "ircmaxell/php-yacc": "^0.0.7",
+ "phpunit/phpunit": "^9.0"
+ },
+ "bin": [
+ "bin/php-parse"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpParser\\": "lib/PhpParser"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Nikita Popov"
+ }
+ ],
+ "description": "A PHP parser written in PHP",
+ "keywords": [
+ "parser",
+ "php"
+ ],
+ "support": {
+ "issues": "https://github.com/nikic/PHP-Parser/issues",
+ "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0"
+ },
+ "time": "2024-12-30T11:07:19+00:00"
+ },
+ {
+ "name": "phar-io/manifest",
+ "version": "2.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phar-io/manifest.git",
+ "reference": "54750ef60c58e43759730615a392c31c80e23176"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176",
+ "reference": "54750ef60c58e43759730615a392c31c80e23176",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-phar": "*",
+ "ext-xmlwriter": "*",
+ "phar-io/version": "^3.0.1",
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
+ "support": {
+ "issues": "https://github.com/phar-io/manifest/issues",
+ "source": "https://github.com/phar-io/manifest/tree/2.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-03T12:33:53+00:00"
+ },
+ {
+ "name": "phar-io/version",
+ "version": "3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phar-io/version.git",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "Library for handling version information and constraints",
+ "support": {
+ "issues": "https://github.com/phar-io/version/issues",
+ "source": "https://github.com/phar-io/version/tree/3.2.1"
+ },
+ "time": "2022-02-21T01:04:05+00:00"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "10.1.16",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "7e308268858ed6baedc8704a304727d20bc07c77"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77",
+ "reference": "7e308268858ed6baedc8704a304727d20bc07c77",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-xmlwriter": "*",
+ "nikic/php-parser": "^4.19.1 || ^5.1.0",
+ "php": ">=8.1",
+ "phpunit/php-file-iterator": "^4.1.0",
+ "phpunit/php-text-template": "^3.0.1",
+ "sebastian/code-unit-reverse-lookup": "^3.0.0",
+ "sebastian/complexity": "^3.2.0",
+ "sebastian/environment": "^6.1.0",
+ "sebastian/lines-of-code": "^2.0.2",
+ "sebastian/version": "^4.0.1",
+ "theseer/tokenizer": "^1.2.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.1"
+ },
+ "suggest": {
+ "ext-pcov": "PHP extension that provides line coverage",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "10.1.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
+ "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-08-22T04:31:57+00:00"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "4.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c",
+ "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
+ "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-08-31T06:24:48+00:00"
+ },
+ {
+ "name": "phpunit/php-invoker",
+ "version": "4.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-invoker.git",
+ "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7",
+ "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "ext-pcntl": "*",
+ "phpunit/phpunit": "^10.0"
+ },
+ "suggest": {
+ "ext-pcntl": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Invoke callables with a timeout",
+ "homepage": "https://github.com/sebastianbergmann/php-invoker/",
+ "keywords": [
+ "process"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
+ "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:56:09+00:00"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "3.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748",
+ "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
+ "security": "https://github.com/sebastianbergmann/php-text-template/security/policy",
+ "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-08-31T14:07:24+00:00"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "6.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d",
+ "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "6.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": [
+ "timer"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-timer/issues",
+ "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:57:52+00:00"
+ },
+ {
+ "name": "phpunit/phpunit",
+ "version": "10.5.45",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "bd68a781d8e30348bc297449f5234b3458267ae8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bd68a781d8e30348bc297449f5234b3458267ae8",
+ "reference": "bd68a781d8e30348bc297449f5234b3458267ae8",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-xml": "*",
+ "ext-xmlwriter": "*",
+ "myclabs/deep-copy": "^1.12.1",
+ "phar-io/manifest": "^2.0.4",
+ "phar-io/version": "^3.2.1",
+ "php": ">=8.1",
+ "phpunit/php-code-coverage": "^10.1.16",
+ "phpunit/php-file-iterator": "^4.1.0",
+ "phpunit/php-invoker": "^4.0.0",
+ "phpunit/php-text-template": "^3.0.1",
+ "phpunit/php-timer": "^6.0.0",
+ "sebastian/cli-parser": "^2.0.1",
+ "sebastian/code-unit": "^2.0.0",
+ "sebastian/comparator": "^5.0.3",
+ "sebastian/diff": "^5.1.1",
+ "sebastian/environment": "^6.1.0",
+ "sebastian/exporter": "^5.1.2",
+ "sebastian/global-state": "^6.0.2",
+ "sebastian/object-enumerator": "^5.0.0",
+ "sebastian/recursion-context": "^5.0.0",
+ "sebastian/type": "^4.0.0",
+ "sebastian/version": "^4.0.1"
+ },
+ "suggest": {
+ "ext-soap": "To be able to generate mocks based on WSDL files"
+ },
+ "bin": [
+ "phpunit"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "10.5-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/Framework/Assert/Functions.php"
+ ],
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "https://phpunit.de/",
+ "keywords": [
+ "phpunit",
+ "testing",
+ "xunit"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/phpunit/issues",
+ "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.45"
+ },
+ "funding": [
+ {
+ "url": "https://phpunit.de/sponsors.html",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2025-02-06T16:08:12+00:00"
+ },
+ {
+ "name": "sebastian/cli-parser",
+ "version": "2.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/cli-parser.git",
+ "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084",
+ "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for parsing CLI options",
+ "homepage": "https://github.com/sebastianbergmann/cli-parser",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/cli-parser/issues",
+ "security": "https://github.com/sebastianbergmann/cli-parser/security/policy",
+ "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T07:12:49+00:00"
+ },
+ {
+ "name": "sebastian/code-unit",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit.git",
+ "reference": "a81fee9eef0b7a76af11d121767abc44c104e503"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503",
+ "reference": "a81fee9eef0b7a76af11d121767abc44c104e503",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/code-unit",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/code-unit/issues",
+ "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:58:43+00:00"
+ },
+ {
+ "name": "sebastian/code-unit-reverse-lookup",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
+ "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d",
+ "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Looks up which function or method a line of code belongs to",
+ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
+ "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:59:15+00:00"
+ },
+ {
+ "name": "sebastian/comparator",
+ "version": "5.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e",
+ "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-mbstring": "*",
+ "php": ">=8.1",
+ "sebastian/diff": "^5.0",
+ "sebastian/exporter": "^5.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ }
+ ],
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "https://github.com/sebastianbergmann/comparator",
+ "keywords": [
+ "comparator",
+ "compare",
+ "equality"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/comparator/issues",
+ "security": "https://github.com/sebastianbergmann/comparator/security/policy",
+ "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-10-18T14:56:07+00:00"
+ },
+ {
+ "name": "sebastian/complexity",
+ "version": "3.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/complexity.git",
+ "reference": "68ff824baeae169ec9f2137158ee529584553799"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799",
+ "reference": "68ff824baeae169ec9f2137158ee529584553799",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.18 || ^5.0",
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for calculating the complexity of PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/complexity",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/complexity/issues",
+ "security": "https://github.com/sebastianbergmann/complexity/security/policy",
+ "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-12-21T08:37:17+00:00"
+ },
+ {
+ "name": "sebastian/diff",
+ "version": "5.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e",
+ "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0",
+ "symfony/process": "^6.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.1-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ }
+ ],
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "keywords": [
+ "diff",
+ "udiff",
+ "unidiff",
+ "unified diff"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/diff/issues",
+ "security": "https://github.com/sebastianbergmann/diff/security/policy",
+ "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T07:15:17+00:00"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "6.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "8074dbcd93529b357029f5cc5058fd3e43666984"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984",
+ "reference": "8074dbcd93529b357029f5cc5058fd3e43666984",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "suggest": {
+ "ext-posix": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "6.1-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "https://github.com/sebastianbergmann/environment",
+ "keywords": [
+ "Xdebug",
+ "environment",
+ "hhvm"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/environment/issues",
+ "security": "https://github.com/sebastianbergmann/environment/security/policy",
+ "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-23T08:47:14+00:00"
+ },
+ {
+ "name": "sebastian/exporter",
+ "version": "5.1.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "955288482d97c19a372d3f31006ab3f37da47adf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf",
+ "reference": "955288482d97c19a372d3f31006ab3f37da47adf",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "php": ">=8.1",
+ "sebastian/recursion-context": "^5.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.1-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "https://www.github.com/sebastianbergmann/exporter",
+ "keywords": [
+ "export",
+ "exporter"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/exporter/issues",
+ "security": "https://github.com/sebastianbergmann/exporter/security/policy",
+ "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T07:17:12+00:00"
+ },
+ {
+ "name": "sebastian/global-state",
+ "version": "6.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/global-state.git",
+ "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9",
+ "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1",
+ "sebastian/object-reflector": "^3.0",
+ "sebastian/recursion-context": "^5.0"
+ },
+ "require-dev": {
+ "ext-dom": "*",
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "6.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Snapshotting of global state",
+ "homepage": "https://www.github.com/sebastianbergmann/global-state",
+ "keywords": [
+ "global state"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/global-state/issues",
+ "security": "https://github.com/sebastianbergmann/global-state/security/policy",
+ "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-02T07:19:19+00:00"
+ },
+ {
+ "name": "sebastian/lines-of-code",
+ "version": "2.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/lines-of-code.git",
+ "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0",
+ "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.18 || ^5.0",
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for counting the lines of code in PHP source code",
+ "homepage": "https://github.com/sebastianbergmann/lines-of-code",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
+ "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy",
+ "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-12-21T08:38:20+00:00"
+ },
+ {
+ "name": "sebastian/object-enumerator",
+ "version": "5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-enumerator.git",
+ "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906",
+ "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1",
+ "sebastian/object-reflector": "^3.0",
+ "sebastian/recursion-context": "^5.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Traverses array structures and object graphs to enumerate all referenced objects",
+ "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
+ "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:08:32+00:00"
+ },
+ {
+ "name": "sebastian/object-reflector",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-reflector.git",
+ "reference": "24ed13d98130f0e7122df55d06c5c4942a577957"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957",
+ "reference": "24ed13d98130f0e7122df55d06c5c4942a577957",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Allows reflection of object attributes, including inherited and non-public ones",
+ "homepage": "https://github.com/sebastianbergmann/object-reflector/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
+ "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:06:18+00:00"
+ },
+ {
+ "name": "sebastian/recursion-context",
+ "version": "5.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "05909fb5bc7df4c52992396d0116aed689f93712"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712",
+ "reference": "05909fb5bc7df4c52992396d0116aed689f93712",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "https://github.com/sebastianbergmann/recursion-context",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:05:40+00:00"
+ },
+ {
+ "name": "sebastian/type",
+ "version": "4.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/type.git",
+ "reference": "462699a16464c3944eefc02ebdd77882bd3925bf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf",
+ "reference": "462699a16464c3944eefc02ebdd77882bd3925bf",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^10.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the types of the PHP type system",
+ "homepage": "https://github.com/sebastianbergmann/type",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/type/issues",
+ "source": "https://github.com/sebastianbergmann/type/tree/4.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T07:10:45+00:00"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "4.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17",
+ "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/version/issues",
+ "source": "https://github.com/sebastianbergmann/version/tree/4.0.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-07T11:34:05+00:00"
+ },
+ {
+ "name": "theseer/tokenizer",
+ "version": "1.2.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/theseer/tokenizer.git",
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
+ "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
+ "support": {
+ "issues": "https://github.com/theseer/tokenizer/issues",
+ "source": "https://github.com/theseer/tokenizer/tree/1.2.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
+ ],
+ "time": "2024-03-03T12:36:25+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "php": "8.3.*",
+ "ext-gmp": "*"
+ },
+ "platform-dev": [],
+ "plugin-api-version": "2.6.0"
+}
diff --git a/css/Roboto.ttf b/css/Roboto.ttf
deleted file mode 100644
index 153c608..0000000
Binary files a/css/Roboto.ttf and /dev/null differ
diff --git a/css/simplex.css b/css/simplex.css
deleted file mode 100644
index abb14fd..0000000
--- a/css/simplex.css
+++ /dev/null
@@ -1,217 +0,0 @@
-body {
-
-}
-
-#content {
- position: relative;
- z-index: 1;
-}
-
-#wrapper {
- width: 960px;
- height: 5px;
- margin: 0 auto;
- z-index: 2;
-}
-
-#footer {
- position: relative;
- bottom: 0px;
- left: 0px;
- margin-left: auto;
- margin-right: auto;
- color: #999999;
- font-size: 10pt;
-}
-
-#footer a {
- color: #999999;
- text-decoration: none;
-}
-
-#bg {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 1;
-}
-
-.left {
- float: left;
-}
-
-.right {
- float: right;
-}
-#defaultdiv{
- width: 100%;
- height: 100%;
- min-height: 600px;
- background-color: white;
- margin:0px auto;
- -webkit-border-radius: 10px;
- -moz-border-radius: 10px;
- border-radius: 10px;
-}
-
-#header_logo {
- height:46px;
- padding-bottom: 5px;
-}
-
-#header_leftlogo{
- margin-left: 50px;
- margin-top: 50px;
-}
-
-#rightdiv{
- margin-top: 30px;
- width: 50%;
- float: right;
- min-height: 300px;
-}
-
-
-.center{
- text-align: center;
-}
-.hidden {
- display: none;
-}
-
-div.mid {
- position: relative;
- margin-left: auto;
- margin-right: auto;
-}
-
-div.label{
- height:25px;
- margin-bottom:3px;
-}
-
-.invisible {
- opacity: 0;
-}
-
-input {
- text-align: center;
-}
-
-input.error,textarea.error {
- background-color: #FFFFD5;
- border: 2px solid red;
- color: red;
- margin: 0;
- outline-width:0;
-}
-
-label.error {
- color: red;
- display: block;
- font-style: italic;
- font-weight: normal;
-}
-
-input.fake {
- border: 1px solid black;
- border-radius: 5px;
- box-shadow: 5px 5px 5px #888;
- opacity: 0.8;
- width: 40%;
-}
-
-input[name=fileToUpload] {
- opacity: 0;
- margin-top: 20px;
-}
-
-p {
- text-align: center;
-}
-
-form[name=form] {
- text-align: center;
-}
-
-#funct,#gomorryf, #targetfunction,input.fake{
- height: 22px;
- margin-bottom: 3px;
-}
-
-table.result{
- border-width: thin;
- border-spacing: 1px;
- background-color: white;
-}
-
-table.result th{
- border-width: 1px;
- padding: 1px;
- border-style: inset;
- border-color: gray;
- background-color: white;
- -moz-border-radius: 3px;
- text-align:center;
-}
-
-table.result td{
- border-width: 1px;
- padding: 1px;
- border-style: inset;
- border-color: gray;
- background-color: white;
- text-align: center;
- width:45px;
-}
-
-table.result td:hover{
- cursor: default;
-}
-
-table.result td.mainelement {
- color:white;
- background-color:red;
- text-align:center;
- width:45px;
-}
-
-#tooltip {
- position: absolute;
- z-index: 3000;
- border: 1px solid #111;
- background-color: #eee;
- padding: 5px;
- opacity: 0.85;
-}
-
-#tooltip h3, #tooltip div {
- margin: 0;
-}
-
-tr.underlined td, tr.underlined th{
- border-top: 3px solid black;
-}
-
-#resultdiv{
- margin-left: 30px;
- margin-top: 30px;
- margin-bottom: 30px;
- width: 90%;
-}
-#placeholder1{
- margin-bottom: 30px;
-}
-#sliders{
- margin-top: 50px;
- margin-bottom: 50px;
- margin-right: 30px;
-}
-.sliderinput{
- border:0;
- color:#f6931f;
- font-weight:bold;
- width: 120px;
-}
\ No newline at end of file
diff --git a/download/Simplex.example.csv b/download/Simplex.example.csv
deleted file mode 100644
index dbfec8b..0000000
--- a/download/Simplex.example.csv
+++ /dev/null
@@ -1,4 +0,0 @@
-max;false;2;6
-2;5;<=;30
-2;3;<=;26
-0;3;<=;15
diff --git a/images/back.jpg b/images/back.jpg
deleted file mode 100644
index 0b05929..0000000
Binary files a/images/back.jpg and /dev/null differ
diff --git a/images/bc_bg.gif b/images/bc_bg.gif
deleted file mode 100644
index 9a2367a..0000000
Binary files a/images/bc_bg.gif and /dev/null differ
diff --git a/images/bc_separator.gif b/images/bc_separator.gif
deleted file mode 100644
index 904a9eb..0000000
Binary files a/images/bc_separator.gif and /dev/null differ
diff --git a/images/example.jpg b/images/example.jpg
deleted file mode 100644
index f0b645f..0000000
Binary files a/images/example.jpg and /dev/null differ
diff --git a/images/firsttable.jpg b/images/firsttable.jpg
deleted file mode 100644
index 8d927cf..0000000
Binary files a/images/firsttable.jpg and /dev/null differ
diff --git a/images/home.gif b/images/home.gif
deleted file mode 100644
index c76d002..0000000
Binary files a/images/home.gif and /dev/null differ
diff --git a/images/icon32.png b/images/icon32.png
deleted file mode 100644
index 0cecfa4..0000000
Binary files a/images/icon32.png and /dev/null differ
diff --git a/images/icon_hd.png b/images/icon_hd.png
deleted file mode 100644
index b39c2c2..0000000
Binary files a/images/icon_hd.png and /dev/null differ
diff --git a/images/icon_md.png b/images/icon_md.png
deleted file mode 100644
index af09609..0000000
Binary files a/images/icon_md.png and /dev/null differ
diff --git a/images/loader4.gif b/images/loader4.gif
deleted file mode 100644
index 47adbf0..0000000
Binary files a/images/loader4.gif and /dev/null differ
diff --git a/images/loading.gif b/images/loading.gif
deleted file mode 100644
index 0b78986..0000000
Binary files a/images/loading.gif and /dev/null differ
diff --git a/images/logo_header.png b/images/logo_header.png
deleted file mode 100644
index d6e7bd8..0000000
Binary files a/images/logo_header.png and /dev/null differ
diff --git a/images/logo_header_min.png b/images/logo_header_min.png
deleted file mode 100644
index 898f76b..0000000
Binary files a/images/logo_header_min.png and /dev/null differ
diff --git a/images/web.config b/images/web.config
deleted file mode 100644
index aa3b972..0000000
--- a/images/web.config
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/images/wypukly.jpg b/images/wypukly.jpg
deleted file mode 100644
index b371b6e..0000000
Binary files a/images/wypukly.jpg and /dev/null differ
diff --git a/index.php b/index.php
deleted file mode 100644
index b34a055..0000000
--- a/index.php
+++ /dev/null
@@ -1,118 +0,0 @@
-
-
-
-
-
-
-
-
Simplex ©
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Ekstremum funkcji celu:
-
Algorytm Gomorry'ego:
-
Wpisz funkcję celu:
-
Wpisz zagadnienie optymalizacyjne:
-
-
-
-
-
-
- Możesz też załadować plik .csv z danymi.
-
- Przykład
- poprawnego pliku z danymi:
- max;false;2;6
- 2;5;<=;30
- 2;3;<=;26
- 0;5;<=;15
-
-
-
-
-
-
- Wczytaj
-
-
-
-
-
Cofnij
-
Generuj plik csv
-
-
-
-
-
-
-
- Prosimy spróbować później.
Powodzenia na egzaminie!');
- }
- ?>
-
-
-
-
-
diff --git a/isactive.php b/isactive.php
deleted file mode 100644
index a651791..0000000
--- a/isactive.php
+++ /dev/null
@@ -1,5 +0,0 @@
-isactivated();
-?>
diff --git a/js/CanvasXpress.min.js b/js/CanvasXpress.min.js
deleted file mode 100644
index 51a2542..0000000
--- a/js/CanvasXpress.min.js
+++ /dev/null
@@ -1,44685 +0,0 @@
-/*
-* CanvasXpress 7.1 - JavaScript Canvas Library
-*
-* Copyright (c) 2009-2012 Isaac Neuhaus
-*
-* imnphd@gmail.com
-*
-*
-* Redistributions of this source code must retain this copyright
-* notice and the following disclaimer.
-*
-* CanvasXpress is licensed under the terms of the Open Source
-* LGPL 3.0 license.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see
.
-*
-* Commercial use is permitted to the extent that this source code
-* do NOT become part of any other Open Source or Commercially licensed
-* development library or toolkit without explicit permission.
-*
-* Network graphs were implemented based on the HeyGraph by Tom Martin
-*
.
-*
-* Thanks to Mingyi Liu for his contributions with the Ext-JS panel and
-* network graphs and Charles Tilford for his input to the Genome Browser.
-*
-*/
-
-function str_repeat(b,a){
- for(var c=[];a>0;c[--a]=b){}
- return(c.join(""))
- }
- function sprintf(){
- var g=0,e,h=arguments[g++],k=[],d,j,l,b;
- while(h){
- if(d=/^[^\x25]+/.exec(h)){
- k.push(d[0])
- }else{
- if(d=/^\x25{2}/.exec(h)){
- k.push("%")
- }else{
- if(d=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(h)){
- if(((e=arguments[d[1]||g++])==null)||(e==undefined)){
- throw ("Too few arguments.")
- }
- if(/[^s]/.test(d[7])&&(typeof(e)!="number")){
- throw ("Expecting number but found "+typeof(e))
- }
- switch(d[7]){
- case"b":
- e=e.toString(2);
- break;
- case"c":
- e=String.fromCharCode(e);
- break;
- case"d":
- e=parseInt(e);
- break;
- case"e":
- e=d[6]?e.toExponential(d[6]):e.toExponential();
- break;
- case"f":
- e=d[6]?parseFloat(e).toFixed(d[6]):parseFloat(e);
- break;
- case"o":
- e=e.toString(8);
- break;
- case"s":
- e=((e=String(e))&&d[6]?e.substring(0,d[6]):e);
- break;
- case"u":
- e=Math.abs(e);
- break;
- case"x":
- e=e.toString(16);
- break;
- case"X":
- e=e.toString(16).toUpperCase();
- break
- }
- e=(/[def]/.test(d[7])&&d[2]&&e>0?"+"+e:e);
- l=d[3]?d[3]=="0"?"0":d[3].charAt(1):" ";
- b=d[5]-String(e).length;
- j=d[5]?str_repeat(l,b):"";
- k.push(d[4]?e+j:j+e)
- }else{
- throw ("Huh ?!")
- }
- }
- }
- h=h.substring(d[0].length)
-}
-return k.join("")
-};
-
-var dateFormat=function(){
- var a=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,b=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,d=/[^-+\dA-Z]/g,c=function(f,e){
- f=String(f);
- e=e||2;
- while(f.length99?Math.round(n/10):n),
- t:r<12?"a":"p",
- tt:r<12?"am":"pm",
- T:r<12?"A":"P",
- TT:r<12?"AM":"PM",
- Z:q?"UTC":(String(i).match(b)||[""]).pop().replace(d,""),
- o:(f>0?"-":"+")+c(Math.floor(Math.abs(f)/60)*100+Math.abs(f)%60,4),
- S:["th","st","nd","rd"][l%10>3?0:(l%100-l%10!=10)*l%10]
- };
-
- return v.replace(a,function(m){
- return m in h?h[m]:m.slice(1,m.length-1)
- })
- }
- }();
-dateFormat.masks={
- "default":"ddd mmm dd yyyy HH:MM:ss",
- shortDate:"m/d/yy",
- mediumDate:"mmm d, yyyy",
- longDate:"mmmm d, yyyy",
- fullDate:"dddd, mmmm d, yyyy",
- shortTime:"h:MM TT",
- mediumTime:"h:MM:ss TT",
- longTime:"h:MM:ss TT Z",
- isoDate:"yyyy-mm-dd",
- isoTime:"HH:MM:ss",
- isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",
- isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
-};
-
-dateFormat.i18n={
- dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
- monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]
- };
-
-Date.prototype.format=function(a,b){
- return dateFormat(this,a,b)
- };
-
-if(typeof(CanvasXpress)=="undefined"){
- CanvasXpress={}
- }
- var CanvasXpress=function(g,e,b,c,d,f,a){
- this.$=function(h){
- return document.getElementById(h)
- };
-
- this.$cX=function(j,m,k){
- var l=document.createElement(j);
- if(m){
- for(var h in m){
- l[h]=m[h]
- }
- }
- if(k){
- for(var h in k){
- l.style[h]=k[h]
- }
- }
- return l
-};
-
-if(!g){
- g=this.createNewTarget()
- }else{
- if(typeof(g)=="object"){
- e=g.data||false;
- b=g.config||false;
- c=g.events||false;
- d=g.hidden||false;
- f=g.info||false;
- a=g.check||false;
- g=g.renderTo||this.createNewTarget()
- }
- }
-this.setInit=function(){
- this.version=7.1;
- this.target=g;
- this.events=c;
- this.info=f;
- this.userId=6151811131480;
- this.startTime=new Date().getTime()
- };
-
-this.validateParameters=function(){
- this.validateData();
- this.validateConfig();
- this.validateEvents();
- this.validateInfo()
- };
-
-this.validateData=function(){
- if(e&&!this.subBrowser){
- try{
- JSON.stringify(e)
- }catch(h){
- alert("Data object malformed:\n"+h)
- }
- }
-};
-
-this.validateConfig=function(){
- this.addConfigLocation();
- if(!b){
- b={}
- }else{
- if(!this.subBrowser){
- try{
- JSON.stringify(b)
- }catch(h){
- alert("Config object malformed:\n"+h)
- }
- }
-}
-this.userConfig=b
-};
-
-this.validateEvents=function(){};
-
-this.validateInfo=function(){
- if(!f){
- f=""
- }
- };
-
-this.addConfigLocation=function(){
- var o=window.location.href.split(/&/);
- if(o&&o.length>0){
- for(var j=0;j1){
- var n=decodeURIComponent(JSON.stringify(h[1]).replace(/^\"/,"").replace(/\"$/,""));
- var k;
- try{
- k=JSON.parse(n)
- }catch(m){
- alert("Location parameters malformed:\n"+m)
- }
- if(k){
- if(!b){
- b={}
- }
- for(var l in k){
- if(!b[l]){
- b[l]=k[l]
- }
- }
- }
- }
-}
-}
-};
-
-this.newId=function(j){
- var l=0;
- var h=this.target+j+l;
- var k=this.$(h);
- while(k){
- l++;
- h=this.target+j+l;
- k=this.$(h)
- }
- return h
- };
-
-this.createNewTarget=function(){
- var h=this.$cX("canvas",{
- id:this.newId("canvasXpress")
- });
- document.body.appendChild(h);
- return h.id
- };
-
-this.insertTarget=function(k,m,j,l,i){
- if(k&&m){
- var n=this.$(k);
- if(n){
- return
- }else{
- n=this.$cX("canvas",{
- id:k,
- width:j,
- height:l
- })
- }
- if(i){
- m.parentNode.insertBefore(n,m.nextSibling)
- }else{
- m.parentNode.insertBefore(n,m)
- }
- }
-};
-
-this.removeTarget=function(h){
- var i=this.$(h);
- if(i){
- i.parentNode.removeChild(i)
- }
- };
-
-this.save=function(){
- return{
- renderTo:this.target,
- data:this.data,
- config:this.getConfig(),
- events:this.events
- }
- };
-
-this.print=function(h){
- return function(i){
- h.resetConfigurator();
- alert("A new window will open so you can right click on the graph and save it");
- if(h.isIE){
- var k=h.canvas.parentNode.childNodes[0];
- return window.open().document.write(""+k.innerHTML+"")
- }else{
- var j=h.canvas.toDataURL("image/png");
- return window.open().document.write(' ')
- }
- }
-}(this);
-this.exportToExcel=function(k){
- var j="";
- for(var h=0;h";
- j+=k[h].join(" ");
- j+=" "
- }
- j+="";
- return window.open().document.write(j)
- };
-
-this.prettyJSON=function(h,q){
- var r=function(i){
- if(typeof(i)=="object"){
- if(i===null){
- return"null"
- }
- if(i.constructor==(new Array).constructor){
- return"array"
- }
- if(i.constructor==(new Date).constructor){
- return"date"
- }
- if(i.constructor==(new RegExp).constructor){
- return"regex"
- }
- return"object"
- }
- return typeof(i)
- };
-
- if(!q){
- q=""
- }
- var s;
- var n=" ";
- var j=r(h);
- var l=0;
- if(j=="array"){
- if(h.length==0){
- return"[]"
- }
- s="["
- }else{
- for(var p in h){
- l++;
- break
- }
- if(l==0){
- return"{}"
- }
- s="{"
- }
- l=0;
- for(var m in h){
- v=h[m];
- if(l>0){
- s+=","
- }
- if(j=="array"){
- s+=("\n"+q+n)
- }else{
- s+=("\n"+q+n+'"'+m+'": ')
- }
- switch(r(v)){
- case"array":case"object":
- s+=this.prettyJSON(v,(q+n));
- break;
- case"boolean":case"number":
- s+=v.toString();
- break;
- case"null":
- s+="null";
- break;
- case"string":
- s+=('"'+v+'"');
- break;default:
- }
- l++
- }
- if(j=="array"){
- s+=("\n"+q+"]")
- }else{
- s+=("\n"+q+"}")
- }
- return s
- };
-
-this.dumpToConsole=function(h){
- console.log(this.target);
- console.log(this.prettyJSON(h))
- };
-
-this.profile=function(j){
- var h=new Date().getTime();
- var i=this.profileTime||this.startTime;
- if(!j){
- j=""
- }
- console.log(this.target+": "+j+": "+(h-i));
- this.profileTime=h
- };
-
-this.stack=function(){
- if(this.debug){
- for(var h in this){
- if(arguments.callee.caller===this[h]){
- CanvasXpress.stack[this.target].push(h);
- return
- }
- }
- }
- };
-
-this.initialize=function(){
- this.initCSS();
- this.setInit();
- this.initCrossBrowser(a);
- this.validateParameters();
- this.initConfig(b);
- this.initViewport(d);
- this.initUtils();
- this.initPrimitives();
- this.initExample();
- this.initData(e);
- this.initLayout();
- this.initEvents();
- this.initAnimation();
- this.initRemote();
- this.initGraph();
- this.showToolbar(true)
- };
-
-this.initialize();
-CanvasXpress.references.push(this);
-CanvasXpress.stack[this.target]=[]
-};
-
-CanvasXpress.references=[];
-CanvasXpress.cacheImages={};
-
-CanvasXpress.cacheText={};
-
-CanvasXpress.stack={};
-
-CanvasXpress.current=false;
-CanvasXpress.resizing=false;
-CanvasXpress.getObject=function(b){
- for(var a=0;a4)||(this.browser=="Opera"&&this.browserVersion>9)||(this.browser=="Safari"&&this.browserVersion>4)||(this.browser=="Chrome"&&this.browserVersion>1)){
- return false
- }else{
- return true
- }
- };
-
-this.isMobileApp=function(){
- if(this.browser.match(/iPhone|iPod|iPad|Android|BlackBerry/i)){
- return true
- }else{
- return false
- }
- };
-
-this.searchString=function(e){
- for(var b=0;b>16)+e;
- h=h>255?255:h<0?0:h;
- var f=((i>>8)&255)+e;
- f=f>255?255:f<0?0:f;
- var d=(i&255)+e;
- d=d>255?255:d<0?0:d;
- j=d|(f<<8)|(h<<16);
- return this.hexToRgb(j.toString(16))
- };
-
-this.rgbToHex=function(b){
- var a=function(c){
- c=parseInt(c,10);
- if(isNaN(c)){
- return"00"
- }
- c=Math.max(0,Math.min(c,255));
- return"0123456789ABCDEF".charAt((c-c%16)/16)+"0123456789ABCDEF".charAt(c%16)
- };
-
- if(b.substr(0,1)==="#"){
- return b
- }
- if(b.match(/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/)){
- return"#"+a(RegExp.$1)+a(RegExp.$2)+a(RegExp.$3)
- }else{
- return b
- }
- };
-
-this.hexToRgb=function(c){
- var b=function(){
- return parseInt(c.substring(0,2),16)
- };
-
- var a=function(){
- return parseInt(c.substring(2,4),16)
- };
-
- var d=function(){
- return parseInt(c.substring(4,6),16)
- };
-
- c=c.charAt(0)=="#"?c.substring(1,7):c;
- return"rgb("+b()+","+a()+","+d()+")"
- };
-
-this.addColorTransparency=function(b,a){
- if(b&&b.match(/^rgba?\((\d{1,3},\d{1,3},\d{1,3})(?:,([0-9\.]+))?/i)){
- if(RegExp.$2){
- return"rgba("+RegExp.$1+","+a+")"
- }else{
- return"rgba("+RegExp.$1+","+a+")"
- }
- }else{
- return false
- }
-};
-
-this.disableGradientTransparency=function(){
- this.gradientTemp=this.gradient;
- this.transparencyTemp=this.transparency;
- this.gradient=false;
- this.transparency=null
- };
-
-this.enableGradientTransparency=function(){
- this.gradient=this.gradientTemp;
- this.transparency=this.transparencyTemp
- };
-
-this.getGradientColor=function(h){
- if(h.match(/^rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(?:,([0-9\.]+))?/i)){
- var f=Math.floor(parseInt(RegExp.$1)/this.gradientRatio);
- var e=Math.floor(parseInt(RegExp.$2)/this.gradientRatio);
- var a=Math.floor(parseInt(RegExp.$3)/this.gradientRatio);
- var d=RegExp.$4?parseFloat(RegExp.$4):false;
- if(d){
- return"rgba("+f+","+e+","+a+","+d+")"
- }else{
- return"rgb("+f+","+e+","+a+")"
- }
- }else{
- return false
- }
-};
-
-this.setGradient=function(e,d,c,b,a){
- if(this.gradientType=="radial"){
- this.setRadialGradient(e,d,c,b,false,false,true)
- }else{
- this.setLinearGradient(e,d,c,b,a,false,true)
- }
- };
-
-this.setLinearGradient=function(c,i,a,f,e,b,d){
- if(!d){
- this.ctx.save()
- }
- var h=this.ctx.createLinearGradient(c,i,a,f);
- if(!b){
- b=this.getGradientColor(e);
- h.addColorStop(0,b);
- h.addColorStop(0.6,e);
- h.addColorStop(1,e)
- }else{
- h.addColorStop(0,e);
- h.addColorStop(1,b)
- }
- this.ctx.fillStyle=h
- };
-
-this.setRadialGradient=function(j,h,a,e,d,c,i){
- if(!i){
- this.ctx.save()
- }
- var b=a/5.5;
- var f=this.ctx.createRadialGradient(j-b,h-b,1,j,h,a);
- if(!d){
- if(this.transparency!=null){
- d="rgba(0,0,0,"+this.transparency+")"
- }else{
- d="rgb(0,0,0)"
- }
- }
- if(!c){
- c="rgba(0,0,0,0)"
- }
- f.addColorStop(0,e);
-f.addColorStop(1,d);
-f.addColorStop(1,c);
-this.ctx.fillStyle=f
-}
-};
-
-CanvasXpress.prototype.initText=function(){
- this.drawTextMultiple=function(v,u,p,n,o,r,q,d,e,w){
- var h=v.split(/\n/);
- if(!n){
- n=this.font
- }
- var k=this.getFontPt(n)+4;
- if(h.length%2){
- p-=(parseInt(h.length/2)*k)+(k/2)
- }else{
- p=(p-parseInt(h.length/2)*k)
- }
- for(var j=0;j1){
- b.push(f.shift()+l);
- b.push(f.shift()+k)
- }
- return b
- };
-
- var E=[];
- if(o==null){
- return
- }
- if(this.isMultipleLines(o)){
- return this.drawTextMultiple(o,l,k,z,B,D,C,g,q,p)
- }
- if(!this.ctx){
- if(this.debug){
- alert("Dude, there is no canvas")
- }
- return
- }
- if(isNaN(l)||isNaN(k)){
- if(this.debug){
- alert("Not a valid coordinate ("+l+", "+k+") to draw "+o)
- }
- return
- }
- if(g<(Math.PI/-2)||g>(Math.PI/2)){
- if(this.debug){
- alert("Dude, you can only rotate between -PI/2 and PI/2")
- }
- return
- }
- if(!i&&!isNaN(o)){
- o=this.formatNumber(o)
- }
- if(!l){
- l=0
- }
- if(!k){
- k=0
- }
- if(!z){
- z=this.font
- }
- if(!B){
- B=this.foreground
- }
- if(!D){
- D=this.align
- }
- if(!C){
- C=this.baseline
- }
- var n=this.measureText(o,z);
- var u=this.getFontPt(z);
- if(q){
- while(n>q&&j<10){
- o=o.substring(0,o.length-1);
- n=this.measureText(o,z);
- j++
- }
- }
- var A,e,v,d;
-if(D=="left"){
- A=l;
- v=A+n
- }else{
- if(D=="right"){
- A=l-n;
- v=l
- }else{
- A=l-(n/2);
- v=l+(n/2)
- }
- }
-if(C=="top"){
- e=k;
- d=e+u
- }else{
- if(C=="bottom"){
- e=k-u;
- d=k
- }else{
- e=k-(u/2);
- d=k+(u/2)
- }
- }
-E=["rect",A,e,v,d];
-if(g){
- E=r(E)
- }
- this.ctx.save();
-this.ctx.strokeStyle=B;
-this.ctx.fillStyle=B;
-this.ctx.font=z;
-this.ctx.save();
-this.ctx.translate(l,k);
-this.ctx.textAlign=D;
-this.ctx.textBaseline=C;
-if(this.showShadow){
- this.ctx.shadowOffsetX=this.shadowOffsetX;
- this.ctx.shadowOffsetY=this.shadowOffsetY;
- this.ctx.shadowBlur=this.shadowBlur;
- this.ctx.shadowColor=this.shadowColor
- }
- if(g){
- this.ctx.rotate(g)
- }
- if(p){
- this.ctx.strokeText(o,0,0)
- }else{
- this.ctx.fillText(o,0,0)
- }
- this.ctx.restore();
-if(this.showShadow){
- this.ctx.shadowOffsetX=0;
- this.ctx.shadowOffsetY=0;
- this.ctx.shadowBlur=0;
- this.ctx.shadowColor=this.background
- }
- return E
-};
-
-this.isMultipleLines=function(b){
- var a=b.toString().split(/\n/);
- return a.length-1
- };
-
-this.capitalize=function(a){
- if(a){
- return a.charAt(0).toUpperCase()+a.slice(1)
- }
- };
-
-this.measureTextMultiple=function(d,e){
- var b=d.split(/\n/);
- var a=0;
- if(!this.ctx){
- return 0
- }
- if(!e){
- e=this.font
- }
- this.ctx.font=e;
- for(var c=0;ca&&d>=this.minTextSize){
- d-=2;
- c=d+"pt "+this.fontName
- }
- }
- return c
-};
-
-this.getFontPt=function(a){
- return Math.max(1,parseInt(a.match(/^[\-\d]+/)[0]))
- };
-
-this.scaleTextToSize=function(a){
- var d=this.scaleTextConstantMult;
- if(!a){
- a=1
- }
- return Math.ceil(1/Math.sqrt(a)*d)
- };
-
-this.formatNumber=function(g,c){
- if(!c){
- c=2
- }
- if(g.toString().length>=7){
- var b=sprintf("%."+c+"e",Number(g));
- var a=sprintf("%."+c+"f",Number(g));
- if(a.toString().length>b.toString().length){
- return b.toString()
- }else{
- return a.toString()
- }
- }else{
- return g.toString()
- }
-};
-
-this.bestFormatNumber=function(b,a){
- if(a<1){
- return sprintf("%.0f",Number(b))
- }else{
- if(Math.abs(b)<0.001){
- return sprintf("%.2e",Number(b))
- }else{
- return sprintf("%.3f",Number(b))
- }
- }
-};
-
-this.getMaxText=function(d){
- var f="";
- var b=0;
- for(var e=0;eb){
- f=d[e].toString();
- b=g
- }
- }
- return f
-};
-
-this.shortenText=function(c,b,a){
- if(!c){
- return""
- }
- c=c.toString();
- if(a){
- return c.substring(0,Math.max(parseInt(a*1/b)-2,1))+".."
- }else{
- if(c.length<=b){
- return c
- }else{
- return c.substring(0,b-3)+"..."
- }
- }
-};
-
-this.convertToNumber=function(a){
- if(!isNaN(a)){
- return parseFloat(a)
- }else{
- return a
- }
- }
-};
-
-CanvasXpress.prototype.initTime=function(){
- Date.prototype.getWeek=function(){
- var a=new Date(this.getFullYear(),0,1);
- return Math.ceil((((this-a)/86400000)+a.getDay()+1)/7)
- };
-
- Date.prototype.getDayYear=function(){
- var a=new Date(this.getFullYear(),0,1);
- return Math.ceil((this-a)/86400000)
- };
-
- this.getMillisecond=function(a){
- return a.getMilliseeconds()
- };
-
- this.getSecond=function(a){
- return a.getSeconds()
- };
-
- this.getMinuteSecond=function(a){
- return a.getMinutes()+":"+a.getSeconds()
- };
-
- this.getMinute=function(a){
- return a.getMinutes()
- };
-
- this.getHourMinute=function(a){
- return a.getHours()+":"+a.getMinutes()
- };
-
- this.getHour=function(a){
- return a.getHours()
- };
-
- this.getYearWeek=function(a){
- return a.getFullYear()+"-"+a.getWeek()
- };
-
- this.getYearMonth=function(a){
- return a.getFullYear()+"-"+a.getMonth()
- };
-
- this.getYear=function(a){
- return a.getFullYear()
- };
-
- this.times={
- second:1000,
- minute:60000,
- hour:3600000,
- day:86400000,
- week:604800000,
- month:2592000000,
- year:31556952000
- };
-
- this.parseDate=function(j){
- var f=0;
- var c=0;
- var e=0;
- var k=parseInt(j.toString().substring(0,4));
- var a=parseInt(j.toString().substring(4,6).replace(/^0/,""));
- var g=parseInt(j.toString().substring(6,8).replace(/^0/,""));
- var b=j.toString().match(/\:/)?j.toString().substring(10).split(":"):false;
- if(b){
- f=b[0]?parseInt(b[0].replace(/^0/,"")):0;
- c=b[1]?parseInt(b[1].replace(/^0/,"")):0;
- e=b[2]?parseInt(b[2].replace(/^0/,"")):0
- }
- return new Date(k,a-1,g,f,c,e)
- };
-
- this.setTimeAxis=function(){
- var h=this.validateTimeAxis();
- if(h){
- var g=Date.parse(h[h.length-1])-Date.parse(h[0]);
- var d;
- var b={};
-
- var c=[];
- this.timeValues=[];
- this.timeValueIndices=[];
- if(g>this.times.year*2){
- d="getYear"
- }else{
- if(g>this.times.month*2){
- d="getYearMonth"
- }else{
- if(g>this.times.week*2){
- d="getYearWeek"
- }else{
- if(g=0;a--){
- var e=this[d](h[a]);
- if(!b.hasOwnProperty(e)){
- c.unshift(h[a]);
- this.timeValueIndices.unshift(a);
- b[e]=true
- }
- }
- }
-}else{
- for(var a=0;aa+this.outlineWidth||k>j+this.outlineWidth||ca){
- c=a
- }
- if(kj){
- n=j
- }
- p=[d,n,c-d,k-n]
- }else{
- if(q=="poly"){}else{
- if(q=="circle"){
- d=parseInt(f[0]);
- n=parseInt(f[1]);
- if(d>a||dj){
- return false
- }
- p=[d,n]
- }else{
- if(q=="line"){
- d=parseFloat(f[0]);
- n=parseFloat(f[1]);
- c=parseFloat(f[2]);
- k=parseFloat(f[3]);
- if(d==c){
- if(da){
- return false
- }else{
- if(n>k){
- if(nj){
- n=j
- }
- }
- if(k>j){
- return false
- }else{
- if(kj){
- return false
- }else{
- if(nj){
- k=j
- }
- }
- }
- }
-}else{
- if(n==k){
- if(nj){
- return false
- }else{
- if(d>c){
- if(da){
- d=a
- }
- }
- if(c>a){
- return false
- }else{
- if(ca){
- return false
- }else{
- if(da){
- c=a
- }
- }
-}
-}
-}else{
- if(d>c){
- if(da){
- return false
- }else{
- if(n>k){
- if(nj){
- return false
- }else{
- g=n-k;
- m=d-c;
- if(d>a){
- n-=(d-a)*g/m;
- d=a
- }
- if(n>j){
- d-=(n-j)*m/g;
- n=j
- }
- if(cj){
- return false
- }else{
- g=k-n;
- m=d-c;
- if(d>a){
- n+=(d-a)*g/m;
- d=a
- }
- if(nj){
- c+=(k-j)*m/g;
- k=j
- }
- }
- }
-}
-}else{
- if(ca){
- return false
- }else{
- if(n>k){
- if(nj){
- return false
- }else{
- g=n-k;
- m=c-d;
- if(dj){
- d+=(n-j)*m/g;
- n=j
- }
- if(c>a){
- k+=(c-a)*g/m;
- c=a
- }
- if(kj){
- return false
- }else{
- g=k-n;
- m=c-d;
- if(da){
- k-=(c-a)*g/m;
- c=a
- }
- if(k>j){
- c-=(k-j)*m/g;
- k=j
- }
- }
-}
-}
-}
-}
-}
-p=[d,n,c,k]
-}else{
- return false
- }
-}
-}
-}
-return p
-};
-
-this.lineLength=function(b,d,a,c){
- return Math.sqrt(Math.pow(a-b,2)+Math.pow(c-d,2))
- };
-
-this.shortenLine=function(b,j,a,i,k,f,l){
- if(this.validateNumbers([b,j,a,i,k,f])){
- if(l.match(/bezier/)){
- if(l.match(/beziery/i)){
- return i>j?[b,j+k,a,i-f]:[b,j-k,a,i+f]
- }else{
- return a>b?[b+k,j,a-f,i]:[b-k,j,a+f,i]
- }
- }else{
- if(l.match(/curved/)){
- return[b,j,a,i]
- }else{
- var c=Math.atan2(i-j,a-b);
- var d=Math.cos(c);
- var h=Math.sin(c);
- var g=this.lineLength(b,j,a,i);
- if(g){
- while(g<(k+f)){
- k/=1.1;
- f/=1.1
- }
- b+=d*k;
- j+=h*k;
- a-=d*f;
- i-=h*f
- }
- }
- }
-return[b,j,a,i]
-}
-};
-
-this.errorBar=function(e,g,d,f,a,h){
- if(!this.isGroupedData&&this.isRawData){}
- if(this.showErrorBars&&this.validateNumbers([a])){
- var b=this.drawLine("line",e,g,d,f,h,false,false,false,false,true);
- if(a>0){
- this.drawLine("line",d,f-a/2,d,f+a/2,h,false,false,false,false,true)
- }else{
- this.drawLine("line",d-a/2,f,d+a/2,f,h,false,false,false,false,true)
- }
- return b
- }
- };
-
-this.splineControlPoint=function(e,m,d,l,c,k){
- var n=Math.sqrt(Math.pow(d-e,2)+Math.pow(l-m,2));
- var h=Math.sqrt(Math.pow(c-d,2)+Math.pow(k-l,2));
- var g=this.tension*n/(n+h);
- var f=this.tension-g;
- var b=d+g*(e-c);
- var a=l+g*(m-k);
- var j=d-f*(e-c);
- var i=l-f*(m-k);
- return[b,a,j,i]
- };
-
-this.drawLine=function(Z,G,a,D,ar,al,Y,ad,ab,an,ao,aq){
- var S=this;
- var ag;
- var N=[];
- var U=false;
- var z=false;
- var v=false;
- var T=function(){
- S.ctx.save();
- if(S.transparency!=null){
- if(al){
- al=S.validateColor(al,S.transparency)||S.addColorTransparency(S.foreground,S.transparency)
- }else{
- al=S.addColorTransparency(S.foreground,S.transparency)
- }
- }else{
- if(al){
- al=S.validateColor(al)||S.foreground
- }else{
- al=S.foreground
- }
- }
- S.ctx.fillStyle=al;
-S.ctx.strokeStyle=al;
-S.ctx.lineWidth=Y?Y:S.outlineWidth;
-S.ctx.lineCap=ad?ad:S.capType;
-if(S.showShadow){
- S.ctx.shadowOffsetX=S.shadowOffsetX;
- S.ctx.shadowOffsetY=S.shadowOffsetY;
- S.ctx.shadowBlur=S.shadowBlur;
- S.ctx.shadowColor=S.shadowColor
- }
-};
-
-var I=function(){
- if(S.showShadow){
- S.ctx.shadowOffsetX=0;
- S.ctx.shadowOffsetY=0;
- S.ctx.shadowBlur=0;
- S.ctx.shadowColor=S.background
- }
- S.ctx.restore()
- };
-
-var h=function(){
- var b;
- b=G;
- G=D;
- D=b;
- b=a;
- a=ar;
- ar=b
- };
-
-var H=function(n){
- var ax=function(aC,aF,aA,aG){
- var aB=[];
- for(var aD=0;aDMath.abs(w)){
- w=0
- }else{
- w=D>G?S.arrowPointSize:-S.arrowPointSize
- }
- }else{
- if(Math.abs(w)>Math.abs(p)){
- p=0
- }else{
- p=ar>a?S.arrowPointSize:-S.arrowPointSize
- }
- }
-}else{
- if(v){
- var s=S.lineLength(G,a,D,ar);
- var az=S.shortenLine(G,a,D,ar,0,s/2,"line");
- var t=az[2];
- var ay=az[3];
- var au=s/2;
- var e=v/au;
- var av=D>G?Math.asin((ay-a)/au):Math.asin(-(ay-a)/au);
- var b=av-(Math.PI/20);
- if(D>G){
- G=t+au*Math.cos(b-e);
- a=ay+au*Math.sin(b-e);
- D=t+au*Math.cos(av-e);
- ar=ay+au*Math.sin(av-e)
- }else{
- G=t+au*Math.cos((b-e)+Math.PI);
- a=ay+au*Math.sin((b-e)+Math.PI);
- D=t+au*Math.cos((av-e)+Math.PI);
- ar=ay+au*Math.sin((av-e)+Math.PI)
- }
- w=D-G;
- p=ar-a
- }
- }
-var f=ax(y,Math.atan2(p,w),D,ar);
-T();
-S.ctx.beginPath();
-S.ctx.moveTo(f[0][0],f[0][1]);
-for(var aw=1;awa){
- if(a+ab>ar-an){
- Z=Z.replace(/beziery/i,"");
- ag="line";
- z=false;
- U=false
- }
- }else{
- if(a-abG){
- if(G+ab>D-an){
- Z=Z.replace(/bezier[x]?/i,"");
- ag="line";
- z=false;
- U=false
- }
- }else{
- if(G-abG?true:false;
- var o=(G+D)/2;
- var m=(a+ar)/2;
- if(P){
- if(U=="X"){
- N=["poly",G,a-2,o+2,a-2,o+2,ar-2,D,ar-2,D,ar+2,o-2,ar+2,o-2,a+2,G,a+2]
- }else{
- N=["poly",G-2,a,G-2,m+2,D-2,m+2,D-2,ar,D+2,ar,D+2,m-2,G+2,m-2,G+2,a]
- }
- }else{
- if(U=="X"){
- N=["poly",G,a-2,o-2,a-2,o-2,ar-2,D,ar-2,D,ar+2,o+2,ar+2,o+2,a+2,G,a+2]
- }else{
- N=["poly",G-2,a,G-2,m-2,D-2,m-2,D-2,ar,D+2,ar,D+2,m+2,G+2,m+2,G+2,a]
- }
- }
- T();
-this.ctx.moveTo(G,a);
-if(U=="Y"){
- this.ctx.bezierCurveTo(G,ar,D,a,D,ar)
- }else{
- this.ctx.bezierCurveTo(D,a,G,ar,D,ar)
- }
- this.ctx.stroke();
-I();
-break;
-case"curvedLine":
- var o=12;
- var u=1;
- var M=this.lineLength(G,a,D,ar);
- var F=this.shortenLine(G,a,D,ar,0,M/2,"line");
- var Q=F[2];
- var E=F[3];
- var X=M/2;
- var O=ab/X;
- var K=an/X;
- var k=(Q-G);
- var j=(E-a);
- var C=U&&G>D?false:!U&&D>=G?true:U;
- var r=D>=G?Math.asin(j/X):Math.asin(-j/X);
- var ah=r+Math.PI;
- var B=Math.PI/o;
- var A=D>=G?0:Math.PI;
- N=["poly"];
- for(var aj=u;aj<=o-u;aj++){
- N.push(Q-(X+2)*Math.cos(r+((B*aj))-A));
- N.push(E-(X+2)*Math.sin(r+((B*aj))-A))
- }
- for(var aj=o-u;aj>=u;aj--){
- N.push(Q-(X-2)*Math.cos(r+((B*aj))-A));
- N.push(E-(X-2)*Math.sin(r+((B*aj))-A))
- }
- T();
- this.ctx.beginPath();
- if(D>=G){
- this.ctx.arc(Q,E,X,r-K,ah+O,C)
- }else{
- this.ctx.arc(Q,E,X,r+O,ah-K,C)
- }
- this.ctx.stroke();
- I();
- break;
-case"line":
- N=["poly",G+2,a,D+2,ar,D-2,ar,G-2,a];
- T();
- this.ctx.beginPath();
- this.lineTo(G,a,D,ar);
- I();
- break
- }
- if(Z.match(/arrowheadsquaretail|squaretailarrowhead/i)){
- v=v?an:false;
- H(false,z,v);
- if(!Z.match(/curve/)){
- h()
- }
- v=v?ab:false;
- H(true,z,v)
- }else{
- if(Z.match(/arrowtailsquarehead|squareheadarrowtail/i)){
- v=v?an:false;
- H(true,z,v);
- if(!Z.match(/curve/)){
- h()
- }
- v=v?ab:false;
- H(false,z,v)
- }else{
- if(Z.match(/arrowhead/i)){
- v=v?an:false;
- H(false,z,v)
- }else{
- if(Z.match(/squarehead/i)){
- v=v?an:false;
- H(true,z,v)
- }else{
- if(Z.match(/arrowtail/i)){
- if(!Z.match(/curve/)){
- h()
- }
- v=v?ab:false;
- H(false,z,v)
- }else{
- if(Z.match(/squaretail/i)){
- if(!Z.match(/curve/)){
- h()
- }
- v=v?ab:false;
- H(true,z,v)
- }else{
- if(Z.match(/arrow/i)){
- v=v?an:false;
- H(false,z,v);
- if(!Z.match(/curve/)){
- h()
- }
- v=v?ab:false;
- H(false,z,v)
- }else{
- if(Z.match(/square/i)){
- v=v?ab:false;
- H(true,z,v);
- if(!Z.match(/curve/)){
- h()
- }
- v=v?an:false;
- H(true,z,v)
- }
- }
- }
- }
- }
-}
-}
-}
-return N
-}else{
- return false
- }
-}
-};
-
-this.polygon=function(l,k,g,e,d,a,i,h,j){
- return this.drawShape("polygon",l,k,false,false,g,e,d,a,i,h,j)
- };
-
-this.circle=function(n,m,q,g,i,e,d,a,k,j,l){
- return this.drawShape("circle",n,m,q,g,i,e,d,a,k,j,l)
- };
-
-this.rectangle=function(n,m,q,g,i,e,d,a,k,j,l){
- return this.drawShape("rectangle",n+(q/2),m+(g/2),q,g,i,e,d,a,k,j,l)
- };
-
-this.rectangleHM=function(n,m,q,g,i,e,d,a,k,j,l){
- return this.drawShape("rectangleHM",n+(q/2),m+(g/2),q,g,i,e,d,a,k,j,l)
- };
-
-this.drawShape=function(P,L,K,N,ac,ad,W,V,R,J,aj,al,Q,ag,O,ai){
- var I=this;
- var T=function(){
- I.ctx.save();
- I.ctx.translate(L,K);
- if(R){
- I.ctx.rotate(R)
- }
- if(I.transparency!=null){
- if(ad){
- ad=I.validateColor(ad,I.transparency)||I.addColorTransparency(I.foreground,I.transparency)
- }else{
- ad=I.addColorTransparency(I.foreground,I.transparency)
- }
- }else{
- if(ad){
- ad=I.validateColor(ad)||I.foreground
- }else{
- ad=I.foreground
- }
- }
- if(I.gradient){
- if(I.gradientType=="radial"){
- I.setGradient(0,0,Math.max(Math.abs(N),Math.abs(ac)),ad)
- }else{
- I.setGradient(0,0,N,ac,ad)
- }
- }else{
- I.ctx.fillStyle=ad
- }
- if(W){
- W=I.validateColor(W)||I.foreground
- }
- I.ctx.strokeStyle=W?W:I.foreground;
-I.ctx.lineWidth=J?J:I.outlineWidth;
-if(I.showShadow){
- I.ctx.shadowOffsetX=I.shadowOffsetX;
- I.ctx.shadowOffsetY=I.shadowOffsetY;
- I.ctx.shadowBlur=I.shadowBlur;
- I.ctx.shadowColor=I.shadowColor
- }
-};
-
-var ap=function(f,d,o){
- if(P=="image"){}else{
- if(P=="rectangleHM"){
- if(f){
- f[0][0]=Math.round(f[0][0])+0.5;
- f[3][0]=f[0][0];
- f[1][0]=Math.round(f[1][0])+1.5;
- f[2][0]=f[1][0];
- f[0][1]=Math.round(f[0][1])+0.5;
- f[1][1]=f[0][1];
- f[2][1]=Math.round(f[2][1])+1.5;
- f[3][1]=f[2][1];
- I.ctx.beginPath();
- I.ctx.moveTo(f[0][0],f[0][1]);
- for(var e=1;e1){
- var h=p.shift()-L;
- var b=p.shift()-K;
- i.push((b*Math.sin(R))-(h*Math.cos(R)));
- i.push((b*Math.cos(R))+(h*Math.sin(R)))
- }
- }
- var c=["poly"];
- while(i.length>1){
- c.push(i.shift()+L);
- c.push(i.shift()+K)
- }
- return c
- }
-};
-
-var G,H;
-if(P=="polygon"||P=="path"||P=="spline"){
- var Z=Number.MAX_VALUE;
- var E=Number.MAX_VALUE*-1;
- var Y=Number.MAX_VALUE;
- var D=Number.MAX_VALUE*-1;
- var F=P=="polygon"?false:true;
- var U=[];
- var ak=[];
- G=[];
- H=["poly"];
- if(L.length==K.length){
- if(P=="spline"&&L.length<5){
- return false
- }
- for(var ab=0;abac?ac/4:N/4;
- G=false;
- T();
- this.ctx.beginPath();
- ctx.moveTo(-j,-am+M);
- ctx.lineTo(-j,am-M);
- ctx.quadraticCurveTo(-j,am,-j+M,am);
- ctx.lineTo(j-M,am);
- ctx.quadraticCurveTo(j,am,j,am-M);
- ctx.lineTo(j,-am+M);
- ctx.quadraticCurveTo(j,-am,j-M,-am);
- ctx.lineTo(-j+M,-am);
- ctx.quadraticCurveTo(-j,-am,-j,-am+M);
- this.ctx.closePath();
- ap();
- break;
- case"square":
- G=[[-j,-j],[j,-j],[j,j],[-j,j]];
- break;
- case"triangle":
- if(N==ac){
- return this.drawShape("equilateral",L,K,N,ac,ad,W,V,R,J,aj,al,Q,ag,O,ai)
- }
- H=["poly",L,K-am,L+j,K+am,L-j,K+am];
- G=[[0,-am],[j,am],[-j,am]];
- break;
- case"triangle2":
- if(N==ac){
- return this.drawShape("equilateral2",L,K,N,ac,ad,W,V,R,J,aj,al,Q,ag,O,ai)
- }
- H=["poly",L,K+am,L+j,K-am,L-j,K-am];
- G=[[0,am],[j,-am],[-j,-am]];
- break;
- case"equilateral":
- var M=N*Math.sqrt(3)/6;
- var g=M/2;
- var v=Math.sqrt((M*M)-(g*g));
- H=["poly",L,K-M,L+v,K+g,L-v,K+g];
- G=[[0,-am],[j,am],[-j,am]];
- break;
- case"equilateral2":
- var M=N*Math.sqrt(3)/6;
- var g=M/2;
- var v=Math.sqrt((M*M)-(g*g));
- H=["poly",L,K+M,L+v,K-g,L-v,K-g];
- G=[[0,am],[j,-am],[-j,-am]];
- break;
- case"diamond":case"rhombus":
- H=["poly",L,K-am,L+j,K,L,K+am,L-j,K];
- G=[[0,-am],[j,0],[0,am],[-j,0]];
- break;
- case"hexagon":
- var ah=N/3;
- var l=ah-j;
- G=[[l,-am],[-l,-am],[j,0],[-l,am],[l,am],[-j,0]];
- break;
- case"octagon":
- var an=N/4;
- var aa=ac/4;
- G=[[-an,-am],[an,-am],[j,-aa],[j,aa],[an,am],[-an,am],[-j,aa],[-j,-aa]];
- break;
- case"oval":
- G=false;
- T();
- this.ctx.scale(1,S);
- this.ctx.beginPath();
- this.ctx.arc(0,0,N/2,0,Math.PI*2,true);
- this.ctx.closePath();
- ap();
- break;
- case"oval2":
- return this.drawShape("oval",L,K,N,N/2,ad,W,V,R,J,aj,al,Q,ag,O,ai);
- break;
- case"oval3":
- return this.drawShape("oval",L,K,N,N/3,ad,W,V,R,J,aj,al,Q,ag,O,ai);
- break;
- case"arc":
- G=false;
- T();
- this.ctx.scale(1,S);
- this.ctx.beginPath();
- this.ctx.arc(0,0,N/2,0,Math.PI,true);
- if(V!="open"){
- this.ctx.closePath()
- }
- ap();
- break;
- case"arc2":
- G=false;
- var B=ac*Math.cos(Q);
- var aq=ac*Math.sin(Q);
- var A=ac*Math.cos(ag);
- var ao=ac*Math.sin(ag);
- var q=this.shortenLine(0,0,B,aq,0,N,"line");
- var m=this.shortenLine(0,0,A,ao,0,N,"line");
- T();
- this.ctx.beginPath();
- this.ctx.moveTo(q[2],q[3]);
- this.ctx.lineTo(B,aq);
- this.ctx.arc(0,0,ac,Q,ag,false);
- this.ctx.lineTo(m[2],m[3]);
- this.ctx.arc(0,0,ac-N,ag,Q,true);
- this.ctx.closePath();
- ap();
- break;
- case"arc3":
- G=false;
- T();
- this.ctx.beginPath();
- this.ctx.arc(0,0,N/2,Q,ag,false);
- ap();
- break;
- case"ellipse":
- var a=j*0.5522848;
- var af=am*0.5522848;
- G=false;
- T();
- this.ctx.beginPath();
- this.ctx.moveTo(0,am);
- this.ctx.bezierCurveTo(0,am-af,j-a,0,j,0);
- this.ctx.bezierCurveTo(j+a,0,N,am-af,N,am);
- this.ctx.bezierCurveTo(N,am+af,j+a,ac,j,ac);
- this.ctx.bezierCurveTo(j-a,ac,0,am+af,0,am);
- this.ctx.closePath();
- ap();
- break;
- case"ellipse2":
- return this.drawShape("ellipse",L,K,N,N/2,ad,W,V,R,J,aj,al,Q,ag,O,ai);
- break;
- case"ellipse3":
- return this.drawShape("ellipse",L,K,N,N/3,ad,W,V,R,J,aj,al,Q,ag,O,ai);
- break;
- case"plus":
- G=[[-X,-am],[X,-am],[X,-X],[j,-X],[j,X],[X,X],[X,am],[-X,am],[-X,X],[-j,X],[-j,-X],[-X,-X],[-X,-am]];
- break;
- case"minus":
- G=[[-j,-X],[j,-X],[j,X],[-j,X],[-j,-X]];
- break;
- case"mdavid":
- var ah=N/3;
- var n=Math.PI/6;
- H=["circle",L,K,N/2];
- G=false;
- T();
- this.ctx.beginPath();
- this.ctx.moveTo(ah,0);
- for(var ab=0;ab<11;ab++){
- this.ctx.rotate(n);
- if(ab%2==0){
- this.ctx.lineTo((ah/0.55),0)
- }else{
- this.ctx.lineTo(ah,0)
- }
- this.ctx.closePath()
- }
- ap();
- break;
- case"star":
- var k=(N/4);
- var C=Math.PI/5;
- H=["circle",L,K,N/2];
- G=false;
- T();
- this.ctx.save();
- this.ctx.scale(0.7,0.7);
- this.ctx.rotate(C*0.45);
- this.ctx.beginPath();
- this.ctx.moveTo(k,0);
- for(var ab=0;ab<9;ab++){
- this.ctx.rotate(C);
- if(ab%2==0){
- this.ctx.lineTo((k/0.35),0)
- }else{
- this.ctx.lineTo(k,0)
- }
- }
- this.ctx.closePath();
- this.ctx.restore();
- ap();
- break;
-case"pie":
- if(typeof(Q)=="undefined"){
- Q=0
- }
- if(typeof(ag)=="undefined"){
- ag=Math.PI*2
- }
- G=false;
-T();
- this.ctx.scale(1,S);
- this.ctx.beginPath();
- this.ctx.arc(0,0,N/2,Q,ag,false);
- this.ctx.closePath();
- ap();
- break;
-case"pie0":
- return this.drawShape("pie",L,K,N,N/2,ad,W,V,R,J,aj,al,0,Math.PI/5,O,ai);
- break;
-case"pie1":
- return this.drawShape("pie",L,K,N,N/2,ad,W,V,R,J,aj,al,0,Math.PI/3.5,O,ai);
- break;
-case"pie2":
- return this.drawShape("pie",L,K,N,N/2,ad,W,V,R,J,aj,al,0,Math.PI/2,O,ai);
- break;
-case"pie3":
- return this.drawShape("pie",L,K,N,N/2,ad,W,V,R,J,aj,al,0,Math.PI/1.5,O,ai);
- break;
-case"pie4":
- return this.drawShape("pie",L,K,N,N/2,ad,W,V,R,J,aj,al,0,Math.PI,O,ai);
- break;
-case"pie5":
- return this.drawShape("pie",L,K,N,N/2,ad,W,V,R,J,aj,al,0,Math.PI*1.2,O,ai);
- break;
-case"pie6":
- return this.drawShape("pie",L,K,N,N/2,ad,W,V,R,J,aj,al,0,Math.PI*1.4,O,ai);
- break;
-case"pie7":
- return this.drawShape("pie",L,K,N,N/2,ad,W,V,R,J,aj,al,0,Math.PI*1.6,O,ai);
- break;
-case"pie8":
- return this.drawShape("pie",L,K,N,N/2,ad,W,V,R,J,aj,al,0,Math.PI*1.8,O,ai);
- break;
-case"pie9":
- return this.drawShape("pie",L,K,N,N/2,ad,W,V,R,J,aj,al,0,Math.PI*2,O,ai);
- break;
-case"pacman":
- return this.drawShape("pie",L,K,N,N/2,ad,W,V,R,J,aj,al,Math.PI*5/4,Math.PI*3/4,O,ai);
- break
- }
- if(R){
- H=ae(H)
- }
- if(G){
- T();
- ap(G)
- }
- return H
-}else{
- return false
- }
-}
-};
-
-this.drawImage=function(b,a,m,k,c,n){
- if(this.isIE&&this.useFlashIE&&this.browserVersion<9&&b==1){
- var g=this;
- var d=function(){
- g.drawImage(CanvasXpress.cacheImages[n],a,m,k,c)
- };
-
- CanvasXpress.cacheImages[n].onload=d;
- CanvasXpress.cacheImages[n].src=n
- }else{
- try{
- this.ctx.drawImage(b,a,m,k,c)
- }catch(j){}
- }
-};
-
-this.setRGB=function(){
- this.reds=[];
- this.greens=[];
- this.blues=[];
- this.yellows=[];
- this.cyans=[];
- this.purples=[];
- this.greys=[];
- this.indicatorBins=this.allVsAll?Math.min(this.x,this.y)/(this.layoutRows*2):Math.min(this.x,this.y)/4;
- this.indicatorBins=this.indicatorBins>512?1:this.indicatorBins>256?2:this.indicatorBins>128?4:8;
- var e=this.indicatorBins;
- var c=parseInt(256/e);
- var d;
- var b=255;
- for(var a=0;a0&&!this.isGroupedData){
- if(!this.smpOverlayColors){
- this.smpOverlayColors={}
- }
- for(var g=0;g0&&this.graphType=="Heatmap"){
- if(!this.varOverlayColors){
- this.varOverlayColors={}
- }
- for(var g=0;gv){
- this[e].data.push([m,g,f,k])
- }else{
- this[e].data.push([m,v,f,k])
- }
- g=v;
- a=Math.max(a,g);
- l+=f;
- m++
- }
- this[e].unit=u>0?(a*this.dendrogramSpace)/u:0;
-this[e].depth=a;
-if(l>0){
- alert("Dude! Malformed newick tree. There are "+l+" additional right parenthesis!")
- }else{
- if(l<0){
- alert("Dude! Malformed newick tree. There are "+Math.abs(l)+" additional left parenthesis!")
- }
- }
-if(e=="varDendrogram"){
- if(this.varIndicesStart<0){
- if(this[e].nodes.length!=this.data.y.vars.length){
- alert("Dude! The length of the variable nodes in the dendrogram ("+this[e].nodes.length+") is different to that one in the data ("+this.data.y.vars.length+"). This ain't gonna work!");
- this.showVarDendrogram=false
- }else{
- if(this[e].nodes.length!=this.varIndices.length){
- alert("Ooops! Cannot show dendrogram with "+this[e].nodes.length+" nodes when only "+this.varIndices.length+" variables are visible.");
- this.showVarDendrogram=false
- }else{
- this.varIndices=this[e].idxs
- }
- }
- }else{
- var o=this.varIndicesStart+this.varIndices.length;
- this.varIndices=[];
- for(var s=this.varIndicesStart;s0&&this.hideDataPoint[a]){
- if(this.broadcastType=="var"){
- return false
- }else{
- if(this.hideDataPoint[a].hasOwnProperty(b)){
- return false
- }
- }
- }
-}
-return true
-};
-
-this.getVarColor=function(a){
- if(this.isArray(this.highlightVar)){
- for(var b=0;b=this.maxPieSectors-1){
- g.oprc+=f;
- g.idso.push(b);
- g.no++
- }else{
- g.ids.push(b)
- }
- }
- if(g.no){
- g.ids.push(-1)
- }
- return g
-};
-
-this.drawPie=function(u,h,g,t,J){
- var q=function(){
- for(var a=0;a-1?u.data[n]:u.oprc;
- var f=E%this.colors.length;
- z=e!=null?parseFloat(e):parseFloat((Math.PI*(2*H))-o);
- e=parseFloat(z+(Math.PI*(2*(v))));
- var I=(z+e)/2;
- var C=(e-z)/32;
- var G=this.transparency!=null?this.validateColor(this.colors[f],this.transparency):this.colors[f];
- if(this.gradient){
- this.setRadialGradient(h,g,t*1.3,G)
- }else{
- this.ctx.fillStyle=G
- }
- this.ctx.beginPath();
- this.ctx.lineWidth=this.pieSegmentSeparation;
- this.ctx.strokeStyle=this.pieType=="separated"?this.background:this.pieType=="solid"?this.foreground:this.foreground;
- if(this.showShadow){
- this.ctx.shadowOffsetX=this.shadowOffsetX;
- this.ctx.shadowOffsetY=this.shadowOffsetY;
- this.ctx.shadowBlur=this.shadowBlur;
- this.ctx.shadowColor=this.shadowColor
- }
- this.ctx.moveTo(h,g);
- this.ctx.arc(h,g,t,z,e,false);
- this.ctx.lineTo(h,g);
- this.ctx.closePath();
- this.ctx.fill();
- if(this.graphType!="Network"){
- this.ctx.stroke()
- }
- if(this.showShadow){
- this.ctx.restore();
- this.ctx.shadowOffsetX=0;
- this.ctx.shadowOffsetY=0;
- this.ctx.shadowBlur=0;
- this.ctx.shadowColor=this.background
- }
- var F=h-Math.sin(I-(Math.PI/2))*A;
- var d=g+Math.cos(I-(Math.PI/2))*A;
- if(this.graphType!="Network"&&this.showPieValues){
- this.drawText(sprintf("%."+this.pieSegmentPrecision+"f",v*100)+"%",F,d,this.axisTickFont,this.axisTickColor,"center","middle")
- }
- if(J){
- F=h+t*Math.cos(z);
- d=g+t*Math.sin(z);
- var b=["poly",h,g,F,d];
- var o=z;
- for(var B=0;B<32;B++){
- o+=C;
- F=h+t*Math.cos(o);
- d=g+t*Math.sin(o);
- b.push(F);
- b.push(d)
- }
- b.push(h);
- b.push(g);
- if(n>-1){
- this.addArea(b,[n,D])
- }else{
- u.idso.push(D);
- this.addArea(b,u.idso)
- }
- }
- H+=v
- }
- this.ctx.lineWidth=m
-}
-};
-
-this.drawBarPlot=function(K,J,F,x,k,C,p,g,E,D,L,N){
- var n,j,I,B;
- var M=this.backgroundType.match(/window/i)?this.foregroundWindow:this.foreground;
- var A=this.seriesSeparationFactor/2;
- var H=k/2;
- if(D=="vertical"){
- for(var G=0;G=0){
- var b=G.pop();
- if(S&&this.lineType=="spline"){
- this.addArea(this.drawLine(N,b[0],b[1],false,false,U[K],this.lineThickness),V[K])
- }else{
- this.addArea(this.drawShape(N,b[0],b[1],false,false,U[K],U[K],I),V[K])
- }
- K--
-}
-};
-
-this.drawBoxPlot=function(K,F,x,g,B,n,E,D,L,C,N){
- var e=function(a){
- return D=="vertical"?x-((a-E)*n):F+((a-E)*n)
- };
-
- var M=this.backgroundType.match(/window/i)?this.foregroundWindow:this.foreground;
- var y=this.seriesSeparationFactor/2;
- var I=g/2;
- var J=g/this.boxPlotOutliersRatio;
- if(D=="vertical"){
- for(var H=0;Hk[1]){
- this.addArea(this.rectangle(B,k[0],f,k[1]-k[0],false,H,"open",false,false,true),J[D]);
- this.drawLine("line",s,k[1],s,k[2],H,false,"butt",false,false,true);
- this.drawLine("line",s,k[3],s,k[0],H,false,"butt",false,false,true)
- }else{
- this.addArea(this.rectangle(B,k[0],f,k[1]-k[0],H,H,"closed",false,false,true),J[D]);
- this.drawLine("line",s,k[3],s,k[1],H,false,"butt",false,false,true);
- this.drawLine("line",s,k[0],s,k[2],H,false,"butt",false,false,true)
- }
- }else{
- this.addArea(this.rectangle(B,k[0],f,q-k[0],H,H,"closed",false,false,true),J[D])
- }
- B+=F
- }
- }else{
- for(var D=0;Dk[0]){
- this.addArea(this.rectangle(k[0],q,k[1]-k[0],f,false,H,"open",false,false,true),J[D]);
- this.drawLine("line",k[1],s,k[2],s,H,false,"butt",false,false,true);
- this.drawLine("line",k[3],s,k[0],s,H,false,"butt",false,false,true)
- }else{
- this.addArea(this.rectangle(k[0],q,k[1]-k[0],f,H,H,"closed",false,false,true),J[D]);
- this.drawLine("line",k[3],s,k[1],s,H,false,"butt",false,false,true);
- this.drawLine("line",k[0],s,k[2],s,H,false,"butt",false,false,true)
- }
- }else{
- this.addArea(this.rectangle(B,q,k[0]-B,f,H,H,"closed",false,false,true),J[D])
- }
- q+=F
- }
- }
-};
-
-this.drawDotPlot=function(P,O,I,B,x,L,D,A,H,C,F,Q,E,N,S){
- var y,k;
- var r=this.dotPlotJitter?Math.ceil(Math.log(this.varIndices.length*5)/Math.LN10):1;
- var M=this.dotPlotJitter?N/r:0;
- var R=this.backgroundType.match(/window/i)?this.foregroundWindow:this.foreground;
- if(F=="vertical"){
- if(this.dotPlotJitter){
- I-=N/2
- }
- for(var K=0;Kd){
- this.xRotate=d
- }
- if(this.xRotate<0){
- this.xRotate=b
- }
- if(this.yRotate>d){
- this.yRotate=d
- }
- if(this.yRotate<0){
- this.yRotate=b
- }
- if(this.zRotate>d){
- this.zRotate=d
- }
- if(this.zRotate<0){
- this.zRotate=b
- }
- if(this.xRotate>0){
- a=180/this.xRotate;
- this.ry=Math.PI/a
- }else{
- this.ry=0
- }
- if(this.yRotate>0){
- a=180/this.yRotate;
- this.rx=Math.PI/a
- }else{
- this.rx=0
- }
- if(this.zRotate>0){
- a=180/this.zRotate;
- this.rz=Math.PI/a
- }else{
- this.rz=0
- }
- };
-
-this.set3DParams=function(){
- this.perspective=this.x*1.5;
- this.lenX=this.x/4*this.zoom*this.x3DRatio;
- this.lenY=this.x/4*this.zoom*this.y3DRatio;
- this.lenZ=this.x/4*this.zoom*this.z3DRatio;
- if(this.padX==null||!this.padX){
- this.padX=this.x/2
- }
- if(this.padY==null||!this.padY){
- this.padY=this.y/2
- }
- if(this.padZ==null||!this.padZ){
- this.padZ=this.y/2
- }
- };
-
-this.get3DTransfrom=function(f,g,h){
- var e,d,b;
- var a=[];
- d=g;
- b=h;
- g=d*Math.cos(this.rx)-b*Math.sin(this.rx);
- h=d*Math.sin(this.rx)+b*Math.cos(this.rx);
- e=f;
- b=h;
- f=b*Math.sin(this.ry)+e*Math.cos(this.ry);
- h=b*Math.cos(this.ry)-e*Math.sin(this.ry);
- e=f;
- d=g;
- f=e*Math.cos(this.rz)-d*Math.sin(this.rz);
- g=e*Math.sin(this.rz)+d*Math.cos(this.rz);
- f=f*(this.perspective/(h+this.perspective));
- g=g*(this.perspective/(h+this.perspective));
- h=h*(this.perspective/(h+this.perspective));
- a.push(f+this.padX);
- a.push(g+this.padY);
- a.push(h+this.padZ);
- return a
- };
-
-this.backfaceCulling=function(s){
- var y=[];
- var w=[];
- var u=[];
- var r=[];
- var q=[];
- var p=[];
- for(var o=0;o0){
- if(ad>0){
- var b=m[ad-1];
- var N=this.getDataAtPos(b,L);
- if(N>0){
- var e=(P-N)/this.functionIntervals;
- for(var ac=0;ac0){
- this.drawShape("path",K,J,false,false,n,n,"open");
- if(ai.nlfit[ae].type=="reg"){
- O=aa+((Y-aa)/(1+U/(Math.pow(U,S))))
- }else{
- O=aa+((Y-aa)/(1+(Math.pow((U/U),S))))
- }
- if(this.xAxisTransform){
- U=this.xAxisTransform=="percentile"?this.percentile(ah,D,U):this.transformValue(this.xAxisTransform,U)
- }
- A=ab+((U-this.xAxisMin)*this.xAxisUnit);
- a=(R+this.y)-((O-this.yAxisMin)*this.yAxisUnit);
- this.drawLine("dottedLine",ab,a,A,a,n);
- this.drawLine("dottedLine",A,a,A,(R+this.y),n)
- }
- }
-}
-if(ai.line){
- for(var ae=0;ae=this.marginTop+this.offsetY+this.top?true:false
- }else{
- A=this.marginLeft+this.offsetX+this.left+((Q-this.xAxisMin)*this.xAxisUnit);
- w=A;
- a=this.marginTop+this.offsetY+this.top;
- am=a+this.y;
- aj=A<=this.marginLeft+this.offsetX+this.left+this.x&&this.marginLeft+this.offsetX+this.left?true:false
- }
- if(aj){
- if(V){
- if(this.graphOrientation=="vertical"){
- this.drawText(V,w-this.margin,am-this.margin,this.decorationFont,this.decorationColor,"right","bottom")
- }else{
- this.drawText(V,w+this.margin,am-this.margin,this.decorationFont,this.decorationColor,"left","bottom")
- }
- }
- this.drawLine(al,A,a,w,am,H)
- }
- }
-}
-if(ai.reg){
- for(var ae=0;ae1){
- var e=this.getFontPt(this.legendFont);
- var b=0;
- if(this.xAxisIndices.length==this.yAxisIndices.length&&this.xAxisIndices.length>1){
- for(var d=0;dthis.yAxisIndices.length){
- b=this.measureText(this.shortenText(this.getMaxText(this.xAxis),this.maxSmpStringLen)+" vs "+this.shortenText(this.yAxis[0],this.maxSmpStringLen),this.legendFont)
- }else{
- if(this.yAxisIndices.length>this.xAxisIndices.length){
- b=this.measureText(this.shortenText(this.getMaxText(this.yAxis),this.maxSmpStringLen)+" vs "+this.shortenText(this.xAxis[0],this.maxSmpStringLen),this.legendFont)
- }
- }
- }
-this.legendSampleWidth=(e-1)+b+(this.margin*3);
-this.legendSampleHeight=(Math.max(this.xAxisIndices.length,this.yAxisIndices.length)*(e+this.margin))+this.margin
-}
-};
-
-this.drawSampleLegend=function(b,k){
- var j=b;
- var e=k;
- var p=this.getFontPt(this.legendFont);
- var o=(p-1)/2;
- k+=this.margin+o;
- if(this.legendBox){
- this.disableGradientTransparency();
- this.rectangle(j,e,this.legendSampleWidth,this.legendSampleHeight,this.legendBackgroundColor,this.legendBoxColor);
- this.enableGradientTransparency()
- }
- var m=Math.max(this.xAxisIndices.length,this.yAxisIndices.length);
- for(var g=0;gthis.yAxisIndices.length?this.yAxis[0]:this.xAxis[0];
- var l=this.shortenText(this.xAxisIndices.length1){
- this.legendColorIndicatorWidth=parseInt(2*256*this.indicatorWidth/this.indicatorBins)+(this.margin*4)+1
- }else{
- this.legendColorIndicatorWidth=parseInt(1*256*this.indicatorWidth/this.indicatorBins)+(this.margin*4)+1
- }
- this.legendColorIndicatorHeight=this.indicatorHeight+(this.margin*3)+this.getFontPt(this.legendFont);
- this.legendColorIndicatorHeight+=this.getFontPt(this.legendFont)+this.margin
- }
- };
-
-this.getHeatmapColor=function(e,d,f){
- var b=Math.abs(e);
- e+=b;
- d+=b;
- f+=b;
- var a=((f-e)*this.heatmapColors.length/(d-e)).toFixed()-1;
- return this.heatmapColors[Math.max(0,Math.min(this.heatmapColors.length-1,a))]
- };
-
-this.drawColorIndicator=function(d,n,f,l,h,b){
- if(this.colorBy||this.outlineBy||b){
- var k=d;
- var e=n;
- var a=this.indicatorHeight;
- var m=this.indicatorHeight;
- if(this.indicatorsPosition=="bottom"){
- for(var g=0;g=10){
- this.drawText(sprintf("%."+h+"f",(f+l)/2),d,n,this.legendFont,this.legendColor,"center","top")
- }
- if(!b){
- this.drawText(this.colorBy||this.outlineBy,d,n+this.margin+this.getFontPt(this.legendFont),this.legendFont,this.legendColor,"center","top")
- }
- d+=(this.heatmapColors.length*this.indicatorWidth/2)-(this.indicatorWidth/2);
- this.drawText(sprintf("%."+h+"f",l),d,n,this.legendFont,this.legendColor,"center","top");
- this.addArea(["rect",k-(this.margin*2),e-this.margin,d+(this.margin*2),n+this.getFontPt(this.legendFont)+this.margin],[-1],"-legend-indicator-color")
- }else{
- for(var g=0;g=10){
- this.drawText(sprintf("%."+h+"f",(f+l)/2),d,n,this.legendFont,this.legendColor,"center","top",-Math.PI/2)
- }
- if(!b){
- this.drawText(this.colorBy||this.outlineBy,d+this.margin+this.getFontPt(this.legendFont),n,this.legendFont,this.legendColor,"center","top",-Math.PI/2)
- }
- n-=(this.heatmapColors.length*this.indicatorWidth/2)-(this.indicatorWidth/2);
- this.drawText(sprintf("%."+h+"f",l),d,n,this.legendFont,this.legendColor,"center","top",-Math.PI/2);
- this.addArea(["rect",k-this.margin,n-(this.margin*2),d+this.margin+this.getFontPt(this.legendFont),e+(this.margin*2)],[-1],"-legend-indicator-color")
- }
- }
-};
-
-this.setShapeLegendIndicatorDimensions=function(){
- if(this.shapeBy){
- this.legendShapeIndicatorWidth=(10*(this.indicatorHeight+this.margin))+(this.margin*2);
- this.legendShapeIndicatorHeight=this.indicatorHeight+(this.margin*3)+this.getFontPt(this.legendFont);
- this.legendShapeIndicatorHeight+=this.getFontPt(this.legendFont)+this.margin
- }
- };
-
-this.drawShapeIndicator=function(b,n,f,m,j){
- if(this.shapeBy){
- var l=b;
- var d=n;
- var k=this.indicatorHeight/2;
- var e=b;
- var a=n;
- if(this.indicatorsPosition=="bottom"){
- for(var g=0;g<10;g++){
- this.drawShape("pie"+g,e,a+this.margin,this.indicatorHeight,this.indicatorHeight,this.background,this.foreground,"open");
- e+=this.indicatorHeight+k
- }
- b=l;
- n+=this.indicatorHeight+this.margin;
- this.drawText(sprintf("%."+j+"f",f),b,n,this.legendFont,this.legendColor,"center","top");
- b+=this.indicatorHeight*7;
- this.drawText(sprintf("%."+j+"f",(f+m)/2),b,n,this.legendFont,this.legendColor,"center","top");
- this.drawText(this.shapeBy||shapeBy,b,n+this.margin+this.getFontPt(this.legendFont),this.legendFont,this.legendColor,"center","top");
- b+=this.indicatorHeight*7;
- this.drawText(sprintf("%."+j+"f",m),b,n,this.legendFont,this.legendColor,"center","top");
- this.addArea(["rect",l-(this.margin*2),d-this.margin,b+(this.margin*2),n+this.getFontPt(this.legendFont)+this.margin],[-1],"-legend-indicator-shape")
- }else{
- for(var g=0;g<10;g++){
- this.drawShape("pie"+g,e+this.margin,a,this.indicatorHeight,this.indicatorHeight,this.background,this.foreground,"open");
- a-=this.indicatorHeight+k
- }
- b+=this.indicatorHeight+this.margin;
- n=d;
- this.drawText(sprintf("%."+j+"f",f),b,n,this.legendFont,this.legendColor,"center","top",-Math.PI/2);
- n-=this.indicatorHeight*7;
- if(this.heatmapColors.length>=10){
- this.drawText(sprintf("%."+j+"f",(f+m)/2),b,n,this.legendFont,this.legendColor,"center","top",-Math.PI/2)
- }
- this.drawText(this.shapeBy||shapeBy,b+this.margin+this.getFontPt(this.legendFont),n,this.legendFont,this.legendColor,"center","top",-Math.PI/2);
- n-=this.indicatorHeight*7;
- this.drawText(sprintf("%."+j+"f",m),b,n,this.legendFont,this.legendColor,"center","top",-Math.PI/2);
- this.addArea(["rect",l-this.margin,n-(this.margin*2),b+this.margin+this.getFontPt(this.legendFont),d+(this.margin*2)],[-1],"-legend-indicator-shape")
- }
- }
-};
-
-this.setSizeLegendIndicatorDimensions=function(){
- if(this.sizeBy){
- var a=0;
- var d=this.indicatorHeight/2;
- for(var b=0;b<10;b++){
- a+=this.sizes[b]+d
- }
- this.legendSizeIndicatorWidth=(a-(this.sizes[0]+this.sizes[9]))+(this.margin*4);
- this.legendSizeIndicatorHeight=this.sizes[9]+(this.margin*3)+this.getFontPt(this.legendFont);
- this.legendSizeIndicatorHeight+=this.getFontPt(this.legendFont)+this.margin
- }
- };
-
-this.drawSizeIndicator=function(e,q,j,p,l){
- if(this.sizeBy){
- var o=e;
- var f=q;
- var m=this.indicatorHeight/2;
- var r=this.sizes[9];
- var g=e;
- var a=q;
- var n=e;
- var d=q;
- if(this.indicatorsPosition=="bottom"){
- for(var k=0;k<10;k++){
- var b=this.sizes[k];
- this.drawShape("sphere",g,a+(r/2),b,b,this.background,this.foreground,"open");
- g+=b+m;
- if(k<4){
- n+=b+m
- }else{
- if(k==5){
- n+=(b+m)/2
- }
- }
- }
- q+=r+this.margin;
- this.drawText(sprintf("%."+l+"f",j),o,q,this.legendFont,this.legendColor,"center","top");
- this.drawText(sprintf("%."+l+"f",(j+p)/2),n,q,this.legendFont,this.legendColor,"center","top");
- this.drawText(this.sizeBy,o+(this.legendSizeIndicatorWidth/2),q+this.margin+this.getFontPt(this.legendFont),this.legendFont,this.legendColor,"center","top");
- this.drawText(sprintf("%."+l+"f",p),g-(r+m),q,this.legendFont,this.legendColor,"center","top");
- this.addArea(["rect",o-(this.margin*2),f-this.margin,(g-r)+(this.margin*2),q+this.getFontPt(this.legendFont)+this.margin],[-1],"-legend-indicator-size")
- }else{
- for(var k=0;k<10;k++){
- var b=this.sizes[k];
- this.drawShape("sphere",g+(r/2),a,b,b,this.background,this.foreground,"open");
- a-=(b+m);
- if(k<4){
- d-=(b+m)
- }else{
- if(k==5){
- d-=((b+m)/2)
- }
- }
- }
- e+=r+this.margin;
-this.drawText(sprintf("%."+l+"f",j),e,q,this.legendFont,this.legendColor,"center","top",-Math.PI/2);
-this.drawText(sprintf("%."+l+"f",(j+p)/2),e,d,this.legendFont,this.legendColor,"center","top",-Math.PI/2);
-this.drawText(this.sizeBy,e+this.margin+this.getFontPt(this.legendFont),f-(this.legendSizeIndicatorWidth/2),this.legendFont,this.legendColor,"center","top",-Math.PI/2);
-this.drawText(sprintf("%."+l+"f",p),e,a+(r+m),this.legendFont,this.legendColor,"center","top",-Math.PI/2);
-this.addArea(["rect",o-this.margin,(a+(r+m))-(this.margin*2),e+this.margin+this.getFontPt(this.legendFont),f+(this.margin*2)],[-1],"-legend-indicator-size")
-}
-}
-};
-
-this.setDataColorShapeSizeIndicatorDimensions=function(){
- this.setColorLegendIndicatorDimensions();
- this.setShapeLegendIndicatorDimensions();
- this.setSizeLegendIndicatorDimensions()
- };
-
-this.getDiameterLegend=function(){
- return this.x>=600?10:this.x>=400?8:this.x>=200?6:4
- };
-
-this.setColorLegendDimensions=function(a){
- this.legendColorWidth=0;
- this.legendColorHeight=0;
- if(this.colorBy||this.outlineBy){
- var g,f;
- var j=this.getDiameterLegend();
- if(a){
- g=this.colorBy||this.outlineBy;
- f=a
- }else{
- if(this.data.x&&this.data.x.hasOwnProperty(this.colorBy)){
- g=this.setMaxSmpStringAnnt(this.colorBy);
- f=this.legendColorsMax
- }else{
- if(this.data.z&&this.data.z.hasOwnProperty(this.colorBy)){
- g=this.setMaxVarStringAnnt(this.colorBy);
- f=this.setMaxVarStringLabel(this.colorBy)
- }else{
- g=0;
- f=0
- }
- }
- }
- var b=this.measureText(g,this.legendFont);
-var e=this.measureText(f,this.legendFont)+j+this.margin;
-this.legendColorWidth=Math.max(b,e)+(this.margin*2);
-var i=this.getFontPt(this.legendFont);
-var h=Math.max(j,i);
-this.legendColorHeight=(this.legendColorsN*(h+this.margin))+i+(this.margin*3)
-}
-};
-
-this.drawColorLegend=function(e,f){
- if((this.outlineBy&&this.isMultidimensionalHeatmap)||(this.colorBy&&((this.data.x&&this.data.x.hasOwnProperty(this.colorBy))||(this.data.z&&this.data.z.hasOwnProperty(this.colorBy))))){
- var i=this.getDiameterLegend();
- var g=this.getFontPt(this.legendFont);
- var j=g/2;
- var h=f+this.margin+j;
- var a=Math.max(i,g);
- this.disableGradientTransparency();
- if(this.legendBackgroundColor){
- this.rectangle(e,f,this.legendColorWidth,this.legendColorHeight,this.legendBackgroundColor,this.legendBoxColor)
- }else{
- this.rectangle(e,f,this.legendColorWidth,this.legendColorHeight,false,this.legendBoxColor,"open")
- }
- this.enableGradientTransparency();
- this.drawText(this.colorBy||this.outlineBy,e+(this.legendColorWidth/2),h,this.legendFont,this.colorLegend,"center","middle");
- h+=j+this.margin;
- this.drawLine("line",e,h,e+this.legendColorWidth,h,this.legendBoxColor);
- h+=this.margin+(a/2);
- for(var b in this.legendColors){
- if(this.outlineBy){
- this.drawShape("circle",e+this.margin+(i/2),h,i,i,false,this.legendColors[b],"open",false,2)
- }else{
- this.drawShape("circle",e+this.margin+(i/2),h,i,i,this.legendColors[b],this.foreground,"closed")
- }
- this.drawText(b,e+(this.margin*2)+i,h,this.legendFont,this.colorLegend,"left","middle");
- h+=this.margin+a
- }
- this.addArea(["rect",e,f,e+this.legendColorWidth,f+this.legendColorHeight],[-1],"-legend-color")
- }
- };
-
-this.setShapeLegendDimensions=function(a){
- this.legendShapeWidth=0;
- this.legendShapeHeight=0;
- if(this.shapeBy){
- var g,f;
- var j=this.getDiameterLegend();
- if(a){
- g=this.shapeBy;
- f=a
- }else{
- if(this.data.x&&this.data.x.hasOwnProperty(this.shapeBy)){
- g=this.setMaxSmpStringAnnt(this.shapeBy);
- f=this.legendShapesMax
- }else{
- if(this.data.z&&this.data.z.hasOwnProperty(this.shapeBy)){
- g=this.setMaxVarStringAnnt(this.shapeBy);
- f=this.setMaxVarStringLabel(this.shapeBy)
- }else{
- g=0;
- f=0
- }
- }
- }
- var b=this.measureText(g,this.legendFont);
-var e=this.measureText(f,this.legendFont)+j+this.margin;
-this.legendShapeWidth=Math.max(b,e)+(this.margin*2);
-var i=this.getFontPt(this.legendFont);
-var h=Math.max(j,i);
-this.legendShapeHeight=(this.legendShapesN*(h+this.margin))+i+(this.margin*3)
-}
-};
-
-this.drawShapeLegend=function(b,e){
- if((this.shapeBy&&this.isMultidimensionalHeatmap)||(this.shapeBy&&((this.data.x&&this.data.x.hasOwnProperty(this.shapeBy))||(this.data.z&&this.data.z.hasOwnProperty(this.shapeBy))))){
- var i=this.getDiameterLegend();
- var f=this.getFontPt(this.legendFont);
- var j=f/2;
- var h=e+this.margin+j;
- var a=Math.max(i,f);
- this.disableGradientTransparency();
- if(this.legendBackgroundColor){
- this.rectangle(b,e,this.legendShapeWidth,this.legendShapeHeight,this.legendBackgroundColor,this.legendBoxColor)
- }else{
- this.rectangle(b,e,this.legendShapeWidth,this.legendShapeHeight,false,this.legendBoxColor,"open")
- }
- this.enableGradientTransparency();
- this.drawText(this.shapeBy,b+(this.legendShapeWidth/2),h,this.legendFont,this.colorLegend,"center","middle");
- h+=j+this.margin;
- this.drawLine("line",b,h,b+this.legendShapeWidth,h,this.legendBoxColor);
- h+=this.margin+(a/2);
- for(var g in this.legendShapes){
- this.drawShape(this.legendShapes[g],b+this.margin+(i/2),h,i,i,this.background,this.foreground,"closed");
- this.drawText(g,b+(this.margin*2)+i,h,this.legendFont,this.colorLegend,"left","middle");
- h+=this.margin+a
- }
- this.addArea(["rect",b,e,b+this.legendShapeWidth,e+this.legendShapeHeight],[-1],"-legend-shape")
- }
- };
-
-this.setSizeLegendDimensions=function(a){
- this.legendSizeWidth=0;
- this.legendSizeHeight=0;
- if(this.sizeBy){
- var g,f;
- var j=this.sizes[this.legendSizesN-1];
- if(a){
- g=this.sizeBy;
- f=a
- }else{
- if(this.data.x&&this.data.x.hasOwnProperty(this.sizeBy)){
- g=this.setMaxSmpStringAnnt(this.sizeBy);
- f=this.legendSizesMax
- }else{
- if(this.data.z&&this.data.z.hasOwnProperty(this.sizeBy)){
- g=this.setMaxVarStringAnnt(this.sizeBy);
- f=this.setMaxVarStringLabel(this.sizeBy)
- }else{
- g=0;
- f=0
- }
- }
- }
- var b=this.measureText(g,this.legendFont);
-var e=this.measureText(f,this.legendFont)+j+this.margin;
-this.legendSizeWidth=Math.max(b,e)+(this.margin*2);
-var i=this.getFontPt(this.legendFont);
-var h=Math.max(j,i);
-this.legendSizeHeight=(this.legendSizesN*(h+this.margin))+i+(this.margin*3)
-}
-};
-
-this.drawSizeLegend=function(e,f){
- if((this.sizeBy&&this.isMultidimensionalHeatmap)||(this.sizeBy&&((this.data.x&&this.data.x.hasOwnProperty(this.sizeBy))||(this.data.z&&this.data.z.hasOwnProperty(this.sizeBy))))){
- var i=this.sizes[this.legendSizesN-1];
- var g=this.getFontPt(this.legendFont);
- var j=g/2;
- var h=f+this.margin+j;
- var a=Math.max(i,g);
- this.disableGradientTransparency();
- if(this.legendBackgroundColor){
- this.rectangle(e,f,this.legendSizeWidth,this.legendSizeHeight,this.legendBackgroundColor,this.legendBoxColor)
- }else{
- this.rectangle(e,f,this.legendSizeWidth,this.legendSizeHeight,false,this.legendBoxColor,"open")
- }
- this.enableGradientTransparency();
- this.drawText(this.sizeBy,e+(this.legendSizeWidth/2),h,this.legendFont,this.colorLegend,"center","middle");
- h+=j+this.margin;
- this.drawLine("line",e,h,e+this.legendSizeWidth,h,this.legendBoxColor);
- h+=this.margin+(a/2);
- for(var b in this.legendSizes){
- this.drawShape("circle",e+this.margin+(i/2),h,this.legendSizes[b],this.legendSizes[b],this.background,this.foreground,"closed");
- this.drawText(b,e+(this.margin*2)+i,h,this.legendFont,this.colorLegend,"left","middle");
- h+=this.margin+a
- }
- this.addArea(["rect",e,f,e+this.legendSizeWidth,f+this.legendSizeHeight],[-1],"-legend-size")
- }
- };
-
-this.setDataColorShapeSizeDimensions=function(){
- this.setColorLegendDimensions();
- this.setShapeLegendDimensions();
- this.setSizeLegendDimensions()
- };
-
-this.setDataColor=function(e){
- this.colorByType=false;
- if(e&&this.isMultidimensionalHeatmap){
- var m=0;
- var a={};
-
- this.dataColors=[];
- this.legendColors={};
-
- this.legendColorsN=0;
- if(this.isNumeric2DArray(e)){
- var h=this.setRangeDataObject(e);
- for(var g=0;gl){
- l=k;
- this.legendColorsMax=d
- }
- a[d]=m%this.colors.length;
- this.legendColors[d]=this.colors[a[d]];
- m++
- }
- this.dataColors.push(this.colors[a[d]])
- }
- }
- this.legendColorsN=m;
- this.setColorLegendDimensions(this.legendColorsMax)
- }
-}else{
- if(this.colorBy){
- var m=0;
- var a={};
-
- this.dataColors=[];
- this.legendColors={};
-
- this.legendColorsN=0;
- if(this.data.x&&this.data.x.hasOwnProperty(this.colorBy)){
- this.colorByType="x";
- var o=this.isGroupedData?this.grpIndices:this.smpIndices;
- if(this.isNumeric(this.data.x[this.colorBy],true)){
- var h=this.range(this.data.x[this.colorBy],true);
- for(var g=0;gl){
- l=k;
- this.legendColorsMax=d
- }
- a[d]=m%this.colors.length;
- this.legendColors[d]=this.colors[a[d]];
- m++
- }
- this.dataColors.push(this.colors[a[d]])
- }
- }else{
- var d=this.isGroupedData?this.getSmpAnnotations(this.colorBy,this.data.w.grps[g],true):this.data.x[this.colorBy][n];
- if(!a.hasOwnProperty(d)){
- var k=this.measureText(d,this.legendFont);
- if(k>l){
- l=k;
- this.legendColorsMax=d
- }
- a[d]=m%this.colors.length;
- this.legendColors[d]=this.colors[a[d]];
- m++
- }
- this.dataColors.push(this.colors[a[d]])
- }
- }
- this.legendColorsN=m;
-this.setColorLegendDimensions()
-}
-}else{
- if(this.data.z&&this.data.z.hasOwnProperty(this.colorBy)){
- this.colorByType="z";
- if(this.isNumeric(this.data.z[this.colorBy],false,true)){
- var h=this.range(this.data.z[this.colorBy],false,true);
- for(var g=0;g-1){
- m=this.getSampleIndices(this.colorBy);
- var h=this.getAxisRangeBySample(m);
- if(!this.scatterType||this.scatterType!="function"){
- for(var g=0;g0){
- p--
- }
- this.dataShapes.push("pie"+p)
- }else{
- this.dataShapes.push(q)
- }
- }
- }
- this.legendShapeRange=h;
- this.legendShapeDecs=this.getAxisDecimals(this.getAxisIncrements(h[0],h[1],10));
- this.setShapeLegendIndicatorDimensions()
- }else{
- var l=0;
- for(var g=0;gl){
- l=k;
- this.legendShapesMax=p
- }
- a[p]=m%this.shapes.length;
- this.legendShapes[p]=this.shapes[a[p]];
- m++
- }
- this.dataShapes.push(this.shapes[a[p]])
- }
- }
- this.legendShapesN=m;
-this.setShapeLegendDimensions(this.legendShapesMax)
-}
-}else{
- if(this.shapeBy){
- var m=0;
- var a={};
-
- var q="square";
- this.dataShapes=[];
- this.legendShapes={};
-
- this.legendShapesN=0;
- if(this.data.x&&this.data.x.hasOwnProperty(this.shapeBy)){
- this.shapeByType="x";
- var o=this.isGroupedData?this.grpIndices:this.smpIndices;
- if(this.isNumeric(this.data.x[this.shapeBy],true)){
- var h=this.range(this.data.x[this.shapeBy],true);
- for(var g=0;g0){
- p--
- }
- this.dataShapes.push("pie"+p)
- }else{
- this.dataShapes.push(q)
- }
- }
- }else{
- var b=this.data.x[this.shapeBy][n];
- if(!isNaN(b)){
- var e=this.percentile(h[0],h[1],b);
- var p=parseInt(e/10);
- if(p>0){
- p--
- }
- this.dataShapes.push("pie"+p)
- }else{
- this.dataShapes.push(q)
- }
- }
- }
- this.legendShapeRange=h;
-this.legendShapeDecs=this.getAxisDecimals(this.getAxisIncrements(h[0],h[1],10));
-this.setShapeLegendIndicatorDimensions()
-}else{
- var l=0;
- for(var g=0;gl){
- l=k;
- this.legendShapesMax=p
- }
- a[p]=m%this.shapes.length;
- this.legendShapes[p]=this.shapes[a[p]];
- m++
- }
- this.dataShapes.push(this.shapes[a[p]])
- }
- }else{
- var p=this.data.x[this.shapeBy][n];
- if(!a.hasOwnProperty(p)){
- var k=this.measureText(p,this.legendFont);
- if(k>l){
- l=k;
- this.legendShapesMax=p
- }
- a[p]=m%this.shapes.length;
- this.legendShapes[p]=this.shapes[a[p]];
- m++
- }
- this.dataShapes.push(this.shapes[a[p]])
- }
- }
- this.legendShapesN=m;
-this.setShapeLegendDimensions()
-}
-}else{
- if(this.data.z&&this.data.z.hasOwnProperty(this.shapeBy)){
- this.shapeByType="z";
- if(this.isNumeric(this.data.z[this.shapeBy],false,true)){
- var h=this.range(this.data.z[this.shapeBy],false,true);
- for(var g=0;g0){
- p--
- }
- this.dataShapes.push("pie"+p)
- }else{
- this.dataShapes.push(q)
- }
- }
- this.legendShapeRange=h;
- this.legendShapeDecs=this.getAxisDecimals(this.getAxisIncrements(h[0],h[1],10));
- this.setShapeLegendIndicatorDimensions()
- }else{
- for(var g=0;g-1){
- m=this.getSampleIndices(this.shapeBy);
- var h=this.getAxisRangeBySample(m);
- for(var g=0;g0){
- p--
- }
- this.dataShapes.push("pie"+p)
- }else{
- this.dataShapes.push(q)
- }
- }
- this.legendShapeRange=h;
- this.legendShapeDecs=this.getAxisDecimals(this.getAxisIncrements(h[0],h[1],10));
- this.setShapeLegendIndicatorDimensions()
- }else{
- if(this.shapeBy=="variable"){
- for(var g=0;g0){
- a--
- }
- this.dataSizes.push(this.sizes[a])
- }else{
- this.dataSizes.push(0)
- }
- }
- }
- this.legendSizeRange=k;
- this.legendSizeDecs=this.getAxisDecimals(this.getAxisIncrements(k[0],k[1],10));
- this.setSizeLegendIndicatorDimensions()
- }else{
- var m=0;
- for(var h=0;hm){
- m=l;
- this.legendSizesMax=a
- }
- b[a]=(n%this.sizes.length)+3;
- this.legendSizes[a]=this.sizes[b[a]];
- n++
- }
- this.dataSizes.push(this.sizes[b[a]])
- }
- }
- this.legendSizesN=n;
-this.setSizeLegendDimensions(this.legendSizesMax)
-}
-}else{
- if(this.sizeBy){
- var n=0;
- var b={};
-
- this.dataSizes=[];
- this.legendSizes={};
-
- this.legendSizesN=0;
- if(this.data.x&&this.data.x.hasOwnProperty(this.sizeBy)){
- this.sizeByType="x";
- var p=this.isGroupedData?this.grpIndices:this.smpIndices;
- if(this.isNumeric(this.data.x[this.sizeBy],true)){
- var k=this.range(this.data.x[this.sizeBy],true);
- for(var h=0;h0){
- a--
- }
- this.dataSizes.push(this.sizes[a])
- }else{
- this.dataSizes.push(0)
- }
- }
- }else{
- var d=this.data.x[this.sizeBy][o];
- if(!isNaN(d)){
- var f=this.percentile(k[0],k[1],d);
- var a=parseInt(f/10);
- if(a>0){
- a--
- }
- this.dataSizes.push(this.sizes[a])
- }else{
- this.dataSizes.push(0)
- }
- }
- }
- this.legendSizeRange=k;
-this.legendSizeDecs=this.getAxisDecimals(this.getAxisIncrements(k[0],k[1],10));
-this.setSizeLegendIndicatorDimensions()
-}else{
- var m=0;
- for(var h=0;hm){
- m=l;
- this.legendSizesMax=a
- }
- b[a]=(n%this.sizes.length)+3;
- this.legendSizes[a]=this.sizes[b[a]];
- n++
- }
- this.dataSizes.push(this.sizes[b[a]])
- }
- }else{
- var a=this.isGroupedData?this.getSmpAnnotations(this.sizeBy,this.data.w.grps[h],true):this.data.x[this.sizeBy][o];
- if(!b.hasOwnProperty(a)){
- var l=this.measureText(a,this.legendFont);
- if(l>m){
- m=l;
- this.legendSizesMax=a
- }
- b[a]=(n%this.sizes.length)+3;
- this.legendSizes[a]=this.sizes[b[a]];
- n++
- }
- this.dataSizes.push(this.sizes[b[a]])
- }
- }
- this.legendSizesN=n;
-this.setSizeLegendDimensions()
-}
-}else{
- if(this.data.z&&this.data.z.hasOwnProperty(this.sizeBy)){
- this.sizeByType="z";
- if(this.isNumeric(this.data.z[this.sizeBy],false,true)){
- var k=this.range(this.data.z[this.sizeBy],false,true);
- for(var h=0;h0){
- a--
- }
- this.dataSizes.push(this.sizes[a])
- }else{
- this.dataSizes.push(0)
- }
- }
- this.legendSizeRange=k;
- this.legendSizeDecs=this.getAxisDecimals(this.getAxisIncrements(k[0],k[1],10));
- this.setSizeLegendIndicatorDimensions()
- }else{
- for(var h=0;h-1){
- n=this.getSampleIndices(this.sizeBy);
- var k=this.getAxisRangeBySample(n);
- for(var h=0;h0){
- a--
- }
- this.dataSizes.push(this.sizes[a])
- }else{
- this.dataSizes.push(0)
- }
- }
- this.legendSizeRange=k;
- this.legendSizeDecs=this.getAxisDecimals(this.getAxisIncrements(k[0],k[1],10));
- this.setSizeLegendIndicatorDimensions()
- }else{
- if(this.sizeBy=="variable"){
- for(var h=0;h0){
- if(this.legendPosition=="right"){
- if(l+this.margin+e>this.height){
- a+=this.margin+k;
- b=k;
- l=e;
- j++;
- this.legendLayout[j]=[f[d]]
- }else{
- if(k>b){
- a+=(k-b);
- b=k
- }
- l+=e;
- if(!this.legendLayout[j]){
- this.legendLayout[j]=[]
- }
- this.legendLayout[j].push(f[d])
- }
- }else{
- if(b+this.margin+k>this.width){
- m+=this.margin+e;
- b=k;
- l=e;
- j++;
- this.legendLayout[d]=[f[d]]
- }else{
- if(e>l){
- m+=(e-l);
- l=e
- }
- b+=k;
- if(!this.legendLayout[j]){
- this.legendLayout[j]=[]
- }
- this.legendLayout[j].push(f[d])
- }
- }
- }
-}
-}
-this.legendWidth=a+this.margin;
-this.legendHeight=m+this.margin
-};
-
-this.getXYLegendCoords=function(p,a,r){
- var o,f,n,k;
- var m=0;
- var d=0;
- var q=-1;
- var g=-1;
- if(this.legendLayout){
- for(var e=0;e-1){
- q=e;
- break
- }
- }
- if(this.legendPosition=="right"){
- r=g==0&&this.allVsAll?this.marginTop+this.layoutTop:g==0?this.marginTop+this.offsetY+this.top:r;
- n=a;
- k=g==0&&this.allVsAll?(this.height-d)/2:g==0?this.marginTop+this.offsetY+this.top+((this.y-d)/2):r;
- a=g==this.legendLayout[q].length-1?a+m:a;
- r=k+this["legend"+this.legendLayout[q][g]+"Height"]+this.margin
- }else{
- a=g==0&&this.allVsAll?this.marginLeft+this.layoutLeft:g==0?this.marginLeft+this.offsetX+this.left:a;
- n=g==0&&this.allVsAll?(this.width-m)/2:g==0?this.marginLeft+this.offsetX+this.left+((this.x-m)/2)+this.margin:a+this.margin;
- k=r;
- a=n+this["legend"+this.legendLayout[q][g]+"Width"]+this.margin;
- r=g==this.legendLayout[q].length-1?r+d:r
- }
- }
-return[n,k,a,r]
-};
-
-this.drawScatterLegend=function(e,s){
- var d=this.allVsAll?this.width-(this.marginRight+this.layoutRight):this.marginLeft+this.offsetX+this.left+this.x;
- var o=this.allVsAll?this.height-(this.marginBottom+this.layoutBottom):this.marginTop+this.offsetY+this.top+this.y;
- if(e){
- d+=e
- }
- if(s){
- o+=s
- }
- if(this.showIndicators){
- var r,k;
- var a,q;
- if(!this.allVsAll&&(this.graphType=="Scatter2D"||this.graphType=="ScatterBubble2D")){
- d+=(this.margin*2);
- o+=this.get2DXAxisHeight()+this.margin;
- if(this.graphType=="ScatterBubble2D"&&this.zAxisShow){
- d+=this.getFontPt(this.axisTitleFont)+(this.margin*2)
- }
- }else{
- d+=(this.margin*1);
- o+=(this.margin*1)
- }
- var n=["Color","Shape","Size"];
- for(var g=0;g0){
- var b="draw"+m[g]+"Legend";
- var p=this.getXYLegendCoords(m[g],d,o);
- this[b](p[0],p[1]);
- if(this.legendPosition=="right"){
- o=p[3]+this.margin
- }else{
- d=p[2]+this.margin
- }
- }
- }
-}
-}
-};
-
-CanvasXpress.prototype.initApi=function(){
- this.getValidGraphTypes=function(){
- return this.validGraphTypes
- };
-
- this.setHeatmapScheme=function(){
- this.initializeAttributes()
- };
-
- this.hasIndicator=function(){
- if(this.graphType.match(/Scatter/)||this.graphType=="Bar"){
- return true
- }else{
- return false
- }
- };
-
-this.hasLegend=function(){
- if(this.graphType!="Network"&&this.graphType!="Genome"&&this.graphType!="Correlation"&&this.graphType!="Heatmap"){
- return true
- }else{
- return false
- }
- };
-
-this.hasLegendProperties=function(){
- if(this.graphType!="Network"&&this.graphType!="Genome"&&this.graphType!="Correlation"&&this.graphType!="Heatmap"&&this.graphType!="Pie"){
- return true
- }else{
- return false
- }
- };
-
-this.hasData=function(){
- if(this.graphType!="Network"&&this.graphType!="Genome"&&this.graphType!="Venn"){
- return true
- }else{
- return false
- }
- };
-
-this.hasDataSamples=function(){
- if(this.graphType!="Network"&&this.graphType!="Genome"&&this.graphType!="Venn"&&this.graphType!="Pie"&&!this.graphType.match(/Scatter/)){
- if(this.graphType=="Correlation"&&this.correlationAxis!="samples"){
- return false
- }
- return true
- }else{
- return false
- }
- };
-
-this.hasDataGroups=function(){
- if(this.graphType!="Network"&&this.graphType!="Genome"&&this.graphType!="Venn"&&this.graphType!="Pie"&&!this.graphType.match(/Scatter/)){
- if(this.graphType=="Correlation"&&this.correlationAxis!="samples"){
- return false
- }
- if(this.data.x){
- return true
- }else{
- return false
- }
- }else{
- return false
- }
-};
-
-this.hasDataVariables=function(){
- if(this.graphType!="Network"&&this.graphType!="Genome"&&this.graphType!="Venn"){
- if(this.graphType=="Correlation"&&this.correlationAxis!="variables"){
- return false
- }
- return true
- }else{
- return false
- }
- };
-
-this.hasDataProperties=function(){
- if(this.graphType!="Network"&&this.graphType!="Genome"&&this.graphType!="Heatmap"&&this.graphType!="Venn"&&this.graphType!="Pie"&&this.graphType!="Correlation"){
- return true
- }else{
- return false
- }
- };
-
-this.hasOrientation=function(){
- if(this.graphType!="Network"&&this.graphType!="Genome"&&this.graphType!="Venn"&&this.graphType!="Pie"&&this.graphType!="Correlation"&&this.graphType!="Circular"&&!this.graphType.match(/Scatter/)){
- return true
- }else{
- return false
- }
- };
-
-this.hasOverlays=function(){
- if(this.graphType!="Network"&&this.graphType!="Genome"&&this.graphType!="Venn"&&this.graphType!="Pie"&&this.graphType!="Correlation"&&!this.graphType.match(/Scatter/)){
- return true
- }else{
- return false
- }
- };
-
-this.hasDendrograms=function(){
- if(this.graphType!="Heatmap"&&(this.data.t.smps||this.data.t.vars)){
- return true
- }else{
- return false
- }
- };
-
-this.hasDecorations=function(){
- return this.data.d&&(this.data.d.nlfit||this.data.d.line||this.data.d.reg||this.data.d.nor||this.data.d.area)?true:false
- };
-
-this.isSegregable=function(){
- if(this.graphType!="Network"&&this.graphType!="Genome"&&this.graphType!="Venn"&&this.graphType!="Pie"&&this.graphType!="Correlation"&&!this.graphType.match(/Scatter/)){
- return true
- }else{
- return false
- }
- };
-
-this.getLineTypes=function(){
- var f=["line"];
- var d=["","dashed","dotted","bezierY","bezierX","curved"];
- var a=["arrow","arrowHead","arrowTail","arrowHeadSquareTail","arrowTailSquareHead","square","squareHead","squareTail","squareHeadArrowTail","squareTailArrowHead"];
- for(var e=0;e0){
- this.getAdditionalData(f,this[e+"Data"],this[e+"Properties"])
- }
-}
-}
-if(this.graphType=="Network"){
- return a?this[e+"Data"]:this.getKeys(this[e+"Data"])
- }else{
- return false
- }
-};
-
-this.getFeatureData=function(b){
- if(!this.featuresData){
- this.featuresData={};
-
- var k=this.skipConfigurableProperties?this.getObjectArray(this.featureConfigurableProperties):{};
-
- for(var g=0;g0){
- this.getAdditionalData(h,this.featuresData,this.featuresProperties)
- }
-}
-}
-return b?this.featuresData:this.getKeys(this.featuresData)
-};
-
-this.getAdditionalData=function(e,f,k){
- for(var g=0;g0){
- for(var d=0;d",">=","<","<=","==","null","not null"]
- };
-
-this.resetFilters=function(e,d){
- var a=[];
- if(!e){
- a=["filterSmpBy","filterVarBy","filterNodeBy","filterEdgeBy","filterFeatureBy"]
- }else{
- a=[e]
- }
- for(var b=0;b0)||(this.graphOrientation=="horizontal"&&b==0)){
- this[f]="volume"
- }else{
- this[f]="candle"
- }
- }else{
- this[f]="mean"
- }
- }
- }
- }
- }
-var a="subTransformType"+g;
-if(!this[a]){
- if(this.data.l.transform&&this.data.l.transform[g]){
- this[a]=this.data.l.transform[g]
- }else{
- this[a]=this.subTransformType
- }
- }
-g++
-}
-}
-};
-
-this.setLayoutWeights=function(){
- if(this.data.l.weight){
- var d=0;
- var e=0;
- var a;
- var b;
- if(this.allVsAll){
- for(var c=0;c-1){
- q=this.layoutParams;
- if(q[this.layoutValidN]){
- for(var y=0;y=this.data.l.vars.length*(this.data.l.smps.length-1)){
- this.drawLayoutVariableLegend()
- }
- }else{
- if(this.graphType!="Pie"){
- if((this.graphOrientation=="vertical"&&(A+1)==z)||(this.graphOrientation!="vertical"&&A==0)){
- this.drawLayoutSampleOverlays(u)
- }
- }else{
- if(this.graphType=="Pie"&&A==0){
- if(h){
- this.drawLayoutVariableLegend()
- }
- }
- }
-}
-}else{
- if(this.data.l.vars&&this.data.l.smps){
- if(A>=this.data.l.vars.length*(this.data.l.smps.length-1)){
- this.drawLayoutVariableLegend()
- }
- }
-}
-}
-var b={};
-
-for(var t=0;t400?20:this.toolbarPermanent&&this.canvas.height<=400?13:0;
- if(!d){
- var y=this.$(this.target);
- y.className="CanvasXpress";
- var d=this.$cX("div",{
- id:"container-"+this.target,
- className:"CanvasXpressContainer"
- });
- if(a){
- d.style.display="none"
- }
- var k=this.$cX("div",{
- id:"north-container-"+this.target,
- className:"CanvasXpressContainer"
- },{
- width:(y.width+14)+"px",
- height:(q+7)+"px",
- clear:"left"
- });
- var g=this.$cX("div",{
- id:"north-handler-"+this.target,
- className:"CanvasXpressHandler",
- state:"open",
- open:"url('"+this.imageDir+"tbottom.png')",
- close:"url('"+this.imageDir+"ttop.png')",
- skipWidth:true
- },{
- width:(y.width+14)+"px",
- height:"7px",
- display:"none",
- backgroundImage:"url('"+this.imageDir+"ttop.png')"
- });
- var z=this.$cX("div",{
- id:"north-wrapper-"+this.target,
- className:"CanvasXpressWrapper"
- },{
- width:(y.width+14)+"px",
- height:q+"px"
- });
- var C=this.$cX("div",{
- id:"middle-container-"+this.target,
- className:"CanvasXpressContainer"
- },{
- width:(y.width+14)+"px",
- height:y.height+"px",
- clear:"left"
- });
- if(this.isIE&&this.useFlashIE&&this.browserVersion<9){
- C.style.zIndex=-1
- }
- var l=this.$cX("div",{
- id:"west-container-"+this.target,
- className:"CanvasXpressContainer"
- },{
- width:"7px",
- height:y.height+"px"
- });
- var j=this.$cX("div",{
- id:"west-handler-"+this.target,
- className:"CanvasXpressHandler",
- state:"open",
- open:"url('"+this.imageDir+"tright.png')",
- close:"url('"+this.imageDir+"tleft.png')",
- skipHeight:true
- },{
- width:"7px",
- height:y.height+"px",
- display:"none",
- backgroundImage:"url('"+this.imageDir+"tleft.png')"
- });
- var B=this.$cX("div",{
- id:"west-wrapper-"+this.target,
- className:"CanvasXpressWrapper"
- },{
- width:"0px",
- height:y.height+"px"
- });
- var e=this.$cX("div",{
- id:"center-wrapper-"+this.target,
- className:"CanvasXpressWrapper"
- });
- var h=this.$cX("div",{
- id:"east-container-"+this.target,
- className:"CanvasXpressContainer"
- },{
- width:"7px",
- height:y.height+"px"
- });
- var f=this.$cX("div",{
- id:"east-handler-"+this.target,
- className:"CanvasXpressHandler",
- state:"open",
- open:"url('"+this.imageDir+"tright.png')",
- close:"url('"+this.imageDir+"tleft.png')",
- skipHeight:true
- },{
- width:"7px",
- height:y.height+"px",
- display:"none",
- backgroundImage:"url('"+this.imageDir+"tleft.png')"
- });
- var x=this.$cX("div",{
- id:"east-wrapper-"+this.target,
- className:"CanvasXpressWrapper"
- },{
- width:"0px",
- height:y.height+"px"
- });
- var b=this.$cX("div",{
- id:"south-container-"+this.target,
- className:"CanvasXpressContainer"
- },{
- width:(y.width+14)+"px",
- height:"7px",
- clear:"left"
- });
- var A=this.$cX("div",{
- id:"south-handler-"+this.target,
- className:"CanvasXpressHandler",
- open:"url('"+this.imageDir+"tbottom.png')",
- close:"url('"+this.imageDir+"ttop.png')",
- skipWidth:true
- },{
- width:(y.width+14)+"px",
- height:"7px",
- display:"none",
- backgroundImage:"url('"+this.imageDir+"ttop.png')"
- });
- var r=this.$cX("div",{
- id:"south-wrapper-"+this.target,
- className:"CanvasXpressWrapper",
- state:"open"
- },{
- width:(y.width+14)+"px",
- height:"0px"
- });
- k.appendChild(g);
- k.appendChild(z);
- l.appendChild(B);
- l.appendChild(j);
- h.appendChild(f);
- h.appendChild(x);
- b.appendChild(A);
- b.appendChild(r);
- C.appendChild(l);
- C.appendChild(e);
- C.appendChild(h);
- d.appendChild(k);
- d.appendChild(C);
- d.appendChild(b);
- if(this.isVideo){
- var m=this.$(this.target+"-cX-Video");
- if(!m){
- m=this.$cX("video",{
- id:this.target+"-cX-Video",
- autoplay:false,
- controls:this.videoControls,
- loop:this.videoLoop,
- preload:this.videoPreload,
- poster:this.videoPoster,
- dataSet:this.videoData,
- width:this.canvas.width,
- height:this.canvas.height,
- className:this.videoClassName
- });
- var n=[];
- var u=this.backgroundVideo;
- if(u&&!(u.propertyIsEnumerable("length"))&&typeof u==="object"&&typeof u.length==="number"){
- n=u
- }else{
- n.push(this.backgroundVideo)
- }
- for(var w=0;w400?"20px":this.toolbarPermanent&&this.canvas.height<=400?"13px":0;
- if(e&&c&&g&&d&&b){
- if(d.style.display=="block"&&d.state=="open"){
- g.style.width=(parseInt(e.style.width)+this.canvas.width+parseInt(c.style.width))+"px";
- b.style.width=(parseInt(e.style.width)+this.canvas.width+parseInt(c.style.width))+"px"
- }else{
- g.style.width=(parseInt(e.style.width)+this.canvas.width+parseInt(c.style.width))+"px";
- b.style.width=(parseInt(e.style.width)+this.canvas.width+parseInt(c.style.width))+"px";
- g.style.height=(f+7)+"px";
- b.style.height=f+"px"
- }
- d.style.left=parseInt(e.style.width)+"px";
- d.style.width=this.canvas.width+"px"
- }
- };
-
-this.resizeViewportWest=function(){
- var f=this.$(this.target+"-cX-Configurator");
- var d=this.$("west-container-"+this.target);
- var b=this.$("west-handler-"+this.target);
- var e=this.$("west-wrapper-"+this.target);
- if(d&&b&&e){
- if(b.style.display=="block"&&b.state=="open"){
- d.style.width=(this.configuratorWidth+7+22)+"px";
- e.style.width=(this.configuratorWidth+22)+"px";
- d.style.height=this.canvas.height+"px";
- e.style.height=this.canvas.height+"px"
- }else{
- d.style.width="7px";
- e.style.width="0px"
- }
- b.style.height=this.canvas.height+"px"
- }
- };
-
-this.resizeViewportEast=function(){
- var d=this.$(this.target+"-cX-DataFilter");
- var b=this.$("east-container-"+this.target);
- var e=this.$("east-handler-"+this.target);
- var c=this.$("east-wrapper-"+this.target);
- if(b&&e&&c){
- if(e.style.display=="block"&&e.state=="open"){
- b.style.width=(this.dataFilterWidth+7+6)+"px";
- c.style.width=(this.dataFilterWidth+6)+"px";
- b.style.height=this.canvas.height+"px";
- c.style.height=this.canvas.height+"px"
- }else{
- b.style.width="7px";
- c.style.width="0px"
- }
- e.style.height=this.canvas.height+"px"
- }
- };
-
-this.resizeViewportSouth=function(e){
- var h=this.$(this.target+"-cX-DataTable");
- var b=this.$("west-handler-"+this.target);
- var c=this.$("west-container-"+this.target);
- var g=this.$("east-container-"+this.target);
- var j=this.$("south-container-"+this.target);
- var f=this.$("south-handler-"+this.target);
- var l=this.$("south-wrapper-"+this.target);
- if(h&&b&&c&&g&&j&&f&&l){
- var i=b&&b.style.display=="none"?7:0;
- if((f.style.display=="block"&&f.state=="open")||e){
- j.style.height=(parseInt(h.style.height)+7+2)+"px";
- l.style.height=(parseInt(h.style.height)+2)+"px";
- j.style.width=(parseInt(h.style.width)+2+i)+"px";
- l.style.width=j.style.width
- }else{
- j.style.width=(parseInt(c.style.width)+this.canvas.width+parseInt(g.style.width))+"px";
- l.style.width=(parseInt(c.style.width)+this.canvas.width+parseInt(g.style.width))+"px";
- j.style.height="7px";
- l.style.height="0px"
- }
- f.style.left=parseInt(c.style.width)+"px";
- f.style.width=this.canvas.width+"px"
- }
- };
-
-this.resizeViewport=function(j){
- if(j){
- var b=this.getTargetEvent(j);
- if(b.className=="CanvasXpressHandler"){
- return
- }
- if(this.Ext){
- for(var d=0;d0){
- this.addRemoveLinkListeners("removeEvtListener",a.childNodes[0]);
- a.removeChild(a.childNodes[0])
- }
- a.parentNode.style.display="none"
- }
- };
-
-this.addMenu=function(g,b,h){
- var c;
- var f;
- var j=this.$("north-wrapper-"+this.target);
- var d=this.$("west-container-"+this.target);
- this.resetLinkDiv();
- if(j&&d){
- if(b){
- id=this.newId("-cX-Menu-");
- c=this.$cX("div",{
- id:id,
- className:"CanvasXpressMenu",
- par:h
- },{
- left:"0px",
- top:"0px",
- zIndex:this.menuIndex++,
- display:"none"
- })
- }else{
- this.removeMenus();
- b=this.setMenu();
- var a=this.getTargetEvent(g);
- var l=this.adjustedCoordinates(g,a);
- x=l.x+d.offsetWidth;
- y=l.y;
- id=this.newId("-cX-Menu-");
- c=this.$cX("div",{
- id:id,
- className:"CanvasXpressMenu"
- },{
- left:x+"px",
- top:y+"px",
- zIndex:this.menuIndex++
- })
- }
- var k=this.$cX("ul",{
- id:this.newId("-cX-List-"),
- className:"CanvasXpressList"
- });
- c.appendChild(k);
- j.appendChild(c);
- for(var f=0;f=g&&t.x<=c&&t.y>=s&&t.y<=r){
- a.subMenuOn=h;
- return
- }
- a.hideMenu(q,h)
- }else{
- var l=q[0].parentNode.parentNode;
- var f=l.par?a.$(l.par):false;
- g=l.offsetLeft+3;
- s=l.offsetTop+3;
- c=g+l.offsetWidth-6;
- r=s+l.offsetHeight-6;
- if(f&&(t.x<=g||t.x>=c||t.y<=s||t.y>=r)){
- a.hideMenu([f,f.childNodes[0]],l)
- }
- a.hideMenu(q,h)
- }
- }
- }
-}(this);
-this.getMenuItemComp=function(d){
- var c=this.getTargetEvent(d);
- var b;
- if(c.tagName.match(/img|span/i)){
- b=c.parentNode;
- c=b.parentNode
- }else{
- if(c.tagName.match(/a/i)){
- b=c;
- c=b.parentNode
- }else{
- b=c.getElementsByTagName("a")[0]
- }
- }
- return[c,b]
-};
-
-this.hideMenu=function(a,b){
- if(a){
- if(a[1].menu){
- a[1].className="CanvasXpressListItemAArrow"
- }else{
- a[1].className="CanvasXpressListItemA"
- }
- a[0].className="CanvasXpressListItem"
- }
- if(b){
- b.style.display="none"
- }
- this.subMenuOn=false
- };
-
-this.removeMenus=function(k){
- var f=[];
- if(!k){
- var c=this.$("north-wrapper-"+this.target);
- if(c){
- var h=c.getElementsByTagName("div");
- for(var g=0;g0){
- for(var g=0;g400?"16px":"8px";
- var g=this.$cX("div",{
- id:this.target+"-cX-Toolbar"
- },{
- position:"absolute",
- overflow:this.toolbarPermanent?"visible":"hidden",
- width:this.width+"px",
- height:"0px",
- left:7+"px",
- top:this.toolbarPermanent?"0px":"12px",
- zIndex:9000
- });
- var b=this.$cX("img",{
- src:this.getPixelImage()+"?"+new Date().getDayYear()+":"+this.userId
- });
- var k=this.$cX("img",{
- id:this.target+"-cX-ToolbarHelp",
- className:"CanvasXpressToolbarImage",
- src:this.imageDir+"help1.png",
- alt:"Help",
- title:"Help"
- },{
- width:o,
- height:o
- });
- var e=this.$cX("img",{
- id:this.target+"-cX-ToolbarSave",
- className:"CanvasXpressToolbarImage",
- src:this.imageDir+"disk.png",
- alt:"Save as png",
- title:"Save as png"
- },{
- width:o,
- height:o
- });
- var n=this.$cX("img",{
- id:this.target+"-cX-ToolbarLayout",
- className:"CanvasXpressToolbarImage",
- src:this.appLayout?this.imageDir+"configure_hide.png":this.isLayoutConfigurator?this.imageDir+"configure_show.png":this.imageDir+"configure_simple_show.png",
- alt:this.appLayout?"Basic layout":"Application layout",
- title:this.appLayout?"Basic layout":"Application layout"
- },{
- width:o,
- height:o,
- display:this.disableDataFilters||this.disableDataTable||this.disableConfigurator?"none":"block"
- });
- var l=this.$cX("img",{
- id:this.target+"-cX-ToolbarFilter",
- className:"CanvasXpressToolbarImage",
- src:this.imageDir+"funnel.png",
- alt:"Filter data",
- title:"Filter data"
- },{
- width:o,
- height:o,
- display:this.disableDataFilters?"none":"block"
- });
- var m=this.$cX("img",{
- id:this.target+"-cX-ToolbarData",
- className:"CanvasXpressToolbarImage",
- src:this.imageDir+"table.png",
- alt:"Show data",
- title:"Show data"
- },{
- width:o,
- height:o,
- display:this.disableDataTable?"none":"block"
- });
- if(this.isVML||this.disableConfigurator||(this.isIE&&this.browserVersion<9)){
- m.style.marginRight="4px"
- }
- var r=this.$cX("img",{
- id:this.target+"-cX-ToolbarConfigurator",
- className:"CanvasXpressToolbarImage",
- src:this.imageDir+"cog.png",
- alt:"Configure plot",
- title:"Configure plot"
- },{
- width:o,
- height:o,
- marginRight:"4px",
- display:this.isVML||this.disableConfigurator||(this.isIE&&this.browserVersion<9)?"none":"block"
- });
- var s=this.$cX("div",{
- id:this.target+"-cX-ToolbarHelpDescription",
- className:"CanvasXpressToolbarHelp draggable"
- },{
- cursor:"move",
- display:"none",
- padding:"10px",
- position:"absolute"
- });
- var j=this.$cX("img",{
- id:this.target+"-cX-ToolbarHelpClose",
- className:"CanvasXpressToolbarHelp",
- src:this.imageDir+"cancel1.png",
- alt:"Close",
- title:"Close"
- });
- s.appendChild(document.createTextNode("Help"));
- s.appendChild(j);
- s.appendChild(this.$cX("br"));
- this.addHelp(s);
- g.appendChild(b);
- g.appendChild(r);
- g.appendChild(m);
- g.appendChild(l);
- g.appendChild(n);
- g.appendChild(e);
- g.appendChild(k);
- g.appendChild(s);
- var s=this.$("north-wrapper-"+this.target);
- if(s){
- s.appendChild(g);
- this.addRemoveToolbarListeners("addEvtListener")
- }
- };
-
-this.addRemoveToolbarListeners=function(a){
- this.addRemoveEvtListener(a,this.$(this.target+"-cX-ToolbarHelp"),"click",this.clickHelp,false);
- this.addRemoveEvtListener(a,this.$(this.target+"-cX-ToolbarSave"),"click",this.print,false);
- this.addRemoveEvtListener(a,this.$(this.target+"-cX-ToolbarLayout"),"click",this.clickLayout,false);
- this.addRemoveEvtListener(a,this.$(this.target+"-cX-ToolbarFilter"),"click",this.clickDataFilters,false);
- this.addRemoveEvtListener(a,this.$(this.target+"-cX-ToolbarData"),"click",this.clickDataTable,false);
- this.addRemoveEvtListener(a,this.$(this.target+"-cX-ToolbarConfigurator"),"click",this.clickGraphConfigurator,false);
- this.addRemoveEvtListener(a,this.$(this.target+"-cX-ToolbarHelpClose"),"click",this.closeHelp,false);
- this.addRemoveEvtListener(a,this.$(this.target+"-cX-ToolbarHelpDescription"),"mousedown",this.registerMousemove,false)
- };
-
-this.clickHelp=function(a){
- return function(f){
- if(!f){
- f=window.event
- }
- var c=a.$(a.target+"-cX-Toolbar");
- var d=a.$(a.target+"-cX-ToolbarHelpDescription");
- if(c&&d){
- c.style.overflow="visible";
- d.style.display="block";
- d.style.left=((f.layerX||f.x)-400)+"px";
- d.style.top=(f.layerY||f.y)+"px"
- }
- return false
- }
- }(this);
-this.closeHelp=function(a){
- return function(f){
- if(!f){
- f=window.event
- }
- var c=a.$(a.target+"-cX-Toolbar");
- var d=a.$(a.target+"-cX-ToolbarHelpDescription");
- if(c&&d){
- d.style.display="none";
- setTimeout(function(){
- c.style.overflow=a.toolbarPermanent?"visible":"hidden"
- },300)
- }
- return false
- }
- }(this);
-this.clickLayout=function(a){
- return function(d){
- if(!d){
- d=window.event
- }
- var b=d.target||d.srcElement;
- a.appLayout=a.appLayout?false:true;
- b.src=a.appLayout?a.imageDir+"configure_hide.png":a.imageDir+"configure_show.png";
- b.alt=a.appLayout?"Basic layout":"Application layout";
- b.title=a.appLayout?"Basic layout":"Application layout";
- if(a.appLayout){
- var c=a.isLayoutConfigurator?500:1;
- if(a.isLayoutConfigurator){
- a.addConfigurator();
- a.selectConfig(false,true);
- if(!a.configuratorLastState||(a.configuratorLastState&&a.configuratorLastState!="docked")){
- a.clickDockUndockConfigurator()
- }
- }
- setTimeout(function(){
- a.showDataFilter();
- if(!a.dataFilterLastState||(a.dataFilterLastState&&a.dataFilterLastState!="docked")){
- a.moveDataFilter();
- if(!a.activeAccordion){
- setTimeout(function(){
- if(a.graphType=="Genome"){
- a.activateAccordion(false,a.$(a.target+"-cX-DataFilterGenomeHeader"))
- }else{
- if(a.graphType=="Network"){
- a.activateAccordion(false,a.$(a.target+"-cX-DataFilterNodeHeader"))
- }else{
- a.activateAccordion(false,a.$(a.target+"-cX-DataFilterVariableHeader"))
- }
- }
- },500)
- }
- }
- setTimeout(function(){
- a.updateDataTable();
- if(!a.dataTableLastState||(a.dataTableLastState&&a.dataTableLastState!="docked")){
- a.moveDataTableDiv("dock")
- }
- setTimeout(function(){
- var e=a.$("middle-container-"+a.target);
- a.dataTableTarget=a.$(a.target+"-cX-DataTable");
- a.updateDataTableResizerDiv(false,parseInt(e.style.width)-4,parseInt(a.dataTableTarget.style.height));
- a.endDataTableResizerDiv();
- a.hideToolbar()
- },500)
- },500)
- },c)
-}else{
- if(a.isLayoutConfigurator){
- a.closeConfigurator()
- }
- setTimeout(function(){
- if(a.activeAccordion){
- a.activateAccordion(false,a.activeAccordion.previousSibling)
- }
- a.hideDataFilter();
- setTimeout(function(){
- a.hideTable();
- a.hideToolbar()
- },500)
- },500)
- }
- return false
-}
-}(this);
-this.clickDataTable=function(a){
- return function(b){
- if(!b){
- b=window.event
- }
- a.updateDataTable();
- return false
- }
- }(this);
-this.clickDataFilters=function(a){
- return function(b){
- if(!b){
- b=window.event
- }
- a.showDataFilter();
- return false
- }
- }(this);
-this.clickGraphConfigurator=function(a){
- return function(b){
- if(!b){
- b=window.event
- }
- a.addConfigurator();
- return false
- }
- }(this);
-this.addHelp=function(r){
- var j=this.$cX("div",false,{
- width:"400px"
- });
- j.appendChild(this.$cX("br"));
- var f=this.$cX("img",{
- src:this.imageDir+"help1.png"
- });
- j.appendChild(f);
- j.appendChild(document.createTextNode(" Show this help"));
- j.appendChild(this.$cX("br"));
- var b=this.$cX("img",{
- src:this.imageDir+"disk.png"
- });
- j.appendChild(b);
- j.appendChild(document.createTextNode(" Save"));
- j.appendChild(this.$cX("br"));
- var A=this.$cX("p",{
- className:"CanvasXpressToolbarHelp",
- innerHTML:"Save the image as a 'png' file (in this toolbar) or save the data as an excel file (in the data table widget)."
- });
- j.appendChild(A);
- var g=this.$cX("img",{
- src:this.imageDir+"funnel.png"
- });
- j.appendChild(g);
- j.appendChild(document.createTextNode(" Filters"));
- j.appendChild(this.$cX("br"));
- var l=this.$cX("p",{
- className:"CanvasXpressToolbarHelp",
- innerHTML:"Widget used to filter the data and metadata. Metadata will be automatically assigned as text, numeric or date."
- });
- j.appendChild(l);
- var g=this.$cX("img",{
- src:this.imageDir+"table.png"
- });
- j.appendChild(g);
- j.appendChild(document.createTextNode(" Show data"));
- j.appendChild(this.$cX("br"));
- var o=this.$cX("p",{
- className:"CanvasXpressToolbarHelp",
- innerHTML:"Show the data used for this visualization in an HTML table."
- });
- j.appendChild(o);
- var f=this.$cX("img",{
- src:this.imageDir+"cog.png"
- });
- j.appendChild(f);
- j.appendChild(document.createTextNode(" Show the configurator"));
- j.appendChild(this.$cX("br"));
- var y=this.$cX("p",{
- className:"CanvasXpressToolbarHelp",
- innerHTML:"This widget allows you to customize this graph. You may enter the name of the property you wish to customize in the text box (which filters as you type) or browse through a number of categories. You will find a short description for the property you select along with its category and links to other relevant properties. You will also see the current value for the seleced property along with a link to an additional widget to help you specifying the new value."
- });
- j.appendChild(y);
- var n=this.$cX("img",{
- src:this.imageDir+"lightbulb.png"
- });
- j.appendChild(n);
- j.appendChild(document.createTextNode(" Show or hide advanced customizations"));
- j.appendChild(this.$cX("br"));
- var t=this.$cX("p",{
- className:"CanvasXpressToolbarHelp",
- innerHTML:"Displayed in the configurator widget."
- });
- j.appendChild(t);
- var B=this.$cX("img",{
- src:this.imageDir+"find.png"
- });
- j.appendChild(B);
- j.appendChild(document.createTextNode(" Search by customizable categories"));
- j.appendChild(this.$cX("br"));
- var q=this.$cX("p",{
- className:"CanvasXpressToolbarHelp",
- innerHTML:"Displayed in the configurator widget to facilitate searching for customizable property."
- });
- j.appendChild(q);
- var e=this.$cX("img",{
- src:this.imageDir+"pin.png"
- });
- j.appendChild(e);
- j.appendChild(document.createTextNode(" Dock widget to the side"));
- j.appendChild(this.$cX("br"));
- var v=this.$cX("img",{
- src:this.imageDir+"unpin.png"
- });
- j.appendChild(v);
- j.appendChild(document.createTextNode(" Undock widget from the side"));
- j.appendChild(this.$cX("br"));
- var i=this.$cX("img",{
- src:this.imageDir+"cancel1.png"
- });
- j.appendChild(i);
- j.appendChild(document.createTextNode(" Close widget"));
- j.appendChild(this.$cX("br"));
- j.appendChild(this.$cX("br"));
- var m=this.$cX("a",{
- href:"http://canvasxpress.org",
- target:"_blank",
- innerHTML:"canvasXpress"
- });
- j.appendChild(document.createTextNode("Additional documentation at "));
- j.appendChild(m);
- j.appendChild(this.$cX("br"));
- r.appendChild(j)
- };
-
-this.showToolbar=function(e){
- if(!this.toolbarPermanent){
- var a=this.$(this.target+"-cX-Toolbar");
- var d=this.$("west-container-"+this.target);
- if(a&&parseInt(a.style.height)==0&&d){
- var c=this;
- var b=parseInt(d.style.width);
- this.resizeMove(a,0,12,this.width+b,20,250);
- if(e){
- setTimeout(function(){
- c.hideToolbar()
- },5000)
- }
- }
- }
-};
-
-this.hideToolbar=function(){
- if(!this.toolbarPermanent){
- var a=this.$(this.target+"-cX-Toolbar");
- var c=this.$("west-container-"+this.target);
- if(a&&parseInt(a.style.height)==20&&c){
- var b=parseInt(c.style.width);
- this.resizeMove(a,0,12,this.width+b,0)
- }
- }
-};
-
-this.isToolbar=function(c){
- if(!c){
- c=window.event
- }
- var b=this.adjustedCoordinates(c);
- if(b){
- var a=b.x;
- var d=b.y;
- if(d>0&&d<24&&a>0&&a24&&d0&&athis.infoTimeIn||c){
- b.style.left="0px";
- b.style.top="0px";
- b.style.display="none";
- b.innerHTML=""
- }
- }
-};
-
-this.showInfoSpan=function(c,j){
- if(this.draggingOn||this.remoteUpdating){
- return
- }
- var l=new Date().getTime()-this.infoStartTime;
- var m=this.$(this.target+"-cX-Info");
- if(m&&j&&j!=""&&l>this.infoTimeIn){
- var k=this.adjustedCoordinates(c,m);
- if(k){
- var f=k.x;
- var d=c?k.y:k.y+25;
- if(!isNaN(j)){
- j=j.toString()
- }
- if(j.match(/\w/)){
- m.innerHTML=j;
- m.style.left=(f+10)+"px";
- m.style.top=(d-20)+"px";
- m.style.display="inline";
- m.style.zIndex=parseInt(m.style.zIndex);
- var i=parseInt(m.clientWidth);
- var a=parseInt(m.clientHeight);
- if(i(window.innerWidth+window.pageXOffset)-f&&(i+20)<(f-window.pageXOffset)){
- m.style.left=(f-(i+20))+"px";
- m.style.left=(f-(parseInt(m.clientWidth)+20))+"px"
- }
- if(a(window.innerHeight+window.pageYOffset)-d&&(a-15)<(d-window.pageYOffset)){
- m.style.top=(d-(a-15))+"px";
- m.style.top=(d-(parseInt(m.clientHeight)-15))+"px"
- }
- this.infoStartTime=new Date().getTime();
- var b=this;
- var g=function(){
- this.update=function(){
- var h=new Date().getTime();
- if(h-b.infoStartTime>b.infoTimeOut){
- b.resetInfoSpan();
- clearInterval(e)
- }
- };
-
- var e=setInterval(this.update,100)
- };
-
- g.call()
- }
- }
-}
-};
-
-this.initializeToolbarTooltip=function(){
- if(!this.disableEvents){
- if(!this.disableToolbar){
- this.addToolbarDiv()
- }
- this.addInfoSpan()
- }
- };
-
-this.initializeToolbarTooltip()
-};
-
-CanvasXpress.prototype.initConfigurator=function(){
- this.addConfigurator=function(a){
- return function(Y,M,G,F){
- if(!Y){
- Y=window.event
- }
- var ab=a.$(a.target+"-cX-Configurator");
- if(ab){
- if(a.activeTarget){
- a.activeTarget.style.zIndex=10000
- }
- a.activeTarget=ab;
- a.activeTarget.style.zIndex=10001;
- if(a.configuratorLastState&&a.configuratorLastState=="docked"){
- var w=a.$("west-handler-"+a.target);
- a.clickViewport(Y,w);
- return
- }
- }
- var J="Search property or function";
- if(a.isVML||a.disableConfigurator||(this.isIE&&this.browserVersion<9)){
- return
- }
- a.configuringOn=true;
- if(M){
- if(a.isArray(M)){
- M=M[0]
- }
- if(a.graphType=="Network"){
- a.configuringNetwork=M;
- if(a.data.nodes.length>M){
- J="Configure "+(a.data.nodes[M].label||a.data.nodes[M].name||a.data.nodes[M].id)
- }else{
- var t=a.data.edges[M-a.data.nodes.length];
- var D=a.data.nodes[a.data.nodeIndices[t.id1]];
- var B=a.data.nodes[a.data.nodeIndices[t.id2]];
- J="Configure "+(D.label||D.name||D.id)+" - "+(B.label||D.name||B.id)
- }
- }else{
- if(a.graphType=="Genome"){
- a.configuringGenome=M;
- J="Configure track "+M
- }
- }
- }
-var af=G!=null&&F!=null?{
- x:G,
- y:F
-}:a.adjustedCoordinates(Y);
-if(af){
- G=a.applicationLook||a.configuratorLastState=="docked"?0:af.x;
- F=a.applicationLook||a.configuratorLastState=="docked"?0:af.y;
- var ab=a.$cX("div",{
- id:a.target+"-cX-Configurator",
- className:a.applicationLook?"CanvasXpressConfigurator fixed":"CanvasXpressConfigurator draggable"
- },{
- cursor:"move",
- left:G+"px",
- top:F+"px",
- padding:"10px",
- position:"absolute",
- zIndex:10001
- });
- var V=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorKeyText"
- },{
- display:"block",
- marginBottom:"5px",
- width:a.configuratorWidth+"px"
- });
- var W=a.$cX("span",{
- id:a.target+"-cX-ConfiguratorKeyTextSpan",
- className:"CanvasXpressConfigurator",
- innerHTML:J
- });
- var aa=a.$cX("img",{
- id:a.target+"-cX-ConfiguratorKeyAdvanced",
- className:"CanvasXpressConfigurator",
- src:a.showAdvancedConfiguration?a.imageDir+"lightbulb.png":a.imageDir+"lightbulb_off.png",
- alt:a.showAdvancedConfiguration?"Show basic configuaration properties":"Show advanced configuaration properties",
- title:a.showAdvancedConfiguration?"Show basic configuaration properties":"Show advanced configuaration properties"
- });
- var X=a.$cX("img",{
- id:a.target+"-cX-ConfiguratorKeySearch",
- className:"CanvasXpressConfigurator",
- src:a.imageDir+"find.png",
- alt:"Browse properties by category",
- title:"Browse properties by category"
- });
- var ah=a.$cX("img",{
- id:a.target+"-cX-ConfiguratorKeyDock",
- className:"CanvasXpressConfigurator",
- src:a.applicationLook?a.imageDir+"unpin.png":a.imageDir+"pin.png",
- alt:a.applicationLook?"Undock":"Dock",
- title:a.applicationLook?"Undock":"Dock",
- state:a.applicationLook?"docked":"free"
- });
- var T=a.$cX("img",{
- id:a.target+"-cX-ConfiguratorKeyClose",
- className:"CanvasXpressConfigurator",
- src:a.imageDir+"cancel1.png",
- alt:"Close",
- title:"Close"
- });
- var U=a.$cX("input",{
- id:a.target+"-cX-ConfiguratorKey",
- className:"CanvasXpressConfigurator",
- type:"text"
- },{
- display:"block",
- width:a.configuratorWidth+"px"
- });
- var S=a.$cX("select",{
- id:a.target+"-cX-ConfiguratorCategories",
- className:"CanvasXpressConfigurator",
- size:5
- },{
- display:"none",
- width:a.configuratorWidth+"px"
- });
- var L=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorSugestionsText",
- innerHTML:"Select property"
- },{
- display:"none",
- margin:"5px 0px 5px 0px",
- width:a.configuratorWidth+"px"
- });
- var K=a.$cX("select",{
- id:a.target+"-cX-ConfiguratorSugestions",
- className:"CanvasXpressConfigurator",
- size:a.mobileApp?5:10
- },{
- display:"none",
- width:a.configuratorWidth+"px"
- });
- var Z=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorSugestionsDescription"
- },{
- display:"none",
- margin:"5px 0px 5px 0px",
- width:a.configuratorWidth+"px",
- minHeight:"56px",
- overflow:"auto"
- });
- var I=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorValueText",
- innerHTML:"Current value"
- },{
- display:"none",
- margin:"5px 0px 5px 0px",
- width:a.configuratorWidth+"px"
- });
- var ag=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorSeeAlso"
- },{
- display:"none",
- width:a.configuratorWidth+"px",
- minHeight:"20px",
- overflow:"auto"
- });
- var H=a.$cX("input",{
- id:a.target+"-cX-ConfiguratorValue",
- className:"CanvasXpressConfigurator",
- type:"text"
- },{
- display:"none",
- width:a.configuratorWidth+"px"
- });
- var A=a.$cX("input",{
- id:a.target+"-cX-ConfiguratorApply",
- value:"Apply",
- type:"button"
- },{
- display:"none",
- cssFloat:"left",
- borderRadius:"5px",
- width:(a.configuratorWidth/2)+"px"
- });
- var ae=a.$cX("input",{
- id:a.target+"-cX-ConfiguratorButton",
- value:"Draw",
- type:"button"
- },{
- display:"none",
- cssFloat:"left",
- borderRadius:"5px",
- width:(a.configuratorWidth/2)+"px"
- });
- var N=a.$cX("img",{
- id:a.target+"-cX-ConfiguratorOptionsClose",
- className:"CanvasXpressConfigurator",
- src:a.imageDir+"cancel1.png",
- alt:"Close",
- title:"Close"
- });
- var C=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorOptions",
- className:"CanvasXpressConfigurator draggable"
- },{
- cursor:"move",
- display:"none",
- padding:"10px",
- position:"absolute"
- });
- var Q=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorColorCurrent",
- className:"CanvasXpressConfiguratorColor"
- },{
- width:"181px",
- height:"16px",
- cssFloat:"left",
- cursor:"default"
- });
- var P=a.$cX("img",{
- id:a.target+"-cX-ConfiguratorColorClose",
- className:"CanvasXpressConfigurator",
- src:a.imageDir+"cancel1.png",
- alt:"Close",
- title:"Close"
- });
- var R=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorColor",
- className:"CanvasXpressConfigurator draggable"
- },{
- width:"204px",
- cursor:"move",
- display:"none",
- padding:"10px",
- position:"absolute"
- });
- var E=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorFilter",
- className:"CanvasXpressConfiguratorFilter draggable",
- innerHTML:'Build filter ("+" to set "-" to remove)'
- },{
- cursor:"move",
- display:"none",
- padding:"10px",
- position:"absolute"
- });
- var O=a.$cX("img",{
- id:a.target+"-cX-ConfiguratorFilterClose",
- className:"CanvasXpressConfigurator",
- src:a.imageDir+"cancel1.png",
- alt:"Close",
- title:"Close"
- });
- V.appendChild(W);
- V.appendChild(T);
- V.appendChild(ah);
- V.appendChild(aa);
- V.appendChild(X);
- C.appendChild(document.createTextNode("Select option ..."));
- C.appendChild(N);
- C.appendChild(a.$cX("br"));
- R.appendChild(Q);
- R.appendChild(P);
- R.appendChild(a.$cX("br"));
- E.appendChild(O);
- E.appendChild(a.$cX("br"));
- ab.appendChild(V);
- ab.appendChild(U);
- ab.appendChild(S);
- ab.appendChild(L);
- ab.appendChild(K);
- ab.appendChild(Z);
- ab.appendChild(ag);
- ab.appendChild(I);
- ab.appendChild(H);
- ab.appendChild(A);
- ab.appendChild(ae);
- ab.appendChild(C);
- ab.appendChild(R);
- ab.appendChild(E);
- var h=a.$("west-wrapper-"+a.target);
- if(h){
- h.appendChild(ab);
- if(a.activeTarget){
- a.activeTarget.style.zIndex=10000
- }
- a.activeTarget=ab;
- a.addRemoveConfiguratorListeners("addEvtListener");
- if(a.configuringNetwork||a.configuringGenome){
- a.selectConfig(false,true)
- }
- setTimeout(function(){
- U.focus()
- },300)
- }
- }
-}
-}(this);
-this.addRemoveConfiguratorListeners=function(A){
- var r=this.$(this.target+"-cX-Configurator");
- var h=this.$(this.target+"-cX-ConfiguratorCategories");
- var B=this.$(this.target+"-cX-ConfiguratorSugestions");
- var v=this.$(this.target+"-cX-ConfiguratorApply");
- var u=this.$(this.target+"-cX-ConfiguratorButton");
- var j=this.$(this.target+"-cX-ConfiguratorKeyClose");
- var y=this.$(this.target+"-cX-ConfiguratorKeyDock");
- var x=this.$(this.target+"-cX-ConfiguratorKeyAdvanced");
- var k=this.$(this.target+"-cX-ConfiguratorKeySearch");
- var o=this.$(this.target+"-cX-ConfiguratorOptions");
- var a=this.$(this.target+"-cX-ConfiguratorOptionsClose");
- var g=this.$(this.target+"-cX-ConfiguratorColor");
- var d=this.$(this.target+"-cX-ConfiguratorColorClose");
- var w=this.$(this.target+"-cX-ConfiguratorFilter");
- var e=this.$(this.target+"-cX-ConfiguratorFilterClose");
- if(r&&h&&B&&u&&v&&j&&y&&x&&k&&o&&a&&g&&d&&w&&e){
- this[A](r,"mousedown",this.registerMousemove,false);
- this[A](h,"change",this.changeCategory,false);
- this[A](h,"click",this.changeCategory,false);
- this[A](B,"change",this.clickSuggestions,false);
- this[A](B,"click",this.clickSuggestions,false);
- this[A](v,"click",this.clickApplyConfigurator,false);
- this[A](u,"click",this.clickConfigurator,false);
- this[A](k,"click",this.clickSearch,false);
- this[A](x,"click",this.clickAdvanced,false);
- this[A](y,"click",this.clickDockUndockConfigurator,false);
- this[A](j,"click",this.closeConfigurator,false);
- this[A](o,"mousedown",this.registerMousemove,false);
- this[A](a,"click",this.closePropertyOptions,false);
- this[A](g,"mousedown",this.registerMousemove,false);
- this[A](d,"click",this.closePropertyColor,false);
- this[A](w,"mousedown",this.registerMousemove,false);
- this[A](e,"click",this.closePropertyFilter,false)
- }
- };
-
-this.getConfigurableProperties=function(){
- if(this.configuringNetwork){
- if(this.data.nodes.length>this.configuringNetwork){
- return this.getNodeConfigurableProperties(this.configuringNetwork)
- }else{
- return this.getEdgeConfigurableProperties(this.configuringNetwork-this.data.nodes.length)
- }
- }else{
- if(this.configuringGenome){
- if(!isNaN(this.configuringGenome)||this.configuringGenome.match(/:/)){
- return this.featureConfigurableProperties
- }else{
- if(this.configuringGenome.match(/track/)){
- return this.trackConfigurableProperties
- }else{
- this.configuringGenome=false
- }
- }
- }
-}
-var d=[];
-for(var c in CanvasXpress.doc.P){
- var a=CanvasXpress.doc.P[c].M;
- var b=CanvasXpress.doc.P[c].U;
- if(CanvasXpress.doc.M[a].U){
- if(CanvasXpress.doc.M[a].U.hasOwnProperty(this.graphType)){
- if(this.showAdvancedConfiguration){
- d.push(c)
- }else{
- if(!CanvasXpress.doc.P[c].A){
- d.push(c)
- }
- }
- }
-}else{
- if(this.showAdvancedConfiguration){
- if(b){
- if(b.hasOwnProperty(this.graphType)){
- d.push(c)
- }
- }else{
- d.push(c)
- }
- }else{
- if(!CanvasXpress.doc.P[c].A){
- if(b){
- if(b.hasOwnProperty(this.graphType)){
- d.push(c)
- }else{
- d.push(c)
- }
- }
- }
-}
-}
-}
-return d
-};
-
-this.getConfigurableObjectDoc=function(a){
- if(this.configuringNetwork){
- if(this.data.nodes.length>this.configuringNetwork){
- return CanvasXpress.doc.N[a]?CanvasXpress.doc.N[a]:false
- }else{
- return CanvasXpress.doc.E[a]?CanvasXpress.doc.E[a]:false
- }
- }else{
- if(this.configuringGenome){
- if(!isNaN(this.configuringGenome)||this.configuringGenome.match(/:/)){
- return CanvasXpress.doc.F[a]?CanvasXpress.doc.F[a]:false
- }else{
- if(this.configuringGenome.match(/track/)){
- return CanvasXpress.doc.G[a]?CanvasXpress.doc.G[a]:false
- }else{
- this.configuringGenome=false;
- return CanvasXpress.doc.P[a]?CanvasXpress.doc.P[a]:false
- }
- }
- }else{
- return CanvasXpress.doc.P[a]?CanvasXpress.doc.P[a]:false
- }
-}
-};
-
-this.selectConfig=function(D,F){
- var z=this.$(this.target+"-cX-ConfiguratorKey");
- var q=this.$(this.target+"-cX-ConfiguratorSugestionsText");
- var n=this.$(this.target+"-cX-ConfiguratorSugestions");
- var E=this.$(this.target+"-cX-ConfiguratorSugestionsDescription");
- var l=this.$(this.target+"-cX-ConfiguratorValueText");
- var H=this.$(this.target+"-cX-ConfiguratorSeeAlso");
- var j=this.$(this.target+"-cX-ConfiguratorValue");
- var f=this.$(this.target+"-cX-ConfiguratorApply");
- var G=this.$(this.target+"-cX-ConfiguratorButton");
- var B=this.$(this.target+"-cX-ConfiguratorValueHREF");
- var m=document.activeElement;
- var y=this.getConfigurableProperties();
- var w=[];
- if(this.getKeyCode(D)==13){
- this.resetOptionColorFilters();
- if(this.editingDescriptionOn){
- this.submitEditPropertyDescription()
- }else{
- if(n&&j&&j.value){
- var g=false;
- for(var A=0;A=0){
- w.push(y[A])
- }
- }
- if(w.length>0&&q&&n&&E&&l&&H&&j&&G&&f){
- this.resetSugestions();
- if(!this.configuringNetwork&&!this.configuringGenome){
- w.sort(function(d,c){
- return CanvasXpress.doc.P[d].M>CanvasXpress.doc.P[c].M?1:CanvasXpress.doc.P[c].M>CanvasXpress.doc.P[d].M?-1:d>c?1:c>d?-1:0
- });
- for(var A=0;A=1){
- a.removeChild(a.firstChild)
- }
- }
- a.style.display="none"
- }
-};
-
-this.clickSuggestions=function(a){
- return function(b){
- if(!b){
- b=window.event
- }
- a.resetEditOptionColorFilters();
- a.setConfiguratorPropertyValue();
- return false
- }
- }(this);
-this.setConfiguratorPropertyValue=function(l,e,j,g,h){
- if(!l){
- l=this.$(this.target+"-cX-ConfiguratorSugestions")
- }
- if(!e){
- e=this.$(this.target+"-cX-ConfiguratorSugestionsDescription")
- }
- if(!j){
- j=this.$(this.target+"-cX-ConfiguratorValueText")
- }
- if(!g){
- g=this.$(this.target+"-cX-ConfiguratorSeeAlso")
- }
- if(!h){
- h=this.$(this.target+"-cX-ConfiguratorValue")
- }
- var k;
- var f=this.$(this.target+"-cX-ConfiguratorOptions");
- var c=this.getConfigurableObjectDoc(l.value);
- h.value="";
- h.style.readonly=false;
- if(this.configuringNetwork){
- if(typeof(this[l.value])=="function"){
- h.style.disabled="disabled";
- h.style.readonly=false
- }else{
- if(this.configuringNetwork=1){
- a.removeChild(a.firstChild)
- }
- }
- a.style.display="none"
- }
-};
-
-this.addPropertyDescription=function(l,g,f){
- var n=g&&g.C?g.C:"";
- var h=g&&g.M?g.M:"";
- this.resetPropertyDescription(l);
- var k=this.$cX("img",{
- id:this.target+"-cX-ConfiguratorSugestionsDescriptionEdit",
- src:this.imageDir+"pencil.png",
- alt:"Edit description",
- title:"Edit description"
- },{
- cursor:"default",
- margin:"2px",
- width:"10px",
- height:"10px"
- });
- var a=this.$cX("i",{
- innerHTML:f
- });
- var t=this.$cX("span",{
- id:this.target+"-cX-ConfiguratorSugestionsDescriptionEditSpan",
- className:"CanvasXpressConfigurator",
- prop:f,
- innerHTML:" : "+n
- });
- var j=this.$cX("i",{
- innerHTML:h
- });
- var r=this.$cX("span",false,{
- className:"CanvasXpressConfigurator"
- });
- r.appendChild(document.createTextNode("Description [ "));
- r.appendChild(j);
- r.appendChild(document.createTextNode(" ]"));
- l.appendChild(r);
- l.appendChild(this.$cX("br"));
- l.appendChild(a);
- l.appendChild(t);
- l.appendChild(k);
- this.addEvtListener(k,"click",this.clickEditPropertyDescription,false)
- };
-
-this.resetPropertyDescription=function(b,a){
- if(!b){
- b=this.$(this.target+"-cX-ConfiguratorSugestionsDescription")
- }
- if(!a){
- a=this.$(this.target+"-cX-ConfiguratorSugestionsDescriptionEdit")
- }
- if(b&&a){
- this.removeEvtListener(a,"click",this.clickEditPropertyDescription,false);
- while(b.childNodes.length>0){
- var f=b.childNodes[0];
- b.removeChild(f)
- }
- }
-};
-
-this.clickEditPropertyDescription=function(a){
- return function(h){
- if(!h){
- h=window.event
- }
- a.resetPropertyColor();
- a.resetPropertyFilter();
- var f=a.$(a.target+"-cX-Configurator");
- var g=a.$(a.target+"-cX-ConfiguratorSugestions");
- var u=a.$(a.target+"-cX-ConfiguratorSugestionsDescriptionEditSpan");
- var m=a.$(a.target+"-cX-ConfiguratorOptions");
- if(f&&g&&u&&m){
- m.style.display="none";
- var t=a.adjustedCoordinates(h,g);
- if(t){
- a.editingDescriptionOn=true;
- var r=t.x;
- var o=t.y;
- var j=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorEditForm",
- className:"CanvasXpressConfigurator draggable"
- },{
- cursor:"move",
- left:r+"px",
- top:o+"px",
- padding:"10px",
- position:"absolute",
- width:(a.configuratorWidth*0.8)+"px"
- });
- var l=a.$cX("img",{
- id:a.target+"-cX-ConfiguratorEditFormClose",
- className:"CanvasXpressConfigurator",
- src:a.imageDir+"cancel1.png",
- alt:"Close",
- title:"Close"
- });
- var q=a.$cX("textarea",{
- id:a.target+"-cX-ConfiguratorEditFormValue",
- className:"CanvasXpressConfigurator",
- value:u.prop+u.innerHTML,
- rows:10
- },{
- width:"100%",
- maxWidth:(a.configuratorWidth*0.8)+"px"
- });
- var n=a.$cX("input",{
- id:a.target+"-cX-ConfiguratorEditFormButton",
- value:"Submit",
- type:"button"
- },{
- width:"100%",
- borderRadius:"5px",
- maxWidth:(a.configuratorWidth*0.8)+"px"
- });
- j.appendChild(document.createTextNode("Editing "+g.value));
- j.appendChild(l);
- j.appendChild(a.$cX("br"));
- j.appendChild(q);
- j.appendChild(n);
- a.addEvtListener(l,"click",a.closeEditPropertyDescription,false);
- a.addEvtListener(n,"click",a.submitEditPropertyDescription,false);
- f.appendChild(j)
- }
- }
- }
-}(this);
-this.submitEditPropertyDescription=function(a){
- return function(f){
- if(!f){
- f=window.event
- }
- var c=a.$(a.target+"-cX-ConfiguratorSugestions");
- var b=a.$(a.target+"-cX-ConfiguratorEditFormValue");
- var d=a.$(a.target+"-cX-ConfiguratorSugestionsDescriptionEditSpan");
- if(c&&b&&d){
- b.value=b.value.replace(/\n/g,"");
- CanvasXpress.doc.P[c.value].C=b.value;
- d.innerHTML=b.value;
- alert("New description for:\n - "+c.value+" -\nwas submitted and may apppear\nin new versions of CanvasXpress\nThank you for your contribution")
- }
- a.resetEditPropertyDescription()
- }
- }(this);
-this.closeEditPropertyDescription=function(a){
- return function(b){
- if(!b){
- b=window.event
- }
- a.resetEditPropertyDescription()
- }
- }(this);
-this.resetEditPropertyDescription=function(){
- var e=this.$(this.target+"-cX-ConfiguratorEditForm");
- var f=this.$(this.target+"-cX-ConfiguratorEditFormClose");
- var a=this.$(this.target+"-cX-ConfiguratorEditFormButton");
- if(e&&f&&a){
- this.addEvtListener(f,"click",this.closeEditPropertyDescription,false);
- this.addEvtListener(a,"click",this.submitEditPropertyDescription,false);
- e.parentNode.removeChild(e)
- }
- this.editingDescriptionOn=false
- };
-
-this.addPropertySeeAlsoLinks=function(e,g){
- this.resetPropertySeeAlsoLinks(e);
- var d=this.$cX("span",false,{
- className:"CanvasXpressConfigurator"
- });
- d.appendChild(document.createTextNode("See Also: "));
- e.appendChild(d);
- if(g&&g.S){
- for(var f=0;f0){
- var d=b.childNodes[0];
- if(d.nodeName.toLowerCase()=="a"){
- this.removeEvtListener(d,"click",this.clickPropertySeeAlsoLinks,false)
- }
- b.removeChild(d)
- }
- }
-};
-
-this.addPropertyOptions=function(w,p,f,g,s){
- this.resetPropertyOptions(w,p);
- var q=this.$cX("span",false,{
- className:"CanvasXpressConfigurator"
- });
- var l=this.$cX("i");
- q.appendChild(document.createTextNode("Current value"));
- if(f&&f.T&&(f.T=="option"||f.T=="array"||f.T=="boolean")){
- var x=this.$cX("div",{
- id:this.target+"-cX-ConfiguratorOptionsContainer",
- className:"CanvasXpressConfiguratorOptions"
- });
- var r=this.$cX("a",{
- href:"javascript:void(0)",
- innerHTML:f.T
- });
- this.addEvtListener(r,"click",this.clickPropertyOptions,false);
- q.appendChild(document.createTextNode(" ["));
- l.appendChild(r);
- q.appendChild(document.createTextNode(" "));
- q.appendChild(l);
- q.appendChild(document.createTextNode(" ]"));
- if(f.T=="array"){
- var n=f.X?this[f.X]():f.O?f.O:[];
- var m=this.getObjectArray(s);
- if(n.length>0){
- for(var h=0;h0){
- var f=a.childNodes[0];
- if(f.nodeName.toLowerCase()=="a"){
- this.removeEvtListener(f,"click",this.clickPropertyOptions,false)
- }
- a.removeChild(f)
- }
- }
- if(e){
- var d=this.$(this.target+"-cX-ConfiguratorOptionsContainer");
- if(d){
- while(d.childNodes.length>0){
- var f=d.childNodes[0];
- if(f.nodeName.toLowerCase()=="a"){
- this.removeEvtListener(f,"click",this.updatePropertyValue,false)
- }else{
- if(f.nodeName.toLowerCase()=="input"&&f.type=="checkbox"){
- this.removeEvtListener(f,"change",this.updatePropertyValue,false)
- }
- }
- d.removeChild(f)
- }
- e.removeChild(d)
- }
- e.style.display="none"
-}
-};
-
-this.addPropertyFilter=function(a){
- return function(d){
- if(!d){
- d=window.event
- }
- a.resetEditPropertyDescription();
- var b=d.target||d.srcElement;
- var c=a.$(a.target+"-cX-ConfiguratorFilter");
- a.addAllPropertyFilters(b.name,b.opts);
- c.style.display="block";
- c.opts=b.opts;
- c.style.left=d.layerX+"px";
- c.style.top=d.layerY+"px"
- }
- }(this);
-this.addAllPropertyFilters=function(c,d){
- var b=this.$(this.target+"-cX-ConfiguratorFilter");
- for(var a=0;a0&&a[r][l]!=null){
- a[r][l]=j;
- a[r+"Op"][l]=f;
- a[r+"Value"][l]=u;
- a[r+"Case"][l]=s
- }else{
- a[r].push(j);
- a[r+"Op"].push(f);
- a[r+"Value"].push(u);
- a[r+"Case"].push(s);
- a.insertPropertyFilterRow(false,l+1,r)
- }
- t.value='["'+a[r].join('", "')+'"]';
- n.style.display="block";
- m.style.display="none"
- }
- }
- }
-}(this);
-this.removePropertyFilterRow=function(a){
- return function(k){
- if(!k){
- k=window.event
- }
- var d=k.target||k.srcElement;
- var j=d.parentNode;
- var h=j.parentNode;
- var l=d.param;
- var f=d.idx;
- var b=a.$(a.target+"-cX-ConfiguratorValue");
- if(j&&l&&f!=null&&b){
- a.resetFilters(l,f);
- a.resetPropertyFilter(true);
- a.addAllPropertyFilters(l,h.opts);
- b.value=a[l].length>0?'["'+a[l].join('", "')+'"]':"[]"
- }
- }
-}(this);
-this.unsetPropertyFilterRow=function(a){
- return function(m){
- if(!m){
- m=window.event
- }
- var p=[];
- var b=m.target||m.srcElement;
- var n=b.param;
- var f=b.idx;
- if(n&&f!=null){
- if(a[n].length>0&&a[n][f]){
- a[n][f]=false;
- a[n+"Op"][f]=false;
- a[n+"Value"][f]=false;
- a[n+"Case"][f]=false;
- for(var d=0;d0?'["'+p.join('", "')+'"]':"[]"
- }
- }
- }
-}
-}(this);
-this.closePropertyFilter=function(a){
- return function(b){
- if(!b){
- b=window.event
- }
- a.handleHideDiv(a.target+"-cX-ConfiguratorFilter");
- a.resetPropertyFilter()
- }
- }(this);
-this.resetPropertyFilter=function(a){
- var b=this.$(this.target+"-cX-ConfiguratorFilter");
- if(b){
- if(b&&b.childNodes){
- while(b.childNodes.length>3){
- var c=b.childNodes[3];
- this.removeEvtListener(c.childNodes[0],"click",this.removePropertyFilterRow,false);
- this.removeEvtListener(c.childNodes[1],"change",this.unsetPropertyFilterRow,false);
- this.removeEvtListener(c.childNodes[2],"change",this.unsetPropertyFilterRow,false);
- this.removeEvtListener(c.childNodes[4],"change",this.unsetPropertyFilterRow,false);
- this.removeEvtListener(c.childNodes[5],"change",this.unsetPropertyFilterRow,false);
- this.removeEvtListener(c.childNodes[8],"click",this.addPropertyFilterRow,false);
- b.removeChild(b.childNodes[3])
- }
- }
- if(!a){
- b.style.display="none"
- }
- }
-};
-
-this.addPropertyColor=function(a){
- return function(j){
- if(!j){
- j=window.event
- }
- a.resetEditPropertyDescription();
- var d=a.$(a.target+"-cX-ConfiguratorColor");
- var t=a.$(a.target+"-cX-ConfiguratorValue");
- if(d&&t){
- var g=t.value?a.rgbToHex(a.validateColor(t.value.replace(/[\'\"]/g,""))):a.foreground;
- a.colorRGBfromString(g);
- var r=Math.round(a.colorHSV[0]/6*180);
- var q=Math.round((1-a.colorHSV[1])*100);
- var m=Math.round((1-a.colorHSV[2])*100);
- var l=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorColorContainer"
- },{
- width:"210px",
- height:"101px",
- marginTop:"7px"
- });
- var b=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorColorPalette",
- className:"CanvasXpressConfiguratorColor"
- },{
- position:"relative",
- left:"0px",
- top:"0px",
- width:"181px",
- height:"101px",
- backgroundImage:"url('"+a.imageDir+"color.png')",
- backgroundRepeat:"no-repeat",
- cursor:"crosshair"
- });
- var o=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorColorPaletteCurrent"
- },{
- position:"relative",
- left:(r-7)+"px",
- top:(q-7)+"px",
- width:"195px",
- height:"115px",
- cursor:"crosshair",
- backgroundImage:"url('"+a.imageDir+"cross.gif')",
- backgroundRepeat:"no-repeat"
- });
- b.appendChild(o);
- var w=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorColorSaturation",
- className:"CanvasXpressConfiguratorColor"
- },{
- position:"relative",
- left:"188px",
- top:"-102px",
- width:"15px",
- height:"100px",
- border:"1px solid "+a.skinBorderColor,
- cursor:"crosshair"
- });
- for(var f=0;f<100;f+=4){
- var u=a.$cX("div",false,{
- height:"4px",
- position:"relative",
- left:"0px",
- cursor:"crosshair"
- });
- w.appendChild(u)
- }
- var k=a.$cX("div",{
- id:a.target+"-cX-ConfiguratorColorSaturationCurrent"
- },{
- position:"relative",
- left:"0px",
- top:(m-108)+"px",
- width:"29px",
- height:"115px",
- cursor:"crosshair",
- backgroundImage:"url('"+a.imageDir+"cross.gif')",
- backgroundRepeat:"no-repeat",
- overflow:"hidden"
- });
- w.appendChild(k);
- l.appendChild(b);
- l.appendChild(w);
- d.appendChild(l);
- a.colorizeSaturationColorDiv();
- a.addEvtListener(b,"mousedown",a.registerPalette,false);
- a.addEvtListener(w,"mousedown",a.registerSaturation,false);
- d.style.display="block";
- d.style.left=j.layerX+"px";
- d.style.top=j.layerY+"px"
- }
- return false
- }
- }(this);
-this.registerPalette=function(a){
- return function(b){
- if(!b){
- b=window.event
- }
- a.changingColorOn="palette";
- if(a.colorHSV[2]==0){
- a.colorFromHsv(null,null,1);
- var c=a.$(a.target+"-cX-ConfiguratorColorSaturationCurrent");
- if(c){
- c.style.top="-108px"
- }
- }
- a.updateColorValue(b);
- a.colorizeSaturationColorDiv();
- return false
- }
-}(this);
-this.registerSaturation=function(a){
- return function(b){
- if(!b){
- b=window.event
- }
- a.changingColorOn="saturation";
- a.updateColorValue(b);
- return false
- }
- }(this);
-this.updateColorValue=function(g){
- if(this.changingColorOn){
- if(this.changingColorOn=="palette"){
- var f=this.$(this.target+"-cX-ConfiguratorColorPalette");
- var b=this.$(this.target+"-cX-ConfiguratorColorPaletteCurrent");
- if(f&&b){
- var d=this.adjustedCoordinates(g,f);
- if(d){
- var a=Math.min(Math.max(0,d.x),181);
- var j=Math.min(Math.max(0,d.y),101);
- b.style.left=(a-7)+"px";
- b.style.top=(j-7)+"px";
- this.colorFromHsv(a*6/180,1-j/100,null);
- this.colorizeSaturationColorDiv()
- }
- }
- }else{
- var c=this.$(this.target+"-cX-ConfiguratorColorSaturation");
- var h=this.$(this.target+"-cX-ConfiguratorColorSaturationCurrent");
- if(c&&h){
- var d=this.adjustedCoordinates(g,c);
- if(d){
- var j=Math.min(Math.max(0,d.y),101);
- h.style.top=(j-108)+"px";
- this.colorFromHsv(null,null,1-j/100)
- }
- }
-}
-}
-};
-
-this.colorFromHsv=function(c,b,a){
- if(c!=null){
- this.colorHSV[0]=Math.min(Math.max(0,c),6)
- }
- if(b!=null){
- this.colorHSV[1]=Math.min(Math.max(0,b),1)
- }
- if(a!=null){
- this.colorHSV[2]=Math.min(Math.max(0,a),1)
- }
- this.colorRGB=this.hsvFromRgb(this.colorHSV[0],this.colorHSV[1],this.colorHSV[2]);
- this.colorizeCurrentColorDiv()
- };
-
-this.hsvFromRgb=function(e,d,b){
- if(e==null){
- return[b,b,b]
- }
- var c=Math.floor(e);
- var g=c%2?e-c:1-(e-c);
- var a=b*(1-d);
- var j=b*(1-d*g);
- switch(c){
- case 0:
- return[b,j,a];
- case 1:
- return[j,b,a];
- case 2:
- return[a,b,j];
- case 3:
- return[a,j,b];
- case 4:
- return[j,a,b];
- case 5:
- return[b,a,j];
- case 6:
- }
-};
-
-this.colorFromRgb=function(e,d,a){
- if(this.colorRGB){
- if(e!=null){
- this.colorRGB[0]=Math.min(Math.max(0,e),1)
- }
- if(d!=null){
- this.colorRGB[1]=Math.min(Math.max(0,d),1)
- }
- if(a!=null){
- this.colorRGB[2]=Math.min(Math.max(0,a),1)
- }
- var c=this.rgbFromHsv(this.colorRGB[0],this.colorRGB[1],this.colorRGB[2]);
- if(c[0]!=null){
- this.colorHSV[0]=c[0]
- }
- if(c[2]!=0){
- this.colorHSV[1]=c[1]
- }
- this.colorHSV[2]=c[2];
- this.colorizeCurrentColorDiv()
- }
- };
-
-this.rgbFromHsv=function(j,f,c){
- var k=Math.min(Math.min(j,f),c);
- var d=Math.max(Math.max(j,f),c);
- var a=d-k;
- if(a==0){
- return[null,0,d]
- }else{
- var e=j==k?3+(c-f)/a:(f==k?5+(j-c)/a:1+(f-j)/a);
- return[e==6?0:e,a/d,d]
- }
- };
-
-this.colorRGBToString=function(){
- if(this.colorRGB){
- return(256|Math.round(255*this.colorRGB[0])).toString(16).substr(1)+(256|Math.round(255*this.colorRGB[1])).toString(16).substr(1)+(256|Math.round(255*this.colorRGB[2])).toString(16).substr(1)
- }
- };
-
-this.colorRGBfromString=function(b){
- var a=b.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
- if(!a){
- return false
- }else{
- if(a[1].length===6){
- this.colorFromRgb(parseInt(a[1].substr(0,2),16)/255,parseInt(a[1].substr(2,2),16)/255,parseInt(a[1].substr(4,2),16)/255)
- }else{
- this.colorFromRgb(parseInt(a[1].charAt(0)+a[1].charAt(0),16)/255,parseInt(a[1].charAt(1)+a[1].charAt(1),16)/255,parseInt(a[1].charAt(2)+a[1].charAt(2),16)/255)
- }
- return true
- }
- };
-
-this.colorizeCurrentColorDiv=function(){
- var f=this.$(this.target+"-cX-ConfiguratorColorCurrent");
- var a=this.$(this.target+"-cX-ConfiguratorValue");
- var d=this.$(this.target+"-cX-ConfiguratorValueHREF");
- if(f&&a&&d){
- var e=this.colorRGBToString();
- var b=this.hexToRgb("#"+e);
- f.style.backgroundColor="#"+e;
- f.innerHTML=" "+b;
- a.value='"'+b+'"';
- d.style.color="#"+e
- }
- };
-
-this.colorizeSaturationColorDiv=function(){
- var b=function(m,k,c,j,h){
- return"rgb("+(m*(1-j/h)*100)+"%,"+(k*(1-j/h)*100)+"%,"+(c*(1-j/h)*100)+"%)"
- };
-
- var e=this.$(this.target+"-cX-ConfiguratorColorSaturation");
- if(e&&this.colorHSV){
- var f=e.childNodes;
- var a=this.hsvFromRgb(this.colorHSV[0],this.colorHSV[1],1);
- if(a){
- for(var d=0;d3){
- c.removeChild(c.childNodes[3])
- }
- this.removeEvtListener(b,"mousedown",this.registerPalette,false);
- this.removeEvtListener(a,"mousedown",this.registerSaturation,false)
- }
- c.style.display="none"
- }
- };
-
-this.updatePropertyValue=function(a){
- return function(h){
- if(!h){
- h=window.event
- }
- a.resetEditPropertyDescription();
- var f=a.$(a.target+"-cX-ConfiguratorValue");
- var j=a.$(a.target+"-cX-ConfiguratorOptions");
- var d=h.target||h.srcElement;
- if(d.nodeName.toLowerCase()=="input"){
- var b=[];
- for(var g=0;g0?'["'+b.join('", "')+'"]':"[]"
- }else{
- if(f&&j){
- if(d.innerHTML=="true"){
- f.value=d.innerHTML
- }else{
- if(d.innerHTML=="false"){
- f.value=d.innerHTML
- }else{
- if(d.innerHTML=="null"){
- f.value=d.innerHTML
- }else{
- f.value='"'+d.innerHTML+'"'
- }
- }
- }
- j.style.display="none"
- }
-}
-return false
-}
-}(this);
-this.clickApplyConfigurator=function(a){
- return function(b){
- return a.clickConfigurator(b,false,false,true)
- }
- }(this);
-this.clickConfigurator=function(a){
- return function(j,g,c,b){
- if(!j){
- j=window.event
- }
- if(!g){
- g=a.$(a.target+"-cX-ConfiguratorSugestions")
- }
- if(!c){
- c=a.$(a.target+"-cX-ConfiguratorValue")
- }
- if(g&&c){
- if(a.configuringNetwork){
- if(a.configuringNetwork0&&c&&c.value){
- var b=JSON.parse(c.value);
- a[g.value](b)
- }else{
- a[g.value]()
- }
- a.resetConfigurator();
- return false
- }else{
- a[g.value]=JSON.parse(c.value);
- a.userConfig[g.value]=a[g.value]
- }
- }
-}
-if(!b){
- a.resetConfigurator()
- }
- var h=g.value.match(/filter(.+)By/);
-if(h){
- a.reset();
- a.filterData()
- }
- a.draw()
-}
-return false
-}
-}(this);
-this.handleHideDiv=function(a){
- var b=this.$(a);
- if(b){
- b.style.display="none"
- }
- return false
- };
-
-this.resetOptionColorFilters=function(){
- this.resetPropertyOptions(false,false,true);
- this.resetPropertyColor();
- this.resetPropertyFilter()
- };
-
-this.resetEditOptionColorFilters=function(){
- this.resetEditPropertyDescription();
- this.resetPropertyOptions(false,false,true);
- this.resetPropertyFilter()
- };
-
-this.resetConfigurator=function(){
- if(this.configuringOn&&this.configuringOn!="docked"){
- this.resetEditOptionColorFilters();
- this.resetPropertyDescription();
- this.resetPropertySeeAlsoLinks();
- this.editingDescriptionOn=false;
- this.configuratorLastState=false;
- this.configuringOn=false;
- this.configuringNetwork=false;
- this.configuringGenome=false;
- this.addRemoveConfiguratorListeners("removeEvtListener");
- this.removeTarget(this.target+"-cX-Configurator")
- }
- }
-};
-
-CanvasXpress.prototype.initAcknowlegments=function(){
- this.addAcknowledgementDiv=function(){
- if(this.$(this.target+"canvasXpressAcknowledgementDiv")){
- this.setAcknowledgementVisibility();
- return
- }
- var f=document.createElement("div");
- f.id=this.target+"canvasXpressAcknowledgementDiv";
- f.style.display=this.acknowledgment?"block":"none";
- f.style.width=this.width+"px";
- f.style.cssFloat="left";
- f.style.position="relative";
- f.style.zIndex=9999;
- this.setAcknowledgementPosition(f);
- var c=document.createElement("img");
- c.src=this.imageDir+this.acknowledgementIcon;
- c.style.margin="2px";
- c.alt="Graphs powered by canvasXpress";
- c.title="Graphs powered by canvasXpress";
- c.style.cssFloat="right";
- var b=document.createElement("a");
- b.href="http://canvasxpress.org";
- b.target="_blank";
- b.style.cssFloat="right";
- b.appendChild(c);
- f.appendChild(b);
- var e=this.$("south-wrapper-"+this.target);
- if(e){
- e.appendChild(f)
- }
- };
-
-this.resizeAcknowledgementDiv=function(){
- var b=this.$(this.target+"canvasXpressAcknowledgementDiv");
- if(b){
- b.style.width=this.width+"px"
- }
- };
-
-this.setAcknowledgementVisibility=function(){
- var b=this.$(this.target+"canvasXpressAcknowledgementDiv");
- if(b){
- b.style.display=this.acknowledgment?"block":"none";
- this.setAcknowledgementPosition(b)
- }
- };
-
-this.setAcknowledgementPosition=function(b){
- if(b){
- if(this.acknowledgementIconPosition=="inside"){
- b.style.top=this.citation?(((this.citationFontSize*this.citationScaleFontFactor)+36)*-1)+"px":"-31px";
- b.style.right="3px"
- }else{
- b.style.top="0px";
- b.style.right="0px"
- }
- }
-};
-
-this.addAcknowledgementDiv()
-};
-
-CanvasXpress.prototype.initCodeInfo=function(){
- this.addInfoCodeDiv=function(){
- if(this.$(this.target+"canvasXpressCode")){
- return
- }
- var a=document.createElement("div");
- a.id=this.target+"canvasXpressInfoDiv";
- a.style.display="none";
- a.style.fontFamily="arial,tahoma,sans-serif";
- a.style.fontSize="small";
- var e=document.createElement("div");
- e.id=this.target+"canvasXpressCode";
- e.style.display="none";
- e.style.fontFamily="arial,tahoma,sans-serif";
- e.style.fontSize="small";
- var d=this.$("north-wrapper-"+this.target);
- var b=this.$("south-wrapper-"+this.target);
- if(d){
- d.appendChild(a)
- }
- if(b){
- b.appendChild(e)
- }
- };
-
-this.clearCodeDiv=function(){
- var d=this.$(this.target+"canvasXpressCode");
- if(d){
- var b=d.childNodes;
- if(b){
- for(var a=0;a=",
- max:"<=",
- like:"like"
- };
-
- h[n].push(m!=null?i+":::"+m:i);
- h[n+"Op"].push(l[p]);
- h[n+"Case"].push(false);
- if(p=="like"){
- h[n+"Value"].push("^"+h.toDoFilter[k][i][p].join("$|^")+"$")
- }else{
- h[n+"Value"].push(h.toDoFilter[k][i][p])
- }
- };
-
-if(this.filteringStringOn||this.filteringNumericOn){
- this.resetFilters();
- var j=false;
- for(var f in this.toDoFilter){
- for(var b in this.toDoFilter[f]){
- for(var g in this.toDoFilter[f][b]){
- var c=this.toDoFilter[f][b]["ref"];
- if(g!="ref"){
- if(f=="sample"){
- a("filterSmpBy",f,g,b,c)
- }else{
- if(f=="variable"){
- a("filterVarBy",f,g,b,c)
- }else{
- if(f=="node"){
- a("filterNodeBy",f,g,b,c)
- }else{
- if(f=="edge"){
- a("filterEdgeBy",f,g,b,c)
- }else{
- if(f=="feature"){
- a("filterFeatureBy",f,g,b,c)
- }
- }
- }
- }
- }
- }
- }
- }
- }
-this.reset();
-this.filterData();
-if(this.graphType=="Network"&&this.filterFlashingOn){
- var d=[];
- for(var e=0;e0&&n>0){
- this.xMouseDown=m.clientX;
- i=Math.max(0,Math.min(q,i));
- n=Math.max(0,Math.min(q,n))
- }else{
- if(i>0){
- i-=r;
- n=(a.x-l.x)-14
- }else{
- n+=i;
- i=0
- }
- }
- var f=Math.min((b.units*i)+b.min,parseFloat(h.innerHTML));
- j.style.left=i+"px";
- b.style.left=i+"px";
- b.style.width=n+"px";
- p.style.left=i+"px";
- o.innerHTML=this.bestFormatNumber(f,b.decis)
- }else{
- var f=Math.max(Math.min((b.units*(i+n))+b.min,b.max),parseFloat(o.innerHTML));
- if(i+n<=q&&n>=0){
- this.xMouseDown=m.clientX;
- i=Math.max(0,Math.min(q,i));
- n=Math.max(0,Math.min(q-i,n))
- }else{
- if(i+n>q){
- i-=r;
- n=q-i
- }
- }
- b.style.width=n+"px";
- h.innerHTML=this.bestFormatNumber(f,b.decis)
- }
- var g=b.uvalue;
- var k=b.filter;
- if(o.innerHTML!=b.min.toString()||h.innerHTML!=b.max.toString()){
- if(!this.toDoFilter[k]){
- this.toDoFilter[k]={}
- }
- if(!this.toDoFilter[k][g]){
- this.toDoFilter[k][g]={}
- }
- if(o.innerHTML!=b.min.toString()){
- this.toDoFilter[k][g]["min"]=parseFloat(o.innerHTML)
- }
- if(h.innerHTML!=b.max.toString()){
- this.toDoFilter[k][g]["max"]=parseFloat(h.innerHTML)
- }
- if(b.ref!=null){
- this.toDoFilter[k][g]["ref"]=b.ref
- }
-}else{
- if(this.toDoFilter[k]&&this.toDoFilter[k][g]){
- delete this.toDoFilter[k][g]
- }
-}
-this.updateDataFilter()
-}
-}
-return false
-};
-
-this.endNumericFilter=function(a){
- if(this.filteringNumericOn){
- this.filteringNumericOn=false
- }
- };
-
-this.createStringFilter=function(A,n,z,c){
- z.sort();
- z.unshift("(All) "+z.length+" values");
- z.push("");
- var w=n.replace(/\W/g,"_");
- var x=this.$cX("div",{
- id:this.target+":"+w+":cX-DataFilterContainer",
- className:"CanvasXpressDataFilterContainerHoverable"
- });
- var h=this.$cX("div",{
- innerHTML:n
- },{
- width:"98%",
- margin:"5px"
- });
- var u=this.$cX("input",{
- id:this.target+":"+w+":cX-DataFilterInput",
- type:"text"
- },{
- cursor:"default",
- width:"98%",
- marginLeft:"3px"
- });
- var g=this.$cX("div",{
- id:this.target+":"+w+":cX-DataFilterMask",
- className:"CanvasXpressDataFilterContainerMask"
- },{
- width:"96%",
- height:"80px"
- });
- var B=this.$cX("div",{
- id:this.target+":"+w+":cX-DataFilterScroll",
- filter:A,
- uvalue:n,
- values:z,
- selected:{
- 0:true
- },
- ref:c,
- skey:w,
- last:0
- },{
- width:"96%",
- height:((z.length+1)*16)+"px"
- });
- var f=this.$cX("div",{
- id:this.target+":"+w+":cX-DataFilterOptions"
- },{
- width:"110%",
- margin:"2px",
- position:"relative"
- });
- for(var p=0;p30?z[p].substr(0,30)+" ...":z[p];
- var y=this.$cX("div",{
- id:this.target+":"+w+":cX-DataFilterItem-"+p,
- className:p==0?"CanvasXpressDataFilterContainerItemSelected":"CanvasXpressDataFilterContainerItem",
- innerHTML:b,
- alt:z[p],
- title:z[p],
- index:p
- });
- f.appendChild(y)
- }
- B.appendChild(f);
- g.appendChild(B);
- x.appendChild(h);
- x.appendChild(u);
- x.appendChild(g);
- this.addRemoveStringDataFilterListeners("addEvtListener",g);
- return x
- };
-
-this.addRemoveStringDataFilterListeners=function(b,a){
- if(b&&a){
- this[b](a,"scroll",this.scrollStringFilter,false);
- this[b](a,"mousedown",this.registerStringFilter,false);
- this[b](a,"mouseup",this.endStringFilter,false)
- }
- };
-
-this.scrollStringFilter=function(a){
- return function(l,j){
- if(!l){
- l=window.event
- }
- if(!j){
- j=this
- }
- var h=j.firstChild;
- var n=h.firstChild;
- var f=h.skey;
- var c=Math.max(0,Math.min(Math.floor(j.scrollTop/16),h.values.length-5));
- n.style.top=j.scrollTop+"px";
- for(var g=0;g30?h.values[c+g].substr(0,30)+" ...":h.values[c+g];
- m.className=h.selected[c+g]?"CanvasXpressDataFilterContainerItemSelected":"CanvasXpressDataFilterContainerItem";
- m.innerHTML=j;
- m.alt=h.values[c+g];
- m.title=h.values[c+g];
- m.index=c+g
- }
- }
- if(a.filteringStringOn){
- a.updateSelectStringFilter(false,a.$(a.target+":"+f+":cX-DataFilterItem-4"),true)
- }
- return false
- }
-}(this);
-this.registerStringFilter=function(a){
- return function(c){
- if(!c){
- c=window.event
- }
- var b=a.getTargetEvent(c);
- if(!b.id.match(/cX-DataFilterMask/)){
- a.$(b.parentNode.id.replace("cX-DataFilterOptions","cX-DataFilterInput")).value="";
- a.updateSelectStringFilter(false,b,c.shiftKey,c.ctrlKey);
- a.filteringStringOn=b
- }
- return false
- }
- }(this);
-this.endStringFilter=function(a){
- return function(k,l){
- if(!k){
- k=window.event
- }
- if(!l&&a.filteringStringOn){
- l=a.filteringStringOn.parentNode.parentNode
- }
- if(!l){
- return
- }
- var g=l.selected;
- var j=l.filter;
- var c=l.uvalue;
- var h=l.ref;
- var b=l.values;
- if(!g[0]){
- if(!a.toDoFilter[j]){
- a.toDoFilter[j]={}
- }
- if(!a.toDoFilter[j][c]){
- a.toDoFilter[j][c]={
- like:[]
- }
- }
- a.toDoFilter[j][c]["like"]=[];
- for(var d in g){
- a.toDoFilter[j][c]["like"].push(b[d])
- }
- if(h!=null){
- a.toDoFilter[j][c]["ref"]=h
- }
- }else{
- if(a.toDoFilter[j]&&a.toDoFilter[j][c]){
- delete a.toDoFilter[j][c]
- }
-}
-a.filteringStringOn=true;
-a.updateDataFilter();
-a.filteringStringOn=false;
-return false
-}
-}(this);
-this.updateStringFilter=function(b){
- var a=this.getTargetEvent(b);
- var c=this.filteringStringOn?this.filteringStringOn.id.replace(/-\d$/,""):"";
- if(a.id.match(c)){
- this.updateSelectStringFilter(false,a,true)
- }
- };
-
-this.updateSelectStringFilter=function(y,A,g,a){
- if(y){
- var t=this.$(y);
- var d=this.$(y.replace("cX-DataFilterInput","cX-DataFilterScroll"));
- if(t.value){
- var j=0;
- var c=d.firstChild;
- var u=c.childNodes[0].index;
- var r=null;
- var B=0;
- d.selected={};
-
- for(var m=1;mk){
- for(var m=k;m<=w;m++){
- B.selected[m]=true;
- j++
- }
- }else{
- for(var m=w;m<=k;m++){
- B.selected[m]=true;
- j++
- }
- }
- }else{
- if(a){
- B.last=w;
- for(var m in q){
- B.selected[m]=true;
- j++
- }
- }else{
- B.last=w
- }
-}
-if(j>0){
- delete B.selected[0]
-}
-delete B.selected[z.length-1];
-for(var m=0;mb){
- this.initialMaxRows=this.maxRows;
- this.maxRows=b
- }
- if(this.maxCols>p){
- this.initialMaxCols=this.maxCols;
- this.maxCols=p
- }
- if(this.totalRows==null||this.totalCols==null){
- this.totalRows=b;
- this.totalCols=p
- }else{
- if(k||b!=this.totalRows||p!=this.totalCols||w[0]!=this.maxRows||w[1]!=this.maxCols||w[2]!=this.rowHeight||w[3]!=this.colWidth){
- this.totalRows=b;
- this.totalCols=p;
- l=true
- }else{
- this.totalRows=b;
- this.totalCols=p;
- if(this.showDataTable){
- this.hideUnhideDataTable()
- }
- }
-}
-this.dataTableTotalHeight=10;
-for(var h=0;h0){
- for(var e=this.startCol;e>=0;e--){
- if(b+this.dataTableColumnWidth[e]+8this.dataTableTotalWidth){
- this.maxCols=(this.totalCols-this.startCol)
- }
- this.maxCols=Math.max(3,Math.min(this.maxCols,(this.totalCols-this.startCol)));
-var a=0;
-this.maxRows=0;
-for(var e=this.startRow;e0){
- for(var e=this.startRow;e>=0;e--){
- if(a+this.dataTableRowHeight[e]+4this.dataTableTotalHeight){
- this.totalRows=(this.totalRows-this.startRow)
- }
- this.maxRows=Math.max(3,Math.min(this.maxRows,(this.totalRows-this.startRow)));
-this.updateDataTable(false,true,false,true);
-d=this.$(this.target+"-cX-DataTableVer");
-f=this.$(this.target+"-cX-DataTableHor");
-if(d&&f){
- if(!this.isIE){
- d.scrollHeight=this.dataTableLastScrollHeight
- }
- d.scrollTop=this.dataTableLastScrollTop?this.dataTableLastScrollTop:d.scrollTop;
- if(!this.isIE){
- f.scrollWidth=this.dataTableLastScrollWidth
- }
- f.scrollLeft=this.dataTableLastScrollLeft?this.dataTableLastScrollLeft:f.scrollLeft
- }
- if(this.dataTableLastState=="docked"){
- this.resizeViewportSouth(true)
- }
-}
-};
-
-this.sortDataTable=function(){
- this.sortDir=this.sortDataTableHead.className=="CanvasXpressTableCellSortDesc"?"descending":"ascending";
- if(this.graphType=="Network"){
- if(this.dataTableTransposed){
- if(this.sortDataTableHead.type=="cxb"){
- this.sortDataTableHead.className="CanvasXpressTableCell";
- this.sortDataTableHead=false;
- return
- }else{
- this.sortNetworkIndices(this.sortDataTableHead.innerHTML)
- }
- }else{
- this.sortDataTableHead.className="CanvasXpressTableCell";
- this.sortDataTableHead=false;
- return
- }
-}else{
- if(this.graphType=="Genome"){
- this.sortDataTableHead.className="CanvasXpressTableCell";
- this.sortDataTableHead=false;
- return
- }else{
- if(this.graphType=="Venn"){
- this.sortDataTableHead.className="CanvasXpressTableCell";
- this.sortDataTableHead=false;
- return
- }else{
- if(this.graphType=="Correlation"){
- if(this.correlationAxis=="samples"){
- if(this.sortDataTableHead.type=="cxb"){
- this.sortSamples()
- }else{
- this.sortSamples(false,false,this.sortDataTableHead.innerHTML,"cor",true);
- this.sortDataTableHead.className="CanvasXpressTableCell";
- this.sortDataTableHead=false
- }
- }else{
- if(this.sortDataTableHead.type=="cxb"){
- this.sortVariables()
- }else{
- this.sortVariables(false,false,this.sortDataTableHead.innerHTML,"cor",true);
- this.sortDataTableHead.className="CanvasXpressTableCell";
- this.sortDataTableHead=false
- }
- }
- }else{
- if(this.graphType=="Candlestick"){
- this.sortDataTableHead.className="CanvasXpressTableCell";
- this.sortDataTableHead=false;
- return
- }else{
- if(this.data.y.vars&&this.data.y.smps){
- if(this.dataTableTransposed){
- if(this.sortDataTableHead.type=="cxx"){
- this.sortSamplesByCategory([this.sortDataTableHead.innerHTML])
- }else{
- if(this.sortDataTableHead.type=="cxv"){
- this.sortSamplesByVariable(this.sortDataTableHead.innerHTML)
- }else{
- if(this.sortDataTableHead.type=="cxb"){
- this.sortSamples()
- }
- }
- }
- }else{
- if(this.sortDataTableHead.type=="cxz"){
- this.sortVariablesByCategory([this.sortDataTableHead.innerHTML])
- }else{
- if(this.sortDataTableHead.type=="cxs"){
- this.sortVariablesBySample(this.sortDataTableHead.innerHTML)
- }else{
- if(this.sortDataTableHead.type=="cxb"){
- this.sortVariables()
- }
- }
- }
-}
-}
-}
-}
-}
-}
-}
-this.updateDataTable(false,true,false,false,true)
-};
-
-this.updateDataTable=function(D,K,M,E,C){
- var t=0;
- var p=0;
- var B=0;
- var y=0;
- var O=[];
- var P=[];
- var A=[];
- var z=[];
- var b=D?false:true;
- var h=function(g,k,d,q){
- if(k.hasOwnProperty(g)){
- return k[g]!=null?k[g]:""
- }else{
- if(d[0][g]&&d[0][g].hasOwnProperty("r")){
- var l=d[0][g]["r"];
- for(var f=0;f=this.startCol){
- A.push(I);
- z.push("cxx");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- for(var I=0;I=this.startRow){
- p=0;
- y=0;
- A=[I+1];
- z=["cxz"];
- for(var H in Q[0]){
- if(p=this.startCol){
- var x=h(H,D[this.networkShowDataTable][I],Q,this[this.networkShowDataTable+"Properties"]);
- A.push(x);
- z.push("cxy");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- t++
- }
- B++
- }
- }else{
- for(var I=0;I=this.startCol){
- A.push(I+1);
- z.push("cxz");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- for(var I in Q[0]){
- if(t=this.startRow){
- p=0;
- y=0;
- A=[I];
- z=["cxx"];
- for(var H=0;H=this.startCol){
- var x=h(I,D[this.networkShowDataTable][H],Q,this[this.networkShowDataTable+"Properties"]);
- A.push(x);
- z.push("cxy");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- t++
- }
- B++
- }
- }
- }else{
- if(this.graphType=="Genome"){
- O=[["Not implemented"]];
- P=[["cxb"]]
- }else{
- if(this.graphType=="Venn"){
- var x=this.getVennCompartments(D);
- A.push("");
- z.push("cxb");
- if(this.dataTableTransposed){
- A.push("No");
- z.push("cxz");
- O.push(A);
- P.push(z);
- for(var I in x[0]){
- if(t=this.startRow){
- p=0;
- y=0;
- A=[I];
- z=["cxx"];
- if(p=this.startCol){
- A.push(D.venn.data[I]);
- z.push("cxy");
- p++
- }
- y++;
- O.push(A);
- P.push(z);
- t++
- }
- B++
- }
- }else{
- for(var I in x[0]){
- if(p=this.startCol){
- A.push(I);
- z.push("cxx");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- if(t=this.startRow){
- p=0;
- y=0;
- A=["No"];
- z=["cxz"];
- for(var I in x[0]){
- if(p=this.startCol){
- A.push(D.venn.data[I]);
- z.push("cxy");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z)
- }
- }
- }else{
- if(this.graphType=="Correlation"){
- var w=this.correlationAxis=="samples"?D.y.smps:D.y.vars;
- var m=this.correlationAxis=="samples"?this.smpIndices:this.varIndices;
- var u=this.correlationAxis=="samples"?"cxs":"cxv";
- A.push("");
- z.push("cxb");
- for(var I=0;I=this.startCol){
- A.push(b?w[m[I]]:w[I]);
- z.push(u);
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- for(var I=0;I=this.startRow){
- p=0;
- y=0;
- A=[b?w[m[I]]:w[I]];
- z=[u];
- for(var H=0;H=this.startCol){
- if(D.y.cor){
- A.push(b?D.y.cor[m[I]][m[H]]:D.y.cor[I][H])
- }else{
- A.push(I==H?1:D.y.data)
- }
- z.push("cxy");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- t++
- }
- B++
- }
- }else{
- if(this.graphType=="Candlestick"){
- var Q=["open","low","high","close","volume"];
- A.push("");
- z.push("cxb");
- if(this.dataTableTransposed){
- for(var I=0;I=this.startCol){
- var F=D.y.vars.length>1?D.y.vars[I]+":"+Q[H]:Q[H];
- A.push(F);
- z.push("cxv");
- p++
- }
- y++
- }
- }
- O.push(A);
- P.push(z);
- for(var I=0;I=this.startRow){
- p=0;
- y=0;
- A=[D.y.smps[I]];
- z=["cxs"];
- for(var H=0;H=this.startCol){
- A.push(D.y[Q[G]][H][I]!=null?D.y[Q[G]][H][I]:D.y[Q[G]][I]);
- z.push("cxy");
- p++
- }
- y++
- }
- }
- O.push(A);
- P.push(z);
- t++
- }
- B++
- }
- }else{
- for(var I=0;I=this.startCol){
- A.push(D.y.smps[I]);
- z.push("cxs");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- for(var I=0;I=this.startRow){
- p=0;
- y=0;
- var F=D.y.vars.length>1?D.y.vars[I]+":"+Q[H]:Q[H];
- A=[F];
- z=["cxv"];
- for(var G=0;G=this.startCol){
- A.push(D.y[Q[H]][I][G]!=null?D.y[Q[H]][I][G]:D.y[Q[H]][G]);
- z.push("cxy");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- t++
- }
- B++
- }
- }
- }
-}else{
- if(D.y.vars&&D.y.smps){
- var N=b?this.varIndices.length:D.y.vars.length;
- var L=b?this.smpIndices.length:D.y.smps.length;
- A.push("");
- z.push("cxb");
- if(this.dataTableTransposed){
- if(D.x){
- for(var I in D.x){
- if(p=this.startCol){
- A.push(I);
- z.push("cxx");
- p++
- }
- y++
- }
- }
- for(var I=0;I=this.startCol){
- A.push(b?D.y.vars[this.varIndices[I]]:D.y.vars[I]);
- z.push("cxv");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- if(D.z){
- for(var I in D.z){
- if(t=this.startRow){
- p=0;
- y=0;
- A=[I];
- z=["cxz"];
- if(D.x){
- for(var H in D.x){
- if(p=this.startCol){
- A.push("");
- z.push("cxb");
- p++
- }
- y++
- }
- }
- for(var H=0;H=this.startCol){
- A.push(b?D.z[I][this.varIndices[H]]:D.z[I][H]);
- z.push("cxz");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- t++
- }
- B++
- }
- }
- for(var I=0;I=this.startRow){
- p=0;
- y=0;
- A=[b?D.y.smps[this.smpIndices[I]]:D.y.smps[I]];
- z=["cxs"];
- if(D.x){
- for(var H in D.x){
- if(p=this.startCol){
- A.push(b?D.x[H][this.smpIndices[I]]:D.x[H][I]);
- z.push("cxx");
- p++
- }
- y++
- }
- }
- for(var H=0;H=this.startCol){
- if(b){
- A.push(D.y.data[this.varIndices[H]][this.smpIndices[I]]!=null?D.y.data[this.varIndices[H]][this.smpIndices[I]]:D.y.data[this.smpIndices[I]])
- }else{
- A.push(D.y.data[H][I]!=null?D.y.data[H][I]:D.y.data[I])
- }
- z.push("cxy");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- t++
-}
-B++
-}
-}else{
- if(D.z){
- for(var I in D.z){
- if(p=this.startCol){
- A.push(I);
- z.push("cxz");
- p++
- }
- y++
- }
- }
- for(var I=0;I=this.startCol){
- A.push(b?D.y.smps[this.smpIndices[I]]:D.y.smps[I]);
- z.push("cxs");
- p++
- }
- y++
-}
-O.push(A);
-P.push(z);
-if(D.x){
- for(var I in D.x){
- if(t=this.startRow){
- p=0;
- y=0;
- A=[I];
- z=["cxx"];
- if(D.z){
- for(var H in D.z){
- if(p=this.startCol){
- A.push("");
- z.push("cxb");
- p++
- }
- y++
- }
- }
- for(var H=0;H=this.startCol){
- A.push(b?D.x[I][this.smpIndices[H]]:D.x[I][H]);
- z.push("cxx");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- t++
- }
- B++
- }
- }
- for(var I=0;I=this.startRow){
- p=0;
- y=0;
- A=[b?D.y.vars[this.varIndices[I]]:D.y.vars[I]];
- z=["cxv"];
- if(D.z){
- for(var H in D.z){
- if(p=this.startCol){
- A.push(b?D.z[H][this.varIndices[I]]:D.z[H][I]);
- z.push("cxz");
- p++
- }
- y++
- }
- }
- for(var H=0;H=this.startCol){
- if(b){
- A.push(D.y.data[this.varIndices[I]][this.smpIndices[H]]!=null?D.y.data[this.varIndices[I]][this.smpIndices[H]]:D.y.data[this.smpIndices[H]])
- }else{
- A.push(D.y.data[I][H]!=null?D.y.data[I][H]:D.y.data[H])
- }
- z.push("cxy");
- p++
- }
- y++
- }
- O.push(A);
- P.push(z);
- t++
-}
-B++
-}
-}
-}
-}
-}
-}
-}
-}
-if(M){
- return O
- }else{
- this.loadDataTableValues(O,P,E,C)
- }
-};
-
-this.loadDataTableValues=function(y,A,p,m){
- var k=this.$(this.target+"-cX-DataTable");
- if(k){
- var h=this.startRow;
- for(var u=0;u=1){
- x.removeChild(x.firstChild)
- }
- }
- var D=y[u][r]!=null?y[u][r]:"";
- var a=A[u][r]!=null?A[u][r]:"";
- var b=this.$cX("div",{
- id:C,
- className:"CanvasXpressTableCell ",
- innerHTML:D,
- title:D,
- alt:D,
- type:a
- });
- if(u!=0){
- b.style.height=this.setDataTableRowHeight(h)+"px";
- x.style.height=this.setDataTableRowHeight(h)+"px"
- }else{
- b.style.height=this.setDataTableRowHeight(0)+"px";
- x.style.height=this.setDataTableRowHeight(0)+"px"
- }
- if(r!=0){
- b.style.width=this.setDataTableColumnWidth(v)+"px";
- x.style.width=this.setDataTableColumnWidth(v)+"px"
- }else{
- b.style.width=this.setDataTableColumnWidth(0)+"px";
- x.style.width=this.setDataTableColumnWidth(0)+"px"
- }
- x.appendChild(b);
- v++
- }
- }
- h++
- }
- if(this.activeTarget){
- this.activeTarget.style.zIndex=10000
- }
- if(this.sortDataTableHead){
- var l=this.$(this.sortDataTableHead.id);
- var f=this.$(this.target+"-cX-DataTableCell.0.0").firstChild;
- var g=this.target+"-cX-DataTableCellContent.0.0";
- if(l){
- l.className=this.sortDataTableHead.className
- }
- if(f){
- f.className=this.sortDataTableHead.id==g?this.sortDataTableHead.className:"CanvasXpressTableCell"
- }
- }
-this.activeTarget=k;
-k.style.display="block";
-k.style.zIndex=10001;
-if(this.dataTableLastState&&this.dataTableLastState=="docked"&&!p&&!m){
- var B=this.$("south-handler-"+this.target);
- this.clickViewport(false,B);
- return
-}
-}
-};
-
-this.moveDataTableDiv=function(e){
- var m=this.$(this.target+"-cX-DataTable");
- if(m){
- var o,q,i;
- var b=this.$(this.remoteParentId+"-canvasXpressRemoteWindow");
- var a=this.$("west-handler-"+this.target);
- var f=this.$("north-container-"+this.target);
- var c=this.$("west-container-"+this.target);
- var k=this.$("east-container-"+this.target);
- var n=this.$("south-container-"+this.target);
- var g=this.$("south-handler-"+this.target);
- var p=this.$("south-wrapper-"+this.target);
- var j=this;
- if(a&&c&&k&&n&&g&&p){
- if(e&&e=="dock"){
- this.dataTableLastState="docked";
- this.dataTableLastHeight=m.clientHeight;
- this.dataTableLastX=m.offsetLeft;
- this.dataTableLastY=m.offsetTop;
- g.style.display="block";
- o=a.style.display=="none"?7:0;
- q=Math.max(m.clientWidth+o,parseInt(c.style.width)+parseInt(k.style.width)+this.canvas.width)+2;
- i=parseInt(f.style.height)+this.canvas.height+m.clientHeight+7+2;
- if(b){
- this.resizeMove(b,0,0,q+48,i+54)
- }
- this.resizeMove(n,0,0,q,m.clientHeight+7+2);
- this.resizeMove(p,0,0,q,m.clientHeight+2);
- this.resizeMove(m,o,0,m.clientWidth,m.clientHeight)
- }else{
- if(e&&e=="hide"){
- delete (this.dataTableLastState);
- delete (this.dataTableLastX);
- delete (this.dataTableLastY);
- g.style.display="none";
- q=parseInt(c.style.width)+parseInt(k.style.width)+this.canvas.width;
- i=parseInt(f.style.height)+this.canvas.height+7;
- if(b){
- this.resizeMove(b,0,0,q+48,i+54)
- }
- this.fade(m);
- this.resizeMove(p,0,0,q,0);
- this.resizeMove(n,0,0,q,7)
- }else{
- if(e&&(e=="max"||e=="release"||e=="undock")){
- this.dataTableLastState="free";
- g.style.display="none";
- q=parseInt(c.style.width)+parseInt(k.style.width)+this.canvas.width;
- i=parseInt(f.style.height)+this.canvas.height+7;
- if(b){
- this.resizeMove(b,0,0,q+48,i+54)
- }
- if(e=="max"||e=="undock"){
- this.resizeMove(m,parseInt(this.dataTableLastX),parseInt(this.dataTableLastY),m.clientWidth,parseInt(this.dataTableLastHeight)||(this.dataTableRowsHeight+42))
- }
- this.resizeMove(p,0,0,q,0);
- this.resizeMove(n,0,0,q,7)
- }else{
- this.dataTableLastX=m.offsetLeft;
- this.dataTableLastY=m.offsetTop;
- return
- }
- }
- }
- if(b){
- setTimeout(function(){
- j.resizeExtContainer(q+48,i+54)
- },500)
- }
- }
-}
-};
-
-this.updateDataTableResizerDiv=function(f,k,j){
- if(!f){
- f=window.event
- }
- if(f&&(k==null||j==null)){
- k=Math.abs(this.dataTableWidth)-(this.xMouseDown-f.clientX);
- j=Math.abs(this.dataTableHeight)-(this.yMouseDown-f.clientY)
- }
- if(this.dataTableTarget&&this.dataTableTarget.style){
- var g=this.$(this.target+"-cX-DataTable");
- var i=this.$(this.target+"-cX-DataTableContainer");
- var a=this.$(this.target+"-cX-DataTableTableMask");
- var l=this.$(this.target+"-cX-DataTableVer");
- var b=this.$(this.target+"-cX-DataTableHor");
- var n=this.$(this.target+"-cX-DataTableToolbar");
- if(g&&i&&a&&l&&b&&n){
- this.dataTableTarget.style.width=this.isIE?Math.max(0,k)+"px":k+"px";
- i.style.width=this.isIE?Math.max(0,k)+"px":k+"px";
- a.style.width=this.isIE?Math.max(0,(k-20))+"px":(k-20)+"px";
- b.style.width=this.isIE?Math.max(0,(k-20))+"px":(k-20)+"px";
- n.style.width=this.isIE?Math.max(0,k)+"px":k+"px";
- this.dataTableTarget.style.height=this.isIE?Math.max(0,j)+"px":j+"px";
- i.style.height=this.isIE?Math.max(0,(j-20))+"px":(j-20)+"px";
- a.style.height=this.isIE?Math.max(0,(j-44))+"px":(j-44)+"px";
- l.style.height=this.isIE?Math.max(0,(j-44))+"px":(j-44)+"px";
- this.dataTableLastWidth=k;
- this.dataTableLastHeight=j
- }
- }
-};
-
-this.endDataTableResizerDiv=function(a){
- if(this.dataTableTarget!=null){
- this.resizeDataTable();
- this.xMouseDown=null;
- this.yMouseDown=null;
- this.dataTableWidth=null;
- this.dataTableHeight=null;
- this.dataTableTarget=false;
- this.resizingDataTableOn=false
- }
- };
-
-this.endDataTableColumnResize=function(a){
- this.xMouseDown=null;
- this.yMouseDown=null;
- this.resizingDataTableColumnOn=false;
- this.dataTableColumnTarget=false;
- document.body.style.cursor="default"
- };
-
-this.initializeDataTableEvents=function(){
- this.addDataTableDiv()
- };
-
-this.initializeDataTableEvents()
-};
-
-CanvasXpress.prototype.initCanvasResizerEvents=function(){
- this.addCanvasResizerDiv=function(a){
- if(a){
- if(document.getElementById("canvasXpressCanvasResize")){
- return
- }
- }else{
- if(document.getElementById(this.target+"canvasXpressCanvasResize")){
- return
- }
- }
- var b=document.createElement("div");
- b.id=a?"canvasXpressCanvasResize":this.target+"canvasXpressCanvasResize";
- b.style.left="0px";
- b.style.top="0px";
- b.style.width="0.5px";
- b.style.height="0.5px";
- if(a){
- b.style.opacity=0.5;
- b.style.filter="alpha(opacity = 50)";
- b.style.backgroundColor=this.resizerBackgroundColor
- }
- b.style.position="absolute";
-b.style.display="none";
-b.style.zIndex=100001;
-if(a){
- document.body.appendChild(b);
- return b
- }else{
- this.canvas.parentNode.appendChild(b)
- }
-};
-
-this.isCanvasResize=function(c){
- if(this.resizable){
- if(!c){
- c=window.event
- }
- var b=this.adjustedCoordinates(c);
- if(b){
- var a=b.x;
- var d=b.y;
- if(a>this.width-18&&d>this.height-18){
- this.resizeCanvasCursorShow="se-resize";
- return true
- }else{
- if(a>this.width-18&&d>20){
- this.resizeCanvasCursorShow="e-resize";
- return true
- }else{
- if(d>this.height-18){
- this.resizeCanvasCursorShow="s-resize";
- return true
- }else{
- this.resizeCanvasCursorShow=false;
- return false
- }
- }
- }
- }
-}
-};
-
-this.updateCanvasResizerCursor=function(d){
- if(this.resizable){
- if(!d){
- d=window.event
- }
- var b=document.getElementById(this.target);
- if(b){
- var c=this.adjustedCoordinates(d);
- if(c){
- var a=c.x;
- var f=c.y;
- if(a>this.width-18&&f>this.height-18){
- b.style.cursor="se-resize";
- this.resizeCanvasCursorShow="se-resize"
- }else{
- if(a>this.width-18&&f>20){
- b.style.cursor="e-resize";
- this.resizeCanvasCursorShow="e-resize"
- }else{
- if(f>this.height-18){
- b.style.cursor="s-resize";
- this.resizeCanvasCursorShow="s-resize"
- }else{
- if(!this.movingOn){
- b.style.cursor="default";
- this.resizeCanvasCursorShow=false
- }
- }
- }
- }
- }
-}
-}
-};
-
-this.updateCanvasResizer=function(f){
- if(this.resizingCanvasOn&&this.resizeCanvasCursorShow){
- document.body.style.cursor=this.resizeCanvasCursorShow;
- var c=document.getElementById(this.target+"canvasXpressCanvasResize");
- var a=document.getElementById("canvasXpressCanvasResize");
- var b=this.adjustedCoordinates(f);
- var d=this.relativeCoordinates(this.canvas);
- if(c&&b&&d){
- if(this.resizeCanvasCursorShow=="se-resize"){
- w=b.x;
- h=b.y
- }else{
- if(this.resizeCanvasCursorShow=="e-resize"){
- w=b.x;
- h=this.height
- }else{
- if(this.resizeCanvasCursorShow=="s-resize"){
- w=this.width;
- h=b.y
- }
- }
- }
- if(!a){
- a=this.addCanvasResizerDiv(true)
- }
- this.preventSelection();
- dx=b.x-this.canvas.width;
- dy=b.y-this.canvas.height;
- c.style.width=w+"px";
- c.style.height=h+"px";
- c.style.display="block";
- a.style.left=d.x+"px";
- a.style.top=d.y+"px";
- a.style.width=w+"px";
- a.style.height=h+"px";
- a.style.display="block";
- CanvasXpress.resizing=true
- }
-}
-};
-
-this.endCanvasResizer=function(g){
- if(this.resizingCanvasOn){
- var d=document.getElementById(this.target);
- var a=document.getElementById(this.target+"canvasXpressCanvasResize");
- var o=document.getElementById("canvasXpressCanvasResize");
- var k=document.getElementById(this.remoteParentId+"-canvasXpressRemoteWindowBuffer");
- var c=this.$("west-container-"+this.target);
- var n=this.$("middle-container-"+this.target);
- var f=this.$("east-container-"+this.target);
- if(d&&a&&o){
- this.tmpHeight=false;
- this.tmpWidth=false;
- var m=parseInt(a.style.width);
- var j=parseInt(a.style.height);
- n.style.width=(parseInt(c.style.width)+parseInt(a.style.width)+parseInt(f.style.width))+"px";
- n.style.height=a.style.height;
- this.resetAxesResizer();
- this.draw(m,j);
- this.resizeAcknowledgementDiv();
- a.style.width="0.5px";
- a.style.height="0.5px";
- a.style.display="none";
- d.style.cursor="default";
- this.updateRemoteNavigationWindow();
- document.body.removeChild(o);
- this.resizeCanvasCursorShow=false;
- this.resizingCanvasOn=false;
- CanvasXpress.resizing=false
- }
- }
-};
-
-this.initializeCanvasResizerEvents=function(){
- if(!this.disableEvents){
- this.addCanvasResizerDiv()
- }
- };
-
-this.initializeCanvasResizerEvents()
-};
-
-CanvasXpress.prototype.initAxisResizerEvents=function(){
- this.addAxesResizeDiv=function(){
- if(document.getElementById(this.target+"canvasXpressAxesResize")){
- return
- }
- var c=["Previous","Next","Current","Middle","Min","Max","Close"];
- var b=9001;
- var e=document.createElement("div");
- e.id=this.target+"canvasXpressAxesResize";
- if(this.resizerTransparency){
- e.style.opacity=0.85;
- e.style.filter="alpha(opacity = 85)"
- }
- e.style.position="absolute";
- e.style.display="none";
- e.style.zIndex=b;
- for(var a=0;aq.min[0]?this.xMouseDown-q.min[0]:f<(q.min[0]+q.min[1])-q.max[0]?this.xMouseDown-((q.min[0]+q.min[1])-q.max[0]):A.x;
- i=d>q.min[2]-(q.max[2]+q.max[3])?this.yMouseDown-(q.min[2]-(q.max[2]+q.max[3])):d<(q.lim[2]+q.min[2]+q.min[3])-q.lim[3]?(q.lim[3]-(q.lim[2]+q.min[2]+q.min[3]))+this.yMouseDown:A.y
- }else{
- if(this.resizerEventData.active=="max"){
- j=f>q.max[0]-(q.min[0]+q.min[1])?this.xMouseDown-(q.max[0]-(q.min[0]+q.min[1])):f<(q.lim[0]+q.max[0]+q.max[1])-q.lim[1]?(q.lim[1]-(q.lim[0]+q.max[0]+q.max[1]))+this.xMouseDown:A.x;
- i=d>q.max[2]?this.yMouseDown-q.max[2]:d<(q.lim[2]+q.max[2]+q.max[3])-(q.lim[2]+q.min[2])?((q.lim[2]+q.min[2])-(q.lim[2]+q.max[2]+q.max[3]))+this.yMouseDown:A.y
- }else{
- if(this.resizerEventData.active=="cur"){
- j=f>q.min[0]?this.xMouseDown-q.min[0]:f<(q.lim[0]+q.max[0]+q.max[1])-q.lim[1]?(q.lim[1]-(q.lim[0]+q.max[0]+q.max[1]))+this.xMouseDown:A.x;
- i=d>q.max[2]?this.yMouseDown-q.max[2]:d<(q.lim[2]+q.min[2]+q.min[3])-q.lim[3]?(q.lim[3]-(q.lim[2]+q.min[2]+q.min[3]))+this.yMouseDown:A.y
- }else{
- return
- }
- }
- }
- var m=j-this.xMouseDown;
- var k=i-this.yMouseDown;
- if(this.resizerType=="samples"||this.resizerEventData.g=="Heatmap"){
- m-=m%a;
- k-=k%a
- }
- var r=m/this.resizerEventData.unit;
- var p=k/this.resizerEventData.unit;
- var t=document.getElementById(this.target+"canvasXpressAxesResizeMin");
- var o=document.getElementById(this.target+"canvasXpressAxesResizeMax");
- var D=document.getElementById(this.target+"canvasXpressAxesResizeMiddle");
- var g=document.getElementById(this.target+"canvasXpressAxesResizeCurrent");
- if(t&&o&&D&&g){
- if(this.resizerEventData.active=="min"){
- if(this.resizerEventData.pos=="h"){
- t.style.left=(q.min[0]+m)+"px";
- D.style.left=((q.min[0]+m)+((q.cur[1]-m)/2))+"px";
- g.style.left=(q.min[0]+m+C+1)+"px";
- g.style.width=(q.cur[1]-m)+"px";
- B=parseInt((q.min[0]+E+m)/a);
- if(this.resizerType=="samples"){
- s=dateFormat(this.data.y.smps[B],this.timeFormat)
- }else{
- if(this.resizerEventData.g=="Heatmap"){
- s=this.resizerEventData.dim=="x"?this.data.y.vars[this.resizerEventData.vals.varIndices[B]]:this.isGroupedData?this.data.w.smps[this.resizerEventData.vals.grpIndices[B]]:this.data.y.smps[this.resizerEventData.vals.smpIndices[B]]
- }else{
- s=this.formatNumber(this.resizerEventData.smin+r)
- }
- }
- }else{
- t.style.top=(q.min[2]+k)+"px";
- D.style.top=((q.min[2]+k)-((q.cur[3]+k)/2))+"px";
- g.style.height=((q.cur[3]+k))+"px";
- b=parseInt((q.min[2]+E+k)/a);
- if(this.resizerType=="samples"){
- s=dateFormat(this.data.y.smps[b],this.timeFormat)
- }else{
- if(this.resizerEventData.g=="Heatmap"){
- s=this.resizerEventData.dim=="x"?this.data.y.vars[this.resizerEventData.vals.varIndices[b]]:this.isGroupedData?this.data.w.smps[this.resizerEventData.vals.grpIndices[b]]:this.data.y.smps[this.resizerEventData.vals.smpIndices[b]]
- }else{
- s=this.formatNumber(this.resizerEventData.smin-p)
- }
- }
- }
-this.showInfoSpan(v,s)
-}else{
- if(this.resizerEventData.active=="max"){
- if(this.resizerEventData.pos=="h"){
- o.style.left=(q.max[0]+m)+"px";
- D.style.left=((q.min[0]+m)+((q.cur[1]-m)/2))+"px";
- g.style.width=(q.cur[1]+m)+"px";
- b=parseInt((q.max[0]+E+m)/a);
- if(this.resizerType=="samples"){
- u=dateFormat(this.data.y.smps[b],this.timeFormat)
- }else{
- if(this.resizerEventData.g=="Heatmap"){
- u=this.resizerEventData.dim=="x"?this.data.y.vars[this.resizerEventData.vals.varIndices[b]]:this.isGroupedData?this.data.w.smps[this.resizerEventData.vals.grpIndices[b]]:this.data.y.smps[this.resizerEventData.vals.smpIndices[b]]
- }else{
- u=this.formatNumber(this.resizerEventData.smax+r)
- }
- }
- }else{
- o.style.top=(q.max[2]+k)+"px";
- D.style.top=((q.max[2]+k)+((q.cur[3]-k)/2))+"px";
- g.style.top=(q.max[2]+k+C)+"px";
- g.style.height=(q.cur[3]-k)+"px";
- B=parseInt((q.max[2]+E+k)/a);
- if(this.resizerType=="samples"){
- u=dateFormat(this.data.y.smps[B],this.timeFormat)
- }else{
- if(this.resizerEventData.g=="Heatmap"){
- u=this.resizerEventData.dim=="x"?this.data.y.vars[this.resizerEventData.vals.varIndices[B]]:this.isGroupedData?this.data.w.smps[this.resizerEventData.vals.grpIndices[B]]:this.data.y.smps[this.resizerEventData.vals.smpIndices[B]]
- }else{
- u=this.formatNumber(this.resizerEventData.smax-p)
- }
- }
-}
-this.showInfoSpan(v,u)
-}else{
- if(this.resizerEventData.active=="cur"){
- if(this.resizerEventData.pos=="h"){
- t.style.left=(q.min[0]+m)+"px";
- D.style.left=((q.min[0]+m)+(q.cur[1]/2))+"px";
- o.style.left=(q.max[0]+m)+"px";
- g.style.left=(q.min[0]+m+C+1)+"px";
- B=parseInt((q.min[0]+E+m)/a);
- b=parseInt((q.max[0]+E+m)/a);
- if(this.resizerType=="samples"){
- s=dateFormat(this.data.y.smps[B],this.timeFormat);
- u=dateFormat(this.data.y.smps[b],this.timeFormat)
- }else{
- if(this.resizerEventData.g=="Heatmap"){
- s=this.resizerEventData.dim=="x"?this.data.y.vars[this.resizerEventData.vals.varIndices[B]]:this.isGroupedData?this.data.w.smps[this.resizerEventData.vals.grpIndices[B]]:this.data.y.smps[this.resizerEventData.vals.smpIndices[B]];
- u=this.resizerEventData.dim=="x"?this.data.y.vars[this.resizerEventData.vals.varIndices[b]]:this.isGroupedData?this.data.w.smps[this.resizerEventData.vals.grpIndices[b]]:this.data.y.smps[this.resizerEventData.vals.smpIndices[b]]
- }else{
- s=this.formatNumber(this.resizerEventData.smin+r);
- u=this.formatNumber(this.resizerEventData.smax+r)
- }
- }
- this.showInfoSpan(v,s+"--"+u)
- }else{
- t.style.top=(q.min[2]+k)+"px";
- D.style.top=((q.max[2]+k)+(q.cur[3]/2))+"px";
- o.style.top=(q.max[2]+k)+"px";
- g.style.top=(q.max[2]+k+C)+"px";
- b=parseInt((q.min[2]+E+k)/a);
- B=parseInt((q.max[2]+E+k)/a);
- if(this.resizerType=="samples"){
- s=dateFormat(this.data.y.smps[b],this.timeFormat);
- u=dateFormat(this.data.y.smps[B],this.timeFormat);
- this.showInfoSpan(v,u+"--"+s)
- }else{
- if(this.resizerEventData.g=="Heatmap"){
- s=this.resizerEventData.dim=="x"?this.data.y.vars[this.resizerEventData.vals.varIndices[b]]:this.isGroupedData?this.data.w.smps[this.resizerEventData.vals.grpIndices[b]]:this.data.y.smps[this.resizerEventData.vals.smpIndices[b]];
- u=this.resizerEventData.dim=="x"?this.data.y.vars[this.resizerEventData.vals.varIndices[B]]:this.isGroupedData?this.data.w.smps[this.resizerEventData.vals.grpIndices[B]]:this.data.y.smps[this.resizerEventData.vals.smpIndices[B]];
- this.showInfoSpan(v,u+"--"+s)
- }else{
- s=this.formatNumber(this.resizerEventData.smin-p);
- u=this.formatNumber(this.resizerEventData.smax-p);
- this.showInfoSpan(v,s+"--"+u)
- }
- }
- }
-}
-}
-}
-this.resizerEventData.lastMin=this.resizerType=="samples"||this.resizerEventData.g=="Heatmap"?B:s;
-this.resizerEventData.lastMax=this.resizerType=="samples"||this.resizerEventData.g=="Heatmap"?b:u;
-if(this.resizerDraw){
- this.drawAxesResizerUpdate()
- }
-}
-}
-}
-};
-
-this.drawAxesResizerUpdate=function(n){
- var d=this.resizerEventData.lastMin!=null?parseFloat(this.resizerEventData.lastMin):parseFloat(this.resizerEventData.smin);
- var k=this.resizerEventData.lastMax!=null?parseFloat(this.resizerEventData.lastMax):parseFloat(this.resizerEventData.smax);
- var j=this.resizerEventData.c||0;
- if(this.resizerType=="samples"){
- var m=this.isGroupedData?this.data.w.smps.length-1:this.data.y.smps.length-1;
- var a=[];
- var g=[];
- for(var f=0;f-1){
- this.setAllSamplesVisible();
- var a,k,c,n;
- var m=this.graphType=="Candlestick"?"close":false;
- var g=[];
- var e=[];
- var q=[];
- for(var f=0;f0){
- e=c.org[0]-1;
- i=c.org[2]-this.resizerWidth;
- d=a*this.resizerEventData.smin;
- f=this.resizerWidth;
- this.rectangle(e,i,d,f,this.resizerBackgroundColor,this.resizerBackgroundColor);
- this.drawLine("line",e,i,e+d+1,i,this.foreground);
- this.drawLine("line",e+d,i,e+d,i+f,this.foreground)
- }
- if(this.resizerEventData.smax0){
- e=c.org[0]+14;
- i=c.org[2];
- d=this.resizerWidth;
- f=a*this.resizerEventData.smin;
- this.rectangle(e,i,d,f,this.resizerBackgroundColor,this.resizerBackgroundColor);
- this.drawLine("line",e,i+f,e+d,i+f,this.foreground);
- this.drawLine("line",e+d,i,e+d,i+f,this.foreground)
- }
- if(this.resizerEventData.smaxj?"h":"v";
- if(g>=c.min[0]+c.lim[0]&&g<=c.min[0]+c.min[1]+c.lim[0]&&f>=c.min[2]+c.lim[2]&&f<=c.min[2]+c.min[3]+c.lim[2]){
- this.resizerEventData.active="min";
- this.axesResizingOn=true
- }else{
- if(g>=c.max[0]+c.lim[0]&&g<=c.max[0]+c.max[1]+c.lim[0]&&f>=c.max[2]+c.lim[2]&&f<=c.max[2]+c.max[3]+c.lim[2]){
- this.resizerEventData.active="max";
- this.axesResizingOn=true
- }else{
- if(g>=c.cur[0]+c.lim[0]&&g<=c.cur[0]+c.cur[1]+c.lim[0]&&f>=c.cur[2]+c.lim[2]&&f<=c.cur[2]+c.cur[3]+c.lim[2]){
- this.resizerEventData.active="cur";
- this.axesResizingOn=true
- }else{
- if(b=="h"){
- if(g>=c.lim[0]&&gc.lim[0]+c.max[0]+c.max[1]&&g<=c.lim[1]-a){
- this.resizerEventData.active="next";
- this.axesResizingOn=true
- }
- }
- }else{
- if(f>=c.lim[2]+c.min[2]+c.min[3]&&f<=c.lim[2]+c.lim[3]){
- this.resizerEventData.active="prev";
- this.axesResizingOn=true
- }else{
- if(f>=c.lim[2]&&f<=c.lim[2]+c.max[2]){
- this.resizerEventData.active="next";
- this.axesResizingOn=true
- }
- }
- }
- }
-}
-}
-this.xMouseDown=g;
-this.yMouseDown=f
-}
-};
-
-this.activateDeactivateAxesResizer=function(j){
- if(!j){
- j=window.event
- }
- var s=this.adjustedCoordinates(j);
- if(s){
- var q;
- var r=s.x;
- var m=s.y;
- var i=this.resizerEventData.areas;
- var u=i.lim[1]-i.lim[0];
- var t=i.lim[3]-i.lim[2];
- var c=5;
- var f=u>t?"h":"v";
- if(f=="h"){
- if(r>=i.lim[0]&&r<=i.lim[0]+i.min[0]){
- q="prev"
- }else{
- if(r>=i.lim[0]+i.max[0]+i.max[1]&&r<=i.lim[1]-c){
- q="next"
- }
- }
- }else{
- if(m>=i.lim[2]+i.min[2]+i.min[3]&&m<=i.lim[2]+i.lim[3]){
- q="prev"
- }else{
- if(m>=i.lim[2]&&m<=i.lim[2]+i.max[2]){
- q="next"
- }
- }
-}
-var d=document.getElementById(this.target+"canvasXpressAxesResizePrevious");
-var g=document.getElementById(this.target+"canvasXpressAxesResizeNext");
-if(d&&g){
- if(q=="prev"){
- var k=d.style.backgroundImage;
- if(j.type.match(/mouseout|touchcancel/i)){
- if(k.match(/_active.png/)){
- d.style.backgroundImage=k.replace("_active.png",".png")
- }
- }else{
- if(!k.match(/_active.png/)){
- d.style.backgroundImage=k.replace(".png","_active.png")
- }
- }
-}else{
- if(q=="next"){
- var k=g.style.backgroundImage;
- if(j.type.match(/mouseout|touchcancel/i)){
- if(k.match(/_active.png/)){
- g.style.backgroundImage=k.replace("_active.png",".png")
- }
- }else{
- if(!k.match(/_active.png/)){
- g.style.backgroundImage=k.replace(".png","_active.png")
- }
- }
-}else{
- var k=d.style.backgroundImage;
- if(k.match(/_active.png/)){
- d.style.backgroundImage=k.replace("_active.png",".png")
- }
- k=g.style.backgroundImage;
- if(k.match(/_active.png/)){
- g.style.backgroundImage=k.replace("_active.png",".png")
- }
- }
-}
-}
-return false
-}
-};
-
-this.moveAxesResizer=function(k){
- var g=this.resizerEventData.smin;
- var m=this.resizerEventData.smax;
- var c=this.resizerType=="samples"||this.resizerEventData.g=="Heatmap"?1:(m-g)/10;
- if((this.resizerType=="samples"||this.resizerEventData.g=="Heatmap")&&this.resizerEventData.pos=="v"){
- if(this.resizerEventData.active=="prev"){
- if(g+cthis.resizerEventData.max){
- c=this.resizerEventData.max-m;
- this.resizerEventData.lastMin=g-c;
- this.resizerEventData.lastMax=this.resizerEventData.max
- }else{
- this.resizerEventData.lastMin=g-c;
- this.resizerEventData.lastMax=m-c
- }
- }
-}else{
- if(this.resizerEventData.active=="prev"){
- if(g-cthis.resizerEventData.max){
- c=this.resizerEventData.max-m;
- this.resizerEventData.lastMin=g+c;
- this.resizerEventData.lastMax=this.resizerEventData.max
- }else{
- this.resizerEventData.lastMin=g+c;
- this.resizerEventData.lastMax=m+c
- }
- }
-}
-var f=this.resizerEventData.areas;
-var d=document.getElementById(this.target+"canvasXpressAxesResizeMin");
-var o=document.getElementById(this.target+"canvasXpressAxesResizeMax");
-var n=document.getElementById(this.target+"canvasXpressAxesResizeMiddle");
-var j=document.getElementById(this.target+"canvasXpressAxesResizeCurrent");
-var b=14;
-var a=9-1;
-var p=parseInt(a/2);
-var i=c*this.resizerEventData.unit;
-if((this.resizerEventData.pos=="h"&&this.resizerEventData.active=="prev")||(this.resizerEventData.pos=="v"&&this.resizerEventData.active=="next")){
- i*=-1
- }
- if(this.resizerEventData.pos=="h"){
- d.style.left=(f.min[0]+i+1)+"px";
- n.style.left=((f.min[0]+i)+(f.cur[1]/2))+"px";
- o.style.left=(f.max[0]+i)+"px";
- j.style.left=(f.min[0]+i+p+1)+"px"
- }else{
- d.style.top=(f.min[2]+i+1)+"px";
- n.style.top=((f.max[2]+i)+(f.cur[3]/2))+"px";
- o.style.top=(f.max[2]+i)+"px";
- j.style.top=(f.max[2]+i+p+1)+"px"
- }
-};
-
-this.getAxesVals=function(e){
- var d=["minData","maxData","xAxisMin","xAxisMax","xAxis2Min","xAxis2Max","yAxisMin","yAxisMax","zAxisMin","zAxisMax","xAxisUnit","xAxis2Unit","yAxisUnit","zAxisUnit","setMin","setMax","setMin2","setMax2","setMinX","setMaxX","setMinY","setMaxY","setMinZ","setMaxZ","xAxisAbsMin","xAxisAbsMax","xAxis2AbsMin","xAxis2AbsMax","yAxisAbsMin","yAxisAbsMax","zAxisAbsMin","zAxisAbsMax","graphType","x","y","varIndices","smpIndices","grpIndices","varIndicesStart","smpIndicesStart"];
- var b={};
-
- if(this.layoutComb){
- for(var a=0;a=m[0]&&r<=m[1]&&p>=m[3]&&p<=m[3]+a){
- var o=this.getAxesVals(n);
- this.showAxesResizer("xAxis",m[0],m[1],m[3]+s,m[3]+this.getAxisFont(o.x)+q,"x","h","b",o,"X",n,d,b);
- return true
- }else{
- if(r>=m[0]-a&&r<=m[0]&&p>=m[2]&&p<=m[3]){
- var o=this.getAxesVals(n);
- this.showAxesResizer("yAxis",m[0]-(this.getAxisFont(o.y)+q),m[0]-s,m[2],m[3],"y","v","l",o,"Y",n,d,b);
- return true
- }
- }
- }else{
- if(f.match(/Heatmap/)){
- if(r>=m[0]-a&&r<=m[0]&&p>=m[2]&&p<=m[3]){
- var o=this.getAxesVals(n);
- this.showAxesResizer("xAxis",m[0]-(this.getAxisFont(o.y)+q),m[0]-s,m[2],m[3],"y","v","l",o,"",n,d,b);
- return true
- }else{
- if(r>=m[1]&&r<=m[1]+a&&p>=m[2]&&p<=m[3]){
- var o=this.getAxesVals(n);
- this.showAxesResizer("xAxis",m[1]+s,m[1]+this.getAxisFont(o.y)+q,m[2],m[3],"y","v","r",o,"",n,d,b);
- return true
- }else{
- if(r>=m[0]&&r<=m[1]&&p>=m[2]-a&&p<=m[2]){
- var o=this.getAxesVals(n);
- this.showAxesResizer("xAxis",m[0],m[1],m[2]-(this.getAxisFont(o.x)+q),m[2]-s,"x","h","t",o,"",n,d,b);
- return true
- }else{
- if(r>=m[0]&&r<=m[1]&&p>=m[3]&&p<=m[3]+a){
- var o=this.getAxesVals(n);
- this.showAxesResizer("xAxis",m[0],m[1],m[3]+s,m[3]+this.getAxisFont(o.x)+q,"x","h","b",o,"",n,d,b);
- return true
- }
- }
- }
- }
- }else{
- if(this.graphOrientation=="vertical"){
- if(r>=m[0]-a&&r<=m[0]&&p>=m[2]&&p<=m[3]){
- var o=this.getAxesVals(n);
- this.showAxesResizer("xAxis",m[0]-(this.getAxisFont(o.y)+q),m[0]-s,m[2],m[3],"y","v","l",o,"",n,d,b);
- return true
- }else{
- if(r>=m[1]&&r<=m[1]+a&&p>=m[2]&&p<=m[3]){
- var o=this.getAxesVals(n);
- if(f=="BarLine"){
- this.showAxesResizer("xAxis2",m[1]+s,m[1]+this.getAxisFont(o.y)+q,m[2],m[3],"y","v","r",o,"2",n,d,b)
- }else{
- this.showAxesResizer("xAxis",m[1]+s,m[1]+this.getAxisFont(o.y)+q,m[2],m[3],"y","v","r",o,"",n,d,b)
- }
- return true
- }
- }
- }else{
- if(r>=m[0]&&r<=m[1]&&p>=m[2]-a&&p<=m[2]){
- var o=this.getAxesVals(n);
- this.showAxesResizer("xAxis",m[0],m[1],m[2]-(this.getAxisFont(o.x)+q),m[2]-s,"x","h","t",o,"",n,d,b);
- return true
- }else{
- if(r>=m[0]&&r<=m[1]&&p>=m[3]&&p<=m[3]+a){
- var o=this.getAxesVals(n);
- if(f=="BarLine"){
- this.showAxesResizer("xAxis2",m[0],m[1],m[3]+s,m[3]+this.getAxisFont(o.x)+q,"x","h","b",o,"2",n,d,b)
- }else{
- this.showAxesResizer("xAxis",m[0],m[1],m[3]+s,m[3]+this.getAxisFont(o.x)+q,"x","h","b",o,"",n,d,b)
- }
- return true
- }
- }
-}
-}
-}
-n++
-}
-}
-}
-return false
-};
-
-this.endAxesResizer=function(a){
- if(this.axesResizingOn){
- this.resetInfoSpan(a);
- if(this.resizerEventData.active=="prev"||this.resizerEventData.active=="next"){
- this.moveAxesResizer(a)
- }
- this.drawAxesResizerUpdate(true);
- this.axesResizingOn=false
- }else{
- if(this.resizerType){
- this.updateResizerEventData();
- this.refreshAxesResizer()
- }
- }
-};
-
-this.resetAxesResizer=function(b){
- if(this.axesResizerShow){
- var a=document.getElementById(this.target+"canvasXpressAxesResize");
- if(a){
- this.addRemoveAxesResizerListeners("removeEvtListener");
- a.style.display="none";
- this.resizerEventData={};
-
- this.resetInfoSpan(b);
- this.axesResizerShow=false
- }
- }
-};
-
-this.initializeAxisResizerEvents=function(){
- if(!this.disableEvents){
- this.addAxesResizeDiv()
- }
- };
-
-this.initializeAxisResizerEvents()
-};
-
-CanvasXpress.prototype.initDraggingEvents=function(){
- this.addDragDiv=function(){
- if(this.$(this.target+"-cX-Drag")){
- return
- }
- var a=this.$cX("div",{
- id:this.target+"-cX-Drag",
- className:"CanvasXpressDrag"
- },{
- width:"0.5px",
- height:"0.5px",
- zIndex:9000
- });
- this.canvas.parentNode.appendChild(a)
- };
-
- this.registerDragNetwork=function(l){
- var c,j,f;
- var k=this.isEvent(l,true);
- var b=this.getTargetEvent(l);
- var a=k[1];
- if(a&&a.match(/-legend-/)){
- if(a.match(/-legend-Nodes/)){
- this.moveLegend="Nodes"
- }else{
- if(a.match(/-legend-Edges/)){
- this.moveLegend="Edges"
- }else{
- if(a.match(/-legend-Decorations/)){
- this.moveLegend="Decorations"
- }else{
- this.moveLegend=a.split(/-legend-/)[1]
- }
- }
- }
- }else{
- if(a&&a.match(/-lab$/)){
- if(l.shiftKey){
- j=true
- }
- c=k[0][0]
- }else{
- if(a&&a.match(/-dec$/)){
- if(l.shiftKey){
- c=k[0][0];
- f=true
- }else{
- this.resetDrag(l);
- this.resetFlags(l)
- }
- }else{
- c=k?k[0][0]:"NaN"
- }
- }
-if(!isNaN(c)&&c=q[0]&&f<=q[1]&&u>=q[2]&&u<=q[3]||this.moveGenome){
- this.skipClick=false;
- this.draggingOn=true;
- this.xMouseDown=f;
- this.yMouseDown=u;
- this.touches.push([f,u,new Date().getTime()]);
- return false
- }
- }else{
- return false
- }
- }else{
- if(m=="Genome"){
- this.registerDragGenome(n)
- }
- }
- if(f>=q[0]&&f<=q[1]&&u>=q[2]&&u<=q[3]||this.moveGenome){
- this.skipClick=false;
- this.draggingOn=true;
- this.xMouseDown=f;
- this.yMouseDown=u;
- this.touches.push([f,u,new Date().getTime()]);
- var p=this.$(this.target+"-cX-Drag");
- if(m=="Network"){
- this.registerDragNetwork(n)
- }
- if((!m.match(/Scatter|Heatmap|Network|Genome|Circular/)&&this.graphOrientation=="vertical"&&!n.shiftKey)||(!m.match(/Scatter|Heatmap|Network|Genome|Circular/)&&this.graphOrientation!="vertical"&&n.shiftKey)){
- p.style.left=q[0]+"px"
- }else{
- p.style.left=this.xMouseDown+"px"
- }
- if((!m.match(/Scatter|Heatmap|Network|Genome|Circular/)&&this.graphOrientation!="vertical"&&!n.shiftKey)||(!m.match(/Scatter|Heatmap|Network|Genome|Circular/)&&this.graphOrientation=="vertical"&&n.shiftKey)||m=="Genome"){
- p.style.top=q[2]+"px"
- }else{
- p.style.top=this.yMouseDown+"px"
- }
- if(this.layoutValid){
- this.layoutValidR=k;
- this.layoutValidC=h;
- this.layoutValidN=r
- }
- return false
- }else{
- if(f>=q[4]&&f<=q[5]&&u>=q[6]&&u<=q[7]){
- var b=this.isEvent(n);
- if(b){
- this.skipClick=false;
- this.draggingOn=true;
- this.xMouseDown=f;
- this.yMouseDown=u;
- this.touches.push([f,u,new Date().getTime()]);
- var p=this.$(this.target+"-cX-Drag");
- if(b[0].match("Smp")){
- this.moveSmp=b[0];
- if(m.match(/Heatmap/)||this.graphOrientation=="horizontal"){
- p.style.left=q[4]+"px";
- p.style.width=(q[5]-q[4])+"px";
- p.style.height="3px"
- }else{
- p.style.width="3px";
- p.style.top=q[6]+"px";
- p.style.height=(q[7]-q[6])+"px"
- }
- }else{
- if(b[0].match("Var")){
- this.moveVar=b[0];
- p.style.width="3px";
- p.style.top=q[6]+"px";
- p.style.height=(q[7]-q[6])+"px"
- }
- }
- return false
- }
- }
- }
- r++
-}
-}
-return false
-}
-}
-};
-
-this.updateDragScatter3D=function(b,f,e,d,k){
- if(this.mobileApp&&this.touches&&this.touches.length>1){
- return
- }
- var g=this;
- var h=this.mobileApp?100:1;
- var a=function(){
- clearTimeout(a);
- var i=g.xMouseDown;
- var n=g.yMouseDown;
- var c=b;
- var m=f;
- var j=g.lineLength(i,n,c,m);
- var p=g.layoutComb?g.layoutParams[k].x:g.x;
- var l=g.layoutComb?g.layoutParams[k].y:g.y;
- var r=((c-i)*g.rotationSensitivity)/p;
- var q=((m-n)*g.rotationSensitivity)/l;
- var o=(j*g.rotationSensitivity)/p;
- g.xRotate-=r;
- g.yRotate+=q;
- g.zRotate-=o;
- g.draw();
- g.skipClick=true
- };
-
- setTimeout(a,h)
- };
-
-this.updateDragNetwork=function(D,r,n,z,v,E){
- if(this.mobileApp&&this.touches&&this.touches.length>1){
- return
- }
- this.movingOn=true;
- var d=r;
- var b=n;
- var q,m,f,o,s,u;
- var B=this.getTargetEvent(D);
- var p={};
-
- if(this.moveNode||this.moveLegend){
- if(this.moveLegend){
- if(this.moveLegend=="Nodes"){
- m=this.data.legend.pos.nodes.x-((d/this.scaleFactor)-this.offsetX);
- f=this.data.legend.pos.nodes.y-((b/this.scaleFactor)-this.offsetY);
- this.data.legend.pos.nodes.x-=m;
- this.data.legend.pos.nodes.y-=f
- }else{
- if(this.moveLegend=="Edges"){
- m=this.data.legend.pos.edges.x-((d/this.scaleFactor)-this.offsetX);
- f=this.data.legend.pos.edges.y-((b/this.scaleFactor)-this.offsetY);
- this.data.legend.pos.edges.x-=m;
- this.data.legend.pos.edges.y-=f
- }else{
- if(this.moveLegend=="Decorations"){
- m=this.data.legend.pos.decorations.x-((d/this.scaleFactor)-this.offsetX);
- f=this.data.legend.pos.decorations.y-((b/this.scaleFactor)-this.offsetY);
- this.data.legend.pos.decorations.x-=m;
- this.data.legend.pos.decorations.y-=f
- }else{
- o=parseInt(this.moveLegend.replace("Text",""));
- m=this.data.legend.text[o].x-((d/this.scaleFactor)-this.offsetX);
- f=this.data.legend.text[o].y-((b/this.scaleFactor)-this.offsetY);
- this.data.legend.text[o].x-=m;
- this.data.legend.text[o].y-=f
- }
- }
- }
- }else{
- if(this.data.nodes[this.moveNodeIndex]){
- q=this.data.nodes[this.moveNodeIndex];
- if(this.is3DNetwork){
- m=(q.x3d-((d/this.scaleFactor)-this.offsetX))-this.moveNodeX;
- f=(q.y3d-((b/this.scaleFactor)-this.offsetY))-this.moveNodeY
- }else{
- m=(q.x-((d/this.scaleFactor)-this.offsetX))-this.moveNodeX;
- f=(q.y-((b/this.scaleFactor)-this.offsetY))-this.moveNodeY
- }
- if(this.moveNodeLab){
- m=q.labelX!=null?(q.labelX-((d/this.scaleFactor)-this.offsetX))-this.moveNodeX:m;
- f=q.labelY!=null?(q.labelY-((b/this.scaleFactor)-this.offsetY))-this.moveNodeY:f;
- this.modifyXYNodeLab(q.id,m,f)
- }else{
- if(this.moveNodeDec){
- m=q.decorationsX?(q.decorationsX-((d/this.scaleFactor)-this.offsetX))-this.moveNodeX:m;
- f=q.decorationsY?(q.decorationsY-((b/this.scaleFactor)-this.offsetY))-this.moveNodeY:f;
- this.modifyXYNodeDec(q.id,m,f)
- }else{
- if(D.shiftKey&&!D.ctrlKey){
- var g=(this.moveNodeW-m)+((r-this.xMouseDown)/this.scaleFactor);
- var A=(this.moveNodeH-f)+((n-this.yMouseDown)/this.scaleFactor);
- this.modifyNodeSize(q.id,Math.abs(g),Math.abs(A));
- for(var o in this.selectNode){
- if(o!=q.id){
- this.modifyNodeSize(o,g,A)
- }
- }
- }else{
- u=this.findParentNodes(q.id);
- if(this.networkLayoutType!="radial"&&((this.moveParentsWithChildren&&!D.shiftKey&&!D.ctrlKey)||(!this.moveParentsWithChildren&&D.shiftKey&&D.ctrlKey))&&u){
- q=this.data.nodes[this.data.nodeIndices[u[0]]]
- }
- this.modifyXYNode(q.id,m,f);
- if(this.selectNode){
- p[q.id]=true;
- u=this.findChildrenNodeIndices(q.id);
- if(u){
- for(var s=0;s1){
- return
- }
- if(this.moveGenome){
- this.movingOn=true;
- var k=this.$(this.target+"-cX-Drag");
- k.style.left="0px";
- k.style.width=this.width+"px";
- k.style.top=g+"px";
- k.style.height="3px"
- }else{
- var k=(a-this.xMouseDown)/this.xAxisUnit;
- if(this.setMin==null){
- this.setMin=this.xAxisMin
- }
- if(this.setMax==null){
- this.setMax=this.xAxisMax
- }
- this.setMin-=k;
- this.setMax-=k;
- this.draw();
- this.xMouseDown=a
- }
- };
-
-this.updateDrag=function(k){
- if(this.draggingOn){
- if(!k){
- k=window.event
- }
- var u=this.adjustedCoordinates(k);
- if(this.resetOn){
- this.resetOn=false;
- this.stopEvent(k);
- return
- }
- if(u){
- this.touchEvent="drag";
- var a=u.x;
- var v=u.y;
- var f=this.layoutValidR;
- var b=this.layoutValidC;
- var o=this.layoutValidN||0;
- var h=this.layoutComb?this.layoutParams[o].graphType:this.graphType;
- var q=this.layoutComb?this.layoutParams[o].varIndices:this.varIndices;
- var s;
- if(this.isGroupedData){
- s=this.layoutComb?this.layoutParams[o].grpIndices:this.grpIndices
- }else{
- s=this.layoutComb?this.layoutParams[o].smpIndices:this.smpIndices
- }
- if(h.match(/Correlation|Pie|Venn|Stacked|Area/)){
- if(this.mobileApp){
- this.movingOn=true;
- this.resetOn=false
- }
- return false
- }
- if((h=="Scatter3D"&&!k.shiftKey)||this.is3DPlot){
- this.updateDragScatter3D(a,v,f,b,o)
- }else{
- if(h=="Network"&&((this.moveNode||this.moveLegend)||(!k.ctrlKey&&!k.shiftKey&&!k.altKey))){
- this.updateDragNetwork(k,a,v,f,b,o)
- }else{
- if(h=="Genome"&&(this.moveGenome||!k.shiftKey)){
- this.updateDragGenome(k,a,v,f,b,o)
- }else{
- if(this.moveVar||this.moveSmp){
- var n=this.getBoundsXY(o);
- var m=this.$(this.target+"-cX-Drag");
- this.skipClick=true;
- if(a>=n[4]&&a<=n[5]&&v>=n[6]&&v<=n[7]){
- if(this.moveSmp){
- if(h.match(/Heatmap/)||this.graphOrientation=="horizontal"){
- m.style.top=v+"px"
- }else{
- m.style.left=a+"px"
- }
- }else{
- m.style.left=a+"px"
- }
- }
- }else{
- if(this.mobileApp&&this.touches&&this.touches.length>1){
- return
- }
- var p;
- if(this.varIndicesStart>0||this.smpIndicesStart>0){
- p=true
- }else{
- if(this.varIndicesStart==0&&this.startingVarIndices&&this.startingVarIndices[o]){
- if(this.varIndicesStart+q.lengthr){
- if(w>this.x/10){
- m=this.xMouseDown>a?39:37;
- this.xMouseDown=a;
- this.yMouseDown=v
- }
- }else{
- if(r>this.y/10){
- m=this.yMouseDown>v?40:38;
- this.xMouseDown=a;
- this.yMouseDown=v
- }
- }
-if(m){
- this.handlePanning(k,m)
- }
- this.movingOn=true;
-this.resetOn=false;
-return false
-}
-var n=this.getBoundsXY(o);
-var m=this.$(this.target+"-cX-Drag");
-this.skipClick=true;
-if((!h.match(/Scatter|Heatmap|Network|Genome|Circular/)&&this.graphOrientation=="vertical"&&!k.shiftKey)||(!h.match(/Scatter|Heatmap|Network|Genome|Circular/)&&this.graphOrientation!="vertical"&&k.shiftKey)){
- m.style.width=(n[1]-n[0])+"px"
- }else{
- if(a>this.xMouseDown){
- if(a>n[1]){
- m.style.width=(n[1]-this.xMouseDown)+"px"
- }else{
- m.style.width=(a-this.xMouseDown)+"px"
- }
- }else{
- if(athis.yMouseDown){
- if(v>n[3]){
- m.style.height=(n[3]-this.yMouseDown)+"px"
- }else{
- m.style.height=(v-this.yMouseDown)+"px"
- }
- }else{
- if(v1?parseInt(A[1]):null;
- for(var v=0;vn){
- if(a!=h&&a!=h-1){
- if(h>a){
- h--
- }
- var o=this.data.tracks.splice(a,1)[0];
- this.data.tracks.splice(h,0,o);
- this.draw()
- }else{
- if(u!=null){
- if(a==h-1){
- g=this.subtracksInfo[v-1].index;
- g++
- }
- u=this.subtracksInfo[u].index;
- if(u!=g){
- if(g>u){
- g--
- }
- var o=this.data.tracks[a].data.splice(u,1)[0];
- this.data.tracks[a].data.splice(g,0,o);
- this.draw()
- }
- }
- }
- break
- }
- }
- }
- }
-}
-}
-this.resetDrag(z)
-}else{
- if(this.movingOn&&!this.panningOn){
- var B=this.adjustedCoordinates(z);
- if(B){
- var r=B.x;
- var n=B.y;
- if(r!=this.xMouseDown||n!=this.yMouseDown){
- var A=this.$(this.target+"-cX-Drag");
- var y=parseInt(A.style.left);
- var f=parseInt(A.style.top);
- var x=y+parseInt(A.style.width);
- var c=f+parseInt(A.style.height);
- this.handleDragEvent(z,y,f,x,c);
- this.resetDrag(z)
- }
- }
- }else{
- this.resetDrag(z)
- }
-}
-}
-}
-}else{
- this.resetDrag(z)
- }
-};
-
-this.validateMinMax=function(b,a){
- if(!isNaN(b)&&!isNaN(a)){
- if(b>a){
- return false
- }
- return true
- }else{
- return false
- }
- };
-
-this.handleDragEventNetwork=function(m,c,r,b,p){
- var f={};
-
- var k=[];
- var v=[];
- var u=[];
- var o=[];
- var q={};
-
- for(var j=0;j1. Press Shift and drag mouse to resize nodes 2. Drag mouse to move nodes")
- }else{
- this.resetZoomPan();
- this.hideUnhideNodes(k,true);
- this.ctx.translate(-this.offsetX,-this.offsetY);
- this.ctx.scale(1/this.scaleFactor,1/this.scaleFactor);
- this.draw(false,false,false,true)
- }
- if(this.showDataTableOnSelect){
- if(this.networkShowDataTable=="edges"){
- for(var j=0;jg[0]&&(kg[1]){
- if(!l[e[0]]){
- this.varIndices.push(e[0]);
- l[e[0]]=1
- }
- if(!p[e[1]]){
- if(this.isGroupedData){
- this.grpIndices.push(e[1])
- }else{
- this.smpIndices.push(e[1])
- }
- p[e[1]]=1
- }
- }
- }
- for(var f=0;f0){
- this.isSelectDataPoints=p;
- this.draw();
- if(this.showDataTableOnSelect){
- var r=[];
- var x=[];
- for(u in a.v){
- r.push(parseInt(u))
- }
- for(u in a.s){
- x.push(parseInt(u))
- }
- r.sort(function(e,c){
- return(e-c)
- });
- x.sort(function(e,c){
- return(e-c)
- });
- var q=this.extractDataObject(x,r);
- this.updateDataTable(q)
- }
- }
-}else{
- var q=this.layoutComb?this.layoutParams[A]:this;
- var h=q.xAxisMin+((y-(this.marginLeft+q.offsetX+q.left))/q.xAxisUnit);
- var g=q.xAxisMin+((w-(this.marginLeft+q.offsetX+q.left))/q.xAxisUnit);
- var b=q.yAxisMax-((l-(this.marginTop+q.offsetY+q.top))/q.yAxisUnit);
- var f=q.yAxisMax-((k-(this.marginTop+q.offsetY+q.top))/q.yAxisUnit);
- if(this.validateMinMax(h,g)&&this.validateMinMax(f,b)){
- this.setMinX=h;
- this.setMaxX=g;
- this.setMaxY=b;
- this.setMinY=f;
- this.draw()
- }
- }
-};
-
-this.handleDragEventGenome=function(i,d,f,b,e){
- var a,h;
- var g=this.layoutComb?this.layoutParams[i]:this;
- var a=g.xAxisMin+((d-(this.marginLeft+g.offsetX+g.left))/g.xAxisUnit);
- var h=g.xAxisMin+((b-(this.marginLeft+g.offsetX+g.left))/g.xAxisUnit);
- if(this.validateMinMax(a,h)){
- this.setMin=a;
- this.setMax=h;
- this.draw()
- }
- };
-
-this.handleDragEventOneDimension=function(D,a,H,B,d,A,b,K){
- if(this.moveVar){
- var l=this.moveVar.split("-")[1];
- if(this.showVarDendrogram&&this.varDendrogram){
- alert("Ooops. Cannot change order when showing the dendrogram");
- return false
- }
- var u=this.layoutComb?this.layoutParams[H].varIndices:this.varIndices;
- var p;
- for(var y=0;yB){
- p=y;
- break
- }
- }
- u.splice(p,0,l[0]);
-this.draw();
-this.skipClick=false
-}else{
- if(this.moveSmp){
- var l=this.moveSmp.split("-")[1];
- var r;
- var j=this.isGroupedData?this.grpIndices:this.smpIndices;
- if(this.isGroupedData){
- r=this.layoutComb?this.layoutParams[H].grpIndices:this.grpIndices
- }else{
- r=this.layoutComb?this.layoutParams[H].smpIndices:this.smpIndices;
- if(this.showSmpDendrogram&&this.smpDendrogram){
- alert("Ooops. Cannot change order when showing the dendrogram");
- return false
- }
- }
- var p;
- for(var y=0;yx){
- p=y;
- break
- }
-}
-r.splice(p,0,l[0]);
-this.draw();
-this.skipClick=false
-}else{
- if(D.shiftKey||K){
- var n={};
-
- var J=[];
- var r;
- var u=this.layoutComb?this.layoutParams[H].varIndices:this.varIndices;
- var j=this.isGroupedData?this.grpIndices:this.smpIndices;
- var h=false;
- if(this.isGroupedData){
- r=this.layoutComb?this.layoutParams[H].grpIndices:this.grpIndices
- }else{
- r=this.layoutComb?this.layoutParams[H].smpIndices:this.smpIndices
- }
- this.setOriginalIndices(H,u,r);
- for(var y=0;y0&&this.showVolume;
- var k=this.layoutComb&&this.layoutCurrent!=H;
- var v=m&&k?q.xAxis2Min:q.xAxisMin;
- var z=m&&k?q.xAxis2Max:q.xAxisMax;
- var G=this.marginLeft+q.offsetX+q.left;
- var F=G+q.x;
- var E=this.marginTop+q.offsetY+q.top;
- var C=E+q.y;
- if(this.graphOrientation=="vertical"){
- v=m?v+((C-b)/q.xAxis2Unit):v+((C-b)/q.xAxisUnit);
- z=m?z-((d-E)/q.xAxis2Unit):z-((d-E)/q.xAxisUnit)
- }else{
- v=m?v+((B-G)/q.xAxis2Unit):v+((B-G)/q.xAxisUnit);
- z=m?z-((F-A)/q.xAxis2Unit):z-((F-A)/q.xAxisUnit)
- }
- if(this.validateMinMax(v,z)){
- if(m){
- this.setMin2=v;
- this.setMax2=z
- }else{
- this.setMin=v;
- this.setMax=z
- }
- this.draw()
- }
- }
-}
-}
-};
-
-this.handleDragEvent=function(h,b,f,a,d){
- var i=this.layoutComb?this.layoutValidN:0;
- var g=this.layoutComb?this.layoutParams[i].graphType:this.graphType;
- if(g=="Network"){
- this.handleDragEventNetwork(h,b,f,a,d)
- }else{
- if(g=="Heatmap"&&!this.moveVar&&!this.moveSmp){
- this.handleDragEventHeatmap(i,b,f,a,d)
- }else{
- if(g.match(/Scatter/)){
- this.handleDragEventScatter(h,g,i,b,f,a,d)
- }else{
- if(g=="Genome"){
- this.handleDragEventGenome(i,b,f,a,d)
- }else{
- this.handleDragEventOneDimension(h,g,i,b,f,a,d)
- }
- }
- }
-}
-};
-
-this.resetDrag=function(a){
- var b=this.$(this.target+"-cX-Drag");
- if(b){
- b.style.left="0px";
- b.style.top="0px";
- b.style.width="0px";
- b.style.height="0px"
- }
- };
-
-this.initializeDraggingEvents=function(){
- if(!this.disableEvents){
- this.addDragDiv()
- }
- };
-
-this.initializeDraggingEvents()
-};
-
-CanvasXpress.prototype.initKeyEvents=function(){
- this.getKeyCode=function(a){
- if(a){
- if((a.charCode)&&(a.keyCode==0)){
- return a.charCode
- }else{
- return a.keyCode
- }
- }
- };
-
-this.registerKey=function(b){
- if(!b){
- b=window.event
- }
- var a=this.getTargetEvent(b);
- var d=this.getKeyCode(b);
- if(this.eventKeys||(b.ctrlKey&&b.altKey&&d==107)){
- if(d==27){
- if(this.animationOn){
- this.animationOn=false;
- return false
- }
- this.masterReset(b)
- }else{
- if(this.configuringOn){
- return
- }else{
- if(d==16&&this.helpKeyEvents){
- if(b.ctrlKey&&b.altKey){
- this.showCtrlShiftAltShorts()
- }else{
- if(b.ctrlKey){
- this.showCtrlShiftShorts()
- }else{
- if(b.altKey){
- this.showShiftAltShorts()
- }else{
- this.showShiftShorts()
- }
- }
- }
- }else{
- if(d==17&&this.helpKeyEvents){
- if(b.shiftKey&&b.altKey){
- this.showCtrlShiftAltShorts()
- }else{
- if(b.shiftKey){
- this.showCtrlShiftShorts()
- }else{
- if(b.altKey){
- this.showCtrlAltShorts()
- }else{
- this.showCtrlShorts()
- }
- }
- }
- }else{
- if((d==18||d==224)&&this.helpKeyEvents){
- if(b.ctrlKey&&b.shiftKey){
- this.showCtrlShiftAltShorts()
- }else{
- if(b.ctrlKey){
- this.showCtrlAltShorts()
- }else{
- if(b.shiftKey){
- this.showShiftAltShorts()
- }else{
- this.showAltShorts()
- }
- }
- }
-}else{
- if(b.ctrlKey&&b.shiftKey){
- if(d>=33&&d<=40){
- this.arrowMove(d,true)
- }else{
- if(d==80&&!this.keyOn){
- this.keyOn=true;
- this.print()
- }else{
- if(d==88&&!this.keyOn){
- this.keyOn=true;
- this.clearNetworkStack()
- }else{
- if(d==90&&this.graphType=="Network"&&!this.keyOn){
- this.keyOn=true;
- this.alignDistributeSelectedNodes(b,d)
- }
- }
- }
- }
-document.defaultAction=true
-}else{
- if(b.ctrlKey&&b.altKey){
- if(d==80&&!this.keyOn){
- this.keyOn=true;
- this.print()
- }
- document.defaultAction=true
- }else{
- if(b.shiftKey&&b.altKey){
- if(d>=50&&d<90&&!this.keyOn){
- this.keyOn=true;
- this.setGraphType(d)
- }
- document.defaultAction=true
- }else{
- if(b.ctrlKey){
- if(d>=33&&d<=40){
- if(d==36&&this.isSelectDataPoints&&this.graphType=="Scatter3D"){
- this.showHideSelectedDataPoint(b,d)
- }else{
- if(d==36&&this.isSelectNodes&&this.graphType=="Network"){
- this.showHideSelectedDataPoint(b,d)
- }else{
- this.arrowMove(d)
- }
- }
- }else{
- if((d==45||d==46)&&!this.keyOn){
- this.keyOn=true;
- this.showHideSelectedDataPoint(b,d)
- }else{
- if((d>=48&&d<58)&&!this.keyOn){
- this.keyOn=true;
- this.setLayout(d-48)
- }else{
- if(d>=65&&d<=90){
- if(d==80&&!this.keyOn){
- this.keyOn=true;
- this.print()
- }
- if(this.graphType=="Network"&&!this.keyOn){
- this.keyOn=true;
- this.alignDistributeSelectedNodes(b,d)
- }
- }
- }
- }
-}
-document.defaultAction=true
-}else{
- if(d==107||d==109||d==61||d==187||d==189){
- if(this.eventPlusMinusKeys&&!/input|textarea|select/i.test(a.tagName)){
- if(d==109||d==189){
- this.handleWheelEvent(b,-1)
- }else{
- this.handleWheelEvent(b,1)
- }
- }
- }else{
- if(d>=33&&d<=40){
- if(this.eventArrowKeys&&!/input|textarea|select/i.test(a.tagName)){
- this.handlePanning(b,d)
- }
- }else{
- if(b.shiftKey){
- document.defaultAction=true
- }else{
- if(b.altKey){
- document.defaultAction=true
- }
- }
-}
-}
-}
-}
-}
-}
-}
-}
-}
-}
-}
-}
-};
-
-this.handlePanning=function(f,j){
- if(this.graphType=="Network"){
- this.cancelEvent(f);
- var m=Math.abs(this.x*this.panningStep);
- var k=Math.abs(this.y*this.panningStep);
- if(j==33){
- this.panningY-=k*5
- }else{
- if(j==34){
- this.panningY+=k*5
- }else{
- if(j==35){
- this.panningX=m*20;
- this.panningY=k*20
- }else{
- if(j==36){
- this.panningX=0;
- this.panningY=0
- }else{
- if(j==37){
- this.panningX-=m
- }else{
- if(j==38){
- this.panningY-=k
- }else{
- if(j==39){
- this.panningX+=m
- }else{
- if(j==40){
- this.panningY+=k
- }
- }
- }
- }
- }
- }
-}
-}
-this.draw(false,false,false,true)
-}else{
- if(this.graphType=="Genome"){
- var p=this.genomeResolution=="high"?1:this.xAxisRange*this.panningStep;
- if(this.setMin==null){
- this.setMin=this.xAxisMin
- }
- if(this.setMax==null){
- this.setMax=this.xAxisMax
- }
- this.cancelEvent(f);
- if(j==37||j==38){
- this.setMin-=p;
- this.setMax-=p
- }else{
- if(j==39||j==40){
- this.setMin+=p;
- this.setMax+=p
- }else{
- if(j==33){
- this.setMin+=this.xAxisRange*0.95;
- this.setMax+=this.xAxisRange*0.95
- }else{
- if(j==34){
- this.setMin-=this.xAxisRange*0.95;
- this.setMax-=this.xAxisRange*0.95
- }else{
- if(j==35){
- this.setMax=null
- }else{
- if(j==36){
- this.setMin=null
- }
- }
- }
- }
- }
-}
-this.draw()
-}else{
- if(this.graphType=="Heatmap"){
- this.cancelEvent(f);
- this.resetAxesResizer(f);
- var g=this.layoutComb?this.layoutValidN:0;
- var q;
- var n=this.layoutComb?this.layoutParams[g].varIndices:this.varIndices;
- if(this.isGroupedData){
- q=this.layoutComb?this.layoutParams[g].grpIndices:this.grpIndices
- }else{
- q=this.layoutComb?this.layoutParams[g].smpIndices:this.smpIndices
- }
- this.setOriginalIndices(j,n,q);
- if(j==35){
- return false
- }else{
- if(j==36){
- this.varIndicesStart=-1;
- this.smpIndicesStart=-1;
- this.varIndices=this.startingVarIndices[g];
- if(this.isGroupedData){
- this.grpIndices=this.startingSmpIndices[g]
- }else{
- this.smpIndices=this.startingSmpIndices[g]
- }
- this.draw()
- }else{
- if(j==37){
- if(this.varIndicesStart>0){
- this.varIndices.unshift(this.startingVarIndices[g][this.varIndicesStart-1]);
- this.varIndices.pop();
- this.varIndicesStart--;
- this.draw()
- }
- }else{
- if(j==38||j==33){
- var o=j==33?5:1;
- var h=false;
- var a=this.isGroupedData?this.grpIndices:this.smpIndices;
- for(var b=0;b0){
- a.unshift(this.startingSmpIndices[g][this.smpIndicesStart-1]);
- a.pop();
- this.smpIndicesStart--;
- h=true
- }
- }
- if(h){
- this.draw()
- }
- }else{
- if(j==39){
- if(this.varIndicesStart>-1&&this.varIndicesStart+n.length-1&&this.smpIndicesStart+q.length0){
- this.smpIndicesStart--;
- q.unshift(this.startingSmpIndices[g][this.smpIndicesStart]);
- q.pop();
- h=true
- }
- }
- }else{
- if(j==39||j==40||j==34){
- var o=j==34?5:1;
- for(var b=0;bCtrl + Shift + Alt ";
- a+=" ";
- a+="";
- this.showInfoSpan(false,a)
- };
-
-this.showCtrlShiftShorts=function(){
- var a="";
- a+="Shift + Ctrl ";
- if(this.graphType=="Network"){
- if(this.is3DNetwork){
- a+="→ Rotate clockwise "+(this.rotationStep*1)+"° continuously ";
- a+="← Rotate anti-clockwise "+(this.rotationStep*1)+"° continuously ";
- a+="↓ Rotate forward "+(this.rotationStep*1)+"° continuously ";
- a+="↑ Rotate backward "+(this.rotationStep*1)+"° continuously ";
- a+="PgUp Rotate anti-clockwise and backward "+(this.rotationStep*3)+"° continuously ";
- a+="PgDn Rotate clockwise and forward "+(this.rotationStep*3)+"° continuously "
- }else{
- a+="→ or ↓ Rotate clockwise "+(this.rotationStep*1)+"° continuously ";
- a+="← or ↑ Rotate anti-clockwise "+(this.rotationStep*1)+"° continuously ";
- a+="PgUp Rotate anti-clockwise "+(this.rotationStep*3)+"° continuously ";
- a+="PgDn Rotate clockwise "+(this.rotationStep*3)+"° continuously "
- }
- }else{
- if(this.graphType=="Scatter2D"||this.graphType=="ScatterBubble2D"){
- if(this.type2D=="XYZ"){
- if(this.xAxis.length>1){
- a+="→ or ↓ or ← or ↑ Update samples in X, Y and Z axes continuously (1x) ";
- a+="PgUp or PgDn Update samples in X, Y and Z axes continuously (2x) "
- }
- }else{
- if(this.type2D=="XY"){
- if(this.zAxis.length>1){
- a+="→ or ↓ or ← or ↑ Update sample in Z axis continuously (1x) ";
- a+="PgUp or PgDn Update sample in Z axis continuously (2x) "
- }
- }else{
- if(this.type2D=="X"){
- if(this.yAxis.length>1){
- a+="→ or ↓ or ← or ↑ Update samples in Y and Z axes continuously (1x) ";
- a+="PgUp or PgDn Update samples in Y and Z axes continuously (2x) "
- }
- }else{
- if(this.xAxis.length>1){
- a+="→ or ↓ or ← or ↑ Update samples in X and Z axes continuously (1x) ";
- a+="PgUp or PgDn Update samples in X and Z axes continuously (2x) "
- }
- }
-}
-}
-}else{
- if(this.graphType=="Scatter3D"){
- a+="→ or ↓ or ← or ↑ Rotate continuously ";
- a+="PgUp or PgDn Rotate continuously "
- }
- }
-}
-a+="P Print ";
-a+="
";
-this.showInfoSpan(false,a)
-};
-
-this.showCtrlAltShorts=function(){
- var a="";
- a+="Ctrl + Alt ";
- a+="P Print ";
- a+="
";
- this.showInfoSpan(false,a)
- };
-
-this.showShiftAltShorts=function(){
- var a="";
- a+="Shift + Alt ";
- a+="2 Scatter2D ";
- a+="3 Scatter3D ";
- a+="4 ScatterBubble2D ";
- a+="A Area ";
- a+="B Bar ";
- a+="C BarLine ";
- a+="D Dotplot ";
- a+="G Genome ";
- a+="H Heatmap ";
- a+="I Boxplot ";
- a+="L Line ";
- a+="M Candlestick ";
- a+="N Network ";
- a+="P Pie ";
- a+="R Circular ";
- a+="S Stacked ";
- a+="T StackedPercent ";
- a+="U StackedLine ";
- a+="W StackedPercentLine ";
- a+="V Venn ";
- a+="X Correlation ";
- a+="
";
- this.showInfoSpan(false,a)
- };
-
-this.showCtrlShorts=function(){
- var a="";
- a+="Ctrl ";
- if(this.graphType=="Network"){
- if(this.is3DNetwork){
- a+="→ Rotate clockwise "+(this.rotationStep*1)+"° ";
- a+="← Rotate anti-clockwise "+(this.rotationStep*1)+"° ";
- a+="↓ Rotate forward "+(this.rotationStep*1)+"° ";
- a+="↑ Rotate backward "+(this.rotationStep*1)+"° ";
- a+="PgUp Rotate anti-clockwise and backward "+(this.rotationStep*3)+"° ";
- a+="PgDn Rotate clockwise and forward "+(this.rotationStep*3)+"° "
- }else{
- a+="→ or ↓ Rotate clockwise "+(this.rotationStep*1)+"° ";
- a+="← or ↑ Rotate anti-clockwise "+(this.rotationStep*1)+"° ";
- a+="PgUp Rotate anti-clockwise "+(this.rotationStep*3)+"° ";
- a+="PgDn Rotate clockwise "+(this.rotationStep*3)+"° "
- }
- a+="click Select/Unselect node ";
- if(this.isSelectNodes){
- a+="Delete Hide selected nodes ";
- a+="Insert Show selected-hidden nodes ";
- a+="Home Show connected nodes to slected nodes ";
- a+="t Align top ";
- a+="r Align right ";
- a+="b Align bottom ";
- a+="l Align left ";
- a+="v Distribute verticaly ";
- a+="h Distribute Horizontaly ";
- a+="z Undo ";
- a+="y Redo "
- }
- }else{
- if(this.graphType=="Scatter2D"||this.graphType=="ScatterBubble2D"){
- if(this.type2D=="XYZ"){
- if(this.xAxis.length>1){
- a+="→ or ↓ or ← or ↑ Update samples in X, Y and Z axes (1x) ";
- a+="PgUp or PgDn Update samples in X, Y and Z axes (2x) "
- }
- }else{
- if(this.type2D=="XY"){
- if(this.zAxis.length>1){
- a+="→ or ↓ or ← or ↑ Update sample in Z axis (1x) ";
- a+="PgUp or PgDn Update sample in Z axis (2x) "
- }
- }else{
- if(this.type2D=="X"){
- if(this.yAxis.length>1){
- a+="→ or ↓ or ← or ↑ Update samples in Y and Z axes (1x) ";
- a+="PgUp or PgDn Update samples in Y and Z axes (2x) "
- }
- }else{
- if(this.xAxis.length>1){
- a+="→ or ↓ or ← or ↑ Update samples in X and Z axes (1x) ";
- a+="PgUp or PgDn Update samples in X and Z axes (2x) "
- }
- }
-}
-}
-if(this.isSelectDataPoints){
- a+="Delete Hide selected nodes ";
- a+="Insert Show selected-hidden nodes "
- }
-}else{
- if(this.graphType=="Scatter3D"){
- a+="→ Rotate clockwise "+(this.rotationStep*1)+"° ";
- a+="← Rotate anti-clockwise "+(this.rotationStep*1)+"° ";
- a+="↓ Rotate forward "+(this.rotationStep*1)+"° ";
- a+="↑ Rotate backward "+(this.rotationStep*1)+"° ";
- a+="PgUp Rotate anti-clockwise and backward "+(this.rotationStep*3)+"° ";
- a+="PgDn Rotate clockwise and forward "+(this.rotationStep*3)+"° ";
- a+="click Select/Unselect data points ";
- if(this.isSelectDataPoints){
- a+="Delete Hide selected nodes ";
- a+="Insert Show selected-hidden nodes ";
- a+="Home Zoom to selected nodes "
- }
- }else{
- if(this.isSegregable()){}
-}
-}
-}
-a+="P Print ";
-a+="
";
-this.showInfoSpan(false,a)
-};
-
-this.showShiftShorts=function(){
- var a="";
- a+="Shift ";
- if(this.isSegregable()){
- a+="Click and Drag Select Samples "
- }else{
- a+=" "
- }
- a+="
";
- this.showInfoSpan(false,a)
- };
-
-this.showAltShorts=function(){
- var a="";
- a+="Alt ";
- a+=" ";
- a+="
";
- this.showInfoSpan(false,a)
- };
-
-this.arrowMove=function(j,b){
- var e=this.graphType;
- if(this.is3DPlot){
- e="Scatter3D;"
- }
- switch(e){
- case"Network":
- if(this.is3DNetwork){
- if(j==33){
- this.xRotate+=(this.rotationStep*3);
- this.yRotate-=(this.rotationStep*3)
- }else{
- if(j==34){
- this.xRotate-=(this.rotationStep*3);
- this.yRotate+=(this.rotationStep*3)
- }else{
- if(j==37){
- this.xRotate+=this.rotationStep
- }else{
- if(j==38){
- this.yRotate-=this.rotationStep
- }else{
- if(j==39){
- this.xRotate-=this.rotationStep
- }else{
- if(j==40){
- this.yRotate+=this.rotationStep
- }
- }
- }
- }
- }
- }
-}else{
- if(j==33){
- this.network2DRotate-=(this.rotationStep*3)
- }else{
- if(j==34){
- this.network2DRotate+=(this.rotationStep*3)
- }else{
- if(j==37||j==38){
- this.network2DRotate-=this.rotationStep
- }else{
- if(j==39||j==40){
- this.network2DRotate+=this.rotationStep
- }
- }
- }
-}
-}
-break;
-case"Scatter2D":case"ScatterBubble2D":
- var f;
- var h;
- if(this.type2D=="XYZ"){
- f=["xAxisCurrent","yAxisCurrent","zAxisCurrent"];
- h=["xAxis","yAxis","zAxis"]
- }else{
- if(this.type2D=="XY"){
- f=["zAxisCurrent"];
- h=["zAxis"]
- }else{
- if(this.type2D=="X"){
- f=["yAxisCurrent","zAxisCurrent"];
- h=["yAxis","zAxis"]
- }else{
- f=["xAxisCurrent","zAxisCurrent"];
- h=["xAxis","zAxis"]
- }
- }
-}
-if(j==33){
- for(var d=0;dthis.xAxis.length-1?0:this.xAxisCurrent;
-this.yAxisCurrent=this.yAxisCurrent<0?this.xAxis.length-1:this.yAxisCurrent>this.yAxis.length-1?0:this.yAxisCurrent;
-this.zAxisCurrent=this.zAxisCurrent<0?this.xAxis.length-1:this.zAxisCurrent>this.zAxis.length-1?0:this.zAxisCurrent;
-break;
-case"Scatter3D":
- if(j==33){
- this.xRotate+=(this.rotationStep*3);
- this.yRotate-=(this.rotationStep*3)
- }else{
- if(j==34){
- this.xRotate-=(this.rotationStep*3);
- this.yRotate+=(this.rotationStep*3)
- }else{
- if(j==35){
- this.xRotate=0;
- this.yRotate=0;
- this.zRotate=45
- }else{
- if(j==36){
- this.xRotate=45;
- this.yRotate=0;
- this.zRotate=0
- }else{
- if(j==37){
- this.xRotate+=this.rotationStep
- }else{
- if(j==38){
- this.yRotate-=this.rotationStep
- }else{
- if(j==39){
- this.xRotate-=this.rotationStep
- }else{
- if(j==40){
- this.yRotate+=this.rotationStep
- }
- }
- }
- }
- }
-}
-}
-}
-break
-}
-if(b&&!this.animationOn){
- this.animationOn=true;
- this.animate(j)
- }else{
- this.draw(false,false,false,true)
- }
-};
-
-this.animate=function(d){
- var a=this;
- var b=function(){
- this.update=function(){
- if(!a.animationOn){
- clearInterval(c)
- }
- a.arrowMove(d);
- var e=a.graphType;
- if(a.is3DPlot){
- e="Scatter3D"
- }
- switch(e){
- case"Network":
- if(this.is3DNetwork){
- if(d==33){
- this.xRotate+=(this.rotationStep*3);
- this.yRotate-=(this.rotationStep*3)
- }else{
- if(d==34){
- this.xRotate-=(this.rotationStep*3);
- this.yRotate+=(this.rotationStep*3)
- }else{
- if(d==37){
- this.xRotate-=this.rotationStep
- }else{
- if(d==38){
- this.yRotate-=this.rotationStep
- }else{
- if(d==39){
- this.xRotate+=this.rotationStep
- }else{
- if(d==40){
- this.yRotate+=this.rotationStep
- }
- }
- }
- }
- }
- }
- }else{
- if(d==33){
- this.network2DRotate+=(this.rotationStep*3)
- }else{
- if(d==34){
- this.network2DRotate-=(this.rotationStep*3)
- }else{
- if(d==37||d==38){
- this.network2DRotate-=this.rotationStep
- }else{
- if(d==39||d==40){
- this.network2DRotate+=this.rotationStep
- }
- }
- }
-}
-}
-break;
-case"Scatter2D":case"ScatterBubble2D":
- if(d!=37){
- if(a.graphType=="ScatterBubble2D"&&a.xAxisIndices.length>1&&a.xAxisIndices.length==a.yAxisIndices.length&&a.xAxisIndices.length==a.zAxisIndices.length){
- if(a.xAxisCurrent>=a.xAxis.length-1){
- a.xAxisCurrent=a.xAxis.length-1;
- a.yAxisCurrent=a.yAxis.length-1;
- a.zAxisCurrent=a.zAxis.length-1;
- d=37
- }
- }else{
- if(a.xAxisIndices.length>1&&a.xAxisIndices.length==a.yAxisIndices.length){
- if(a.zAxisCurrent>=a.zAxis.length-1){
- a.zAxisCurrent=a.zAxis.length-1;
- d=37
- }
- }else{
- if(a.xAxisIndices.length>a.yAxisIndices.length){
- if(a.yAxisCurrent>=a.yAxis.length-1){
- a.yAxisCurrent=a.yAxis.length-1
- }
- if(a.zAxisCurrent>=a.zAxis.length-1){
- a.zAxisCurrent=a.zAxis.length-1
- }
- if(a.yAxisCurrent>=a.yAxis.length-1&&a.zAxisCurrent>=a.zAxis.length-1){
- d=37
- }
- }else{
- if(a.xAxisCurrent>=a.xAxis.length-1){
- a.xAxisCurrent=a.xAxis.length-1
- }
- if(a.zAxisCurrent>=a.zAxis.length-1){
- a.zAxisCurrent=a.zAxis.length-1
- }
- if(a.xAxisCurrent>=a.xAxis.length-1&&a.zAxisCurrent>=a.zAxis.length-1){
- d=37
- }
- }
-}
-}
-}else{
- if(d!=39){
- if(a.graphType=="ScatterBubble2D"&&a.xAxisIndices.length>1&&a.xAxisIndices.length==a.yAxisIndices.length&&a.xAxisIndices.length==a.zAxisIndices.length){
- if(a.xAxisCurrent<=0){
- a.xAxisCurrent=0;
- a.yAxisCurrent=0;
- a.zAxisCurrent=0;
- d=39
- }
- }else{
- if(a.xAxisIndices.length>1&&a.xAxisIndices.length==a.yAxisIndices.length){
- if(a.zAxisCurrent<=0){
- a.zAxisCurrent=0;
- d=39
- }
- }else{
- if(a.xAxisIndices.length>a.yAxisIndices.length){
- if(a.yAxisCurrent<=0){
- a.yAxisCurrent=0
- }
- if(a.zAxisCurrent<=0){
- a.zAxisCurrent=0
- }
- if(a.yAxisCurrent<=0&&a.zAxisCurrent<=0){
- d=39
- }
- }else{
- if(a.xAxisCurrent<=0){
- a.xAxisCurrent=0
- }
- if(a.zAxisCurrent<=0){
- a.zAxisCurrent=0
- }
- if(a.xAxisCurrent<=0&&a.zAxisCurrent<=0){
- d=39
- }
- }
-}
-}
-}
-}
-break;
-case"Scatter3D":
- if(a.xRotate<=0&&(d==39||d<37)){
- a.xRotate=0;
- a.yRotate=0;
- d=40
- }else{
- if(a.xRotate>=90&&(d==37||d<37)){
- a.xRotate=90;
- a.yRotate=90;
- d=38
- }else{
- if(a.yRotate<=0&&(d==38||d<37)){
- a.yRotate=0;
- a.xRotate=90;
- d=39
- }else{
- if(a.yRotate>=90&&(d==40||d<37)){
- a.yRotate=90;
- a.xRotate=0;
- d=37
- }
- }
- }
-}
-break
-}
-};
-
-var c=setInterval(this.update,a.animationTime)
-};
-
-b.call()
-};
-
-this.setGraphType=function(b){
- var a;
- if(b==66){
- a="Bar"
- }else{
- if(b==76){
- a="Line"
- }else{
- if(b==65){
- a="Area"
- }else{
- if(b==67){
- a="BarLine"
- }else{
- if(b==73){
- a="Boxplot"
- }else{
- if(b==68){
- a="Dotplot"
- }else{
- if(b==72){
- a="Heatmap"
- }else{
- if(b==83){
- a="Stacked"
- }else{
- if(b==85){
- a="StackedLine"
- }else{
- if(b==84){
- a="StackedPercent"
- }else{
- if(b==87){
- a="StackedPercentLine"
- }else{
- if(b==50){
- a="Scatter2D"
- }else{
- if(b==52){
- a="ScatterBubble2D"
- }else{
- if(b==51){
- a="Scatter3D"
- }else{
- if(b==88){
- a="Correlation"
- }else{
- if(b==86){
- a="Venn"
- }else{
- if(b==80){
- a="Pie"
- }else{
- if(b==78){
- a="Network"
- }else{
- if(b==71){
- a="Genome"
- }else{
- if(b==77){
- a="Candlestick"
- }else{
- if(b==82){
- a="Circular"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-}
-}
-}
-}
-}
-}
-}
-}
-}
-if(a&&this.isValidGraphType(a)){
- this.graphType=a;
- this.draw()
- }else{
- alert("Dude! You cannot plot this data in a "+a+" graph")
- }
-};
-
-this.reset=function(){
- this.varIndicesStart=-1;
- this.smpIndicesStart=-1;
- switch(this.graphType){
- case"Area":case"AreaLine":case"Stacked":case"StackedLine":case"StackedPercent":case"StackedPercentLine":case"Heatmap":case"Correlation":case"Venn":case"Pie":case"Bar":case"Line":case"BarLine":case"Boxplot":case"Dotplot":case"Candlestick":case"Circular":
- this.setAllVariablesVisible();
- this.setAllSamplesVisible();
- break;
- case"Scatter2D":case"ScatterBubble2D":case"Scatter3D":
- this.resetSelectedDataPoints();
- this.setAllVariablesVisible();
- this.setAllSamplesVisible();
- break;
- case"Network":
- this.resetSelectedNodes();
- this.setAllNodesVisible();
- this.ctx.translate(-this.offsetX,-this.offsetY);
- this.ctx.scale(1/this.scaleFactor,1/this.scaleFactor);
- break;
- case"Genome":
- this.setAllFeaturesVisible();
- break
- }
- };
-
-this.redraw=function(){
- this.setInitialConfig();
- this.varIndicesStart=-1;
- this.smpIndicesStart=-1;
- switch(this.graphType){
- case"Area":case"AreaLine":case"Stacked":case"StackedLine":case"StackedPercent":case"StackedPercentLine":case"Correlation":case"Venn":case"Pie":case"Circular":
- this.setAllVariablesVisible();
- this.setAllSamplesVisible();
- return true;
- case"Bar":case"Line":case"BarLine":case"Boxplot":case"Dotplot":case"Genome":case"Candlestick":
- this.setAllVariablesVisible();
- this.setAllSamplesVisible();
- this.setMin=null;
- this.setMax=null;
- this.setMin2=null;
- this.setMax2=null;
- this.xRotate=45;
- this.yRotate=0;
- break;
- case"Scatter2D":case"ScatterBubble2D":
- this.resetSelectedDataPoints();
- this.setAllVariablesVisible();
- this.setAllSamplesVisible();
- this.setMinX=null;
- this.setMaxX=null;
- this.setMinY=null;
- this.setMaxY=null;
- break;
- case"Scatter3D":
- this.resetSelectedDataPoints();
- this.setAllVariablesVisible();
- this.setAllSamplesVisible();
- this.xRotate=45;
- this.yRotate=0;
- break;
- case"Heatmap":
- this.setAllVariablesVisible();
- this.setAllSamplesVisible();
- break;
- case"Network":
- this.resetSelectedNodes();
- this.setAllNodesVisible();
- this.network2DRotate=0;
- if(this.randomNetwork){
- this.layoutDone=false
- }
- this.ctx.translate(-this.offsetX,-this.offsetY);
- this.ctx.scale(1/this.scaleFactor,1/this.scaleFactor);
- break
- }
- this.draw();
- return true
- };
-
-this.resetZoomPan=function(){
- this.zoom=1;
- this.panningX=0;
- this.panningY=0;
- this.panningGlobalX=0;
- this.panningGlobalY=0;
- this.padX=this.x/2;
- this.padY=this.y/2;
- this.padZ=this.y/2
- };
-
-this.resetSelectedObjects=function(){
- if(this.isSelectDataPoints||this.isSelectNodes){
- this.resetSelectedDataPoints();
- this.resetSelectedNodes();
- this.redraw()
- }
- };
-
-this.masterReset=function(a){
- this.resetTooltipDivs();
- this.resetDrag(a);
- this.resetSelectedDataPoints();
- this.resetSelectedNodes();
- if(this.dataTableLastState&&this.dataTableLastState!="docked"){
- this.hideUnhideDataTable(true)
- }
- this.resetConfigurator();
- this.resetAxesResizer(a);
- this.resetFlags(a);
- this.resetZoomPan();
- this.redraw()
- }
-};
-
-CanvasXpress.prototype.initSelectEvents=function(){
- this.showHideSelectedDataPoint=function(j,l){
- if(j){
- this.stopEvent(j)
- }
- var o=this.layoutComb?this.layoutValidN:0;
- var r=this.layoutComb?this.layoutParams[o].graphType:this.graphType;
- var q=[];
- if(l==45||l==46){
- if(r=="Network"){
- var a=[];
- var k=l==45?false:true;
- for(var d in this.selectNode){
- a.push(d)
- }
- if(a.length>0){
- this.hideUnhideNodes(a,k)
- }
- }else{
- if(r.match(/Scatter/)){
- if(l==45){
- this.selectDataPoint=this.hideDataPoint;
- this.hideDataPoint=[]
- }else{
- if(l==46){
- this.hideDataPoint=this.selectDataPoint;
- this.selectDataPoint=[]
- }
- }
- if(r=="Scatter3D"){
- var m=this.xAxisIndex+":"+this.yAxisIndex+":"+this.zAxisIndex;
- for(var g=0;g0){
- this.hideUnhideNodes(h,true);
- this.draw()
- }
- }else{
- if(r=="Scatter3D"){
- if(this.isSelectDataPoints){
- for(var g in this.selectDataPoint){
- var p=parseInt(g);
- if(!isNaN(p)){
- q.push(this.varIndices[p])
- }
- }
- this.isSelectDataPoints=0;
- this.selectDataPoint=[];
- this.varIndices=q;
- this.draw()
- }
- }
-}
-}
-}
-};
-
-this.addRemoveToSelectedDataPoints=function(h,f){
- var b=this.broadcast?CanvasXpress.references:[this];
- for(var e=0;e to show or hide help on key events"')
- }else{
- if(a.isAxis(b)){
- a.stopEvent(b)
- }else{
- if(a.axesResizerShow&&!a.resizerType){
- a.stopEvent(b);
- a.resetAxesResizer(b)
- }else{
- if(a.mobileApp){
- a.stopEvent(b);
- a.addConfigurator(b)
- }else{
- var c=a.getEventDataId(b);
- if(c){
- a.handleMouseEvents("click",b,c)
- }else{
- a.resetSelectedObjects()
- }
- }
- }
- }
- }
- }
-}else{
- a.resetConfigurator()
- }
- a.lastCanvasEvent="click"
-}
-};
-
-setTimeout(a.clickBuffer,250);
-setTimeout(function(){
- a.doubleClick=false
- },500)
-}
-}(this);
-this.dblclickCanvas=function(a){
- return function(c){
- if(!c){
- c=window.event
- }
- a.doubleClick=true;
- if(a.clickBuffer){
- clearTimeout(a.clickBuffer);
- a.clickBuffer=null
- }
- if(!a.skipClick){
- var b=a.getEventDataId(c);
- if(b){
- if(a.graphType=="Network"||a.graphType=="Genome"){
- a.addConfigurator(c,b)
- }else{
- a.handleMouseEvents("dblclick",c,b)
- }
- }else{
- a.cancelEvent(c);
- a.addConfigurator(c)
- }
- a.lastCanvasEvent="dblclick"
- }
- return false
- }
-}(this);
-this.wheelCanvas=function(a){
- return function(b){
- if(!b){
- b=window.event
- }
- var c=0;
- if(!b){
- b=window.event
- }
- if(b.wheelDelta){
- c=b.wheelDelta/120;
- if(window.opera){
- c=-c
- }
- }else{
- if(b.detail){
- c=-b.detail/3
- }
- }
- if(c){
- a.handleWheelEvent(b,c)
- }
-}
-}(this);
-this.addRemoveCanvasListeners=function(a){
- this[a](this.canvas,"contextmenu",this.contextmenuCanvas,false);
- this[a](this.canvas,"mousedown",this.mousedownCanvas,false);
- this[a](this.canvas,"touchstart",this.mousedownCanvas,false);
- this[a](this.canvas,"click",this.clickCanvas,false);
- this[a](this.canvas,"dblclick",this.dblclickCanvas,false);
- this[a](this.canvas,"mousewheel",this.wheelCanvas,false)
- };
-
-this.isVersion=function(b){
- if(this.showVersion){
- var a=this.adjustedCoordinates(b);
- return a&&a.x>0&&a.x<=10&&a.y>0&&a.y<=10?true:false
- }
- };
-
-this.isHelp=function(b){
- var a=this.adjustedCoordinates(b);
- return a&&a.x>0&&a.x<=10&&a.y>0&&a.y<=10?true:false
- };
-
-this.handleWheelEvent=function(G,H,K){
- var F=this.getTargetEvent(G);
- if(/CanvasXpress/.test(F.className)){
- CanvasXpress.current=F.id
- }
- if(this.graphType=="Network"){
- this.cancelEvent(G);
- if(!K){
- K=this.adjustedCoordinates(G)
- }
- if(K){
- if(G.type=="keydown"){
- K.x=this.width/2;
- K.y=this.height/2
- }
- var u=this.scaleFactor*this.zoomStep;
- var m=(this.widthBounds/2)-(K.x/this.scaleFactor);
- var k=(this.heightBounds/2)-(K.y/this.scaleFactor);
- this.scaleFactor=H>0?this.scaleFactor+u:this.scaleFactor-u;
- this.widthBounds=this.x/this.scaleFactor;
- this.heightBounds=this.y/this.scaleFactor;
- var g=(this.widthBounds/2)-(K.x/this.scaleFactor);
- var M=(this.heightBounds/2)-(K.y/this.scaleFactor);
- this.panningX=m-g;
- this.panningY=k-M;
- if(!this.networkFreeze){
- u=this.zoom*this.zoomStep;
- this.zoom=H>0?this.zoom+u:this.zoom-u
- }
- this.draw(false,false,false,true);
- this.panningGlobalX+=this.panningX;
- this.panningGlobalY+=this.panningY
- }
- }else{
- if(this.graphType=="Genome"){
- this.cancelEvent(G);
- if(this.xAxisUnit>100&&H>0){
- return
- }
- if(!K){
- K=this.adjustedCoordinates(G)
- }
- if(K){
- var j=(K.x-(this.marginLeft+this.left))/this.x;
- var v=1-j;
- var y=this.xAxisRange*this.zoomStep;
- if(H>0){
- this.setMin=this.setMin!=null?this.setMin+(y*j):this.xAxisMin+(y*j);
- this.setMax=this.setMax!=null?this.setMax-(y*v):this.xAxisMax-(y*v)
- }else{
- this.setMin=this.setMin!=null?this.setMin-(y*j):this.xAxisMin-(y*j);
- this.setMax=this.setMax!=null?this.setMax+(y*v):this.xAxisMax+(y*v)
- }
- this.draw()
- }
- }else{
- if(this.graphType=="Heatmap"){
- this.cancelEvent(G);
- this.resetAxesResizer(G);
- var I=this.layoutComb?this.layoutValidN:0;
- var z;
- var B=this.layoutComb?this.layoutParams[I].varIndices:this.varIndices;
- var n=this.isGroupedData?this.grpIndices:this.smpIndices;
- if(this.isGroupedData){
- z=this.layoutComb?this.layoutParams[I].grpIndices:this.grpIndices
- }else{
- z=this.layoutComb?this.layoutParams[I].smpIndices:this.smpIndices
- }
- this.setOriginalIndices(I,B,z);
- if(!K){
- K=this.adjustedCoordinates(G)
- }
- if(K){
- if(G.type=="keydown"){
- K.x=this.width/2;
- K.y=this.height/2
- }
- K.x-=(this.marginLeft+this.left);
- K.y-=(this.marginTop+this.top);
- var A=Math.min(Math.max(K.x,0),this.x)/this.x;
- var J=Math.ceil(B.length/10)*2;
- var a=Math.round(A*J);
- var q=J-a;
- var D=Math.min(Math.max(K.y,0),this.y)/this.y;
- var L=Math.ceil(z.length/10)*2;
- var f=Math.round(D*L);
- var t=L-f;
- var s=false;
- if(H>0){
- if(!this.zoomVariablesDisable&&B.length>3){
- if(this.varIndicesStart<0){
- this.varIndicesStart++
- }
- for(var E=0;E3){
- if(this.smpIndicesStart<0){
- this.smpIndicesStart++
- }
- for(var E=0;E=0&&this.varIndicesStart+B.length0){
- this.varIndicesStart--;
- this.varIndices.unshift(this.startingVarIndices[I][this.varIndicesStart]);
- s=true
- }
- }
- }
- for(var E=0;E0){
- this.varIndicesStart--;
- this.varIndices.unshift(this.startingVarIndices[I][this.varIndicesStart]);
- s=true
- }else{
- if(this.varIndicesStart>=0&&this.varIndicesStart+B.length=0&&this.smpIndicesStart+z.length0){
- this.smpIndicesStart--;
- this.smpIndices.unshift(this.startingSmpIndices[I][this.smpIndicesStart]);
- s=true
- }
- }
- }
- for(var E=0;E0){
- this.smpIndicesStart--;
- this.smpIndices.unshift(this.startingSmpIndices[I][this.smpIndicesStart]);
- s=true
- }else{
- if(this.smpIndicesStart>=0&&this.smpIndicesStart+z.length0){
- if(z.length>3){
- if(this.smpIndicesStart<0){
- this.smpIndicesStart++
- }
- this.smpIndicesStart+=l;
- for(var E=l;Ez.length){
- b=z;
- for(var E=0;Ethis.smpIndicesStart+z.length){
- b.push(this.startingSmpIndices[I][this.smpIndicesStart+z.length])
- }else{
- if(this.smpIndicesStart>0){
- this.smpIndicesStart--;
- b.unshift(this.startingSmpIndices[I][this.smpIndicesStart])
- }
- }
- }
- for(var E=0;E0){
- this.smpIndicesStart--;
- b.unshift(this.startingSmpIndices[I][this.smpIndicesStart])
- }else{
- if(this.startingSmpIndices[I].length>this.smpIndicesStart+z.length){
- b.push(this.startingSmpIndices[I][this.smpIndicesStart+z.length])
- }
- }
- }
- this.setSamplesVisible(b,true);
-this.draw()
-}
-}
-}
-}else{
- if(this.graphType=="Scatter3D"||this.is3DPlot){
- this.cancelEvent(G);
- if(!K){
- K=this.adjustedCoordinates(G)
- }
- if(K){
- K.x-=(this.marginLeft+this.left);
- K.y-=(this.marginTop+this.top);
- var x=(Math.min(Math.max(K.x,0),this.x)/this.x)-0.5;
- var w=(Math.min(Math.max(K.y,0),this.y)/this.y)-0.5
- }
- if(H>0){
- if(this.zoom>=4){
- return
- }
- this.zoom*=1.1;
- this.padX-=x*this.padX/4;
- this.padY-=w*this.padY/4
- }else{
- if(this.zoom<=0.5){
- return
- }
- this.zoom*=0.9;
- this.padX+=x*this.padX/4;
- this.padY+=w*this.padY/4
- }
- this.draw()
- }else{
- if(this.graphType=="Scatter2D"||this.graphType=="ScatterBubble2D"){
- this.cancelEvent(G);
- return;
- if(!K){
- K=this.adjustedCoordinates(G)
- }
- if(K){
- K.x-=(this.marginLeft+this.left);
- K.y-=(this.marginTop+this.top);
- var x=Math.min(Math.max(K.x,0),this.x)/this.x;
- var w=Math.min(Math.max(K.y,0),this.y)/this.y;
- var r=this.xAxisMin+(x*this.xAxisRange);
- var o=this.yAxisMax-(w*this.yAxisRange)
- }
- }
- }
-}
-}
-}
-}
-return false
-};
-
-this.setLayoutValidIndices=function(k){
- if(this.layoutComb){
- var h=this.adjustedCoordinates(k);
- if(h){
- var a=h.x;
- var g=h.y;
- var m=0;
- for(var f=0;f=b[0]&&a<=b[1]&&g>=b[2]&&g<=b[3]){
- if(this.layoutValid){
- this.layoutValidR=f;
- this.layoutValidC=d;
- this.layoutValidN=m
- }
- }
- m++
- }
- }
- }
-}
-};
-
-this.getNetworkEventDataId=function(c){
- var a=this.isEvent(c,true);
- var d=a[0];
- var b=a[1];
- if(d){
- return b&&b.match(/-legend-/)?false:d
- }else{
- return false
- }
- };
-
-this.getEventDataId=function(a){
- return this.graphType=="Network"?this.getNetworkEventDataId(a):this.isEvent(a)
- };
-
-this.getEventAreaData=function(a){
- return this.extractDataObject(this.getEventDataId(a))
- };
-
-this.handleMouseEvents=function(b,c,a){
- if(a[0]==-1){
- this.showInfoSpan(c,"CanvasXpress ("+this.version+")")
- }else{
- if(this.layoutComb&&!this.layoutValidN){
- this.setLayoutValidIndices(c)
- }
- var d=this.extractDataObject(a);
- if(this.userEvents[b]){
- if(typeof(this.userEvents[b])=="object"&&this.userEvents[b].handler&&this.userEvents[b].scope){
- if(c.ctrlKey&&b=="click"){
- if(c.shiftKey&&b=="click"){
- alert(this.prettyJSON(d))
- }else{
- if(c.shiftKey&&b=="click"){
- this.addRemoveToSelectedDataPoints(false,this.getEventDataId(c));
- this.draw()
- }else{
- this.addRemoveToSelectedDataPoints(false,this.getEventDataId(c));
- this.draw()
- }
- }
- }else{
- if(c.shiftKey&&b=="click"&&this.graphType=="Network"&&this.networkLayoutType=="radial"){
- this.reRootRadialNetwork(this.getEventDataId(c))
- }else{
- if(c.shiftKey&&b=="click"){}else{
- if(c.altKey&&b=="click"){}else{
- this.userEvents[b].handler.apply(this.userEvents[b].scope,[d,c,this,a])
- }
- }
- }
- }
-}else{
- if(typeof(this.userEvents[b])=="object"&&this.userEvents[b].handler){
- if(c.ctrlKey&&b=="click"){
- if(c.shiftKey&&b=="click"){
- alert(this.prettyJSON(d))
- }else{
- if(c.shiftKey&&b=="click"){
- this.addRemoveToSelectedDataPoints(false,this.getEventDataId(c));
- this.draw()
- }else{
- this.addRemoveToSelectedDataPoints(false,this.getEventDataId(c));
- this.draw()
- }
- }
- }else{
- if(c.shiftKey&&b=="click"&&this.graphType=="Network"&&this.networkLayoutType=="radial"){
- this.reRootRadialNetwork(this.getEventDataId(c))
- }else{
- if(c.shiftKey&&b=="click"){}else{
- if(c.altKey&&b=="click"){}else{
- this.userEvents[b].handler(d,c,this,a)
- }
- }
- }
-}
-}else{
- if(c.ctrlKey&&b=="click"){
- if(c.shiftKey&&b=="click"){
- alert(this.prettyJSON(d))
- }else{
- if(c.shiftKey&&b=="click"){
- this.addRemoveToSelectedDataPoints(false,this.getEventDataId(c));
- this.draw()
- }else{
- this.addRemoveToSelectedDataPoints(false,this.getEventDataId(c));
- this.draw()
- }
- }
- }else{
- if(c.shiftKey&&b=="click"&&this.graphType=="Network"&&this.networkLayoutType=="radial"){
- this.reRootRadialNetwork(this.getEventDataId(c))
- }else{
- if(c.shiftKey&&b=="click"){}else{
- if(c.altKey&&b=="click"){}else{
- this.userEvents[b](d,c,this,a)
- }
- }
- }
-}
-}
-}
-}
-}
-};
-
-this.formatCoords=function(j,k){
- var f=[];
- if(this.graphType!="Network"){
- for(var e=0;e=(a*2)){
- g.canvas.parentNode.removeChild(j);
- clearInterval(c)
- }
- e++
- };
-
- var c=setInterval(this.update,300)
- };
-
- o.call()
- };
-
-this.initializeCanvasEvents=function(){
- if(!this.disableEvents){
- this.addRemoveCanvasListeners("addEvtListener")
- }
- };
-
-this.initializeCanvasEvents()
-};
-
-CanvasXpress.prototype.initCleanupEvents=function(){
- this.destroy=function(a){
- if(a){
- if(CanvasXpress.references.length==1&&CanvasXpress.references[0].target==a){
- return this.destroy()
- }else{
- this.removeReference(a)
- }
- }else{
- while(CanvasXpress.references.length>0){
- a=CanvasXpress.references[0];
- this.removeReference(a.target)
- }
- CanvasXpress.cacheImages={};
-
- CanvasXpress.cacheText={};
-
- CanvasXpress.stack={};
-
- CanvasXpress.current=false
- }
- };
-
-this.monitorReference=function(){
- var b=[];
- for(var a=0;aMath.abs(f)+j&&j>document.body.scrollLeft-f?Math.abs(f)+j:j-f;
- h.y=document.body.scrollTop>Math.abs(k)+i&&i>document.body.scrollTop-k?Math.abs(k)+i:(i-k)
- }else{
- h.x=0;
- h.y=0
- }
- return h
- }
- };
-
-this.isObjectInsideArea=function(b,g,d,l,c,j){
- var k,h;
- switch(b){
- case"rect":
- k=(g[0]+g[2])/2;
- h=(g[1]+g[3])/2;
- break;
- case"circle":
- k=g[0];
- h=g[1];
- break;
- case"poly":
- var e=[];
- var a=[];
- for(var f=0;fk[2]){
- k[4]=k[0];
- k[0]=k[2];
- k[2]=k[4]
- }
- if(k[1]>k[3]){
- k[4]=k[1];
- k[1]=k[3];
- k[3]=k[4]
- }
- if(m>=k[0]&&m<=k[2]&&l>=k[1]&&l<=k[3]){
- return true
- }else{
- return false
- }
- case"circle":
- var f=k[2]/2;
- if(m>=k[0]-f&&m<=k[0]+f&&l>=k[1]-f&&l<=k[1]+f){
- return true
- }else{
- return false
- }
- case"poly":
- var d=[];
- var a=[];
- var g=false;
- for(var e=0;e=0;k--){
- var g=r[k][0];
- var v=r[k][1];
- var p=r[k][2];
- var l=r[k][3];
- if(this.isPointInsideArea(v,t,q,p)){
- if(l){
- l=g[0]+l
- }
- if(j){
- if(l){
- b.push(l)
- }else{
- b.push(g[0])
- }
- }else{
- return h?[g,l]:l?[l]:g
- }
- }
- }
- if(b.length>0){
- return b
- }
-}
-}
-return false
-};
-
-this.getBoundsXY=function(e){
- var d=this.layoutComb?this.layoutParams[e]:this;
- var a=this.graphType=="Network"?0:this.marginLeft+d.offsetX;
- var b=this.graphType=="Network"?0:this.marginTop+d.offsetY;
- return[a+d.left,a+d.left+d.x,b+d.top,b+d.top+d.y,a,a+d.left+d.x+d.right,b,b+d.top+d.y+d.bottom]
- };
-
-this.extractDataObject=function(h,b){
- var k=this;
- var E=this.layoutComb&&this.layoutValidN>-1?this.layoutParams[this.layoutValidN].graphType:this.graphType;
- var K=[];
- var I=[];
- var H=[];
- var w=function(d){
- var n={};
-
- for(var j in k.data.x){
- n[j]=[];
- for(var g=0;g-1){
- I.push(this.getSampleIndices(this.colorBy))
- }
- if(this.shapeBy&&this.getSampleIndices(this.shapeBy)>-1){
- I.push(this.getSampleIndices(this.shapeBy))
- }
- if(this.sizeBy&&this.getSampleIndices(this.sizeBy)>-1){
- I.push(this.getSampleIndices(this.sizeBy))
- }
- }
-}
-}
-if(E.match(/Area/)){
- return{
- x:this.data.x,
- y:{
- vars:F(K),
- smps:this.data.y.smps,
- data:e(K)
- },
- z:v(K)
- }
- }else{
- if(this.isGroupedData){
- var y={
- x:{},
- w:{},
- z:v(K)
- };
-
- if(E=="Boxplot"&&I[1]!=null){
- y.y={
- data:this.data.y.data[K[0]][I[1]],
- vars:this.data.y.vars[I[1]],
- smps:this.data.y.smps[I[1]]
- }
- }
- for(var x in this.data.w){
- if(x=="smps"){
- y.w[x]=l(I,true)
- }else{
- if(x=="grps"){
- y.w[x]=f(I)
- }else{
- if(x=="vars"){
- y.w[x]=F(K)
- }else{
- if(this.data.w[x].length>K[0]&&this.data.w[x][K[0]].length>I[0]){
- y.w[x]=[];
- y.w[x].push(this.data.w[x][K[0]][I[0]])
- }
- }
- }
- }
- }
-for(var x in this.data.x){
- var m=[];
- for(var D=0;D=this.data.nodes.length){
- if(!y.edges){
- y.edges=[]
- }
- y.edges.push(this.data.edges[h[D]-this.data.nodes.length])
- }else{
- if(!y.nodes){
- y.nodes=[]
- }
- y.nodes.push(this.data.nodes[h[D]])
- }
- }
- }
-return y;
-case"Genome":
- var E;
- var y=[];
- y[0]={
- data:[]
-};
-
-var q=0;
-var r=isNaN(h[0])&&h[0].match(":")?h[0].match(/:(\d+)/)[1]:false;
- for(var D=0;D"+b.display+" "
- }else{
- if(this.isGroupedData&&b.w){
- i=""+b.w.vars[0]+" ";
- if(this.summaryType=="mean"){
- for(var d=0;d"+b.w.smps[d]+" : "+b.w.mean[d]+" "
- }
- }else{
- if(this.summaryType=="median"||this.summaryType=="iqr"){
- for(var d=0;d"+b.w.smps[d]+": "+b.w.median[d]+" "
- }
- }else{
- if(this.summaryType=="sum"){
- for(var d=0;d"+b.w.smps[d]+": "+b.w.sum[d]+" "
- }
- }
- }
- }
- }else{
- if(b.y){
- i=""+b.y.vars[0]+" ";
- for(var d=0;d"+b.y.smps[d]+": "+l.join(", ")+" "
- }else{
- i+=""+b.y.smps[d]+" : "+b.y.data[0][d]+" "
- }
- }
- }else{
- if(b.t){
- i=""+b.t.t+" Depth: "+b.t.d+" "
- }
- }
-}
-}
-return i;
-case"Pie":
- var n=""+b.y.smps[0]+" ";
- for(var d=0;d"+b.y.vars[d]+": "+b.y.data[d]+" ("+a+"%) "
- }
- return n;
-case"Candlestick":
- return dateFormat(b.y.smps[0],this.timeFormat)+", "+b.y.close[0];
-case"Correlation":
- var n;
- if(this.correlationAxis=="samples"){
- n=b.y.smps[0]+" vs "+b.y.smps[1]
- }else{
- n=b.y.vars[0]+" vs "+b.y.vars[1]
- }
- return n;
-case"Venn":
- for(var e in b.venn.data){
- return e+" = "+b.venn.data[e]
- }
- case"Network":
- var n;
- if(b&&b.nodes){
- if(b.nodes[0]){
- n=b.nodes[0].hideTooltip?"":b.nodes[0].tooltip||b.nodes[0].name||b.nodes[0].label||b.nodes[0].id
- }
- }else{
- if(b&&b.edges){
- var h=this.nodes[b.edges[0].id1];
- var f=this.nodes[b.edges[0].id2];
- n=(h.label||h.id)+" - "+(f.label||f.id);
- n=b.edges[0].hideTooltip?"":b.edges[0].tooltip||b.edges[0].name||b.edges[0].label||n
- }
- }
-return n;
-case"Genome":
- return b.name||b[0].data[0].id
- }
-}else{
- return""
- }
-};
-
-this.setUserEvents=function(){
- this.userEvents={};
-
- if(this.disableEvents){
- return
- }
- var b=this;
- if(this.events&&this.events.enddragnode){
- this.userEvents.enddragnode=this.events.enddragnode
- }
- if(this.events&&this.events.stackchange){
- this.userEvents.stackchange=this.events.stackchange
- }
- if(this.events&&this.events.select){
- this.userEvents.select=this.events.select
- }
- if(this.events&&this.events.enddraw){
- this.userEvents.enddraw=this.events.enddraw
- }
- if(this.events&&this.events.mouseout){
- this.userEvents.mouseout=this.events.mouseout
- }else{
- this.userEvents.mouseout=function(h,g,f,d){
- f.resetInfoSpan(g)
- }
- }
- if(this.events&&this.events.contextmenu){
- this.userEvents.contextmenu=this.events.contextmenu
- }else{
- this.userEvents.contextmenu=function(h,g,f,d){
- if(f.graphType=="Network"){
- if(h&&h.nodes&&h.nodes.length==1){
- if(f.selectNode&&!f.selectNode[h.nodes[0].id]){
- f.addRemoveToSelectedDataPoints(false,d)
- }
- }else{
- if(h&&h.edges&&h.edges.length==1){}
- }
- }
-f.addMenu(g)
-}
-}
-if(this.events&&this.events.click){
- this.userEvents.click=this.events.click
- }else{
- this.userEvents.click=function(h,g,f,d){
- if(h&&h.t){
- f.modifyDendrogram(h)
- }else{
- if(h.nodes&&h.nodes.length==1&&h.nodes[0].links){
- f.showLinkDiv(g,h.nodes[0].links,h.nodes[0].label!=null?h.nodes[0].label:h.nodes[0].name?h.nodes[0].name:h.nodes[0].id)
- }else{
- if(h.edges&&h.edges.length==1&&h.edges[0].links){
- f.showLinkDiv(g,h.edges[0].links,h.edges[0].label!=null?h.edges[0].label:h.edges[0].name?h.edges[0].name:h.edges[0].id1+"-"+h.edges[0].id2)
- }else{
- f.updateDataTable(h)
- }
- }
- }
- return false
-}
-}
-if(this.events&&this.events.dblclick){
- this.userEvents.dblclick=this.events.dblclick
- }else{
- this.userEvents.dblclick=function(f,d){
- if(f){
- alert(b.prettyJSON(f))
- }
- return false
- }
- }
-var c=["mouseover","mousemove"];
-for(var a=0;a1){
- var k=d.touches[0];
- var j=d.touches[1];
- var r=Math.abs(j[0]-k[0]);
- var q=Math.abs(j[1]-k[1]);
- var n=Math.atan2(j[1]-k[1],j[0]-k[0])*180/Math.PI;
- if(r<20&&q<20){
- d.touchEvent="dbltap"
- }else{
- d.touchEvent="pinch"
- }
- }else{
- if(d.touchEvent!="drag"){
- if(d.touchEvent=="dbltap"||d.touchEvent=="pinch"){
- return false
- }
- d.touchEvent="tap"
- }
- }
- if(d.touchEvent=="pinch"&&d.touchesEnd.length>1){
- if(d.graphType.match(/Network|Genome|Heatmap|Bar|Line|Dotplot|Boxplot|Area|Stacked|Scatter3D|Circular/)){
- var o=d.euclidianDistance([d.touches[0][0],d.touches[1][0]],[d.touches[0][1],d.touches[1][1]]);
- var e=d.euclidianDistance([d.touchesEnd[0][0],d.touchesEnd[1][0]],[d.touchesEnd[0][1],d.touchesEnd[1][1]]);
- var p=(d.touchesEnd[0][0]+d.touchesEnd[1][0])/2;
- var m=(d.touchesEnd[0][1]+d.touchesEnd[1][1])/2;
- var l=d.zoomStep;
- d.zoomStep*=3;
- d.resetFlags(g);
- d.handleWheelEvent(g,e-o,{
- x:p,
- y:m
- });
- d.zoomStep=l
- }
- d.touchesEnd=false;
- return false
- }else{
- if(d.touchEvent=="dbltap"){
- d.stopEvent(g);
- d.addConfigurator(g,false,3,3);
- d.resetFlags(g);
- return false
- }else{
- if(d.touchEvent=="tap"){
- var h=d.getEventDataId(g);
- if(h){
- d.handleMouseEvents("click",g,h)
- }else{
- d.resetSelectedObjects()
- }
- d.resetFlags(g);
- return false
- }
- }
- }
- d.stopEvent(g);
-d.endDrag(g);
-d.endCanvasResizer(g);
-d.endAxesResizer(g);
-d.resetFlags(g)
-};
-
-var c=a.adjustedCoordinates(g);
-if(c){
- if(!a.touchesEnd){
- a.touchesEnd=[]
- }
- a.touchesEnd.push([c.x,c.y,new Date().getTime()]);
- setTimeout(b,250)
- }
-}
-}
-}(this);
-this.keydownDoc=function(a){
- return function(b){
- if(!b){
- b=window.event
- }
- if(CanvasXpress.current&&CanvasXpress.current==a.target){
- a.registerKey(b)
- }
- }
-}(this);
-this.keyupDoc=function(a){
- return function(c){
- if(!c){
- c=window.event
- }
- var b=a.getTargetEvent(c);
- if(CanvasXpress.current&&CanvasXpress.current==a.target){
- a.keyOn=false;
- if(b.id.match(/cX-DataFilterInput/)){
- a.updateSelectStringFilter(b.id)
- }else{
- if(a.configuringOn){
- a.selectConfig(c)
- }else{
- if(a.remoteService){
- a.selectDataSet(c)
- }
- }
- }
- }
-}
-}(this);
-this.resizeWindow=function(a){
- return function(b){
- if(!b){
- b=window.event
- }
- if(a.resizeImage){
- a.resizeImage(true)
- }
- return false
- }
- }(this);
-this.initDocEvents=function(){
- this.addEvtListener(document,"mousemove",this.mousemoveDoc,false);
- this.addEvtListener(document,"touchmove",this.mousemoveDoc,false);
- this.addEvtListener(document,"mouseup",this.mouseupDoc,false);
- this.addEvtListener(document,"touchend",this.touchendDoc,false);
- this.addEvtListener(document,"keydown",this.keydownDoc,false);
- this.addEvtListener(document,"keyup",this.keyupDoc,false);
- this.addEvtListener(window,"resize",this.resizeWindow,false)
- };
-
-this.initializeEvents=function(){
- this.setUserEvents();
- this.initViewport();
- this.initToolbarTooltip();
- this.initMenuLinks();
- this.initConfigurator();
- this.initDataFilter();
- this.initDataTable();
- this.initDraggingEvents();
- this.initCanvasResizerEvents();
- this.initAxisResizerEvents();
- this.initKeyEvents();
- this.initSelectEvents();
- this.initDendrogramEvents();
- this.initCanvasEvents();
- this.initAcknowlegments();
- this.initCodeInfo();
- this.initDocEvents();
- this.initCleanupEvents()
- };
-
-this.initializeEvents()
-};
-
-CanvasXpress.prototype.initAnimation=function(){
- this.saveSnapshot=function(){
- var a=this.cloneVisualData(this.data);
- if(a){
- this.snapshots.push(a)
- }
- };
-
-this.playSnapshot=function(b,d,c){
- if(this.snapshots.length<1){
- return
- }
- this.stopSnapshotPlay();
- var a=this;
- this.snapshotPlay={
- idx:0,
- time:b,
- task:setTimeout(function(){
- a.nextSnapshot(c)
- },0),
- callback:d,
- oldData:this.data
- };
-
- this.snapshotPaused=false
- };
-
-this.nextSnapshot=function(c){
- if(this.snapshotPlay.idx>=this.snapshots.length){
- if(this.snapshotPlay.callback){
- this.snapshotPlay.callback.call(this,c)
- }else{
- this.snapshotPlay.idx=0
- }
- }
- if(this.snapshotPlay){
- var b=this.snapshotPlay.time||this.snapshots[this.snapshotPlay.idx].time||50;
- this.loadData(this.snapshots[this.snapshotPlay.idx++],true);
- var a=this;
- this.snapshotPlay.task=setTimeout(function(){
- a.nextSnapshot(c)
- },b);
- this.snapshotPaused=false
- }
-};
-
-this.stopSnapshotPlay=function(a){
- if(!this.snapshotPlay){
- return
- }
- clearTimeout(this.snapshotPlay.task);
- this.loadData(this.snapshotPlay.oldData,a);
- delete this.snapshotPlay;
- this.snapshotPaused=false
- };
-
-this.clearSnapshot=function(){
- this.stopSnapshotPlay(true);
- this.snapshots=[];
- this.snapshotPaused=false
- };
-
-this.duplicateSnapshot=function(){
- if(this.snapshots.length<1){
- return
- }
- var a=(this.snapshotPlay?this.snapshotPlay.idx:this.snapshots.length)-1;
- var b=this.cloneVisualData(this.snapshots[a]);
- if(this.snapshotPlay){
- this.snapshots.splice(a+1,0,b);
- this.snapshotPlay.idx++
- }else{
- this.snapshots.push(b)
- }
- };
-
-this.makeSnapshotPlay=function(){
- if(!this.snapshotPlay){
- this.snapshotPlay={
- idx:this.snapshots.length,
- oldData:this.data
- }
- }else{
- this.pauseSnapshot()
- }
-};
-
-this.moveSnapshot=function(c){
- if(this.snapshots.length<1){
- return
- }
- this.makeSnapshotPlay();
- var b=this.snapshotPlay.idx-1,a=b+c;
- if(a>=0&&a<=this.snapshots.length){
- this.snapshots.splice(a,0,(this.snapshots.splice(b,1))[0])
- }
- this.snapshotPlay.idx=a+1
- };
-
-this.prevSnapshotOnce=function(){
- if(this.snapshots.length<2){
- return
- }
- this.makeSnapshotPlay();
- this.snapshotPlay.idx-=2;
- if(this.snapshotPlay.idx<0){
- this.snapshotPlay.idx=0
- }
- this.loadData(this.snapshots[this.snapshotPlay.idx++],true);
- this.snapshotPaused=true
- };
-
-this.nextSnapshotOnce=function(){
- if(!this.snapshotPlay){
- return
- }
- if(this.snapshotPlay.idx1&&this.snapshotPlay&&this.snapshotPaused&&this.snapshotPlay.idx1&&(!this.snapshotPlay||(this.snapshotPlay.idx>1&&this.snapshotPaused))
- };
-
-this.updateSnapshot=function(){
- if(this.snapshotPlay){
- this.snapshots[this.snapshotPlay.idx-1]=this.cloneVisualData(this.data)
- }
- };
-
-this.pauseSnapshot=function(){
- if(!this.snapshotPlay){
- return
- }
- if(this.snapshotPlay.task){
- clearTimeout(this.snapshotPlay.task)
- }
- this.snapshotPaused=true
- };
-
-this.setSnapshotTime=function(a){
- if(a>0){
- this.snapshots[this.snapshotPlay.idx-1].time=a
- }
- };
-
-this.getSnapshotTime=function(){
- return this.snapshots[this.snapshotPlay.idx-1].time||50
- };
-
-this.assembleObj=function(b,k,m){
- var e=[];
- if(!k[m]){
- return b[m]
- }
- if(!k[m].indices){
- k[m].indices={}
- }
- for(var h=0;hh?50-h*2/n:5
- }
- }
- },
- time:100/e
- })
-}
-this.setSnapshotsData({
- base:c,
- ss:o
-})
-};
-
-this.fade=function(e,a,f,d){
- if(e){
- if(!a){
- a=1000
- }
- if(e.fadeState==null){
- if(e.style.opacity==null||e.style.opacity==""||e.style.opacity=="1"){
- e.fadeState=2
- }else{
- e.fadeState=-2
- }
- }
- if(e.fadeState==1||e.fadeState==-1){
- e.fadeState=e.fadeState==1?-1:1;
- e.fadeleft=a-e.fadeleft
- }else{
- var b=this;
- e.fadeState=e.fadeState==2?-1:1;
- e.fadeleft=a;
- setTimeout(function(){
- b.animateFade(new Date().getTime(),e,f,d)
- },33)
- }
- }
-};
-
-this.animateFade=function(a,h,j,d){
- var b=this;
- var g=new Date().getTime();
- var f=g-a;
- if(h.fadeleft<=f){
- h.style.opacity=h.fadeState==1?"1":"0";
- h.style.filter="alpha(opacity = "+(h.fadeState==1?"100":"0")+")";
- h.fadeState=h.fadeState==1?2:-2;
- if(j!=null){
- j()
- }
- if(d){
- setTimeout(function(){
- b.resetFade(h);
- for(var c=0;c0){
- j=q/40
- }
- var n=b-p;
- if(n!=0){
- n/=j
- }
- var h=m-i;
- if(h!=0){
- h/=j
- }
- var f=k-g;
- if(f!=0){
- f/=j
- }
- var r=e-a;
- if(r!=0){
- r/=j
- }
- this.updateResizeMove(d,p,b,n,i,m,h,g,k,f,a,e,r,l)
- }
- };
-
-this.updateResizeMove=function(d,n,b,m,i,l,h,g,j,f,a,e,q,k){
- if(d){
- var p=this;
- n=this.stepResizeMove(n,b,m);
- i=this.stepResizeMove(i,l,h);
- g=this.stepResizeMove(g,j,f);
- a=this.stepResizeMove(a,e,q);
- d.style.left=Math.round(n)+"px";
- d.style.top=Math.round(i)+"px";
- d.style.width=Math.round(g)+"px";
- d.style.height=Math.round(a)+"px";
- if(n==b&&i==l&&a==e&&g==j){
- if(k!=null){
- k()
- }
- return
- }
- setTimeout(function(){
- p.updateResizeMove(d,n,b,m,i,l,h,g,j,f,a,e,q,k)
- },40)
- }
- };
-
-this.stepResizeMove=function(d,b,a){
- if(a==0||d==b){
- return b
- }
- d+=a;
- if((a>0&&d>=b)||(a<0&&d<=b)){
- return b
- }
- return d
- };
-
-this.transitionAccordion=function(a,d,h,j){
- var f=this;
- var b=new Date().getTime();
- var g=b-a;
- if(d<=g){
- if(h){
- h.style.height=this.dataFilterHeight+"px"
- }
- if(j){
- j.style.height="0px";
- j.style.display="none"
- }
- if(h){
- if(h.clientWidth-h.scrollWidth){
- this.resizeDataFilterForScroller(true)
- }else{
- if(h.clientHeight0){
- return true
- }else{
- if(type=="mean"&&level.mean&&level.mean[0].length>0){
- return true
- }else{
- if(type=="median"&&level.median&&level.median[0].length>0){
- return true
- }else{
- if(type=="iqr"&&level.iqr1&&level.qtl1&&level.median&&level.qtl3&&level.iqr3&&level.median[0].length>0){
- return true
- }else{
- if(type=="candle"&&level.close&&level.open&&level.high&&level.low&&level.close[0].length>0){
- return true
- }else{
- if(type=="volume"&&level.volume&&level.volume[0].length>0){
- return true
- }else{
- if(type=="raw"&&this.isRawData){
- return true
- }else{
- if(type=="video"&&this.data.video){
- return true
- }else{
- return false
- }
- }
- }
- }
- }
- }
- }
- }
-}
-}
-}
-}
-};
-
-this.setAllNodesVisible=function(){
- this.nodes={};
-
- this.data.nodeIndices={};
-
- for(var i=0;i0){
- this.filterNodeBy.splice(idx,1);
- this.filterNodeByOp.splice(idx,1);
- this.filterNodeByValue.splice(idx,1);
- this.filterNodeByCase.splice(idx,1)
- }else{
- this.filterNodeBy=[];
- this.filterNodeByOp=[];
- this.filterNodeByValue=[];
- this.filterNodeByCase=[]
- }
- };
-
-this.resetEdgeFilters=function(idx){
- if(idx!=null&&this.filterEdgeBy.length>0){
- this.filterEdgeBy.splice(idx,1);
- this.filterEdgeByOp.splice(idx,1);
- this.filterEdgeByValue.splice(idx,1);
- this.filterEdgeByCase.splice(idx,1)
- }else{
- this.filterEdgeBy=[];
- this.filterEdgeByOp=[];
- this.filterEdgeByValue=[];
- this.filterEdgeByCase=[]
- }
- };
-
-this.setAllFeaturesVisible=function(){
- for(var i=0;i0){
- this.filterFeatureBy.splice(idx,1);
- this.filterFeatureByOp.splice(idx,1);
- this.filterFeatureByValue.splice(idx,1);
- this.filterFeatureByCase.splice(idx,1)
- }else{
- this.filterFeatureBy=[];
- this.filterFeatureByOp=[];
- this.filterFeatureByValue=[];
- this.filterFeatureByCase=[]
- }
- };
-
-this.setSelectNodes=function(nodeIds){
- this.selectNode={};
-
- this.isSelectNodes=0;
- for(var i=0;i0){
- for(var i=0;i0){
- var arr=[];
- for(var j=0;j0){
- this.filterVarBy.splice(idx,1);
- this.filterVarByOp.splice(idx,1);
- this.filterVarByValue.splice(idx,1);
- this.filterVarByCase.splice(idx,1);
- this.filteredVarIndices.splice(idx,1)
- }else{
- this.filterVarBy=[];
- this.filterVarByOp=[];
- this.filterVarByValue=[];
- this.filterVarByCase=[];
- this.filteredVarIndices=[]
- }
- };
-
-this.setAllSamplesVisible=function(indices){
- if(this.data.y&&this.data.y.smps){
- if(!this.data.y.smps&&this.data.y.data&&this.data.y.vars){
- this.data.y.smps=[];
- for(var i=0;i0){
- for(var i=0;i0){
- this.filterSmpBy.splice(idx,1);
- this.filterSmpByOp.splice(idx,1);
- this.filterSmpByValue.splice(idx,1);
- this.filterSmpByCase.splice(idx,1);
- this.filteredSmpIndices.splice(idx,1)
- }else{
- this.filterSmpBy=[];
- this.filterSmpByOp=[];
- this.filterSmpByValue=[];
- this.filterSmpByCase=[];
- this.filteredSmpIndices=[]
- }
- };
-
-this.setIndices=function(vIndices,sIndices){
- if(this.graphType=="Network"){
- this.setNodes()
- }else{
- if(this.graphType!="Genome"&&this.graphType!="Venn"){
- this.setAllVariablesVisible(vIndices);
- this.setAllSamplesVisible(sIndices)
- }
- }
-};
-
-this.resetIndices=function(){
- if(this.isGroupedData){
- this.setIndices()
- }
- };
-
-this.setMaxSmpStringAttr=function(str,font){
- this.setMaxSmpStringAnnt(str,font);
- this.setMaxSmpStringLabel(str,font);
- this.setMaxSmpStringDesc(font);
- this.setMaxSmpStringName(font)
- };
-
-this.setMaxSmpStringAnnt=function(str,font){
- if(!font){
- font=this.smpLabelFont
- }
- var max=0;
- this.maxSmpAnnt=0;
- this.maxSmpAnntStr="";
- if(this.data.x){
- if(str&&this.data.x[str]){
- return str
- }else{
- for(var annt in this.data.x){
- var len=this.measureText(annt,font);
- if(len>max){
- max=len;
- this.maxSmpAnnt=annt.length;
- this.maxSmpAnntStr=annt
- }
- }
- }
- }
-};
-
-this.setMaxSmpStringLabel=function(str,font){
- if(!font){
- font=this.smpLabelFont
- }
- var max=0;
- var seen={};
-
- this.maxSmpLabel=0;
- this.maxSmpLabelStr="";
- if(this.data.x){
- if(str&&this.data.x[str]){
- var maxStr="";
- for(var i=0;imax){
- max=len;
- maxStr=text
- }
- seen[text]=true
- }
- }
- return maxStr
- }else{
- for(var annt in this.data.x){
- for(var i=0;imax){
- max=len;
- this.maxSmpLabel=this.data.x[annt][this.smpIndices[i]].length;
- this.maxSmpLabelStr=this.data.x[annt][this.smpIndices[i]]
- }
- seen[text]=true
- }
- }
- }
- }
-}
-};
-
-this.setMaxSmpStringDesc=function(font){
- if(!font){
- font=this.smpLabelFont
- }
- var max=0;
- var seen={};
-
- this.maxSmpLabelDesc=0;
- this.maxSmpLabelDescStr="";
- if(this.data.x&&this.smpLabelDescription&&this.data.x[this.smpLabelDescription]){
- for(var i=0;imax){
- max=len;
- this.maxSmpLabelDesc=text.length;
- this.maxSmpLabelDescStr=text
- }
- }
- }
- }
-};
-
-this.setMaxSmpStringName=function(font){
- if(!font){
- font=this.smpLabelFont
- }
- if(this.data.y||this.data.w){
- var level=this.isGroupedData?this.data.w:this.data.y;
- var max=0;
- this.maxSmpName=0;
- this.maxSmpNameStr="";
- if(this.isGroupedData){
- for(var i=0;imax){
- max=len;
- this.maxSmpName=level.smps[i].length;
- this.maxSmpNameStr=level.smps[i]
- }
- }
- }else{
- for(var i=0;imax){
- max=len;
- this.maxSmpName=text.length;
- this.maxSmpNameStr=text
- }
- }
- }
-}
-};
-
-this.getSmpAnnotations=function(annt,indices,str,num){
- var seen={};
-
- var arr=[];
- var nul=false;
- if(this.data.x.hasOwnProperty(annt)){
- for(var i=0;imax){
- max=len;
- this.maxVarAnnt=annt.length;
- this.maxVarAnntStr=annt
- }
- }
- }
- }
-};
-
-this.setMaxVarStringLabel=function(str,font){
- if(!font){
- font=this.varLabelFont
- }
- var max=0;
- var seen={};
-
- this.maxVarLabel=0;
- this.maxVarLabelStr="";
- if(this.data.z){
- if(str&&this.data.z[str]){
- var maxStr="";
- for(var i=0;imax){
- max=len;
- maxStr=text
- }
- seen[text]=true
- }
- }
- return maxStr
- }else{
- for(var annt in this.data.z){
- for(var i=0;imax){
- max=len;
- this.maxVarLabel=text.length;
- this.maxVarLabelStr=text
- }
- seen[text]=true
- }
- }
- }
- }
-}
-};
-
-this.setMaxVarStringDesc=function(font){
- if(!font){
- font=this.varLabelFont
- }
- var max=0;
- var seen={};
-
- this.maxVarLabelDesc=0;
- this.maxVarLabelDescStr="";
- if(this.data.z&&this.varLabelDescription&&this.data.z[this.varLabelDescription]){
- for(var i=0;imax){
- max=len;
- this.maxVarLabelDesc=text.length;
- this.maxVarLabelDescStr=text
- }
- seen[text]=true
- }
- }
- }
-};
-
-this.setMaxVarStringName=function(font){
- if(!font){
- font=this.varLabelFont
- }
- if(this.data.y||this.data.w){
- var level=this.graphType.match(/BarLine|StackedLine|StackedPercentLine/)?this.data.y:this.isGroupedData?this.data.w:this.data.y;
- var max=0;
- this.maxVarName=0;
- this.maxVarNameStr="";
- if(level.vars){
- for(var i=0;imax){
- max=len;
- this.maxVarName=text.length;
- this.maxVarNameStr=text
- }
- }
- }
- }
-};
-
-this.getVarAnnotations=function(annt,indices,str,num){
- var seen={};
-
- var arr=[];
- var nul=false;
- if(this.data.z.hasOwnProperty(annt)){
- for(var i=0;i\<\=]/)){
- return eval(parseFloat(ts)+" "+op+" "+parseFloat(vl))
- }else{
- if(op.match("null")){
- return op=="not null"&&ts!=null?true:op=="null"&&ts==null?true:false
- }else{
- var r=cs?new RegExp(vl):new RegExp(vl,"i");
- return op=="like"?r.test(ts):r.test(ts)?false:true
- }
- }
- return false
-};
-
-var addEdge=function(nd){
- if(!edgs[nd]){
- edgs[nd]=0
- }
- edgs[nd]++
-};
-
-if(this.graphType=="Genome"&&this.filterFeatureBy.length>0){
- for(var i=0;i0||this.filterEdgeBy.length)){
- for(var i=0;i0){
- for(var i=0;i0){
- for(var i=0;i0){
- for(var i=0;i=0){
- var rng=this.range(this.data.y.data[idx]);
- min=rng[0];
- max=rng[1]
- }else{
- min=0;
- max=1
- }
- }else{
- if(type=="km"&&!forceRaw){
- min=0;
- max=1
- }else{
- if(type=="video"){
- min=0;
- max=1
- }else{
- if(type=="percentile"&&!forceRaw){
- min=0;
- max=100
- }else{
- if((type=="mean"||type=="median"||type=="sum")&&!forceRaw){
- if(stacked){
- var indices=this.isGroupedData?this.grpIndices:this.smpIndices;
- var data=this.isTransformedData?level.trans:level[this.summaryType];
- for(var i=0;i0){
- tot+=val
- }
- }
- max=Math.max(tot,max)
- }
- min=0
- }else{
- for(var i=0;i0){
- min=Math.min(val,min);
- max=Math.max(val+std,max)
- }
- }else{
- min=Math.min(val,min);
- max=Math.max(val+std,max)
- }
- }else{
- if(justPositive){
- if(val>0){
- min=Math.min(val,min);
- max=Math.max(val,max)
- }
- }else{
- min=Math.min(val,min);
- max=Math.max(val,max)
- }
- }
- }
- }
-}
-}
-}else{
- if(type=="iqr"&&!forceRaw){
- if(this.isTransformedData){
- alert("Transformation not allowed");
- this.isTransformedData=false
- }
- for(var i=0;i0&&iqr3>0){
- min=Math.min(iqr1,min);
- max=Math.max(iqr3,max)
- }
- }else{
- min=Math.min(iqr1,min);
- max=Math.max(iqr3,max)
- }
- }
- if(out){
- for(var k=0;k0){
- min=Math.min(out[k],min);
- max=Math.max(out[k],max)
- }
- }else{
- min=Math.min(out[k],min);
- max=Math.max(out[k],max)
- }
- }
- }
- }
- }
-}
-}else{
- if(type=="candle"){
- if(this.isTransformedData){
- alert("Transformation not allowed");
- this.isTransformedData=false
- }
- var indices=this.isGroupedData?this.grpIndices:this.smpIndices;
- for(var i=0;i0){
- min=Math.min(val,min);
- max=Math.max(val,max)
- }
- }else{
- min=Math.min(val,min);
- max=Math.max(val,max)
- }
- }
- }
- }
-}else{
- var data=this.isTransformedData?level.trans:level.data;
- if(stacked){
- for(var i=0;i0){
- tot+=val
- }
- }
- max=Math.max(tot,max)
- }
- min=0
- }else{
- for(var i=0;i0){
- min=Math.min(val,min);
- max=Math.max(val,max)
- }
- }else{
- min=Math.min(val,min);
- max=Math.max(val,max)
- }
- }
- }
- }
-}
-}
-}
-}
-}
-}
-}
-}
-}
-}
-}
-this.minData=this.setMin!=null?this.setMin:min;
-this.maxData=this.setMax!=null?this.setMax:max
-};
-
-this.setRangeDataObject=function(data){
- var min=Number.MAX_VALUE;
- var max=Number.MAX_VALUE*-1;
- for(var i=0;ivals[b]?1:vals[a]0){
- if(this.tmpAsciiArrayAscii1){
- return that.sortAsciibetically1(a,b)
- }else{
- return that.sortNumerically1(a,b)
- }
- }else{
- return((this.tmpAsciiArray[a]>this.tmpAsciiArray[b])?1:(this.tmpAsciiArray[a]0){
- if(this.tmpAsciiArrayAscii2){
- return that.sortAsciibetically2(a,b)
- }else{
- return that.sortNumerically2(a,b)
- }
- }else{
- return((this.tmpAsciiArray1[a]>this.tmpAsciiArray1[b])?1:(this.tmpAsciiArray1[a]this.tmpAsciiArray2[b])?1:(this.tmpAsciiArray2[a]0){
- if(this.tmpAsciiArrayAscii1){
- return that.sortAsciibetically1(a,b)
- }else{
- return that.sortNumerically1(a,b)
- }
- }else{
- return(this.tmpAsciiArray[a]||m)-(this.tmpAsciiArray[b]||m)
- }
-};
-
-this.sortNumerically1=function(a,b){
- var that=this;
- var m=Number.MAX_VALUE*-1;
- if((this.tmpAsciiArray1[a]||m)-(this.tmpAsciiArray1[b]||m)==0&&this.tmpAsciiArray2.length>0){
- if(this.tmpAsciiArrayAscii2){
- return that.sortAsciibetically2(a,b)
- }else{
- return that.sortNumerically2(a,b)
- }
- }else{
- return(this.tmpAsciiArray1[a]||m)-(this.tmpAsciiArray1[b]||m)
- }
-};
-
-this.sortNumerically2=function(a,b){
- var m=Number.MAX_VALUE*-1;
- return(this.tmpAsciiArray2[a]||m)-(this.tmpAsciiArray2[b]||m)
- };
-
-this.radixSort=function(arr){
- var rs=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
- var cpy=new Int32Array(arr.length);
- var c4=[].concat(rs);
- var c3=[].concat(rs);
- var c2=[].concat(rs);
- var c1=[].concat(rs);
- var o4=0;
- var t4;
- var o3=0;
- var t3;
- var o2=0;
- var t2;
- var o1=0;
- var t1;
- var x;
- for(x=0;x>8)&255;
- t2=(arr[x]>>16)&255;
- t1=(arr[x]>>24)&255^128;
- c4[t4]++;
- c3[t3]++;
- c2[t2]++;
- c1[t1]++
- }
- for(x=0;x<256;x++){
- t4=o4+c4[x];
- t3=o3+c3[x];
- t2=o2+c2[x];
- t1=o1+c1[x];
- c4[x]=o4;
- c3[x]=o3;
- c2[x]=o2;
- c1[x]=o1;
- o4=t4;
- o3=t3;
- o2=t2;
- o1=t1
- }
- for(x=0;x>8)&255;
- arr[c3[t3]]=cpy[x];
- c3[t3]++
- }
- for(x=0;x>16)&255;
- cpy[c2[t2]]=arr[x];
- c2[t2]++
- }
- for(x=0;x>24)&255^128;
- arr[c1[t1]]=cpy[x];
- c1[t1]++
- }
- return arr
- };
-
-this.isNumeric2DArray=function(arr){
- for(var i=0;i=":10,
- ">":10,
- "&&":5,
- "||":4,
- ",":1
-};
-
-this.expects={
- sin:1,
- cos:1,
- tan:1,
- sec:1,
- csc:1,
- cot:1,
- asin:1,
- acos:1,
- atan:1,
- asec:1,
- acsc:1,
- acot:1,
- sinh:1,
- cosh:1,
- tanh:1,
- sech:1,
- csch:1,
- coth:1,
- asinh:1,
- acosh:1,
- atanh:1,
- asech:1,
- acsch:1,
- acoth:1,
- exp:1,
- ln:1,
- log:1,
- logb:2,
- pow:2,
- sq:1,
- sqrt:1,
- abs:1,
- sgn:1,
- chs:1,
- floor:1,
- ceil:1,
- ip:1,
- fp:1,
- inv:1,
- min:2,
- max:2,
- gamma:1,
- fact:1,
- comb:2,
- perm:2,
- gcd:2,
- lcm:2,
- prime:1,
- and:2,
- or:2,
- xor:2,
- neg:1,
- not:1,
- "^":2,
- "*":2,
- "/":2,
- mod:2,
- div:2,
- "+":2,
- "-":2,
- "<":2,
- "<=":2,
- "==":2,
- "!=":2,
- ">=":2,
- ">":2,
- "&&":2,
- "||":2
-};
-
-this.alias={
- "+":"add",
- "-":"sub",
- "*":"mul",
- "/":"div",
- "!":"fact",
- "x^y":"pow",
- "^":"pow",
- "10^":"pow10",
- div:"idiv",
- "<":"lt",
- "<=":"le",
- "==":"eq",
- "!=":"ne",
- ">=":"ge",
- ">":"gt",
- "%":"pc",
- "%ch":"pcch"
-};
-
-this.add=function(y,x){
- return new Number(x)+new Number(y)
- };
-
-this.sub=function(y,x){
- return x-y
- };
-
-this.mul=function(y,x){
- return x*y
- };
-
-this.div=function(y,x){
- return x/y
- };
-
-this.sin=function(x){
- return Math.sin(x)
- };
-
-this.cos=function(x){
- return Math.cos(x)
- };
-
-this.tan=function(x){
- return Math.tan(x)
- };
-
-this.sec=function(x){
- return 1/Math.cos(x)
- };
-
-this.csc=function(x){
- return 1/Math.sin(x)
- };
-
-this.cot=function(x){
- return 1/Math.tan(x)
- };
-
-this.asin=function(x){
- return Math.asin(x)
- };
-
-this.acos=function(x){
- return Math.acos(x)
- };
-
-this.atan=function(x){
- return Math.atan(x)
- };
-
-this.asec=function(x){
- return Math.acos(1/x)
- };
-
-this.acsc=function(x){
- return Math.asin(1/x)
- };
-
-this.acot=function(x){
- return Math.atan(1/x)
- };
-
-this.sinh=function(x){
- return(Math.exp(x)-Math.exp(-x))*0.5
- };
-
-this.cosh=function(x){
- return(Math.exp(x)+Math.exp(-x))*0.5
- };
-
-this.tanh=function(x){
- return(Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x))
- };
-
-this.sech=function(x){
- return 1/cosh(x)
- };
-
-this.csch=function(x){
- return 1/sinh(x)
- };
-
-this.coth=function(x){
- return 1/tanh(x)
- };
-
-this.asinh=function(x){
- return Math.log(x+Math.sqrt(x*x+1))
- };
-
-this.acosh=function(x){
- return Math.log(x+Math.sqrt(x*x-1))
- };
-
-this.atanh=function(x){
- return Math.log((1+x)/(1-x))*0.5
- };
-
-this.asech=function(x){
- return acosh(1/x)
- };
-
-this.acsch=function(x){
- return asinh(1/x)
- };
-
-this.acoth=function(x){
- return atanh(1/x)
- };
-
-this.exp=function(x){
- return Math.exp(x)
- };
-
-this.ln=function(x){
- return Math.log(x)
- };
-
-this.log=function(x){
- return Math.log(x)/Math.LN10
- };
-
-this.logb=function(y,x){
- return Math.log(x)/Math.log(y)
- };
-
-this.pow=function(y,x){
- return Math.pow(x,y)
- };
-
-this.pow10=function(x){
- return Math.pow(10,x)
- };
-
-this.sq=function(x){
- return x*x
- };
-
-this.sqrt=function(x){
- return Math.sqrt(x)
- };
-
-this.abs=function(x){
- return x>=0?x:-x
- };
-
-this.sgn=function(x){
- return x==0?0:(x>0?1:-1)
- };
-
-this.chs=function(x){
- return -x
- };
-
-this.neg=function(x){
- return -x
- };
-
-this.floor=function(x){
- return Math.floor(x)
- };
-
-this.ceil=function(x){
- return Math.ceil(x)
- };
-
-this.ip=function(x){
- return parseInt(x)
- };
-
-this.fp=function(x){
- return abs(x)-ip(abs(x))
- };
-
-this.inv=function(x){
- return 1/x
- };
-
-this.idiv=function(y,x){
- return parseInt(x/y)
- };
-
-this.mod=function(y,x){
- return x%y
- };
-
-this.and=function(y,x){
- return x&y
- };
-
-this.or=function(y,x){
- return x|y
- };
-
-this.xor=function(y,x){
- return x^y
- };
-
-this.not=function(x){
- return ~x
- };
-
-this.lt=function(y,x){
- return x=y?1:0
- };
-
-this.gt=function(y,x){
- return x>y?1:0
- };
-
-this.Min=function(y,x){
- return Math.min(x,y)
- };
-
-this.Max=function(y,x){
- return Math.max(x,y)
- };
-
-this.pc=function(y,x){
- return x*y/100
- };
-
-this.pcch=function(y,x){
- return 100*y/x
- };
-
-this.gammaConsts=new Array(76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,0.001208650973866179,-0.000005395239384953);
-this.gammaLn=function(x){
- var n=new Number(x);
- var tmp=new Number(x+5.5);
- var ser=new Number(1.000000000190015);
- tmp-=(x+0.5)*Math.log(tmp);
- for(var i in this.gammaConsts){
- ser+=this.gammaConsts[i]/++n
- }
- return Math.log(2.5066282746310007*ser/x)-tmp
- };
-
-this.gamma=function(x){
- return Math.exp(this.gammaLn(x))
- };
-
-this.fact=function(n){
- var r=new Number(n);
- if(n<=1){
- return 1
- }
- if(n>100||(n%1)){
- return Math.exp(this.gammaLn(n+1))
- }while(--n){
- r*=n
- }
- return r
- };
-
-this.comb=function(y,x){
- return Math.floor(0.5+Math.exp(this.gammaLn(x+1)-this.gammaLn(y+1)-this.gammaLn(x-y+1)))
- };
-
-this.perm=function(y,x){
- return Math.floor(0.5+Math.exp(this.gammaLn(x+1)-this.gammaLn(x-y+1)))
- };
-
-this.gcd=function(a,b){
- if(a==0){
- return(b||1)
- }
- return(b?this.gcd(b,a%b):a)
- };
-
-this.lcm=function(a,b){
- return(a/this.gcd(a,b))*b
- };
-
-this.prime=function(n){
- var d=new Number(5);
- var dd=new Number(4);
- var w=parseInt(n/d);
- if(n==2||n==3||n==5){
- return 1
- }
- if(n<5||(n&1)==0||(n%3)==0){
- return 0
- }while(d*w=0;i--){
- tmp[cnt]=arr[i];
- cnt++
- }
- return tmp
- };
-
-this.percentile=function(min,max,val){
- var range=max-min;
- if(range==0){
- return 50
- }
- var prcnt=val-min;
- return prcnt*100/range
- };
-
-this.rank=function(arr){
- var ranks=[];
- for(var i=0;i0){
- sum+=arr[i]
- }
- }else{
- sum+=arr[i]
- }
- }
- return sum
-};
-
-this.mean=function(arr,filterSmps,filterVars){
- arr=this.cleanArray(arr,filterSmps,filterVars);
- var mean=0;
- var n=0;
- for(var i=0;i0){
- mean/=n
- }
- return mean
-};
-
-this.range=function(arr,filterSmps,filterVars){
- arr=this.cleanArray(arr,filterSmps,filterVars);
- var min=Number.MAX_VALUE;
- var max=Number.MAX_VALUE*-1;
- for(var i=0;i0){
- vals[1]=n;
- median.sort(function(a,b){
- return a-b
- });
- if(n%2){
- vals[0]=median[parseInt(n/2)]
- }else{
- vals[0]=(median[parseInt((n-1)/2)]+median[n/2])/2
- }
- }
- return vals
-};
-
-this.meanStandardDeviationN=function(arr,filterSmps,filterVars){
- arr=this.cleanArray(arr,filterSmps,filterVars);
- var vals=[];
- var stdev=0;
- var mean=0;
- var n=0;
- for(var i=0;i0){
- mean/=n;
- stdev=Math.sqrt(stdev/n-mean*mean);
- vals.push(mean);
- vals.push(stdev);
- vals.push(n)
- }else{
- vals.push("");
- vals.push("");
- vals.push("")
- }
- return vals
- };
-
-this.quantiles=function(arr,filterSmps,filterVars){
- arr=this.cleanArray(arr,filterSmps,filterVars);
- var vals=[];
- var out=[];
- var n=arr.length;
- if(n>2){
- var qtl1i=Math.floor(n*0.25);
- var qtl2i=Math.floor(n*0.5);
- var qtl3i=Math.floor(n*0.75);
- arr.sort(function(a,b){
- return a-b
- });
- var qtl1;
- var qtl2;
- var qtl3;
- if(n%2){
- qtl2=arr[qtl2i]
- }else{
- qtl2=this.mean([arr[qtl2i-1],arr[qtl2i]])
- }
- if((n/2)%2){
- qtl1=arr[qtl1i];
- qtl3=arr[qtl3i]
- }else{
- qtl1=this.mean([arr[qtl1i-1],arr[qtl1i]]);
- qtl3=this.mean([arr[qtl3i-1],arr[qtl3i]])
- }
- var iqr=(qtl3-qtl1)*1.5;
- var iqr1;
- var iqr3;
- for(var i=0;i<=qtl1i;i++){
- if(arr[i]=qtl3i;i--){
- if(arr[i]>qtl3+iqr){
- out.push(arr[i])
- }else{
- iqr3=arr[i];
- break
- }
- }
- vals.push(qtl1);
-vals.push(qtl2);
-vals.push(qtl3);
-vals.push(iqr1);
-vals.push(iqr3);
-vals.push(out);
-vals.push(n)
-}else{
- if(n>1){
- vals.push(arr[0]);
- vals.push(arr[1]);
- vals.push(arr[1]);
- vals.push(arr[0]);
- vals.push(arr[1]);
- vals.push(out);
- vals.push(n)
- }else{
- if(n>0){
- vals.push(arr[0]);
- vals.push(arr[0]);
- vals.push(arr[0]);
- vals.push(arr[0]);
- vals.push(arr[0]);
- vals.push(out);
- vals.push(n)
- }else{
- vals.push(Number.NaN);
- vals.push(Number.NaN);
- vals.push(Number.NaN);
- vals.push(Number.NaN);
- vals.push(Number.NaN);
- vals.push(Number.NaN)
- }
- }
-}
-return vals
-};
-
-this.covariance=function(arr1,arr2,filterSmps,filterVars){
- var clean=this.cleanArrays(arr1,arr2,filterSmps,filterVars);
- arr1=clean[0];
- arr2=clean[1];
- var sxy=0;
- var n=0;
- var m1=this.mean(arr1);
- var m2=this.mean(arr2);
- for(var i=0;i0){
- sxy/=n;
- return sxy-(m1*m2)
- }
- return sxy
- };
-
-this.correlation=function(arr1,arr2,filterSmps,filterVars){
- var clean=this.cleanArrays(arr1,arr2,filterSmps,filterVars);
- arr1=clean[0];
- arr2=clean[1];
- var n=0;
- var sx=0;
- var sy=0;
- var sx2=0;
- var sy2=0;
- var cov=this.covariance(arr1,arr2);
- var cor=0;
- for(var i=0;i0){
- cor=(n*n)*cov/Math.sqrt(((n*sx2)-(sx*sx))*((n*sy2)-(sy*sy)))
- }
- return cor
- };
-
-this.regression=function(arr1,arr2,filterSmps,filterVars){
- var clean=this.cleanArrays(arr1,arr2,filterSmps,filterVars);
- arr1=clean[0];
- arr2=clean[1];
- var n=0;
- var sx=0;
- var sy=0;
- var sxy=0;
- var sx2=0;
- var sy2=0;
- var cov=this.covariance(arr1,arr2);
- var cor=0;
- var slope=0;
- var inter=0;
- for(var i=0;i2){
- slope=(n*sxy-sx*sy)/(n*sx2-sx*sx);
- inter=(sy-slope*sx)/n;
- cor=(n*n)*cov/Math.sqrt(((n*sx2)-(sx*sx))*((n*sy2)-(sy*sy)))
- }
- return[slope,inter,cor]
- };
-
-this.slope=function(x0,y0,x1,y1){
- return y0!=y1?(x1-x0)/(y1-y0):0
- };
-
-this.intercept=function(x,y,s){
- return y-(x*s)
- };
-
-this.slopeIntercept=function(x0,y0,x1,y1){
- var s=this.slope(x0,y0,x1,y1);
- return[s,this.intercept(x0,y0,s)]
- };
-
-this.normalize=function(d){
- for(var i=0;in){
- return null
- }
- var sv=[];
- var si=[];
- var ti={};
-
- var t=0;
- var s=0;
- var v,sel;
- while(sdis[i][j]){
- minD[i]=j
- }
- }
- }
-for(var i=0;idis[c2][j]){
- dis[j][c1]=dis[c1][j]=dis[c2][j]
- }
- }else{
- if(this.linkage=="complete"){
- if(dis[c1][j]this.maxIterations){
- rep=false
- }
-}
-for(var i=0;i=level.data[ii][idx]){
- val=level.data[ii][j]-level.data[ii][idx];
- if(type=="ratio2"){
- level.trans[ii][j]=Math.pow(2,val)
- }else{
- if(type=="ratio10"){
- level.trans[ii][j]=Math.pow(10,val)
- }
- }
- }else{
- val=level.data[ii][idx]/level.data[ii][i];
- if(type=="ratio2"){
- level.trans[ii][j]=Math.pow(2,val)*-1
- }else{
- level.trans[ii][j]=Math.pow(10,val)*-1
- }
- }
- }else{
- if(level.data[ii][j]>=level.data[ii][idx]){
- level.trans[ii][j]=level.data[ii][j]/level.data[ii][idx]
- }else{
- level.trans[ii][j]=level.data[ii][idx]/level.data[ii][j]*-1
- }
- }
- }
-}
-}
-};
-
-this.transformRelative=function(type,axis,exp){
- var level=this.isGroupedData?this.data.w:this.data.y;
- var filterSmp=this.isGroupedData?false:true;
- axis=axis?axis:this.zscoreAxis?this.zscoreAxis:"samples";
- if(axis=="samples"){
- for(var i=0;i0){
- this.xAxis=this.xAxisTemp;
- this.xAxisTmp=[]
- }
- if(this.yAxisTemp&&this.yAxisTemp.length>0){
- this.yAxis=this.yAxisTemp;
- this.yAxisTmp=[]
- }
- if(this.zAxisTemp&&this.zAxisTemp.length>0){
- this.zAxis=this.zAxisTemp;
- this.zAxisTmp=[]
- }
- if(!this.xAxis||!this.yAxis){
- this.xAxis=[];
- this.yAxis=[];
- this.xAxisIndices=[];
- this.yAxisIndices=[];
- this.xAxis=[this.data.y.smps[0]];
- for(var i=1;ii){
- this.data.l.smps.push({
- xAxis:[this.data.y.smps[j]],
- yAxis:[this.data.y.smps[i]]
- })
- }else{
- this.data.l.smps.push({})
- }
- }else{
- if(this.allVsAllType=="lower"){
- if(i>j){
- this.data.l.smps.push({
- xAxis:[this.data.y.smps[j]],
- yAxis:[this.data.y.smps[i]]
- })
- }else{
- this.data.l.smps.push({})
- }
- }else{
- this.data.l.smps.push({
- xAxis:[this.data.y.smps[j]],
- yAxis:[this.data.y.smps[i]]
- })
- }
- }
- }
- }
-}
-this.layoutComb=true;
-this.showAnimationTemp=this.showAnimation;
-this.showAnimation=false;
-this.layout=n+"X"+n;
-this.isValidLayout()
-}
-};
-
-this.setMultiplePies=function(){
- if(this.graphType.match(/Pie/)){
- var r,c;
- var n=this.xAxis.length;
- if(this.layout){
- var topo=this.layout.split(/X/i);
- r=parseInt(topo[0]);
- c=parseInt(topo[1]);
- if(r*c2){
- this.validGraphTypes.push("Scatter2D");
- this.validGraphTypes.push("ScatterBubble2D");
- this.validGraphTypes.push("Scatter3D")
- }else{
- if(this.data.y.smps.length>1){
- this.validGraphTypes.push("Scatter2D")
- }
- }
-}
-}
-this.validGraphTypes.sort()
-}
-this.initializeDataAttributes(this.data.initialVarIndices,this.data.initialSmpIndices);
-delete (this.data.initialVarIndices);
-delete (this.data.initialSmpIndices)
-};
-
-this.setMarketTechnicalData=function(){
- if(this.stockIndicators.length>0){
- var n={};
-
- var e=false;
- var v={
- Sma5:5,
- Sma10:10,
- Sma20:20,
- Sma25:25,
- Sma50:50
- };
-
- var r=[];
- for(var i=0;i0){
- this.stockIndicators=r;
- var t={};
-
- for(var i=0;i=0;j--){
- var d=this.parseDate(data[j][0]);
- var idx=0;
- if(!dates.hasOwnProperty(d)){
- idx=t;
- dates[d]=t;
- this.data.market.smps.push(d);
- t++
- }else{
- idx=dates[d]
- }
- this.data.market.open[i][idx]=data[j][1];
- this.data.market.high[i][idx]=data[j][2];
- this.data.market.low[i][idx]=data[j][3];
- this.data.market.close[i][idx]=data[j][4];
- this.data.market.volume[i][idx]=data[j][5]
- }
- }
- }
- this.isMarketDataFormated=true
-};
-
-this.switchToMarketData=function(){
- var market=this.data.market;
- this.dataStndBy=this.data;
- this.data={};
-
- this.data.y=market;
- this.initializeDataAttributes();
- if(this.showVolume){
- this.deleteSubGraphAttributes();
- this.data.l={};
-
- this.data.l.vars=[this.data.y.vars,this.data.y.vars];
- this.data.l.weight=this.graphOrientation=="vertical"?[0.75,0.25]:[0.25,0.75];
- this.data.l.type=["Candlestick","Candlestick"];
- this.data.l.name=this.graphOrientation=="vertical"?["Price","Volume"]:["Volume","Price"];
- this.data.l.desc=this.graphOrientation=="vertical"?["Price","Volume"]:["Volume","Price"];
- this.segregateSamplesBy=false;
- this.segregateVariablesBy=false;
- this.layoutComb=true;
- this.layout="1X2";
- this.isValidLayout()
- }
- };
-
-this.switchFromMarketData=function(){
- this.switchData();
- if(this.showVolume){
- this.resetLayout();
- this.isValidLayout()
- }
- };
-
-this.switchData=function(){
- if(this.dataStndBy){
- this.initConfig();
- this.data=this.dataStndBy;
- this.initializeData(this.data)
- }
- };
-
-this.updateData=function(data){
- this.initializeData(data);
- this.initializeGraph()
- };
-
-this.initializeData()
-};
-
-CanvasXpress.prototype.FunctionData=function(){
- this.implied=function(a){
- if(a=="neg"){
- return false
- }
- return/^(\d+\.\d+|\d+\.?|\.\d+)(e[-+]?\d+)?|\w+$/.test(a)
- };
-
- this.tokenize=function(f){
- var b;
- var a=[];
- var d=new String("");
- var c=/(\d+\.\d+|\d+\.?|\.\d+)(e[-+]?\d+)?|[xy]|[a-z]+|[-+*\/(),^]|<=?|>=?|==|!=|&&|\|\|/g;
- f=f.toLowerCase();
- f=f.replace(/\s/g,"");
- f=f.replace(/\+\+/g,"+");
- f=f.replace(/\+-/g,"-");
- f=f.replace(/-\+/g,"-");
- f=f.replace(/--/g,"+");
- f=f.replace(/^\+/,"");
- f=f.replace(/([(*\/&\|<>=])\+/g,"$1");
- f=f.replace(/^-/,"neg ");
- f=f.replace(/([(*\/&\|<>=])-/g,"$1neg ");
- f=f.replace(/\)(\(|\w)/g,")*$1");
- f=f.replace(/(\d)\(/g,"$1*(");
- while(b=c.exec(f)){
- if(this.implied(d)&&this.implied(b[0].toString())){
- a.push("*")
- }
- a.push(d=b[0])
- }
- return a
- };
-
- this.isValidEnd=function(a){
- return/^(\d+\.\d+|\d+\.?|\.\d+)(e[-+]?\d+)?|[)xye]|pi|rand$/.test(a)
- };
-
- this.toPostFx=function(d){
- var b=new String();
- var c=new String("");
- var a=new Array();
- var e=new Array();
- while(b=d.shift()){
- if(b=="("){
- a.push(b)
- }else{
- if(this.precedence[b]){
- while(a.length&&a[a.length-1]!="("&&this.precedence[a[a.length-1]]>=this.precedence[b]){
- e.push(a.pop())
- }
- if(b==","&&!this.isValidEnd(c)){
- e.push("Unexpected: "+c)
- }
- if(b!=","){
- a.push(b)
- }
- }else{
- if(b==")"){
- if(!this.isValidEnd(c)){
- e.push("Unexpected: "+c)
- }while(a.length&&a[a.length-1]!="("){
- e.push(a.pop())
- }
- if(a.length==0){
- e.push("Unmatched: )")
- }
- a.pop()
- }else{
- if(/^[-+]?(\d+\.?|\d*\.\d+)(e[-+]?\d+)?$/.test(b)){
- e.push(b)
- }else{
- e.push("Unknown: "+b)
- }
- }
- }
- }
-c=b
-}
-if(!this.isValidEnd(c)){
- e.push("Unexpected: "+c)
- }while(b=a.pop()){
- if(b=="("){
- e.push("Unmatched: (")
- }
- e.push(b)
- }
- return e
-};
-
-this.syntaxCheck=function(d){
- var a=new Number(0);
- var c=new String();
- for(var b=0;b1?a.pop():0))
- }else{
- a.push(d)
- }
- }
- }
- }
- }
-}
-if(isNaN(a[a.length-1])){
- return Number.NaN
- }
-}
-return parseFloat(a.pop())
-};
-
-this.set2DPlot=function(j,g){
- var k={
- vars:[],
- smps:["X","Y"],
- data:[]
- };
-
- var f=this.setMinX?this.setMinX:(0-1);
- var b=this.setMaxX?this.setMaxX:(1-0);
- var e=this.setMinY?this.setMinY:(0-1);
- var a=this.setMaxY?this.setMaxY:(1-0);
- var p=(b-f)/this.functionIntervals;
- var o=(a-e)/this.functionIntervals;
- var c=1;
- if(g==1){
- var m=f;
- for(var h=0;h=that.remoteIds.length){
- that.remoteUpdate=false;
- clearInterval(cl)
- }else{
- that.resetSelectOptionsRemoteData(s,x);
- that.requestRemoteIds()
- }
- };
-
- var cl=setInterval(this.update,that.remoteUpdateDelay)
- };
-
- updater.call()
- }
- }
-}(this);
-this.saveRemoteParameters=function(o){
- var params="index="+this.remoteDataIndex+"&save=true";
- for(var p in this.remoteParams){
- params+="&"+p+"="+this.remoteParams[p]
- }
- params+="¶ms="+JSON.stringify(this.userConfig);
- var url=this.remoteService+"?"+params;
- this.ajaxRequest(url,function(){
- alert("Parameters saved")
- },"json","POST")
- };
-
-this.castRemoteParameters=function(o){
- o.remoteParentId=this.remoteParentId;
- o.remoteService=this.remoteService;
- o.remoteDirection=this.remoteDirection;
- o.remoteDataIndex=this.remoteDataIndex;
- o.remoteWindow=this.remoteWindow;
- o.remoteAutoPlay=this.remoteAutoPlay;
- o.remoteAutoPlayDelay=this.remoteAutoPlayDelay;
- for(var p in this.remoteParams){
- o.remoteParams[p]=this.remoteParams[p]
- }
- o.addRemoveNavigationTopListeners("addEvtListener");
- o.addRemoveNavigationLeftRightListeners("addEvtListener")
- };
-
-this.maintainIndices=function(n){
- if(!this.graphType.match(/Network|Genome|Venn/)&&!n.config.graphType.match(/Network|Genome|Venn/)){
- if(this.data.y.vars.length==n.data.y.vars.length){
- n.data.initialVarIndices=this.varIndices
- }
- if(this.data.y.smps.length==n.data.y.smps.length){
- n.data.initialSmpIndices=this.smpIndices
- }
- }
-};
-
-this.maintainState=function(n){
- if(!this.graphType.match(/Network|Genome|Venn/)&&!n.graphType.match(/Network|Genome|Venn/)){
- if(this.isGroupedData&&n.data.x){
- for(var i=0;i40?v.substring(0,37)+"...":v
- }else{
- this.resetSelectOptionsRemoteData(s)
- }
- }
-};
-
-this.resetSelectOptionsRemoteData=function(s,t){
- if(!s){
- s=document.getElementById(this.remoteParentId+"-canvasXpressRemoteWindowTopBarSelect")
- }
- if(s){
- if(this.remoteIds.length==0){
- for(var i=0;i=1){
- s.removeChild(s.firstChild)
- }
- }
-};
-
-this.addSelectOptionsRemoteData=function(ids,s,t){
- if(ids){
- this.remoteIds=ids;
- if(!s){
- s=document.getElementById(this.remoteParentId+"-canvasXpressRemoteWindowTopBarSelect")
- }
- if(s){
- for(var i=0;i=step){
- clearInterval(clearUpdateInt);
- that.destroy(o);
- if(that.remoteDirection=="next"){
- c2.style.left=0+"px"
- }else{
- c1.style.left=0+"px"
- }
- b.parentNode.style.overflow="visible";
- that.remoteUpdating=false;
- that.updateCurrentRemoteData()
- }else{
- if(that.remoteDirection=="next"){
- c1.style.left=(l*-1)+"px";
- c2.style.left=(l*-1)+"px"
- }else{
- c1.style.left=(-w+l)+"px";
- c2.style.left=(-w+l)+"px"
- }
- c1.style.display="block";
- c2.style.display="block"
- }
- s++
- };
-
- var clearUpdateInt=setInterval(this.update,100)
- };
-
- updater.call()
- }
- }
-};
-
-this.handleRemoteSelect=function(t){
- return function(e){
- var s=t.getTargetEvent(e);
- var i=s.children[s.selectedIndex].value;
- var c=document.getElementById(t.remoteParentId+"-canvasXpressRemoteWindowTopBarCurrent");
- t.remoteDirection=i>t.remoteDataIndex?"next":"previous";
- t.remoteDataIndex=i;
- var v=s.children[s.selectedIndex].text;
- if(c&&s){
- s.style.display="none";
- t.resetSelectOptionsRemoteData(s);
- c.value=v.length>40?v.substring(0,37)+"...":v
- }
- t.requestRemoteData()
- }
- }(this);
-this.handleRemoteClickStop=function(t){
- return function(e){
- t.remoteStop=true
- }
- }(this);
-this.handleRemoteClickPlay=function(t){
- return function(e){
- var r=t.getTargetEvent(e);
- t.remoteDirection="next";
- t.remoteStop=false;
- t.playRemoteData(r.parentNode.lastChild)
- }
- }(this);
-this.playRemoteData=function(s){
- var updater=function(){
- that=CanvasXpress.references[0];
- if(that){
- if(!that.remoteUpdating&&!that.remoteStop){
- that.remoteUpdating=true;
- that.showInfoSpan(false,"Updating ...",true);
- if(s&&s.tagName.match(/select/i)&&that.remoteDataIndex>=s.length-1){
- that.remoteDataIndex=0
- }else{
- that.remoteDataIndex++
- }
- that.requestRemoteData()
- }
- }
- this.update=function(){
- that=CanvasXpress.references[0];
- if(that){
- if(!that.remoteUpdating&&!that.remoteStop){
- that.remoteUpdating=true;
- that.showInfoSpan(false,"Updating ...",true);
- if(s&&s.tagName.match(/select/i)&&that.remoteDataIndex>=s.length-1){
- that.remoteDataIndex=0
- }else{
- that.remoteDataIndex++
- }
- that.requestRemoteData()
- }
- if(that.remoteStop){
- clearInterval(cl)
- }
- }else{
- clearInterval(cl)
- }
- };
-
-var cl=setInterval(this.update,that.remoteAutoPlayDelay)
-};
-
-updater.call()
-};
-
-this.handleRemoteClickPrev=function(t){
- return function(e){
- if(!t.remoteUpdating){
- var r=t.getTargetEvent(e);
- var s=r.parentNode.lastChild;
- t.remoteUpdating=true;
- t.showInfoSpan(false,"Updating ...",true);
- t.remoteDirection="previous";
- if(s&&s.tagName.match(/select/i)&&t.remoteDataIndex<=0){
- t.remoteDataIndex=s.length-1
- }else{
- t.remoteDataIndex--
- }
- t.requestRemoteData()
- }
- }
-}(this);
-this.handleRemoteClickNext=function(t){
- return function(e){
- if(!t.remoteUpdating){
- var r=t.getTargetEvent(e);
- var s=r.parentNode.lastChild;
- t.remoteUpdating=true;
- t.showInfoSpan(false,"Updating ...",true);
- t.remoteDirection="next";
- if(s&&s.tagName.match(/select/i)&&t.remoteDataIndex>=s.length-1){
- t.remoteDataIndex=0
- }else{
- t.remoteDataIndex++
- }
- t.requestRemoteData()
- }
- }
-}(this);
-this.handleRemoteClickDown=function(t){
- return function(e){
- if(!t.remoteUpdating){
- var s=document.getElementById(t.remoteParentId+"-canvasXpressRemoteWindowTopBarSelect");
- if(s){
- if(s.style.display=="none"){
- s.style.display="block";
- s.options[s.selectedIndex].selected=true
- }else{
- s.style.display="none"
- }
- }
- }
-}
-}(this);
-this.addRemoteNavigationTop=function(w){
- var m="5px";
- var n=document.createElement("div");
- n.id=this.remoteParentId+"-canvasXpressRemoteWindowTopBar";
- n.style.padding="2px";
- n.style.color=this.skinColor;
- n.style.border="1px solid "+this.skinBorderColor;
- n.style.backgroundColor=this.skinBackgroundColor;
- n.style.boxShadow="2px 2px 2px "+this.skinShadowColor;
- n.style.MozBoxShadow="2px 2px 2px "+this.skinShadowColor;
- n.style.borderRadius="4px";
- n.style.width="435px";
- n.style.position="absolute";
- n.style.marginLeft=w+"px";
- n.style.zIndex=9500;
- n.style.display="none";
- var r=document.createElement("img");
- r.id=this.remoteParentId+"-canvasXpressRemoteWindowTopBarPrev";
- r.src=this.imageDir+this.previousButton;
- r.alt="Previous graph";
- r.title="Previous graph";
- r.style.margin=m;
- n.appendChild(r);
- var p=document.createElement("img");
- p.id=this.remoteParentId+"-canvasXpressRemoteWindowTopBarPlay";
- p.src=this.imageDir+this.playButton;
- p.alt="Iterate over graphs";
- p.title="Iterate over graphs";
- p.style.margin=m;
- n.appendChild(p);
- var e=document.createElement("img");
- e.id=this.remoteParentId+"-canvasXpressRemoteWindowTopBarStop";
- e.src=this.imageDir+this.stopButton;
- e.alt="Stop iteration";
- e.title="Stop iteration";
- e.style.margin=m;
- n.appendChild(e);
- var f=document.createElement("img");
- f.id=this.remoteParentId+"-canvasXpressRemoteWindowTopBarNext";
- f.src=this.imageDir+this.nextButton;
- f.alt="Next graph";
- f.title="Next graph";
- f.style.margin=m;
- n.appendChild(f);
- var c=document.createElement("input");
- c.id=this.remoteParentId+"-canvasXpressRemoteWindowTopBarCurrent";
- c.type="text";
- c.style.padding="1px 1px 2px 1px";
- c.style.position="absolute";
- c.style.cursor="default";
- c.style.display="block";
- c.style.left="102px";
- c.style.top="0px";
- c.style.margin="5px";
- c.style.width="322px";
- c.style.borderRadius="4px";
- c.style.MozBorderRadius="4px";
- n.appendChild(c);
- var d=document.createElement("img");
- d.id=this.remoteParentId+"-canvasXpressRemoteWindowTopBarDown";
- d.src=this.imageDir+this.dropdownButton;
- d.alt="Select graph";
- d.title="Select graph";
- d.style.margin=m;
- d.style.position="absolute";
- d.style.top="3px";
- d.style.right="4px";
- n.appendChild(d);
- var s=document.createElement("select");
- s.id=this.remoteParentId+"-canvasXpressRemoteWindowTopBarSelect";
- s.style.position="absolute";
- s.style.margin="5px";
- s.style.color=this.skinColor;
- s.style.backgroundColor=this.skinBackgroundColor;
- s.style.border="1px solid "+this.skinBorderColor;
- s.style.marginTop="1px";
- s.style.left="102px";
- s.style.top="26px";
- s.style.maxWidth="800px";
- s.style.display="none";
- s.size=10;
- n.appendChild(s);
- return n
- };
-
-this.addRemoveNavigationTopListeners=function(t){
- var r=document.getElementById(this.remoteParentId+"-canvasXpressRemoteWindowTopBarPrev");
- var p=document.getElementById(this.remoteParentId+"-canvasXpressRemoteWindowTopBarPlay");
- var e=document.getElementById(this.remoteParentId+"-canvasXpressRemoteWindowTopBarStop");
- var f=document.getElementById(this.remoteParentId+"-canvasXpressRemoteWindowTopBarNext");
- var d=document.getElementById(this.remoteParentId+"-canvasXpressRemoteWindowTopBarDown");
- var s=document.getElementById(this.remoteParentId+"-canvasXpressRemoteWindowTopBarSelect");
- if(r){
- this[t](r,"click",this.handleRemoteClickPrev,false)
- }
- if(p){
- this[t](p,"click",this.handleRemoteClickPlay,false)
- }
- if(e){
- this[t](e,"click",this.handleRemoteClickStop,false)
- }
- if(f){
- this[t](f,"click",this.handleRemoteClickNext,false)
- }
- if(d){
- this[t](d,"click",this.handleRemoteClickDown,false)
- }
- if(s){
- this[t](s,"change",this.handleRemoteSelect,false)
- }
- };
-
-this.selectDataSet=function(e){
- var t=document.activeElement;
- if(t.id==this.remoteParentId+"-canvasXpressRemoteWindowTopBarCurrent"){
- var s=document.getElementById(this.remoteParentId+"-canvasXpressRemoteWindowTopBarSelect");
- var p=[];
- if(s&&t.value.length>0){
- if(this.remoteIds.length==0){
- for(var i=0;i=0){
- p.push(i)
- }
- }
- for(var i=0;i=w?0:15;
- if(wc<=wp&&w1){
- return true
- }else{
- return false
- }
- case"ScatterBubble2D":case"Scatter3D":
- if(this.data.y&&this.data.y.smps&&this.data.y.smps.length>2){
- return true
- }else{
- return false
- }
- case"Candlestick":
- if(this.data.market){
- return true
- }else{
- return false
- }
- case"Venn":
- if(this.data.venn){
- return true
- }else{
- return false
- }
- case"Network":
- if(this.data.nodes){
- return true
- }else{
- return false
- }
- case"Genome":
- if(this.data.tracks){
- return true
- }else{
- return false
- }
- case"Video":
- if(this.data.video){
- return true
- }else{
- return false
- }
- }
- return false
-};
-
-this.setColorScheme=function(){
- switch(this.colorScheme){
- case"reset":
- this.colors=this.colors0;
- break;
- case"basic":
- this.colors=this.colors1;
- break;
- case"dark":
- this.colors=this.colors2;
- break;
- case"strong":
- this.colors=this.colors3;
- break;
- case"light":
- this.colors=this.colors4;
- break;
- case"pastel":
- this.colors=this.colors5;
- break;
- case"balanced":
- this.colors=this.colors6;
- break;
- case"user":
- this.colors=this.colors;
- break
- }
- };
-
-this.reinitializeGraph=function(){
- if(this.graphType=="Candlestick"){
- this.isGraphTime=true;
- if(!this.isMarketSwitched){
- this.switchToMarketData();
- this.initAxes();
- this.summaryType="candle";
- this.initializeDataAttributes();
- this.isMarketSwitched=true
- }
- this.setMarketTechnicalData()
- }else{
- if(this.isExample&&this.isMarketSwitched){
- this.switchFromMarketData();
- this.isMarketSwitched=false;
- this.summaryType=this.data.y.data?"raw":"mean";
- this.initializeDataAttributes();
- this.isGraphTime=false;
- if(this.showVolume){
- this.layoutComb=false
- }
- }else{
- if(this.graphType.match(/Scatter/)&&this.allVsAll){
- this.setAllVsAll()
- }else{
- if(this.graphType.match(/Pie/)&&this.xAxis.length>1){
- this.setMultiplePies()
- }
- }
- }
-}
-};
-
-this.initializeGraph=function(m,a,l,g,b){
- var d=this;
- var h=5;
- var k=0;
- var e=[];
- var j=function(){
- for(var n=0;n0){
- if(this.graphType=="Network"){
- this.Network(true)
- }else{
- if(this.graphType=="Scatter3D"){
- this.Scatter3D(true)
- }else{
- if(this.graphType=="Scatter2D"||this.graphType=="ScatterBubble2D"){
- this.Scatter2D(true)
- }
- }
- }
-}
-if(e.length>0&&!j()){
- for(var c=0;c1){
- var d={};
-
- var c=[];
- if(this.isArray(g)){
- for(var e=0;e=0?0:e
- };
-
-this.getAxisDecimals=function(d){
- var c=1000000;
- var e=(((d*c)-(parseInt(d)*c))/c).toString().replace(/\./,"").length-1;
- return e
- };
-
-this.setAxis=function(c){
- var d=this.isGroupedData?this.data.w:this.data.y;
- if(this[c].length==0){
- if(c=="xAxis"){
- this[c].push(d.smps[this.smpIndices[0]])
- }else{
- if(c=="yAxis"){
- if(d.smps.length>1){
- this[c].push(d.smps[this.smpIndices[1]])
- }else{
- this[c].push(d.smps[this.smpIndices[0]])
- }
- }else{
- if(c=="zAxis"){
- if(d.smps.length>2){
- this[c].push(d.smps[this.smpIndices[2]])
- }else{
- if(d.smps.length>1){
- this[c].push(d.smps[this.smpIndices[1]])
- }else{
- this[c].push(d.smps[this.smpIndices[0]])
- }
- }
- }
- }
-}
-}else{
- if(this.graphType=="Scatter3D"&&this[c].length>1){
- this[c]=[this[c][0]]
- }
- }
-};
-
-this.setAxisValues=function(e){
- var z,p,m,n,o,x,k,f;
- var d={};
-
- var h=e+"MinorValues";
- var l=e+"Values";
- var v=e+"Ticks";
- var w=e+"TickFormat";
- var u=e+"Incr";
- var c=e+"Decs";
- var q=e+"Min";
- var g=e+"Transform";
- var t=e+"MaxStrLength";
- if(this[g]=="percentile"){
- this[c]=0;
- this[l]=[];
- this[h]=[];
- var y=[0,25,50,75,100];
- for(var s=0;sthis.maxData){
- if(this[i]-this[d]>0){
- this[i]-=this[d];
- this[p]-=this[d]
- }
- if(this.minData>0&&this[i]<0){
- this[i]+=this[d];
- this[p]+=this[d]
- }
- }
- }
-}
-this[m]=this[p]-this[i];
-this.setAxisValues(h)
-};
-
-this.setAxes=function(d){
- if(this.graphType.match(/Correlation/)){
- var c=this.isGroupedData?this.data.w:this.data.y;
- this.setMin=null;
- this.setMax=null;
- if(this.correlationAnchorLegend){
- this.setAxisAttributes("xAxis")
- }
- if(!c.cor||c.cor.length==0){
- this.summarize("cor");
- this.setRangeData("cor")
- }
- if(!this.yAxisTitle){
- this.yAxisTitle="Correlation"
- }
- }else{
- if(this.graphType.match(/Scatter|Pie/)){
- var g=this.smpIndices;
- var q=["xAxis"];
- var l=["X"];
- this.setMin=null;
- this.setMax=null;
- if(this.graphType.match(/Scatter/)){
- q.push("yAxis");
- l.push("Y")
- }
- if(this.graphType.match(/ScatterBubble2D|Scatter3D/)){
- q.push("zAxis");
- l.push("Z")
- }
- if(this.graphType=="Scatter3D"){
- this.xAxisTicks=10;
- this.yAxisTicks=10;
- this.zAxisTicks=10
- }
- for(var r=0;r0?d:false,false,this[q[r]+"Transform"]);
- this.setSamplesVisible(g)
- }
- if(!this.xAxisTitle){
- this.xAxisTitle=this.xAxis.length==1?this.xAxis[0]:" "
- }
- if(!this.yAxisTitle){
- this.yAxisTitle=this.yAxis.length==1?this.yAxis[0]:" "
- }
- if(!this.zAxisTitle){
- this.zAxisTitle=this.zAxis.length==1?this.zAxis[0]:" "
- }
- }else{
- if(this.graphType.match(/Genome/)){
- var s=this.setMin;
- var u=this.setMax;
- this.setRangeData("genome");
- this.xAxisExact=true;
- this.xAxisTransform=false;
- this.xAxisAbsMin=this.minData;
- this.xAxisAbsMax=this.maxData;
- if(s!=null){
- this.setMin=s
- }
- if(u!=null){
- this.setMax=u
- }
- this.xAxisMin=this.setMin!=null?this.setMin:this.minData-1;
- this.xAxisMax=this.setMax!=null?this.setMax:this.maxData+1;
- this.xAxisDecs=0;
- this.xAxisRange=this.xAxisMax-this.xAxisMin;
- this.xAxisTicks=this.ticks;
- this.xAxisIncr=this.xAxisRange/this.xAxisTicks;
- this.setAxisValues("xAxis")
- }else{
- var j=this.smpIndices;
- var n=this.varIndices;
- var k=this.grpIndices;
- var f=this.varIndices;
- var h=this.graphType=="Dotplot"&&this.isGroupedData?true:false;
- var m=this.graphType.match(/Percent/)?"percentile":false;
- var t=this.graphType.match(/Stacked/)||(this.graphType.match(/Area/)&&this.areaIsCumulative)?true:false;
- var e=this.graphType=="Candlestick"?"candle":m?m:false;
- if(this.varIndicesStart>-1||this.smpIndicesStart>-1){
- this.setAllVariablesVisible();
- this.setAllSamplesVisible();
- if(this.graphType=="Heatmap"){
- this.graphOrientation="horizontal"
- }
- }else{
- if(this.graphType=="StackedPercent"||this.graphType=="StackedPercentLine"){
- this.setMin=null;
- this.setMax=null;
- this.axisExact=true;
- this.xAxisExact=true
- }else{
- if(this.graphType=="Boxplot"&&!this.isGroupedData){
- if(!this.data.y.median){
- this.summarize("iqr")
- }
- }
- }
-}
-if(this.graphType.match(/BarLine|AreaLine|StackedLine|StackedPercentLine/)&&this.data.a){
- this.setVariablesVisible(this.getVariablesVisibleByAxis("xAxis"))
- }
- this.setAxisAttributes("xAxis",e,h,m,t);
-this["xAxisTitle"]=!this["xAxisTitle"]&&this.data.y.desc?this.data.y.desc[0]:"";
-if((this.graphType.match(/BarLine|AreaLine|StackedLine|StackedPercentLine/)&&this.data.a)||(this.graphType=="Candlestick"&&this.showVolume)){
- e=this.graphType=="Candlestick"?"volume":false;
- if(this.graphType.match(/BarLine|AreaLine|StackedLine|StackedPercentLine/)){
- this.setVariablesVisible(f);
- this.setVariablesVisible(this.getVariablesVisibleByAxis("xAxis2"))
- }
- var p=this.setMax!=null?this.setMax:null;
- var o=this.setMin!=null?this.setMin:null;
- this.setMax=this.setMax2!=null?this.setMax2:null;
- this.setMin=this.setMin2!=null?this.setMin2:null;
- this.setAxisAttributes("xAxis2",e,h);
- this["xAxis2Title"]=!this["xAxis2Title"]&&this.data.y.desc?this.data.y.desc[1]:"";
- this.setMax=p!=null?p:null;
- this.setMin=o!=null?o:null
- }
- if(this.graphType=="Circular"&&this.rAxis){
- this.setAxisAttributes("rAxis","circular",h,m,false,true)
- }
- this.setVariablesVisible(f);
-this.smpIndices=j;
-this.varIndices=n;
-this.grpIndices=k
-}
-}
-}
-};
-
-this.setScatterPointSize=function(){
- this.scatterPointSize=this.varIndices.length>50?this.sizes[1]:this.varIndices.length>20?this.sizes[2]:this.sizes[3];
- if(this.layoutComb){
- this.scatterPointSize=Math.ceil(this.scatterPointSize/this.layoutRows)
- }
- };
-
-this.setAxisUnits=function(e,g){
- var f=e+"Unit";
- var d=e+"Range";
- var c=g?g:e.substring(0,1);
- this[f]=this[c]/this[d]
- };
-
-this.setAxisFont=function(h,g){
- var f=this.graphType=="Venn"?16:12;
- if(this.autoScaleFont||!this.axisTickFont||!this.decorationFont||!this.axisTitleFont){
- var c,e,d;
- if(g>=600){
- c=12*this.tickScaleFontFactor;
- d=10*this.decorationScaleFontFactor;
- e=this.getFontPt(this.scaleTextToFont(h,f,g-2))*this.axisTitleScaleFontFactor
- }else{
- if(g>=400){
- c=10*this.tickScaleFontFactor;
- d=8*this.decorationScaleFontFactor;
- e=this.getFontPt(this.scaleTextToFont(h,f,g-2))*this.axisTitleScaleFontFactor
- }else{
- if(g>=200){
- c=8*this.tickScaleFontFactor;
- d=6*this.decorationScaleFontFactor;
- e=8*this.axisTitleScaleFontFactor
- }else{
- if(g>=100){
- c=6*this.tickScaleFontFactor;
- d=4*this.decorationScaleFontFactor;
- e=6*this.axisTitleScaleFontFactor
- }else{
- c=4*this.tickScaleFontFactor;
- d=2*this.decorationScaleFontFactor;
- e=4*this.axisTitleScaleFontFactor
- }
- }
- }
- }
-this.axisTickFont=(parseInt(c))+"Pt "+this.fontName;
-this.decorationFont=(parseInt(d))+"Pt "+this.fontName;
-this.axisTitleFont=(parseInt(e))+"Pt "+this.fontName
-}else{
- this.axisTickFont=parseInt(this.axisTickFontSize)+"Pt "+this.fontName;
- this.decorationFont=parseInt(this.decorationFontSize)+"Pt "+this.fontName;
- this.axisTitleFont=parseInt(this.axisTitleFontSize)+"Pt "+this.fontName
- }
-};
-
-this.getAxisFont=function(c){
- if(c>=600){
- return 12
- }else{
- if(c>=400){
- return 10
- }else{
- if(c>=200){
- return 8
- }else{
- return 6
- }
- }
- }
-};
-
-this.getHeatmapShades=function(d,c){
- switch(d){
- case"white":case"black":
- if(c&&c!="white"&&c!="black"){
- return this.getHeatmapShades(c)
- }else{
- return this.greys
- }
- case"grey":
- return this.greys;
- case"green":
- return this.greens;
- case"red":
- return this.reds;
- case"blue":
- return this.blues;
- case"yellow":
- return this.yellows;
- case"cyan":
- return this.cyans;
- case"purple":
- return this.purples
- }
- };
-
-this.setHeatmapColors=function(c){
- this.setRGB();
- var k=c?c:this.maxData-this.minData;
- var d=this.heatmapType.split("-");
- var m=256/this.indicatorBins;
- var l=this.getHeatmapShades(d[0],d[1]);
- this.heatmapColors=[];
- this.heatmapBin=(k?k:1)/this.indicatorBins;
- if(this.indicatorCenter.match("rainbow")&&d.length>1){
- var e=["red","purple","blue","cyan","green","yellow"];
- if(this.indicatorCenter=="rainbow-green"){
- e.reverse()
- }
- var n=null;
- for(var h=0;h5){
- n=0
- }
- f.push(e[n]);
- n++
- }
- n=null;
- for(var h=0;h1){
- if((d[0]=="white"&&d[1]!="black")||(d[0]=="black"&&d[1]!="white")){
- this.heatmapType=d[1];
- this.setHeatmapColors(c)
- }else{
- if(d[1]=="white"){
- if(d[0]=="black"){
- this.heatmapColors.push("rgb(0,0,0)");
- for(var h=m-1;h>=0;h--){
- this.heatmapColors.push(l[h]);
- this.heatmapColors.push(l[h])
- }
- }else{
- for(var h=0;h=0;h--){
- this.heatmapColors.push(l[h])
- }
- }
-}
-}
-}else{
- if(this.indicatorCenter=="black"&&color[0]!="grey"){
- this.heatmapColors.push("rgb(0,0,0)")
- }else{
- this.heatmapColors.push("rgb(255,255,255)")
- }
- for(var h=m-1;h>=0;h--){
- this.heatmapColors.push(l[h]);
- this.heatmapColors.push(l[h])
- }
- }
-}
-};
-
-this.initializeAxis=function(){
- if(!this.graphType.match(/Venn|Network|Video/)){
- if(!a){
- this.setAxes();
- this.setHeatmapColors()
- }
- }
-};
-
-this.initializeAxis()
-};
-
-CanvasXpress.prototype.Pie=function(){
- this.setVarPie=function(){
- var f=[];
- var a=this.smpIndices[0];
- if(this.varIndices.length>=this.maxPieSectors-1){
- var e=this;
- this.varIndices.sort(function(g,d){
- return e.data.y.data[d][a]-e.data.y.data[g][a]
- })
- }
- for(var b=0;bthis.width/2){
- this.legendFont=this.scaleTextToFont(b,e,this.width/2)
- }
- var c=e+this.measureText(d,this.legendFont)+(this.margin*5);
- var f=this.varIndices.length>this.maxPieSectors?this.maxPieSectors:this.varIndices.length;
- var a=(f*(e+this.margin))+(this.margin*3);
- return([c,a])
- };
-
- this.setPieXYDimensions=function(){
- var a=this.getPieLegendDimensions();
- if(this.showLegend){
- if(this.legendPosition=="right"){
- this.right=this.layoutComb?this.layoutRight:a[0]
- }else{
- this.bottom=this.layoutComb?this.layoutBottom:a[1]
- }
- }
- this.x=this.layoutComb?this.layoutWidth:this.width-(this.marginLeft+this.left+this.right+this.marginRight);
- this.y=this.layoutComb?this.layoutHeight:this.height-(this.marginTop+this.top+this.bottom+this.marginBottom);
- this.setAxisFont("Pie",this.x)
- };
-
-this.drawPieDataPoints=function(){
- var b=Math.min(this.x,this.y);
- var c=(b-(b/5))/2;
- var a=this.marginLeft+this.offsetX+this.left+(this.x/2);
- var d=this.marginTop+this.offsetY+this.top+(this.y/2);
- this.setVarPie();
- this.drawPie(this.varPie,a,d,c,true)
- };
-
-this.drawPieLegend=function(){
- if(this.showLegend){
- var b,g;
- var k=this.getPieLegendDimensions();
- var l=this.getFontPt(this.legendFont);
- var j=l/2;
- if(this.legendPosition=="right"){
- b=this.layoutComb?(this.width-(this.marginRight+k[0]))+this.marginLeft+this.left:this.marginLeft+this.left+this.x+(this.margin*2)+j;
- g=this.layoutComb?(this.layoutTop+(this.margin*3)+((this.height-(this.layoutTop+this.layoutBottom))/2))-(k[1]/2):this.marginTop+this.top+((this.y/2)-(k[1]/2))+this.margin
- }else{
- b=this.layoutComb?(this.layoutLeft+(this.margin*3)+((this.width-(this.layoutLeft+this.layoutRight))/2))-(k[0]/2):this.marginLeft+this.left+((this.x/2)-(k[0]/2))+this.margin;
- g=this.layoutComb?(this.height-(this.marginBottom+k[1]))+this.marginTop+this.top:this.marginTop+this.top+this.y+(this.margin*2)+j
- }
- var a=b+j+this.margin;
- var f=g;
- for(var d=0;d-1?this.shortenText(this.data.y.vars[h],this.maxVarStringLen):"Other";
- this.drawShape("square",b,f,l,l,this.colors[c],this.foreground,"closed");
- this.drawText(e,a,f,this.legendFont,this.legendColor,"left","middle");
- f+=l+this.margin
- }
- if(this.legendBox){
- this.rectangle(b-(this.margin*2),g-(this.margin*2),k[0]-l,k[1]-l,false,this.legendBoxColor,"open")
- }
- }
-};
-
-this.drawPiePlot=function(){
- this.setPieXYDimensions();
- this.drawTitle();
- this.drawPieDataPoints();
- this.drawPieLegend()
- };
-
-this.initializePiePlot=function(){
- if(this.xAxisMin<0){
- alert("Dude you can't draw a pie chart with negative numbers!");
- return
- }
- if(this.layoutValid){
- this.drawLayoutCompartments(this.drawPiePlot)
- }else{
- this.drawPiePlot()
- }
- };
-
-this.initializePiePlot()
-};
-
-CanvasXpress.prototype.Venn=function(){
- this.setVennXYDimensions=function(){
- var a;
- this.vennMarginLeft=0;
- this.vennMarginTop=0;
- this.setLegendFont();
- this.setAxisFont("Venn",this.width);
- if(this.showLegend){
- this.bottom=this.margin+((this.getFontPt(this.legendFont)+this.margin)*this.vennGroups)
- }
- if(this.width<=this.height){
- this.x=this.width-(this.marginLeft+this.left+this.right+this.marginRight)
- }else{
- this.x=this.height-(this.marginTop+this.top+this.bottom+this.marginBottom)
- }
- this.y=this.vennGroups==4?this.x*0.8:this.vennGroups==3?this.x*0.95:this.vennGroups==2?this.x*0.65:this.x;
- this.vennMarginTop=(this.height-(this.marginTop+this.top+this.y+this.bottom+this.marginBottom))/2;
- this.vennMarginLeft=(this.width-(this.marginLeft+this.left+this.x+this.right+this.marginRight))/2;
- if(this.x<400){
- var b=this.getFontPt(this.axisTickFont)-2;
- if(this.x<200){
- b-=1
- }
- this.axisTickFont=b+"Pt "+this.fontName
- }
- this.resizeCanvas()
- };
-
- this.drawVennBubble=function(b,c,a){
- if(this.vennGroups==4){
- if(this.isIE&&!this.useFlashIE){
- a=a.replace("rgb","rgba");
- a=a.replace(")",",0.5)");
- this.drawShape("ellipse2",0,0,this.x/1.4,this.x/1.4,a,this.foreground,"closed")
- }else{
- this.drawShape("ellipse2",0,0,this.x/1.4,this.x/1.4,a,this.foreground,"closed");
- this.ctx.globalCompositeOperation="lighter"
- }
- }else{
- if(this.isIE&&!this.useFlashIE){
- a=a.replace("rgb","rgba");
- a=a.replace(")",",0.5)");
- this.drawShape("circle",b,c,this.x/2,this.x/2,a,this.foreground,"closed")
- }else{
- this.drawShape("circle",b,c,this.x/2,this.x/2,a,this.foreground,"closed");
- this.ctx.globalCompositeOperation="lighter"
- }
- }
-};
-
-this.drawVennLayout=function(){
- var g,h,b,e;
- var a=["A","B","C","D"];
- this.ctx.clearRect(0,0,this.width,this.height);
- if(this.vennGroups==4){
- this.ctx.save();
- g=this.vennMarginLeft+this.marginLeft+this.margin+(this.x/4.94);
- h=this.vennMarginTop+this.marginTop+this.top+(this.x/13);
- this.ctx.translate(g,h);
- this.ctx.rotate(Math.PI/4);
- this.drawVennBubble(0,0,this.vennColors.length>0&&this.validateColor(this.vennColors[0])?this.validateColor(this.vennColors[0]):"rgb(255,0,0)");
- g=this.x/22.4;
- h=this.x/-5.32;
- this.ctx.translate(g,h);
- this.drawVennBubble(0,0,this.vennColors.length>1&&this.validateColor(this.vennColors[1])?this.validateColor(this.vennColors[1]):"rgb(0,153,51)");
- g=this.x/1.84;
- h=this.x/-5.32;
- this.ctx.translate(g,h);
- this.ctx.rotate(Math.PI/2);
- g=this.x/-22.4;
- h=this.x/-5.32;
- this.ctx.translate(g,h);
- this.drawVennBubble(0,0,this.vennColors.length>2&&this.validateColor(this.vennColors[2])?this.validateColor(this.vennColors[2]):"rgb(0,0,255)");
- g=this.x/22.4;
- h=this.x/5.32;
- this.ctx.translate(g,h);
- this.drawVennBubble(0,0,this.vennColors.length>3&&this.validateColor(this.vennColors[3])?this.validateColor(this.vennColors[3]):"rgb(153,204,0)");
- this.ctx.restore();
- b=[11.2,3.05,1.46,1.08];
- e=[7,42,42,7]
- }else{
- if(this.vennGroups==3){
- this.ctx.save();
- g=this.vennMarginLeft+this.marginLeft+this.left+(this.x/2);
- h=this.vennMarginTop+this.marginTop+this.top+(this.x/2.86);
- this.drawVennBubble(g,h,this.vennColors.length>0&&this.validateColor(this.vennColors[0])?this.validateColor(this.vennColors[0]):"rgb(255,0,0)");
- h+=(this.x/3.33);
- g=this.vennMarginLeft+this.marginLeft+this.left+(this.x/3);
- this.drawVennBubble(g,h,this.vennColors.length>1&&this.validateColor(this.vennColors[1])?this.validateColor(this.vennColors[1]):"rgb(0,255,0)");
- g=this.vennMarginLeft+this.marginLeft+this.left+(this.x/1.5);
- this.drawVennBubble(g,h,this.vennColors.length>2&&this.validateColor(this.vennColors[2])?this.validateColor(this.vennColors[2]):"rgb(0,0,255)");
- this.ctx.restore();
- b=[2,8.66,1.13];
- e=[20,2.3,2.3]
- }else{
- if(this.vennGroups==2){
- this.ctx.save();
- g=this.vennMarginLeft+this.marginLeft+this.left+(this.x/3);
- h=this.vennMarginTop+this.marginTop+this.top+(this.x/2.67);
- this.drawVennBubble(g,h,this.vennColors.length>0&&this.validateColor(this.vennColors[0])?this.validateColor(this.vennColors[0]):"rgb(0,0,255)");
- g=this.vennMarginLeft+this.marginLeft+this.left+(this.x/1.5);
- h=this.vennMarginTop+this.marginTop+this.top+(this.x/2.67);
- this.drawVennBubble(g,h,this.vennColors.length>1&&this.validateColor(this.vennColors[1])?this.validateColor(this.vennColors[1]):"rgb(255,0,0)");
- this.ctx.restore();
- b=[3,1.5];
- e=[16,16]
- }else{
- if(this.vennGroups==1){
- g=this.vennMarginLeft+this.marginLeft+this.left+(this.x/2);
- h=this.vennMarginTop+this.marginTop+this.top+(this.x/2);
- this.drawShape("circle",g,h,this.x,this.x,this.vennColors.length>0&&this.validateColor(this.vennColors[0])?this.validateColor(this.vennColors[0]):"rgb(255,0,0)",this.foreground,"closed");
- b=[100];
- e=[100]
- }
- }
- }
-}
-if(!this.vennLegendColors){
- for(var d=0;d0&&this.validateColor(this.vennColors[0])?this.validateColor(this.vennColors[0]):"rgb(255,0,0)");
- h.push(this.vennColors.length>1&&this.validateColor(this.vennColors[1])?this.validateColor(this.vennColors[1]):"rgb(0,153,51)");
- h.push(this.vennColors.length>2&&this.validateColor(this.vennColors[2])?this.validateColor(this.vennColors[3]):"rgb(153,204,0)");
- h.push(this.vennColors.length>3&&this.validateColor(this.vennColors[3])?this.validateColor(this.vennColors[2]):"rgb(0,0,255)")
- }else{
- if(this.vennGroups==3){
- h.push(this.vennColors.length>0&&this.validateColor(this.vennColors[0])?this.validateColor(this.vennColors[0]):"rgb(255,0,0)");
- h.push(this.vennColors.length>1&&this.validateColor(this.vennColors[1])?this.validateColor(this.vennColors[1]):"rgb(0,255,0)");
- h.push(this.vennColors.length>2&&this.validateColor(this.vennColors[2])?this.validateColor(this.vennColors[2]):"rgb(0,0,255)")
- }else{
- if(this.vennGroups==2){
- h.push(this.vennColors.length>0&&this.validateColor(this.vennColors[0])?this.validateColor(this.vennColors[0]):"rgb(0,0,255)");
- h.push(this.vennColors.length>1&&this.validateColor(this.vennColors[1])?this.validateColor(this.vennColors[1]):"rgb(255,0,0)")
- }else{
- h.push(this.vennColors.length>0&&this.validateColor(this.vennColors[0])?this.validateColor(this.vennColors[0]):"rgb(255,0,0)")
- }
- }
- }
- for(var f=0;fthis.x)?this.scaleTextToFont(b,j,this.x-this.margin):this.legendFont;
- if(!this.vennLegendColors){
- this.drawText(b,c,g,e,this.legendColor,"left","middle")
- }else{
- this.drawText(b,d,g,e,h[f],"left","middle")
- }
- g+=this.margin+j
- }
-}
-};
-
-this.drawVennPlot=function(){
- this.setVennXYDimensions();
- this.drawTitle();
- this.showShadow=false;
- this.drawVennLayout();
- this.showShadow=this.tmpshowShadow;
- this.drawVennDataPoints();
- this.drawVennLegend()
- };
-
-this.initializeVennPlot=function(){
- this.transparency=null;
- this.tmpshowShadow=this.showShadow;
- this.background="rgb(255,255,255)";
- this.foreground="rgb(0,0,0)";
- this.drawVennPlot()
- };
-
-this.initializeVennPlot()
-};
-
-CanvasXpress.prototype.Correlation=function(){
- this.setCorrelationVarSmpLabelFont=function(b){
- var a=this.scaleTextToSize(b);
- a=this.correlationAxis=="samples"?a*this.smpLabelScaleFontFactor:a*this.varLabelScaleFontFactor;
- a=Math.min(a,this.maxTextSize);
- this.smpLabelFont=(a)+"Pt "+this.fontName;
- this.varLabelFont=(a)+"Pt "+this.fontName
- };
-
- this.getCorrelationLabelsHeight=function(){
- var a=0;
- if(this.correlationAxis=="samples"){
- if(this.maxSmpName>this.maxSmpStringLen){
- a+=this.measureText(this.maxSmpNameStr.substring(0,this.maxSmpStringLen),this.smpLabelFont)
- }else{
- a+=this.measureText(this.maxSmpNameStr,this.smpLabelFont)
- }
- }else{
- if(this.maxVarName>this.maxVarStringLen){
- a+=this.measureText(this.maxVarNameStr.substring(0,this.maxVarStringLen),this.varLabelFont)
- }else{
- a+=this.measureText(this.maxVarNameStr,this.varLabelFont)
- }
- }
- if(this.correlationAnchorLegend){
- a+=this.correlationAnchorLegendAlignWidth+this.margin
- }
- return a
-};
-
-this.setCorrelationXYDimensions=function(){
- this.corMarginLeft=0;
- this.corMarginTop=0;
- if(this.yAxisShow){
- this.setAxisFont(this.yAxisTitle,this.height);
- this.left=this.margin+this.getFontPt(this.axisTitleFont)+this.margin
- }
- if(this.width<=this.height){
- this.x=this.width-(this.marginLeft+this.left+this.right+this.marginRight)
- }else{
- this.x=this.height-(this.marginTop+this.top+this.bottom+this.marginBottom)
- }
- var a=this.correlationAxis=="variables"?this.varIndices.length:this.isGroupedData?this.grpIndices.length:this.smpIndices.length;
- this.diamondSize=this.x/a;
- this.setCorrelationVarSmpLabelFont(a);
- this.y=this.x/2+(this.diamondSize/2);
- if(this.xAxisShow){
- this.top+=this.margin+this.getCorrelationLabelsHeight()+this.margin
- }
- if(this.autoAdjust){
- this.height=this.marginTop+this.top+this.y+this.bottom+this.marginBottom;
- this.width=this.marginLeft+this.left+this.x+this.right+this.marginRight
- }else{
- this.corMarginTop=(this.height-(this.marginTop+this.top+this.y+this.bottom+this.marginBottom))/2;
- this.corMarginLeft=(this.width-(this.marginLeft+this.left+this.x+this.right+this.marginRight))/2
- }
- this.resizeCanvas()
- };
-
-this.drawCorrelationLayout=function(){
- if(this.yAxisShow){
- this.drawText(this.yAxisTitle,this.corMarginLeft+this.marginLeft+this.left/2,this.marginTop+this.top+(this.y/2),this.axisTitleFont,this.axisTitleColor,"center","middle",-Math.PI/2)
- }
- if(this.xAxisShow){
- var c=this.corMarginLeft+this.marginLeft+this.left+(this.diamondSize/2);
- var p=(this.corMarginTop+this.marginTop+this.top)-this.margin;
- var o=(this.corMarginTop+this.marginTop+this.top)-(this.getCorrelationLabelsHeight()+this.margin);
- var n=o+this.correlationAnchorLegendAlignWidth;
- var k,f,h;
- var a=this.isGroupedData?this.data.w:this.data.y;
- var r=this.correlationAxis=="variables"?this.varIndices:this.isGroupedData?this.grpIndices:this.smpIndices;
- var m=this.correlationAxis=="samples"?this.maxSmpStringLen:this.maxVarStringLen;
- if(this.correlationAnchorLegend){
- h=this.correlationAxis=="samples"?a.data[0]:this.getDataForSmpGrpAtIndex(0);
- r.sort(function(s,i){
- return h[s]-h[i]
- });
- this.setAxisUnits("xAxis")
- }
- if(this.correlationAxis=="samples"){
- k=a.smps;
- f=this.smpLabelFont
- }else{
- k=a.vars;
- f=this.varLabelFont
- }
- for(var g=0;g=l;f--){
- var a=q[(q.length-f)-1];
- var e=h[a][m];
- var d=this.getHeatmapColor(this.minData,this.maxData,e);
- if(isNaN(e)){
- this.addArea(this.drawShape("diamond",b,n,this.diamondSize,this.diamondSize,this.missingDataColor,this.missingDataColor,"closed"),[a,m])
- }else{
- this.addArea(this.drawShape("diamond",b,n,this.diamondSize,this.diamondSize,d,d,"closed"),[a,m])
- }
- b+=r;
- n-=r
- }
- }
- this.drawLine("line",this.corMarginLeft+this.marginLeft+this.left,this.corMarginTop+this.marginTop+this.top+r,this.corMarginLeft+this.marginLeft+this.left+(this.x/2),this.corMarginTop+this.marginTop+this.top+this.y,this.foreground,false,"butt");
-this.drawLine("line",this.corMarginLeft+this.marginLeft+this.left+this.x,this.corMarginTop+this.marginTop+this.top+r,this.corMarginLeft+this.marginLeft+this.left+(this.x/2),this.corMarginTop+this.marginTop+this.top+this.y,this.foreground,false,"butt");
-c=this.corMarginLeft+this.marginLeft+this.left+r;
-o=this.corMarginTop+this.marginTop+this.top;
-b=c+(this.x/2);
-n=(this.corMarginTop+this.marginTop+this.top+this.y)-r;
-for(var l=0;l1&&this.xAxisIndices.length==this.yAxisIndices.length&&this.xAxisIndices.length==this.zAxisIndices.length){
- this.type2D="XYZ"
- }else{
- if(this.xAxisIndices.length>1&&this.xAxisIndices.length==this.yAxisIndices.length){
- this.type2D="XY"
- }else{
- if(this.xAxisIndices.length>this.yAxisIndices.length){
- this.type2D="X"
- }else{
- this.type2D="Y"
- }
- }
- }
-}
-};
-
-this.set2DText=function(){
- var c=this.xAxisTitle.length>this.yAxisTitle.length?this.xAxisTitle:this.yAxisTitle;
- var b=this.layoutComb?Math.min(this.layoutWidth,this.layoutHeight):Math.min(this.width,this.height);
- this.setAxisFont(c,b)
- };
-
-this.setDecorationsLegendPositions=function(){
- if(this.showDecorations){
- this.setDecorationLegendDimension();
- if(this.showLegend){
- if(this.legendPosition=="bottom"){
- this.decorationsPosition="right"
- }else{
- this.decorationsPosition="bottom"
- }
- }
- }
-};
-
-this.reRangeData=function(){
- this.xAxis=[];
- for(var b=0;b=45&&this.xRotate>=45){
- this.drawText(u,j,h+5,this.axisTickFont,this.axisTickColor,"right",false,-Math.PI/2)
- }else{
- this.drawText(u,j-5,h,this.axisTickFont,this.axisTickColor,"right")
- }
- }
- m++
- }
- q+=f;
- w++
- }
- this.draw3DLayout(B,d,n,A,c,k,e,this.yAxisTickStyle)
- }
- if(this.yAxisShow){
- this.draw3DAxisTitle(-this.lenX-(f*4),-this.lenX-(f*4),r-(f*2),this.lenY+f,-this.lenZ-(f*4),-this.lenZ-(f*4),g,"y")
- }
- B=[-this.lenX,-this.lenX,-this.lenX,-this.lenX];
-d=[-this.lenY,-this.lenY,-this.lenY,this.lenY];
-n=[-this.lenZ,this.lenZ,this.lenZ,this.lenZ];
-A=[-this.lenX,-this.lenX,-this.lenX,-this.lenX];
-c=[this.lenY,-this.lenY,this.lenY,this.lenY];
-k=[-this.lenZ,-this.lenZ,this.lenZ,-this.lenZ];
-e=[this.foreground,this.foreground,this.foreground,this.foreground];
-this.draw3DLayout(B,d,n,A,c,k,e,this.yAxisTickStyle)
-};
-
-this.set3DZLayout=function(){
- var F=[],d=[],q=[],E=[],c=[],n=[],f=[];
- var C,o,v,p,b,H,A,m,k;
- var g=this.is3DPlot?this.lenZ/(this.varIndices.length*0.5):this.lenZ/15;
- var e=this.is3DPlot?this.lenZ/(this.smpIndices.length*0.5):false;
- var z=this.is3DPlot?((this.varIndices.length*0.5)*-g)+g:(15*-g)+g;
- var w=this.is3DPlot?((this.smpIndices.length*0.5)*-e)+e:false;
- var j=this.zAxisTitle?this.zAxisTitle:this.is3DPlot?"Variables":this.data.y.smps[this.zAxisIndex];
- var B=this.marginLeft+this.offsetX+this.left;
- var r=this.marginTop+this.offsetY+this.top;
- if(this.show3DGrid&&!this.is3DPlot){
- v=z;
- C=0;
- o=0;
- while(v=45){
- if(this.yRotate>=45){
- this.drawText(A,m+5,k,this.axisTickFont,this.axisTickColor,"left")
- }else{
- this.drawText(A,m,k+5,this.axisTickFont,this.axisTickColor,"right",false,-Math.PI/2)
- }
- }else{
- this.drawText(A,m+5,k,this.axisTickFont,this.axisTickColor,"left")
- }
- }
- o++
- }
- v+=g;
- C++
-}
-this.draw3DLayout(F,d,q,E,c,n,f,this.zAxisTickStyle)
-}else{
- if(this.is3DPlot){
- var h=this;
- var D=function(){
- var l=C/h.varLabelInterval;
- if(parseInt(l)==parseFloat(l)){
- b=h.get3DTransfrom(h.lenX,h.lenY,v-(g/2));
- m=b[0]+B;
- k=b[1]+r;
- A=h.data.y.vars[h.varIndices[C]];
- if(h.xRotate>=45){
- if(h.yRotate>=45){
- h.drawText(A,m+5,k,h.axisTickFont,h.axisTickColor,"left")
- }else{
- h.drawText(A,m,k+5,h.axisTickFont,h.axisTickColor,"right",false,-Math.PI/2)
- }
- }else{
- h.drawText(A,m+5,k,h.axisTickFont,h.axisTickColor,"left")
- }
- }
- };
-
-var G=function(){
- var l=C/h.smpLabelInterval;
- if(parseInt(l)==parseFloat(l)){
- b=h.get3DTransfrom((p*h.lenX/h.lenZ)-(e/4),h.lenY,-h.lenZ);
- m=b[0]+B;
- k=b[1]+r;
- A=h.data.y.smps[h.smpIndices[C]];
- h.drawText(A,m,k+5,h.axisTickFont,h.axisTickColor,"right",false,-Math.PI/2)
- }
- };
-
-v=z;
-C=0;
-o=0;
-while(v