Compare commits
401 Commits
Author | SHA1 | Date |
---|---|---|
Chakib Benziane | 4ae70a0a9b | 10 years ago |
David Souther | 6867ea693e | 10 years ago |
Joseph Dursun | 5022ce3eb4 | 10 years ago |
Robin Hu | 0c03b2794b | 11 years ago |
Tyler Wolf | 365863cbe0 | 11 years ago |
Tyler Wolf | 3a8fb19cd3 | 11 years ago |
Robin Hu | b8d6f750ab | 11 years ago |
Robin Hu | eff85fb985 | 11 years ago |
Joe Grund | 5e918172b2 | 11 years ago |
Tyler Wolf | 4e17dfeb15 | 11 years ago |
Tyler Wolf | 4fa5591542 | 11 years ago |
Robin Hu | 3d88c7a5eb | 11 years ago |
Robin Hu | 37ca61f8d1 | 11 years ago |
Robin Hu | b8b06c75a4 | 11 years ago |
David Souther | 3dd43d675b | 11 years ago |
David Souther | bebc9f5d4f | 11 years ago |
Tyler Wolf | 6752bf5cc8 | 11 years ago |
frank shao | 9a5b562138 | 11 years ago |
frank shao | 50fa59e63e | 11 years ago |
frank shao | d6d8dd0dce | 11 years ago |
frank shao | a744416600 | 11 years ago |
frank shao | d3467a8838 | 11 years ago |
Robin Hu | d51729c49b | 11 years ago |
Robin Hu | 4983f2c6df | 11 years ago |
frank shao | 168b9703c2 | 11 years ago |
frank shao | ef80d6b62c | 11 years ago |
frank shao | ccb051cf5e | 11 years ago |
frank shao | 8afe71bf76 | 11 years ago |
Tyler Wolf | 200b20aad8 | 11 years ago |
Tyler Wolf | a54db1e8bf | 11 years ago |
Robin Hu | 7a410c57ba | 11 years ago |
Robin Hu | 3681e52ed6 | 11 years ago |
Robin Hu | 0f5201e139 | 11 years ago |
Robin Hu | a53af7ac65 | 11 years ago |
Robin Hu | 81e60d6185 | 11 years ago |
Robin Hu | 92285645b9 | 11 years ago |
Robin Hu | 43c4639b84 | 11 years ago |
Robin Hu | 5fd13d9593 | 11 years ago |
Tyler Wolf | 660b0f0f3c | 11 years ago |
Tyler Wolf | 7eab35d829 | 11 years ago |
Tyler Wolf | 764767a017 | 11 years ago |
Tyler Wolf | b84975efc1 | 11 years ago |
Tyler Wolf | 2185020fe1 | 11 years ago |
David Long | 97779bae8b | 11 years ago |
David Long | ef5d9ef6c6 | 11 years ago |
David Long | 467087f730 | 11 years ago |
David Long | 1ba5bb03f2 | 11 years ago |
David Long | f268640571 | 11 years ago |
David Long | 227437dd9e | 11 years ago |
David Long | f202da6f5e | 11 years ago |
Robin Hu | 7472209eb2 | 11 years ago |
Robin Hu | 4c6c8da076 | 11 years ago |
David Long | 4846c6beb8 | 11 years ago |
Robin Hu | 5460532501 | 11 years ago |
Robin Hu | 13d5dec998 | 11 years ago |
Robin Hu | 194c4fc0a1 | 11 years ago |
Tyler Wolf | 4ffb9da3ab | 11 years ago |
Tyler Wolf | 396de28528 | 11 years ago |
Tyler Wolf | 36bd0696c5 | 11 years ago |
Robin Hu | 4baaf99dae | 11 years ago |
Robin Hu | d2751d839e | 11 years ago |
Robin Hu | 03441be565 | 11 years ago |
Robin Hu | 70be1f7d70 | 11 years ago |
Robin Hu | 2ae2f2ceb7 | 11 years ago |
Robin Hu | eabd6fa706 | 11 years ago |
Robin Hu | c8483fb8da | 11 years ago |
Tyler Wolf | 59399a6967 | 11 years ago |
Tyler Wolf | 42f3f4c61f | 11 years ago |
Tyler Wolf | 47fabca15f | 11 years ago |
Tyler Wolf | 772492e5bf | 11 years ago |
Tyler Wolf | 906272fc23 | 11 years ago |
Tyler Wolf | 5afa1e89dc | 11 years ago |
Robin Hu | 86f7081d53 | 11 years ago |
Robin Hu | f1a1b34e11 | 11 years ago |
Robin Hu | ebd429e1e2 | 11 years ago |
Marsup | 230f4527a2 | 11 years ago |
Robin Hu | 1488afcc41 | 11 years ago |
Robin Hu | 02ca4d7238 | 11 years ago |
Robin Hu | 550e060238 | 11 years ago |
Robin Hu | bc7fa9a984 | 11 years ago |
Robin Hu | 8d81c2c63d | 11 years ago |
Robin Hu | 85131c19ab | 11 years ago |
Robin Hu | 0497069de8 | 11 years ago |
Robin Hu | b87a42f884 | 11 years ago |
Robin Hu | 59e338a6f6 | 11 years ago |
Robin Hu | 5bfae9db41 | 11 years ago |
Robin Hu | ef96592694 | 11 years ago |
Robin Hu | 96840219ee | 11 years ago |
Justin Turner Arthur | 9fa0b63686 | 11 years ago |
Robin Hu | 3974ce1693 | 11 years ago |
Robin Hu | 8c43e72bbe | 11 years ago |
Robin Hu | 07899e2654 | 11 years ago |
Robin Hu | 0e116c6b56 | 11 years ago |
Robin Hu | f71c9d25ea | 11 years ago |
frank shao | 685ab6219d | 11 years ago |
Robin Hu | 3b83d8380a | 11 years ago |
Robin Hu | 9315679dc7 | 11 years ago |
Marsup | a2e78e1a72 | 11 years ago |
Robin Hu | c6c00d4a34 | 11 years ago |
Robin Hu | bf76cf8b69 | 11 years ago |
Robin Hu | 06fc5c5ae6 | 11 years ago |
Robin Hu | e2034e7aad | 11 years ago |
Robin Hu | b072322514 | 11 years ago |
Robin Hu | 9fde60f5ff | 11 years ago |
Robin Hu | 4be1306d80 | 11 years ago |
Robin Hu | 4f8dfc6002 | 11 years ago |
Robin Hu | 33aac696c8 | 11 years ago |
Robin Hu | 8319fe5796 | 11 years ago |
Robin Hu | c13606db14 | 11 years ago |
Robin Hu | 91f7a8631f | 11 years ago |
Robin Hu | 0edc568ad0 | 11 years ago |
Robin Hu | ce180645d1 | 11 years ago |
Rusty Bailey | a4ef6d3c5c | 11 years ago |
Robin Hu | 843577aff8 | 11 years ago |
Robin Hu | 804cb72738 | 11 years ago |
Robin Hu | ad1a18d761 | 11 years ago |
Robin Hu | 6244f27d0e | 11 years ago |
Robin Hu | 5e78ec57c3 | 11 years ago |
Robin Hu | 32f69f5377 | 11 years ago |
Robin Hu | f286b1b4e9 | 11 years ago |
Robin Hu | 1e8109a9d1 | 11 years ago |
Robin Hu | 46f0f215ac | 11 years ago |
Robin Hu | aaf46a48ff | 11 years ago |
Robin Hu | 3e78184006 | 11 years ago |
Robin Hu | 13e7d4c688 | 11 years ago |
Robin Hu | acef1926f0 | 11 years ago |
Robin Hu | 9a9e34bb30 | 11 years ago |
Robin Hu | 7adc37f1f8 | 11 years ago |
Robin Hu | 1a86e271c1 | 11 years ago |
Robin Hu | 42c155eb1b | 11 years ago |
Robin Hu | 3c5990d815 | 11 years ago |
Tyler Wolf | e7782c1a08 | 11 years ago |
Tyler Wolf | cfc706bfa9 | 11 years ago |
Robin Hu | caa6b56c73 | 11 years ago |
Robin Hu | f63cd1b732 | 11 years ago |
Tyler Wolf | 3bda8b90f2 | 11 years ago |
Robin Hu | 4ea8115a6a | 11 years ago |
Robin Hu | b102af9edd | 11 years ago |
Robin Hu | 8c6b6eb643 | 11 years ago |
Robin Hu | 7d5a3ac209 | 11 years ago |
Robin Hu | 6f6a472ed1 | 11 years ago |
Robin Hu | 58d60f9cb5 | 11 years ago |
Robin Hu | e2ef9489da | 11 years ago |
Robin Hu | 30d8637356 | 11 years ago |
Robin Hu | c2cc7772d1 | 11 years ago |
Robin Hu | 8b4a0b6cd9 | 11 years ago |
Robin Hu | eb117f90d9 | 11 years ago |
Robin Hu | 17a21cc0f4 | 11 years ago |
Tyler Wolf | c0db335539 | 11 years ago |
Tyler Wolf | 8099796792 | 11 years ago |
Robin Hu | 6ff087584d | 11 years ago |
Robin Hu | c2b32f2909 | 11 years ago |
Robin Hu | 7b24a9c2f6 | 11 years ago |
Robin Hu | 9f2280bee7 | 11 years ago |
Tyler Wolf | aea9036ee2 | 11 years ago |
Robin Hu | 0ead511d72 | 11 years ago |
Robin Hu | 281f6cfbce | 11 years ago |
Robin Hu | 16d0a843fc | 11 years ago |
Robin Hu | e33e102952 | 11 years ago |
Robin Hu | f78caa70fa | 11 years ago |
Robin Hu | 7133a13d85 | 11 years ago |
Robin Hu | 1522fee378 | 11 years ago |
Robin Hu | 9fbe68c8d8 | 11 years ago |
Robin Hu | 6d0b196892 | 11 years ago |
Robin Hu | 9770970f79 | 11 years ago |
Robin Hu | cdb7e3e271 | 11 years ago |
Robin Hu | efeba92bc8 | 11 years ago |
Tyler Wolf | d9cca0320f | 11 years ago |
Robin Hu | d8909d3217 | 11 years ago |
Robin Hu | 435cea2cf7 | 11 years ago |
Robin Hu | 1f3f3589c3 | 11 years ago |
Robin Hu | 9e947d4aec | 11 years ago |
Robin Hu | d57fa841ca | 11 years ago |
Robin Hu | 178700c896 | 11 years ago |
Robin Hu | f8092dbba5 | 11 years ago |
Robin Hu | 1969a038d3 | 11 years ago |
Robin Hu | 213d870d7b | 11 years ago |
Robin Hu | 4fe7606c04 | 11 years ago |
Robin Hu | acb310ceec | 11 years ago |
Robin Hu | 73a59f6a07 | 11 years ago |
Robin Hu | 6edf25b5a6 | 11 years ago |
Robin Hu | f2375705a4 | 11 years ago |
Robin Hu | 4e861eaba0 | 11 years ago |
Robin Hu | 7610c5b5f6 | 11 years ago |
Robin Hu | e083d663e3 | 11 years ago |
Rusty Bailey | fa43a8388d | 11 years ago |
Robin Hu | 59e37367aa | 11 years ago |
Robin Hu | 561fb5afe1 | 11 years ago |
Robin Hu | ff8d93fdb1 | 11 years ago |
Robin Hu | 4061294bd5 | 11 years ago |
Robin Hu | 174592207e | 11 years ago |
Robin Hu | 552758c876 | 11 years ago |
Robin Hu | f1d00a33be | 11 years ago |
Robin Hu | 0edd39bb1c | 11 years ago |
Robin Hu | b9a2d618cc | 11 years ago |
Robin Hu | 718c7c9ee4 | 11 years ago |
Robin Hu | 39bd96ada4 | 11 years ago |
Robin Hu | 3dbdde795f | 11 years ago |
Robin Hu | ce3de0d95c | 11 years ago |
Robin Hu | 9b941caeda | 11 years ago |
Rusty Bailey | e47e048410 | 11 years ago |
Robin Hu | 5179633685 | 11 years ago |
Robin Hu | 646c54bf62 | 11 years ago |
Robin Hu | 4bb3531197 | 11 years ago |
Robin Hu | 61ea02e264 | 11 years ago |
Robin Hu | 19afd68f53 | 11 years ago |
Robin Hu | 16f64b9821 | 11 years ago |
Robin Hu | d92428332c | 11 years ago |
Robin Hu | d31e83fd28 | 11 years ago |
Robin Hu | 29bf6d9831 | 11 years ago |
Robin Hu | 229cbd5121 | 11 years ago |
Robin Hu | c2f5cd6e56 | 11 years ago |
Robin Hu | d978f38436 | 11 years ago |
Robin Hu | 6dd18cdcee | 11 years ago |
Mike Rötgers | 6d99aee7b9 | 11 years ago |
Robin Hu | df6585c8ce | 11 years ago |
Robin Hu | 07c850649b | 11 years ago |
Robin Hu | c686b7a147 | 11 years ago |
Robin Hu | dc195e6e6e | 11 years ago |
Robin Hu | 3883010ca4 | 11 years ago |
Robin Hu | 5bce7a4d07 | 11 years ago |
Robin Hu | 8a5ecbe037 | 11 years ago |
Robin Hu | dd718105c8 | 11 years ago |
Robin Hu | b53101de01 | 11 years ago |
Robin Hu | 01db0e9751 | 11 years ago |
Robin Hu | 535993aa7c | 11 years ago |
Robin Hu | 2cf5b63c91 | 11 years ago |
Robin Hu | e891716b11 | 11 years ago |
Robin Hu | 5af04cb857 | 11 years ago |
Robin Hu | a552f5aa28 | 11 years ago |
Robin Hu | 5d7570bbed | 11 years ago |
Robin Hu | 8d316048ff | 11 years ago |
Robin Hu | 525f9365ce | 11 years ago |
Robin Hu | de8380e144 | 11 years ago |
Robin Hu | 2ed8169fcf | 11 years ago |
Robin Hu | 9d6f842f71 | 11 years ago |
Robin Hu | 60e2f85b84 | 11 years ago |
Robin Hu | 9c0eb46f4a | 11 years ago |
Robin Hu | c51ccd122f | 11 years ago |
Robin Hu | def5fa3cd2 | 11 years ago |
Robin Hu | 71c14ad24d | 11 years ago |
Robin Hu | 44ec8ab87a | 11 years ago |
Gregory Goltsov | 1747495cd9 | 11 years ago |
Jacob Quant | 9cac28a26a | 11 years ago |
Robin Hu | 799b06254c | 11 years ago |
Robin Hu | cbd8614d97 | 11 years ago |
Robin Hu | 7f71b66b0c | 11 years ago |
Robin Hu | 4abc8906a3 | 11 years ago |
Robin Hu | e182e081bf | 11 years ago |
frank shao | 058503a0be | 11 years ago |
frank shao | 147168ca9b | 11 years ago |
Tyler Wolf | 6b86e1d218 | 11 years ago |
Tyler Wolf | c017c9443c | 11 years ago |
Robin Hu | 579a9b1cf1 | 11 years ago |
fskreuz | 0331d2e650 | 11 years ago |
Tyler Wolf | e545d547de | 11 years ago |
Tyler Wolf | e918466d57 | 11 years ago |
Tyler Wolf | e4b46f3c81 | 11 years ago |
Simon Kelly | 0e6b742dab | 11 years ago |
Robin Hu | 3fc286a3aa | 11 years ago |
Al Tenhundfeld | 88fed7306d | 11 years ago |
Robin Hu | 738a94f634 | 11 years ago |
Robin Hu | 2725a44021 | 11 years ago |
Robin Hu | c801cf2733 | 11 years ago |
Al Tenhundfeld | 3b7217b928 | 11 years ago |
Robin Hu | 688518f7f1 | 11 years ago |
tubaxenor | b1a7d2211c | 11 years ago |
Robin Hu | 9227616db2 | 11 years ago |
Robin Hu | 5f5c298ec7 | 11 years ago |
Robin Hu | 94efcbad66 | 11 years ago |
Robin Hu | 1621b83e7a | 11 years ago |
Robin Hu | 493160f13b | 11 years ago |
Robin Hu | 3266bc369d | 11 years ago |
Robin Hu | 7f24fe8d1f | 11 years ago |
Robin Hu | 7bfc19b21f | 11 years ago |
Robin Hu | 0443d7c779 | 11 years ago |
Robin Hu | 4b21903740 | 11 years ago |
Robin Hu | d8ba26dc06 | 11 years ago |
Robin Hu | 410569110e | 11 years ago |
Robin Hu | 8608819e0d | 11 years ago |
Robin Hu | 729d57cda8 | 11 years ago |
Robin Hu | 678beb63ef | 11 years ago |
Robin Hu | e6ea912eb6 | 11 years ago |
Areski Belaid | 3cc8bec2c3 | 11 years ago |
frank shao | c0a0c8b2f0 | 11 years ago |
frank shao | 69c42a52a4 | 11 years ago |
Robin Hu | 874e068d9f | 11 years ago |
Robin Hu | 5e5ba5c34b | 11 years ago |
Robin Hu | 4c3554db5d | 11 years ago |
Robin Hu | 1a6b5dab13 | 11 years ago |
Robin Hu | 3a75b583ca | 11 years ago |
Robin Hu | 8dea03da44 | 11 years ago |
Robin Hu | 6e84a6845c | 11 years ago |
Robin Hu | e1e9144e5f | 11 years ago |
Robin Hu | 6c2f19a044 | 11 years ago |
Robin Hu | c13be39c12 | 11 years ago |
Robin Hu | 1ff26f5fab | 11 years ago |
Robin Hu | 6ab5b447d4 | 11 years ago |
Robin Hu | 75ff9267c8 | 11 years ago |
Robin Hu | 792a36262d | 11 years ago |
Robin Hu | ca769e706d | 11 years ago |
Robin Hu | 14117b32de | 11 years ago |
Robin Hu | 8b870e6b0a | 11 years ago |
Robin Hu | 4b8ad322cf | 11 years ago |
Robin Hu | 79b196cb41 | 11 years ago |
Robin Hu | 65edf27199 | 11 years ago |
Robin Hu | fa89918faf | 11 years ago |
Robin Hu | 3c6d1b65ee | 11 years ago |
Robin Hu | 81bf049daa | 11 years ago |
Robin Hu | 8479f5fce1 | 11 years ago |
Robin Hu | 817340cff5 | 11 years ago |
Robin Hu | b07d1f2a87 | 11 years ago |
Robin Hu | 5f3e6d5691 | 11 years ago |
Robin Hu | 1eb01d703d | 11 years ago |
Robin Hu | 93a26c53c9 | 11 years ago |
Robin Hu | 28d708d09d | 11 years ago |
Robin Hu | 9b3858e926 | 11 years ago |
Robin Hu | cdb9ea83ab | 11 years ago |
Robin Hu | d974556d05 | 11 years ago |
Robin Hu | 575ed7950e | 11 years ago |
Robin Hu | 02da71c944 | 11 years ago |
Robin Hu | defaf765e8 | 11 years ago |
Robin Hu | 27d80457b9 | 11 years ago |
Tyler Wolf | f84a1bfaa9 | 11 years ago |
Tyler Wolf | 45e5efa82c | 11 years ago |
Robin Hu | 0b3ef24e0b | 11 years ago |
Robin Hu | dbe826943f | 11 years ago |
Robin Hu | c079f3e122 | 11 years ago |
Robin Hu | 4038a56c7a | 11 years ago |
Robin Hu | 4cbd253c67 | 11 years ago |
Robin Hu | dc66846d46 | 11 years ago |
Robin Hu | 79fb28f088 | 11 years ago |
Robin Hu | c02705fc18 | 11 years ago |
Robin Hu | 9122285ae5 | 11 years ago |
Luiz Laydner | 1ca88b7956 | 11 years ago |
Tyler Wolf | c1db474991 | 11 years ago |
Tyler Wolf | 705f7efb29 | 11 years ago |
Tyler Wolf | 9d13fb73a4 | 11 years ago |
Robin Hu | d10350455e | 11 years ago |
Robin Hu | 24b949d931 | 11 years ago |
Robin Hu | 683eb18ce1 | 11 years ago |
Robin Hu | c57626ad9b | 11 years ago |
Simon Kelly | 3b8c364ff4 | 11 years ago |
Tyler Wolf | abeac917da | 11 years ago |
Tyler Wolf | 086e0e5d9e | 11 years ago |
Tyler Wolf | a1e6ad4d8b | 11 years ago |
Tyler Wolf | deed5470f3 | 11 years ago |
Tyler Wolf | 713df676f7 | 11 years ago |
Tyler Wolf | 364f689fb3 | 11 years ago |
Robin Hu | 104921eb68 | 11 years ago |
Robin Hu | 6b63db67d0 | 11 years ago |
Tyler Wolf | 47767c44c8 | 11 years ago |
Tyler Wolf | e2dd47bcc2 | 11 years ago |
Robin Hu | 0151cdccab | 11 years ago |
Robin Hu | 739b93fecf | 11 years ago |
Robin Hu | 319520513f | 11 years ago |
Robin Hu | 62edb49ab8 | 11 years ago |
Robin Hu | 7bf1091f41 | 11 years ago |
Robin Hu | 1703cc428a | 11 years ago |
Robin Hu | 65b97714fa | 11 years ago |
Robin Hu | a9b6f3ab09 | 11 years ago |
Bob Monteverde | 065c8eb84d | 11 years ago |
Tyler Wolf | bb5146775e | 11 years ago |
Dingo | b0bc28cbe0 | 11 years ago |
Tyler Wolf | af8b13dd48 | 11 years ago |
frank shao | 90e4078941 | 11 years ago |
Tyler Wolf | a437d1ef0e | 11 years ago |
Robin Hu | 577a57d405 | 11 years ago |
Robin Hu | 8731046948 | 11 years ago |
Tyler Wolf | bd0aab25ca | 11 years ago |
Tyler Wolf | 1ac80d87c8 | 11 years ago |
Tyler Wolf | a6c18a730a | 11 years ago |
Robin Hu | 1097586ec3 | 11 years ago |
Robin Hu | 3e48d32290 | 11 years ago |
Tyler Wolf | fb5897eb52 | 11 years ago |
Tyler Wolf | a67a42333e | 11 years ago |
Tyler Wolf | da6427cd0f | 11 years ago |
Tyler Wolf | 0e219e5a1b | 11 years ago |
Tyler Wolf | 05663aee36 | 11 years ago |
Tyler Wolf | 5d0c538957 | 11 years ago |
twolfnovus | a65b5c4988 | 11 years ago |
twolfnovus | 8b4d0250c9 | 11 years ago |
twolfnovus | f108de0bd1 | 11 years ago |
Robin Hu | 0c422148d9 | 11 years ago |
twolfnovus | f00781535b | 11 years ago |
twolfnovus | a10c25b333 | 11 years ago |
twolfnovus | 0d5f297d61 | 11 years ago |
twolfnovus | d3c44f7f00 | 11 years ago |
twolfnovus | 16ba25c7f1 | 11 years ago |
frank shao | ba59c9e019 | 11 years ago |
twolfnovus | 034d7f8b50 | 11 years ago |
Anders Johnson | 08b23cf37d | 11 years ago |
Michael J. Cohen | 5650e9cde9 | 11 years ago |
lihongxun | 2a394feab3 | 11 years ago |
Tyler Wolf | 6a6e0d7329 | 11 years ago |
Dingo | 76b97fde13 | 11 years ago |
Dingo | dd94b599fe | 11 years ago |
Dingo | ad288b96f4 | 11 years ago |
Dingo | f41a4db9b9 | 11 years ago |
Dingo | 0593a97d44 | 11 years ago |
Fredrik Wollsén | cdc8e73b1b | 11 years ago |
@ -0,0 +1,106 @@
|
||||
module.exports = function(grunt) {
|
||||
|
||||
//Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
concat: {
|
||||
options: {
|
||||
separator: ''
|
||||
},
|
||||
dist: {
|
||||
src: [
|
||||
'src/intro.js',
|
||||
'src/core.js',
|
||||
'src/interactiveLayer.js',
|
||||
'src/tooltip.js',
|
||||
'src/utils.js',
|
||||
'src/models/axis.js',
|
||||
'src/models/historicalBar.js',
|
||||
'src/models/bullet.js',
|
||||
'src/models/bulletChart.js',
|
||||
'src/models/cumulativeLineChart.js',
|
||||
'src/models/discreteBar.js',
|
||||
'src/models/discreteBarChart.js',
|
||||
'src/models/distribution.js',
|
||||
'src/models/historicalBar.js',
|
||||
'src/models/historicalBarChart.js',
|
||||
'src/models/indentedTree.js',
|
||||
'src/models/legend.js',
|
||||
'src/models/line.js',
|
||||
'src/models/lineChart.js',
|
||||
'src/models/linePlusBarChart.js',
|
||||
'src/models/lineWithFocusChart.js',
|
||||
'src/models/linePlusBarWithFocusChart.js',
|
||||
'src/models/multiBar.js',
|
||||
'src/models/multiBarChart.js',
|
||||
'src/models/multiBarHorizontal.js',
|
||||
'src/models/multiBarHorizontalChart.js',
|
||||
'src/models/multiChart.js',
|
||||
'src/models/ohlcBar.js',
|
||||
'src/models/pie.js',
|
||||
'src/models/pieChart.js',
|
||||
'src/models/scatter.js',
|
||||
'src/models/scatterChart.js',
|
||||
'src/models/scatterPlusLineChart.js',
|
||||
'src/models/sparkline.js',
|
||||
'src/models/sparklinePlus.js',
|
||||
'src/models/stackedArea.js',
|
||||
'src/models/stackedAreaChart.js',
|
||||
'src/outro.js'
|
||||
],
|
||||
dest: 'nv.d3.js'
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
options: {
|
||||
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
|
||||
'<%= grunt.template.today("yyyy-mm-dd") %> */'
|
||||
},
|
||||
js: {
|
||||
files: {
|
||||
'nv.d3.min.js': ['nv.d3.js']
|
||||
}
|
||||
}
|
||||
},
|
||||
jshint: {
|
||||
foo: {
|
||||
src: "src/**/*.js"
|
||||
},
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
js: {
|
||||
files: ["src/**/*.js"],
|
||||
tasks: ['concat']
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
css: {
|
||||
files: [
|
||||
{ src: 'src/nv.d3.css', dest: 'nv.d3.css' }
|
||||
]
|
||||
}
|
||||
},
|
||||
cssmin: {
|
||||
dist: {
|
||||
files: {
|
||||
'nv.d3.min.css' : ['nv.d3.css']
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
||||
|
||||
grunt.registerTask('default', ['concat', 'copy']);
|
||||
grunt.registerTask('production', ['concat', 'uglify', 'copy', 'cssmin']);
|
||||
grunt.registerTask('release', ['production']);
|
||||
grunt.registerTask('lint', ['jshint']);
|
||||
};
|
@ -1,53 +1,87 @@
|
||||
Please see Novus' official statement on nvd3 with an explanation,
|
||||
apology, and commitment to its permanent status as an open-source
|
||||
project.
|
||||
[http://nvd3.org/statement.html](http://nvd3.org/statement.html)
|
||||
# NVD3 - v1.1.15-beta
|
||||
## Release notes for version 1.1.15 beta
|
||||
* Various fixes across the board
|
||||
|
||||
# nvd3 - v0.0.1
|
||||
## Overview
|
||||
A reusable chart library for d3.js.
|
||||
|
||||
A reusable chart library for d3.JS.
|
||||
NVD3 may change from its current state, but will always try to follow the style of d3.js.
|
||||
|
||||
Currently in an early stage of development, but will be a very active project. It may change quite a bit from its current state, but will always try to follow the style in which d3.js was done.
|
||||
You can also check out the [examples page](http://nvd3.org/ghpages/examples.html).
|
||||
**Note:** The examples on nvd3.org are outdated. For examples on how to use the latest NVD3, please checkout the **examples/** directory in the repository.
|
||||
|
||||
You can also check out the [examples page](http://nvd3.org/ghpages/examples.html)
|
||||
---
|
||||
|
||||
# Current development focus
|
||||
|
||||
- Getting documentation up.
|
||||
- Unifying common API functions between charts.
|
||||
- Bug fixes that come up.
|
||||
|
||||
---
|
||||
|
||||
# Current Improvement focus
|
||||
# Installation Instructions
|
||||
|
||||
Upgrade to d3.v3 in progress!
|
||||
`d3.v3.js` is a dependency of `nv.d3.js`. Be sure to include in in your project, then:
|
||||
Add a script tag to include `nv.d3.js` OR `nv.d3.min.js` in your project.
|
||||
Also add a link to the `nv.d3.css` file.
|
||||
|
||||
See wiki -> Documentation for more detail
|
||||
|
||||
---
|
||||
|
||||
If one of [the existing models](https://github.com/novus/nvd3/tree/master/src/models) doesn't meet your needs, fork the project, implement the model and an example using it, send us a pull request, for consideration for inclusion in the project.
|
||||
|
||||
Please do not aggregate pull requests. Aggregated pull requests are actually more difficult to review!
|
||||
We cannot honor all pull requests, but we will review all of them.
|
||||
|
||||
Please do not aggregate pull requests. Aggregated pull requests are actually more difficult to review.
|
||||
|
||||
We are currently changing our branch structure so that master will be gauranteed stable. In addition, there is now a "development" branch. This branch reflects the latest changes to nvd3 and is not necessarily stable.
|
||||
We are currently changing our branch structure so that master will be gauranteed stable. In addition, there is now a "development" branch. This branch reflects the latest changes to NVD3 and is not necessarily stable.
|
||||
|
||||
---
|
||||
|
||||
Minifying your fork:
|
||||
## Minifying your fork:
|
||||
|
||||
The Makefile requires [UglifyJS](https://github.com/mishoo/UglifyJS).
|
||||
### Using Make
|
||||
The Makefile requires [UglifyJS](https://github.com/mishoo/UglifyJS) and [CSSMin](https://github.com/jbleuzen/node-cssmin)
|
||||
|
||||
The easiest way to install is to install via npm. Run `npm install
|
||||
uglify-js` from your home directory, then add the output from `npm bin`
|
||||
into your path so that you have access to `uglifyjs` from the command
|
||||
line (remember to restart your terminal window when adding to the path.)
|
||||
The easiest way to install UglifyJS and CSSMin is via npm. Run `npm install -g uglify-js cssmin`. After installing verify the setup by running `uglifyjs --version` and `cssmin --help`.
|
||||
|
||||
Once you have `uglifyjs` command available, running `make` from your
|
||||
Once you have the `uglifyjs` and `cssmin` commands available, running `make` from your
|
||||
fork's root directory will rebuild both `nv.d3.js` and `nv.d3.min.js`.
|
||||
|
||||
Without UglifyJS, you won't get the minified version when running make.
|
||||
make # build nv.d3.js and nv.d3.css and minify
|
||||
make nv.d3.js # Build nv.d3.js
|
||||
make nv.d3.min.js # Minify nv.d3.js into nv.d3.min.js
|
||||
make nv.d3.css # Build nv.d3.css
|
||||
make nv.d3.min.css # Minify nv.d3.css into nv.d3.min.css
|
||||
make clean # Delete nv.d3.*js and nv.d3.*css
|
||||
|
||||
|
||||
*Without UglifyJS or CSSMin, you won't get the minified versions when running make.**
|
||||
|
||||
### Using Grunt
|
||||
|
||||
You can use grunt instead of makefile to build js file. See more about [grunt](http://gruntjs.com/).
|
||||
***[Nodejs](http://nodejs.org/) must be installed before you can use grunt.***
|
||||
Run `npm install` in root dir to install grunt and it's dependencies.
|
||||
|
||||
Then, you can use these commands:
|
||||
|
||||
grunt # build nv.d3.js
|
||||
grunt production # build nv.d3.js and nv.d3.min.js
|
||||
grunt watch # watch file changes in src/, and rebuild nv.d3.js, it's very helpful when delevop NVD3
|
||||
grunt lint # run jshint on src/**/*.js
|
||||
|
||||
**We ask that you DO NOT minify pull requests...
|
||||
**We ask that you DO NOT minify pull requests...
|
||||
If you need to minify please build pull request in separate branch, and
|
||||
merge and minify in your master.
|
||||
|
||||
## (Officially) Supported Browsers
|
||||
## Supported Browsers
|
||||
NVD3 runs best on WebKit based browsers.
|
||||
|
||||
* Chrome latest version (preferred)
|
||||
* Firefox latest version
|
||||
* Safari latest version
|
||||
* Internet Explorer 9 and 10
|
||||
* **Google Chrome: latest version (preferred)**
|
||||
* **Opera 15+ (preferred)**
|
||||
* Safari: latest version
|
||||
* Firefox: latest version
|
||||
* Internet Explorer: 9 and 10
|
||||
|
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "nvd3",
|
||||
"version": "1.1.15-beta",
|
||||
"homepage": "http://www.nvd3.org",
|
||||
"authors": [
|
||||
"Bob Monteverde",
|
||||
"Tyler Wolf",
|
||||
"Robin Hu",
|
||||
"Frank Shao"
|
||||
],
|
||||
"description": "Re-usable charts and chart components for d3.",
|
||||
"main": ["nv.d3.js", "src/nv.d3.css"],
|
||||
"keywords": [
|
||||
"d3",
|
||||
"visualization",
|
||||
"svg",
|
||||
"charts"
|
||||
],
|
||||
"license": "Apache License, v2.0",
|
||||
"dependencies": {
|
||||
"d3": "~3.3.13"
|
||||
},
|
||||
"ignore" : [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests",
|
||||
"src/models/*",
|
||||
"src/*.js",
|
||||
"lib",
|
||||
"examples",
|
||||
"deprecated"
|
||||
]
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
|
||||
<style>
|
||||
|
||||
body {
|
||||
overflow-y:scroll;
|
||||
}
|
||||
|
||||
text {
|
||||
font: 12px sans-serif;
|
||||
}
|
||||
|
||||
</style>
|
||||
<body class='with-3d-shadow with-transitions'>
|
||||
|
||||
<div style="width: 100%; height: 400px;">
|
||||
<svg id="test1"></svg>
|
||||
</div>
|
||||
<script src="../lib/d3.v3.js"></script>
|
||||
<script src="../nv.d3.js"></script>
|
||||
<script src="../src/models/axis.js"></script>
|
||||
<script src="../src/models/historicalBar.js"></script>
|
||||
<script src="../src/models/historicalBarChart.js"></script>
|
||||
<script src="../src/utils.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
var chart;
|
||||
nv.addGraph(function() {
|
||||
chart = nv.models.historicalBarChart();
|
||||
chart
|
||||
.margin({left: 100, bottom: 100})
|
||||
.x(function(d,i) { return i })
|
||||
.transitionDuration(250)
|
||||
;
|
||||
|
||||
// chart sub-models (ie. xAxis, yAxis, etc) when accessed directly, return themselves, not the parent chart, so need to chain separately
|
||||
chart.xAxis
|
||||
.axisLabel("Time (s)")
|
||||
.tickFormat(d3.format(',.1f'));
|
||||
|
||||
chart.yAxis
|
||||
.axisLabel('Voltage (v)')
|
||||
.tickFormat(d3.format(',.2f'));
|
||||
|
||||
chart.showXAxis(true);
|
||||
|
||||
d3.select('#test1')
|
||||
.datum(sinData())
|
||||
.transition().duration(0)
|
||||
.call(chart);
|
||||
|
||||
//TODO: Figure out a good way to do this automatically
|
||||
nv.utils.windowResize(chart.update);
|
||||
//nv.utils.windowResize(function() { d3.select('#chart1 svg').call(chart) });
|
||||
|
||||
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
|
||||
//Simple test data generators
|
||||
|
||||
function sinAndCos() {
|
||||
var sin = [],
|
||||
cos = [];
|
||||
|
||||
for (var i = 0; i < 100; i++) {
|
||||
sin.push({x: i, y: Math.sin(i/10)});
|
||||
cos.push({x: i, y: .5 * Math.cos(i/10)});
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
values: sin,
|
||||
key: "Sine Wave",
|
||||
color: "#ff7f0e"
|
||||
},
|
||||
{
|
||||
values: cos,
|
||||
key: "Cosine Wave",
|
||||
color: "#2ca02c"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
function sinData() {
|
||||
var sin = [];
|
||||
|
||||
for (var i = 0; i < 100; i++) {
|
||||
sin.push({x: i, y: Math.sin(i/10)});
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
values: sin,
|
||||
key: "Sine Wave",
|
||||
color: "#ff7f0e"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
</script>
|
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
@ -0,0 +1,98 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html>
|
||||
<title>NVD3 Examples List</title>
|
||||
<body>
|
||||
<style>
|
||||
body {
|
||||
font-family: Helvetica;
|
||||
/* IE10 Consumer Preview */
|
||||
background-image: -ms-radial-gradient(left top, circle farthest-corner, #FFFFFF 0%, #DEE2FF 100%);
|
||||
|
||||
/* Mozilla Firefox */
|
||||
background-image: -moz-radial-gradient(left top, circle farthest-corner, #FFFFFF 0%, #DEE2FF 100%);
|
||||
|
||||
/* Opera */
|
||||
background-image: -o-radial-gradient(left top, circle farthest-corner, #FFFFFF 0%, #DEE2FF 100%);
|
||||
|
||||
/* Webkit (Safari/Chrome 10) */
|
||||
background-image: -webkit-gradient(radial, left top, 0, left top, 1012, color-stop(0, #FFFFFF), color-stop(1, #DEE2FF));
|
||||
|
||||
/* Webkit (Chrome 11+) */
|
||||
background-image: -webkit-radial-gradient(left top, circle farthest-corner, #FFFFFF 0%, #DEE2FF 100%);
|
||||
|
||||
/* W3C Markup, IE10 Release Preview */
|
||||
background-image: radial-gradient(circle farthest-corner at left top, #FFFFFF 0%, #DEE2FF 100%);
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
float: left;
|
||||
margin-right: 20px;
|
||||
border-right: solid 1px #ccc;
|
||||
}
|
||||
|
||||
li {
|
||||
padding: 8px;
|
||||
min-width: 220px;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
display:block;
|
||||
}
|
||||
|
||||
li:hover {
|
||||
background-color: #ccc;
|
||||
}
|
||||
</style>
|
||||
<h2>NVD3 Examples List</h2>
|
||||
<ul>
|
||||
<li><a href="bullet.html">Bullet</a>
|
||||
<li><a href="bulletChart.html">BulletChart</a>
|
||||
<li><a href="crossfilter.html">Crossfilter</a>
|
||||
<li><a href="crossfilterWithDimentions.html">CrossfilterWithDimentions</a>
|
||||
<li><a href="crossfilterWithTables.html">CrossfilterWithTables</a>
|
||||
<li><a href="cumulativeLineChart.html">CumulativeLineChart</a>
|
||||
<li><a href="discreteBarChart.html">DiscreteBarChart</a>
|
||||
<li><a href="historicalBar.html">HistoricalBar</a>
|
||||
<li><a href="historicalBarChart.html">HistoricalBarChart</a>
|
||||
<li><a href="horizon.html">Horizon</a>
|
||||
<li><a href="indentedtree.html">Indentedtree</a>
|
||||
<li><a href="legend.html">Legend</a>
|
||||
<li><a href="line.html">Line</a>
|
||||
<li><a href="lineChart.html">LineChart</a>
|
||||
<li><a href="lineChartSVGResize.html">LineChartSVGResize</a>
|
||||
<li><a href="linePlusBarChart.html">LinePlusBarChart</a>
|
||||
<li><a href="linePlusBarWithFocusChart.html">LinePlusBarWithFocusChart</a>
|
||||
<li><a href="lineWithFisheyeChart.html">LineWithFisheyeChart</a>
|
||||
<li><a href="lineWithFocusChart.html">LineWithFocusChart</a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="multiBar.html">MultiBar</a>
|
||||
<li><a href="multiBarChart.html">MultiBarChart</a>
|
||||
<li><a href="multiBarHorizontalChart.html">MultiBarHorizontalChart</a>
|
||||
<li><a href="multiChart.html">MultiChart</a>
|
||||
<li><a href="parallelCoordinates.html">ParallelCoordinates</a>
|
||||
<li><a href="pie.html">Pie</a>
|
||||
<li><a href="pieChart.html">PieChart</a>
|
||||
<li><a href="scatter.html">Scatter</a>
|
||||
<li><a href="scatterChart.html">ScatterChart</a>
|
||||
<li><a href="scatterPlusLineChart.html">ScatterPlusLineChart</a>
|
||||
<li><a href="sparkline.html">Sparkline</a>
|
||||
<li><a href="sparklinePlus.html">SparklinePlus</a>
|
||||
<li><a href="stackedArea.html">StackedArea</a>
|
||||
<li><a href="stackedAreaChart.html">StackedAreaChart</a>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<strong>Test pages</strong>
|
||||
<li><a href="../test/lineChartTest.html">Line Chart</a></li>
|
||||
<li><a href="../test/pieChartTest.html">Pie Chart</a></li>
|
||||
<li><a href="../test/ScatterChartTest.html">Scatter Chart</a></li>
|
||||
<li><a href="../test/stackedAreaChartTest.html">Stacked Area Chart</a></li>
|
||||
<li><a href="../test/multiBarChartTest.html">Multibar Chart</a></li>
|
||||
<li><a href="../test/polylinearTest.html">Polylinear Scale Line Chart</a></li>
|
||||
<li><a href="../test/realTimeChartTest.html">Real Time Chart</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,302 @@
|
||||
// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).
|
||||
var colorbrewer = {YlGn: {
|
||||
3: ["#f7fcb9","#addd8e","#31a354"],
|
||||
4: ["#ffffcc","#c2e699","#78c679","#238443"],
|
||||
5: ["#ffffcc","#c2e699","#78c679","#31a354","#006837"],
|
||||
6: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],
|
||||
7: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
|
||||
8: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
|
||||
9: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]
|
||||
},YlGnBu: {
|
||||
3: ["#edf8b1","#7fcdbb","#2c7fb8"],
|
||||
4: ["#ffffcc","#a1dab4","#41b6c4","#225ea8"],
|
||||
5: ["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],
|
||||
6: ["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],
|
||||
7: ["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],
|
||||
8: ["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],
|
||||
9: ["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]
|
||||
},GnBu: {
|
||||
3: ["#e0f3db","#a8ddb5","#43a2ca"],
|
||||
4: ["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],
|
||||
5: ["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],
|
||||
6: ["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],
|
||||
7: ["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],
|
||||
8: ["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],
|
||||
9: ["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]
|
||||
},BuGn: {
|
||||
3: ["#e5f5f9","#99d8c9","#2ca25f"],
|
||||
4: ["#edf8fb","#b2e2e2","#66c2a4","#238b45"],
|
||||
5: ["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],
|
||||
6: ["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],
|
||||
7: ["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],
|
||||
8: ["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],
|
||||
9: ["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]
|
||||
},PuBuGn: {
|
||||
3: ["#ece2f0","#a6bddb","#1c9099"],
|
||||
4: ["#f6eff7","#bdc9e1","#67a9cf","#02818a"],
|
||||
5: ["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],
|
||||
6: ["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],
|
||||
7: ["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],
|
||||
8: ["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],
|
||||
9: ["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]
|
||||
},PuBu: {
|
||||
3: ["#ece7f2","#a6bddb","#2b8cbe"],
|
||||
4: ["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],
|
||||
5: ["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],
|
||||
6: ["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],
|
||||
7: ["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],
|
||||
8: ["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],
|
||||
9: ["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]
|
||||
},BuPu: {
|
||||
3: ["#e0ecf4","#9ebcda","#8856a7"],
|
||||
4: ["#edf8fb","#b3cde3","#8c96c6","#88419d"],
|
||||
5: ["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],
|
||||
6: ["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],
|
||||
7: ["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],
|
||||
8: ["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],
|
||||
9: ["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]
|
||||
},RdPu: {
|
||||
3: ["#fde0dd","#fa9fb5","#c51b8a"],
|
||||
4: ["#feebe2","#fbb4b9","#f768a1","#ae017e"],
|
||||
5: ["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],
|
||||
6: ["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],
|
||||
7: ["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],
|
||||
8: ["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],
|
||||
9: ["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]
|
||||
},PuRd: {
|
||||
3: ["#e7e1ef","#c994c7","#dd1c77"],
|
||||
4: ["#f1eef6","#d7b5d8","#df65b0","#ce1256"],
|
||||
5: ["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],
|
||||
6: ["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],
|
||||
7: ["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],
|
||||
8: ["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],
|
||||
9: ["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]
|
||||
},OrRd: {
|
||||
3: ["#fee8c8","#fdbb84","#e34a33"],
|
||||
4: ["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],
|
||||
5: ["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],
|
||||
6: ["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],
|
||||
7: ["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],
|
||||
8: ["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],
|
||||
9: ["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]
|
||||
},YlOrRd: {
|
||||
3: ["#ffeda0","#feb24c","#f03b20"],
|
||||
4: ["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],
|
||||
5: ["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],
|
||||
6: ["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],
|
||||
7: ["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],
|
||||
8: ["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],
|
||||
9: ["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]
|
||||
},YlOrBr: {
|
||||
3: ["#fff7bc","#fec44f","#d95f0e"],
|
||||
4: ["#ffffd4","#fed98e","#fe9929","#cc4c02"],
|
||||
5: ["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],
|
||||
6: ["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],
|
||||
7: ["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],
|
||||
8: ["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],
|
||||
9: ["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]
|
||||
},Purples: {
|
||||
3: ["#efedf5","#bcbddc","#756bb1"],
|
||||
4: ["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],
|
||||
5: ["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],
|
||||
6: ["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],
|
||||
7: ["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],
|
||||
8: ["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],
|
||||
9: ["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]
|
||||
},Blues: {
|
||||
3: ["#deebf7","#9ecae1","#3182bd"],
|
||||
4: ["#eff3ff","#bdd7e7","#6baed6","#2171b5"],
|
||||
5: ["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],
|
||||
6: ["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],
|
||||
7: ["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],
|
||||
8: ["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],
|
||||
9: ["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]
|
||||
},Greens: {
|
||||
3: ["#e5f5e0","#a1d99b","#31a354"],
|
||||
4: ["#edf8e9","#bae4b3","#74c476","#238b45"],
|
||||
5: ["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],
|
||||
6: ["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],
|
||||
7: ["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],
|
||||
8: ["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],
|
||||
9: ["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]
|
||||
},Oranges: {
|
||||
3: ["#fee6ce","#fdae6b","#e6550d"],
|
||||
4: ["#feedde","#fdbe85","#fd8d3c","#d94701"],
|
||||
5: ["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],
|
||||
6: ["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],
|
||||
7: ["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],
|
||||
8: ["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],
|
||||
9: ["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]
|
||||
},Reds: {
|
||||
3: ["#fee0d2","#fc9272","#de2d26"],
|
||||
4: ["#fee5d9","#fcae91","#fb6a4a","#cb181d"],
|
||||
5: ["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],
|
||||
6: ["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],
|
||||
7: ["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],
|
||||
8: ["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],
|
||||
9: ["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]
|
||||
},Greys: {
|
||||
3: ["#f0f0f0","#bdbdbd","#636363"],
|
||||
4: ["#f7f7f7","#cccccc","#969696","#525252"],
|
||||
5: ["#f7f7f7","#cccccc","#969696","#636363","#252525"],
|
||||
6: ["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],
|
||||
7: ["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],
|
||||
8: ["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],
|
||||
9: ["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]
|
||||
},PuOr: {
|
||||
3: ["#f1a340","#f7f7f7","#998ec3"],
|
||||
4: ["#e66101","#fdb863","#b2abd2","#5e3c99"],
|
||||
5: ["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],
|
||||
6: ["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],
|
||||
7: ["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],
|
||||
8: ["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],
|
||||
9: ["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],
|
||||
10: ["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],
|
||||
11: ["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]
|
||||
},BrBG: {
|
||||
3: ["#d8b365","#f5f5f5","#5ab4ac"],
|
||||
4: ["#a6611a","#dfc27d","#80cdc1","#018571"],
|
||||
5: ["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],
|
||||
6: ["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],
|
||||
7: ["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],
|
||||
8: ["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],
|
||||
9: ["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],
|
||||
10: ["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],
|
||||
11: ["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]
|
||||
},PRGn: {
|
||||
3: ["#af8dc3","#f7f7f7","#7fbf7b"],
|
||||
4: ["#7b3294","#c2a5cf","#a6dba0","#008837"],
|
||||
5: ["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],
|
||||
6: ["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],
|
||||
7: ["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],
|
||||
8: ["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],
|
||||
9: ["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],
|
||||
10: ["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],
|
||||
11: ["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]
|
||||
},PiYG: {
|
||||
3: ["#e9a3c9","#f7f7f7","#a1d76a"],
|
||||
4: ["#d01c8b","#f1b6da","#b8e186","#4dac26"],
|
||||
5: ["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],
|
||||
6: ["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],
|
||||
7: ["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],
|
||||
8: ["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],
|
||||
9: ["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],
|
||||
10: ["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],
|
||||
11: ["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]
|
||||
},RdBu: {
|
||||
3: ["#ef8a62","#f7f7f7","#67a9cf"],
|
||||
4: ["#ca0020","#f4a582","#92c5de","#0571b0"],
|
||||
5: ["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],
|
||||
6: ["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],
|
||||
7: ["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],
|
||||
8: ["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],
|
||||
9: ["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],
|
||||
10: ["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],
|
||||
11: ["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]
|
||||
},RdGy: {
|
||||
3: ["#ef8a62","#ffffff","#999999"],
|
||||
4: ["#ca0020","#f4a582","#bababa","#404040"],
|
||||
5: ["#ca0020","#f4a582","#ffffff","#bababa","#404040"],
|
||||
6: ["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],
|
||||
7: ["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],
|
||||
8: ["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],
|
||||
9: ["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],
|
||||
10: ["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],
|
||||
11: ["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]
|
||||
},RdYlBu: {
|
||||
3: ["#fc8d59","#ffffbf","#91bfdb"],
|
||||
4: ["#d7191c","#fdae61","#abd9e9","#2c7bb6"],
|
||||
5: ["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],
|
||||
6: ["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],
|
||||
7: ["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],
|
||||
8: ["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],
|
||||
9: ["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],
|
||||
10: ["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],
|
||||
11: ["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]
|
||||
},Spectral: {
|
||||
3: ["#fc8d59","#ffffbf","#99d594"],
|
||||
4: ["#d7191c","#fdae61","#abdda4","#2b83ba"],
|
||||
5: ["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],
|
||||
6: ["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],
|
||||
7: ["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],
|
||||
8: ["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],
|
||||
9: ["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],
|
||||
10: ["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],
|
||||
11: ["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]
|
||||
},RdYlGn: {
|
||||
3: ["#fc8d59","#ffffbf","#91cf60"],
|
||||
4: ["#d7191c","#fdae61","#a6d96a","#1a9641"],
|
||||
5: ["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],
|
||||
6: ["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],
|
||||
7: ["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],
|
||||
8: ["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],
|
||||
9: ["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],
|
||||
10: ["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],
|
||||
11: ["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]
|
||||
},Accent: {
|
||||
3: ["#7fc97f","#beaed4","#fdc086"],
|
||||
4: ["#7fc97f","#beaed4","#fdc086","#ffff99"],
|
||||
5: ["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],
|
||||
6: ["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],
|
||||
7: ["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],
|
||||
8: ["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]
|
||||
},Dark2: {
|
||||
3: ["#1b9e77","#d95f02","#7570b3"],
|
||||
4: ["#1b9e77","#d95f02","#7570b3","#e7298a"],
|
||||
5: ["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],
|
||||
6: ["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],
|
||||
7: ["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],
|
||||
8: ["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]
|
||||
},Paired: {
|
||||
3: ["#a6cee3","#1f78b4","#b2df8a"],
|
||||
4: ["#a6cee3","#1f78b4","#b2df8a","#33a02c"],
|
||||
5: ["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],
|
||||
6: ["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],
|
||||
7: ["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],
|
||||
8: ["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],
|
||||
9: ["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],
|
||||
10: ["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],
|
||||
11: ["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],
|
||||
12: ["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]
|
||||
},Pastel1: {
|
||||
3: ["#fbb4ae","#b3cde3","#ccebc5"],
|
||||
4: ["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],
|
||||
5: ["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],
|
||||
6: ["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],
|
||||
7: ["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],
|
||||
8: ["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],
|
||||
9: ["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]
|
||||
},Pastel2: {
|
||||
3: ["#b3e2cd","#fdcdac","#cbd5e8"],
|
||||
4: ["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],
|
||||
5: ["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],
|
||||
6: ["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],
|
||||
7: ["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],
|
||||
8: ["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]
|
||||
},Set1: {
|
||||
3: ["#e41a1c","#377eb8","#4daf4a"],
|
||||
4: ["#e41a1c","#377eb8","#4daf4a","#984ea3"],
|
||||
5: ["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],
|
||||
6: ["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],
|
||||
7: ["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],
|
||||
8: ["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],
|
||||
9: ["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]
|
||||
},Set2: {
|
||||
3: ["#66c2a5","#fc8d62","#8da0cb"],
|
||||
4: ["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],
|
||||
5: ["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],
|
||||
6: ["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],
|
||||
7: ["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],
|
||||
8: ["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]
|
||||
},Set3: {
|
||||
3: ["#8dd3c7","#ffffb3","#bebada"],
|
||||
4: ["#8dd3c7","#ffffb3","#bebada","#fb8072"],
|
||||
5: ["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],
|
||||
6: ["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],
|
||||
7: ["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],
|
||||
8: ["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],
|
||||
9: ["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],
|
||||
10: ["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],
|
||||
11: ["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],
|
||||
12: ["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]
|
||||
}};
|
@ -0,0 +1,769 @@
|
||||
|
||||
/********************
|
||||
* HTML CSS
|
||||
*/
|
||||
|
||||
|
||||
.chartWrap {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/********************
|
||||
Box shadow and border radius styling
|
||||
*/
|
||||
.nvtooltip.with-3d-shadow, .with-3d-shadow .nvtooltip {
|
||||
-moz-box-shadow: 0 5px 10px rgba(0,0,0,.2);
|
||||
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
|
||||
box-shadow: 0 5px 10px rgba(0,0,0,.2);
|
||||
|
||||
-webkit-border-radius: 6px;
|
||||
-moz-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/********************
|
||||
* TOOLTIP CSS
|
||||
*/
|
||||
|
||||
.nvtooltip {
|
||||
position: absolute;
|
||||
background-color: rgba(255,255,255,1.0);
|
||||
padding: 1px;
|
||||
border: 1px solid rgba(0,0,0,.2);
|
||||
z-index: 10000;
|
||||
|
||||
font-family: Arial;
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
pointer-events: none;
|
||||
|
||||
white-space: nowrap;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/*Give tooltips that old fade in transition by
|
||||
putting a "with-transitions" class on the container div.
|
||||
*/
|
||||
.nvtooltip.with-transitions, .with-transitions .nvtooltip {
|
||||
transition: opacity 250ms linear;
|
||||
-moz-transition: opacity 250ms linear;
|
||||
-webkit-transition: opacity 250ms linear;
|
||||
|
||||
transition-delay: 250ms;
|
||||
-moz-transition-delay: 250ms;
|
||||
-webkit-transition-delay: 250ms;
|
||||
}
|
||||
|
||||
.nvtooltip.x-nvtooltip,
|
||||
.nvtooltip.y-nvtooltip {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.nvtooltip h3 {
|
||||
margin: 0;
|
||||
padding: 4px 14px;
|
||||
line-height: 18px;
|
||||
font-weight: normal;
|
||||
background-color: rgba(247,247,247,0.75);
|
||||
text-align: center;
|
||||
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
|
||||
-webkit-border-radius: 5px 5px 0 0;
|
||||
-moz-border-radius: 5px 5px 0 0;
|
||||
border-radius: 5px 5px 0 0;
|
||||
}
|
||||
|
||||
.nvtooltip p {
|
||||
margin: 0;
|
||||
padding: 5px 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nvtooltip span {
|
||||
display: inline-block;
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
||||
.nvtooltip table {
|
||||
margin: 6px;
|
||||
border-spacing:0;
|
||||
}
|
||||
|
||||
|
||||
.nvtooltip table td {
|
||||
padding: 2px 9px 2px 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.nvtooltip table td.key {
|
||||
font-weight:normal;
|
||||
}
|
||||
.nvtooltip table td.value {
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.nvtooltip table tr.highlight td {
|
||||
padding: 1px 9px 1px 0;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 1px;
|
||||
border-top-style: solid;
|
||||
border-top-width: 1px;
|
||||
}
|
||||
|
||||
.nvtooltip table td.legend-color-guide div {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.nvtooltip .footer {
|
||||
padding: 3px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
.nvtooltip-pending-removal {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
||||
/********************
|
||||
* SVG CSS
|
||||
*/
|
||||
|
||||
|
||||
svg {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
/* Trying to get SVG to act like a greedy block in all browsers */
|
||||
display: block;
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
|
||||
svg text {
|
||||
font: normal 12px Arial;
|
||||
}
|
||||
|
||||
svg .title {
|
||||
font: bold 14px Arial;
|
||||
}
|
||||
|
||||
.nvd3 .nv-background {
|
||||
fill: white;
|
||||
fill-opacity: 0;
|
||||
/*
|
||||
pointer-events: none;
|
||||
*/
|
||||
}
|
||||
|
||||
.nvd3.nv-noData {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
/**********
|
||||
* Brush
|
||||
*/
|
||||
|
||||
.nv-brush .extent {
|
||||
fill-opacity: .125;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Legend
|
||||
*/
|
||||
|
||||
.nvd3 .nv-legend .nv-series {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.nvd3 .nv-legend .disabled circle {
|
||||
fill-opacity: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Axes
|
||||
*/
|
||||
.nvd3 .nv-axis {
|
||||
pointer-events:none;
|
||||
}
|
||||
|
||||
.nvd3 .nv-axis path {
|
||||
fill: none;
|
||||
stroke: #000;
|
||||
stroke-opacity: .75;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.nvd3 .nv-axis path.domain {
|
||||
stroke-opacity: .75;
|
||||
}
|
||||
|
||||
.nvd3 .nv-axis.nv-x path.domain {
|
||||
stroke-opacity: 0;
|
||||
}
|
||||
|
||||
.nvd3 .nv-axis line {
|
||||
fill: none;
|
||||
stroke: #e5e5e5;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.nvd3 .nv-axis .zero line,
|
||||
/*this selector may not be necessary*/ .nvd3 .nv-axis line.zero {
|
||||
stroke-opacity: .75;
|
||||
}
|
||||
|
||||
.nvd3 .nv-axis .nv-axisMaxMin text {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.nvd3 .x .nv-axis .nv-axisMaxMin text,
|
||||
.nvd3 .x2 .nv-axis .nv-axisMaxMin text,
|
||||
.nvd3 .x3 .nv-axis .nv-axisMaxMin text {
|
||||
text-anchor: middle
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Brush
|
||||
*/
|
||||
|
||||
.nv-brush .resize path {
|
||||
fill: #eee;
|
||||
stroke: #666;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Bars
|
||||
*/
|
||||
|
||||
.nvd3 .nv-bars .negative rect {
|
||||
zfill: brown;
|
||||
}
|
||||
|
||||
.nvd3 .nv-bars rect {
|
||||
zfill: steelblue;
|
||||
fill-opacity: .75;
|
||||
|
||||
transition: fill-opacity 250ms linear;
|
||||
-moz-transition: fill-opacity 250ms linear;
|
||||
-webkit-transition: fill-opacity 250ms linear;
|
||||
}
|
||||
|
||||
.nvd3 .nv-bars rect.hover {
|
||||
fill-opacity: 1;
|
||||
}
|
||||
|
||||
.nvd3 .nv-bars .hover rect {
|
||||
fill: lightblue;
|
||||
}
|
||||
|
||||
.nvd3 .nv-bars text {
|
||||
fill: rgba(0,0,0,0);
|
||||
}
|
||||
|
||||
.nvd3 .nv-bars .hover text {
|
||||
fill: rgba(0,0,0,1);
|
||||
}
|
||||
|
||||
|
||||
/**********
|
||||
* Bars
|
||||
*/
|
||||
|
||||
.nvd3 .nv-multibar .nv-groups rect,
|
||||
.nvd3 .nv-multibarHorizontal .nv-groups rect,
|
||||
.nvd3 .nv-discretebar .nv-groups rect {
|
||||
stroke-opacity: 0;
|
||||
|
||||
transition: fill-opacity 250ms linear;
|
||||
-moz-transition: fill-opacity 250ms linear;
|
||||
-webkit-transition: fill-opacity 250ms linear;
|
||||
}
|
||||
|
||||
.nvd3 .nv-multibar .nv-groups rect:hover,
|
||||
.nvd3 .nv-multibarHorizontal .nv-groups rect:hover,
|
||||
.nvd3 .nv-discretebar .nv-groups rect:hover {
|
||||
fill-opacity: 1;
|
||||
}
|
||||
|
||||
.nvd3 .nv-discretebar .nv-groups text,
|
||||
.nvd3 .nv-multibarHorizontal .nv-groups text {
|
||||
font-weight: bold;
|
||||
fill: rgba(0,0,0,1);
|
||||
stroke: rgba(0,0,0,0);
|
||||
}
|
||||
|
||||
/***********
|
||||
* Pie Chart
|
||||
*/
|
||||
|
||||
.nvd3.nv-pie path {
|
||||
stroke-opacity: 0;
|
||||
transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
-moz-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
-webkit-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
|
||||
}
|
||||
|
||||
.nvd3.nv-pie .nv-slice text {
|
||||
stroke: #000;
|
||||
stroke-width: 0;
|
||||
}
|
||||
|
||||
.nvd3.nv-pie path {
|
||||
stroke: #fff;
|
||||
stroke-width: 1px;
|
||||
stroke-opacity: 1;
|
||||
}
|
||||
|
||||
.nvd3.nv-pie .hover path {
|
||||
fill-opacity: .7;
|
||||
}
|
||||
.nvd3.nv-pie .nv-label {
|
||||
pointer-events: none;
|
||||
}
|
||||
.nvd3.nv-pie .nv-label rect {
|
||||
fill-opacity: 0;
|
||||
stroke-opacity: 0;
|
||||
}
|
||||
|
||||
/**********
|
||||
* Lines
|
||||
*/
|
||||
|
||||
.nvd3 .nv-groups path.nv-line {
|
||||
fill: none;
|
||||
stroke-width: 1.5px;
|
||||
/*
|
||||
stroke-linecap: round;
|
||||
shape-rendering: geometricPrecision;
|
||||
|
||||
transition: stroke-width 250ms linear;
|
||||
-moz-transition: stroke-width 250ms linear;
|
||||
-webkit-transition: stroke-width 250ms linear;
|
||||
|
||||
transition-delay: 250ms
|
||||
-moz-transition-delay: 250ms;
|
||||
-webkit-transition-delay: 250ms;
|
||||
*/
|
||||
}
|
||||
|
||||
.nvd3 .nv-groups path.nv-line.nv-thin-line {
|
||||
stroke-width: 1px;
|
||||
}
|
||||
|
||||
|
||||
.nvd3 .nv-groups path.nv-area {
|
||||
stroke: none;
|
||||
/*
|
||||
stroke-linecap: round;
|
||||
shape-rendering: geometricPrecision;
|
||||
|
||||
stroke-width: 2.5px;
|
||||
transition: stroke-width 250ms linear;
|
||||
-moz-transition: stroke-width 250ms linear;
|
||||
-webkit-transition: stroke-width 250ms linear;
|
||||
|
||||
transition-delay: 250ms
|
||||
-moz-transition-delay: 250ms;
|
||||
-webkit-transition-delay: 250ms;
|
||||
*/
|
||||
}
|
||||
|
||||
.nvd3 .nv-line.hover path {
|
||||
stroke-width: 6px;
|
||||
}
|
||||
|
||||
/*
|
||||
.nvd3.scatter .groups .point {
|
||||
fill-opacity: 0.1;
|
||||
stroke-opacity: 0.1;
|
||||
}
|
||||
*/
|
||||
|
||||
.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point {
|
||||
fill-opacity: 0;
|
||||
stroke-opacity: 0;
|
||||
}
|
||||
|
||||
.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point {
|
||||
fill-opacity: .5 !important;
|
||||
stroke-opacity: .5 !important;
|
||||
}
|
||||
|
||||
|
||||
.with-transitions .nvd3 .nv-groups .nv-point {
|
||||
transition: stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
-moz-transition: stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
-webkit-transition: stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
|
||||
}
|
||||
|
||||
.nvd3.nv-scatter .nv-groups .nv-point.hover,
|
||||
.nvd3 .nv-groups .nv-point.hover {
|
||||
stroke-width: 7px;
|
||||
fill-opacity: .95 !important;
|
||||
stroke-opacity: .95 !important;
|
||||
}
|
||||
|
||||
|
||||
.nvd3 .nv-point-paths path {
|
||||
stroke: #aaa;
|
||||
stroke-opacity: 0;
|
||||
fill: #eee;
|
||||
fill-opacity: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.nvd3 .nv-indexLine {
|
||||
cursor: ew-resize;
|
||||
}
|
||||
|
||||
|
||||
/**********
|
||||
* Distribution
|
||||
*/
|
||||
|
||||
.nvd3 .nv-distribution {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Scatter
|
||||
*/
|
||||
|
||||
/* **Attempting to remove this for useVoronoi(false), need to see if it's required anywhere
|
||||
.nvd3 .nv-groups .nv-point {
|
||||
pointer-events: none;
|
||||
}
|
||||
*/
|
||||
|
||||
.nvd3 .nv-groups .nv-point.hover {
|
||||
stroke-width: 20px;
|
||||
stroke-opacity: .5;
|
||||
}
|
||||
|
||||
.nvd3 .nv-scatter .nv-point.hover {
|
||||
fill-opacity: 1;
|
||||
}
|
||||
|
||||
/*
|
||||
.nv-group.hover .nv-point {
|
||||
fill-opacity: 1;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/**********
|
||||
* Stacked Area
|
||||
*/
|
||||
|
||||
.nvd3.nv-stackedarea path.nv-area {
|
||||
fill-opacity: .7;
|
||||
/*
|
||||
stroke-opacity: .65;
|
||||
fill-opacity: 1;
|
||||
*/
|
||||
stroke-opacity: 0;
|
||||
|
||||
transition: fill-opacity 250ms linear, stroke-opacity 250ms linear;
|
||||
-moz-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear;
|
||||
-webkit-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear;
|
||||
|
||||
/*
|
||||
transition-delay: 500ms;
|
||||
-moz-transition-delay: 500ms;
|
||||
-webkit-transition-delay: 500ms;
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
.nvd3.nv-stackedarea path.nv-area.hover {
|
||||
fill-opacity: .9;
|
||||
/*
|
||||
stroke-opacity: .85;
|
||||
*/
|
||||
}
|
||||
/*
|
||||
.d3stackedarea .groups path {
|
||||
stroke-opacity: 0;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
.nvd3.nv-stackedarea .nv-groups .nv-point {
|
||||
stroke-opacity: 0;
|
||||
fill-opacity: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
.nvd3.nv-stackedarea .nv-groups .nv-point.hover {
|
||||
stroke-width: 20px;
|
||||
stroke-opacity: .75;
|
||||
fill-opacity: 1;
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Line Plus Bar
|
||||
*/
|
||||
|
||||
.nvd3.nv-linePlusBar .nv-bar rect {
|
||||
fill-opacity: .75;
|
||||
}
|
||||
|
||||
.nvd3.nv-linePlusBar .nv-bar rect:hover {
|
||||
fill-opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
/**********
|
||||
* Bullet
|
||||
*/
|
||||
|
||||
.nvd3.nv-bullet { font: 10px sans-serif; }
|
||||
.nvd3.nv-bullet .nv-measure { fill-opacity: .8; }
|
||||
.nvd3.nv-bullet .nv-measure:hover { fill-opacity: 1; }
|
||||
.nvd3.nv-bullet .nv-marker { stroke: #000; stroke-width: 2px; }
|
||||
.nvd3.nv-bullet .nv-markerTriangle { stroke: #000; fill: #fff; stroke-width: 1.5px; }
|
||||
.nvd3.nv-bullet .nv-tick line { stroke: #666; stroke-width: .5px; }
|
||||
.nvd3.nv-bullet .nv-range.nv-s0 { fill: #eee; }
|
||||
.nvd3.nv-bullet .nv-range.nv-s1 { fill: #ddd; }
|
||||
.nvd3.nv-bullet .nv-range.nv-s2 { fill: #ccc; }
|
||||
.nvd3.nv-bullet .nv-title { font-size: 14px; font-weight: bold; }
|
||||
.nvd3.nv-bullet .nv-subtitle { fill: #999; }
|
||||
|
||||
|
||||
.nvd3.nv-bullet .nv-range {
|
||||
fill: #bababa;
|
||||
fill-opacity: .4;
|
||||
}
|
||||
.nvd3.nv-bullet .nv-range:hover {
|
||||
fill-opacity: .7;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Sparkline
|
||||
*/
|
||||
|
||||
.nvd3.nv-sparkline path {
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus g.nv-hoverValue {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-hoverValue line {
|
||||
stroke: #333;
|
||||
stroke-width: 1.5px;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus,
|
||||
.nvd3.nv-sparklineplus g {
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
.nvd3 .nv-hoverArea {
|
||||
fill-opacity: 0;
|
||||
stroke-opacity: 0;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-xValue,
|
||||
.nvd3.nv-sparklineplus .nv-yValue {
|
||||
/*
|
||||
stroke: #666;
|
||||
*/
|
||||
stroke-width: 0;
|
||||
font-size: .9em;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-yValue {
|
||||
stroke: #f66;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-maxValue {
|
||||
stroke: #2ca02c;
|
||||
fill: #2ca02c;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-minValue {
|
||||
stroke: #d62728;
|
||||
fill: #d62728;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-currentValue {
|
||||
/*
|
||||
stroke: #444;
|
||||
fill: #000;
|
||||
*/
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
/**********
|
||||
* historical stock
|
||||
*/
|
||||
|
||||
.nvd3.nv-ohlcBar .nv-ticks .nv-tick {
|
||||
stroke-width: 2px;
|
||||
}
|
||||
|
||||
.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover {
|
||||
stroke-width: 4px;
|
||||
}
|
||||
|
||||
.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive {
|
||||
stroke: #2ca02c;
|
||||
}
|
||||
|
||||
.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative {
|
||||
stroke: #d62728;
|
||||
}
|
||||
|
||||
.nvd3.nv-historicalStockChart .nv-axis .nv-axislabel {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.nvd3.nv-historicalStockChart .nv-dragTarget {
|
||||
fill-opacity: 0;
|
||||
stroke: none;
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.nvd3 .nv-brush .extent {
|
||||
/*
|
||||
cursor: ew-resize !important;
|
||||
*/
|
||||
fill-opacity: 0 !important;
|
||||
}
|
||||
|
||||
.nvd3 .nv-brushBackground rect {
|
||||
stroke: #000;
|
||||
stroke-width: .4;
|
||||
fill: #fff;
|
||||
fill-opacity: .7;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Indented Tree
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* TODO: the following 3 selectors are based on classes used in the example. I should either make them standard and leave them here, or move to a CSS file not included in the library
|
||||
*/
|
||||
.nvd3.nv-indentedtree .name {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.nvd3.nv-indentedtree .clickable {
|
||||
color: #08C;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.nvd3.nv-indentedtree span.clickable:hover {
|
||||
color: #005580;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
.nvd3.nv-indentedtree .nv-childrenCount {
|
||||
display: inline-block;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.nvd3.nv-indentedtree .nv-treeicon {
|
||||
cursor: pointer;
|
||||
/*
|
||||
cursor: n-resize;
|
||||
*/
|
||||
}
|
||||
|
||||
.nvd3.nv-indentedtree .nv-treeicon.nv-folded {
|
||||
cursor: pointer;
|
||||
/*
|
||||
cursor: s-resize;
|
||||
*/
|
||||
}
|
||||
|
||||
/**********
|
||||
* Parallel Coordinates
|
||||
*/
|
||||
|
||||
.nvd3 .background path {
|
||||
fill: none;
|
||||
stroke: #ccc;
|
||||
stroke-opacity: .4;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.nvd3 .foreground path {
|
||||
fill: none;
|
||||
stroke: steelblue;
|
||||
stroke-opacity: .7;
|
||||
}
|
||||
|
||||
.nvd3 .brush .extent {
|
||||
fill-opacity: .3;
|
||||
stroke: #fff;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.nvd3 .axis line, .axis path {
|
||||
fill: none;
|
||||
stroke: #000;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.nvd3 .axis text {
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
/****
|
||||
Interactive Layer
|
||||
*/
|
||||
.nvd3 .nv-interactiveGuideLine {
|
||||
pointer-events:none;
|
||||
}
|
||||
.nvd3 line.nv-guideline {
|
||||
stroke: #ccc;
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "nvd3",
|
||||
"version": "0.0.1",
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-contrib-jshint": "~0.3.0",
|
||||
"grunt-contrib-watch": "~0.3.1",
|
||||
"grunt-contrib-uglify": "~0.2.0",
|
||||
"grunt-contrib-concat": "~0.2.0",
|
||||
"grunt-contrib-copy": "~0.4.1",
|
||||
"grunt-contrib-cssmin": "~0.6.2"
|
||||
}
|
||||
}
|
@ -0,0 +1,251 @@
|
||||
/* Utility class to handle creation of an interactive layer.
|
||||
This places a rectangle on top of the chart. When you mouse move over it, it sends a dispatch
|
||||
containing the X-coordinate. It can also render a vertical line where the mouse is located.
|
||||
|
||||
dispatch.elementMousemove is the important event to latch onto. It is fired whenever the mouse moves over
|
||||
the rectangle. The dispatch is given one object which contains the mouseX/Y location.
|
||||
It also has 'pointXValue', which is the conversion of mouseX to the x-axis scale.
|
||||
*/
|
||||
nv.interactiveGuideline = function() {
|
||||
"use strict";
|
||||
var tooltip = nv.models.tooltip();
|
||||
//Public settings
|
||||
var width = null
|
||||
, height = null
|
||||
//Please pass in the bounding chart's top and left margins
|
||||
//This is important for calculating the correct mouseX/Y positions.
|
||||
, margin = {left: 0, top: 0}
|
||||
, xScale = d3.scale.linear()
|
||||
, yScale = d3.scale.linear()
|
||||
, dispatch = d3.dispatch('elementMousemove', 'elementMouseout','elementDblclick')
|
||||
, showGuideLine = true
|
||||
, svgContainer = null
|
||||
//Must pass in the bounding chart's <svg> container.
|
||||
//The mousemove event is attached to this container.
|
||||
;
|
||||
|
||||
//Private variables
|
||||
var isMSIE = navigator.userAgent.indexOf("MSIE") !== -1 //Check user-agent for Microsoft Internet Explorer.
|
||||
;
|
||||
|
||||
|
||||
function layer(selection) {
|
||||
selection.each(function(data) {
|
||||
var container = d3.select(this);
|
||||
|
||||
var availableWidth = (width || 960), availableHeight = (height || 400);
|
||||
|
||||
var wrap = container.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([data]);
|
||||
var wrapEnter = wrap.enter()
|
||||
.append("g").attr("class", " nv-wrap nv-interactiveLineLayer");
|
||||
|
||||
|
||||
wrapEnter.append("g").attr("class","nv-interactiveGuideLine");
|
||||
|
||||
if (!svgContainer) {
|
||||
return;
|
||||
}
|
||||
|
||||
function mouseHandler() {
|
||||
var d3mouse = d3.mouse(this);
|
||||
var mouseX = d3mouse[0];
|
||||
var mouseY = d3mouse[1];
|
||||
var subtractMargin = true;
|
||||
var mouseOutAnyReason = false;
|
||||
if (isMSIE) {
|
||||
/*
|
||||
D3.js (or maybe SVG.getScreenCTM) has a nasty bug in Internet Explorer 10.
|
||||
d3.mouse() returns incorrect X,Y mouse coordinates when mouse moving
|
||||
over a rect in IE 10.
|
||||
However, d3.event.offsetX/Y also returns the mouse coordinates
|
||||
relative to the triggering <rect>. So we use offsetX/Y on IE.
|
||||
*/
|
||||
mouseX = d3.event.offsetX;
|
||||
mouseY = d3.event.offsetY;
|
||||
|
||||
/*
|
||||
On IE, if you attach a mouse event listener to the <svg> container,
|
||||
it will actually trigger it for all the child elements (like <path>, <circle>, etc).
|
||||
When this happens on IE, the offsetX/Y is set to where ever the child element
|
||||
is located.
|
||||
As a result, we do NOT need to subtract margins to figure out the mouse X/Y
|
||||
position under this scenario. Removing the line below *will* cause
|
||||
the interactive layer to not work right on IE.
|
||||
*/
|
||||
if(d3.event.target.tagName !== "svg")
|
||||
subtractMargin = false;
|
||||
|
||||
if (d3.event.target.className.baseVal.match("nv-legend"))
|
||||
mouseOutAnyReason = true;
|
||||
|
||||
}
|
||||
|
||||
if(subtractMargin) {
|
||||
mouseX -= margin.left;
|
||||
mouseY -= margin.top;
|
||||
}
|
||||
|
||||
/* If mouseX/Y is outside of the chart's bounds,
|
||||
trigger a mouseOut event.
|
||||
*/
|
||||
if (mouseX < 0 || mouseY < 0
|
||||
|| mouseX > availableWidth || mouseY > availableHeight
|
||||
|| (d3.event.relatedTarget && d3.event.relatedTarget.ownerSVGElement === undefined)
|
||||
|| mouseOutAnyReason
|
||||
)
|
||||
{
|
||||
if (isMSIE) {
|
||||
if (d3.event.relatedTarget
|
||||
&& d3.event.relatedTarget.ownerSVGElement === undefined
|
||||
&& d3.event.relatedTarget.className.match(tooltip.nvPointerEventsClass)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
dispatch.elementMouseout({
|
||||
mouseX: mouseX,
|
||||
mouseY: mouseY
|
||||
});
|
||||
layer.renderGuideLine(null); //hide the guideline
|
||||
return;
|
||||
}
|
||||
|
||||
var pointXValue = xScale.invert(mouseX);
|
||||
dispatch.elementMousemove({
|
||||
mouseX: mouseX,
|
||||
mouseY: mouseY,
|
||||
pointXValue: pointXValue
|
||||
});
|
||||
|
||||
//If user double clicks the layer, fire a elementDblclick dispatch.
|
||||
if (d3.event.type === "dblclick") {
|
||||
dispatch.elementDblclick({
|
||||
mouseX: mouseX,
|
||||
mouseY: mouseY,
|
||||
pointXValue: pointXValue
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
svgContainer
|
||||
.on("mousemove",mouseHandler, true)
|
||||
.on("mouseout" ,mouseHandler,true)
|
||||
.on("dblclick" ,mouseHandler)
|
||||
;
|
||||
|
||||
//Draws a vertical guideline at the given X postion.
|
||||
layer.renderGuideLine = function(x) {
|
||||
if (!showGuideLine) return;
|
||||
var line = wrap.select(".nv-interactiveGuideLine")
|
||||
.selectAll("line")
|
||||
.data((x != null) ? [nv.utils.NaNtoZero(x)] : [], String);
|
||||
|
||||
line.enter()
|
||||
.append("line")
|
||||
.attr("class", "nv-guideline")
|
||||
.attr("x1", function(d) { return d;})
|
||||
.attr("x2", function(d) { return d;})
|
||||
.attr("y1", availableHeight)
|
||||
.attr("y2",0)
|
||||
;
|
||||
line.exit().remove();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
layer.dispatch = dispatch;
|
||||
layer.tooltip = tooltip;
|
||||
|
||||
layer.margin = function(_) {
|
||||
if (!arguments.length) return margin;
|
||||
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
||||
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
||||
return layer;
|
||||
};
|
||||
|
||||
layer.width = function(_) {
|
||||
if (!arguments.length) return width;
|
||||
width = _;
|
||||
return layer;
|
||||
};
|
||||
|
||||
layer.height = function(_) {
|
||||
if (!arguments.length) return height;
|
||||
height = _;
|
||||
return layer;
|
||||
};
|
||||
|
||||
layer.xScale = function(_) {
|
||||
if (!arguments.length) return xScale;
|
||||
xScale = _;
|
||||
return layer;
|
||||
};
|
||||
|
||||
layer.showGuideLine = function(_) {
|
||||
if (!arguments.length) return showGuideLine;
|
||||
showGuideLine = _;
|
||||
return layer;
|
||||
};
|
||||
|
||||
layer.svgContainer = function(_) {
|
||||
if (!arguments.length) return svgContainer;
|
||||
svgContainer = _;
|
||||
return layer;
|
||||
};
|
||||
|
||||
|
||||
return layer;
|
||||
};
|
||||
|
||||
/* Utility class that uses d3.bisect to find the index in a given array, where a search value can be inserted.
|
||||
This is different from normal bisectLeft; this function finds the nearest index to insert the search value.
|
||||
|
||||
For instance, lets say your array is [1,2,3,5,10,30], and you search for 28.
|
||||
Normal d3.bisectLeft will return 4, because 28 is inserted after the number 10. But interactiveBisect will return 5
|
||||
because 28 is closer to 30 than 10.
|
||||
|
||||
Unit tests can be found in: interactiveBisectTest.html
|
||||
|
||||
Has the following known issues:
|
||||
* Will not work if the data points move backwards (ie, 10,9,8,7, etc) or if the data points are in random order.
|
||||
* Won't work if there are duplicate x coordinate values.
|
||||
*/
|
||||
nv.interactiveBisect = function (values, searchVal, xAccessor) {
|
||||
"use strict";
|
||||
if (! values instanceof Array) return null;
|
||||
if (typeof xAccessor !== 'function') xAccessor = function(d,i) { return d.x;}
|
||||
|
||||
var bisect = d3.bisector(xAccessor).left;
|
||||
var index = d3.max([0, bisect(values,searchVal) - 1]);
|
||||
var currentValue = xAccessor(values[index], index);
|
||||
if (typeof currentValue === 'undefined') currentValue = index;
|
||||
|
||||
if (currentValue === searchVal) return index; //found exact match
|
||||
|
||||
var nextIndex = d3.min([index+1, values.length - 1]);
|
||||
var nextValue = xAccessor(values[nextIndex], nextIndex);
|
||||
if (typeof nextValue === 'undefined') nextValue = nextIndex;
|
||||
|
||||
if (Math.abs(nextValue - searchVal) >= Math.abs(currentValue - searchVal))
|
||||
return index;
|
||||
else
|
||||
return nextIndex
|
||||
};
|
||||
|
||||
/*
|
||||
Returns the index in the array "values" that is closest to searchVal.
|
||||
Only returns an index if searchVal is within some "threshold".
|
||||
Otherwise, returns null.
|
||||
*/
|
||||
nv.nearestValueIndex = function (values, searchVal, threshold) {
|
||||
"use strict";
|
||||
var yDistMax = Infinity, indexToHighlight = null;
|
||||
values.forEach(function(d,i) {
|
||||
var delta = Math.abs(searchVal - d);
|
||||
if ( delta <= yDistMax && delta < threshold) {
|
||||
yDistMax = delta;
|
||||
indexToHighlight = i;
|
||||
}
|
||||
});
|
||||
return indexToHighlight;
|
||||
};
|
@ -0,0 +1,419 @@
|
||||
|
||||
nv.models.historicalBarChart = function() {
|
||||
"use strict";
|
||||
//============================================================
|
||||
// Public Variables with Default Settings
|
||||
//------------------------------------------------------------
|
||||
|
||||
var bars = nv.models.historicalBar()
|
||||
, xAxis = nv.models.axis()
|
||||
, yAxis = nv.models.axis()
|
||||
, legend = nv.models.legend()
|
||||
;
|
||||
|
||||
|
||||
var margin = {top: 30, right: 90, bottom: 50, left: 90}
|
||||
, color = nv.utils.defaultColor()
|
||||
, width = null
|
||||
, height = null
|
||||
, showLegend = false
|
||||
, showXAxis = true
|
||||
, showYAxis = true
|
||||
, rightAlignYAxis = false
|
||||
, tooltips = true
|
||||
, tooltip = function(key, x, y, e, graph) {
|
||||
return '<h3>' + key + '</h3>' +
|
||||
'<p>' + y + ' at ' + x + '</p>'
|
||||
}
|
||||
, x
|
||||
, y
|
||||
, state = {}
|
||||
, defaultState = null
|
||||
, noData = 'No Data Available.'
|
||||
, dispatch = d3.dispatch('tooltipShow', 'tooltipHide', 'stateChange', 'changeState')
|
||||
, transitionDuration = 250
|
||||
;
|
||||
|
||||
xAxis
|
||||
.orient('bottom')
|
||||
.tickPadding(7)
|
||||
;
|
||||
yAxis
|
||||
.orient( (rightAlignYAxis) ? 'right' : 'left')
|
||||
;
|
||||
|
||||
//============================================================
|
||||
|
||||
|
||||
//============================================================
|
||||
// Private Variables
|
||||
//------------------------------------------------------------
|
||||
|
||||
var showTooltip = function(e, offsetElement) {
|
||||
|
||||
// New addition to calculate position if SVG is scaled with viewBox, may move TODO: consider implementing everywhere else
|
||||
if (offsetElement) {
|
||||
var svg = d3.select(offsetElement).select('svg');
|
||||
var viewBox = (svg.node()) ? svg.attr('viewBox') : null;
|
||||
if (viewBox) {
|
||||
viewBox = viewBox.split(' ');
|
||||
var ratio = parseInt(svg.style('width')) / viewBox[2];
|
||||
e.pos[0] = e.pos[0] * ratio;
|
||||
e.pos[1] = e.pos[1] * ratio;
|
||||
}
|
||||
}
|
||||
|
||||
var left = e.pos[0] + ( offsetElement.offsetLeft || 0 ),
|
||||
top = e.pos[1] + ( offsetElement.offsetTop || 0),
|
||||
x = xAxis.tickFormat()(bars.x()(e.point, e.pointIndex)),
|
||||
y = yAxis.tickFormat()(bars.y()(e.point, e.pointIndex)),
|
||||
content = tooltip(e.series.key, x, y, e, chart);
|
||||
|
||||
nv.tooltip.show([left, top], content, null, null, offsetElement);
|
||||
};
|
||||
|
||||
//============================================================
|
||||
|
||||
|
||||
function chart(selection) {
|
||||
selection.each(function(data) {
|
||||
var container = d3.select(this),
|
||||
that = this;
|
||||
|
||||
var availableWidth = (width || parseInt(container.style('width')) || 960)
|
||||
- margin.left - margin.right,
|
||||
availableHeight = (height || parseInt(container.style('height')) || 400)
|
||||
- margin.top - margin.bottom;
|
||||
|
||||
|
||||
chart.update = function() { container.transition().duration(transitionDuration).call(chart) };
|
||||
chart.container = this;
|
||||
|
||||
//set state.disabled
|
||||
state.disabled = data.map(function(d) { return !!d.disabled });
|
||||
|
||||
if (!defaultState) {
|
||||
var key;
|
||||
defaultState = {};
|
||||
for (key in state) {
|
||||
if (state[key] instanceof Array)
|
||||
defaultState[key] = state[key].slice(0);
|
||||
else
|
||||
defaultState[key] = state[key];
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Display noData message if there's nothing to show.
|
||||
|
||||
if (!data || !data.length || !data.filter(function(d) { return d.values.length }).length) {
|
||||
var noDataText = container.selectAll('.nv-noData').data([noData]);
|
||||
|
||||
noDataText.enter().append('text')
|
||||
.attr('class', 'nvd3 nv-noData')
|
||||
.attr('dy', '-.7em')
|
||||
.style('text-anchor', 'middle');
|
||||
|
||||
noDataText
|
||||
.attr('x', margin.left + availableWidth / 2)
|
||||
.attr('y', margin.top + availableHeight / 2)
|
||||
.text(function(d) { return d });
|
||||
|
||||
return chart;
|
||||
} else {
|
||||
container.selectAll('.nv-noData').remove();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Setup Scales
|
||||
|
||||
x = bars.xScale();
|
||||
y = bars.yScale();
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Setup containers and skeleton of chart
|
||||
|
||||
var wrap = container.selectAll('g.nv-wrap.nv-historicalBarChart').data([data]);
|
||||
var gEnter = wrap.enter().append('g').attr('class', 'nvd3 nv-wrap nv-historicalBarChart').append('g');
|
||||
var g = wrap.select('g');
|
||||
|
||||
gEnter.append('g').attr('class', 'nv-x nv-axis');
|
||||
gEnter.append('g').attr('class', 'nv-y nv-axis');
|
||||
gEnter.append('g').attr('class', 'nv-barsWrap');
|
||||
gEnter.append('g').attr('class', 'nv-legendWrap');
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Legend
|
||||
|
||||
if (showLegend) {
|
||||
legend.width(availableWidth);
|
||||
|
||||
g.select('.nv-legendWrap')
|
||||
.datum(data)
|
||||
.call(legend);
|
||||
|
||||
if ( margin.top != legend.height()) {
|
||||
margin.top = legend.height();
|
||||
availableHeight = (height || parseInt(container.style('height')) || 400)
|
||||
- margin.top - margin.bottom;
|
||||
}
|
||||
|
||||
wrap.select('.nv-legendWrap')
|
||||
.attr('transform', 'translate(0,' + (-margin.top) +')')
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
wrap.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
|
||||
|
||||
if (rightAlignYAxis) {
|
||||
g.select(".nv-y.nv-axis")
|
||||
.attr("transform", "translate(" + availableWidth + ",0)");
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Main Chart Component(s)
|
||||
|
||||
bars
|
||||
.width(availableWidth)
|
||||
.height(availableHeight)
|
||||
.color(data.map(function(d,i) {
|
||||
return d.color || color(d, i);
|
||||
}).filter(function(d,i) { return !data[i].disabled }));
|
||||
|
||||
|
||||
var barsWrap = g.select('.nv-barsWrap')
|
||||
.datum(data.filter(function(d) { return !d.disabled }))
|
||||
|
||||
barsWrap.transition().call(bars);
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Setup Axes
|
||||
|
||||
if (showXAxis) {
|
||||
xAxis
|
||||
.scale(x)
|
||||
.tickSize(-availableHeight, 0);
|
||||
|
||||
g.select('.nv-x.nv-axis')
|
||||
.attr('transform', 'translate(0,' + y.range()[0] + ')');
|
||||
g.select('.nv-x.nv-axis')
|
||||
.transition()
|
||||
.call(xAxis);
|
||||
}
|
||||
|
||||
if (showYAxis) {
|
||||
yAxis
|
||||
.scale(y)
|
||||
.ticks( availableHeight / 36 )
|
||||
.tickSize( -availableWidth, 0);
|
||||
|
||||
g.select('.nv-y.nv-axis')
|
||||
.transition()
|
||||
.call(yAxis);
|
||||
}
|
||||
//------------------------------------------------------------
|
||||
|
||||
|
||||
//============================================================
|
||||
// Event Handling/Dispatching (in chart's scope)
|
||||
//------------------------------------------------------------
|
||||
|
||||
legend.dispatch.on('legendClick', function(d,i) {
|
||||
d.disabled = !d.disabled;
|
||||
|
||||
if (!data.filter(function(d) { return !d.disabled }).length) {
|
||||
data.map(function(d) {
|
||||
d.disabled = false;
|
||||
wrap.selectAll('.nv-series').classed('disabled', false);
|
||||
return d;
|
||||
});
|
||||
}
|
||||
|
||||
state.disabled = data.map(function(d) { return !!d.disabled });
|
||||
dispatch.stateChange(state);
|
||||
|
||||
selection.transition().call(chart);
|
||||
});
|
||||
|
||||
legend.dispatch.on('legendDblclick', function(d) {
|
||||
//Double clicking should always enable current series, and disabled all others.
|
||||
data.forEach(function(d) {
|
||||
d.disabled = true;
|
||||
});
|
||||
d.disabled = false;
|
||||
|
||||
state.disabled = data.map(function(d) { return !!d.disabled });
|
||||
dispatch.stateChange(state);
|
||||
chart.update();
|
||||
});
|
||||
|
||||
dispatch.on('tooltipShow', function(e) {
|
||||
if (tooltips) showTooltip(e, that.parentNode);
|
||||
});
|
||||
|
||||
|
||||
dispatch.on('changeState', function(e) {
|
||||
|
||||
if (typeof e.disabled !== 'undefined') {
|
||||
data.forEach(function(series,i) {
|
||||
series.disabled = e.disabled[i];
|
||||
});
|
||||
|
||||
state.disabled = e.disabled;
|
||||
}
|
||||
|
||||
chart.update();
|
||||
});
|
||||
|
||||
//============================================================
|
||||
|
||||
});
|
||||
|
||||
return chart;
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// Event Handling/Dispatching (out of chart's scope)
|
||||
//------------------------------------------------------------
|
||||
|
||||
bars.dispatch.on('elementMouseover.tooltip', function(e) {
|
||||
e.pos = [e.pos[0] + margin.left, e.pos[1] + margin.top];
|
||||
dispatch.tooltipShow(e);
|
||||
});
|
||||
|
||||
bars.dispatch.on('elementMouseout.tooltip', function(e) {
|
||||
dispatch.tooltipHide(e);
|
||||
});
|
||||
|
||||
dispatch.on('tooltipHide', function() {
|
||||
if (tooltips) nv.tooltip.cleanup();
|
||||
});
|
||||
|
||||
//============================================================
|
||||
|
||||
|
||||
//============================================================
|
||||
// Expose Public Variables
|
||||
//------------------------------------------------------------
|
||||
|
||||
// expose chart's sub-components
|
||||
chart.dispatch = dispatch;
|
||||
chart.bars = bars;
|
||||
chart.legend = legend;
|
||||
chart.xAxis = xAxis;
|
||||
chart.yAxis = yAxis;
|
||||
|
||||
d3.rebind(chart, bars, 'defined', 'isArea', 'x', 'y', 'size', 'xScale', 'yScale',
|
||||
'xDomain', 'yDomain', 'xRange', 'yRange', 'forceX', 'forceY', 'interactive', 'clipEdge', 'clipVoronoi', 'id', 'interpolate','highlightPoint','clearHighlights', 'interactive');
|
||||
|
||||
chart.options = nv.utils.optionsFunc.bind(chart);
|
||||
|
||||
chart.margin = function(_) {
|
||||
if (!arguments.length) return margin;
|
||||
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
||||
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
||||
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
||||
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.width = function(_) {
|
||||
if (!arguments.length) return width;
|
||||
width = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.height = function(_) {
|
||||
if (!arguments.length) return height;
|
||||
height = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.color = function(_) {
|
||||
if (!arguments.length) return color;
|
||||
color = nv.utils.getColor(_);
|
||||
legend.color(color);
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.showLegend = function(_) {
|
||||
if (!arguments.length) return showLegend;
|
||||
showLegend = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.showXAxis = function(_) {
|
||||
if (!arguments.length) return showXAxis;
|
||||
showXAxis = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.showYAxis = function(_) {
|
||||
if (!arguments.length) return showYAxis;
|
||||
showYAxis = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.rightAlignYAxis = function(_) {
|
||||
if(!arguments.length) return rightAlignYAxis;
|
||||
rightAlignYAxis = _;
|
||||
yAxis.orient( (_) ? 'right' : 'left');
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.tooltips = function(_) {
|
||||
if (!arguments.length) return tooltips;
|
||||
tooltips = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.tooltipContent = function(_) {
|
||||
if (!arguments.length) return tooltip;
|
||||
tooltip = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.state = function(_) {
|
||||
if (!arguments.length) return state;
|
||||
state = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.defaultState = function(_) {
|
||||
if (!arguments.length) return defaultState;
|
||||
defaultState = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.noData = function(_) {
|
||||
if (!arguments.length) return noData;
|
||||
noData = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.transitionDuration = function(_) {
|
||||
if (!arguments.length) return transitionDuration;
|
||||
transitionDuration = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
//============================================================
|
||||
|
||||
|
||||
return chart;
|
||||
}
|
@ -1,317 +1,337 @@
|
||||
nv.models.indentedTree = function() {
|
||||
|
||||
//============================================================
|
||||
// Public Variables with Default Settings
|
||||
//------------------------------------------------------------
|
||||
|
||||
var margin = {top: 0, right: 0, bottom: 0, left: 0} //TODO: implement, maybe as margin on the containing div
|
||||
, width = 960
|
||||
, height = 500
|
||||
, color = nv.utils.defaultColor()
|
||||
, id = Math.floor(Math.random() * 10000)
|
||||
, header = true
|
||||
, filterZero = false
|
||||
, noData = "No Data Available."
|
||||
, childIndent = 20
|
||||
, columns = [{key:'key', label: 'Name', type:'text'}] //TODO: consider functions like chart.addColumn, chart.removeColumn, instead of a block like this
|
||||
, tableClass = null
|
||||
, iconOpen = 'images/grey-plus.png' //TODO: consider removing this and replacing with a '+' or '-' unless user defines images
|
||||
, iconClose = 'images/grey-minus.png'
|
||||
, dispatch = d3.dispatch('elementClick', 'elementDblclick', 'elementMouseover', 'elementMouseout')
|
||||
;
|
||||
|
||||
//============================================================
|
||||
|
||||
var idx = 0;
|
||||
|
||||
function chart(selection) {
|
||||
selection.each(function(data) {
|
||||
var depth = 1,
|
||||
container = d3.select(this);
|
||||
|
||||
var tree = d3.layout.tree()
|
||||
.children(function(d) { return d.values })
|
||||
.size([height, childIndent]); //Not sure if this is needed now that the result is HTML
|
||||
|
||||
chart.update = function() { container.transition().duration(600).call(chart) };
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Display No Data message if there's nothing to show.
|
||||
if (!data[0]) data[0] = {key: noData};
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
|
||||
var nodes = tree.nodes(data[0]);
|
||||
|
||||
// nodes.map(function(d) {
|
||||
// d.id = i++;
|
||||
// })
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Setup containers and skeleton of chart
|
||||
|
||||
var wrap = d3.select(this).selectAll('div').data([[nodes]]);
|
||||
var wrapEnter = wrap.enter().append('div').attr('class', 'nvd3 nv-wrap nv-indentedtree');
|
||||
var tableEnter = wrapEnter.append('table');
|
||||
var table = wrap.select('table').attr('width', '100%').attr('class', tableClass);
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
|
||||
if (header) {
|
||||
var thead = tableEnter.append('thead');
|
||||
|
||||
var theadRow1 = thead.append('tr');
|
||||
|
||||
columns.forEach(function(column) {
|
||||
theadRow1
|
||||
.append('th')
|
||||
.attr('width', column.width ? column.width : '10%')
|
||||
.style('text-align', column.type == 'numeric' ? 'right' : 'left')
|
||||
.append('span')
|
||||
.text(column.label);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var tbody = table.selectAll('tbody')
|
||||
.data(function(d) { return d });
|
||||
tbody.enter().append('tbody');
|
||||
|
||||
|
||||
|
||||
//compute max generations
|
||||
depth = d3.max(nodes, function(node) { return node.depth });
|
||||
tree.size([height, depth * childIndent]); //TODO: see if this is necessary at all
|
||||
|
||||
|
||||
// Update the nodes…
|
||||
var node = tbody.selectAll('tr')
|
||||
// .data(function(d) { return d; }, function(d) { return d.id || (d.id == ++i)});
|
||||
.data(function(d) { return d.filter(function(d) { return (filterZero && !d.children) ? filterZero(d) : true; } )}, function(d,i) { return d.id || (d.id || ++idx)});
|
||||
//.style('display', 'table-row'); //TODO: see if this does anything
|
||||
|
||||
node.exit().remove();
|
||||
|
||||
node.select('img.nv-treeicon')
|
||||
.attr('src', icon)
|
||||
.classed('folded', folded);
|
||||
|
||||
var nodeEnter = node.enter().append('tr');
|
||||
|
||||
|
||||
columns.forEach(function(column, index) {
|
||||
|
||||
var nodeName = nodeEnter.append('td')
|
||||
.style('padding-left', function(d) { return (index ? 0 : d.depth * childIndent + 12 + (icon(d) ? 0 : 16)) + 'px' }, 'important') //TODO: check why I did the ternary here
|
||||
.style('text-align', column.type == 'numeric' ? 'right' : 'left');
|
||||
|
||||
|
||||
if (index == 0) {
|
||||
nodeName.append('img')
|
||||
.classed('nv-treeicon', true)
|
||||
.classed('nv-folded', folded)
|
||||
.attr('src', icon)
|
||||
.style('width', '14px')
|
||||
.style('height', '14px')
|
||||
.style('padding', '0 1px')
|
||||
.style('display', function(d) { return icon(d) ? 'inline-block' : 'none'; })
|
||||
.on('click', click);
|
||||
}
|
||||
|
||||
|
||||
nodeName.append('span')
|
||||
.attr('class', d3.functor(column.classes) )
|
||||
.text(function(d) { return column.format ? column.format(d) :
|
||||
(d[column.key] || '-') });
|
||||
|
||||
if (column.showCount) {
|
||||
nodeName.append('span')
|
||||
.attr('class', 'nv-childrenCount');
|
||||
|
||||
node.selectAll('span.nv-childrenCount').text(function(d) {
|
||||
return ((d.values && d.values.length) || (d._values && d._values.length)) ? //If this is a parent
|
||||
'(' + ((d.values && (d.values.filter(function(d) { return filterZero ? filterZero(d) : true; }).length)) //If children are in values check its children and filter
|
||||
|| (d._values && d._values.filter(function(d) { return filterZero ? filterZero(d) : true; }).length) //Otherwise, do the same, but with the other name, _values...
|
||||
|| 0) + ')' //This is the catch-all in case there are no children after a filter
|
||||
: '' //If this is not a parent, just give an empty string
|
||||
});
|
||||
}
|
||||
|
||||
if (column.click)
|
||||
nodeName.select('span').on('click', column.click);
|
||||
|
||||
});
|
||||
|
||||
node
|
||||
.order()
|
||||
.on('click', function(d) {
|
||||
dispatch.elementClick({
|
||||
row: this, //TODO: decide whether or not this should be consistent with scatter/line events or should be an html link (a href)
|
||||
data: d,
|
||||
pos: [d.x, d.y]
|
||||
});
|
||||
})
|
||||
.on('dblclick', function(d) {
|
||||
dispatch.elementDblclick({
|
||||
row: this,
|
||||
data: d,
|
||||
pos: [d.x, d.y]
|
||||
});
|
||||
})
|
||||
.on('mouseover', function(d) {
|
||||
dispatch.elementMouseover({
|
||||
row: this,
|
||||
data: d,
|
||||
pos: [d.x, d.y]
|
||||
});
|
||||
})
|
||||
.on('mouseout', function(d) {
|
||||
dispatch.elementMouseout({
|
||||
row: this,
|
||||
data: d,
|
||||
pos: [d.x, d.y]
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// Toggle children on click.
|
||||
function click(d, _, unshift) {
|
||||
d3.event.stopPropagation();
|
||||
|
||||
if(d3.event.shiftKey && !unshift) {
|
||||
//If you shift-click, it'll toggle fold all the children, instead of itself
|
||||
d3.event.shiftKey = false;
|
||||
d.values && d.values.forEach(function(node){
|
||||
if (node.values || node._values) {
|
||||
click(node, 0, true);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
if(!hasChildren(d)) {
|
||||
//download file
|
||||
//window.location.href = d.url;
|
||||
return true;
|
||||
}
|
||||
if (d.values) {
|
||||
d._values = d.values;
|
||||
d.values = null;
|
||||
} else {
|
||||
d.values = d._values;
|
||||
d._values = null;
|
||||
}
|
||||
chart.update();
|
||||
}
|
||||
|
||||
|
||||
function icon(d) {
|
||||
return (d._values && d._values.length) ? iconOpen : (d.values && d.values.length) ? iconClose : '';
|
||||
}
|
||||
|
||||
function folded(d) {
|
||||
return (d._values && d._values.length);
|
||||
}
|
||||
|
||||
function hasChildren(d) {
|
||||
var values = d.values || d._values;
|
||||
|
||||
return (values && values.length);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
return chart;
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// Expose Public Variables
|
||||
//------------------------------------------------------------
|
||||
|
||||
chart.margin = function(_) {
|
||||
if (!arguments.length) return margin;
|
||||
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
||||
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
||||
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
||||
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.width = function(_) {
|
||||
if (!arguments.length) return width;
|
||||
width = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.height = function(_) {
|
||||
if (!arguments.length) return height;
|
||||
height = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.color = function(_) {
|
||||
if (!arguments.length) return color;
|
||||
color = nv.utils.getColor(_);
|
||||
scatter.color(color);
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.id = function(_) {
|
||||
if (!arguments.length) return id;
|
||||
id = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.header = function(_) {
|
||||
if (!arguments.length) return header;
|
||||
header = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.noData = function(_) {
|
||||
if (!arguments.length) return noData;
|
||||
noData = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.filterZero = function(_) {
|
||||
if (!arguments.length) return filterZero;
|
||||
filterZero = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.columns = function(_) {
|
||||
if (!arguments.length) return columns;
|
||||
columns = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.tableClass = function(_) {
|
||||
if (!arguments.length) return tableClass;
|
||||
tableClass = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.iconOpen = function(_){
|
||||
if (!arguments.length) return iconOpen;
|
||||
iconOpen = _;
|
||||
return chart;
|
||||
}
|
||||
|
||||
chart.iconClose = function(_){
|
||||
if (!arguments.length) return iconClose;
|
||||
iconClose = _;
|
||||
return chart;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
|
||||
|
||||
return chart;
|
||||
nv.models.indentedTree = function() {
|
||||
"use strict";
|
||||
//============================================================
|
||||
// Public Variables with Default Settings
|
||||
//------------------------------------------------------------
|
||||
|
||||
var margin = {top: 0, right: 0, bottom: 0, left: 0} //TODO: implement, maybe as margin on the containing div
|
||||
, width = 960
|
||||
, height = 500
|
||||
, color = nv.utils.defaultColor()
|
||||
, id = Math.floor(Math.random() * 10000)
|
||||
, header = true
|
||||
, filterZero = false
|
||||
, noData = "No Data Available."
|
||||
, childIndent = 20
|
||||
, columns = [{key:'key', label: 'Name', type:'text'}] //TODO: consider functions like chart.addColumn, chart.removeColumn, instead of a block like this
|
||||
, tableClass = null
|
||||
, iconOpen = 'images/grey-plus.png' //TODO: consider removing this and replacing with a '+' or '-' unless user defines images
|
||||
, iconClose = 'images/grey-minus.png'
|
||||
, dispatch = d3.dispatch('elementClick', 'elementDblclick', 'elementMouseover', 'elementMouseout')
|
||||
, getUrl = function(d) { return d.url }
|
||||
;
|
||||
|
||||
//============================================================
|
||||
|
||||
var idx = 0;
|
||||
|
||||
function chart(selection) {
|
||||
selection.each(function(data) {
|
||||
var depth = 1,
|
||||
container = d3.select(this);
|
||||
|
||||
var tree = d3.layout.tree()
|
||||
.children(function(d) { return d.values })
|
||||
.size([height, childIndent]); //Not sure if this is needed now that the result is HTML
|
||||
|
||||
chart.update = function() { container.transition().duration(600).call(chart) };
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Display No Data message if there's nothing to show.
|
||||
if (!data[0]) data[0] = {key: noData};
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
|
||||
var nodes = tree.nodes(data[0]);
|
||||
|
||||
// nodes.map(function(d) {
|
||||
// d.id = i++;
|
||||
// })
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Setup containers and skeleton of chart
|
||||
|
||||
var wrap = d3.select(this).selectAll('div').data([[nodes]]);
|
||||
var wrapEnter = wrap.enter().append('div').attr('class', 'nvd3 nv-wrap nv-indentedtree');
|
||||
var tableEnter = wrapEnter.append('table');
|
||||
var table = wrap.select('table').attr('width', '100%').attr('class', tableClass);
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
|
||||
if (header) {
|
||||
var thead = tableEnter.append('thead');
|
||||
|
||||
var theadRow1 = thead.append('tr');
|
||||
|
||||
columns.forEach(function(column) {
|
||||
theadRow1
|
||||
.append('th')
|
||||
.attr('width', column.width ? column.width : '10%')
|
||||
.style('text-align', column.type == 'numeric' ? 'right' : 'left')
|
||||
.append('span')
|
||||
.text(column.label);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var tbody = table.selectAll('tbody')
|
||||
.data(function(d) { return d });
|
||||
tbody.enter().append('tbody');
|
||||
|
||||
|
||||
|
||||
//compute max generations
|
||||
depth = d3.max(nodes, function(node) { return node.depth });
|
||||
tree.size([height, depth * childIndent]); //TODO: see if this is necessary at all
|
||||
|
||||
|
||||
// Update the nodes…
|
||||
var node = tbody.selectAll('tr')
|
||||
// .data(function(d) { return d; }, function(d) { return d.id || (d.id == ++i)});
|
||||
.data(function(d) { return d.filter(function(d) { return (filterZero && !d.children) ? filterZero(d) : true; } )}, function(d,i) { return d.id || (d.id || ++idx)});
|
||||
//.style('display', 'table-row'); //TODO: see if this does anything
|
||||
|
||||
node.exit().remove();
|
||||
|
||||
node.select('img.nv-treeicon')
|
||||
.attr('src', icon)
|
||||
.classed('folded', folded);
|
||||
|
||||
var nodeEnter = node.enter().append('tr');
|
||||
|
||||
|
||||
columns.forEach(function(column, index) {
|
||||
|
||||
var nodeName = nodeEnter.append('td')
|
||||
.style('padding-left', function(d) { return (index ? 0 : d.depth * childIndent + 12 + (icon(d) ? 0 : 16)) + 'px' }, 'important') //TODO: check why I did the ternary here
|
||||
.style('text-align', column.type == 'numeric' ? 'right' : 'left');
|
||||
|
||||
|
||||
if (index == 0) {
|
||||
nodeName.append('img')
|
||||
.classed('nv-treeicon', true)
|
||||
.classed('nv-folded', folded)
|
||||
.attr('src', icon)
|
||||
.style('width', '14px')
|
||||
.style('height', '14px')
|
||||
.style('padding', '0 1px')
|
||||
.style('display', function(d) { return icon(d) ? 'inline-block' : 'none'; })
|
||||
.on('click', click);
|
||||
}
|
||||
|
||||
|
||||
nodeName.each(function(d) {
|
||||
if (!index && getUrl(d))
|
||||
d3.select(this)
|
||||
.append('a')
|
||||
.attr('href',getUrl)
|
||||
.attr('class', d3.functor(column.classes))
|
||||
.append('span')
|
||||
else
|
||||
d3.select(this)
|
||||
.append('span')
|
||||
|
||||
d3.select(this).select('span')
|
||||
.attr('class', d3.functor(column.classes) )
|
||||
.text(function(d) { return column.format ? column.format(d) :
|
||||
(d[column.key] || '-') });
|
||||
});
|
||||
|
||||
if (column.showCount) {
|
||||
nodeName.append('span')
|
||||
.attr('class', 'nv-childrenCount');
|
||||
|
||||
node.selectAll('span.nv-childrenCount').text(function(d) {
|
||||
return ((d.values && d.values.length) || (d._values && d._values.length)) ? //If this is a parent
|
||||
'(' + ((d.values && (d.values.filter(function(d) { return filterZero ? filterZero(d) : true; }).length)) //If children are in values check its children and filter
|
||||
|| (d._values && d._values.filter(function(d) { return filterZero ? filterZero(d) : true; }).length) //Otherwise, do the same, but with the other name, _values...
|
||||
|| 0) + ')' //This is the catch-all in case there are no children after a filter
|
||||
: '' //If this is not a parent, just give an empty string
|
||||
});
|
||||
}
|
||||
|
||||
// if (column.click)
|
||||
// nodeName.select('span').on('click', column.click);
|
||||
|
||||
});
|
||||
|
||||
node
|
||||
.order()
|
||||
.on('click', function(d) {
|
||||
dispatch.elementClick({
|
||||
row: this, //TODO: decide whether or not this should be consistent with scatter/line events or should be an html link (a href)
|
||||
data: d,
|
||||
pos: [d.x, d.y]
|
||||
});
|
||||
})
|
||||
.on('dblclick', function(d) {
|
||||
dispatch.elementDblclick({
|
||||
row: this,
|
||||
data: d,
|
||||
pos: [d.x, d.y]
|
||||
});
|
||||
})
|
||||
.on('mouseover', function(d) {
|
||||
dispatch.elementMouseover({
|
||||
row: this,
|
||||
data: d,
|
||||
pos: [d.x, d.y]
|
||||
});
|
||||
})
|
||||
.on('mouseout', function(d) {
|
||||
dispatch.elementMouseout({
|
||||
row: this,
|
||||
data: d,
|
||||
pos: [d.x, d.y]
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// Toggle children on click.
|
||||
function click(d, _, unshift) {
|
||||
d3.event.stopPropagation();
|
||||
|
||||
if(d3.event.shiftKey && !unshift) {
|
||||
//If you shift-click, it'll toggle fold all the children, instead of itself
|
||||
d3.event.shiftKey = false;
|
||||
d.values && d.values.forEach(function(node){
|
||||
if (node.values || node._values) {
|
||||
click(node, 0, true);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
if(!hasChildren(d)) {
|
||||
//download file
|
||||
//window.location.href = d.url;
|
||||
return true;
|
||||
}
|
||||
if (d.values) {
|
||||
d._values = d.values;
|
||||
d.values = null;
|
||||
} else {
|
||||
d.values = d._values;
|
||||
d._values = null;
|
||||
}
|
||||
chart.update();
|
||||
}
|
||||
|
||||
|
||||
function icon(d) {
|
||||
return (d._values && d._values.length) ? iconOpen : (d.values && d.values.length) ? iconClose : '';
|
||||
}
|
||||
|
||||
function folded(d) {
|
||||
return (d._values && d._values.length);
|
||||
}
|
||||
|
||||
function hasChildren(d) {
|
||||
var values = d.values || d._values;
|
||||
|
||||
return (values && values.length);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
return chart;
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// Expose Public Variables
|
||||
//------------------------------------------------------------
|
||||
chart.options = nv.utils.optionsFunc.bind(chart);
|
||||
|
||||
chart.margin = function(_) {
|
||||
if (!arguments.length) return margin;
|
||||
margin.top = typeof _.top != 'undefined' ? _.top : margin.top;
|
||||
margin.right = typeof _.right != 'undefined' ? _.right : margin.right;
|
||||
margin.bottom = typeof _.bottom != 'undefined' ? _.bottom : margin.bottom;
|
||||
margin.left = typeof _.left != 'undefined' ? _.left : margin.left;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.width = function(_) {
|
||||
if (!arguments.length) return width;
|
||||
width = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.height = function(_) {
|
||||
if (!arguments.length) return height;
|
||||
height = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.color = function(_) {
|
||||
if (!arguments.length) return color;
|
||||
color = nv.utils.getColor(_);
|
||||
scatter.color(color);
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.id = function(_) {
|
||||
if (!arguments.length) return id;
|
||||
id = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.header = function(_) {
|
||||
if (!arguments.length) return header;
|
||||
header = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.noData = function(_) {
|
||||
if (!arguments.length) return noData;
|
||||
noData = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.filterZero = function(_) {
|
||||
if (!arguments.length) return filterZero;
|
||||
filterZero = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.columns = function(_) {
|
||||
if (!arguments.length) return columns;
|
||||
columns = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.tableClass = function(_) {
|
||||
if (!arguments.length) return tableClass;
|
||||
tableClass = _;
|
||||
return chart;
|
||||
};
|
||||
|
||||
chart.iconOpen = function(_){
|
||||
if (!arguments.length) return iconOpen;
|
||||
iconOpen = _;
|
||||
return chart;
|
||||
}
|
||||
|
||||
chart.iconClose = function(_){
|
||||
if (!arguments.length) return iconClose;
|
||||
iconClose = _;
|
||||
return chart;
|
||||
}
|
||||
|
||||
chart.getUrl = function(_){
|
||||
if (!arguments.length) return getUrl;
|
||||
getUrl = _;
|
||||
return chart;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
|
||||
|
||||
return chart;
|
||||
};
|
@ -1,133 +1,490 @@
|
||||
/* Tooltip rendering model for nvd3 charts.
|
||||
window.nv.models.tooltip is the updated,new way to render tooltips.
|
||||
|
||||
/*****
|
||||
* A no-frills tooltip implementation.
|
||||
*****/
|
||||
window.nv.tooltip.show is the old tooltip code.
|
||||
window.nv.tooltip.* also has various helper methods.
|
||||
*/
|
||||
(function() {
|
||||
"use strict";
|
||||
window.nv.tooltip = {};
|
||||
|
||||
/* Model which can be instantiated to handle tooltip rendering.
|
||||
Example usage:
|
||||
var tip = nv.models.tooltip().gravity('w').distance(23)
|
||||
.data(myDataObject);
|
||||
|
||||
(function() {
|
||||
tip(); //just invoke the returned function to render tooltip.
|
||||
*/
|
||||
window.nv.models.tooltip = function() {
|
||||
var content = null //HTML contents of the tooltip. If null, the content is generated via the data variable.
|
||||
, data = null /* Tooltip data. If data is given in the proper format, a consistent tooltip is generated.
|
||||
Format of data:
|
||||
{
|
||||
key: "Date",
|
||||
value: "August 2009",
|
||||
series: [
|
||||
{
|
||||
key: "Series 1",
|
||||
value: "Value 1",
|
||||
color: "#000"
|
||||
},
|
||||
{
|
||||
key: "Series 2",
|
||||
value: "Value 2",
|
||||
color: "#00f"
|
||||
}
|
||||
]
|
||||
|
||||
var nvtooltip = window.nv.tooltip = {};
|
||||
}
|
||||
|
||||
nvtooltip.show = function(pos, content, gravity, dist, parentContainer, classes) {
|
||||
*/
|
||||
, gravity = 'w' //Can be 'n','s','e','w'. Determines how tooltip is positioned.
|
||||
, distance = 50 //Distance to offset tooltip from the mouse location.
|
||||
, snapDistance = 25 //Tolerance allowed before tooltip is moved from its current position (creates 'snapping' effect)
|
||||
, fixedTop = null //If not null, this fixes the top position of the tooltip.
|
||||
, classes = null //Attaches additional CSS classes to the tooltip DIV that is created.
|
||||
, chartContainer = null //Parent DIV, of the SVG Container that holds the chart.
|
||||
, tooltipElem = null //actual DOM element representing the tooltip.
|
||||
, position = {left: null, top: null} //Relative position of the tooltip inside chartContainer.
|
||||
, enabled = true //True -> tooltips are rendered. False -> don't render tooltips.
|
||||
//Generates a unique id when you create a new tooltip() object
|
||||
, id = "nvtooltip-" + Math.floor(Math.random() * 100000)
|
||||
;
|
||||
|
||||
var container = document.createElement('div');
|
||||
container.className = 'nvtooltip ' + (classes ? classes : 'xy-tooltip');
|
||||
//CSS class to specify whether element should not have mouse events.
|
||||
var nvPointerEventsClass = "nv-pointer-events-none";
|
||||
|
||||
//Format function for the tooltip values column
|
||||
var valueFormatter = function(d,i) {
|
||||
return d;
|
||||
};
|
||||
|
||||
//Format function for the tooltip header value.
|
||||
var headerFormatter = function(d) {
|
||||
return d;
|
||||
};
|
||||
|
||||
//By default, the tooltip model renders a beautiful table inside a DIV.
|
||||
//You can override this function if a custom tooltip is desired.
|
||||
var contentGenerator = function(d) {
|
||||
if (content != null) return content;
|
||||
|
||||
if (d == null) return '';
|
||||
|
||||
var table = d3.select(document.createElement("table"));
|
||||
var theadEnter = table.selectAll("thead")
|
||||
.data([d])
|
||||
.enter().append("thead");
|
||||
theadEnter.append("tr")
|
||||
.append("td")
|
||||
.attr("colspan",3)
|
||||
.append("strong")
|
||||
.classed("x-value",true)
|
||||
.html(headerFormatter(d.value));
|
||||
|
||||
var tbodyEnter = table.selectAll("tbody")
|
||||
.data([d])
|
||||
.enter().append("tbody");
|
||||
var trowEnter = tbodyEnter.selectAll("tr")
|
||||
.data(function(p) { return p.series})
|
||||
.enter()
|
||||
.append("tr")
|
||||
.classed("highlight", function(p) { return p.highlight})
|
||||
;
|
||||
|
||||
trowEnter.append("td")
|
||||
.classed("legend-color-guide",true)
|
||||
.append("div")
|
||||
.style("background-color", function(p) { return p.color});
|
||||
trowEnter.append("td")
|
||||
.classed("key",true)
|
||||
.html(function(p) {return p.key});
|
||||
trowEnter.append("td")
|
||||
.classed("value",true)
|
||||
.html(function(p,i) { return valueFormatter(p.value,i) });
|
||||
|
||||
|
||||
trowEnter.selectAll("td").each(function(p) {
|
||||
if (p.highlight) {
|
||||
var opacityScale = d3.scale.linear().domain([0,1]).range(["#fff",p.color]);
|
||||
var opacity = 0.6;
|
||||
d3.select(this)
|
||||
.style("border-bottom-color", opacityScale(opacity))
|
||||
.style("border-top-color", opacityScale(opacity))
|
||||
;
|
||||
}
|
||||
});
|
||||
|
||||
var html = table.node().outerHTML;
|
||||
if (d.footer !== undefined)
|
||||
html += "<div class='footer'>" + d.footer + "</div>";
|
||||
return html;
|
||||
|
||||
};
|
||||
|
||||
var dataSeriesExists = function(d) {
|
||||
if (d && d.series && d.series.length > 0) return true;
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
//In situations where the chart is in a 'viewBox', re-position the tooltip based on how far chart is zoomed.
|
||||
function convertViewBoxRatio() {
|
||||
if (chartContainer) {
|
||||
var svg = d3.select(chartContainer);
|
||||
if (svg.node().tagName !== "svg") {
|
||||
svg = svg.select("svg");
|
||||
}
|
||||
var viewBox = (svg.node()) ? svg.attr('viewBox') : null;
|
||||
if (viewBox) {
|
||||
viewBox = viewBox.split(' ');
|
||||
var ratio = parseInt(svg.style('width')) / viewBox[2];
|
||||
|
||||
position.left = position.left * ratio;
|
||||
position.top = position.top * ratio;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Creates new tooltip container, or uses existing one on DOM.
|
||||
function getTooltipContainer(newContent) {
|
||||
var body;
|
||||
if (chartContainer)
|
||||
body = d3.select(chartContainer);
|
||||
else
|
||||
body = d3.select("body");
|
||||
|
||||
gravity = gravity || 's';
|
||||
dist = dist || 20;
|
||||
|
||||
var body = parentContainer;
|
||||
if ( !parentContainer || parentContainer.tagName.match(/g|svg/i)) {
|
||||
//If the parent element is an SVG element, place tooltip in the <body> element.
|
||||
body = document.getElementsByTagName('body')[0];
|
||||
}
|
||||
|
||||
container.innerHTML = content;
|
||||
container.style.left = 0;
|
||||
container.style.top = 0;
|
||||
container.style.opacity = 0;
|
||||
|
||||
body.appendChild(container);
|
||||
|
||||
var height = parseInt(container.offsetHeight),
|
||||
width = parseInt(container.offsetWidth),
|
||||
windowWidth = nv.utils.windowSize().width,
|
||||
windowHeight = nv.utils.windowSize().height,
|
||||
scrollTop = window.scrollY,
|
||||
scrollLeft = window.scrollX,
|
||||
left, top;
|
||||
|
||||
windowHeight = window.innerWidth >= document.body.scrollWidth ? windowHeight : windowHeight - 16;
|
||||
windowWidth = window.innerHeight >= document.body.scrollHeight ? windowWidth : windowWidth - 16;
|
||||
|
||||
var tooltipTop = function ( Elem ) {
|
||||
var offsetTop = top;
|
||||
do {
|
||||
if( !isNaN( Elem.offsetTop ) ) {
|
||||
offsetTop += (Elem.offsetTop);
|
||||
var container = body.select(".nvtooltip");
|
||||
if (container.node() === null) {
|
||||
//Create new tooltip div if it doesn't exist on DOM.
|
||||
container = body.append("div")
|
||||
.attr("class", "nvtooltip " + (classes? classes: "xy-tooltip"))
|
||||
.attr("id",id)
|
||||
;
|
||||
}
|
||||
} while( Elem = Elem.offsetParent );
|
||||
return offsetTop;
|
||||
}
|
||||
|
||||
var tooltipLeft = function ( Elem ) {
|
||||
var offsetLeft = left;
|
||||
do {
|
||||
if( !isNaN( Elem.offsetLeft ) ) {
|
||||
offsetLeft += (Elem.offsetLeft);
|
||||
|
||||
|
||||
container.node().innerHTML = newContent;
|
||||
container.style("top",0).style("left",0).style("opacity",0);
|
||||
container.selectAll("div, table, td, tr").classed(nvPointerEventsClass,true)
|
||||
container.classed(nvPointerEventsClass,true);
|
||||
return container.node();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Draw the tooltip onto the DOM.
|
||||
function nvtooltip() {
|
||||
if (!enabled) return;
|
||||
if (!dataSeriesExists(data)) return;
|
||||
|
||||
convertViewBoxRatio();
|
||||
|
||||
var left = position.left;
|
||||
var top = (fixedTop != null) ? fixedTop : position.top;
|
||||
var container = getTooltipContainer(contentGenerator(data));
|
||||
tooltipElem = container;
|
||||
if (chartContainer) {
|
||||
var svgComp = chartContainer.getElementsByTagName("svg")[0];
|
||||
var boundRect = (svgComp) ? svgComp.getBoundingClientRect() : chartContainer.getBoundingClientRect();
|
||||
var svgOffset = {left:0,top:0};
|
||||
if (svgComp) {
|
||||
var svgBound = svgComp.getBoundingClientRect();
|
||||
var chartBound = chartContainer.getBoundingClientRect();
|
||||
var svgBoundTop = svgBound.top;
|
||||
|
||||
//Defensive code. Sometimes, svgBoundTop can be a really negative
|
||||
// number, like -134254. That's a bug.
|
||||
// If such a number is found, use zero instead. FireFox bug only
|
||||
if (svgBoundTop < 0) {
|
||||
var containerBound = chartContainer.getBoundingClientRect();
|
||||
svgBoundTop = (Math.abs(svgBoundTop) > containerBound.height) ? 0 : svgBoundTop;
|
||||
}
|
||||
svgOffset.top = Math.abs(svgBoundTop - chartBound.top);
|
||||
svgOffset.left = Math.abs(svgBound.left - chartBound.left);
|
||||
}
|
||||
//If the parent container is an overflow <div> with scrollbars, subtract the scroll offsets.
|
||||
//You need to also add any offset between the <svg> element and its containing <div>
|
||||
//Finally, add any offset of the containing <div> on the whole page.
|
||||
left += chartContainer.offsetLeft + svgOffset.left - 2*chartContainer.scrollLeft;
|
||||
top += chartContainer.offsetTop + svgOffset.top - 2*chartContainer.scrollTop;
|
||||
}
|
||||
|
||||
if (snapDistance && snapDistance > 0) {
|
||||
top = Math.floor(top/snapDistance) * snapDistance;
|
||||
}
|
||||
} while( Elem = Elem.offsetParent );
|
||||
return offsetLeft;
|
||||
}
|
||||
|
||||
switch (gravity) {
|
||||
case 'e':
|
||||
left = pos[0] - width - dist;
|
||||
top = pos[1] - (height / 2);
|
||||
var tLeft = tooltipLeft(container);
|
||||
var tTop = tooltipTop(container);
|
||||
if (tLeft < scrollLeft) left = pos[0] + dist > scrollLeft ? pos[0] + dist : scrollLeft - tLeft + left;
|
||||
if (tTop < scrollTop) top = scrollTop - tTop + top;
|
||||
if (tTop + height > scrollTop + windowHeight) top = scrollTop + windowHeight - tTop + top - height;
|
||||
break;
|
||||
case 'w':
|
||||
left = pos[0] + dist;
|
||||
top = pos[1] - (height / 2);
|
||||
if (tLeft + width > windowWidth) left = pos[0] - width - dist;
|
||||
if (tTop < scrollTop) top = scrollTop + 5;
|
||||
if (tTop + height > scrollTop + windowHeight) top = scrollTop - height - 5;
|
||||
break;
|
||||
case 'n':
|
||||
left = pos[0] - (width / 2) - 5;
|
||||
top = pos[1] + dist;
|
||||
var tLeft = tooltipLeft(container);
|
||||
var tTop = tooltipTop(container);
|
||||
if (tLeft < scrollLeft) left = scrollLeft + 5;
|
||||
if (tLeft + width > windowWidth) left = left - width/2 + 5;
|
||||
if (tTop + height > scrollTop + windowHeight) top = scrollTop + windowHeight - tTop + top - height;
|
||||
break;
|
||||
case 's':
|
||||
left = pos[0] - (width / 2);
|
||||
top = pos[1] - height - dist;
|
||||
var tLeft = tooltipLeft(container);
|
||||
var tTop = tooltipTop(container);
|
||||
if (tLeft < scrollLeft) left = scrollLeft + 5;
|
||||
if (tLeft + width > windowWidth) left = left - width/2 + 5;
|
||||
if (scrollTop > tTop) top = scrollTop;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
container.style.left = left+'px';
|
||||
container.style.top = top+'px';
|
||||
container.style.opacity = 1;
|
||||
container.style.position = 'absolute'; //fix scroll bar issue
|
||||
container.style.pointerEvents = 'none'; //fix scroll bar issue
|
||||
|
||||
return container;
|
||||
|
||||
nv.tooltip.calcTooltipPosition([left,top], gravity, distance, container);
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.nvPointerEventsClass = nvPointerEventsClass;
|
||||
|
||||
nvtooltip.content = function(_) {
|
||||
if (!arguments.length) return content;
|
||||
content = _;
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
//Returns tooltipElem...not able to set it.
|
||||
nvtooltip.tooltipElem = function() {
|
||||
return tooltipElem;
|
||||
};
|
||||
|
||||
nvtooltip.contentGenerator = function(_) {
|
||||
if (!arguments.length) return contentGenerator;
|
||||
if (typeof _ === 'function') {
|
||||
contentGenerator = _;
|
||||
}
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.data = function(_) {
|
||||
if (!arguments.length) return data;
|
||||
data = _;
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.gravity = function(_) {
|
||||
if (!arguments.length) return gravity;
|
||||
gravity = _;
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.distance = function(_) {
|
||||
if (!arguments.length) return distance;
|
||||
distance = _;
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.snapDistance = function(_) {
|
||||
if (!arguments.length) return snapDistance;
|
||||
snapDistance = _;
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.classes = function(_) {
|
||||
if (!arguments.length) return classes;
|
||||
classes = _;
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.chartContainer = function(_) {
|
||||
if (!arguments.length) return chartContainer;
|
||||
chartContainer = _;
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.position = function(_) {
|
||||
if (!arguments.length) return position;
|
||||
position.left = (typeof _.left !== 'undefined') ? _.left : position.left;
|
||||
position.top = (typeof _.top !== 'undefined') ? _.top : position.top;
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.fixedTop = function(_) {
|
||||
if (!arguments.length) return fixedTop;
|
||||
fixedTop = _;
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.enabled = function(_) {
|
||||
if (!arguments.length) return enabled;
|
||||
enabled = _;
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.valueFormatter = function(_) {
|
||||
if (!arguments.length) return valueFormatter;
|
||||
if (typeof _ === 'function') {
|
||||
valueFormatter = _;
|
||||
}
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.headerFormatter = function(_) {
|
||||
if (!arguments.length) return headerFormatter;
|
||||
if (typeof _ === 'function') {
|
||||
headerFormatter = _;
|
||||
}
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
//id() is a read-only function. You can't use it to set the id.
|
||||
nvtooltip.id = function() {
|
||||
return id;
|
||||
};
|
||||
|
||||
|
||||
return nvtooltip;
|
||||
};
|
||||
|
||||
nvtooltip.cleanup = function() {
|
||||
|
||||
// Find the tooltips, mark them for removal by this class (so others cleanups won't find it)
|
||||
var tooltips = document.getElementsByClassName('nvtooltip');
|
||||
var purging = [];
|
||||
while(tooltips.length) {
|
||||
purging.push(tooltips[0]);
|
||||
tooltips[0].style.transitionDelay = '0 !important';
|
||||
tooltips[0].style.opacity = 0;
|
||||
tooltips[0].className = 'nvtooltip-pending-removal';
|
||||
}
|
||||
//Original tooltip.show function. Kept for backward compatibility.
|
||||
// pos = [left,top]
|
||||
nv.tooltip.show = function(pos, content, gravity, dist, parentContainer, classes) {
|
||||
|
||||
//Create new tooltip div if it doesn't exist on DOM.
|
||||
var container = document.createElement('div');
|
||||
container.className = 'nvtooltip ' + (classes ? classes : 'xy-tooltip');
|
||||
|
||||
var body = parentContainer;
|
||||
if ( !parentContainer || parentContainer.tagName.match(/g|svg/i)) {
|
||||
//If the parent element is an SVG element, place tooltip in the <body> element.
|
||||
body = document.getElementsByTagName('body')[0];
|
||||
}
|
||||
|
||||
container.style.left = 0;
|
||||
container.style.top = 0;
|
||||
container.style.opacity = 0;
|
||||
container.innerHTML = content;
|
||||
body.appendChild(container);
|
||||
|
||||
//If the parent container is an overflow <div> with scrollbars, subtract the scroll offsets.
|
||||
if (parentContainer) {
|
||||
pos[0] = pos[0] - parentContainer.scrollLeft;
|
||||
pos[1] = pos[1] - parentContainer.scrollTop;
|
||||
}
|
||||
nv.tooltip.calcTooltipPosition(pos, gravity, dist, container);
|
||||
};
|
||||
|
||||
setTimeout(function() {
|
||||
//Looks up the ancestry of a DOM element, and returns the first NON-svg node.
|
||||
nv.tooltip.findFirstNonSVGParent = function(Elem) {
|
||||
while(Elem.tagName.match(/^g|svg$/i) !== null) {
|
||||
Elem = Elem.parentNode;
|
||||
}
|
||||
return Elem;
|
||||
};
|
||||
|
||||
while (purging.length) {
|
||||
var removeMe = purging.pop();
|
||||
removeMe.parentNode.removeChild(removeMe);
|
||||
}
|
||||
}, 500);
|
||||
//Finds the total offsetTop of a given DOM element.
|
||||
//Looks up the entire ancestry of an element, up to the first relatively positioned element.
|
||||
nv.tooltip.findTotalOffsetTop = function ( Elem, initialTop ) {
|
||||
var offsetTop = initialTop;
|
||||
|
||||
do {
|
||||
if( !isNaN( Elem.offsetTop ) ) {
|
||||
offsetTop += (Elem.offsetTop);
|
||||
}
|
||||
} while( Elem = Elem.offsetParent );
|
||||
return offsetTop;
|
||||
};
|
||||
|
||||
//Finds the total offsetLeft of a given DOM element.
|
||||
//Looks up the entire ancestry of an element, up to the first relatively positioned element.
|
||||
nv.tooltip.findTotalOffsetLeft = function ( Elem, initialLeft) {
|
||||
var offsetLeft = initialLeft;
|
||||
|
||||
do {
|
||||
if( !isNaN( Elem.offsetLeft ) ) {
|
||||
offsetLeft += (Elem.offsetLeft);
|
||||
}
|
||||
} while( Elem = Elem.offsetParent );
|
||||
return offsetLeft;
|
||||
};
|
||||
|
||||
//Global utility function to render a tooltip on the DOM.
|
||||
//pos = [left,top] coordinates of where to place the tooltip, relative to the SVG chart container.
|
||||
//gravity = how to orient the tooltip
|
||||
//dist = how far away from the mouse to place tooltip
|
||||
//container = tooltip DIV
|
||||
nv.tooltip.calcTooltipPosition = function(pos, gravity, dist, container) {
|
||||
|
||||
var height = parseInt(container.offsetHeight),
|
||||
width = parseInt(container.offsetWidth),
|
||||
windowWidth = nv.utils.windowSize().width,
|
||||
windowHeight = nv.utils.windowSize().height,
|
||||
scrollTop = window.pageYOffset,
|
||||
scrollLeft = window.pageXOffset,
|
||||
left, top;
|
||||
|
||||
windowHeight = window.innerWidth >= document.body.scrollWidth ? windowHeight : windowHeight - 16;
|
||||
windowWidth = window.innerHeight >= document.body.scrollHeight ? windowWidth : windowWidth - 16;
|
||||
|
||||
gravity = gravity || 's';
|
||||
dist = dist || 20;
|
||||
|
||||
var tooltipTop = function ( Elem ) {
|
||||
return nv.tooltip.findTotalOffsetTop(Elem, top);
|
||||
};
|
||||
|
||||
var tooltipLeft = function ( Elem ) {
|
||||
return nv.tooltip.findTotalOffsetLeft(Elem,left);
|
||||
};
|
||||
|
||||
switch (gravity) {
|
||||
case 'e':
|
||||
left = pos[0] - width - dist;
|
||||
top = pos[1] - (height / 2);
|
||||
var tLeft = tooltipLeft(container);
|
||||
var tTop = tooltipTop(container);
|
||||
if (tLeft < scrollLeft) left = pos[0] + dist > scrollLeft ? pos[0] + dist : scrollLeft - tLeft + left;
|
||||
if (tTop < scrollTop) top = scrollTop - tTop + top;
|
||||
if (tTop + height > scrollTop + windowHeight) top = scrollTop + windowHeight - tTop + top - height;
|
||||
break;
|
||||
case 'w':
|
||||
left = pos[0] + dist;
|
||||
top = pos[1] - (height / 2);
|
||||
var tLeft = tooltipLeft(container);
|
||||
var tTop = tooltipTop(container);
|
||||
if (tLeft + width > windowWidth) left = pos[0] - width - dist;
|
||||
if (tTop < scrollTop) top = scrollTop + 5;
|
||||
if (tTop + height > scrollTop + windowHeight) top = scrollTop + windowHeight - tTop + top - height;
|
||||
break;
|
||||
case 'n':
|
||||
left = pos[0] - (width / 2) - 5;
|
||||
top = pos[1] + dist;
|
||||
var tLeft = tooltipLeft(container);
|
||||
var tTop = tooltipTop(container);
|
||||
if (tLeft < scrollLeft) left = scrollLeft + 5;
|
||||
if (tLeft + width > windowWidth) left = left - width/2 + 5;
|
||||
if (tTop + height > scrollTop + windowHeight) top = scrollTop + windowHeight - tTop + top - height;
|
||||
break;
|
||||
case 's':
|
||||
left = pos[0] - (width / 2);
|
||||
top = pos[1] - height - dist;
|
||||
var tLeft = tooltipLeft(container);
|
||||
var tTop = tooltipTop(container);
|
||||
if (tLeft < scrollLeft) left = scrollLeft + 5;
|
||||
if (tLeft + width > windowWidth) left = left - width/2 + 5;
|
||||
if (scrollTop > tTop) top = scrollTop;
|
||||
break;
|
||||
case 'none':
|
||||
left = pos[0];
|
||||
top = pos[1] - dist;
|
||||
var tLeft = tooltipLeft(container);
|
||||
var tTop = tooltipTop(container);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
container.style.left = left+'px';
|
||||
container.style.top = top+'px';
|
||||
container.style.opacity = 1;
|
||||
container.style.position = 'absolute';
|
||||
|
||||
return container;
|
||||
};
|
||||
|
||||
//Global utility function to remove tooltips from the DOM.
|
||||
nv.tooltip.cleanup = function() {
|
||||
|
||||
// Find the tooltips, mark them for removal by this class (so others cleanups won't find it)
|
||||
var tooltips = document.getElementsByClassName('nvtooltip');
|
||||
var purging = [];
|
||||
while(tooltips.length) {
|
||||
purging.push(tooltips[0]);
|
||||
tooltips[0].style.transitionDelay = '0 !important';
|
||||
tooltips[0].style.opacity = 0;
|
||||
tooltips[0].className = 'nvtooltip-pending-removal';
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
|
||||
while (purging.length) {
|
||||
var removeMe = purging.pop();
|
||||
removeMe.parentNode.removeChild(removeMe);
|
||||
}
|
||||
}, 500);
|
||||
};
|
||||
|
||||
})();
|
||||
|
@ -0,0 +1,256 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
|
||||
<link href="teststyle.css" rel="stylesheet" type='text/css'>
|
||||
|
||||
<body>
|
||||
<div style='position:relative;' class='with-transitions'>
|
||||
<h3>Scatter chart tests</h3>
|
||||
<div class='navigation'>
|
||||
Tests:
|
||||
<a href="lineChartTest.html">Line Chart</a>
|
||||
<a href="stackedAreaChartTest.html">Stacked Area</a>
|
||||
<a href="../examples/cumulativeLineChart.html">Cumulative Line</a>
|
||||
<a href="ScatterChartTest.html">Scatter</a>
|
||||
<a href="interactiveBisectTest.html">nv.interactiveBisect unit tests</a>
|
||||
</div>
|
||||
<div id="test1" class="chart third">
|
||||
Normal - four series', all random (40 points)
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test2" class="chart third">
|
||||
Normal - one series', all random (5 points), zero left margin
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test3" class="chart third">
|
||||
Zero right margin, 200 points
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test4" class="chart third">
|
||||
Bigger margins
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test5" class="chart third">
|
||||
Zero data points
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test6" class="chart third">
|
||||
One point.
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test7" class="chart third">
|
||||
Two points
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test8" class="chart third">
|
||||
Three series', one point each
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test9" class="chart third">
|
||||
Three series', first one has zero points
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test10" class="chart third">
|
||||
Lots of series
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test11" class="chart third">
|
||||
Scatter plus line: y=2x + 0
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test12" class="chart third">
|
||||
Scatter plus line: y=2x + 10;
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test13" class="chart third">
|
||||
Scatter plus line: y=-0.5x + 1.0;
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test14" class="chart third">
|
||||
Scatter chart: duplicate y values
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test15" class="chart third">
|
||||
Scatter chart: duplicate x values
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div id="test16" class="chart third">
|
||||
Scatter chart: extremely small data points (1e-10)
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../lib/d3.v3.js"></script>
|
||||
<!--<script src="../lib/fisheye.js"></script>-->
|
||||
<script src="../nv.d3.js"></script>
|
||||
<script src="../src/tooltip.js"></script>
|
||||
<script src="../src/utils.js"></script>
|
||||
<script src="../src/models/legend.js"></script>
|
||||
<script src="../src/models/axis.js"></script>
|
||||
<script src="../src/models/distribution.js"></script>
|
||||
<script src="../src/models/scatter.js"></script>
|
||||
<script src="../src/models/scatterChart.js"></script>
|
||||
<script src="../src/models/scatterPlusLineChart.js"></script>
|
||||
<script src="testScript.js"></script>
|
||||
<script>
|
||||
|
||||
defaultChartTest("test1", randomData(4,40));
|
||||
defaultChartTest("test2", randomData(1,5), {left:0});
|
||||
defaultChartTest("test3", randomData(2,200), {right: 0});
|
||||
defaultChartTest("test4", randomData(2, 8), {top:40, right: 90, bottom: 150, left: 150});
|
||||
defaultChartTest("test5", randomData(0,0));
|
||||
defaultChartTest("test6", randomData(1,1));
|
||||
defaultChartTest("test7", randomData(1,2));
|
||||
defaultChartTest("test8", randomData(3,1));
|
||||
defaultChartTest("test9", [
|
||||
{key: "Group 0", values: []},
|
||||
{key: "Group 1", values: [{x:1, y:1}]}
|
||||
]);
|
||||
|
||||
defaultChartTest("test10", randomData(30,2));
|
||||
|
||||
scatterPlusLineTest("test11", randomDataSloped(2,0));
|
||||
scatterPlusLineTest("test12", randomDataSloped(2,10));
|
||||
scatterPlusLineTest("test13", randomDataSloped(-0.5,1));
|
||||
defaultChartTest("test14", [
|
||||
{key: "Duplicate Y",
|
||||
values: [
|
||||
{x: 0, y: 10}, {x:1, y:10},{x:2, y:10},{x:3, y:10}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
||||
defaultChartTest("test15",[
|
||||
{key: "Duplicate X",
|
||||
area: true,
|
||||
values: [
|
||||
{x: 4, y: 10},
|
||||
{x: 4, y: 11},
|
||||
{x: 4, y: 12},
|
||||
{x: 4, y: 13}
|
||||
]
|
||||
}
|
||||
]);
|
||||
|
||||
defaultChartTest("test16",tinyPoints());
|
||||
|
||||
function defaultChartTest(container, data, margin) {
|
||||
nv.addGraph(function() {
|
||||
var chart;
|
||||
chart = nv.models.scatterChart()
|
||||
.showDistX(true).showDistY(true)
|
||||
;
|
||||
chart.xAxis.tickFormat(d3.format('.02f'));
|
||||
chart.yAxis.tickFormat(d3.format('.02f'));
|
||||
if (margin) {
|
||||
chart.margin(margin);
|
||||
}
|
||||
chart.tooltipContent(function(key) {
|
||||
return "<h3>" + key + "</h3>";
|
||||
});
|
||||
d3.select('#' + container + ' svg').datum(data).transition().duration(500).call(chart);
|
||||
nv.utils.windowResize(chart.update);
|
||||
return chart;
|
||||
});
|
||||
}
|
||||
|
||||
function scatterPlusLineTest(container, data) {
|
||||
nv.addGraph(function() {
|
||||
var chart;
|
||||
chart = nv.models.scatterPlusLineChart()
|
||||
.showDistX(true).showDistY(true);
|
||||
chart.xAxis.tickFormat(d3.format('.02f'));
|
||||
chart.yAxis.tickFormat(d3.format('.02f'));
|
||||
chart.tooltipContent(function(key) {
|
||||
return "<h3>" + key + "</h3>";
|
||||
});
|
||||
d3.select('#' + container + ' svg').datum(data).transition().duration(500).call(chart);
|
||||
nv.utils.windowResize(chart.update);
|
||||
return chart;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function randomData(groups, points) { //# groups,# points per group
|
||||
var data = [],
|
||||
shapes = ['circle', 'cross', 'triangle-up', 'triangle-down', 'diamond', 'square'],
|
||||
random = d3.random.normal();
|
||||
|
||||
for (i = 0; i < groups; i++) {
|
||||
data.push({
|
||||
key: 'Group ' + i,
|
||||
values: []
|
||||
});
|
||||
|
||||
for (j = 0; j < points; j++) {
|
||||
data[i].values.push({
|
||||
x: random(),
|
||||
y: random(),
|
||||
size: Math.random(),
|
||||
shape: shapes[j % 6]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
function randomDataSloped(slope,intercept) { //# groups,# points per group
|
||||
var data = [],
|
||||
shapes = ['circle', 'cross', 'triangle-up', 'triangle-down', 'diamond', 'square'],
|
||||
random = d3.random.normal();
|
||||
|
||||
var groups = 2, points = 10;
|
||||
for (i = 0; i < groups; i++) {
|
||||
data.push({
|
||||
key: 'Group ' + i,
|
||||
values: [],
|
||||
slope: slope,
|
||||
intercept: intercept
|
||||
});
|
||||
|
||||
for (j = 0; j < points; j++) {
|
||||
data[i].values.push({
|
||||
x: random(),
|
||||
y: random(),
|
||||
size: Math.random(),
|
||||
shape: shapes[j % 6]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
function tinyPoints() {
|
||||
var rval = {key: "Tiny points", values: []};
|
||||
for(var i =1; i < 20; i++) {
|
||||
rval.values.push({
|
||||
x: Math.random() * 1e-10,
|
||||
y: Math.random() * 1e-10
|
||||
});
|
||||
}
|
||||
return [rval];
|
||||
}
|
||||
</script>
|
@ -0,0 +1,158 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
|
||||
<link href="teststyle.css" rel="stylesheet" type='text/css'>
|
||||
|
||||
<body>
|
||||
<h3>Unit tests for nv.interactiveBisect - this function is important for rendering tooltips and the guideline on charts.</h3>
|
||||
<div class='navigation'>
|
||||
Tests:
|
||||
<a href="lineChartTest.html">Line Chart</a>
|
||||
<a href="stackedAreaChartTest.html">Stacked Area</a>
|
||||
<a href="../examples/cumulativeLineChart.html">Cumulative Line</a>
|
||||
</div>
|
||||
|
||||
<script src="../lib/d3.v3.js"></script>
|
||||
<script src="../nv.d3.js"></script>
|
||||
<script src="../src/interactiveLayer.js"></script>
|
||||
|
||||
<script>
|
||||
function runTest(description, dataArray, searchVal, expectedResult, xAccessor) {
|
||||
var result = nv.interactiveBisect(dataArray, searchVal, xAccessor);
|
||||
var content = "";
|
||||
if (result === expectedResult) {
|
||||
content = "PASSED: " + description;
|
||||
}
|
||||
else {
|
||||
content = "FAILED: " + description;
|
||||
}
|
||||
|
||||
var node = document.createElement("div");
|
||||
node.innerHTML = content;
|
||||
document.getElementsByTagName("body")[0].appendChild(node);
|
||||
}
|
||||
|
||||
var x = function(d) {return d;};
|
||||
|
||||
runTest("Basic test",
|
||||
[0,1,2,3,4,5],
|
||||
3,
|
||||
3,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Basic test - zero bound",
|
||||
[0,1,2,3,4,5],
|
||||
0,
|
||||
0,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Basic test - length bound",
|
||||
[0,1,2,3,4,5],
|
||||
5,
|
||||
5,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Basic test - negative number",
|
||||
[0,1,2,3,4,5],
|
||||
-4,
|
||||
0,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Basic test - past the end",
|
||||
[0,1,2,3,4,5],
|
||||
10,
|
||||
5,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Floating point number",
|
||||
[0,1,2,3,4,5],
|
||||
0.34,
|
||||
0,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Floating point number part 2",
|
||||
[0,1,2,3,4,5],
|
||||
1.50001,
|
||||
2,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Fibonacci - existing item search",
|
||||
[0,1,1,2,3,5,8,13,21,34],
|
||||
8,
|
||||
6,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Fibonacci - inbetween item (left)",
|
||||
[0,1,1,2,3,5,8,13,21,34],
|
||||
15,
|
||||
7,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Fibonacci - inbetween item (right)",
|
||||
[0,1,1,2,3,5,8,13,21,34],
|
||||
20,
|
||||
8,
|
||||
x
|
||||
);
|
||||
|
||||
x = function(d,i) { return i};
|
||||
|
||||
runTest("xAccessor is index mode - existing item",
|
||||
[0,1,1,2,3,5,8,13,21,34],
|
||||
7,
|
||||
7,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("xAccessor is index mode - inbetween item",
|
||||
[0,1,1,2,3,5,8,13,21,34],
|
||||
7.3,
|
||||
7,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("xAccessor is index mode - inbetween item part 2",
|
||||
[0,1,1,2,3,5,8,13,21,34],
|
||||
7.500001,
|
||||
8,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Empty array",
|
||||
[],
|
||||
4,
|
||||
0,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Single element array",
|
||||
[0],
|
||||
0,
|
||||
0,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Single element array - negative bound",
|
||||
[0],
|
||||
-10,
|
||||
0,
|
||||
x
|
||||
);
|
||||
|
||||
runTest("Single element array - past the end",
|
||||
[0],
|
||||
1,
|
||||
0,
|
||||
x
|
||||
);
|
||||
</script>
|
@ -0,0 +1,475 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
|
||||
<link href="teststyle.css" rel="stylesheet" type='text/css'>
|
||||
<style>
|
||||
#chart13, #chart14 {
|
||||
overflow: scroll;
|
||||
width: 500px;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
#chart13 svg, #chart14 svg {
|
||||
width: 700px;
|
||||
height: 400px;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<h3>Line chart test cases - feel free to add more tests</h3>
|
||||
<div style='position:relative;'>
|
||||
<div class='navigation'>
|
||||
Tests:
|
||||
<a href="lineChartTest.html">Line Chart</a>
|
||||
<a href="stackedAreaChartTest.html">Stacked Area</a>
|
||||
<a href="../examples/cumulativeLineChart.html">Cumulative Line</a>
|
||||
<a href="ScatterChartTest.html">Scatter</a>
|
||||
<a href="pieChartTest.html">Pie chart</a>
|
||||
<a href="realTimeChartTest.html">Real time test</a>
|
||||
<a href="polylinearTest.html">Polylinear test</a>
|
||||
<a href="interactiveBisectTest.html">nv.interactiveBisect unit tests</a>
|
||||
</div>
|
||||
<div class='chart full' id='chart1'>
|
||||
Example of chart with many series', and new interactive guideline plus tooltip. A chunk of data was purposely removed
|
||||
to show how the chart handles it.
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart half with-transitions' id='chart2'>
|
||||
Chart with old tooltip style (with-transitions).
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart half' id='chart3'>
|
||||
Chart with three data points.
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart third' id='chart4'>
|
||||
Chart where two series have different number of points.
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart third' id='chart5'>
|
||||
Chart with one point.
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart third' id='chart6'>
|
||||
Chart with 1000 points.
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='chart third' id='chart7'>
|
||||
Chart with no data.
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart third' id='chart8'>
|
||||
All points random. No order.
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart third' id='chart9'>
|
||||
Points do not increase linearly.
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='chart third' id='chart10'>
|
||||
Chart with 15 series'
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart third' id='chart11'>
|
||||
Data points go backwards
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart third' id='chart12'>
|
||||
Duplicate X coordinate points.
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='chart third' id='chart16'>
|
||||
Duplicate Y coordinate points.
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='chart third' id='chart13'>
|
||||
Chart in a overflow div with scrolls (new tooltips)
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='chart third' id='chart14'>
|
||||
Chart in a overflow div with scrolls (old tooltips)
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div style='clear:both;'></div>
|
||||
<div class='chart third' id='chart15'>
|
||||
What if there are null, Infinity and NaN values in points?
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart third' id='chart17'>
|
||||
Chart with very small, 1e-10, points (old tooltips)
|
||||
<button>Select chart</button>
|
||||
<svg></svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../lib/d3.v3.js"></script>
|
||||
<script src="../nv.d3.js"></script>
|
||||
<script src="../src/tooltip.js"></script>
|
||||
<script src="../src/utils.js"></script>
|
||||
<script src="../src/interactiveLayer.js"></script>
|
||||
<script src="../src/models/legend.js"></script>
|
||||
<script src="../src/models/axis.js"></script>
|
||||
<script src="../src/models/scatter.js"></script>
|
||||
<script src="../src/models/line.js"></script>
|
||||
<script src="../src/models/lineChart.js"></script>
|
||||
<script src="testScript.js"></script>
|
||||
<script>
|
||||
|
||||
d3.select("body").on("keydown",function() {
|
||||
if (d3.event.ctrlKey && d3.event.which === 75) {
|
||||
alert("keydowned");
|
||||
}
|
||||
});
|
||||
//------------ CHART 1
|
||||
defaultChartConfig("chart1", dummyStocks(),true, true, {forceY:false});
|
||||
|
||||
//-------------- CHART 2 --- Chart without the interactive guideline.
|
||||
nv.addGraph(function() {
|
||||
var chart;
|
||||
chart = nv.models.lineChart().useInteractiveGuideline(false);
|
||||
|
||||
chart
|
||||
.x(function(d,i) { return d.x });
|
||||
|
||||
|
||||
chart.xAxis // chart sub-models (ie. xAxis, yAxis, etc) when accessed directly, return themselves, not the parent chart, so need to chain separately
|
||||
.tickFormat(d3.format(',.1f'));
|
||||
|
||||
chart.yAxis
|
||||
.axisLabel('Voltage (v)')
|
||||
.tickFormat(d3.format(',.4f'));
|
||||
|
||||
chart.showXAxis(true).showYAxis(true).rightAlignYAxis(true).margin({right: 90});
|
||||
|
||||
d3.select('#chart2 svg')
|
||||
//.datum([]) //for testing noData
|
||||
.datum(dummyStocks(50))
|
||||
.transition().duration(500)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
defaultChartConfig("chart3", smallDataSet(3));
|
||||
defaultChartConfig("chart4", badDataSet());
|
||||
defaultChartConfig("chart5", smallDataSet(1));
|
||||
defaultChartConfig("chart6", normalDist());
|
||||
|
||||
defaultChartConfig("chart7", smallDataSet(0));
|
||||
defaultChartConfig("chart8", allRandom(),false);
|
||||
defaultChartConfig("chart9", fibonacci());
|
||||
|
||||
defaultChartConfig("chart10", lotsofSeries());
|
||||
defaultChartConfig("chart11", backwards(),false);
|
||||
defaultChartConfig("chart12", duplicateX(),false);
|
||||
defaultChartConfig("chart13",hyperbole(), true, false, {width: 700, height: 400});
|
||||
defaultChartConfig("chart14",hyperbole(), false, false, {width: 700, height: 400});
|
||||
defaultChartConfig("chart15", withNaNs());
|
||||
defaultChartConfig("chart16", duplicateY(), false);
|
||||
defaultChartConfig("chart17", tinyPoints(), false);
|
||||
|
||||
function defaultChartConfig(containerid, data, guideline, useDates, auxOptions) {
|
||||
if (auxOptions === undefined) auxOptions = {};
|
||||
if (guideline === undefined) guideline = true;
|
||||
nv.addGraph(function() {
|
||||
var chart;
|
||||
chart = nv.models.lineChart().useInteractiveGuideline(guideline);
|
||||
|
||||
chart
|
||||
.x(function(d,i) {
|
||||
return d.x;
|
||||
});
|
||||
|
||||
if (auxOptions.width)
|
||||
chart.width(auxOptions.width);
|
||||
|
||||
if (auxOptions.height)
|
||||
chart.height(auxOptions.height);
|
||||
|
||||
if (auxOptions.forceY)
|
||||
chart.forceY([0]);
|
||||
|
||||
var formatter;
|
||||
if (useDates !== undefined) {
|
||||
formatter = function(d,i) {
|
||||
var now = (new Date()).getTime() - 86400 * 1000 * 365;
|
||||
now = new Date(now + d * 86400 * 1000);
|
||||
return d3.time.format('%b %d %Y')(now );
|
||||
}
|
||||
}
|
||||
else {
|
||||
formatter = d3.format(",.1f");
|
||||
}
|
||||
chart.margin({right: 40});
|
||||
chart.xAxis // chart sub-models (ie. xAxis, yAxis, etc) when accessed directly, return themselves, not the parent chart, so need to chain separately
|
||||
.tickFormat(
|
||||
formatter
|
||||
);
|
||||
|
||||
chart.yAxis
|
||||
.axisLabel('Voltage (v)')
|
||||
.tickFormat(d3.format(',.2f'));
|
||||
|
||||
|
||||
d3.select('#' + containerid + ' svg')
|
||||
.datum(data)
|
||||
.transition().duration(500)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
}
|
||||
|
||||
function sinAndCos() {
|
||||
var sin = [],
|
||||
cos = [],
|
||||
rand = [],
|
||||
rand2 = []
|
||||
;
|
||||
|
||||
var now = (new Date()).getTime();
|
||||
for (var i = 0; i < 100; i++) {
|
||||
sin.push({x: i, y: i % 10 == 5 ? null : Math.sin(i/10) }); //the nulls are to show how defined works
|
||||
cos.push({x: i, y: .5 * Math.cos(i/10)});
|
||||
rand.push({x:i, y: Math.random() / 10});
|
||||
rand2.push({x: i, y: Math.cos(i/10) + Math.random() / 10 })
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
area: true,
|
||||
values: sin,
|
||||
key: "Sine Wave",
|
||||
color: "#ff7f0e"
|
||||
},
|
||||
{
|
||||
values: cos,
|
||||
key: "Cosine Wave",
|
||||
color: "#2ca02c"
|
||||
},
|
||||
{
|
||||
values: rand,
|
||||
key: "Random Points",
|
||||
color: "#2222ff"
|
||||
}
|
||||
,
|
||||
{
|
||||
values: rand2,
|
||||
key: "Random Cosine",
|
||||
color: "#667711"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
function hyperbole() {
|
||||
var series1 = [], series2 = [], series3 = [];
|
||||
for(var i = 1; i < 100; i++) {
|
||||
series1.push({x: i, y: 1 / i});
|
||||
series2.push({x: i, y: 5 / i});
|
||||
series3.push({x: i, y: -8 / i});
|
||||
}
|
||||
|
||||
return [
|
||||
{values: series1, key: "Series 1"},
|
||||
{values: series2, key: "Series 2"},
|
||||
{values: series3, key: "Series 3"}
|
||||
];
|
||||
}
|
||||
|
||||
function smallDataSet(n) {
|
||||
var series = [];
|
||||
for(var i = 0; i < n; i++) {
|
||||
series.push({x: i, y: i * 0.3 + 2})
|
||||
}
|
||||
return [
|
||||
{values: series, key: "Line 1"}
|
||||
];
|
||||
}
|
||||
|
||||
function badDataSet() {
|
||||
var series1 = [], series2 = [];
|
||||
for(var i =0; i < 30; i++) {
|
||||
series1.push({x:i, y: i*0.3 + 12});
|
||||
}
|
||||
for(i = 0; i < 30; i += 5) {
|
||||
series2.push({x:i, y: i*0.7 + 8});
|
||||
}
|
||||
return [
|
||||
{values: series1, key:"Series 1"},
|
||||
{values: series2, key:"Series 2"}
|
||||
];
|
||||
}
|
||||
|
||||
function normalDist() {
|
||||
var series1 = [], series2 = [];
|
||||
for(var i = -500; i < 500; i += 1) {
|
||||
var x = i / 100;
|
||||
var y = 0.3989 * Math.pow(2.71, -0.5*x*x);
|
||||
series1.push({x:i, y:y});
|
||||
series2.push({x:i, y:y*2});
|
||||
}
|
||||
return [
|
||||
{values: series1, key:"Normal 1", area:true},
|
||||
{values: series2, key:"Normal 2"}];
|
||||
}
|
||||
|
||||
|
||||
function allRandom() {
|
||||
var series = [];
|
||||
for(var i = 0; i < 20; i++) {
|
||||
series.push({x: Math.floor(Math.random()*20), y: Math.floor(Math.random()*20) });
|
||||
}
|
||||
return [{values: series,area:true, key: "Total Chaos"}];
|
||||
}
|
||||
|
||||
function fibonacci() {
|
||||
var series = [
|
||||
{x:1, y:1},
|
||||
{x:2, y:2.5},
|
||||
{x:3, y:4},
|
||||
{x:5, y:6.7},
|
||||
{x:8, y:10.1},
|
||||
{x:13, y:20.1},
|
||||
{x:21, y:35.1},
|
||||
{x:34, y:60.0},
|
||||
{x:55, y:70.9},
|
||||
{x:89, y:100.3}
|
||||
];
|
||||
|
||||
return [{values: series,area:true,color: "#22fb88", key: "Fibonacci"}];
|
||||
}
|
||||
|
||||
function lotsofSeries() {
|
||||
var rval = [];
|
||||
for(var n = 0; n < 15; n++) {
|
||||
var values = [];
|
||||
var slope = Math.random() * 5;
|
||||
for(var i =0; i < 30; i++) {
|
||||
values.push(
|
||||
{x: i,
|
||||
y: i * slope + Math.random()*5}
|
||||
);
|
||||
}
|
||||
var isArea = (Math.random() > 0.5);
|
||||
rval.push({key: "Series " + n, area: isArea, values: values});
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
function backwards() {
|
||||
var series = [];
|
||||
for(var i = 30; i >= 1; i--) {
|
||||
series.push({x: i, y: Math.sqrt(i) });
|
||||
}
|
||||
return [{values: series, key: "Backwards series", area:true}];
|
||||
}
|
||||
|
||||
function duplicateX() {
|
||||
return [
|
||||
{key: "Duplicate X",
|
||||
area: true,
|
||||
values: [
|
||||
{x: 4, y: 10},
|
||||
{x: 4, y: 11},
|
||||
{x: 4, y: 12},
|
||||
{x: 4, y: 13}
|
||||
]
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
function duplicateY() {
|
||||
return [
|
||||
{key: "Duplicate Y",
|
||||
values: [
|
||||
{x: 0, y: 10}, {x:1, y:10},{x:2, y:10},{x:3, y:10}
|
||||
]
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
function withNaNs() {
|
||||
return [
|
||||
{key: "NaN Points",
|
||||
values: [
|
||||
{x: 1, y: NaN},
|
||||
{x: 2, y: undefined},
|
||||
{x: 3, y: false},
|
||||
{x: 4, y: null},
|
||||
{x: 5, y: "Hello"},
|
||||
{x: NaN, y: NaN},
|
||||
{x: null, y: null},
|
||||
{x: undefined, y: undefined},
|
||||
{x: "Hello", y: "World"},
|
||||
{x: Infinity, y: Infinity}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
function tinyPoints() {
|
||||
var rval = {key: "Tiny points", values: []};
|
||||
for(var i =1; i < 20; i++) {
|
||||
rval.values.push({
|
||||
x: i,
|
||||
y: Math.random() * 1e-10
|
||||
});
|
||||
}
|
||||
return [rval];
|
||||
}
|
||||
|
||||
function dummyStocks(numPoints) {
|
||||
numPoints = numPoints || 200;
|
||||
function volatileChart(key,startPrice, volatility, isArea) {
|
||||
var rval = {key: key, values: []};
|
||||
if (isArea) rval.area = true;
|
||||
for(var i = 1; i < numPoints; i++) {
|
||||
|
||||
rval.values.push({x: i, y: (i > 110 && i < 130) ? null : startPrice});
|
||||
var rnd = Math.random();
|
||||
var changePct = 2 * volatility * rnd;
|
||||
if ( changePct > volatility) {
|
||||
changePct -= (2*volatility);
|
||||
}
|
||||
|
||||
startPrice = startPrice + startPrice * changePct;
|
||||
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
var stocks = [];
|
||||
stocks.push(volatileChart("APPL",5.00, 0.02));
|
||||
stocks.push(volatileChart("GOOG", 6.01,0.024));
|
||||
stocks.push(volatileChart("MSFT", 2.01, 0.012));
|
||||
stocks.push(volatileChart("IBM US", 2.5, 0.08, true));
|
||||
return stocks;
|
||||
}
|
||||
|
||||
</script>
|
@ -0,0 +1,148 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
|
||||
<link href="teststyle.css" rel="stylesheet" type='text/css'>
|
||||
<body class='with-3d-shadow with-transitions'>
|
||||
<h3>Multibar chart test cases - feel free to add more tests</h3>
|
||||
<div class='navigation'>
|
||||
<a href="../examples/multiBar.html">Multibar Stream example</a>
|
||||
</div>
|
||||
<div class='chart half' id="chart1">
|
||||
Normal chart, with transition delay, and bar color set.
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart half' id="chart2">
|
||||
Normal chart, no transitionDuration or delay, no bar color set.
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart half' id="chart3">
|
||||
Chart with single series, no group spacing.
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart half' id="chart4">
|
||||
Chart with 18 series, 7 data points per series.
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart third' id="chart5">
|
||||
Chart with 1 data point
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart third' id="chart6">
|
||||
Chart with 2 data points
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart third' id="chart7">
|
||||
Chart with 0 data points
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<script src="../lib/d3.v3.js"></script>
|
||||
<script src="../nv.d3.js"></script>
|
||||
<script src="../src/tooltip.js"></script>
|
||||
<script src="../src/utils.js"></script>
|
||||
<script src="../src/models/legend.js"></script>
|
||||
<script src="../src/models/axis.js"></script>
|
||||
<script src="../src/models/multiBar.js"></script>
|
||||
<script src="../src/models/multiBarChart.js"></script>
|
||||
<script>
|
||||
|
||||
|
||||
var negative_test_data = new d3.range(0,3).map(function(d,i) { return {
|
||||
key: 'Stream ' + i,
|
||||
values: new d3.range(0,11).map( function(f,j) {
|
||||
return {
|
||||
y: 10 + Math.random()*100 * (Math.floor(Math.random()*100)%2 ? 1 : -1),
|
||||
x: j
|
||||
}
|
||||
})
|
||||
};
|
||||
});
|
||||
|
||||
function dataFactory(seriesNum, perSeries) {
|
||||
return new d3.range(0,seriesNum).map(function(d,i) { return {
|
||||
key: 'Stream ' + i,
|
||||
values: new d3.range(0,perSeries).map( function(f,j) {
|
||||
return {
|
||||
y: 10 + Math.random()*100,
|
||||
x: j
|
||||
}
|
||||
})
|
||||
};
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
defaultChartConfig("chart1", negative_test_data, {
|
||||
barColor: d3.scale.category20().range(),
|
||||
delay: 1200,
|
||||
groupSpacing: 0.1,
|
||||
reduceXTicks: false,
|
||||
staggerLabels: true
|
||||
});
|
||||
|
||||
defaultChartConfig("chart2", dataFactory(3,11), {
|
||||
delay: 0,
|
||||
transitionDuration:0,
|
||||
groupSpacing: 0.2
|
||||
});
|
||||
|
||||
defaultChartConfig("chart3",dataFactory(1,15),{
|
||||
groupSpacing: 0,
|
||||
delay:0
|
||||
});
|
||||
|
||||
defaultChartConfig("chart4",dataFactory(18,7),{
|
||||
delay:800
|
||||
});
|
||||
|
||||
defaultChartConfig("chart5",dataFactory(1,1),{
|
||||
delay:0
|
||||
});
|
||||
|
||||
defaultChartConfig("chart6",dataFactory(1,2),{
|
||||
delay:0
|
||||
});
|
||||
|
||||
defaultChartConfig("chart7",dataFactory(0,0),{
|
||||
delay:0
|
||||
});
|
||||
|
||||
function defaultChartConfig(containerId, data, chartOptions) {
|
||||
nv.addGraph(function() {
|
||||
var chart;
|
||||
chart = nv.models.multiBarChart()
|
||||
.margin({bottom: 100})
|
||||
.transitionDuration(300)
|
||||
;
|
||||
|
||||
chart.options(chartOptions);
|
||||
chart.multibar
|
||||
.hideable(true);
|
||||
|
||||
chart.xAxis
|
||||
.axisLabel("Current Index")
|
||||
.showMaxMin(true)
|
||||
.tickFormat(d3.format(',0f'));
|
||||
|
||||
chart.yAxis
|
||||
.tickFormat(d3.format(',.1f'));
|
||||
|
||||
d3.select('#' + containerId + ' svg')
|
||||
.datum(data)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
|
||||
|
||||
return chart;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
@ -0,0 +1,177 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
|
||||
<link href="teststyle.css" rel="stylesheet" type='text/css'>
|
||||
<style>
|
||||
|
||||
body {
|
||||
overflow-y:scroll;
|
||||
font-family: Arial;
|
||||
}
|
||||
|
||||
text {
|
||||
font: 12px sans-serif;
|
||||
}
|
||||
|
||||
</style>
|
||||
<body class='with-transitions'>
|
||||
<div class='navigation'>
|
||||
Tests:
|
||||
<a href="lineChartTest.html">Line Chart</a>
|
||||
<a href="stackedAreaChartTest.html">Stacked Area</a>
|
||||
<a href="../examples/cumulativeLineChart.html">Cumulative Line</a>
|
||||
<a href="ScatterChartTest.html">Scatter</a>
|
||||
<a href="realTimeChartTest.html">Real time test</a>
|
||||
</div>
|
||||
<div class='chart third' id="test1">
|
||||
<h2>Standard Pie Chart</h2>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='chart third' id="test2">
|
||||
<h2>Donut pie chart</h2>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='chart third' id="test3">
|
||||
<h2>Pie chart with 30 series'</h2>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='chart third' id='test7'>
|
||||
<h2>Pie chart with percent label type</h2>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='chart third' id="test4">
|
||||
<h2>Empty array passed in</h2>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='chart third' id="test5">
|
||||
<h2>Series' have only zero values</h2>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='chart third' id="test6">
|
||||
<h2>NaN, null, undefined values passed in</h2>
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<script src="../lib/d3.v3.js"></script>
|
||||
<script src="../nv.d3.js"></script>
|
||||
<script src="../src/tooltip.js"></script>
|
||||
<script src="../src/models/legend.js"></script>
|
||||
<script src="../src/models/pie.js"></script>
|
||||
<script src="../src/models/pieChart.js"></script>
|
||||
<script src="../src/utils.js"></script>
|
||||
<script>
|
||||
|
||||
var testdata = [
|
||||
{
|
||||
key: "One",
|
||||
y: 5
|
||||
},
|
||||
{
|
||||
key: "Two",
|
||||
y: 2
|
||||
},
|
||||
{
|
||||
key: "Three",
|
||||
y: 9
|
||||
},
|
||||
{
|
||||
key: "Four",
|
||||
y: 7
|
||||
},
|
||||
{
|
||||
key: "Five",
|
||||
y: 4
|
||||
},
|
||||
{
|
||||
key: "Six",
|
||||
y: 3
|
||||
},
|
||||
{
|
||||
key: "Seven",
|
||||
y: .5
|
||||
}
|
||||
];
|
||||
|
||||
function thirtySeries() {
|
||||
var data = [];
|
||||
for(var i =0; i < 30; i++) {
|
||||
data.push({
|
||||
key: "Series-" + i,
|
||||
y: Math.floor(Math.random() * 100)
|
||||
});
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
function defaultChart(containerId, data, labelType) {
|
||||
nv.addGraph(function() {
|
||||
var width = 500,
|
||||
height = 500;
|
||||
|
||||
var chart = nv.models.pieChart()
|
||||
.x(function(d) { return d.key })
|
||||
.y(function(d) { return d.y })
|
||||
.color(d3.scale.category10().range())
|
||||
.width(width)
|
||||
.height(height)
|
||||
.labelType(labelType)
|
||||
;
|
||||
|
||||
d3.select("#" + containerId + " svg")
|
||||
.datum(data)
|
||||
.transition().duration(1200)
|
||||
.attr('width', width)
|
||||
.attr('height', height)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
return chart;
|
||||
});
|
||||
}
|
||||
|
||||
//Adds donut pie chart.
|
||||
nv.addGraph(function() {
|
||||
|
||||
var width = 500,
|
||||
height = 500;
|
||||
|
||||
var chart = nv.models.pieChart()
|
||||
.x(function(d) { return d.key })
|
||||
.color(d3.scale.category10().range())
|
||||
.width(width)
|
||||
.height(height)
|
||||
.donut(true);
|
||||
|
||||
chart.pie
|
||||
.startAngle(function(d) { return d.startAngle/2 -Math.PI/2 })
|
||||
.endAngle(function(d) { return d.endAngle/2 -Math.PI/2 });
|
||||
|
||||
d3.select("#test2 svg")
|
||||
.datum(testdata)
|
||||
.transition().duration(1200)
|
||||
.attr('width', width)
|
||||
.attr('height', height)
|
||||
.call(chart);
|
||||
nv.utils.windowResize(chart.update);
|
||||
return chart;
|
||||
});
|
||||
|
||||
defaultChart("test1", testdata);
|
||||
defaultChart("test3", thirtySeries());
|
||||
defaultChart("test4",[]);
|
||||
defaultChart("test5",[{key: "Zero series", y: 0}, {key: "Zero series 2", y: 0}]);
|
||||
defaultChart("test6", [
|
||||
{key: "Undefined", y: undefined},
|
||||
{key: "Nan", y: NaN},
|
||||
{key: "null", y: null},
|
||||
{key: "zero", y: 0}
|
||||
])
|
||||
|
||||
defaultChart("test7",testdata, "percent");
|
||||
</script>
|
@ -0,0 +1,192 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
|
||||
<link href="teststyle.css" rel="stylesheet" type='text/css'>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<body>
|
||||
<h3>Test cases for Domain and Range overrides - Example of a polylinear scale</h3>
|
||||
<div style='position:relative;'>
|
||||
<div class='navigation'>
|
||||
Tests:
|
||||
<a href="lineChartTest.html">Line Chart</a>
|
||||
<a href="stackedAreaChartTest.html">Stacked Area</a>
|
||||
<a href="../examples/cumulativeLineChart.html">Cumulative Line</a>
|
||||
<a href="ScatterChartTest.html">Scatter</a>
|
||||
<a href="pieChartTest.html">Pie chart</a>
|
||||
</div>
|
||||
<div class='chart full' id='chart1'>
|
||||
Line chart: yDomain = [0,2,200], yRange = [500,50,0]
|
||||
<svg></svg>
|
||||
</div>
|
||||
<div class='chart half with-transitions' id='chart2'>
|
||||
Historical bar chart: yDomain = [0,2,130], yRange = [500,50,0]
|
||||
<svg></svg>
|
||||
</div>
|
||||
|
||||
<div class='half'>
|
||||
Notes:
|
||||
The chart.yRange() and chart.xRange() properties are an advanced feature. They are useful
|
||||
in situations where your data has wild extremes: ie, you have lots of smaller numbers, and lots of really big numbers.<br/><br/>
|
||||
|
||||
Without a polylinear scale, those really big data points will overwhelm the small points.<br/><br/>
|
||||
|
||||
Please look at the examples to understand how polylinear scales work. Comment/uncomment the lines that alter yDomain and yRange
|
||||
to see the effect it has on the charts.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../lib/d3.v3.js"></script>
|
||||
<script src="../nv.d3.js"></script>
|
||||
<script src="../src/tooltip.js"></script>
|
||||
<script src="../src/utils.js"></script>
|
||||
<script src="../src/interactiveLayer.js"></script>
|
||||
<script src="../src/models/legend.js"></script>
|
||||
<script src="../src/models/axis.js"></script>
|
||||
<script src="../src/models/scatter.js"></script>
|
||||
<script src="../src/models/line.js"></script>
|
||||
<script src="../src/models/lineChart.js"></script>
|
||||
<script src="../src/models/historicalBar.js"></script>
|
||||
<script src="../src/models/historicalBarChart.js"></script>
|
||||
<script>
|
||||
|
||||
//------------ CHART 1
|
||||
lineChartConfig("chart1", sinAndCos(),true, false);
|
||||
barChartConfig(dataWithSpikes());
|
||||
|
||||
|
||||
function lineChartConfig(containerid, data, guideline, useDates, auxOptions) {
|
||||
if (auxOptions === undefined) auxOptions = {};
|
||||
if (guideline === undefined) guideline = true;
|
||||
nv.addGraph(function() {
|
||||
var chart;
|
||||
chart = nv.models.lineChart().useInteractiveGuideline(guideline);
|
||||
|
||||
var fullChartHeight = 500 - chart.margin().top - chart.margin().bottom;
|
||||
chart
|
||||
.x(function(d,i) {
|
||||
return d.x;
|
||||
})
|
||||
.yDomain([0,2,200]) //Using a polylinear scale
|
||||
.yRange([fullChartHeight,50,0])
|
||||
;
|
||||
|
||||
if (auxOptions.width)
|
||||
chart.width(auxOptions.width);
|
||||
|
||||
if (auxOptions.height)
|
||||
chart.height(auxOptions.height);
|
||||
|
||||
var formatter;
|
||||
if (useDates) {
|
||||
formatter = function(d,i) {
|
||||
var now = (new Date()).getTime() - 86400 * 1000 * 365;
|
||||
now = new Date(now + d * 86400 * 1000);
|
||||
return d3.time.format('%b %d %Y')(now );
|
||||
}
|
||||
}
|
||||
else {
|
||||
formatter = d3.format(",.1f");
|
||||
}
|
||||
|
||||
chart.xAxis // chart sub-models (ie. xAxis, yAxis, etc) when accessed directly, return themselves, not the parent chart, so need to chain separately
|
||||
.tickFormat(
|
||||
formatter
|
||||
);
|
||||
|
||||
chart.yAxis
|
||||
.axisLabel('Voltage (v)')
|
||||
.tickFormat(d3.format(',.2f'));
|
||||
|
||||
d3.select('#' + containerid + ' svg')
|
||||
.datum(data)
|
||||
.transition().duration(500)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
}
|
||||
|
||||
function barChartConfig(data) {
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.historicalBarChart();
|
||||
var fullChartHeight = 500 - chart.margin().top - chart.margin().bottom;
|
||||
chart.color(["#ff7f0e"])
|
||||
.yDomain([0,2,130])
|
||||
.yRange([fullChartHeight,50,0])
|
||||
.transitionDuration(500)
|
||||
;
|
||||
|
||||
chart.xAxis
|
||||
.tickFormat(d3.format(',.1f'))
|
||||
.axisLabel("Time")
|
||||
;
|
||||
|
||||
chart.yAxis
|
||||
.axisLabel('Random Number')
|
||||
.tickFormat(d3.format(',.4f'));
|
||||
d3.select("#chart2 svg")
|
||||
.datum(data)
|
||||
.transition().duration(500)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
return chart;
|
||||
});
|
||||
}
|
||||
|
||||
function sinAndCos() {
|
||||
var sin = [],
|
||||
cos = [],
|
||||
higherOrder = []
|
||||
;
|
||||
|
||||
var now = (new Date()).getTime();
|
||||
for (var i = 0; i < 100; i++) {
|
||||
sin.push({x: i, y: Math.abs(Math.sin(i/10)) }); //the nulls are to show how defined works
|
||||
cos.push({x: i, y: Math.abs(.5 * Math.cos(i/10)) });
|
||||
|
||||
higherOrder.push({x: i, y: Math.cos(i) * 100 + 100});
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
values: sin,
|
||||
key: "Sine Wave",
|
||||
color: "#ff7f0e"
|
||||
},
|
||||
{
|
||||
values: cos,
|
||||
key: "Cosine Wave",
|
||||
color: "#2ca02c"
|
||||
},
|
||||
{
|
||||
values: higherOrder,
|
||||
key: "Higher Order",
|
||||
color: "#fc34ff"
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
function dataWithSpikes() {
|
||||
var rval = [];
|
||||
for(var i =0; i < 100; i++) {
|
||||
|
||||
var spike = (Math.random() > 0.9);
|
||||
rval.push({
|
||||
x: i,
|
||||
y: (spike) ? Math.random() * 100 + 30 : Math.random()
|
||||
});
|
||||
}
|
||||
return [
|
||||
{key: "Series 1",
|
||||
color : "orange",
|
||||
values: rval}
|
||||
];
|
||||
}
|
||||
|
||||
</script>
|
@ -0,0 +1,102 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
|
||||
<link href="teststyle.css" rel="stylesheet" type='text/css'>
|
||||
|
||||
<body>
|
||||
<div class='navigation'>
|
||||
Tests:
|
||||
<a href="lineChartTest.html">Line Chart</a>
|
||||
<a href="stackedAreaChartTest.html">Stacked Area</a>
|
||||
<a href="../examples/cumulativeLineChart.html">Cumulative Line</a>
|
||||
<a href="ScatterChartTest.html">Scatter</a>
|
||||
</div>
|
||||
<h3>Example showing real time chart updating</h3>
|
||||
The chart below is a historical bar chart, which is ideal for visualizing time series data.<br/>
|
||||
First, you need to update the data model for the chart. In the example, we append a random number
|
||||
every half a second. Then, you call <strong>chart.update()</strong>.
|
||||
|
||||
<div id='chart' class='chart half with-transitions'>
|
||||
<svg></svg>
|
||||
<button id='start-stop-button'>Start/Stop Stream</button>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="../lib/d3.v3.js"></script>
|
||||
<script src="../nv.d3.js"></script>
|
||||
<script src="../src/tooltip.js"></script>
|
||||
<script src="../src/utils.js"></script>
|
||||
<script src="../src/interactiveLayer.js"></script>
|
||||
<script src="../src/models/legend.js"></script>
|
||||
<script src="../src/models/axis.js"></script>
|
||||
<script src="../src/models/scatter.js"></script>
|
||||
<script src="../src/models/line.js"></script>
|
||||
<script src="../src/models/lineChart.js"></script>
|
||||
<script src="../src/models/historicalBar.js"></script>
|
||||
<script src="../src/models/historicalBarChart.js"></script>
|
||||
|
||||
<script>
|
||||
var chart;
|
||||
var data = [{
|
||||
key: "Stream 1",
|
||||
color: "orange",
|
||||
values: [
|
||||
{x: 1, y: 1}
|
||||
]
|
||||
}];
|
||||
nv.addGraph(function() {
|
||||
|
||||
chart = nv.models.historicalBarChart();
|
||||
|
||||
chart
|
||||
.x(function(d,i) { return d.x });
|
||||
|
||||
chart.xAxis // chart sub-models (ie. xAxis, yAxis, etc) when accessed directly, return themselves, not the parent chart, so need to chain separately
|
||||
.tickFormat(d3.format(',.1f'))
|
||||
.axisLabel("Time")
|
||||
;
|
||||
|
||||
chart.yAxis
|
||||
.axisLabel('Random Number')
|
||||
.tickFormat(d3.format(',.4f'));
|
||||
|
||||
chart.showXAxis(true).showYAxis(true).rightAlignYAxis(true).margin({right: 90});
|
||||
|
||||
d3.select('#chart svg')
|
||||
.datum(data)
|
||||
.transition().duration(500)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
var x = 2;
|
||||
var run = true;
|
||||
setInterval(function(){
|
||||
if (!run) return;
|
||||
|
||||
var spike = (Math.random() > 0.95) ? 10: 1;
|
||||
data[0].values.push({
|
||||
x: x,
|
||||
y: Math.random() * spike
|
||||
});
|
||||
|
||||
if (data[0].values.length > 70) {
|
||||
data[0].values.shift();
|
||||
}
|
||||
x++;
|
||||
|
||||
chart.update();
|
||||
}, 500);
|
||||
|
||||
d3.select("#start-stop-button").on("click",function() {
|
||||
run = !run;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,322 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
|
||||
<link href="teststyle.css" rel="stylesheet" type='text/css'>
|
||||
<body>
|
||||
<h3>Stacked area chart test cases - feel free to add more tests</h3>
|
||||
<div class='navigation'>
|
||||
Tests:
|
||||
<a href="lineChartTest.html">Line Chart</a>
|
||||
<a href="stackedAreaChartTest.html">Stacked Area</a>
|
||||
<a href="../examples/cumulativeLineChart.html">Cumulative Line</a>
|
||||
</div>
|
||||
<div class='chart full' id='chart1'>Full chart example with new tooltip and guideline<button>Select chart</button><svg></svg></div>
|
||||
<div class='chart half with-transitions' id='chart2'>Chart with old tooltips (with-transitions)<button>Select chart</button><svg></svg></div>
|
||||
<div class='chart half' id='chart3'>Chart with single point<button>Select chart</button><svg></svg></div>
|
||||
<div class='chart half' id='chart4'>Chart with two points<button>Select chart</button><svg></svg></div>
|
||||
<div class='chart half' id='chart5'>Chart with 'holes'<button>Select chart</button><svg></svg></div>
|
||||
<div class='chart half' id='chart6'>Total random points<button>Select chart</button><svg></svg></div>
|
||||
<div class='chart half' id='chart7'>Less than four points, old tooltips<button>Select chart</button><svg></svg></div>
|
||||
<div class='chart half' id='chart8'>No data<svg></svg></div>
|
||||
<div class='chart half' id='chart9'>Data is all negative<svg></svg></div>
|
||||
|
||||
<script src="../lib/d3.v3.js"></script>
|
||||
<script src="../nv.d3.js"></script>
|
||||
<script src="../src/utils.js"></script>
|
||||
<script src="../src/models/axis.js"></script>
|
||||
<script src="../src/tooltip.js"></script>
|
||||
<script src="../src/interactiveLayer.js"></script>
|
||||
<script src="../src/models/legend.js"></script>
|
||||
<script src="../src/models/axis.js"></script>
|
||||
<script src="../src/models/scatter.js"></script>
|
||||
<script src="../src/models/stackedArea.js"></script>
|
||||
<script src="../src/models/stackedAreaChart.js"></script>
|
||||
<script src="testScript.js"></script>
|
||||
<script>
|
||||
|
||||
|
||||
var histcatexplong = [
|
||||
{
|
||||
"key" : "Consumer Discretionary" ,
|
||||
"values" : [ [ 1138683600000 , 27.38478809681] , [ 1141102800000 , 27.371377218208] , [ 1143781200000 , 26.309915460827] , [ 1146369600000 , 26.425199957521] , [ 1149048000000 , 26.823411519395] , [ 1151640000000 , 23.850443591584] , [ 1154318400000 , 23.158355444054] , [ 1156996800000 , 22.998689393694] , [ 1159588800000 , 27.977128511299] , [ 1162270800000 , 29.073672469721] , [ 1164862800000 , 28.587640408904] , [ 1167541200000 , 22.788453687638] , [ 1170219600000 , 22.429199073597] , [ 1172638800000 , 22.324103271051] , [ 1175313600000 , 17.558388444186] , [ 1177905600000 , 16.769518096208] , [ 1180584000000 , 16.214738201302] , [ 1183176000000 , 18.729632971228] , [ 1185854400000 , 18.814523318848] , [ 1188532800000 , 19.789986451358] , [ 1191124800000 , 17.070049054933] , [ 1193803200000 , 16.121349575715] , [ 1196398800000 , 15.141659430091] , [ 1199077200000 , 17.175388025298] , [ 1201755600000 , 17.286592443521] , [ 1204261200000 , 16.323141626569] , [ 1206936000000 , 19.231263773952] , [ 1209528000000 , 18.446256391094] , [ 1212206400000 , 17.822632399764] , [ 1214798400000 , 15.539366475979] , [ 1217476800000 , 15.255131790216] , [ 1220155200000 , 15.660963922593] , [ 1222747200000 , 13.254482273697] , [ 1225425600000 , 11.920796202299] , [ 1228021200000 , 12.122809090925] , [ 1230699600000 , 15.691026271393] , [ 1233378000000 , 14.720881635107] , [ 1235797200000 , 15.387939360044] , [ 1238472000000 , 13.765436672229] , [ 1241064000000 , 14.6314458648] , [ 1243742400000 , 14.292446536221] , [ 1246334400000 , 16.170071367016] , [ 1249012800000 , 15.948135554337] , [ 1251691200000 , 16.612872685134] , [ 1254283200000 , 18.778338719091] , [ 1256961600000 , 16.75602606542] , [ 1259557200000 , 19.385804443147] , [ 1262235600000 , 22.950590240168] , [ 1264914000000 , 23.61159018141] , [ 1267333200000 , 25.708586989581] , [ 1270008000000 , 26.883915999885] , [ 1272600000000 , 25.893486687065] , [ 1275278400000 , 24.678914263176] , [ 1277870400000 , 25.937275793023] , [ 1280548800000 , 29.46138169384] , [ 1283227200000 , 27.357322961862] , [ 1285819200000 , 29.057235285673] , [ 1288497600000 , 28.549434189386] , [ 1291093200000 , 28.506352379723] , [ 1293771600000 , 29.449241421597] , [ 1296450000000 , 25.796838168807] , [ 1298869200000 , 28.740145449189] , [ 1301544000000 , 22.091744141872] , [ 1304136000000 , 25.079662545409] , [ 1306814400000 , 23.674906973064] , [ 1309406400000 , 23.41800274293] , [ 1312084800000 , 23.243644138871] , [ 1314763200000 , 31.591854066817] , [ 1317355200000 , 31.497112374114] , [ 1320033600000 , 26.672380820431] , [ 1322629200000 , 27.297080015495] , [ 1325307600000 , 20.174315530051] , [ 1327986000000 , 19.631084213899] , [ 1330491600000 , 20.366462219462] , [ 1333166400000 , 17.429019937289] , [ 1335758400000 , 16.75543633539] , [ 1338436800000 , 16.182906906042]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Consumer Staples" ,
|
||||
"values" : [ [ 1138683600000 , 7.2800122043237] , [ 1141102800000 , 7.1187787503354] , [ 1143781200000 , 8.351887016482] , [ 1146369600000 , 8.4156698763993] , [ 1149048000000 , 8.1673298604231] , [ 1151640000000 , 5.5132447126042] , [ 1154318400000 , 6.1152537710599] , [ 1156996800000 , 6.076765091942] , [ 1159588800000 , 4.6304473798646] , [ 1162270800000 , 4.6301068469402] , [ 1164862800000 , 4.3466656309389] , [ 1167541200000 , 6.830104897003] , [ 1170219600000 , 7.241633040029] , [ 1172638800000 , 7.1432372054153] , [ 1175313600000 , 10.608942063374] , [ 1177905600000 , 10.914964549494] , [ 1180584000000 , 10.933223880565] , [ 1183176000000 , 8.3457524851265] , [ 1185854400000 , 8.1078413081882] , [ 1188532800000 , 8.2697185922474] , [ 1191124800000 , 8.4742436475968] , [ 1193803200000 , 8.4994601179319] , [ 1196398800000 , 8.7387319683243] , [ 1199077200000 , 6.8829183612895] , [ 1201755600000 , 6.984133637885] , [ 1204261200000 , 7.0860136043287] , [ 1206936000000 , 4.3961787956053] , [ 1209528000000 , 3.8699674365231] , [ 1212206400000 , 3.6928925238305] , [ 1214798400000 , 6.7571718894253] , [ 1217476800000 , 6.4367313362344] , [ 1220155200000 , 6.4048441521454] , [ 1222747200000 , 5.4643833239669] , [ 1225425600000 , 5.3150786833374] , [ 1228021200000 , 5.3011272612576] , [ 1230699600000 , 4.1203601430809] , [ 1233378000000 , 4.0881783200525] , [ 1235797200000 , 4.1928665957189] , [ 1238472000000 , 7.0249415663205] , [ 1241064000000 , 7.006530880769] , [ 1243742400000 , 6.994835633224] , [ 1246334400000 , 6.1220222336254] , [ 1249012800000 , 6.1177436137653] , [ 1251691200000 , 6.1413396231981] , [ 1254283200000 , 4.8046006145874] , [ 1256961600000 , 4.6647600660544] , [ 1259557200000 , 4.544865006255] , [ 1262235600000 , 6.0488249316539] , [ 1264914000000 , 6.3188669540206] , [ 1267333200000 , 6.5873958262306] , [ 1270008000000 , 6.2281189839578] , [ 1272600000000 , 5.8948915746059] , [ 1275278400000 , 5.5967320482214] , [ 1277870400000 , 0.99784432084837] , [ 1280548800000 , 1.0950794175359] , [ 1283227200000 , 0.94479734407491] , [ 1285819200000 , 1.222093988688] , [ 1288497600000 , 1.335093106856] , [ 1291093200000 , 1.3302565104985] , [ 1293771600000 , 1.340824670897] , [ 1296450000000 , 0] , [ 1298869200000 , 0] , [ 1301544000000 , 0] , [ 1304136000000 , 0] , [ 1306814400000 , 0] , [ 1309406400000 , 0] , [ 1312084800000 , 0] , [ 1314763200000 , 0] , [ 1317355200000 , 4.4583692315] , [ 1320033600000 , 3.6493043348059] , [ 1322629200000 , 3.8610064091761] , [ 1325307600000 , 5.5144800685202] , [ 1327986000000 , 5.1750695220792] , [ 1330491600000 , 5.6710066952691] , [ 1333166400000 , 8.5658461590953] , [ 1335758400000 , 8.6135447714243] , [ 1338436800000 , 8.0231460925212]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Energy" ,
|
||||
"values" : [ [ 1138683600000 , 1.544303464167] , [ 1141102800000 , 1.4387289432421] , [ 1143781200000 , 0] , [ 1146369600000 , 0] , [ 1149048000000 , 0] , [ 1151640000000 , 1.328626801128] , [ 1154318400000 , 1.2874050802627] , [ 1156996800000 , 1.0872743105593] , [ 1159588800000 , 0.96042562635813] , [ 1162270800000 , 0.93139372870616] , [ 1164862800000 , 0.94432167305385] , [ 1167541200000 , 1.277750166208] , [ 1170219600000 , 1.2204893886811] , [ 1172638800000 , 1.207489123122] , [ 1175313600000 , 1.2490651414113] , [ 1177905600000 , 1.2593129913052] , [ 1180584000000 , 1.373329808388] , [ 1183176000000 , 0] , [ 1185854400000 , 0] , [ 1188532800000 , 0] , [ 1191124800000 , 0] , [ 1193803200000 , 0] , [ 1196398800000 , 0] , [ 1199077200000 , 0] , [ 1201755600000 , 0] , [ 1204261200000 , 0] , [ 1206936000000 , 0] , [ 1209528000000 , 0] , [ 1212206400000 , 0] , [ 1214798400000 , 0] , [ 1217476800000 , 0] , [ 1220155200000 , 0] , [ 1222747200000 , 1.4516108933695] , [ 1225425600000 , 1.1856025268225] , [ 1228021200000 , 1.3430470355439] , [ 1230699600000 , 2.2752595354509] , [ 1233378000000 , 2.4031560010523] , [ 1235797200000 , 2.0822430731926] , [ 1238472000000 , 1.5640902826938] , [ 1241064000000 , 1.5812873972356] , [ 1243742400000 , 1.9462448548894] , [ 1246334400000 , 2.9464870223957] , [ 1249012800000 , 3.0744699383222] , [ 1251691200000 , 2.9422304628446] , [ 1254283200000 , 2.7503075599999] , [ 1256961600000 , 2.6506701800427] , [ 1259557200000 , 2.8005425319977] , [ 1262235600000 , 2.6816184971185] , [ 1264914000000 , 2.681206271327] , [ 1267333200000 , 2.8195488011259] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 1.0687057346382] , [ 1280548800000 , 1.2539400544134] , [ 1283227200000 , 1.1862969445955] , [ 1285819200000 , 0] , [ 1288497600000 , 0] , [ 1291093200000 , 0] , [ 1293771600000 , 0] , [ 1296450000000 , 1.941972859484] , [ 1298869200000 , 2.1142247697552] , [ 1301544000000 , 2.3788590206824] , [ 1304136000000 , 2.5337302877545] , [ 1306814400000 , 2.3163370395199] , [ 1309406400000 , 2.0645451843195] , [ 1312084800000 , 2.1004446672411] , [ 1314763200000 , 3.6301875804303] , [ 1317355200000 , 2.454204664652] , [ 1320033600000 , 2.196082370894] , [ 1322629200000 , 2.3358418255202] , [ 1325307600000 , 0] , [ 1327986000000 , 0] , [ 1330491600000 , 0] , [ 1333166400000 , 0.39001201038526] , [ 1335758400000 , 0.30945472725559] , [ 1338436800000 , 0.31062439305591]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Financials" ,
|
||||
"values" : [ [ 1138683600000 , 13.356778764352] , [ 1141102800000 , 13.611196863271] , [ 1143781200000 , 6.895903006119] , [ 1146369600000 , 6.9939633271352] , [ 1149048000000 , 6.7241510257675] , [ 1151640000000 , 5.5611293669516] , [ 1154318400000 , 5.6086488714041] , [ 1156996800000 , 5.4962849907033] , [ 1159588800000 , 6.9193153169279] , [ 1162270800000 , 7.0016334389777] , [ 1164862800000 , 6.7865422443273] , [ 1167541200000 , 9.0006454225383] , [ 1170219600000 , 9.2233916171431] , [ 1172638800000 , 8.8929316009479] , [ 1175313600000 , 10.345937520404] , [ 1177905600000 , 10.075914677026] , [ 1180584000000 , 10.089006188111] , [ 1183176000000 , 10.598330295008] , [ 1185854400000 , 9.968954653301] , [ 1188532800000 , 9.7740580198146] , [ 1191124800000 , 10.558483060626] , [ 1193803200000 , 9.9314651823603] , [ 1196398800000 , 9.3997715873769] , [ 1199077200000 , 8.4086493387262] , [ 1201755600000 , 8.9698309085926] , [ 1204261200000 , 8.2778357995396] , [ 1206936000000 , 8.8585045600123] , [ 1209528000000 , 8.7013756413322] , [ 1212206400000 , 7.7933605469443] , [ 1214798400000 , 7.0236183483064] , [ 1217476800000 , 6.9873088186829] , [ 1220155200000 , 6.8031713070097] , [ 1222747200000 , 6.6869531315723] , [ 1225425600000 , 6.138256993963] , [ 1228021200000 , 5.6434994016354] , [ 1230699600000 , 5.495220262512] , [ 1233378000000 , 4.6885326869846] , [ 1235797200000 , 4.4524349883438] , [ 1238472000000 , 5.6766520778185] , [ 1241064000000 , 5.7675774480752] , [ 1243742400000 , 5.7882863168337] , [ 1246334400000 , 7.2666010034924] , [ 1249012800000 , 7.519182132226] , [ 1251691200000 , 7.849651451445] , [ 1254283200000 , 10.383992037985] , [ 1256961600000 , 9.0653691861818] , [ 1259557200000 , 9.6705248324159] , [ 1262235600000 , 10.856380561349] , [ 1264914000000 , 11.27452370892] , [ 1267333200000 , 11.754156529088] , [ 1270008000000 , 8.2870811422456] , [ 1272600000000 , 8.0210264360699] , [ 1275278400000 , 7.5375074474865] , [ 1277870400000 , 8.3419527338039] , [ 1280548800000 , 9.4197471818443] , [ 1283227200000 , 8.7321733185797] , [ 1285819200000 , 9.6627062648126] , [ 1288497600000 , 10.187962234549] , [ 1291093200000 , 9.8144201733476] , [ 1293771600000 , 10.275723361713] , [ 1296450000000 , 16.796066079353] , [ 1298869200000 , 17.543254984075] , [ 1301544000000 , 16.673660675084] , [ 1304136000000 , 17.963944353609] , [ 1306814400000 , 16.637740867211] , [ 1309406400000 , 15.84857094609] , [ 1312084800000 , 14.767303362182] , [ 1314763200000 , 24.778452182432] , [ 1317355200000 , 18.370353229999] , [ 1320033600000 , 15.2531374291] , [ 1322629200000 , 14.989600840649] , [ 1325307600000 , 16.052539160125] , [ 1327986000000 , 16.424390322793] , [ 1330491600000 , 17.884020741105] , [ 1333166400000 , 7.1424929577921] , [ 1335758400000 , 7.8076213051482] , [ 1338436800000 , 7.2462684949232]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Health Care" ,
|
||||
"values" : [ [ 1138683600000 , 14.212410956029] , [ 1141102800000 , 13.973193618249] , [ 1143781200000 , 15.218233920665] , [ 1146369600000 , 14.38210972745] , [ 1149048000000 , 13.894310878491] , [ 1151640000000 , 15.593086090032] , [ 1154318400000 , 16.244839695188] , [ 1156996800000 , 16.017088850646] , [ 1159588800000 , 14.183951830055] , [ 1162270800000 , 14.148523245697] , [ 1164862800000 , 13.424326059972] , [ 1167541200000 , 12.974450435753] , [ 1170219600000 , 13.23247041802] , [ 1172638800000 , 13.318762655574] , [ 1175313600000 , 15.961407746104] , [ 1177905600000 , 16.287714639805] , [ 1180584000000 , 16.246590583889] , [ 1183176000000 , 17.564505594809] , [ 1185854400000 , 17.872725373165] , [ 1188532800000 , 18.018998508757] , [ 1191124800000 , 15.584518016603] , [ 1193803200000 , 15.480850647181] , [ 1196398800000 , 15.699120036984] , [ 1199077200000 , 19.184281817226] , [ 1201755600000 , 19.691226605207] , [ 1204261200000 , 18.982314051295] , [ 1206936000000 , 18.707820309008] , [ 1209528000000 , 17.459630929761] , [ 1212206400000 , 16.500616076782] , [ 1214798400000 , 18.086324003979] , [ 1217476800000 , 18.929464156258] , [ 1220155200000 , 18.233728682084] , [ 1222747200000 , 16.315776297325] , [ 1225425600000 , 14.63289219025] , [ 1228021200000 , 14.667835024478] , [ 1230699600000 , 13.946993947308] , [ 1233378000000 , 14.394304684397] , [ 1235797200000 , 13.724462792967] , [ 1238472000000 , 10.930879035806] , [ 1241064000000 , 9.8339915513708] , [ 1243742400000 , 10.053858541872] , [ 1246334400000 , 11.786998438287] , [ 1249012800000 , 11.780994901769] , [ 1251691200000 , 11.305889670276] , [ 1254283200000 , 10.918452290083] , [ 1256961600000 , 9.6811395055706] , [ 1259557200000 , 10.971529744038] , [ 1262235600000 , 13.330210480209] , [ 1264914000000 , 14.592637568961] , [ 1267333200000 , 14.605329141157] , [ 1270008000000 , 13.936853794037] , [ 1272600000000 , 12.189480759072] , [ 1275278400000 , 11.676151385046] , [ 1277870400000 , 13.058852800017] , [ 1280548800000 , 13.62891543203] , [ 1283227200000 , 13.811107569918] , [ 1285819200000 , 13.786494560787] , [ 1288497600000 , 14.04516285753] , [ 1291093200000 , 13.697412447288] , [ 1293771600000 , 13.677681376221] , [ 1296450000000 , 19.961511864531] , [ 1298869200000 , 21.049198298158] , [ 1301544000000 , 22.687631094008] , [ 1304136000000 , 25.469010617433] , [ 1306814400000 , 24.883799437121] , [ 1309406400000 , 24.203843814248] , [ 1312084800000 , 22.138760964038] , [ 1314763200000 , 16.034636966228] , [ 1317355200000 , 15.394958944556] , [ 1320033600000 , 12.625642461969] , [ 1322629200000 , 12.973735699739] , [ 1325307600000 , 15.786018336149] , [ 1327986000000 , 15.227368020134] , [ 1330491600000 , 15.899752650734] , [ 1333166400000 , 18.994731295388] , [ 1335758400000 , 18.450055817702] , [ 1338436800000 , 17.863719889669]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Industrials" ,
|
||||
"values" : [ [ 1138683600000 , 7.1590087090398] , [ 1141102800000 , 7.1297210970108] , [ 1143781200000 , 5.5774588290586] , [ 1146369600000 , 5.4977254491156] , [ 1149048000000 , 5.5138153113634] , [ 1151640000000 , 4.3198084032122] , [ 1154318400000 , 3.9179295839125] , [ 1156996800000 , 3.8110093051479] , [ 1159588800000 , 5.5629020916939] , [ 1162270800000 , 5.7241673711336] , [ 1164862800000 , 5.4715049695004] , [ 1167541200000 , 4.9193763571618] , [ 1170219600000 , 5.136053947247] , [ 1172638800000 , 5.1327258759766] , [ 1175313600000 , 5.1888943925082] , [ 1177905600000 , 5.5191481293345] , [ 1180584000000 , 5.6093625614921] , [ 1183176000000 , 4.2706312987397] , [ 1185854400000 , 4.4453235132117] , [ 1188532800000 , 4.6228003109761] , [ 1191124800000 , 5.0645764756954] , [ 1193803200000 , 5.0723447230959] , [ 1196398800000 , 5.1457765818846] , [ 1199077200000 , 5.4067851597282] , [ 1201755600000 , 5.472241916816] , [ 1204261200000 , 5.3742740389688] , [ 1206936000000 , 6.251751933664] , [ 1209528000000 , 6.1406852153472] , [ 1212206400000 , 5.8164385627465] , [ 1214798400000 , 5.4255846656171] , [ 1217476800000 , 5.3738499417204] , [ 1220155200000 , 5.1815627753979] , [ 1222747200000 , 5.0305983235349] , [ 1225425600000 , 4.6823058607165] , [ 1228021200000 , 4.5941481589093] , [ 1230699600000 , 5.4669598474575] , [ 1233378000000 , 5.1249037357] , [ 1235797200000 , 4.3504421250742] , [ 1238472000000 , 4.6260881026002] , [ 1241064000000 , 5.0140402458946] , [ 1243742400000 , 4.7458462454774] , [ 1246334400000 , 6.0437019654564] , [ 1249012800000 , 6.4595216249754] , [ 1251691200000 , 6.6420468254155] , [ 1254283200000 , 5.8927271960913] , [ 1256961600000 , 5.4712108838003] , [ 1259557200000 , 6.1220254207747] , [ 1262235600000 , 5.5385935169255] , [ 1264914000000 , 5.7383377612639] , [ 1267333200000 , 6.1715976730415] , [ 1270008000000 , 4.0102262681174] , [ 1272600000000 , 3.769389679692] , [ 1275278400000 , 3.5301571031152] , [ 1277870400000 , 2.7660252652526] , [ 1280548800000 , 3.1409983385775] , [ 1283227200000 , 3.0528024863055] , [ 1285819200000 , 4.3126123157971] , [ 1288497600000 , 4.594654041683] , [ 1291093200000 , 4.5424126126793] , [ 1293771600000 , 4.7790043987302] , [ 1296450000000 , 7.4969154058289] , [ 1298869200000 , 7.9424751557821] , [ 1301544000000 , 7.1560736250547] , [ 1304136000000 , 7.9478117337855] , [ 1306814400000 , 7.4109214848895] , [ 1309406400000 , 7.5966457641101] , [ 1312084800000 , 7.165754444071] , [ 1314763200000 , 5.4816702524302] , [ 1317355200000 , 4.9893656089584] , [ 1320033600000 , 4.498385105327] , [ 1322629200000 , 4.6776090358151] , [ 1325307600000 , 8.1350814368063] , [ 1327986000000 , 8.0732769990652] , [ 1330491600000 , 8.5602340387277] , [ 1333166400000 , 5.1293714074325] , [ 1335758400000 , 5.2586794619016] , [ 1338436800000 , 5.1100853569977]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Information Technology" ,
|
||||
"values" : [ [ 1138683600000 , 13.242301508051] , [ 1141102800000 , 12.863536342042] , [ 1143781200000 , 21.034044171629] , [ 1146369600000 , 21.419084618803] , [ 1149048000000 , 21.142678863691] , [ 1151640000000 , 26.568489677529] , [ 1154318400000 , 24.839144939905] , [ 1156996800000 , 25.456187462167] , [ 1159588800000 , 26.350164502826] , [ 1162270800000 , 26.47833320519] , [ 1164862800000 , 26.425979547847] , [ 1167541200000 , 28.191461582256] , [ 1170219600000 , 28.930307448808] , [ 1172638800000 , 29.521413891117] , [ 1175313600000 , 28.188285966466] , [ 1177905600000 , 27.704619625832] , [ 1180584000000 , 27.490862424829] , [ 1183176000000 , 28.770679721286] , [ 1185854400000 , 29.060480671449] , [ 1188532800000 , 28.240998844973] , [ 1191124800000 , 33.004893194127] , [ 1193803200000 , 34.075180359928] , [ 1196398800000 , 32.548560664833] , [ 1199077200000 , 30.629727432728] , [ 1201755600000 , 28.642858788159] , [ 1204261200000 , 27.973575227842] , [ 1206936000000 , 27.393351882726] , [ 1209528000000 , 28.476095288523] , [ 1212206400000 , 29.29667866426] , [ 1214798400000 , 29.222333802896] , [ 1217476800000 , 28.092966093843] , [ 1220155200000 , 28.107159262922] , [ 1222747200000 , 25.482974832098] , [ 1225425600000 , 21.208115993834] , [ 1228021200000 , 20.295043095268] , [ 1230699600000 , 15.925754618401] , [ 1233378000000 , 17.162864628346] , [ 1235797200000 , 17.084345773174] , [ 1238472000000 , 22.246007102281] , [ 1241064000000 , 24.530543998509] , [ 1243742400000 , 25.084184918242] , [ 1246334400000 , 16.606166527358] , [ 1249012800000 , 17.239620011628] , [ 1251691200000 , 17.336739127379] , [ 1254283200000 , 25.478492475753] , [ 1256961600000 , 23.017152085245] , [ 1259557200000 , 25.617745423683] , [ 1262235600000 , 24.061133998642] , [ 1264914000000 , 23.223933318644] , [ 1267333200000 , 24.425887263937] , [ 1270008000000 , 35.501471156693] , [ 1272600000000 , 33.775013878676] , [ 1275278400000 , 30.417993630285] , [ 1277870400000 , 30.023598978467] , [ 1280548800000 , 33.327519522436] , [ 1283227200000 , 31.963388450371] , [ 1285819200000 , 30.498967232092] , [ 1288497600000 , 32.403696817912] , [ 1291093200000 , 31.47736071922] , [ 1293771600000 , 31.53259666241] , [ 1296450000000 , 41.760282761548] , [ 1298869200000 , 45.605771243237] , [ 1301544000000 , 39.986557966215] , [ 1304136000000 , 43.846330510051] , [ 1306814400000 , 39.857316881857] , [ 1309406400000 , 37.675127768208] , [ 1312084800000 , 35.775077970313] , [ 1314763200000 , 48.631009702577] , [ 1317355200000 , 42.830831754505] , [ 1320033600000 , 35.611502589362] , [ 1322629200000 , 35.320136981738] , [ 1325307600000 , 31.564136901516] , [ 1327986000000 , 32.074407502433] , [ 1330491600000 , 35.053013769976] , [ 1333166400000 , 26.434568573937] , [ 1335758400000 , 25.305617871002] , [ 1338436800000 , 24.520919418236]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Materials" ,
|
||||
"values" : [ [ 1138683600000 , 5.5806167415681] , [ 1141102800000 , 5.4539047069985] , [ 1143781200000 , 7.6728842432362] , [ 1146369600000 , 7.719946716654] , [ 1149048000000 , 8.0144619912942] , [ 1151640000000 , 7.942223133434] , [ 1154318400000 , 8.3998279827444] , [ 1156996800000 , 8.532324572605] , [ 1159588800000 , 4.7324285199763] , [ 1162270800000 , 4.7402397487697] , [ 1164862800000 , 4.9042069355168] , [ 1167541200000 , 5.9583963430882] , [ 1170219600000 , 6.3693899239171] , [ 1172638800000 , 6.261153903813] , [ 1175313600000 , 5.3443942184584] , [ 1177905600000 , 5.4932111235361] , [ 1180584000000 , 5.5747393101109] , [ 1183176000000 , 5.3833633060013] , [ 1185854400000 , 5.5125898831832] , [ 1188532800000 , 5.8116112661327] , [ 1191124800000 , 4.3962296939996] , [ 1193803200000 , 4.6967663605521] , [ 1196398800000 , 4.7963004350914] , [ 1199077200000 , 4.1817985183351] , [ 1201755600000 , 4.3797643870182] , [ 1204261200000 , 4.6966642197965] , [ 1206936000000 , 4.3609995132565] , [ 1209528000000 , 4.4736290996496] , [ 1212206400000 , 4.3749762738128] , [ 1214798400000 , 3.3274661194507] , [ 1217476800000 , 3.0316184691337] , [ 1220155200000 , 2.5718140204728] , [ 1222747200000 , 2.7034994044603] , [ 1225425600000 , 2.2033786591364] , [ 1228021200000 , 1.9850621240805] , [ 1230699600000 , 0] , [ 1233378000000 , 0] , [ 1235797200000 , 0] , [ 1238472000000 , 0] , [ 1241064000000 , 0] , [ 1243742400000 , 0] , [ 1246334400000 , 0] , [ 1249012800000 , 0] , [ 1251691200000 , 0] , [ 1254283200000 , 0.44495950017788] , [ 1256961600000 , 0.33945469262483] , [ 1259557200000 , 0.38348269455195] , [ 1262235600000 , 0] , [ 1264914000000 , 0] , [ 1267333200000 , 0] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , 0] , [ 1288497600000 , 0] , [ 1291093200000 , 0] , [ 1293771600000 , 0] , [ 1296450000000 , 0.52216435716176] , [ 1298869200000 , 0.59275786698454] , [ 1301544000000 , 0] , [ 1304136000000 , 0] , [ 1306814400000 , 0] , [ 1309406400000 , 0] , [ 1312084800000 , 0] , [ 1314763200000 , 0] , [ 1317355200000 , 0] , [ 1320033600000 , 0] , [ 1322629200000 , 0] , [ 1325307600000 , 0] , [ 1327986000000 , 0] , [ 1330491600000 , 0] , [ 1333166400000 , 0] , [ 1335758400000 , 0] , [ 1338436800000 , 0]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Telecommunication Services" ,
|
||||
"values" : [ [ 1138683600000 , 3.7056975170243] , [ 1141102800000 , 3.7561118692318] , [ 1143781200000 , 2.861913700854] , [ 1146369600000 , 2.9933744103381] , [ 1149048000000 , 2.7127537218463] , [ 1151640000000 , 3.1195497076283] , [ 1154318400000 , 3.4066964004508] , [ 1156996800000 , 3.3754571113569] , [ 1159588800000 , 2.2965579982924] , [ 1162270800000 , 2.4486818633018] , [ 1164862800000 , 2.4002308848517] , [ 1167541200000 , 1.9649579750349] , [ 1170219600000 , 1.9385263638056] , [ 1172638800000 , 1.9128975336387] , [ 1175313600000 , 2.3412869836298] , [ 1177905600000 , 2.4337870351445] , [ 1180584000000 , 2.62179703171] , [ 1183176000000 , 3.2642864957929] , [ 1185854400000 , 3.3200396223709] , [ 1188532800000 , 3.3934212707572] , [ 1191124800000 , 4.2822327088179] , [ 1193803200000 , 4.1474964228541] , [ 1196398800000 , 4.1477082879801] , [ 1199077200000 , 5.2947122916128] , [ 1201755600000 , 5.2919843508028] , [ 1204261200000 , 5.1989783050309] , [ 1206936000000 , 3.5603057673513] , [ 1209528000000 , 3.3009087690692] , [ 1212206400000 , 3.1784852603792] , [ 1214798400000 , 4.5889503538868] , [ 1217476800000 , 4.401779617494] , [ 1220155200000 , 4.2208301828278] , [ 1222747200000 , 3.89396671475] , [ 1225425600000 , 3.0423832241354] , [ 1228021200000 , 3.135520611578] , [ 1230699600000 , 1.9631418164089] , [ 1233378000000 , 1.8963543874958] , [ 1235797200000 , 1.8266636017025] , [ 1238472000000 , 0.93136635895188] , [ 1241064000000 , 0.92737801918888] , [ 1243742400000 , 0.97591889805002] , [ 1246334400000 , 2.6841193805515] , [ 1249012800000 , 2.5664341140531] , [ 1251691200000 , 2.3887523699873] , [ 1254283200000 , 1.1737801663681] , [ 1256961600000 , 1.0953582317281] , [ 1259557200000 , 1.2495674976653] , [ 1262235600000 , 0.36607452464754] , [ 1264914000000 , 0.3548719047291] , [ 1267333200000 , 0.36769242398939] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , 0.85450741275337] , [ 1288497600000 , 0.91360317921637] , [ 1291093200000 , 0.89647678692269] , [ 1293771600000 , 0.87800687192639] , [ 1296450000000 , 0] , [ 1298869200000 , 0] , [ 1301544000000 , 0.43668720882994] , [ 1304136000000 , 0.4756523602692] , [ 1306814400000 , 0.46947368328469] , [ 1309406400000 , 0.45138896152316] , [ 1312084800000 , 0.43828726648117] , [ 1314763200000 , 2.0820861395316] , [ 1317355200000 , 0.9364411075395] , [ 1320033600000 , 0.60583907839773] , [ 1322629200000 , 0.61096950747437] , [ 1325307600000 , 0] , [ 1327986000000 , 0] , [ 1330491600000 , 0] , [ 1333166400000 , 0] , [ 1335758400000 , 0] , [ 1338436800000 , 0]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Utilities" ,
|
||||
"values" : [ [ 1138683600000 , 0] , [ 1141102800000 , 0] , [ 1143781200000 , 0] , [ 1146369600000 , 0] , [ 1149048000000 , 0] , [ 1151640000000 , 0] , [ 1154318400000 , 0] , [ 1156996800000 , 0] , [ 1159588800000 , 0] , [ 1162270800000 , 0] , [ 1164862800000 , 0] , [ 1167541200000 , 0] , [ 1170219600000 , 0] , [ 1172638800000 , 0] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , 0] , [ 1185854400000 , 0] , [ 1188532800000 , 0] , [ 1191124800000 , 0] , [ 1193803200000 , 0] , [ 1196398800000 , 0] , [ 1199077200000 , 0] , [ 1201755600000 , 0] , [ 1204261200000 , 0] , [ 1206936000000 , 0] , [ 1209528000000 , 0] , [ 1212206400000 , 0] , [ 1214798400000 , 0] , [ 1217476800000 , 0] , [ 1220155200000 , 0] , [ 1222747200000 , 0] , [ 1225425600000 , 0] , [ 1228021200000 , 0] , [ 1230699600000 , 0] , [ 1233378000000 , 0] , [ 1235797200000 , 0] , [ 1238472000000 , 0] , [ 1241064000000 , 0] , [ 1243742400000 , 0] , [ 1246334400000 , 0] , [ 1249012800000 , 0] , [ 1251691200000 , 0] , [ 1254283200000 , 0] , [ 1256961600000 , 0] , [ 1259557200000 , 0] , [ 1262235600000 , 0] , [ 1264914000000 , 0] , [ 1267333200000 , 0] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , 0] , [ 1288497600000 , 0] , [ 1291093200000 , 0] , [ 1293771600000 , 0] , [ 1296450000000 , 0] , [ 1298869200000 , 0] , [ 1301544000000 , 0] , [ 1304136000000 , 0] , [ 1306814400000 , 0] , [ 1309406400000 , 0] , [ 1312084800000 , 0] , [ 1314763200000 , 0] , [ 1317355200000 , 0] , [ 1320033600000 , 0] , [ 1322629200000 , 0] , [ 1325307600000 , 0] , [ 1327986000000 , 0] , [ 1330491600000 , 0] , [ 1333166400000 , 0] , [ 1335758400000 , 0] , [ 1338436800000 , 0]]
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
// for testing single data point
|
||||
var histcatexplong_singledatapoint = [
|
||||
{
|
||||
"key" : "Consumer Discretionary" ,
|
||||
"values" : [ [ 1138683600000 , 27.38478809681]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Consumer Staples" ,
|
||||
"values" : [ [ 1138683600000 , 7.2800122043237]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Energy" ,
|
||||
"values" : [ [ 1138683600000 , 1.544303464167]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Financials" ,
|
||||
"values" : [ [ 1138683600000 , 13.356778764352]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Health Care" ,
|
||||
"values" : [ [ 1138683600000 , 14.212410956029]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Industrials" ,
|
||||
"values" : [ [ 1138683600000 , 7.1590087090398]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Information Technology" ,
|
||||
"values" : [ [ 1138683600000 , 13.242301508051]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Materials" ,
|
||||
"values" : [ [ 1138683600000 , 5.5806167415681]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Telecommunication Services" ,
|
||||
"values" : [ [ 1138683600000 , 3.7056975170243]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Utilities" ,
|
||||
"values" : [ [ 1138683600000 , 0]]
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
// for testing two data point s
|
||||
var histcatexplong_twodatapoint = [
|
||||
{
|
||||
"key" : "Consumer Discretionary" ,
|
||||
"values" : [ [ 1138683600000 , 27.38478809681], [ 1141102800000 , 29.4] ]
|
||||
} ,
|
||||
{
|
||||
"key" : "Consumer Staples" ,
|
||||
"values" : [ [ 1138683600000 , 7.2800122043237], [ 1141102800000 , 6.7]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Energy" ,
|
||||
"values" : [ [ 1138683600000 , 1.544303464167], [ 1141102800000 , 2.4]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Financials" ,
|
||||
"values" : [ [ 1138683600000 , 13.356778764352], [ 1141102800000 , 19.2]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Health Care" ,
|
||||
"values" : [ [ 1138683600000 , 14.212410956029], [ 1141102800000 , 15.4]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Industrials" ,
|
||||
"values" : [ [ 1138683600000 , 7.1590087090398], [ 1141102800000 , 10.3]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Information Technology" ,
|
||||
"values" : [ [ 1138683600000 , 13.242301508051], [ 1141102800000 , 14.3]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Materials" ,
|
||||
"values" : [ [ 1138683600000 , 5.5806167415681], [ 1141102800000 , 3.2]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Telecommunication Services" ,
|
||||
"values" : [ [ 1138683600000 , 3.7056975170243], [ 1141102800000 , 1.3]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Utilities" ,
|
||||
"values" : [ [ 1138683600000 , 0], [ 1141102800000 , 2]]
|
||||
}
|
||||
];
|
||||
|
||||
var histcatexplong_withholes = [
|
||||
{
|
||||
"key" : "Consumer Discretionary" ,
|
||||
"values" : [ [ 1138683600000 , 27.38478809681] , [ 1141102800000 , 27.371377218208] , [ 1143781200000 , 26.309915460827] , [ 1146369600000 , 26.425199957521] , [ 1149048000000 , 26.823411519395] , [ 1151640000000 , 23.850443591584] , [ 1154318400000 , 23.158355444054] , [ 1156996800000 , 22.998689393694] , [ 1159588800000 , 27.977128511299] , [ 1162270800000 , 29.073672469721] , [ 1164862800000 , 28.587640408904] , [ 1167541200000 , 22.788453687638] , [ 1170219600000 , 22.429199073597] , [ 1172638800000 , 22.324103271051] , [ 1175313600000 , 17.558388444186] , [ 1177905600000 , 16.769518096208] , [ 1180584000000 , 16.214738201302] , [ 1183176000000 , 18.729632971228] , [ 1185854400000 , 18.814523318848] , [ 1188532800000 , 19.789986451358] , [ 1191124800000 , 17.070049054933] , [ 1193803200000 , 16.121349575715] , [ 1196398800000 , 15.141659430091] , [ 1199077200000 , 0] , [ 1201755600000 , 0] , [ 1204261200000 , 0] , [ 1206936000000 , 19.231263773952] , [ 1209528000000 , 18.446256391094] , [ 1212206400000 , 17.822632399764] , [ 1214798400000 , 15.539366475979] , [ 1217476800000 , 15.255131790216] , [ 1220155200000 , 15.660963922593] , [ 1222747200000 , 13.254482273697] , [ 1225425600000 , 11.920796202299] , [ 1228021200000 , 12.122809090925] , [ 1230699600000 , 15.691026271393] , [ 1233378000000 , 14.720881635107] , [ 1235797200000 , 15.387939360044] , [ 1238472000000 , 13.765436672229] , [ 1241064000000 , 14.6314458648] , [ 1243742400000 , 14.292446536221] , [ 1246334400000 , 16.170071367016] , [ 1249012800000 , 15.948135554337] , [ 1251691200000 , 16.612872685134] , [ 1254283200000 , 18.778338719091] , [ 1256961600000 , 16.75602606542] , [ 1259557200000 , 19.385804443147] , [ 1262235600000 , 22.950590240168] , [ 1264914000000 , 23.61159018141] , [ 1267333200000 , 25.708586989581] , [ 1270008000000 , 26.883915999885] , [ 1272600000000 , 25.893486687065] , [ 1275278400000 , 24.678914263176] , [ 1277870400000 , 25.937275793023] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , 29.057235285673] , [ 1288497600000 , 28.549434189386] , [ 1291093200000 , 28.506352379723] , [ 1293771600000 , 29.449241421597] , [ 1296450000000 , 25.796838168807] , [ 1298869200000 , 28.740145449189] , [ 1301544000000 , 22.091744141872] , [ 1304136000000 , 25.079662545409] , [ 1306814400000 , 23.674906973064] , [ 1309406400000 , 23.41800274293] , [ 1312084800000 , 23.243644138871] , [ 1314763200000 , 31.591854066817] , [ 1317355200000 , 31.497112374114] , [ 1320033600000 , 26.672380820431] , [ 1322629200000 , 27.297080015495] , [ 1325307600000 , 20.174315530051] , [ 1327986000000 , 19.631084213899] , [ 1330491600000 , 20.366462219462] , [ 1333166400000 , 17.429019937289] , [ 1335758400000 , 16.75543633539] , [ 1338436800000 , 16.182906906042]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Consumer Staples" ,
|
||||
"values" : [ [ 1138683600000 , 7.2800122043237] , [ 1141102800000 , 7.1187787503354] , [ 1143781200000 , 8.351887016482] , [ 1146369600000 , 8.4156698763993] , [ 1149048000000 , 8.1673298604231] , [ 1151640000000 , 5.5132447126042] , [ 1154318400000 , 6.1152537710599] , [ 1156996800000 , 6.076765091942] , [ 1159588800000 , 4.6304473798646] , [ 1162270800000 , 4.6301068469402] , [ 1164862800000 , 4.3466656309389] , [ 1167541200000 , 6.830104897003] , [ 1170219600000 , 7.241633040029] , [ 1172638800000 , 7.1432372054153] , [ 1175313600000 , 10.608942063374] , [ 1177905600000 , 10.914964549494] , [ 1180584000000 , 10.933223880565] , [ 1183176000000 , 8.3457524851265] , [ 1185854400000 , 8.1078413081882] , [ 1188532800000 , 8.2697185922474] , [ 1191124800000 , 8.4742436475968] , [ 1193803200000 , 8.4994601179319] , [ 1196398800000 , 8.7387319683243] , [ 1199077200000 , 6.8829183612895] , [ 1201755600000 , 6.984133637885] , [ 1204261200000 , 7.0860136043287] , [ 1206936000000 , 4.3961787956053] , [ 1209528000000 , 3.8699674365231] , [ 1212206400000 , 3.6928925238305] , [ 1214798400000 , 6.7571718894253] , [ 1217476800000 , 6.4367313362344] , [ 1220155200000 , 6.4048441521454] , [ 1222747200000 , 5.4643833239669] , [ 1225425600000 , 5.3150786833374] , [ 1228021200000 , 5.3011272612576] , [ 1230699600000 , 4.1203601430809] , [ 1233378000000 , 4.0881783200525] , [ 1235797200000 , 4.1928665957189] , [ 1238472000000 , 7.0249415663205] , [ 1241064000000 , 7.006530880769] , [ 1243742400000 , 6.994835633224] , [ 1246334400000 , 6.1220222336254] , [ 1249012800000 , 6.1177436137653] , [ 1251691200000 , 6.1413396231981] , [ 1254283200000 , 4.8046006145874] , [ 1256961600000 , 4.6647600660544] , [ 1259557200000 , 4.544865006255] , [ 1262235600000 , 6.0488249316539] , [ 1264914000000 , 6.3188669540206] , [ 1267333200000 , 6.5873958262306] , [ 1270008000000 , 6.2281189839578] , [ 1272600000000 , 5.8948915746059] , [ 1275278400000 , 5.5967320482214] , [ 1277870400000 , 0.99784432084837] , [ 1280548800000 , 1.0950794175359] , [ 1283227200000 , 0.94479734407491] , [ 1285819200000 , 1.222093988688] , [ 1288497600000 , 1.335093106856] , [ 1291093200000 , 1.3302565104985] , [ 1293771600000 , 1.340824670897] , [ 1296450000000 , 0] , [ 1298869200000 , 0] , [ 1301544000000 , 0] , [ 1304136000000 , 0] , [ 1306814400000 , 0] , [ 1309406400000 , 0] , [ 1312084800000 , 0] , [ 1314763200000 , 0] , [ 1317355200000 , 4.4583692315] , [ 1320033600000 , 3.6493043348059] , [ 1322629200000 , 3.8610064091761] , [ 1325307600000 , 5.5144800685202] , [ 1327986000000 , 5.1750695220792] , [ 1330491600000 , 5.6710066952691] , [ 1333166400000 , 8.5658461590953] , [ 1335758400000 , 8.6135447714243] , [ 1338436800000 , 8.0231460925212]]
|
||||
}];
|
||||
|
||||
var histcatexpshort = [
|
||||
{
|
||||
"key" : "Consumer Staples" ,
|
||||
"values" : [ [ 1138683600000 , 0] , [ 1141102800000 , 0] , [ 1143781200000 , 0] , [ 1146369600000 , 0] , [ 1149048000000 , 0] , [ 1151640000000 , 0] , [ 1154318400000 , 0] , [ 1156996800000 , 0] , [ 1159588800000 , 0] , [ 1162270800000 , 0] , [ 1164862800000 , 0] , [ 1167541200000 , -0.24102139376003] , [ 1170219600000 , -0.69960584365035] , [ 1172638800000 , -0.67365051426185] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , -0.31429312464988] , [ 1185854400000 , -0.90018700397153] , [ 1188532800000 , -0.96926214328714] , [ 1191124800000 , -1.1343386468131] , [ 1193803200000 , -1.1335426595455] , [ 1196398800000 , -1.2327663032424] , [ 1199077200000 , -0.41027135492155] , [ 1201755600000 , -0.41779167524802] , [ 1204261200000 , -0.38133883625885] , [ 1206936000000 , 0] , [ 1209528000000 , -0.32550520320253] , [ 1212206400000 , -0.33185144615505] , [ 1214798400000 , -0.68609668877894] , [ 1217476800000 , -0.70001207744308] , [ 1220155200000 , -0.68378680840919] , [ 1222747200000 , -0.40908783182034] , [ 1225425600000 , -0.39074266525646] , [ 1228021200000 , -0.40358490474562] , [ 1230699600000 , -0.85752207262267] , [ 1233378000000 , -0.74395750438805] , [ 1235797200000 , -0.70718832429489] , [ 1238472000000 , -0.76244465406965] , [ 1241064000000 , -0.67618572591984] , [ 1243742400000 , -0.67649596761402] , [ 1246334400000 , -0.94618002703247] , [ 1249012800000 , -0.95408485581014] , [ 1251691200000 , -0.96272139504276] , [ 1254283200000 , 0] , [ 1256961600000 , 0] , [ 1259557200000 , 0] , [ 1262235600000 , 0] , [ 1264914000000 , 0] , [ 1267333200000 , 0] , [ 1270008000000 , -0.25516420149471] , [ 1272600000000 , -0.24106264576017] , [ 1275278400000 , -0.22802547751448] , [ 1277870400000 , -0.62187524046697] , [ 1280548800000 , -0.72155608677106] , [ 1283227200000 , -0.70221659944774] , [ 1285819200000 , -1.1117002584543] , [ 1288497600000 , -1.190911001336] , [ 1291093200000 , -1.1781082003972] , [ 1293771600000 , -1.2125860264875] , [ 1296450000000 , -1.7748010365657] , [ 1298869200000 , -1.8919594178596] , [ 1301544000000 , -1.7077946421533] , [ 1304136000000 , -2.024238803094] , [ 1306814400000 , -1.9769844081819] , [ 1309406400000 , -2.0730275464065] , [ 1312084800000 , -1.9690128240888] , [ 1314763200000 , -5.5557852269348] , [ 1317355200000 , -7.2527933190641] , [ 1320033600000 , -5.7367677053109] , [ 1322629200000 , -6.0409316206662] , [ 1325307600000 , -4.6511525539195] , [ 1327986000000 , -4.526116059083] , [ 1330491600000 , -4.846292325197] , [ 1333166400000 , -2.2663198779425] , [ 1335758400000 , -2.4172072568564] , [ 1338436800000 , -2.3204729601189]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Consumer Discretionary" ,
|
||||
"values" : [ [ 1138683600000 , -0.62238434102863] , [ 1141102800000 , -0.61484565039024] , [ 1143781200000 , -1.0769367918668] , [ 1146369600000 , -1.2221156604129] , [ 1149048000000 , -1.2434858263377] , [ 1151640000000 , -0.58606435489597] , [ 1154318400000 , -0.61478911495141] , [ 1156996800000 , -0.61429362688591] , [ 1159588800000 , -1.1168614112788] , [ 1162270800000 , -1.1510268716612] , [ 1164862800000 , -1.1104724164222] , [ 1167541200000 , -1.2298338563471] , [ 1170219600000 , -1.5053664389104] , [ 1172638800000 , -1.5535266372193] , [ 1175313600000 , -3.1690472535854] , [ 1177905600000 , -3.1273013967041] , [ 1180584000000 , -3.155466271777] , [ 1183176000000 , -3.7158562579437] , [ 1185854400000 , -3.8244546635586] , [ 1188532800000 , -3.5524464859972] , [ 1191124800000 , -3.0472339109128] , [ 1193803200000 , -3.064978140815] , [ 1196398800000 , -3.0818130124986] , [ 1199077200000 , -2.9806791138312] , [ 1201755600000 , -3.7360958775824] , [ 1204261200000 , -3.4687841733263] , [ 1206936000000 , -3.3702018615806] , [ 1209528000000 , -3.1982756208679] , [ 1212206400000 , -3.0489433155104] , [ 1214798400000 , -3.7008275605963] , [ 1217476800000 , -3.8980507260892] , [ 1220155200000 , -3.7680083260241] , [ 1222747200000 , -3.2061890012391] , [ 1225425600000 , -2.6727551440484] , [ 1228021200000 , -2.4469327462935] , [ 1230699600000 , -3.0192419668784] , [ 1233378000000 , -2.892958553476] , [ 1235797200000 , -3.1153570053479] , [ 1238472000000 , -2.9927580570711] , [ 1241064000000 , -3.5061796706294] , [ 1243742400000 , -3.2944159516725] , [ 1246334400000 , -3.4154213240617] , [ 1249012800000 , -3.6492125438171] , [ 1251691200000 , -3.6674164998394] , [ 1254283200000 , -4.6271484977727] , [ 1256961600000 , -4.2433407292676] , [ 1259557200000 , -4.4742625247274] , [ 1262235600000 , -5.2078214612359] , [ 1264914000000 , -5.2209579214469] , [ 1267333200000 , -5.4596395756061] , [ 1270008000000 , -5.6906459276584] , [ 1272600000000 , -6.4981737808665] , [ 1275278400000 , -6.2563044048578] , [ 1277870400000 , -6.175479487959] , [ 1280548800000 , -6.6641002427295] , [ 1283227200000 , -6.3648667745556] , [ 1285819200000 , -5.0270168607884] , [ 1288497600000 , -5.1186072976233] , [ 1291093200000 , -5.1127601587872] , [ 1293771600000 , -5.3015262972641] , [ 1296450000000 , -4.4295728671596] , [ 1298869200000 , -4.5488139745696] , [ 1301544000000 , -2.9021260315957] , [ 1304136000000 , -3.1482096241139] , [ 1306814400000 , -2.8648831814763] , [ 1309406400000 , -2.8149423433441] , [ 1312084800000 , -2.6350669145713] , [ 1314763200000 , -5.9871754759038] , [ 1317355200000 , -8.6127555816399] , [ 1320033600000 , -7.0712887348892] , [ 1322629200000 , -7.3930257999857] , [ 1325307600000 , -6.5183071556304] , [ 1327986000000 , -7.4388913793503] , [ 1330491600000 , -8.2134465182649] , [ 1333166400000 , -7.7836036697105] , [ 1335758400000 , -8.0955053683936] , [ 1338436800000 , -8.0981845818893]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Energy" ,
|
||||
"values" : [ [ 1138683600000 , -0.95707527558303] , [ 1141102800000 , -0.78324346694487] , [ 1143781200000 , -1.2905241058019] , [ 1146369600000 , -1.3880880486779] , [ 1149048000000 , -1.3337247185993] , [ 1151640000000 , -1.0342112071924] , [ 1154318400000 , -1.1264764100183] , [ 1156996800000 , -1.0001002640852] , [ 1159588800000 , -0.85341153093953] , [ 1162270800000 , -0.88452017844596] , [ 1164862800000 , -0.84305725300642] , [ 1167541200000 , -1.0874455682301] , [ 1170219600000 , -1.1714969043168] , [ 1172638800000 , -1.1445856467934] , [ 1175313600000 , -1.1928513334073] , [ 1177905600000 , -1.2365691634265] , [ 1180584000000 , -1.2690940962478] , [ 1183176000000 , -1.662233774695] , [ 1185854400000 , -1.745760538781] , [ 1188532800000 , -1.5209200931271] , [ 1191124800000 , -1.7874791820886] , [ 1193803200000 , -1.7755668105117] , [ 1196398800000 , -1.5456069064618] , [ 1199077200000 , -1.7077541586335] , [ 1201755600000 , -1.6462081650757] , [ 1204261200000 , -1.8624735339628] , [ 1206936000000 , -0.71073453533048] , [ 1209528000000 , -0.75380709640219] , [ 1212206400000 , -0.71020554911716] , [ 1214798400000 , -1.2077850914504] , [ 1217476800000 , -1.0505576787644] , [ 1220155200000 , -0.97804595164878] , [ 1222747200000 , -0.34591294663671] , [ 1225425600000 , -0.19958331514025] , [ 1228021200000 , -0.17599782216296] , [ 1230699600000 , -0.49577714121027] , [ 1233378000000 , -0.51644059173978] , [ 1235797200000 , -0.48576859637083] , [ 1238472000000 , -0.75596531126452] , [ 1241064000000 , -0.72073358315801] , [ 1243742400000 , -0.82125996732294] , [ 1246334400000 , -1.4933216860121] , [ 1249012800000 , -1.5003760525933] , [ 1251691200000 , -1.4744921420596] , [ 1254283200000 , -1.8197844060652] , [ 1256961600000 , -1.6558574419626] , [ 1259557200000 , -1.7256149254159] , [ 1262235600000 , -2.7667194124217] , [ 1264914000000 , -2.9113351806903] , [ 1267333200000 , -3.0172806042796] , [ 1270008000000 , -2.8607175559701] , [ 1272600000000 , -2.629226972169] , [ 1275278400000 , -2.1855196883832] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , -1.3788733828844] , [ 1288497600000 , -1.4136792139765] , [ 1291093200000 , -1.5176522942901] , [ 1293771600000 , -1.5776651933208] , [ 1296450000000 , -1.7171675182182] , [ 1298869200000 , -1.8121885250566] , [ 1301544000000 , -1.2221934283206] , [ 1304136000000 , -1.2910715239439] , [ 1306814400000 , -1.1492301612576] , [ 1309406400000 , -1.0613891302841] , [ 1312084800000 , -0.99605193205308] , [ 1314763200000 , -1.7324212072278] , [ 1317355200000 , -1.5226856867477] , [ 1320033600000 , -1.3159138896549] , [ 1322629200000 , -1.3925952659299] , [ 1325307600000 , -1.59624913621] , [ 1327986000000 , -1.5235879880296] , [ 1330491600000 , -1.7315573519279] , [ 1333166400000 , -0.86883431220926] , [ 1335758400000 , -0.90144871282829] , [ 1338436800000 , -0.7010492182517]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Financials" ,
|
||||
"values" : [ [ 1138683600000 , -0.56797103580254] , [ 1141102800000 , -0.57324319174933] , [ 1143781200000 , -1.1014818753272] , [ 1146369600000 , -1.1480256918118] , [ 1149048000000 , -1.0709335336775] , [ 1151640000000 , -0.84876993929658] , [ 1154318400000 , -0.88122638919979] , [ 1156996800000 , -0.86421146074279] , [ 1159588800000 , -0.95093689377974] , [ 1162270800000 , -0.96646862382248] , [ 1164862800000 , -0.96726919442167] , [ 1167541200000 , -0.99874655234936] , [ 1170219600000 , -1.0004843898938] , [ 1172638800000 , -0.9925349676815] , [ 1175313600000 , -1.1888941931287] , [ 1177905600000 , -1.9402228220929] , [ 1180584000000 , -2.03915987194] , [ 1183176000000 , -2.4620526931074] , [ 1185854400000 , -2.2423544651877] , [ 1188532800000 , -1.8790998536037] , [ 1191124800000 , -0.43246873489492] , [ 1193803200000 , -0.40142684216371] , [ 1196398800000 , -0.35646635110466] , [ 1199077200000 , -0.90385702817642] , [ 1201755600000 , -0.86997575249605] , [ 1204261200000 , -0.80101406775415] , [ 1206936000000 , 0] , [ 1209528000000 , 0] , [ 1212206400000 , 0] , [ 1214798400000 , -0.31816167663298] , [ 1217476800000 , -0.309250081849] , [ 1220155200000 , -0.27723698582762] , [ 1222747200000 , -0.32001379372079] , [ 1225425600000 , -0.1940212908561] , [ 1228021200000 , -0.051964569203423] , [ 1230699600000 , -0.68342686502452] , [ 1233378000000 , -0.57645644730726] , [ 1235797200000 , -0.50860972184555] , [ 1238472000000 , -0.44405217759605] , [ 1241064000000 , -0.45224333626901] , [ 1243742400000 , -0.41691818252313] , [ 1246334400000 , -2.4654561579904] , [ 1249012800000 , -2.5473566378551] , [ 1251691200000 , -2.8340604021307] , [ 1254283200000 , -1.8452445924041] , [ 1256961600000 , -1.5626544265386] , [ 1259557200000 , -1.707842764916] , [ 1262235600000 , -1.2237258567344] , [ 1264914000000 , -1.9756896168227] , [ 1267333200000 , -2.0920321696833] , [ 1270008000000 , -1.9782327706952] , [ 1272600000000 , -2.0416328165753] , [ 1275278400000 , -1.7816736134798] , [ 1277870400000 , -0.66092275437689] , [ 1280548800000 , -0.73608099025756] , [ 1283227200000 , -0.63686713461189] , [ 1285819200000 , -0.0024159482973197] , [ 1288497600000 , -0.0023052643588188] , [ 1291093200000 , -0.0023008251965446] , [ 1293771600000 , -0.002247807834351] , [ 1296450000000 , -0.62004345920743] , [ 1298869200000 , -0.69634926653235] , [ 1301544000000 , -0.76013525555354] , [ 1304136000000 , -1.505368495849] , [ 1306814400000 , -1.3456949237707] , [ 1309406400000 , -1.3013934898695] , [ 1312084800000 , -1.183199519395] , [ 1314763200000 , -0.0074317809719494] , [ 1317355200000 , -0.019430458325379] , [ 1320033600000 , -0.015777413509084] , [ 1322629200000 , -0.016463879837718] , [ 1325307600000 , -0.0031338919976225] , [ 1327986000000 , -0.0029770278967514] , [ 1330491600000 , -0.003048902987439] , [ 1333166400000 , -0.71171545945298] , [ 1335758400000 , -0.72003299240508] , [ 1338436800000 , -0.72961974845039]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Health Care" ,
|
||||
"values" : [ [ 1138683600000 , 0] , [ 1141102800000 , 0] , [ 1143781200000 , 0] , [ 1146369600000 , 0] , [ 1149048000000 , 0] , [ 1151640000000 , 0] , [ 1154318400000 , 0] , [ 1156996800000 , 0] , [ 1159588800000 , 0] , [ 1162270800000 , 0] , [ 1164862800000 , 0] , [ 1167541200000 , 0] , [ 1170219600000 , 0] , [ 1172638800000 , 0] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , -0.16816074963595] , [ 1185854400000 , -0.19318598121302] , [ 1188532800000 , -0.20130864403797] , [ 1191124800000 , 0] , [ 1193803200000 , 0] , [ 1196398800000 , 0] , [ 1199077200000 , 0] , [ 1201755600000 , 0] , [ 1204261200000 , 0] , [ 1206936000000 , 0] , [ 1209528000000 , 0] , [ 1212206400000 , 0] , [ 1214798400000 , -0.30476443991021] , [ 1217476800000 , -0.31836730824777] , [ 1220155200000 , -0.30797427879366] , [ 1222747200000 , -0.48318623977865] , [ 1225425600000 , -0.50834562674351] , [ 1228021200000 , -0.47936068182503] , [ 1230699600000 , -0.61753010081956] , [ 1233378000000 , -0.59493587396819] , [ 1235797200000 , -0.62664324339064] , [ 1238472000000 , 0] , [ 1241064000000 , 0] , [ 1243742400000 , 0] , [ 1246334400000 , 0] , [ 1249012800000 , 0] , [ 1251691200000 , 0] , [ 1254283200000 , -1.3076157801726] , [ 1256961600000 , -1.2306204787628] , [ 1259557200000 , -1.4728435992801] , [ 1262235600000 , -1.7729831226837] , [ 1264914000000 , -1.7711733839842] , [ 1267333200000 , -1.8233584472099] , [ 1270008000000 , -1.8505979461969] , [ 1272600000000 , -1.5989071613823] , [ 1275278400000 , -1.6636770720413] , [ 1277870400000 , -1.4523909758725] , [ 1280548800000 , -1.503771584105] , [ 1283227200000 , -1.5458561450475] , [ 1285819200000 , -1.457331837483] , [ 1288497600000 , -1.4217332434071] , [ 1291093200000 , -1.4687927303394] , [ 1293771600000 , -1.437223057967] , [ 1296450000000 , -0.72221871524334] , [ 1298869200000 , -0.7399575414588] , [ 1301544000000 , -1.9712239746745] , [ 1304136000000 , -2.2360949351942] , [ 1306814400000 , -2.2147572530541] , [ 1309406400000 , -2.0440932285023] , [ 1312084800000 , -1.9438209561938] , [ 1314763200000 , -4.9035620630386] , [ 1317355200000 , -4.9036674804213] , [ 1320033600000 , -4.1900706458801] , [ 1322629200000 , -4.5602615827955] , [ 1325307600000 , -1.9194421885814] , [ 1327986000000 , -1.8854470816382] , [ 1330491600000 , -1.9514785018245] , [ 1333166400000 , -0.65282205870454] , [ 1335758400000 , -0.57068368199209] , [ 1338436800000 , -0.55902563384907]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Industrials" ,
|
||||
"values" : [ [ 1138683600000 , -0.390983707093] , [ 1141102800000 , -0.38471122730537] , [ 1143781200000 , -0.22897173467143] , [ 1146369600000 , -0.23798946472286] , [ 1149048000000 , -0.20721233428173] , [ 1151640000000 , -0.54577697700394] , [ 1154318400000 , -0.50300252995937] , [ 1156996800000 , -0.49609518628103] , [ 1159588800000 , -0.19582276889273] , [ 1162270800000 , -0.60399139945108] , [ 1164862800000 , -0.61477368082886] , [ 1167541200000 , -0.13665869881705] , [ 1170219600000 , -0.13147565243332] , [ 1172638800000 , -0.11819441593356] , [ 1175313600000 , -0.41610825689528] , [ 1177905600000 , -0.38815419659358] , [ 1180584000000 , -0.3703838943035] , [ 1183176000000 , -1.6193903804534] , [ 1185854400000 , -1.6502660417328] , [ 1188532800000 , -1.481875010149] , [ 1191124800000 , -0.96180099322536] , [ 1193803200000 , -0.97017301394967] , [ 1196398800000 , -0.97432971260093] , [ 1199077200000 , -0.36071934518387] , [ 1201755600000 , -0.42150070991777] , [ 1204261200000 , -0.41784042793202] , [ 1206936000000 , -0.70494708349169] , [ 1209528000000 , -0.73449590911984] , [ 1212206400000 , -0.7400163600788] , [ 1214798400000 , -0.52584502195668] , [ 1217476800000 , -0.56224806965368] , [ 1220155200000 , -0.50830855192741] , [ 1222747200000 , -0.79494637898049] , [ 1225425600000 , -0.70391433947286] , [ 1228021200000 , -0.61420660317009] , [ 1230699600000 , -0.41699636242004] , [ 1233378000000 , -0.3779041158185] , [ 1235797200000 , -0.34282498854047] , [ 1238472000000 , -0.83845630450592] , [ 1241064000000 , -0.85937944918912] , [ 1243742400000 , -0.85530287999615] , [ 1246334400000 , -1.2819866264007] , [ 1249012800000 , -1.4598491663715] , [ 1251691200000 , -1.5261472177779] , [ 1254283200000 , -1.2503948993549] , [ 1256961600000 , -1.1767079775724] , [ 1259557200000 , -1.2585538260386] , [ 1262235600000 , -3.420972598165] , [ 1264914000000 , -3.3381337072954] , [ 1267333200000 , -3.7043129330694] , [ 1270008000000 , -4.6924500756609] , [ 1272600000000 , -4.6880683704908] , [ 1275278400000 , -4.3335249071719] , [ 1277870400000 , -3.6545810416445] , [ 1280548800000 , -4.1639787701262] , [ 1283227200000 , -3.8249597612047] , [ 1285819200000 , -0.33221815335641] , [ 1288497600000 , -0.33346468179047] , [ 1291093200000 , -0.34546911228789] , [ 1293771600000 , -0.36609971997147] , [ 1296450000000 , -0.42502545672607] , [ 1298869200000 , -0.38192733348507] , [ 1301544000000 , -0.01991033447621] , [ 1304136000000 , -0.020319195299659] , [ 1306814400000 , -0.018147820835144] , [ 1309406400000 , -0.017923186209383] , [ 1312084800000 , -0.016133999253684] , [ 1314763200000 , -0.72058656278977] , [ 1317355200000 , -0.42812646564889] , [ 1320033600000 , -0.35896134792589] , [ 1322629200000 , -0.38637896444549] , [ 1325307600000 , -0.31794663984021] , [ 1327986000000 , -0.32220831831888] , [ 1330491600000 , -0.37107872672214] , [ 1333166400000 , -0.81968633933695] , [ 1335758400000 , -0.77148300885994] , [ 1338436800000 , -0.77392261735539]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Information Technology" ,
|
||||
"values" : [ [ 1138683600000 , -0.86346955704548] , [ 1141102800000 , -0.88352373534584] , [ 1143781200000 , -1.2630802711685] , [ 1146369600000 , -1.2352593999242] , [ 1149048000000 , -1.2086379045093] , [ 1151640000000 , -1.0416778473647] , [ 1154318400000 , -0.99326278105154] , [ 1156996800000 , -1.0095045907007] , [ 1159588800000 , -2.0762515478576] , [ 1162270800000 , -2.13066829429] , [ 1164862800000 , -2.2458400474235] , [ 1167541200000 , -2.1315262677135] , [ 1170219600000 , -2.4063108252146] , [ 1172638800000 , -2.3753290631454] , [ 1175313600000 , -2.1119577565913] , [ 1177905600000 , -2.1546804750397] , [ 1180584000000 , -2.3768374034303] , [ 1183176000000 , -1.244878330098] , [ 1185854400000 , -1.2233210265236] , [ 1188532800000 , -1.1715073644317] , [ 1191124800000 , -1.0036136395928] , [ 1193803200000 , -0.9510676777939] , [ 1196398800000 , -0.97553526602196] , [ 1199077200000 , -1.9083849411912] , [ 1201755600000 , -1.855965027796] , [ 1204261200000 , -1.7343633512402] , [ 1206936000000 , -2.1847032903649] , [ 1209528000000 , -2.2095446284368] , [ 1212206400000 , -2.2060678671735] , [ 1214798400000 , -1.0941627910924] , [ 1217476800000 , -1.0004352405294] , [ 1220155200000 , -0.93563501378075] , [ 1222747200000 , 0] , [ 1225425600000 , -0.65155092645953] , [ 1228021200000 , -0.66021585164047] , [ 1230699600000 , 0] , [ 1233378000000 , 0] , [ 1235797200000 , 0] , [ 1238472000000 , 0] , [ 1241064000000 , 0] , [ 1243742400000 , 0] , [ 1246334400000 , 0] , [ 1249012800000 , 0] , [ 1251691200000 , 0] , [ 1254283200000 , -0.29297573068109] , [ 1256961600000 , -0.75043756379084] , [ 1259557200000 , -0.85690846482745] , [ 1262235600000 , -0.21937480770873] , [ 1264914000000 , -0.93232569935343] , [ 1267333200000 , -0.94180327525084] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , -0.21253553193891] , [ 1288497600000 , -0.23178244747722] , [ 1291093200000 , -0.21481706129968] , [ 1293771600000 , -0.23306463011242] , [ 1296450000000 , -0.90244048159158] , [ 1298869200000 , -1.0410052083529] , [ 1301544000000 , -2.209350937089] , [ 1304136000000 , -2.6540796712932] , [ 1306814400000 , -3.2481210590957] , [ 1309406400000 , -3.0717986354635] , [ 1312084800000 , -2.7493296528921] , [ 1314763200000 , -2.1973991293256] , [ 1317355200000 , -0.86403111842659] , [ 1320033600000 , -0.87824756160219] , [ 1322629200000 , -0.80812571482871] , [ 1325307600000 , -1.6419820357151] , [ 1327986000000 , -1.6893790342619] , [ 1330491600000 , -1.8614499455474] , [ 1333166400000 , -1.814727017516] , [ 1335758400000 , -1.8744942128618] , [ 1338436800000 , -1.7880124850882]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Materials" ,
|
||||
"values" : [ [ 1138683600000 , -0.26079769654951] , [ 1141102800000 , -0.23368425410881] , [ 1143781200000 , -0.46285283466193] , [ 1146369600000 , -0.4588429059205] , [ 1149048000000 , -0.43055120080853] , [ 1151640000000 , -0.26428963363642] , [ 1154318400000 , -0.26203611963364] , [ 1156996800000 , -0.26706156717825] , [ 1159588800000 , -0.024613610779192] , [ 1162270800000 , -0.024351047945929] , [ 1164862800000 , -0.031497065480344] , [ 1167541200000 , 0] , [ 1170219600000 , 0] , [ 1172638800000 , 0] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , 0] , [ 1185854400000 , 0] , [ 1188532800000 , 0] , [ 1191124800000 , 0] , [ 1193803200000 , 0] , [ 1196398800000 , 0] , [ 1199077200000 , 0] , [ 1201755600000 , 0] , [ 1204261200000 , 0] , [ 1206936000000 , -0.83875613435932] , [ 1209528000000 , -0.84367445572656] , [ 1212206400000 , -0.78928126005463] , [ 1214798400000 , -1.1075954825404] , [ 1217476800000 , -1.2704836497926] , [ 1220155200000 , -1.307504052056] , [ 1222747200000 , -0.70440409992826] , [ 1225425600000 , -0.74122140007729] , [ 1228021200000 , -0.82224393045109] , [ 1230699600000 , -1.8719055314571] , [ 1233378000000 , -1.5200311233975] , [ 1235797200000 , -1.5552386899059] , [ 1238472000000 , -1.1576593040773] , [ 1241064000000 , -1.0757811060575] , [ 1243742400000 , -1.0250125722511] , [ 1246334400000 , -2.2747597224127] , [ 1249012800000 , -2.3125499227974] , [ 1251691200000 , -2.2784386530745] , [ 1254283200000 , -1.1518806233757] , [ 1256961600000 , -1.0075503399018] , [ 1259557200000 , -1.1400577929481] , [ 1262235600000 , -0.50677891891165] , [ 1264914000000 , -0.54332908490051] , [ 1267333200000 , -0.55473181189807] , [ 1270008000000 , -0.3633796157757] , [ 1272600000000 , -0.30361861470847] , [ 1275278400000 , -0.24614951229153] , [ 1277870400000 , -1.0959443687647] , [ 1280548800000 , -1.1881529264637] , [ 1283227200000 , -1.1835349242596] , [ 1285819200000 , -0.92507477884561] , [ 1288497600000 , -0.94531016133473] , [ 1291093200000 , -0.93519433603434] , [ 1293771600000 , -1.009221344252] , [ 1296450000000 , -2.3640716285835] , [ 1298869200000 , -2.4914494188556] , [ 1301544000000 , -1.7979456141716] , [ 1304136000000 , -2.1389760840247] , [ 1306814400000 , -1.9721362241269] , [ 1309406400000 , -1.9170229522382] , [ 1312084800000 , -1.8076246545605] , [ 1314763200000 , -2.1010686108381] , [ 1317355200000 , -2.2396373791195] , [ 1320033600000 , -1.8469012813015] , [ 1322629200000 , -2.0079125997321] , [ 1325307600000 , -1.9170007806182] , [ 1327986000000 , -1.9239118384243] , [ 1330491600000 , -2.0649464738798] , [ 1333166400000 , -0.88385747789351] , [ 1335758400000 , -0.91438087144161] , [ 1338436800000 , -0.96513752020965]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Telecommunication Services" ,
|
||||
"values" : [ [ 1138683600000 , 0] , [ 1141102800000 , 0] , [ 1143781200000 , -0.077395192503573] , [ 1146369600000 , -0.079342784160835] , [ 1149048000000 , -0.07376956808809] , [ 1151640000000 , -0.041850521681201] , [ 1154318400000 , -0.037598545052499] , [ 1156996800000 , -0.040984079427717] , [ 1159588800000 , -0.19335817797448] , [ 1162270800000 , -0.18578493919925] , [ 1164862800000 , -0.1769473933101] , [ 1167541200000 , -0.57245352054975] , [ 1170219600000 , -0.61554187332911] , [ 1172638800000 , -0.63016714701151] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , -0.12118014109021] , [ 1185854400000 , -0.11085831487208] , [ 1188532800000 , -0.10901265358445] , [ 1191124800000 , -0.17205583275088] , [ 1193803200000 , -0.16573676303991] , [ 1196398800000 , -0.17954841680392] , [ 1199077200000 , -0.82703336198161] , [ 1201755600000 , -0.76741763304227] , [ 1204261200000 , -0.79430844816827] , [ 1206936000000 , -1.0279404050708] , [ 1209528000000 , -1.0342425093761] , [ 1212206400000 , -1.0903083860383] , [ 1214798400000 , -1.0895432841007] , [ 1217476800000 , -1.1392703218146] , [ 1220155200000 , -0.98872086340391] , [ 1222747200000 , -1.227654651568] , [ 1225425600000 , -1.0527419580394] , [ 1228021200000 , -0.84338280322309] , [ 1230699600000 , -0.5982617279246] , [ 1233378000000 , -0.74123723862634] , [ 1235797200000 , -0.81665712408277] , [ 1238472000000 , -0.89868760705228] , [ 1241064000000 , -0.86338472153689] , [ 1243742400000 , -0.85040889603889] , [ 1246334400000 , -0.82872733882926] , [ 1249012800000 , -1.2797824676355] , [ 1251691200000 , -1.152043882336] , [ 1254283200000 , -0.70125890680538] , [ 1256961600000 , -0.69496338525418] , [ 1259557200000 , -0.81982038022784] , [ 1262235600000 , -0.42841700219624] , [ 1264914000000 , -0.43298861575253] , [ 1267333200000 , -0.46951194437705] , [ 1270008000000 , -0.46723980191721] , [ 1272600000000 , -0.43139262322841] , [ 1275278400000 , -0.4052075794202] , [ 1277870400000 , -0.45399431179247] , [ 1280548800000 , -0.50492374473014] , [ 1283227200000 , -0.49032976375464] , [ 1285819200000 , -0.95769381063728] , [ 1288497600000 , -0.92968381683254] , [ 1291093200000 , -0.90984207437415] , [ 1293771600000 , -0.91448295661871] , [ 1296450000000 , -1.3204103334172] , [ 1298869200000 , -1.3896989018] , [ 1301544000000 , -1.8536993972883] , [ 1304136000000 , -1.9901582471947] , [ 1306814400000 , -1.8731097808809] , [ 1309406400000 , -1.8109819859122] , [ 1312084800000 , -1.7946593386661] , [ 1314763200000 , -1.6002716669781] , [ 1317355200000 , -0.056479286204019] , [ 1320033600000 , -0.046232413998891] , [ 1322629200000 , -0.051182355563531] , [ 1325307600000 , -0.032858749040145] , [ 1327986000000 , -0.032326418106178] , [ 1330491600000 , -0.033980477379241] , [ 1333166400000 , -0.053069550536519] , [ 1335758400000 , -0.055741850564434] , [ 1338436800000 , -0.055851808568252]]
|
||||
} ,
|
||||
{
|
||||
"key" : "Utilities" ,
|
||||
"values" : [ [ 1138683600000 , 0] , [ 1141102800000 , 0] , [ 1143781200000 , -0.073769471773675] , [ 1146369600000 , -0.077824496315782] , [ 1149048000000 , -0.080696288096361] , [ 1151640000000 , 0] , [ 1154318400000 , 0] , [ 1156996800000 , 0] , [ 1159588800000 , 0] , [ 1162270800000 , 0] , [ 1164862800000 , 0] , [ 1167541200000 , 0] , [ 1170219600000 , 0] , [ 1172638800000 , 0] , [ 1175313600000 , 0] , [ 1177905600000 , 0] , [ 1180584000000 , 0] , [ 1183176000000 , -0.16073291656515] , [ 1185854400000 , -0.1646253606633] , [ 1188532800000 , -0.1655815581449] , [ 1191124800000 , -0.74417496631713] , [ 1193803200000 , -0.76230340423681] , [ 1196398800000 , -0.73882938190048] , [ 1199077200000 , -0.3820573391806] , [ 1201755600000 , -0.360757285179] , [ 1204261200000 , -0.38081058463615] , [ 1206936000000 , -0.92767439811083] , [ 1209528000000 , -0.92774728028789] , [ 1212206400000 , -0.85273481694714] , [ 1214798400000 , -1.69407085613] , [ 1217476800000 , -1.5179726219101] , [ 1220155200000 , -1.3576700600738] , [ 1222747200000 , -1.0404839864076] , [ 1225425600000 , -0.95251478838915] , [ 1228021200000 , -1.0610509118017] , [ 1230699600000 , -0.3316792294278] , [ 1233378000000 , -0.33745002288524] , [ 1235797200000 , -0.28806366796683] , [ 1238472000000 , 0] , [ 1241064000000 , 0] , [ 1243742400000 , 0] , [ 1246334400000 , -0.6338555382785] , [ 1249012800000 , -0.62797265130959] , [ 1251691200000 , -0.60264057253794] , [ 1254283200000 , -0.28687231077181] , [ 1256961600000 , -0.22215649778327] , [ 1259557200000 , -0.24027664555676] , [ 1262235600000 , 0] , [ 1264914000000 , 0] , [ 1267333200000 , 0] , [ 1270008000000 , 0] , [ 1272600000000 , 0] , [ 1275278400000 , 0] , [ 1277870400000 , 0] , [ 1280548800000 , 0] , [ 1283227200000 , 0] , [ 1285819200000 , 0] , [ 1288497600000 , 0] , [ 1291093200000 , 0] , [ 1293771600000 , 0] , [ 1296450000000 , 0] , [ 1298869200000 , 0] , [ 1301544000000 , 0] , [ 1304136000000 , 0] , [ 1306814400000 , 0] , [ 1309406400000 , 0] , [ 1312084800000 , 0] , [ 1314763200000 , 0] , [ 1317355200000 , 0] , [ 1320033600000 , 0] , [ 1322629200000 , 0] , [ 1325307600000 , 0] , [ 1327986000000 , 0] , [ 1330491600000 , 0] , [ 1333166400000 , 0] , [ 1335758400000 , 0] , [ 1338436800000 , 0]]
|
||||
}
|
||||
];
|
||||
|
||||
function totalRandom() {
|
||||
var rval = [];
|
||||
for(var n=1; n <= 2; n++) {
|
||||
var series = [];
|
||||
for(var i =0; i < 50; i++) {
|
||||
series.push([
|
||||
Math.floor(Math.random() * 100),
|
||||
Math.random() * 6
|
||||
]);
|
||||
}
|
||||
rval.push({key: "Random " + n, values: series});
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
function nPoints() {
|
||||
var rval = [
|
||||
{key: "Series 1",
|
||||
values: [
|
||||
[1,2],
|
||||
[2,4],
|
||||
[3,8]
|
||||
]}
|
||||
];
|
||||
return rval;
|
||||
|
||||
}
|
||||
|
||||
//an example of harmonizing colors between visualizations
|
||||
//observe that Consumer Discretionary and Consumer Staples have
|
||||
//been flipped in the second chart
|
||||
var colors = d3.scale.category20();
|
||||
var keyColor = function(d, i) {return colors(d.key)};
|
||||
|
||||
function defaultChartConfig(container, data, useGuideline) {
|
||||
if (useGuideline === undefined) useGuideline = true;
|
||||
nv.addGraph(function() {
|
||||
var chart;
|
||||
chart = nv.models.stackedAreaChart()
|
||||
.useInteractiveGuideline(useGuideline)
|
||||
.x(function(d) { return d[0] })
|
||||
.y(function(d) { return d[1] })
|
||||
.color(keyColor)
|
||||
;
|
||||
|
||||
chart.xAxis
|
||||
.tickFormat(function(d) { return d3.time.format('%x')(new Date(d)) });
|
||||
|
||||
chart.yAxis
|
||||
.tickFormat(d3.format(',.2f'));
|
||||
|
||||
d3.select('#' + container + ' svg')
|
||||
.datum(data)
|
||||
.transition().duration(500).call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
}
|
||||
|
||||
//Chart with old tooltip format.
|
||||
nv.addGraph(function() {
|
||||
var chart = nv.models.stackedAreaChart()
|
||||
.x(function(d) { return d[0] })
|
||||
.y(function(d) { return d[1] })
|
||||
.showControls(false)
|
||||
.color(keyColor)
|
||||
.margin({right:90})
|
||||
.rightAlignYAxis(true)
|
||||
;
|
||||
|
||||
chart.xAxis
|
||||
.tickFormat(function(d) { return d3.time.format('%x')(new Date(d)) });
|
||||
|
||||
chart.yAxis
|
||||
.tickFormat(d3.format(',.2f'));
|
||||
|
||||
d3.select('#chart2 svg')
|
||||
.datum(histcatexpshort)
|
||||
.call(chart);
|
||||
|
||||
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
});
|
||||
|
||||
defaultChartConfig("chart1", histcatexplong);
|
||||
defaultChartConfig("chart3", histcatexplong_singledatapoint);
|
||||
defaultChartConfig("chart4", histcatexplong_twodatapoint);
|
||||
defaultChartConfig("chart5", histcatexplong_withholes);
|
||||
defaultChartConfig("chart6", totalRandom(), false);
|
||||
defaultChartConfig("chart7", nPoints(),false);
|
||||
defaultChartConfig("chart8", []);
|
||||
defaultChartConfig("chart9", histcatexpshort,true);
|
||||
</script>
|
@ -0,0 +1,20 @@
|
||||
//A little snippet of D3 code that creates a button that lets you toggle whether a chart is the only one visible on a page or not.
|
||||
d3.selectAll(".chart button").on("click",function() {
|
||||
var thisId = this.parentElement.id;
|
||||
|
||||
var chartContainer = d3.select("#" + thisId);
|
||||
if (chartContainer.attr("class").match("selected"))
|
||||
chartContainer.classed("selected",false);
|
||||
else
|
||||
chartContainer.classed("selected",true);
|
||||
|
||||
d3.selectAll(".chart").style("display",function() {
|
||||
if (thisId === this.id) return "block";
|
||||
|
||||
if (d3.select(this).style("display") === "none")
|
||||
return "block";
|
||||
else
|
||||
return "none";
|
||||
});
|
||||
window.onresize();
|
||||
});
|
@ -0,0 +1,39 @@
|
||||
body {
|
||||
overflow-y:scroll;
|
||||
font-family: arial;
|
||||
}
|
||||
|
||||
text {
|
||||
font: 12px sans-serif;
|
||||
}
|
||||
|
||||
.chart {
|
||||
float:left;
|
||||
height: 500px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
.chart.full {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.chart.half {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.chart.third {
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.chart.selected {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.navigation a{
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.navigation {
|
||||
margin-bottom: 1em;
|
||||
}
|
Loading…
Reference in New Issue