├── .gitignore ├── README.md ├── config_sample.py ├── requirements.txt ├── run.py ├── static ├── css │ ├── component.css │ ├── jquery.nstSlider.css │ └── magic.min.css ├── fa │ ├── HELP-US-OUT.txt │ ├── css │ │ ├── font-awesome.css │ │ └── font-awesome.min.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── less │ │ ├── animated.less │ │ ├── bordered-pulled.less │ │ ├── core.less │ │ ├── fixed-width.less │ │ ├── font-awesome.less │ │ ├── icons.less │ │ ├── larger.less │ │ ├── list.less │ │ ├── mixins.less │ │ ├── path.less │ │ ├── rotated-flipped.less │ │ ├── stacked.less │ │ └── variables.less │ └── scss │ │ ├── _animated.scss │ │ ├── _bordered-pulled.scss │ │ ├── _core.scss │ │ ├── _fixed-width.scss │ │ ├── _icons.scss │ │ ├── _larger.scss │ │ ├── _list.scss │ │ ├── _mixins.scss │ │ ├── _path.scss │ │ ├── _rotated-flipped.scss │ │ ├── _stacked.scss │ │ ├── _variables.scss │ │ └── font-awesome.scss ├── font │ ├── mnjxxk.eot │ ├── mnjxxk.svg │ ├── mnjxxk.ttf │ └── mnjxxk.woff ├── img │ └── logo.png ├── js │ ├── china-zh2.js │ ├── china.js │ ├── countUp.js │ ├── d3.layout.cloud.js │ ├── d3.min.js │ ├── dark.js │ ├── echarts.min.js │ ├── echarts2 │ │ ├── chart │ │ │ ├── bar.js │ │ │ ├── chord.js │ │ │ ├── eventRiver.js │ │ │ ├── force.js │ │ │ ├── funnel.js │ │ │ ├── gauge.js │ │ │ ├── heatmap.js │ │ │ ├── k.js │ │ │ ├── line.js │ │ │ ├── map.js │ │ │ ├── pie.js │ │ │ ├── radar.js │ │ │ ├── scatter.js │ │ │ ├── tree.js │ │ │ ├── treemap.js │ │ │ ├── venn.js │ │ │ └── wordCloud.js │ │ ├── echarts-all.js │ │ └── echarts.js │ ├── jquery.nstSlider.min.js │ └── svgcheckbx.js └── lib │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ └── jquery.min.js └── templates ├── compare.html ├── index.html ├── layout.html ├── platform.html ├── question.html └── stat.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.pyc 3 | config.py 4 | venv/ 5 | ppt/ 6 | note -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ppd-magic-mirror 2 | web analysis and visualization for PPD Magic Mirror Contest 3 | -------------------------------------------------------------------------------- /config_sample.py: -------------------------------------------------------------------------------- 1 | HOST = 'localhost' 2 | PORT = 3306 3 | USER = 'root' 4 | PASSWORD = 'root' 5 | DATABASE = 'dbname' 6 | CHARSET = 'utf8' 7 | 8 | NEOHOST = 'localhost' 9 | NEOUSER = 'root' 10 | NEOPASSWORD = 'root' -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | mysql-python 3 | numpy -------------------------------------------------------------------------------- /static/css/component.css: -------------------------------------------------------------------------------- 1 | *, 2 | *:after, 3 | *::before { 4 | -webkit-box-sizing: border-box; 5 | -moz-box-sizing: border-box; 6 | box-sizing: border-box; 7 | } 8 | 9 | .ac-custom { 10 | padding: 0 3em; 11 | max-width: 900px; 12 | margin: 0 auto; 13 | } 14 | 15 | .ac-custom h2 { 16 | font-size: 3em; 17 | font-weight: 300; 18 | padding: 0 0 0.5em; 19 | margin: 0 0 30px; 20 | } 21 | 22 | .ac-custom ul, 23 | .ac-custom ol { 24 | list-style: none; 25 | padding: 0; 26 | margin: 0 auto; 27 | max-width: 800px; 28 | } 29 | 30 | .ac-custom li { 31 | margin: 0 auto; 32 | padding: 10px; 33 | position: relative; 34 | } 35 | 36 | .ac-custom label { 37 | display: inline-block; 38 | position: relative; 39 | padding: 0 0 0 36px; 40 | vertical-align: top; 41 | color: rgba(100,100,100,0.8); 42 | cursor: pointer; 43 | -webkit-transition: color 0.3s; 44 | -moz-transition: color 0.3s; 45 | -ms-transition: color 0.3s; 46 | -o-transition: color 0.3s; 47 | transition: color 0.3s; 48 | } 49 | 50 | .ac-custom input[type="checkbox"], 51 | .ac-custom input[type="radio"], 52 | .ac-custom label::before { 53 | width: 20px; 54 | height: 20px; 55 | top: 50%; 56 | left: 2px; 57 | margin-top: -10px; 58 | position: absolute; 59 | cursor: pointer; 60 | } 61 | .ac-custom input[type="checkbox"] { 62 | left: 11px; 63 | margin-top: -10px; 64 | } 65 | 66 | .ac-custom input[type="checkbox"], 67 | .ac-custom input[type="radio"] { 68 | opacity: 0; 69 | -webkit-appearance: none; 70 | display: inline-block; 71 | vertical-align: middle; 72 | z-index: 100; 73 | } 74 | 75 | .ac-custom label::before { 76 | content: ''; 77 | border: 2px solid rgba(240,240,240,0.9); 78 | -webkit-transition: opacity 0.3s; 79 | -moz-transition: opacity 0.3s; 80 | -ms-transition: opacity 0.3s; 81 | -o-transition: opacity 0.3s; 82 | transition: opacity 0.3s; 83 | } 84 | 85 | .ac-radio label::before { 86 | border-radius: 50%; 87 | } 88 | 89 | .ac-custom input[type="checkbox"]:checked + label::before, 90 | .ac-custom input[type="radio"]:checked + label::before { 91 | opacity: 0.8; 92 | } 93 | 94 | /* General SVG and path styles */ 95 | 96 | .ac-custom svg { 97 | position: absolute; 98 | width: 18px; 99 | height: 18px; 100 | top: 50%; 101 | margin-top: -11px; 102 | left: 13px; 103 | pointer-events: none; 104 | } 105 | 106 | .ac-custom svg path { 107 | stroke: #fdfcd3; 108 | stroke-width: 13px; 109 | stroke-linecap: round; 110 | stroke-linejoin: round; 111 | fill: none; 112 | } -------------------------------------------------------------------------------- /static/css/jquery.nstSlider.css: -------------------------------------------------------------------------------- 1 | .is_clickable{cursor:hand;cursor:pointer}.nstSlider{cursor:hand;cursor:pointer;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;position:relative;width:300px;height:20px;background:#134}.nstSlider .leftGrip.gripHighlighted{background:#134}.nstSlider .rightGrip.gripHighlighted{background:#134}.nstSlider .rightGrip,.nstSlider .leftGrip{position:absolute;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;width:20px;height:20px;}.nstSlider .bar{-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;position:absolute;background:#fff;height:8px;top:6px}.nstSlider .highlightPanel{-webkit-transition:all 500ms ease-in-out;-moz-transition:all 500ms ease-in-out;-ms-transition:all 500ms ease-in-out;-o-transition:all 500ms ease-in-out;transition:all 500ms ease-in-out;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;position:absolute;background:#e87722;height:20px;top:0} -------------------------------------------------------------------------------- /static/fa/HELP-US-OUT.txt: -------------------------------------------------------------------------------- 1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, 2 | Fonticons (https://fonticons.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, 3 | comprehensive icon sets or copy and paste your own. 4 | 5 | Please. Check it out. 6 | 7 | -Dave Gandy 8 | -------------------------------------------------------------------------------- /static/fa/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Honlan/ppd-magic-mirror/ef110a615883772ff535e66868b8a407fbe7af96/static/fa/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /static/fa/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Honlan/ppd-magic-mirror/ef110a615883772ff535e66868b8a407fbe7af96/static/fa/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /static/fa/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Honlan/ppd-magic-mirror/ef110a615883772ff535e66868b8a407fbe7af96/static/fa/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /static/fa/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Honlan/ppd-magic-mirror/ef110a615883772ff535e66868b8a407fbe7af96/static/fa/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /static/fa/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Honlan/ppd-magic-mirror/ef110a615883772ff535e66868b8a407fbe7af96/static/fa/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /static/fa/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /static/fa/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /static/fa/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /static/fa/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /static/fa/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | -------------------------------------------------------------------------------- /static/fa/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /static/fa/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /static/fa/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | .fa-icon-rotate(@degrees, @rotation) { 15 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation); 16 | -webkit-transform: rotate(@degrees); 17 | -ms-transform: rotate(@degrees); 18 | transform: rotate(@degrees); 19 | } 20 | 21 | .fa-icon-flip(@horiz, @vert, @rotation) { 22 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1); 23 | -webkit-transform: scale(@horiz, @vert); 24 | -ms-transform: scale(@horiz, @vert); 25 | transform: scale(@horiz, @vert); 26 | } 27 | -------------------------------------------------------------------------------- /static/fa/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /static/fa/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /static/fa/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /static/fa/less/variables.less: -------------------------------------------------------------------------------- 1 | // Variables 2 | // -------------------------- 3 | 4 | @fa-font-path: "../fonts"; 5 | @fa-font-size-base: 14px; 6 | @fa-line-height-base: 1; 7 | //@fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.5.0/fonts"; // for referencing Bootstrap CDN font files directly 8 | @fa-css-prefix: fa; 9 | @fa-version: "4.5.0"; 10 | @fa-border-color: #eee; 11 | @fa-inverse: #fff; 12 | @fa-li-width: (30em / 14); 13 | 14 | @fa-var-500px: "\f26e"; 15 | @fa-var-adjust: "\f042"; 16 | @fa-var-adn: "\f170"; 17 | @fa-var-align-center: "\f037"; 18 | @fa-var-align-justify: "\f039"; 19 | @fa-var-align-left: "\f036"; 20 | @fa-var-align-right: "\f038"; 21 | @fa-var-amazon: "\f270"; 22 | @fa-var-ambulance: "\f0f9"; 23 | @fa-var-anchor: "\f13d"; 24 | @fa-var-android: "\f17b"; 25 | @fa-var-angellist: "\f209"; 26 | @fa-var-angle-double-down: "\f103"; 27 | @fa-var-angle-double-left: "\f100"; 28 | @fa-var-angle-double-right: "\f101"; 29 | @fa-var-angle-double-up: "\f102"; 30 | @fa-var-angle-down: "\f107"; 31 | @fa-var-angle-left: "\f104"; 32 | @fa-var-angle-right: "\f105"; 33 | @fa-var-angle-up: "\f106"; 34 | @fa-var-apple: "\f179"; 35 | @fa-var-archive: "\f187"; 36 | @fa-var-area-chart: "\f1fe"; 37 | @fa-var-arrow-circle-down: "\f0ab"; 38 | @fa-var-arrow-circle-left: "\f0a8"; 39 | @fa-var-arrow-circle-o-down: "\f01a"; 40 | @fa-var-arrow-circle-o-left: "\f190"; 41 | @fa-var-arrow-circle-o-right: "\f18e"; 42 | @fa-var-arrow-circle-o-up: "\f01b"; 43 | @fa-var-arrow-circle-right: "\f0a9"; 44 | @fa-var-arrow-circle-up: "\f0aa"; 45 | @fa-var-arrow-down: "\f063"; 46 | @fa-var-arrow-left: "\f060"; 47 | @fa-var-arrow-right: "\f061"; 48 | @fa-var-arrow-up: "\f062"; 49 | @fa-var-arrows: "\f047"; 50 | @fa-var-arrows-alt: "\f0b2"; 51 | @fa-var-arrows-h: "\f07e"; 52 | @fa-var-arrows-v: "\f07d"; 53 | @fa-var-asterisk: "\f069"; 54 | @fa-var-at: "\f1fa"; 55 | @fa-var-automobile: "\f1b9"; 56 | @fa-var-backward: "\f04a"; 57 | @fa-var-balance-scale: "\f24e"; 58 | @fa-var-ban: "\f05e"; 59 | @fa-var-bank: "\f19c"; 60 | @fa-var-bar-chart: "\f080"; 61 | @fa-var-bar-chart-o: "\f080"; 62 | @fa-var-barcode: "\f02a"; 63 | @fa-var-bars: "\f0c9"; 64 | @fa-var-battery-0: "\f244"; 65 | @fa-var-battery-1: "\f243"; 66 | @fa-var-battery-2: "\f242"; 67 | @fa-var-battery-3: "\f241"; 68 | @fa-var-battery-4: "\f240"; 69 | @fa-var-battery-empty: "\f244"; 70 | @fa-var-battery-full: "\f240"; 71 | @fa-var-battery-half: "\f242"; 72 | @fa-var-battery-quarter: "\f243"; 73 | @fa-var-battery-three-quarters: "\f241"; 74 | @fa-var-bed: "\f236"; 75 | @fa-var-beer: "\f0fc"; 76 | @fa-var-behance: "\f1b4"; 77 | @fa-var-behance-square: "\f1b5"; 78 | @fa-var-bell: "\f0f3"; 79 | @fa-var-bell-o: "\f0a2"; 80 | @fa-var-bell-slash: "\f1f6"; 81 | @fa-var-bell-slash-o: "\f1f7"; 82 | @fa-var-bicycle: "\f206"; 83 | @fa-var-binoculars: "\f1e5"; 84 | @fa-var-birthday-cake: "\f1fd"; 85 | @fa-var-bitbucket: "\f171"; 86 | @fa-var-bitbucket-square: "\f172"; 87 | @fa-var-bitcoin: "\f15a"; 88 | @fa-var-black-tie: "\f27e"; 89 | @fa-var-bluetooth: "\f293"; 90 | @fa-var-bluetooth-b: "\f294"; 91 | @fa-var-bold: "\f032"; 92 | @fa-var-bolt: "\f0e7"; 93 | @fa-var-bomb: "\f1e2"; 94 | @fa-var-book: "\f02d"; 95 | @fa-var-bookmark: "\f02e"; 96 | @fa-var-bookmark-o: "\f097"; 97 | @fa-var-briefcase: "\f0b1"; 98 | @fa-var-btc: "\f15a"; 99 | @fa-var-bug: "\f188"; 100 | @fa-var-building: "\f1ad"; 101 | @fa-var-building-o: "\f0f7"; 102 | @fa-var-bullhorn: "\f0a1"; 103 | @fa-var-bullseye: "\f140"; 104 | @fa-var-bus: "\f207"; 105 | @fa-var-buysellads: "\f20d"; 106 | @fa-var-cab: "\f1ba"; 107 | @fa-var-calculator: "\f1ec"; 108 | @fa-var-calendar: "\f073"; 109 | @fa-var-calendar-check-o: "\f274"; 110 | @fa-var-calendar-minus-o: "\f272"; 111 | @fa-var-calendar-o: "\f133"; 112 | @fa-var-calendar-plus-o: "\f271"; 113 | @fa-var-calendar-times-o: "\f273"; 114 | @fa-var-camera: "\f030"; 115 | @fa-var-camera-retro: "\f083"; 116 | @fa-var-car: "\f1b9"; 117 | @fa-var-caret-down: "\f0d7"; 118 | @fa-var-caret-left: "\f0d9"; 119 | @fa-var-caret-right: "\f0da"; 120 | @fa-var-caret-square-o-down: "\f150"; 121 | @fa-var-caret-square-o-left: "\f191"; 122 | @fa-var-caret-square-o-right: "\f152"; 123 | @fa-var-caret-square-o-up: "\f151"; 124 | @fa-var-caret-up: "\f0d8"; 125 | @fa-var-cart-arrow-down: "\f218"; 126 | @fa-var-cart-plus: "\f217"; 127 | @fa-var-cc: "\f20a"; 128 | @fa-var-cc-amex: "\f1f3"; 129 | @fa-var-cc-diners-club: "\f24c"; 130 | @fa-var-cc-discover: "\f1f2"; 131 | @fa-var-cc-jcb: "\f24b"; 132 | @fa-var-cc-mastercard: "\f1f1"; 133 | @fa-var-cc-paypal: "\f1f4"; 134 | @fa-var-cc-stripe: "\f1f5"; 135 | @fa-var-cc-visa: "\f1f0"; 136 | @fa-var-certificate: "\f0a3"; 137 | @fa-var-chain: "\f0c1"; 138 | @fa-var-chain-broken: "\f127"; 139 | @fa-var-check: "\f00c"; 140 | @fa-var-check-circle: "\f058"; 141 | @fa-var-check-circle-o: "\f05d"; 142 | @fa-var-check-square: "\f14a"; 143 | @fa-var-check-square-o: "\f046"; 144 | @fa-var-chevron-circle-down: "\f13a"; 145 | @fa-var-chevron-circle-left: "\f137"; 146 | @fa-var-chevron-circle-right: "\f138"; 147 | @fa-var-chevron-circle-up: "\f139"; 148 | @fa-var-chevron-down: "\f078"; 149 | @fa-var-chevron-left: "\f053"; 150 | @fa-var-chevron-right: "\f054"; 151 | @fa-var-chevron-up: "\f077"; 152 | @fa-var-child: "\f1ae"; 153 | @fa-var-chrome: "\f268"; 154 | @fa-var-circle: "\f111"; 155 | @fa-var-circle-o: "\f10c"; 156 | @fa-var-circle-o-notch: "\f1ce"; 157 | @fa-var-circle-thin: "\f1db"; 158 | @fa-var-clipboard: "\f0ea"; 159 | @fa-var-clock-o: "\f017"; 160 | @fa-var-clone: "\f24d"; 161 | @fa-var-close: "\f00d"; 162 | @fa-var-cloud: "\f0c2"; 163 | @fa-var-cloud-download: "\f0ed"; 164 | @fa-var-cloud-upload: "\f0ee"; 165 | @fa-var-cny: "\f157"; 166 | @fa-var-code: "\f121"; 167 | @fa-var-code-fork: "\f126"; 168 | @fa-var-codepen: "\f1cb"; 169 | @fa-var-codiepie: "\f284"; 170 | @fa-var-coffee: "\f0f4"; 171 | @fa-var-cog: "\f013"; 172 | @fa-var-cogs: "\f085"; 173 | @fa-var-columns: "\f0db"; 174 | @fa-var-comment: "\f075"; 175 | @fa-var-comment-o: "\f0e5"; 176 | @fa-var-commenting: "\f27a"; 177 | @fa-var-commenting-o: "\f27b"; 178 | @fa-var-comments: "\f086"; 179 | @fa-var-comments-o: "\f0e6"; 180 | @fa-var-compass: "\f14e"; 181 | @fa-var-compress: "\f066"; 182 | @fa-var-connectdevelop: "\f20e"; 183 | @fa-var-contao: "\f26d"; 184 | @fa-var-copy: "\f0c5"; 185 | @fa-var-copyright: "\f1f9"; 186 | @fa-var-creative-commons: "\f25e"; 187 | @fa-var-credit-card: "\f09d"; 188 | @fa-var-credit-card-alt: "\f283"; 189 | @fa-var-crop: "\f125"; 190 | @fa-var-crosshairs: "\f05b"; 191 | @fa-var-css3: "\f13c"; 192 | @fa-var-cube: "\f1b2"; 193 | @fa-var-cubes: "\f1b3"; 194 | @fa-var-cut: "\f0c4"; 195 | @fa-var-cutlery: "\f0f5"; 196 | @fa-var-dashboard: "\f0e4"; 197 | @fa-var-dashcube: "\f210"; 198 | @fa-var-database: "\f1c0"; 199 | @fa-var-dedent: "\f03b"; 200 | @fa-var-delicious: "\f1a5"; 201 | @fa-var-desktop: "\f108"; 202 | @fa-var-deviantart: "\f1bd"; 203 | @fa-var-diamond: "\f219"; 204 | @fa-var-digg: "\f1a6"; 205 | @fa-var-dollar: "\f155"; 206 | @fa-var-dot-circle-o: "\f192"; 207 | @fa-var-download: "\f019"; 208 | @fa-var-dribbble: "\f17d"; 209 | @fa-var-dropbox: "\f16b"; 210 | @fa-var-drupal: "\f1a9"; 211 | @fa-var-edge: "\f282"; 212 | @fa-var-edit: "\f044"; 213 | @fa-var-eject: "\f052"; 214 | @fa-var-ellipsis-h: "\f141"; 215 | @fa-var-ellipsis-v: "\f142"; 216 | @fa-var-empire: "\f1d1"; 217 | @fa-var-envelope: "\f0e0"; 218 | @fa-var-envelope-o: "\f003"; 219 | @fa-var-envelope-square: "\f199"; 220 | @fa-var-eraser: "\f12d"; 221 | @fa-var-eur: "\f153"; 222 | @fa-var-euro: "\f153"; 223 | @fa-var-exchange: "\f0ec"; 224 | @fa-var-exclamation: "\f12a"; 225 | @fa-var-exclamation-circle: "\f06a"; 226 | @fa-var-exclamation-triangle: "\f071"; 227 | @fa-var-expand: "\f065"; 228 | @fa-var-expeditedssl: "\f23e"; 229 | @fa-var-external-link: "\f08e"; 230 | @fa-var-external-link-square: "\f14c"; 231 | @fa-var-eye: "\f06e"; 232 | @fa-var-eye-slash: "\f070"; 233 | @fa-var-eyedropper: "\f1fb"; 234 | @fa-var-facebook: "\f09a"; 235 | @fa-var-facebook-f: "\f09a"; 236 | @fa-var-facebook-official: "\f230"; 237 | @fa-var-facebook-square: "\f082"; 238 | @fa-var-fast-backward: "\f049"; 239 | @fa-var-fast-forward: "\f050"; 240 | @fa-var-fax: "\f1ac"; 241 | @fa-var-feed: "\f09e"; 242 | @fa-var-female: "\f182"; 243 | @fa-var-fighter-jet: "\f0fb"; 244 | @fa-var-file: "\f15b"; 245 | @fa-var-file-archive-o: "\f1c6"; 246 | @fa-var-file-audio-o: "\f1c7"; 247 | @fa-var-file-code-o: "\f1c9"; 248 | @fa-var-file-excel-o: "\f1c3"; 249 | @fa-var-file-image-o: "\f1c5"; 250 | @fa-var-file-movie-o: "\f1c8"; 251 | @fa-var-file-o: "\f016"; 252 | @fa-var-file-pdf-o: "\f1c1"; 253 | @fa-var-file-photo-o: "\f1c5"; 254 | @fa-var-file-picture-o: "\f1c5"; 255 | @fa-var-file-powerpoint-o: "\f1c4"; 256 | @fa-var-file-sound-o: "\f1c7"; 257 | @fa-var-file-text: "\f15c"; 258 | @fa-var-file-text-o: "\f0f6"; 259 | @fa-var-file-video-o: "\f1c8"; 260 | @fa-var-file-word-o: "\f1c2"; 261 | @fa-var-file-zip-o: "\f1c6"; 262 | @fa-var-files-o: "\f0c5"; 263 | @fa-var-film: "\f008"; 264 | @fa-var-filter: "\f0b0"; 265 | @fa-var-fire: "\f06d"; 266 | @fa-var-fire-extinguisher: "\f134"; 267 | @fa-var-firefox: "\f269"; 268 | @fa-var-flag: "\f024"; 269 | @fa-var-flag-checkered: "\f11e"; 270 | @fa-var-flag-o: "\f11d"; 271 | @fa-var-flash: "\f0e7"; 272 | @fa-var-flask: "\f0c3"; 273 | @fa-var-flickr: "\f16e"; 274 | @fa-var-floppy-o: "\f0c7"; 275 | @fa-var-folder: "\f07b"; 276 | @fa-var-folder-o: "\f114"; 277 | @fa-var-folder-open: "\f07c"; 278 | @fa-var-folder-open-o: "\f115"; 279 | @fa-var-font: "\f031"; 280 | @fa-var-fonticons: "\f280"; 281 | @fa-var-fort-awesome: "\f286"; 282 | @fa-var-forumbee: "\f211"; 283 | @fa-var-forward: "\f04e"; 284 | @fa-var-foursquare: "\f180"; 285 | @fa-var-frown-o: "\f119"; 286 | @fa-var-futbol-o: "\f1e3"; 287 | @fa-var-gamepad: "\f11b"; 288 | @fa-var-gavel: "\f0e3"; 289 | @fa-var-gbp: "\f154"; 290 | @fa-var-ge: "\f1d1"; 291 | @fa-var-gear: "\f013"; 292 | @fa-var-gears: "\f085"; 293 | @fa-var-genderless: "\f22d"; 294 | @fa-var-get-pocket: "\f265"; 295 | @fa-var-gg: "\f260"; 296 | @fa-var-gg-circle: "\f261"; 297 | @fa-var-gift: "\f06b"; 298 | @fa-var-git: "\f1d3"; 299 | @fa-var-git-square: "\f1d2"; 300 | @fa-var-github: "\f09b"; 301 | @fa-var-github-alt: "\f113"; 302 | @fa-var-github-square: "\f092"; 303 | @fa-var-gittip: "\f184"; 304 | @fa-var-glass: "\f000"; 305 | @fa-var-globe: "\f0ac"; 306 | @fa-var-google: "\f1a0"; 307 | @fa-var-google-plus: "\f0d5"; 308 | @fa-var-google-plus-square: "\f0d4"; 309 | @fa-var-google-wallet: "\f1ee"; 310 | @fa-var-graduation-cap: "\f19d"; 311 | @fa-var-gratipay: "\f184"; 312 | @fa-var-group: "\f0c0"; 313 | @fa-var-h-square: "\f0fd"; 314 | @fa-var-hacker-news: "\f1d4"; 315 | @fa-var-hand-grab-o: "\f255"; 316 | @fa-var-hand-lizard-o: "\f258"; 317 | @fa-var-hand-o-down: "\f0a7"; 318 | @fa-var-hand-o-left: "\f0a5"; 319 | @fa-var-hand-o-right: "\f0a4"; 320 | @fa-var-hand-o-up: "\f0a6"; 321 | @fa-var-hand-paper-o: "\f256"; 322 | @fa-var-hand-peace-o: "\f25b"; 323 | @fa-var-hand-pointer-o: "\f25a"; 324 | @fa-var-hand-rock-o: "\f255"; 325 | @fa-var-hand-scissors-o: "\f257"; 326 | @fa-var-hand-spock-o: "\f259"; 327 | @fa-var-hand-stop-o: "\f256"; 328 | @fa-var-hashtag: "\f292"; 329 | @fa-var-hdd-o: "\f0a0"; 330 | @fa-var-header: "\f1dc"; 331 | @fa-var-headphones: "\f025"; 332 | @fa-var-heart: "\f004"; 333 | @fa-var-heart-o: "\f08a"; 334 | @fa-var-heartbeat: "\f21e"; 335 | @fa-var-history: "\f1da"; 336 | @fa-var-home: "\f015"; 337 | @fa-var-hospital-o: "\f0f8"; 338 | @fa-var-hotel: "\f236"; 339 | @fa-var-hourglass: "\f254"; 340 | @fa-var-hourglass-1: "\f251"; 341 | @fa-var-hourglass-2: "\f252"; 342 | @fa-var-hourglass-3: "\f253"; 343 | @fa-var-hourglass-end: "\f253"; 344 | @fa-var-hourglass-half: "\f252"; 345 | @fa-var-hourglass-o: "\f250"; 346 | @fa-var-hourglass-start: "\f251"; 347 | @fa-var-houzz: "\f27c"; 348 | @fa-var-html5: "\f13b"; 349 | @fa-var-i-cursor: "\f246"; 350 | @fa-var-ils: "\f20b"; 351 | @fa-var-image: "\f03e"; 352 | @fa-var-inbox: "\f01c"; 353 | @fa-var-indent: "\f03c"; 354 | @fa-var-industry: "\f275"; 355 | @fa-var-info: "\f129"; 356 | @fa-var-info-circle: "\f05a"; 357 | @fa-var-inr: "\f156"; 358 | @fa-var-instagram: "\f16d"; 359 | @fa-var-institution: "\f19c"; 360 | @fa-var-internet-explorer: "\f26b"; 361 | @fa-var-intersex: "\f224"; 362 | @fa-var-ioxhost: "\f208"; 363 | @fa-var-italic: "\f033"; 364 | @fa-var-joomla: "\f1aa"; 365 | @fa-var-jpy: "\f157"; 366 | @fa-var-jsfiddle: "\f1cc"; 367 | @fa-var-key: "\f084"; 368 | @fa-var-keyboard-o: "\f11c"; 369 | @fa-var-krw: "\f159"; 370 | @fa-var-language: "\f1ab"; 371 | @fa-var-laptop: "\f109"; 372 | @fa-var-lastfm: "\f202"; 373 | @fa-var-lastfm-square: "\f203"; 374 | @fa-var-leaf: "\f06c"; 375 | @fa-var-leanpub: "\f212"; 376 | @fa-var-legal: "\f0e3"; 377 | @fa-var-lemon-o: "\f094"; 378 | @fa-var-level-down: "\f149"; 379 | @fa-var-level-up: "\f148"; 380 | @fa-var-life-bouy: "\f1cd"; 381 | @fa-var-life-buoy: "\f1cd"; 382 | @fa-var-life-ring: "\f1cd"; 383 | @fa-var-life-saver: "\f1cd"; 384 | @fa-var-lightbulb-o: "\f0eb"; 385 | @fa-var-line-chart: "\f201"; 386 | @fa-var-link: "\f0c1"; 387 | @fa-var-linkedin: "\f0e1"; 388 | @fa-var-linkedin-square: "\f08c"; 389 | @fa-var-linux: "\f17c"; 390 | @fa-var-list: "\f03a"; 391 | @fa-var-list-alt: "\f022"; 392 | @fa-var-list-ol: "\f0cb"; 393 | @fa-var-list-ul: "\f0ca"; 394 | @fa-var-location-arrow: "\f124"; 395 | @fa-var-lock: "\f023"; 396 | @fa-var-long-arrow-down: "\f175"; 397 | @fa-var-long-arrow-left: "\f177"; 398 | @fa-var-long-arrow-right: "\f178"; 399 | @fa-var-long-arrow-up: "\f176"; 400 | @fa-var-magic: "\f0d0"; 401 | @fa-var-magnet: "\f076"; 402 | @fa-var-mail-forward: "\f064"; 403 | @fa-var-mail-reply: "\f112"; 404 | @fa-var-mail-reply-all: "\f122"; 405 | @fa-var-male: "\f183"; 406 | @fa-var-map: "\f279"; 407 | @fa-var-map-marker: "\f041"; 408 | @fa-var-map-o: "\f278"; 409 | @fa-var-map-pin: "\f276"; 410 | @fa-var-map-signs: "\f277"; 411 | @fa-var-mars: "\f222"; 412 | @fa-var-mars-double: "\f227"; 413 | @fa-var-mars-stroke: "\f229"; 414 | @fa-var-mars-stroke-h: "\f22b"; 415 | @fa-var-mars-stroke-v: "\f22a"; 416 | @fa-var-maxcdn: "\f136"; 417 | @fa-var-meanpath: "\f20c"; 418 | @fa-var-medium: "\f23a"; 419 | @fa-var-medkit: "\f0fa"; 420 | @fa-var-meh-o: "\f11a"; 421 | @fa-var-mercury: "\f223"; 422 | @fa-var-microphone: "\f130"; 423 | @fa-var-microphone-slash: "\f131"; 424 | @fa-var-minus: "\f068"; 425 | @fa-var-minus-circle: "\f056"; 426 | @fa-var-minus-square: "\f146"; 427 | @fa-var-minus-square-o: "\f147"; 428 | @fa-var-mixcloud: "\f289"; 429 | @fa-var-mobile: "\f10b"; 430 | @fa-var-mobile-phone: "\f10b"; 431 | @fa-var-modx: "\f285"; 432 | @fa-var-money: "\f0d6"; 433 | @fa-var-moon-o: "\f186"; 434 | @fa-var-mortar-board: "\f19d"; 435 | @fa-var-motorcycle: "\f21c"; 436 | @fa-var-mouse-pointer: "\f245"; 437 | @fa-var-music: "\f001"; 438 | @fa-var-navicon: "\f0c9"; 439 | @fa-var-neuter: "\f22c"; 440 | @fa-var-newspaper-o: "\f1ea"; 441 | @fa-var-object-group: "\f247"; 442 | @fa-var-object-ungroup: "\f248"; 443 | @fa-var-odnoklassniki: "\f263"; 444 | @fa-var-odnoklassniki-square: "\f264"; 445 | @fa-var-opencart: "\f23d"; 446 | @fa-var-openid: "\f19b"; 447 | @fa-var-opera: "\f26a"; 448 | @fa-var-optin-monster: "\f23c"; 449 | @fa-var-outdent: "\f03b"; 450 | @fa-var-pagelines: "\f18c"; 451 | @fa-var-paint-brush: "\f1fc"; 452 | @fa-var-paper-plane: "\f1d8"; 453 | @fa-var-paper-plane-o: "\f1d9"; 454 | @fa-var-paperclip: "\f0c6"; 455 | @fa-var-paragraph: "\f1dd"; 456 | @fa-var-paste: "\f0ea"; 457 | @fa-var-pause: "\f04c"; 458 | @fa-var-pause-circle: "\f28b"; 459 | @fa-var-pause-circle-o: "\f28c"; 460 | @fa-var-paw: "\f1b0"; 461 | @fa-var-paypal: "\f1ed"; 462 | @fa-var-pencil: "\f040"; 463 | @fa-var-pencil-square: "\f14b"; 464 | @fa-var-pencil-square-o: "\f044"; 465 | @fa-var-percent: "\f295"; 466 | @fa-var-phone: "\f095"; 467 | @fa-var-phone-square: "\f098"; 468 | @fa-var-photo: "\f03e"; 469 | @fa-var-picture-o: "\f03e"; 470 | @fa-var-pie-chart: "\f200"; 471 | @fa-var-pied-piper: "\f1a7"; 472 | @fa-var-pied-piper-alt: "\f1a8"; 473 | @fa-var-pinterest: "\f0d2"; 474 | @fa-var-pinterest-p: "\f231"; 475 | @fa-var-pinterest-square: "\f0d3"; 476 | @fa-var-plane: "\f072"; 477 | @fa-var-play: "\f04b"; 478 | @fa-var-play-circle: "\f144"; 479 | @fa-var-play-circle-o: "\f01d"; 480 | @fa-var-plug: "\f1e6"; 481 | @fa-var-plus: "\f067"; 482 | @fa-var-plus-circle: "\f055"; 483 | @fa-var-plus-square: "\f0fe"; 484 | @fa-var-plus-square-o: "\f196"; 485 | @fa-var-power-off: "\f011"; 486 | @fa-var-print: "\f02f"; 487 | @fa-var-product-hunt: "\f288"; 488 | @fa-var-puzzle-piece: "\f12e"; 489 | @fa-var-qq: "\f1d6"; 490 | @fa-var-qrcode: "\f029"; 491 | @fa-var-question: "\f128"; 492 | @fa-var-question-circle: "\f059"; 493 | @fa-var-quote-left: "\f10d"; 494 | @fa-var-quote-right: "\f10e"; 495 | @fa-var-ra: "\f1d0"; 496 | @fa-var-random: "\f074"; 497 | @fa-var-rebel: "\f1d0"; 498 | @fa-var-recycle: "\f1b8"; 499 | @fa-var-reddit: "\f1a1"; 500 | @fa-var-reddit-alien: "\f281"; 501 | @fa-var-reddit-square: "\f1a2"; 502 | @fa-var-refresh: "\f021"; 503 | @fa-var-registered: "\f25d"; 504 | @fa-var-remove: "\f00d"; 505 | @fa-var-renren: "\f18b"; 506 | @fa-var-reorder: "\f0c9"; 507 | @fa-var-repeat: "\f01e"; 508 | @fa-var-reply: "\f112"; 509 | @fa-var-reply-all: "\f122"; 510 | @fa-var-retweet: "\f079"; 511 | @fa-var-rmb: "\f157"; 512 | @fa-var-road: "\f018"; 513 | @fa-var-rocket: "\f135"; 514 | @fa-var-rotate-left: "\f0e2"; 515 | @fa-var-rotate-right: "\f01e"; 516 | @fa-var-rouble: "\f158"; 517 | @fa-var-rss: "\f09e"; 518 | @fa-var-rss-square: "\f143"; 519 | @fa-var-rub: "\f158"; 520 | @fa-var-ruble: "\f158"; 521 | @fa-var-rupee: "\f156"; 522 | @fa-var-safari: "\f267"; 523 | @fa-var-save: "\f0c7"; 524 | @fa-var-scissors: "\f0c4"; 525 | @fa-var-scribd: "\f28a"; 526 | @fa-var-search: "\f002"; 527 | @fa-var-search-minus: "\f010"; 528 | @fa-var-search-plus: "\f00e"; 529 | @fa-var-sellsy: "\f213"; 530 | @fa-var-send: "\f1d8"; 531 | @fa-var-send-o: "\f1d9"; 532 | @fa-var-server: "\f233"; 533 | @fa-var-share: "\f064"; 534 | @fa-var-share-alt: "\f1e0"; 535 | @fa-var-share-alt-square: "\f1e1"; 536 | @fa-var-share-square: "\f14d"; 537 | @fa-var-share-square-o: "\f045"; 538 | @fa-var-shekel: "\f20b"; 539 | @fa-var-sheqel: "\f20b"; 540 | @fa-var-shield: "\f132"; 541 | @fa-var-ship: "\f21a"; 542 | @fa-var-shirtsinbulk: "\f214"; 543 | @fa-var-shopping-bag: "\f290"; 544 | @fa-var-shopping-basket: "\f291"; 545 | @fa-var-shopping-cart: "\f07a"; 546 | @fa-var-sign-in: "\f090"; 547 | @fa-var-sign-out: "\f08b"; 548 | @fa-var-signal: "\f012"; 549 | @fa-var-simplybuilt: "\f215"; 550 | @fa-var-sitemap: "\f0e8"; 551 | @fa-var-skyatlas: "\f216"; 552 | @fa-var-skype: "\f17e"; 553 | @fa-var-slack: "\f198"; 554 | @fa-var-sliders: "\f1de"; 555 | @fa-var-slideshare: "\f1e7"; 556 | @fa-var-smile-o: "\f118"; 557 | @fa-var-soccer-ball-o: "\f1e3"; 558 | @fa-var-sort: "\f0dc"; 559 | @fa-var-sort-alpha-asc: "\f15d"; 560 | @fa-var-sort-alpha-desc: "\f15e"; 561 | @fa-var-sort-amount-asc: "\f160"; 562 | @fa-var-sort-amount-desc: "\f161"; 563 | @fa-var-sort-asc: "\f0de"; 564 | @fa-var-sort-desc: "\f0dd"; 565 | @fa-var-sort-down: "\f0dd"; 566 | @fa-var-sort-numeric-asc: "\f162"; 567 | @fa-var-sort-numeric-desc: "\f163"; 568 | @fa-var-sort-up: "\f0de"; 569 | @fa-var-soundcloud: "\f1be"; 570 | @fa-var-space-shuttle: "\f197"; 571 | @fa-var-spinner: "\f110"; 572 | @fa-var-spoon: "\f1b1"; 573 | @fa-var-spotify: "\f1bc"; 574 | @fa-var-square: "\f0c8"; 575 | @fa-var-square-o: "\f096"; 576 | @fa-var-stack-exchange: "\f18d"; 577 | @fa-var-stack-overflow: "\f16c"; 578 | @fa-var-star: "\f005"; 579 | @fa-var-star-half: "\f089"; 580 | @fa-var-star-half-empty: "\f123"; 581 | @fa-var-star-half-full: "\f123"; 582 | @fa-var-star-half-o: "\f123"; 583 | @fa-var-star-o: "\f006"; 584 | @fa-var-steam: "\f1b6"; 585 | @fa-var-steam-square: "\f1b7"; 586 | @fa-var-step-backward: "\f048"; 587 | @fa-var-step-forward: "\f051"; 588 | @fa-var-stethoscope: "\f0f1"; 589 | @fa-var-sticky-note: "\f249"; 590 | @fa-var-sticky-note-o: "\f24a"; 591 | @fa-var-stop: "\f04d"; 592 | @fa-var-stop-circle: "\f28d"; 593 | @fa-var-stop-circle-o: "\f28e"; 594 | @fa-var-street-view: "\f21d"; 595 | @fa-var-strikethrough: "\f0cc"; 596 | @fa-var-stumbleupon: "\f1a4"; 597 | @fa-var-stumbleupon-circle: "\f1a3"; 598 | @fa-var-subscript: "\f12c"; 599 | @fa-var-subway: "\f239"; 600 | @fa-var-suitcase: "\f0f2"; 601 | @fa-var-sun-o: "\f185"; 602 | @fa-var-superscript: "\f12b"; 603 | @fa-var-support: "\f1cd"; 604 | @fa-var-table: "\f0ce"; 605 | @fa-var-tablet: "\f10a"; 606 | @fa-var-tachometer: "\f0e4"; 607 | @fa-var-tag: "\f02b"; 608 | @fa-var-tags: "\f02c"; 609 | @fa-var-tasks: "\f0ae"; 610 | @fa-var-taxi: "\f1ba"; 611 | @fa-var-television: "\f26c"; 612 | @fa-var-tencent-weibo: "\f1d5"; 613 | @fa-var-terminal: "\f120"; 614 | @fa-var-text-height: "\f034"; 615 | @fa-var-text-width: "\f035"; 616 | @fa-var-th: "\f00a"; 617 | @fa-var-th-large: "\f009"; 618 | @fa-var-th-list: "\f00b"; 619 | @fa-var-thumb-tack: "\f08d"; 620 | @fa-var-thumbs-down: "\f165"; 621 | @fa-var-thumbs-o-down: "\f088"; 622 | @fa-var-thumbs-o-up: "\f087"; 623 | @fa-var-thumbs-up: "\f164"; 624 | @fa-var-ticket: "\f145"; 625 | @fa-var-times: "\f00d"; 626 | @fa-var-times-circle: "\f057"; 627 | @fa-var-times-circle-o: "\f05c"; 628 | @fa-var-tint: "\f043"; 629 | @fa-var-toggle-down: "\f150"; 630 | @fa-var-toggle-left: "\f191"; 631 | @fa-var-toggle-off: "\f204"; 632 | @fa-var-toggle-on: "\f205"; 633 | @fa-var-toggle-right: "\f152"; 634 | @fa-var-toggle-up: "\f151"; 635 | @fa-var-trademark: "\f25c"; 636 | @fa-var-train: "\f238"; 637 | @fa-var-transgender: "\f224"; 638 | @fa-var-transgender-alt: "\f225"; 639 | @fa-var-trash: "\f1f8"; 640 | @fa-var-trash-o: "\f014"; 641 | @fa-var-tree: "\f1bb"; 642 | @fa-var-trello: "\f181"; 643 | @fa-var-tripadvisor: "\f262"; 644 | @fa-var-trophy: "\f091"; 645 | @fa-var-truck: "\f0d1"; 646 | @fa-var-try: "\f195"; 647 | @fa-var-tty: "\f1e4"; 648 | @fa-var-tumblr: "\f173"; 649 | @fa-var-tumblr-square: "\f174"; 650 | @fa-var-turkish-lira: "\f195"; 651 | @fa-var-tv: "\f26c"; 652 | @fa-var-twitch: "\f1e8"; 653 | @fa-var-twitter: "\f099"; 654 | @fa-var-twitter-square: "\f081"; 655 | @fa-var-umbrella: "\f0e9"; 656 | @fa-var-underline: "\f0cd"; 657 | @fa-var-undo: "\f0e2"; 658 | @fa-var-university: "\f19c"; 659 | @fa-var-unlink: "\f127"; 660 | @fa-var-unlock: "\f09c"; 661 | @fa-var-unlock-alt: "\f13e"; 662 | @fa-var-unsorted: "\f0dc"; 663 | @fa-var-upload: "\f093"; 664 | @fa-var-usb: "\f287"; 665 | @fa-var-usd: "\f155"; 666 | @fa-var-user: "\f007"; 667 | @fa-var-user-md: "\f0f0"; 668 | @fa-var-user-plus: "\f234"; 669 | @fa-var-user-secret: "\f21b"; 670 | @fa-var-user-times: "\f235"; 671 | @fa-var-users: "\f0c0"; 672 | @fa-var-venus: "\f221"; 673 | @fa-var-venus-double: "\f226"; 674 | @fa-var-venus-mars: "\f228"; 675 | @fa-var-viacoin: "\f237"; 676 | @fa-var-video-camera: "\f03d"; 677 | @fa-var-vimeo: "\f27d"; 678 | @fa-var-vimeo-square: "\f194"; 679 | @fa-var-vine: "\f1ca"; 680 | @fa-var-vk: "\f189"; 681 | @fa-var-volume-down: "\f027"; 682 | @fa-var-volume-off: "\f026"; 683 | @fa-var-volume-up: "\f028"; 684 | @fa-var-warning: "\f071"; 685 | @fa-var-wechat: "\f1d7"; 686 | @fa-var-weibo: "\f18a"; 687 | @fa-var-weixin: "\f1d7"; 688 | @fa-var-whatsapp: "\f232"; 689 | @fa-var-wheelchair: "\f193"; 690 | @fa-var-wifi: "\f1eb"; 691 | @fa-var-wikipedia-w: "\f266"; 692 | @fa-var-windows: "\f17a"; 693 | @fa-var-won: "\f159"; 694 | @fa-var-wordpress: "\f19a"; 695 | @fa-var-wrench: "\f0ad"; 696 | @fa-var-xing: "\f168"; 697 | @fa-var-xing-square: "\f169"; 698 | @fa-var-y-combinator: "\f23b"; 699 | @fa-var-y-combinator-square: "\f1d4"; 700 | @fa-var-yahoo: "\f19e"; 701 | @fa-var-yc: "\f23b"; 702 | @fa-var-yc-square: "\f1d4"; 703 | @fa-var-yelp: "\f1e9"; 704 | @fa-var-yen: "\f157"; 705 | @fa-var-youtube: "\f167"; 706 | @fa-var-youtube-play: "\f16a"; 707 | @fa-var-youtube-square: "\f166"; 708 | 709 | -------------------------------------------------------------------------------- /static/fa/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /static/fa/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /static/fa/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /static/fa/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /static/fa/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /static/fa/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /static/fa/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | @mixin fa-icon-rotate($degrees, $rotation) { 15 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}); 16 | -webkit-transform: rotate($degrees); 17 | -ms-transform: rotate($degrees); 18 | transform: rotate($degrees); 19 | } 20 | 21 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 22 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}); 23 | -webkit-transform: scale($horiz, $vert); 24 | -ms-transform: scale($horiz, $vert); 25 | transform: scale($horiz, $vert); 26 | } 27 | -------------------------------------------------------------------------------- /static/fa/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /static/fa/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /static/fa/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /static/fa/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | -------------------------------------------------------------------------------- /static/font/mnjxxk.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Honlan/ppd-magic-mirror/ef110a615883772ff535e66868b8a407fbe7af96/static/font/mnjxxk.eot -------------------------------------------------------------------------------- /static/font/mnjxxk.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Honlan/ppd-magic-mirror/ef110a615883772ff535e66868b8a407fbe7af96/static/font/mnjxxk.ttf -------------------------------------------------------------------------------- /static/font/mnjxxk.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Honlan/ppd-magic-mirror/ef110a615883772ff535e66868b8a407fbe7af96/static/font/mnjxxk.woff -------------------------------------------------------------------------------- /static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Honlan/ppd-magic-mirror/ef110a615883772ff535e66868b8a407fbe7af96/static/img/logo.png -------------------------------------------------------------------------------- /static/js/countUp.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | countUp.js 4 | (c) 2014-2015 @inorganik 5 | Licensed under the MIT license. 6 | 7 | */ 8 | 9 | // target = id of html element or var of previously selected html element where counting occurs 10 | // startVal = the value you want to begin at 11 | // endVal = the value you want to arrive at 12 | // decimals = number of decimal places, default 0 13 | // duration = duration of animation in seconds, default 2 14 | // options = optional object of options (see below) 15 | 16 | var CountUp = function(target, startVal, endVal, decimals, duration, options) { 17 | 18 | // make sure requestAnimationFrame and cancelAnimationFrame are defined 19 | // polyfill for browsers without native support 20 | // by Opera engineer Erik Möller 21 | var lastTime = 0; 22 | var vendors = ['webkit', 'moz', 'ms', 'o']; 23 | for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { 24 | window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; 25 | window.cancelAnimationFrame = 26 | window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; 27 | } 28 | if (!window.requestAnimationFrame) { 29 | window.requestAnimationFrame = function(callback, element) { 30 | var currTime = new Date().getTime(); 31 | var timeToCall = Math.max(0, 16 - (currTime - lastTime)); 32 | var id = window.setTimeout(function() { callback(currTime + timeToCall); }, 33 | timeToCall); 34 | lastTime = currTime + timeToCall; 35 | return id; 36 | }; 37 | } 38 | if (!window.cancelAnimationFrame) { 39 | window.cancelAnimationFrame = function(id) { 40 | clearTimeout(id); 41 | }; 42 | } 43 | 44 | // Robert Penner's easeOutExpo 45 | this.easeOutExpo = function(t, b, c, d) { 46 | return c * (-Math.pow(2, -10 * t / d) + 1) * 1024 / 1023 + b; 47 | }; 48 | 49 | // default options 50 | this.options = { 51 | useEasing : true, // toggle easing 52 | useGrouping : true, // 1,000,000 vs 1000000 53 | separator : '', // character to use as a separator 54 | decimal : '.', // character to use as a decimal 55 | postFormatter: null, // post formatter to run after internal formatting 56 | easingFn: null, // custom easing closure function, will default to Robert Penner's easeOutExpo 57 | formattingFn: null // custom formatting closure function, in the scenario you need more control over the printed number 58 | }; 59 | // extend default options with passed options object 60 | for (var key in options) { 61 | if (options.hasOwnProperty(key)) { 62 | this.options[key] = options[key]; 63 | } 64 | } 65 | if (this.options.separator === '') this.options.useGrouping = false; 66 | if (!this.options.prefix) this.options.prefix = ''; 67 | if (!this.options.suffix) this.options.suffix = ''; 68 | // establish easing function 69 | this.options.easingFn = !this.options.easingFn 70 | ? this.easeOutExpo 71 | : this.options.easingFn; 72 | 73 | this.d = (typeof target === 'string') ? document.getElementById(target) : target; 74 | this.startVal = Number(startVal); 75 | this.endVal = Number(endVal); 76 | this.countDown = (this.startVal > this.endVal); 77 | this.frameVal = this.startVal; 78 | this.decimals = Math.max(0, decimals || 0); 79 | this.dec = Math.pow(10, this.decimals); 80 | this.duration = Number(duration) * 1000 || 2000; 81 | var self = this; 82 | 83 | this.version = function () { return '1.7.0'; }; 84 | 85 | // Print value to target 86 | this.printValue = function(value) { 87 | if(self.options.formattingFn) { 88 | var result = self.options.formattingFn(value); 89 | } else { 90 | var result = (!isNaN(value)) ? self.formatNumber(value) : '--'; 91 | } 92 | 93 | if (self.d.tagName == 'INPUT') { 94 | this.d.value = result; 95 | } 96 | else if (self.d.tagName == 'text' || self.d.tagName == 'tspan') { 97 | this.d.textContent = result; 98 | } 99 | else { 100 | this.d.innerHTML = result; 101 | } 102 | }; 103 | 104 | this.count = function(timestamp) { 105 | 106 | if (!self.startTime) self.startTime = timestamp; 107 | 108 | self.timestamp = timestamp; 109 | 110 | var progress = timestamp - self.startTime; 111 | self.remaining = self.duration - progress; 112 | 113 | // to ease or not to ease 114 | if (self.options.useEasing) { 115 | if (self.countDown) { 116 | self.frameVal = self.startVal - self.options.easingFn.call( 117 | self, 118 | progress, 119 | 0, 120 | self.startVal - self.endVal, 121 | self.duration 122 | ); 123 | } else { 124 | self.frameVal = self.options.easingFn.call( 125 | self, 126 | progress, 127 | self.startVal, 128 | self.endVal - self.startVal, 129 | self.duration 130 | ); 131 | } 132 | } else { 133 | if (self.countDown) { 134 | self.frameVal = self.startVal - ((self.startVal - self.endVal) * (progress / self.duration)); 135 | } else { 136 | self.frameVal = self.startVal + (self.endVal - self.startVal) * (progress / self.duration); 137 | } 138 | } 139 | 140 | // don't go past endVal since progress can exceed duration in the last frame 141 | if (self.countDown) { 142 | self.frameVal = (self.frameVal < self.endVal) ? self.endVal : self.frameVal; 143 | } else { 144 | self.frameVal = (self.frameVal > self.endVal) ? self.endVal : self.frameVal; 145 | } 146 | 147 | // decimal 148 | self.frameVal = Math.floor(self.frameVal*self.dec)/self.dec; 149 | 150 | // format and print value 151 | self.printValue(self.frameVal); 152 | 153 | // whether to continue 154 | if (progress < self.duration) { 155 | self.rAF = requestAnimationFrame(self.count); 156 | } else { 157 | if (self.callback) self.callback(); 158 | } 159 | }; 160 | // start your animation 161 | this.start = function(callback) { 162 | self.callback = callback; 163 | self.rAF = requestAnimationFrame(self.count); 164 | return false; 165 | }; 166 | // toggles pause/resume animation 167 | this.pauseResume = function() { 168 | if (!self.paused) { 169 | self.paused = true; 170 | cancelAnimationFrame(self.rAF); 171 | } else { 172 | self.paused = false; 173 | delete self.startTime; 174 | self.duration = self.remaining; 175 | self.startVal = self.frameVal; 176 | requestAnimationFrame(self.count); 177 | } 178 | }; 179 | // reset to startVal so animation can be run again 180 | this.reset = function() { 181 | self.paused = false; 182 | delete self.startTime; 183 | self.startVal = startVal; 184 | cancelAnimationFrame(self.rAF); 185 | self.printValue(self.startVal); 186 | }; 187 | // pass a new endVal and start animation 188 | this.update = function (newEndVal) { 189 | cancelAnimationFrame(self.rAF); 190 | self.paused = false; 191 | delete self.startTime; 192 | self.startVal = self.frameVal; 193 | self.endVal = Number(newEndVal); 194 | self.countDown = (self.startVal > self.endVal); 195 | self.rAF = requestAnimationFrame(self.count); 196 | }; 197 | this.formatNumber = function(nStr) { 198 | nStr = nStr.toFixed(self.decimals); 199 | nStr += ''; 200 | var x, x1, x2, rgx; 201 | x = nStr.split('.'); 202 | x1 = x[0]; 203 | x2 = x.length > 1 ? self.options.decimal + x[1] : ''; 204 | rgx = /(\d+)(\d{3})/; 205 | if (self.options.useGrouping) { 206 | while (rgx.test(x1)) { 207 | x1 = x1.replace(rgx, '$1' + self.options.separator + '$2'); 208 | } 209 | } 210 | var value = self.options.prefix + x1 + x2 + self.options.suffix; 211 | if(self.options.postFormatter != null) { 212 | value = self.options.postFormatter(value); 213 | } 214 | return value; 215 | }; 216 | 217 | // format startVal on initialization 218 | self.printValue(self.startVal); 219 | }; 220 | 221 | // Example: 222 | // var numAnim = new countUp("SomeElementYouWantToAnimate", 0, 99.99, 2, 2.5); 223 | // numAnim.start(); 224 | // numAnim.update(135); 225 | // with optional callback: 226 | // numAnim.start(someMethodToCallOnComplete); 227 | -------------------------------------------------------------------------------- /static/js/d3.layout.cloud.js: -------------------------------------------------------------------------------- 1 | // Word cloud layout by Jason Davies, http://www.jasondavies.com/word-cloud/ 2 | // Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf 3 | (function(exports) { 4 | function cloud() { 5 | var size = [256, 256], 6 | text = cloudText, 7 | font = cloudFont, 8 | fontSize = cloudFontSize, 9 | rotate = cloudRotate, 10 | padding = cloudPadding, 11 | spiral = archimedeanSpiral, 12 | words = [], 13 | timeInterval = Infinity, 14 | event = d3.dispatch("word", "end"), 15 | timer = null, 16 | cloud = {}; 17 | 18 | cloud.start = function() { 19 | var board = zeroArray((size[0] >> 5) * size[1]), 20 | bounds = null, 21 | n = words.length, 22 | i = -1, 23 | tags = [], 24 | data = words.map(function(d, i) { 25 | return { 26 | text: text.call(this, d, i), 27 | font: font.call(this, d, i), 28 | rotate: rotate.call(this, d, i), 29 | size: ~~fontSize.call(this, d, i), 30 | padding: cloudPadding.call(this, d, i) 31 | }; 32 | }).sort(function(a, b) { return b.size - a.size; }); 33 | 34 | if (timer) clearInterval(timer); 35 | timer = setInterval(step, 0); 36 | step(); 37 | 38 | return cloud; 39 | 40 | function step() { 41 | var start = +new Date, 42 | d; 43 | while (+new Date - start < timeInterval && ++i < n && timer) { 44 | d = data[i]; 45 | d.x = (size[0] * (Math.random() + .5)) >> 1; 46 | d.y = (size[1] * (Math.random() + .5)) >> 1; 47 | cloudSprite(d, data, i); 48 | if (place(board, d, bounds)) { 49 | tags.push(d); 50 | event.word(d); 51 | if (bounds) cloudBounds(bounds, d); 52 | else bounds = [{x: d.x + d.x0, y: d.y + d.y0}, {x: d.x + d.x1, y: d.y + d.y1}]; 53 | // Temporary hack 54 | d.x -= size[0] >> 1; 55 | d.y -= size[1] >> 1; 56 | } 57 | } 58 | if (i >= n) { 59 | cloud.stop(); 60 | event.end(tags, bounds); 61 | } 62 | } 63 | } 64 | 65 | cloud.stop = function() { 66 | if (timer) { 67 | clearInterval(timer); 68 | timer = null; 69 | } 70 | return cloud; 71 | }; 72 | 73 | cloud.timeInterval = function(x) { 74 | if (!arguments.length) return timeInterval; 75 | timeInterval = x == null ? Infinity : x; 76 | return cloud; 77 | }; 78 | 79 | function place(board, tag, bounds) { 80 | var perimeter = [{x: 0, y: 0}, {x: size[0], y: size[1]}], 81 | startX = tag.x, 82 | startY = tag.y, 83 | maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]), 84 | s = spiral(size), 85 | dt = Math.random() < .5 ? 1 : -1, 86 | t = -dt, 87 | dxdy, 88 | dx, 89 | dy; 90 | 91 | while (dxdy = s(t += dt)) { 92 | dx = ~~dxdy[0]; 93 | dy = ~~dxdy[1]; 94 | 95 | if (Math.min(dx, dy) > maxDelta) break; 96 | 97 | tag.x = startX + dx; 98 | tag.y = startY + dy; 99 | 100 | if (tag.x + tag.x0 < 0 || tag.y + tag.y0 < 0 || 101 | tag.x + tag.x1 > size[0] || tag.y + tag.y1 > size[1]) continue; 102 | // TODO only check for collisions within current bounds. 103 | if (!bounds || !cloudCollide(tag, board, size[0])) { 104 | if (!bounds || collideRects(tag, bounds)) { 105 | var sprite = tag.sprite, 106 | w = tag.width >> 5, 107 | sw = size[0] >> 5, 108 | lx = tag.x - (w << 4), 109 | sx = lx & 0x7f, 110 | msx = 32 - sx, 111 | h = tag.y1 - tag.y0, 112 | x = (tag.y + tag.y0) * sw + (lx >> 5), 113 | last; 114 | for (var j = 0; j < h; j++) { 115 | last = 0; 116 | for (var i = 0; i <= w; i++) { 117 | board[x + i] |= (last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0); 118 | } 119 | x += sw; 120 | } 121 | delete tag.sprite; 122 | return true; 123 | } 124 | } 125 | } 126 | return false; 127 | } 128 | 129 | cloud.words = function(x) { 130 | if (!arguments.length) return words; 131 | words = x; 132 | return cloud; 133 | }; 134 | 135 | cloud.size = function(x) { 136 | if (!arguments.length) return size; 137 | size = [+x[0], +x[1]]; 138 | return cloud; 139 | }; 140 | 141 | cloud.font = function(x) { 142 | if (!arguments.length) return font; 143 | font = d3.functor(x); 144 | return cloud; 145 | }; 146 | 147 | cloud.rotate = function(x) { 148 | if (!arguments.length) return rotate; 149 | rotate = d3.functor(x); 150 | return cloud; 151 | }; 152 | 153 | cloud.text = function(x) { 154 | if (!arguments.length) return text; 155 | text = d3.functor(x); 156 | return cloud; 157 | }; 158 | 159 | cloud.spiral = function(x) { 160 | if (!arguments.length) return spiral; 161 | spiral = spirals[x + ""] || x; 162 | return cloud; 163 | }; 164 | 165 | cloud.fontSize = function(x) { 166 | if (!arguments.length) return fontSize; 167 | fontSize = d3.functor(x); 168 | return cloud; 169 | }; 170 | 171 | cloud.padding = function(x) { 172 | if (!arguments.length) return padding; 173 | padding = d3.functor(x); 174 | return cloud; 175 | }; 176 | 177 | return d3.rebind(cloud, event, "on"); 178 | } 179 | 180 | function cloudText(d) { 181 | return d.text; 182 | } 183 | 184 | function cloudFont() { 185 | return "serif"; 186 | } 187 | 188 | function cloudFontSize(d) { 189 | return Math.sqrt(d.value); 190 | } 191 | 192 | function cloudRotate() { 193 | return (~~(Math.random() * 6) - 3) * 30; 194 | } 195 | 196 | function cloudPadding() { 197 | return 1; 198 | } 199 | 200 | // Fetches a monochrome sprite bitmap for the specified text. 201 | // Load in batches for speed. 202 | function cloudSprite(d, data, di) { 203 | if (d.sprite) return; 204 | c.clearRect(0, 0, (cw << 5) / ratio, ch / ratio); 205 | var x = 0, 206 | y = 0, 207 | maxh = 0, 208 | n = data.length; 209 | di--; 210 | while (++di < n) { 211 | d = data[di]; 212 | c.save(); 213 | c.font = ~~((d.size + 1) / ratio) + "px " + d.font; 214 | var w = c.measureText(d.text + "m").width * ratio, 215 | h = d.size << 1; 216 | if (d.rotate) { 217 | var sr = Math.sin(d.rotate * cloudRadians), 218 | cr = Math.cos(d.rotate * cloudRadians), 219 | wcr = w * cr, 220 | wsr = w * sr, 221 | hcr = h * cr, 222 | hsr = h * sr; 223 | w = (Math.max(Math.abs(wcr + hsr), Math.abs(wcr - hsr)) + 0x1f) >> 5 << 5; 224 | h = ~~Math.max(Math.abs(wsr + hcr), Math.abs(wsr - hcr)); 225 | } else { 226 | w = (w + 0x1f) >> 5 << 5; 227 | } 228 | if (h > maxh) maxh = h; 229 | if (x + w >= (cw << 5)) { 230 | x = 0; 231 | y += maxh; 232 | maxh = 0; 233 | } 234 | if (y + h >= ch) break; 235 | c.translate((x + (w >> 1)) / ratio, (y + (h >> 1)) / ratio); 236 | if (d.rotate) c.rotate(d.rotate * cloudRadians); 237 | c.fillText(d.text, 0, 0); 238 | c.restore(); 239 | d.width = w; 240 | d.height = h; 241 | d.xoff = x; 242 | d.yoff = y; 243 | d.x1 = w >> 1; 244 | d.y1 = h >> 1; 245 | d.x0 = -d.x1; 246 | d.y0 = -d.y1; 247 | x += w; 248 | } 249 | var pixels = c.getImageData(0, 0, (cw << 5) / ratio, ch / ratio).data, 250 | sprite = []; 251 | while (--di >= 0) { 252 | d = data[di]; 253 | var w = d.width, 254 | w32 = w >> 5, 255 | h = d.y1 - d.y0, 256 | p = d.padding; 257 | // Zero the buffer 258 | for (var i = 0; i < h * w32; i++) sprite[i] = 0; 259 | x = d.xoff; 260 | if (x == null) return; 261 | y = d.yoff; 262 | var seen = 0, 263 | seenRow = -1; 264 | for (var j = 0; j < h; j++) { 265 | for (var i = 0; i < w; i++) { 266 | var k = w32 * j + (i >> 5), 267 | m = pixels[((y + j) * (cw << 5) + (x + i)) << 2] ? 1 << (31 - (i % 32)) : 0; 268 | if (p) { 269 | if (j) sprite[k - w32] |= m; 270 | if (j < w - 1) sprite[k + w32] |= m; 271 | m |= (m << 1) | (m >> 1); 272 | } 273 | sprite[k] |= m; 274 | seen |= m; 275 | } 276 | if (seen) seenRow = j; 277 | else { 278 | d.y0++; 279 | h--; 280 | j--; 281 | y++; 282 | } 283 | } 284 | d.y1 = d.y0 + seenRow; 285 | d.sprite = sprite.slice(0, (d.y1 - d.y0) * w32); 286 | } 287 | } 288 | 289 | // Use mask-based collision detection. 290 | function cloudCollide(tag, board, sw) { 291 | sw >>= 5; 292 | var sprite = tag.sprite, 293 | w = tag.width >> 5, 294 | lx = tag.x - (w << 4), 295 | sx = lx & 0x7f, 296 | msx = 32 - sx, 297 | h = tag.y1 - tag.y0, 298 | x = (tag.y + tag.y0) * sw + (lx >> 5), 299 | last; 300 | for (var j = 0; j < h; j++) { 301 | last = 0; 302 | for (var i = 0; i <= w; i++) { 303 | if (((last << msx) | (i < w ? (last = sprite[j * w + i]) >>> sx : 0)) 304 | & board[x + i]) return true; 305 | } 306 | x += sw; 307 | } 308 | return false; 309 | } 310 | 311 | function cloudBounds(bounds, d) { 312 | var b0 = bounds[0], 313 | b1 = bounds[1]; 314 | if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0; 315 | if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0; 316 | if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1; 317 | if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1; 318 | } 319 | 320 | function collideRects(a, b) { 321 | return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y; 322 | } 323 | 324 | function archimedeanSpiral(size) { 325 | var e = size[0] / size[1]; 326 | return function(t) { 327 | return [e * (t *= .1) * Math.cos(t), t * Math.sin(t)]; 328 | }; 329 | } 330 | 331 | function rectangularSpiral(size) { 332 | var dy = 4, 333 | dx = dy * size[0] / size[1], 334 | x = 0, 335 | y = 0; 336 | return function(t) { 337 | var sign = t < 0 ? -1 : 1; 338 | // See triangular numbers: T_n = n * (n + 1) / 2. 339 | switch ((Math.sqrt(1 + 4 * sign * t) - sign) & 3) { 340 | case 0: x += dx; break; 341 | case 1: y += dy; break; 342 | case 2: x -= dx; break; 343 | default: y -= dy; break; 344 | } 345 | return [x, y]; 346 | }; 347 | } 348 | 349 | // TODO reuse arrays? 350 | function zeroArray(n) { 351 | var a = [], 352 | i = -1; 353 | while (++i < n) a[i] = 0; 354 | return a; 355 | } 356 | 357 | var cloudRadians = Math.PI / 180, 358 | cw = 1 << 11 >> 5, 359 | ch = 1 << 11, 360 | canvas, 361 | ratio = 1; 362 | 363 | if (typeof document !== "undefined") { 364 | canvas = document.createElement("canvas"); 365 | canvas.width = 1; 366 | canvas.height = 1; 367 | ratio = Math.sqrt(canvas.getContext("2d").getImageData(0, 0, 1, 1).data.length >> 2); 368 | canvas.width = (cw << 5) / ratio; 369 | canvas.height = ch / ratio; 370 | } else { 371 | // node-canvas support 372 | var Canvas = require("canvas"); 373 | canvas = new Canvas(cw << 5, ch); 374 | } 375 | 376 | var c = canvas.getContext("2d"), 377 | spirals = { 378 | archimedean: archimedeanSpiral, 379 | rectangular: rectangularSpiral 380 | }; 381 | c.fillStyle = "red"; 382 | c.textAlign = "center"; 383 | 384 | exports.cloud = cloud; 385 | })(typeof exports === "undefined" ? d3.layout || (d3.layout = {}) : exports); -------------------------------------------------------------------------------- /static/js/dark.js: -------------------------------------------------------------------------------- 1 | (function (root, factory) { 2 | if (typeof define === 'function' && define.amd) { 3 | // AMD. Register as an anonymous module. 4 | define(['exports', 'echarts'], factory); 5 | } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { 6 | // CommonJS 7 | factory(exports, require('echarts')); 8 | } else { 9 | // Browser globals 10 | factory({}, root.echarts); 11 | } 12 | }(this, function (exports, echarts) { 13 | var log = function (msg) { 14 | if (typeof console !== 'undefined') { 15 | console && console.error && console.error(msg); 16 | } 17 | }; 18 | if (!echarts) { 19 | log('ECharts is not Loaded'); 20 | return; 21 | } 22 | var contrastColor = '#eee'; 23 | var axisCommon = function () { 24 | return { 25 | axisLine: { 26 | lineStyle: { 27 | color: contrastColor 28 | } 29 | }, 30 | axisTick: { 31 | lineStyle: { 32 | color: contrastColor 33 | } 34 | }, 35 | axisLabel: { 36 | textStyle: { 37 | color: contrastColor 38 | } 39 | }, 40 | splitLine: { 41 | lineStyle: { 42 | type: 'dashed', 43 | color: '#aaa' 44 | } 45 | }, 46 | splitArea: { 47 | areaStyle: { 48 | color: contrastColor 49 | } 50 | } 51 | }; 52 | }; 53 | 54 | var colorPalette = ['#dd6b66','#759aa0','#e69d87','#8dc1a9','#ea7e53','#eedd78','#73a373','#73b9bc','#7289ab', '#91ca8c','#f49f42']; 55 | var theme = { 56 | color: colorPalette, 57 | backgroundColor: '#333', 58 | tooltip: { 59 | axisPointer: { 60 | lineStyle: { 61 | color: contrastColor 62 | }, 63 | crossStyle: { 64 | color: contrastColor 65 | } 66 | } 67 | }, 68 | legend: { 69 | textStyle: { 70 | color: contrastColor 71 | } 72 | }, 73 | textStyle: { 74 | color: contrastColor 75 | }, 76 | title: { 77 | textStyle: { 78 | color: contrastColor 79 | } 80 | }, 81 | toolbox: { 82 | iconStyle: { 83 | normal: { 84 | borderColor: contrastColor 85 | } 86 | } 87 | }, 88 | timeline: { 89 | lineStyle: { 90 | color: contrastColor 91 | }, 92 | itemStyle: { 93 | normal: { 94 | color: colorPalette[1] 95 | } 96 | }, 97 | label: { 98 | normal: { 99 | textStyle: { 100 | color: contrastColor 101 | } 102 | } 103 | }, 104 | controlStyle: { 105 | normal: { 106 | color: contrastColor, 107 | borderColor: contrastColor 108 | } 109 | } 110 | }, 111 | timeAxis: axisCommon(), 112 | logAxis: axisCommon(), 113 | valueAxis: axisCommon(), 114 | categoryAxis: axisCommon(), 115 | 116 | line: { 117 | symbol: 'circle' 118 | }, 119 | graph: { 120 | color: colorPalette 121 | }, 122 | gauge: { 123 | title: { 124 | textStyle: { 125 | color: contrastColor 126 | } 127 | } 128 | } 129 | }; 130 | theme.categoryAxis.splitLine.show = false; 131 | echarts.registerTheme('dark', theme); 132 | })); -------------------------------------------------------------------------------- /static/js/echarts2/chart/bar.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/bar",["require","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.bar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}},emphasis:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}}}};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_BAR,_buildShape:function(){this._buildPosition()},_buildNormal:function(e,t,i,o,r){for(var s,l,h,d,c,m,p,u,V,U,g,f,y=this.series,b=i[0][0],_=y[b],x="horizontal"==r,k=this.component.xAxis,v=this.component.yAxis,L=x?k.getAxis(_.xAxisIndex):v.getAxis(_.yAxisIndex),w=this._mapSize(L,i),W=w.gap,X=w.barGap,I=w.barWidthMap,S=w.barMaxWidthMap,K=w.barWidth,C=w.barMinHeightMap,T=w.interval,E=this.deepQuery([this.ecTheme,a],"island.r"),z=0,A=t;A>z&&null!=L.getNameByIndex(z);z++){x?d=L.getCoordByIndex(z)-W/2:c=L.getCoordByIndex(z)+W/2;for(var M=0,F=i.length;F>M;M++){var J=y[i[M][0]].yAxisIndex||0,P=y[i[M][0]].xAxisIndex||0;s=x?v.getAxis(J):k.getAxis(P),p=m=V=u=s.getCoord(0);for(var O=0,D=i[M].length;D>O;O++)b=i[M][O],_=y[b],g=_.data[z],f=this.getDataFromOption(g,"-"),o[b]=o[b]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},h=Math.min(S[b]||Number.MAX_VALUE,I[b]||K),"-"!==f&&(f>0?(l=O>0?s.getCoordSize(f):x?p-s.getCoord(f):s.getCoord(f)-p,1===D&&C[b]>l&&(l=C[b]),x?(m-=l,c=m):(d=m,m+=l)):0>f?(l=O>0?s.getCoordSize(f):x?s.getCoord(f)-V:V-s.getCoord(f),1===D&&C[b]>l&&(l=C[b]),x?(c=u,u+=l):(u-=l,d=u)):(l=0,x?(m-=l,c=m):(d=m,m+=l)),o[b][z]=x?d+h/2:c-h/2,o[b].min>f&&(o[b].min=f,x?(o[b].minY=c,o[b].minX=o[b][z]):(o[b].minX=d+l,o[b].minY=o[b][z])),o[b].maxO;O++)b=i[M][O],_=y[b],g=_.data[z],f=this.getDataFromOption(g,"-"),h=Math.min(S[b]||Number.MAX_VALUE,I[b]||K),"-"==f&&this.deepQuery([g,_,this.option],"calculable")&&(x?(m-=E,c=m):(d=m,m+=E),U=this._getBarItem(b,z,L.getNameByIndex(z),d,c-(x?0:h),x?h:E,x?E:h,x?"vertical":"horizontal"),U.hoverable=!1,U.draggable=!1,U.style.lineWidth=1,U.style.brushType="stroke",U.style.strokeColor=_.calculableHolderColor||this.ecTheme.calculableHolderColor||a.calculableHolderColor,this.shapeList.push(new n(U)));x?d+=h+X:c-=h+X}}this._calculMarkMapXY(o,i,x?"y":"x")},_buildHorizontal:function(e,t,i,n){return this._buildNormal(e,t,i,n,"horizontal")},_buildVertical:function(e,t,i,n){return this._buildNormal(e,t,i,n,"vertical")},_buildOther:function(e,t,i,a){for(var o=this.series,r=0,s=i.length;s>r;r++)for(var l=0,h=i[r].length;h>l;l++){var d=i[r][l],c=o[d],m=c.xAxisIndex||0,p=this.component.xAxis.getAxis(m),u=p.getCoord(0),V=c.yAxisIndex||0,U=this.component.yAxis.getAxis(V),g=U.getCoord(0);a[d]=a[d]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var f=0,y=c.data.length;y>f;f++){var b=c.data[f],_=this.getDataFromOption(b,"-");if(_ instanceof Array){var x,k,v=p.getCoord(_[0]),L=U.getCoord(_[1]),w=[b,c],W=this.deepQuery(w,"barWidth")||10,X=this.deepQuery(w,"barHeight");null!=X?(x="horizontal",_[0]>0?(W=v-u,v-=W):W=_[0]<0?u-v:0,k=this._getBarItem(d,f,_[0],v,L-X/2,W,X,x)):(x="vertical",_[1]>0?X=g-L:_[1]<0?(X=L-g,L-=X):X=0,k=this._getBarItem(d,f,_[0],v-W/2,L,W,X,x)),this.shapeList.push(new n(k)),v=p.getCoord(_[0]),L=U.getCoord(_[1]),a[d].min0>_[0]&&(a[d].min0=_[0],a[d].minY0=L,a[d].minX0=v),a[d].max0<_[0]&&(a[d].max0=_[0],a[d].maxY0=L,a[d].maxX0=v),a[d].sum0+=_[0],a[d].counter0++,a[d].min1>_[1]&&(a[d].min1=_[1],a[d].minY1=L,a[d].minX1=v),a[d].max1<_[1]&&(a[d].max1=_[1],a[d].maxY1=L,a[d].maxX1=v),a[d].sum1+=_[1],a[d].counter1++}}}this._calculMarkMapXY(a,i,"xy")},_mapSize:function(e,t,i){var n,a,o=this._findSpecialBarSzie(t,i),r=o.barWidthMap,s=o.barMaxWidthMap,l=o.barMinHeightMap,h=o.sBarWidthCounter,d=o.sBarWidthTotal,c=o.barGap,m=o.barCategoryGap,p=1;if(t.length!=h){if(i)n=e.getGap(),c=0,a=+(n/t.length).toFixed(2),0>=a&&(p=Math.floor(t.length/n),a=1);else if(n="string"==typeof m&&m.match(/%$/)?(e.getGap()*(100-parseFloat(m))/100).toFixed(2)-0:e.getGap()-m,"string"==typeof c&&c.match(/%$/)?(c=parseFloat(c)/100,a=+((n-d)/((t.length-1)*c+t.length-h)).toFixed(2),c=a*c):(c=parseFloat(c),a=+((n-d-c*(t.length-1))/(t.length-h)).toFixed(2)),0>=a)return this._mapSize(e,t,!0)}else if(n=h>1?"string"==typeof m&&m.match(/%$/)?+(e.getGap()*(100-parseFloat(m))/100).toFixed(2):e.getGap()-m:d,a=0,c=h>1?+((n-d)/(h-1)).toFixed(2):0,0>c)return this._mapSize(e,t,!0);return this._recheckBarMaxWidth(t,r,s,l,n,a,c,p)},_findSpecialBarSzie:function(e,t){for(var i,n,a,o,r=this.series,s={},l={},h={},d=0,c=0,m=0,p=e.length;p>m;m++)for(var u={barWidth:!1,barMaxWidth:!1},V=0,U=e[m].length;U>V;V++){var g=e[m][V],f=r[g];if(!t){if(u.barWidth)s[g]=i;else if(i=this.query(f,"barWidth"),null!=i){s[g]=i,c+=i,d++,u.barWidth=!0;for(var y=0,b=V;b>y;y++){var _=e[m][y];s[_]=i}}if(u.barMaxWidth)l[g]=n;else if(n=this.query(f,"barMaxWidth"),null!=n){l[g]=n,u.barMaxWidth=!0;for(var y=0,b=V;b>y;y++){var _=e[m][y];l[_]=n}}}h[g]=this.query(f,"barMinHeight"),a=null!=a?a:this.query(f,"barGap"),o=null!=o?o:this.query(f,"barCategoryGap")}return{barWidthMap:s,barMaxWidthMap:l,barMinHeightMap:h,sBarWidth:i,sBarMaxWidth:n,sBarWidthCounter:d,sBarWidthTotal:c,barGap:a,barCategoryGap:o}},_recheckBarMaxWidth:function(e,t,i,n,a,o,r,s){for(var l=0,h=e.length;h>l;l++){var d=e[l][0];i[d]&&i[d]0&&y.height>f&&y.width>f?(y.y+=f/2,y.height-=f,y.x+=f/2,y.width-=f):y.brushType="fill",d.highlightStyle.textColor=d.highlightStyle.color,d=this.addLabel(d,m,p,i,h);for(var b=[y,d.highlightStyle],_=0,x=b.length;x>_;_++){var k=b[_].textPosition;if("insideLeft"===k||"insideRight"===k||"insideTop"===k||"insideBottom"===k){var v=5;switch(k){case"insideLeft":b[_].textX=y.x+v,b[_].textY=y.y+y.height/2,b[_].textAlign="left",b[_].textBaseline="middle";break;case"insideRight":b[_].textX=y.x+y.width-v,b[_].textY=y.y+y.height/2,b[_].textAlign="right",b[_].textBaseline="middle";break;case"insideTop":b[_].textX=y.x+y.width/2,b[_].textY=y.y+v/2,b[_].textAlign="center",b[_].textBaseline="top";break;case"insideBottom":b[_].textX=y.x+y.width/2,b[_].textY=y.y+y.height-v/2,b[_].textAlign="center",b[_].textBaseline="bottom"}b[_].textPosition="specific",b[_].textColor=b[_].textColor||"#fff"}}return this.deepQuery([p,m,this.option],"calculable")&&(this.setCalculable(d),d.draggable=!0),o.pack(d,c[e],e,c[e].data[t],t,i),d},getMarkCoord:function(e,t){var i,n,a=this.series[e],o=this.xMarkMap[e],r=this.component.xAxis.getAxis(a.xAxisIndex),s=this.component.yAxis.getAxis(a.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)if(o.isHorizontal){i="string"==typeof t.xAxis&&r.getIndexByName?r.getIndexByName(t.xAxis):t.xAxis||0;var l=o[i];l=null!=l?l:"string"!=typeof t.xAxis&&r.getCoordByIndex?r.getCoordByIndex(t.xAxis||0):r.getCoord(t.xAxis||0),n=[l,s.getCoord(t.yAxis||0)]}else{i="string"==typeof t.yAxis&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var h=o[i];h=null!=h?h:"string"!=typeof t.yAxis&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),n=[r.getCoord(t.xAxis||0),h]}else{var d=null!=t.valueIndex?t.valueIndex:null!=o.maxX0?"1":"";n=[o[t.type+"X"+d],o[t.type+"Y"+d],o[t.type+"Line"+d],o[t.type+d]]}return n},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e,t){function i(){V--,0===V&&t&&t()}for(var n=this.series,a={},r=0,s=e.length;s>r;r++)a[e[r][0]]=e[r];for(var l,h,d,c,m,p,u,V=0,r=this.shapeList.length-1;r>=0;r--)if(p=o.get(this.shapeList[r],"seriesIndex"),a[p]&&!a[p][3]&&"rectangle"===this.shapeList[r].type){if(u=o.get(this.shapeList[r],"dataIndex"),m=n[p],a[p][2]&&u===m.data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!a[p][2]&&0===u){this.zr.delShape(this.shapeList[r].id);continue}"horizontal"===this.shapeList[r]._orient?(c=this.component.yAxis.getAxis(m.yAxisIndex||0).getGap(),d=a[p][2]?-c:c,l=0):(h=this.component.xAxis.getAxis(m.xAxisIndex||0).getGap(),l=a[p][2]?h:-h,d=0),this.shapeList[r].position=[0,0],V++,this.zr.animate(this.shapeList[r].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[l,d]}).done(i).start()}V||t&&t()}},r.inherits(t,i),e("../chart").define("bar",t),t}); -------------------------------------------------------------------------------- /static/js/echarts2/chart/chord.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/chord",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Sector","../util/shape/Ribbon","../util/shape/Icon","zrender/shape/BezierCurve","../config","../util/ecData","zrender/tool/util","zrender/tool/vector","../data/Graph","../layout/Chord","../chart"],function(e){"use strict";function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.scaleLineLength=4,this.scaleUnitAngle=4,this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Sector"),r=e("../util/shape/Ribbon"),s=e("../util/shape/Icon"),l=e("zrender/shape/BezierCurve"),h=e("../config");h.chord={zlevel:0,z:2,clickable:!0,radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,ribbonType:!0,minRadius:10,maxRadius:20,symbol:"circle",showScale:!1,showScaleText:!1,itemStyle:{normal:{borderWidth:0,borderColor:"#000",label:{show:!0,rotate:!1,distance:5},chordStyle:{width:1,color:"black",borderWidth:1,borderColor:"#999",opacity:.5}},emphasis:{borderWidth:0,borderColor:"#000",chordStyle:{width:1,color:"black",borderWidth:1,borderColor:"#999"}}}};var d=e("../util/ecData"),c=e("zrender/tool/util"),p=e("zrender/tool/vector"),m=e("../data/Graph"),u=e("../layout/Chord");return t.prototype={type:h.CHART_TYPE_CHORD,_init:function(){var e=this.series;this.selectedMap={};for(var t={},i={},n=0,a=e.length;a>n;n++)if(e[n].type===this.type){var o=this.isSelected(e[n].name);this.selectedMap[e[n].name]=o,o&&this.buildMark(n),this.reformOption(e[n]),t[e[n].name]=e[n]}for(var n=0,a=e.length;a>n;n++)if(e[n].type===this.type)if(e[n].insertToSerie){var r=t[e[n].insertToSerie];e[n]._referenceSerie=r}else i[e[n].name]=[e[n]];for(var n=0,a=e.length;a>n;n++)if(e[n].type===this.type&&e[n].insertToSerie){for(var s=e[n]._referenceSerie;s&&s._referenceSerie;)s=s._referenceSerie;i[s.name]&&this.selectedMap[e[n].name]&&i[s.name].push(e[n])}for(var l in i)this._buildChords(i[l]);this.addShapeList()},_getNodeCategory:function(e,t){return e.categories&&e.categories[t.category||0]},_getNodeQueryTarget:function(e,t){var i=this._getNodeCategory(e,t);return[t,i,e]},_getEdgeQueryTarget:function(e,t,i){return i=i||"normal",[t.itemStyle&&t.itemStyle[i],e.itemStyle[i].chordStyle]},_buildChords:function(e){for(var t=[],i=e[0],n=function(e){return e.layout.size>0},a=function(e){return function(t){return e.getEdge(t.node2,t.node1)}},o=0;oa;a++){var r=n[a];if(r&&!r.ignore){var s=this._getNodeCategory(t,r),l=s?s.name:r.name;if(this.selectedMap[l]=this.isSelected(l),this.selectedMap[l]){var h=i.addNode(r.name,r);h.rawIndex=a}}}for(var a=0,o=e.links.length;o>a;a++){var d=e.links[a],c=d.source,p=d.target;"number"==typeof c&&(c=n[c],c&&(c=c.name)),"number"==typeof p&&(p=n[p],p&&(p=p.name));var u=i.addEdge(c,p,d);u&&(u.rawIndex=a)}return i.eachNode(function(e){var i=e.data.value;if(null==i)if(i=0,t.ribbonType)for(var n=0;n0&&(u.style.brushType="both"),u.highlightStyle.lineWidth>0&&(u.highlightStyle.brushType="both"),d.pack(u,e,t,i.data,i.rawIndex,i.id,i.category),this.shapeList.push(u),i.shape=u},this)},_buildNodeIcons:function(e,t,i,n){var a=this.parseCenter(this.zr,n.center),o=this.parseRadius(this.zr,n.radius),r=o[1];i.eachNode(function(i){var o=i.layout.startAngle,l=i.layout.endAngle,h=(o+l)/2,c=r*Math.cos(h),p=r*Math.sin(h),m=this._getNodeQueryTarget(n,i.data),u=this._getNodeCategory(n,i.data),g=this.deepQuery(m,"itemStyle.normal.color");g||(g=this.getColor(u?u.name:i.id));var V=new s({zlevel:e.zlevel,z:e.z+1,style:{x:-i.layout.size,y:-i.layout.size,width:2*i.layout.size,height:2*i.layout.size,iconType:this.deepQuery(m,"symbol"),color:g,brushType:"both",lineWidth:this.deepQuery(m,"itemStyle.normal.borderWidth"),strokeColor:this.deepQuery(m,"itemStyle.normal.borderColor")},highlightStyle:{color:this.deepQuery(m,"itemStyle.emphasis.color"),lineWidth:this.deepQuery(m,"itemStyle.emphasis.borderWidth"),strokeColor:this.deepQuery(m,"itemStyle.emphasis.borderColor")},clickable:n.clickable,position:[c+a[0],p+a[1]]});d.pack(V,e,t,i.data,i.rawIndex,i.id,i.category),this.shapeList.push(V),i.shape=V},this)},_buildLabels:function(e,t,i,a){var o=this.query(a,"itemStyle.normal.label.rotate"),r=this.query(a,"itemStyle.normal.label.distance"),s=this.parseCenter(this.zr,a.center),l=this.parseRadius(this.zr,a.radius),h=a.clockWise,d=h?1:-1;i.eachNode(function(t){var i=t.layout.startAngle/Math.PI*180*d,h=t.layout.endAngle/Math.PI*180*d,c=(i*-d+h*-d)/2;c%=360,0>c&&(c+=360);var m=90>=c||c>=270;c=c*Math.PI/180;var u=[Math.cos(c),-Math.sin(c)],g=0;g=a.ribbonType?a.showScaleText?35+r:r:r+t.layout.size;var V=p.scale([],u,l[1]+g);p.add(V,V,s);var y={zlevel:e.zlevel,z:e.z+1,hoverable:!1,style:{text:null==t.data.label?t.id:t.data.label,textAlign:m?"left":"right"}};o?(y.rotation=m?c:Math.PI+c,y.style.x=m?l[1]+g:-l[1]-g,y.style.y=0,y.position=s.slice()):(y.style.x=V[0],y.style.y=V[1]),y.style.color=this.deepQuery([t.data,a],"itemStyle.normal.label.textStyle.color")||"#000000",y.style.textFont=this.getFont(this.deepQuery([t.data,a],"itemStyle.normal.label.textStyle")),y=new n(y),this.shapeList.push(y),t.labelShape=y},this)},_buildRibbons:function(e,t,i,n){var a=e[t],o=this.parseCenter(this.zr,n.center),s=this.parseRadius(this.zr,n.radius);i.eachEdge(function(l,h){var c,p=i.getEdge(l.node2,l.node1);if(p&&!l.shape){if(p.shape)return void(l.shape=p.shape);var m=l.layout.startAngle/Math.PI*180,u=l.layout.endAngle/Math.PI*180,g=p.layout.startAngle/Math.PI*180,V=p.layout.endAngle/Math.PI*180;c=this.getColor(1===e.length?l.layout.weight<=p.layout.weight?l.node1.id:l.node2.id:a.name);var y,f,U=this._getEdgeQueryTarget(a,l.data),_=this._getEdgeQueryTarget(a,l.data,"emphasis"),b=new r({zlevel:a.zlevel,z:a.z,style:{x:o[0],y:o[1],r:s[0],source0:m,source1:u,target0:g,target1:V,brushType:"both",opacity:this.deepQuery(U,"opacity"),color:c,lineWidth:this.deepQuery(U,"borderWidth"),strokeColor:this.deepQuery(U,"borderColor"),clockWise:n.clockWise},clickable:n.clickable,highlightStyle:{brushType:"both",opacity:this.deepQuery(_,"opacity"),lineWidth:this.deepQuery(_,"borderWidth"),strokeColor:this.deepQuery(_,"borderColor")}});l.layout.weight<=p.layout.weight?(y=p.node1,f=p.node2):(y=l.node1,f=l.node2),d.pack(b,a,t,l.data,null==l.rawIndex?h:l.rawIndex,l.data.name||y.id+"-"+f.id,y.id,f.id),this.shapeList.push(b),l.shape=b}},this)},_buildEdgeCurves:function(e,t,i,n,a){var o=e[t],r=this.parseCenter(this.zr,n.center);i.eachEdge(function(e,i){var n=a.getNodeById(e.node1.id),s=a.getNodeById(e.node2.id),h=n.shape,c=s.shape,p=this._getEdgeQueryTarget(o,e.data),m=this._getEdgeQueryTarget(o,e.data,"emphasis"),u=new l({zlevel:o.zlevel,z:o.z,style:{xStart:h.position[0],yStart:h.position[1],xEnd:c.position[0],yEnd:c.position[1],cpX1:r[0],cpY1:r[1],lineWidth:this.deepQuery(p,"width"),strokeColor:this.deepQuery(p,"color"),opacity:this.deepQuery(p,"opacity")},highlightStyle:{lineWidth:this.deepQuery(m,"width"),strokeColor:this.deepQuery(m,"color"),opacity:this.deepQuery(m,"opacity")}});d.pack(u,o,t,e.data,null==e.rawIndex?i:e.rawIndex,e.data.name||e.node1.id+"-"+e.node2.id,e.node1.id,e.node2.id),this.shapeList.push(u),e.shape=u},this)},_buildScales:function(e,t,i){var o,r,s=e.clockWise,l=this.parseCenter(this.zr,e.center),h=this.parseRadius(this.zr,e.radius),d=s?1:-1,c=0,m=-(1/0);e.showScaleText&&(i.eachNode(function(e){var t=e.data.value;t>m&&(m=t),c+=t}),m>1e10?(o="b",r=1e-9):m>1e7?(o="m",r=1e-6):m>1e4?(o="k",r=.001):(o="",r=1));var u=c/(360-e.padding);i.eachNode(function(t){for(var i=t.layout.startAngle/Math.PI*180,c=t.layout.endAngle/Math.PI*180,m=i;;){if(s&&m>c||!s&&c>m)break;var g=m/180*Math.PI,V=[Math.cos(g),Math.sin(g)],y=p.scale([],V,h[1]+1);p.add(y,y,l);var f=p.scale([],V,h[1]+this.scaleLineLength);p.add(f,f,l);var U=new a({zlevel:e.zlevel,z:e.z-1,hoverable:!1,style:{xStart:y[0],yStart:y[1],xEnd:f[0],yEnd:f[1],lineCap:"round",brushType:"stroke",strokeColor:"#666",lineWidth:1}});this.shapeList.push(U),m+=d*this.scaleUnitAngle}if(e.showScaleText)for(var _=i,b=5*u*this.scaleUnitAngle,x=0;;){if(s&&_>c||!s&&c>_)break;var g=_;g%=360,0>g&&(g+=360);var k=90>=g||g>=270,v=new n({zlevel:e.zlevel,z:e.z-1,hoverable:!1,style:{x:k?h[1]+this.scaleLineLength+4:-h[1]-this.scaleLineLength-4,y:0,text:Math.round(10*x)/10+o,textAlign:k?"left":"right"},position:l.slice(),rotation:k?[-g/180*Math.PI,0,0]:[-(g+180)/180*Math.PI,0,0]});this.shapeList.push(v),x+=b*r,_+=d*this.scaleUnitAngle*5}},this)},refresh:function(e){if(e&&(this.option=e,this.series=e.series),this.legend=this.component.legend,this.legend)this.getColor=function(e){return this.legend.getColor(e)},this.isSelected=function(e){return this.legend.isSelected(e)};else{var t={},i=0;this.getColor=function(e){return t[e]?t[e]:(t[e]||(t[e]=this.zr.getColor(i++)),t[e])},this.isSelected=function(){return!0}}this.backupShapeList(),this._init()},reformOption:function(e){var t=c.merge;e=t(t(e||{},this.ecTheme.chord),h.chord),e.itemStyle.normal.label.textStyle=this.getTextStyle(e.itemStyle.normal.label.textStyle),this.z=e.z,this.zlevel=e.zlevel}},c.inherits(t,i),e("../chart").define("chord",t),t}),define("echarts/util/shape/Ribbon",["require","zrender/shape/Base","zrender/shape/util/PathProxy","zrender/tool/util","zrender/tool/area"],function(e){function t(e){i.call(this,e),this._pathProxy=new n}var i=e("zrender/shape/Base"),n=e("zrender/shape/util/PathProxy"),a=e("zrender/tool/util"),o=e("zrender/tool/area");return t.prototype={type:"ribbon",buildPath:function(e,t){var i=t.clockWise||!1,n=this._pathProxy;n.begin(e);var a=t.x,o=t.y,r=t.r,s=t.source0/180*Math.PI,l=t.source1/180*Math.PI,h=t.target0/180*Math.PI,d=t.target1/180*Math.PI,c=a+Math.cos(s)*r,p=o+Math.sin(s)*r,m=a+Math.cos(l)*r,u=o+Math.sin(l)*r,g=a+Math.cos(h)*r,V=o+Math.sin(h)*r,y=a+Math.cos(d)*r,f=o+Math.sin(d)*r;n.moveTo(c,p),n.arc(a,o,t.r,s,l,!i),n.bezierCurveTo(.7*(a-m)+m,.7*(o-u)+u,.7*(a-g)+g,.7*(o-V)+V,g,V),(t.source0!==t.target0||t.source1!==t.target1)&&(n.arc(a,o,t.r,h,d,!i),n.bezierCurveTo(.7*(a-y)+y,.7*(o-f)+f,.7*(a-c)+c,.7*(o-p)+p,c,p))},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var i=this.getRect(this.style);return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?o.isInsidePath(this._pathProxy.pathCommands,0,"fill",e,t):void 0}},a.inherits(t,i),t}),define("echarts/data/Graph",["require","zrender/tool/util"],function(e){var t=e("zrender/tool/util"),i=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={}};i.prototype.isDirected=function(){return this._directed},i.prototype.addNode=function(e,t){if(this._nodesMap[e])return this._nodesMap[e];var n=new i.Node(e,t);return this.nodes.push(n),this._nodesMap[e]=n,n},i.prototype.getNodeById=function(e){return this._nodesMap[e]},i.prototype.addEdge=function(e,t,n){if("string"==typeof e&&(e=this._nodesMap[e]),"string"==typeof t&&(t=this._nodesMap[t]),e&&t){var a=e.id+"-"+t.id;if(this._edgesMap[a])return this._edgesMap[a];var o=new i.Edge(e,t,n);return this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),this._edgesMap[a]=o,o}},i.prototype.removeEdge=function(e){var i=e.node1,n=e.node2,a=i.id+"-"+n.id;this._directed&&(i.outEdges.splice(t.indexOf(i.outEdges,e),1),n.inEdges.splice(t.indexOf(n.inEdges,e),1)),i.edges.splice(t.indexOf(i.edges,e),1),i!==n&&n.edges.splice(t.indexOf(n.edges,e),1),delete this._edgesMap[a],this.edges.splice(t.indexOf(this.edges,e),1)},i.prototype.getEdge=function(e,t){return"string"!=typeof e&&(e=e.id),"string"!=typeof t&&(t=t.id),this._directed?this._edgesMap[e+"-"+t]:this._edgesMap[e+"-"+t]||this._edgesMap[t+"-"+e]},i.prototype.removeNode=function(e){if("string"!=typeof e||(e=this._nodesMap[e])){delete this._nodesMap[e.id],this.nodes.splice(t.indexOf(this.nodes,e),1);for(var i=0;in;)e.call(t,this.nodes[n],n)?n++:(this.removeNode(this.nodes[n]),i--)},i.prototype.filterEdge=function(e,t){for(var i=this.edges.length,n=0;i>n;)e.call(t,this.edges[n],n)?n++:(this.removeEdge(this.edges[n]),i--)},i.prototype.eachNode=function(e,t){for(var i=this.nodes.length,n=0;i>n;n++)this.nodes[n]&&e.call(t,this.nodes[n],n)},i.prototype.eachEdge=function(e,t){for(var i=this.edges.length,n=0;i>n;n++)this.edges[n]&&e.call(t,this.edges[n],n)},i.prototype.clear=function(){this.nodes.length=0,this.edges.length=0,this._nodesMap={},this._edgesMap={}},i.prototype.breadthFirstTraverse=function(e,t,i,n){if("string"==typeof t&&(t=this._nodesMap[t]),t){var a="edges";"out"===i?a="outEdges":"in"===i&&(a="inEdges");for(var o=0;or;r++){var s=o.addNode(e[r].id,e[r]);s.data.value=0,n&&(s.data.outValue=s.data.inValue=0)}for(var r=0;a>r;r++)for(var l=0;a>l;l++){var h=t[r][l];n&&(o.nodes[r].data.outValue+=h,o.nodes[l].data.inValue+=h),o.nodes[r].data.value+=h,o.nodes[l].data.value+=h}for(var r=0;a>r;r++)for(var l=r;a>l;l++){var h=t[r][l];if(0!==h){var d=o.nodes[r],c=o.nodes[l],p=o.addEdge(d,c,{});if(p.data.weight=h,r!==l&&n&&t[l][r]){var m=o.addEdge(c,d,{});m.data.weight=t[l][r]}}}return o}},i}),define("echarts/layout/Chord",["require"],function(){var e=function(e){e=e||{},this.sort=e.sort||null,this.sortSub=e.sortSub||null,this.padding=.05,this.startAngle=e.startAngle||0,this.clockWise=null==e.clockWise?!1:e.clockWise,this.center=e.center||[0,0],this.directed=!0};e.prototype.run=function(e){e instanceof Array||(e=[e]);var n=e.length;if(n){for(var a=e[0],o=a.nodes.length,r=[],s=0,l=0;o>l;l++){var h=a.nodes[l],d={size:0,subGroups:[],node:h};r.push(d);for(var c=0,p=0;pl;l++){var d=r[l];d.node.layout.startAngle=_,d.node.layout.endAngle=_+b*d.size*U,d.node.layout.subGroups=[];for(var V=0;Vn;n++)if(i[n].type===this.type){e=this.component.xAxis.getAxis(i[n].xAxisIndex||0);for(var o=0,r=i[n].data.length;r>o;o++){t=i[n].data[o].evolution;for(var l=0,h=t.length;h>l;l++)t[l].timeScale=e.getCoord(s.getNewDate(t[l].time)-0),t[l].valueScale=Math.pow(t[l].value,.8)}}this._intervalX=Math.round(this.component.grid.getWidth()/40)},_drawEventRiver:function(){for(var e=this.series,t=0;ta)){for(var o=[],r=[],s=0;a>s;s++)o.push(n[s].timeScale),r.push(n[s].valueScale);var l=[];l.push([o[0],i]);var s=0;for(s=0;a-1>s;s++)l.push([(o[s]+o[s+1])/2,r[s]/-2+i]);for(l.push([(o[s]+(o[s]+t))/2,r[s]/-2+i]),l.push([o[s]+t,i]),l.push([(o[s]+(o[s]+t))/2,r[s]/2+i]),s=a-1;s>0;s--)l.push([(o[s]+o[s-1])/2,r[s-1]/2+i]);return l}},ondragend:function(e,t){this.isDragend&&e.target&&(t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1)},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},l.inherits(t,i),e("../chart").define("eventRiver",t),t}),define("echarts/layout/eventRiver",["require"],function(){function e(e,i,o){function r(e,t){var i=e.importance,n=t.importance;return i>n?-1:n>i?1:0}for(var s=4,l=0;l=e)return[0];for(var t=[];e--;)t.push(0);return t}(),u=c.slice(0),y=[],g=0,b=0,l=0;l.5?.5:1,r=t.y,s=(t.height-n)/i,l=0,h=e.length;h>l;l++){var m=e[l];m.y=r+s*m.y+m._offset*o,delete m.time,delete m.value,delete m.xpx,delete m.ypx,delete m._offset;for(var V=m.evolution,U=0,d=V.length;d>U;U++)V[U].valueScale*=s}}function i(e,t,i,n){if(e===i)throw new Error("x0 is equal with x1!!!");if(t===n)return function(){return t};var a=(t-n)/(e-i),o=(n*e-t*i)/(e-i);return function(e){return a*e+o}}function n(e,t,n){var a=~~t,o=e.time.length;e.xpx=[],e.ypx=[];for(var r,s=0,l=0,h=0,m=0,V=0;o>s;s++){l=~~e.time[s],m=e.value[s]/2,s===o-1?(h=l+a,V=0):(h=~~e.time[s+1],V=e.value[s+1]/2),r=i(l,m,h,V);for(var U=l;h>U;U++)e.xpx.push(U-n),e.ypx.push(r(U))}e.xpx.push(h-n),e.ypx.push(V)}function a(e,t,i){for(var n,a=0,o=t.xpx.length,r=0;o>r;r++)n=i(t,r),a=Math.max(a,n+e[t.xpx[r]]);for(r=0;o>r;r++)n=i(t,r),e[t.xpx[r]]=a+n;return a}return e}); -------------------------------------------------------------------------------- /static/js/echarts2/chart/funnel.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/funnel",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Polygon"),r=e("../config");r.funnel={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}};var s=e("../util/ecData"),l=e("../util/number"),h=e("zrender/tool/util"),m=e("zrender/tool/color"),V=e("zrender/tool/area");return t.prototype={type:r.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};for(var i,n=0,a=e.length;a>n;n++)if(e[n].type===r.CHART_TYPE_FUNNEL){if(e[n]=this.reformOption(e[n]),this.legendHoverLink=e[n].legendHoverLink||this.legendHoverLink,i=e[n].name||"",this.selectedMap[i]=t?t.isSelected(i):!0,!this.selectedMap[i])continue;this._buildSingleFunnel(n),this.buildMark(n)}this.addShapeList()},_buildSingleFunnel:function(e){var t=this.component.legend,i=this.series[e],n=this._mapData(e),a=this._getLocation(e);this._paramsMap[e]={location:a,data:n};for(var o,r=0,s=[],h=0,m=n.length;m>h;h++)o=n[h].name,this.selectedMap[o]=t?t.isSelected(o):!0,this.selectedMap[o]&&!isNaN(n[h].value)&&(s.push(n[h]),r++);if(0!==r){for(var V,U,d,p,c=this._buildFunnelCase(e),u=i.funnelAlign,y=i.gap,g=r>1?(a.height-(r-1)*y)/r:a.height,b=a.y,f="descending"===i.sort?this._getItemWidth(e,s[0].value):l.parsePercent(i.minSize,a.width),k="descending"===i.sort?1:0,_=a.centerX,x=[],h=0,m=s.length;m>h;h++)if(o=s[h].name,this.selectedMap[o]&&!isNaN(s[h].value)){switch(V=m-2>=h?this._getItemWidth(e,s[h+k].value):"descending"===i.sort?l.parsePercent(i.minSize,a.width):l.parsePercent(i.maxSize,a.width),u){case"left":U=a.x;break;case"right":U=a.x+a.width-f;break;default:U=_-f/2}d=this._buildItem(e,s[h]._index,t?t.getColor(o):this.zr.getColor(s[h]._index),U,b,f,V,g,u),b+=g+y,p=d.style.pointList,x.unshift([p[0][0]-10,p[0][1]]),x.push([p[1][0]+10,p[1][1]]),0===h&&(0===f?(p=x.pop(),"center"==u&&(x[0][0]+=10),"right"==u&&(x[0][0]=p[0]),x[0][1]-="center"==u?10:15,1==m&&(p=d.style.pointList)):(x[x.length-1][1]-=5,x[0][1]-=5)),f=V}c&&(x.unshift([p[3][0]-10,p[3][1]]),x.push([p[2][0]+10,p[2][1]]),0===f?(p=x.pop(),"center"==u&&(x[0][0]+=10),"right"==u&&(x[0][0]=p[0]),x[0][1]+="center"==u?10:15):(x[x.length-1][1]+=5,x[0][1]+=5),c.style.pointList=x)}},_buildFunnelCase:function(e){var t=this.series[e];if(this.deepQuery([t,this.option],"calculable")){var i=this._paramsMap[e].location,n=10,a={hoverable:!1,style:{pointListd:[[i.x-n,i.y-n],[i.x+i.width+n,i.y-n],[i.x+i.width+n,i.y+i.height+n],[i.x-n,i.y+i.height+n]],brushType:"stroke",lineWidth:1,strokeColor:t.calculableHolderColor||this.ecTheme.calculableHolderColor||r.calculableHolderColor}};return s.pack(a,t,e,void 0,-1),this.setCalculable(a),a=new o(a),this.shapeList.push(a),a}},_getLocation:function(e){var t=this.series[e],i=this.zr.getWidth(),n=this.zr.getHeight(),a=this.parsePercent(t.x,i),o=this.parsePercent(t.y,n),r=null==t.width?i-a-this.parsePercent(t.x2,i):this.parsePercent(t.width,i);return{x:a,y:o,width:r,height:null==t.height?n-o-this.parsePercent(t.y2,n):this.parsePercent(t.height,n),centerX:a+r/2}},_mapData:function(e){function t(e,t){return"-"===e.value?1:"-"===t.value?-1:t.value-e.value}function i(e,i){return-t(e,i)}for(var n=this.series[e],a=h.clone(n.data),o=0,r=a.length;r>o;o++)a[o]._index=o;return"none"!=n.sort&&a.sort("descending"===n.sort?t:i),a},_buildItem:function(e,t,i,n,a,o,r,l,h){var m=this.series,V=m[e],U=V.data[t],d=this.getPolygon(e,t,i,n,a,o,r,l,h);s.pack(d,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(d);var p=this.getLabel(e,t,i,n,a,o,r,l,h);s.pack(p,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(p),this._needLabel(V,U,!1)||(p.invisible=!0);var c=this.getLabelLine(e,t,i,n,a,o,r,l,h);this.shapeList.push(c),this._needLabelLine(V,U,!1)||(c.invisible=!0);var u=[],y=[];return this._needLabelLine(V,U,!0)&&(u.push(c.id),y.push(c.id)),this._needLabel(V,U,!0)&&(u.push(p.id),y.push(d.id)),d.hoverConnect=u,p.hoverConnect=y,d},_getItemWidth:function(e,t){var i=this.series[e],n=this._paramsMap[e].location,a=i.min,o=i.max,r=l.parsePercent(i.minSize,n.width),s=l.parsePercent(i.maxSize,n.width);return(t-a)*(s-r)/(o-a)+r},getPolygon:function(e,t,i,n,a,r,s,l,h){var V,U=this.series[e],d=U.data[t],p=[d,U],c=this.deepMerge(p,"itemStyle.normal")||{},u=this.deepMerge(p,"itemStyle.emphasis")||{},y=this.getItemStyleColor(c.color,e,t,d)||i,g=this.getItemStyleColor(u.color,e,t,d)||("string"==typeof y?m.lift(y,-.2):y);switch(h){case"left":V=n;break;case"right":V=n+(r-s);break;default:V=n+(r-s)/2}var b={zlevel:U.zlevel,z:U.z,clickable:this.deepQuery(p,"clickable"),style:{pointList:[[n,a],[n+r,a],[V+s,a+l],[V,a+l]],brushType:"both",color:y,lineWidth:c.borderWidth,strokeColor:c.borderColor},highlightStyle:{color:g,lineWidth:u.borderWidth,strokeColor:u.borderColor}};return this.deepQuery([d,U,this.option],"calculable")&&(this.setCalculable(b),b.draggable=!0),new o(b)},getLabel:function(e,t,i,a,o,r,s,l,U){var d,p=this.series[e],c=p.data[t],u=this._paramsMap[e].location,y=h.merge(h.clone(c.itemStyle)||{},p.itemStyle),g="normal",b=y[g].label,f=b.textStyle||{},k=y[g].labelLine.length,_=this.getLabelText(e,t,g),x=this.getFont(f),L=i;b.position=b.position||y.normal.label.position,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(r,s)/2>V.getTextWidth(_,x)?"#fff":m.reverse(i)):d="left"===b.position?"right":"left";var W={zlevel:p.zlevel,z:p.z+1,style:{x:this._getLabelPoint(b.position,a,u,r,s,k,U),y:o+l/2,color:f.color||L,text:_,textAlign:f.align||d,textBaseline:f.baseline||"middle",textFont:x}};return g="emphasis",b=y[g].label||b,f=b.textStyle||f,k=y[g].labelLine.length||k,b.position=b.position||y.normal.label.position,_=this.getLabelText(e,t,g),x=this.getFont(f),L=i,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(r,s)/2>V.getTextWidth(_,x)?"#fff":m.reverse(i)):d="left"===b.position?"right":"left",W.highlightStyle={x:this._getLabelPoint(b.position,a,u,r,s,k,U),color:f.color||L,text:_,textAlign:f.align||d,textFont:x,brushType:"fill"},new n(W)},getLabelText:function(e,t,i){var n=this.series,a=n[e],o=a.data[t],r=this.deepQuery([o,a],"itemStyle."+i+".label.formatter");return r?"function"==typeof r?r.call(this.myChart,{seriesIndex:e,seriesName:a.name||"",series:a,dataIndex:t,data:o,name:o.name,value:o.value}):"string"==typeof r?r=r.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{a0}",a.name).replace("{b0}",o.name).replace("{c0}",o.value):void 0:o.name},getLabelLine:function(e,t,i,n,o,r,s,l,m){var V=this.series[e],U=V.data[t],d=this._paramsMap[e].location,p=h.merge(h.clone(U.itemStyle)||{},V.itemStyle),c="normal",u=p[c].labelLine,y=p[c].labelLine.length,g=u.lineStyle||{},b=p[c].label;b.position=b.position||p.normal.label.position;var f={zlevel:V.zlevel,z:V.z+1,hoverable:!1,style:{xStart:this._getLabelLineStartPoint(n,d,r,s,m),yStart:o+l/2,xEnd:this._getLabelPoint(b.position,n,d,r,s,y,m),yEnd:o+l/2,strokeColor:g.color||i,lineType:g.type,lineWidth:g.width}};return c="emphasis",u=p[c].labelLine||u,y=p[c].labelLine.length||y,g=u.lineStyle||g,b=p[c].label||b,b.position=b.position,f.highlightStyle={xEnd:this._getLabelPoint(b.position,n,d,r,s,y,m),strokeColor:g.color||i,lineType:g.type,lineWidth:g.width},new a(f)},_getLabelPoint:function(e,t,i,n,a,o,r){switch(e="inner"===e||"inside"===e?"center":e){case"center":return"center"==r?t+n/2:"left"==r?t+10:t+n-10;case"left":return"auto"===o?i.x-10:"center"==r?i.centerX-Math.max(n,a)/2-o:"right"==r?t-(a>n?a-n:0)-o:i.x-o;default:return"auto"===o?i.x+i.width+10:"center"==r?i.centerX+Math.max(n,a)/2+o:"right"==r?i.x+i.width+o:t+Math.max(n,a)+o}},_getLabelLineStartPoint:function(e,t,i,n,a){return"center"==a?t.centerX:n>i?e+Math.min(i,n)/2:e+Math.max(i,n)/2},_needLabel:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(t,i),e("../chart").define("funnel",t),t}); -------------------------------------------------------------------------------- /static/js/echarts2/chart/gauge.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/gauge",["require","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("../util/shape/GaugePointer"),a=e("zrender/shape/Text"),o=e("zrender/shape/Line"),r=e("zrender/shape/Rectangle"),s=e("zrender/shape/Circle"),l=e("zrender/shape/Sector"),h=e("../config");h.gauge={zlevel:0,z:2,center:["50%","50%"],clickable:!0,legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}};var m=e("../util/ecData"),V=e("../util/accMath"),U=e("zrender/tool/util");return t.prototype={type:h.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={},this.selectedMap={};for(var t=0,i=e.length;i>t;t++)e[t].type===h.CHART_TYPE_GAUGE&&(this.selectedMap[e[t].name]=!0,e[t]=this.reformOption(e[t]),this.legendHoverLink=e[t].legendHoverLink||this.legendHoverLink,this._buildSingleGauge(t),this.buildMark(t));this.addShapeList()},_buildSingleGauge:function(e){var t=this.series[e];this._paramsMap[e]={center:this.parseCenter(this.zr,t.center),radius:this.parseRadius(this.zr,t.radius),startAngle:t.startAngle.toFixed(2)-0,endAngle:t.endAngle.toFixed(2)-0},this._paramsMap[e].totalAngle=this._paramsMap[e].startAngle-this._paramsMap[e].endAngle,this._colorMap(e),this._buildAxisLine(e),this._buildSplitLine(e),this._buildAxisTick(e),this._buildAxisLabel(e),this._buildPointer(e),this._buildTitle(e),this._buildDetail(e)},_buildAxisLine:function(e){var t=this.series[e];if(t.axisLine.show)for(var i,n,a=t.min,o=t.max-a,r=this._paramsMap[e],s=r.center,l=r.startAngle,h=r.totalAngle,V=r.colorArray,U=t.axisLine.lineStyle,d=this.parsePercent(U.width,r.radius[1]),p=r.radius[1],c=p-d,u=l,y=0,g=V.length;g>y;y++)n=l-h*(V[y][0]-a)/o,i=this._getSector(s,c,p,n,u,V[y][1],U,t.zlevel,t.z),u=n,i._animationAdd="r",m.set(i,"seriesIndex",e),m.set(i,"dataIndex",y),this.shapeList.push(i)},_buildSplitLine:function(e){var t=this.series[e];if(t.splitLine.show)for(var i,n,a,r=this._paramsMap[e],s=t.splitNumber,l=t.min,h=t.max-l,m=t.splitLine,V=this.parsePercent(m.length,r.radius[1]),U=m.lineStyle,d=U.color,p=r.center,c=r.startAngle*Math.PI/180,u=r.totalAngle*Math.PI/180,y=r.radius[1],g=y-V,b=0;s>=b;b++)i=c-u/s*b,n=Math.sin(i),a=Math.cos(i),this.shapeList.push(new o({zlevel:t.zlevel,z:t.z+1,hoverable:!1,style:{xStart:p[0]+a*y,yStart:p[1]-n*y,xEnd:p[0]+a*g,yEnd:p[1]-n*g,strokeColor:"auto"===d?this._getColor(e,l+h/s*b):d,lineType:U.type,lineWidth:U.width,shadowColor:U.shadowColor,shadowBlur:U.shadowBlur,shadowOffsetX:U.shadowOffsetX,shadowOffsetY:U.shadowOffsetY}}))},_buildAxisTick:function(e){var t=this.series[e];if(t.axisTick.show)for(var i,n,a,r=this._paramsMap[e],s=t.splitNumber,l=t.min,h=t.max-l,m=t.axisTick,V=m.splitNumber,U=this.parsePercent(m.length,r.radius[1]),d=m.lineStyle,p=d.color,c=r.center,u=r.startAngle*Math.PI/180,y=r.totalAngle*Math.PI/180,g=r.radius[1],b=g-U,f=0,k=s*V;k>=f;f++)f%V!==0&&(i=u-y/k*f,n=Math.sin(i),a=Math.cos(i),this.shapeList.push(new o({zlevel:t.zlevel,z:t.z+1,hoverable:!1,style:{xStart:c[0]+a*g,yStart:c[1]-n*g,xEnd:c[0]+a*b,yEnd:c[1]-n*b,strokeColor:"auto"===p?this._getColor(e,l+h/k*f):p,lineType:d.type,lineWidth:d.width,shadowColor:d.shadowColor,shadowBlur:d.shadowBlur,shadowOffsetX:d.shadowOffsetX,shadowOffsetY:d.shadowOffsetY}})))},_buildAxisLabel:function(e){var t=this.series[e];if(t.axisLabel.show)for(var i,n,o,r,s=t.splitNumber,l=t.min,h=t.max-l,m=t.axisLabel.textStyle,U=this.getFont(m),d=m.color,p=this._paramsMap[e],c=p.center,u=p.startAngle,y=p.totalAngle,g=p.radius[1]-this.parsePercent(t.splitLine.length,p.radius[1])-5,b=0;s>=b;b++)r=V.accAdd(l,V.accMul(V.accDiv(h,s),b)),i=u-y/s*b,n=Math.sin(i*Math.PI/180),o=Math.cos(i*Math.PI/180),i=(i+360)%360,this.shapeList.push(new a({zlevel:t.zlevel,z:t.z+1,hoverable:!1,style:{x:c[0]+o*g,y:c[1]-n*g,color:"auto"===d?this._getColor(e,r):d,text:this._getLabelText(t.axisLabel.formatter,r),textAlign:i>=110&&250>=i?"left":70>=i||i>=290?"right":"center",textBaseline:i>=10&&170>=i?"top":i>=190&&350>=i?"bottom":"middle",textFont:U,shadowColor:m.shadowColor,shadowBlur:m.shadowBlur,shadowOffsetX:m.shadowOffsetX,shadowOffsetY:m.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(t.pointer.show){var i=t.max-t.min,a=t.pointer,o=this._paramsMap[e],r=this.parsePercent(a.length,o.radius[1]),l=this.parsePercent(a.width,o.radius[1]),h=o.center,V=this._getValue(e);V=V2?2:l/2,color:"#fff"}});m.pack(p,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,V),this.shapeList.push(p),this.shapeList.push(new s({zlevel:t.zlevel,z:t.z+2,hoverable:!1,style:{x:h[0],y:h[1],r:a.width/2.5,color:"#fff"}}))}},_buildTitle:function(e){var t=this.series[e];if(t.title.show){var i=t.data[0],n=null!=i.name?i.name:"";if(""!==n){var o=t.title,r=o.offsetCenter,s=o.textStyle,l=s.color,h=this._paramsMap[e],m=h.center[0]+this.parsePercent(r[0],h.radius[1]),V=h.center[1]+this.parsePercent(r[1],h.radius[1]);this.shapeList.push(new a({zlevel:t.zlevel,z:t.z+(Math.abs(m-h.center[0])+Math.abs(V-h.center[1])<2*s.fontSize?2:1),hoverable:!1,style:{x:m,y:V,color:"auto"===l?this._getColor(e):l,text:n,textAlign:"center",textFont:this.getFont(s),shadowColor:s.shadowColor,shadowBlur:s.shadowBlur,shadowOffsetX:s.shadowOffsetX,shadowOffsetY:s.shadowOffsetY}}))}}},_buildDetail:function(e){var t=this.series[e];if(t.detail.show){var i=t.detail,n=i.offsetCenter,a=i.backgroundColor,o=i.textStyle,s=o.color,l=this._paramsMap[e],h=this._getValue(e),m=l.center[0]-i.width/2+this.parsePercent(n[0],l.radius[1]),V=l.center[1]+this.parsePercent(n[1],l.radius[1]);this.shapeList.push(new r({zlevel:t.zlevel,z:t.z+(Math.abs(m+i.width/2-l.center[0])+Math.abs(V+i.height/2-l.center[1])r;r++)o.push([a[r][0]*n+i,a[r][1]]);this._paramsMap[e].colorArray=o},_getColor:function(e,t){null==t&&(t=this._getValue(e));for(var i=this._paramsMap[e].colorArray,n=0,a=i.length;a>n;n++)if(i[n][0]>=t)return i[n][1];return i[i.length-1][1]},_getSector:function(e,t,i,n,a,o,r,s,h){return new l({zlevel:s,z:h,hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:i,startAngle:n,endAngle:a,brushType:"fill",color:o,shadowColor:r.shadowColor,shadowBlur:r.shadowBlur,shadowOffsetX:r.shadowOffsetX,shadowOffsetY:r.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if("function"==typeof e)return e.call(this.myChart,t);if("string"==typeof e)return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},U.inherits(t,i),e("../chart").define("gauge",t),t}),define("echarts/util/shape/GaugePointer",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("zrender/tool/util");return t.prototype={type:"gauge-pointer",buildPath:function(e,t){var i=t.r,n=t.width,a=t.angle,o=t.x-Math.cos(a)*n*(n>=i/3?1:2),r=t.y+Math.sin(a)*n*(n>=i/3?1:2);a=t.angle-Math.PI/2,e.moveTo(o,r),e.lineTo(t.x+Math.cos(a)*n,t.y-Math.sin(a)*n),e.lineTo(t.x+Math.cos(t.angle)*i,t.y-Math.sin(t.angle)*i),e.lineTo(t.x-Math.cos(a)*n,t.y+Math.sin(a)*n),e.lineTo(o,r)},getRect:function(e){if(e.__rect)return e.__rect;var t=2*e.width,i=e.x,n=e.y,a=i+Math.cos(e.angle)*e.r,o=n-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(i,a)-t,y:Math.min(n,o)-t,width:Math.abs(i-a)+t,height:Math.abs(n-o)+t},e.__rect},isCover:e("./normalIsCover")},n.inherits(t,i),t}); -------------------------------------------------------------------------------- /static/js/echarts2/chart/heatmap.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/heatmap",["require","./base","../layer/heatmap","../config","../util/ecData","zrender/tool/util","zrender/tool/color","zrender/shape/Image","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("../layer/heatmap"),a=e("../config"),o=(e("../util/ecData"),e("zrender/tool/util")),r=(e("zrender/tool/color"),e("zrender/shape/Image"));return a.heatmap={zlevel:0,z:2,clickable:!0},t.prototype={type:a.CHART_TYPE_HEATMAP,refresh:function(e){this.clear(),e&&(this.option=e,this.series=e.series),this._init()},_init:function(){var e=this.series;this.backupShapeList();for(var t=e.length,i=0;t>i;++i)if(e[i].type===a.CHART_TYPE_HEATMAP){e[i]=this.reformOption(e[i]);var o=new n(e[i]),s=o.getCanvas(e[i].data,this.zr.getWidth(),this.zr.getHeight()),l=new r({position:[0,0],scale:[1,1],hoverable:this.option.hoverable,style:{x:0,y:0,image:s,width:s.width,height:s.height}});this.shapeList.push(l)}this.addShapeList()}},o.inherits(t,i),e("../chart").define("heatmap",t),t}),define("echarts/layer/heatmap",["require"],function(){function e(e){if(this.option=e,e)for(var i in t)this.option[i]=void 0!==e[i]?e[i]:t[i];else this.option=t}var t={blurSize:30,gradientColors:["blue","cyan","lime","yellow","red"],minAlpha:.05,valueScale:1,opacity:1},i=20,n=256;return e.prototype={getCanvas:function(e,t,a){var o=this._getBrush(),r=this._getGradient(),s=i+this.option.blurSize,l=document.createElement("canvas");l.width=t,l.height=a;for(var h=l.getContext("2d"),m=e.length,V=0;m>V;++V){var d=e[V],U=d[0],p=d[1],c=d[2],u=Math.min(1,Math.max(c*this.option.valueScale||this.option.minAlpha,this.option.minAlpha));h.globalAlpha=u,h.drawImage(o,U-s,p-s)}for(var g=h.getImageData(0,0,l.width,l.height),y=g.data,m=y.length/4;m--;){var b=4*m+3,u=y[b]/256,f=Math.floor(u*(n-1));y[b-3]=r[4*f],y[b-2]=r[4*f+1],y[b-1]=r[4*f+2],y[b]*=this.option.opacity}return h.putImageData(g,0,0),l},_getBrush:function(){if(!this._brushCanvas){this._brushCanvas=document.createElement("canvas");var e=i+this.option.blurSize,t=2*e;this._brushCanvas.width=t,this._brushCanvas.height=t;var n=this._brushCanvas.getContext("2d");n.shadowOffsetX=t,n.shadowBlur=this.option.blurSize,n.shadowColor="black",n.beginPath(),n.arc(-e,e,i,0,2*Math.PI,!0),n.closePath(),n.fill()}return this._brushCanvas},_getGradient:function(){if(!this._gradientPixels){var e=n,t=document.createElement("canvas");t.width=1,t.height=e;for(var i=t.getContext("2d"),a=i.createLinearGradient(0,0,0,e),o=this.option.gradientColors.length,r=0;o>r;++r)"string"==typeof this.option.gradientColors[r]?a.addColorStop((r+1)/o,this.option.gradientColors[r]):a.addColorStop(this.option.gradientColors[r].offset,this.option.gradientColors[r].color);i.fillStyle=a,i.fillRect(0,0,1,e),this._gradientPixels=i.getImageData(0,0,1,e).data}return this._gradientPixels}},e}),define("echarts/layer/heatmap",["require"],function(){function e(e){if(this.option=e,e)for(var i in t)this.option[i]=void 0!==e[i]?e[i]:t[i];else this.option=t}var t={blurSize:30,gradientColors:["blue","cyan","lime","yellow","red"],minAlpha:.05,valueScale:1,opacity:1},i=20,n=256;return e.prototype={getCanvas:function(e,t,a){var o=this._getBrush(),r=this._getGradient(),s=i+this.option.blurSize,l=document.createElement("canvas");l.width=t,l.height=a;for(var h=l.getContext("2d"),m=e.length,V=0;m>V;++V){var d=e[V],U=d[0],p=d[1],c=d[2],u=Math.min(1,Math.max(c*this.option.valueScale||this.option.minAlpha,this.option.minAlpha));h.globalAlpha=u,h.drawImage(o,U-s,p-s)}for(var g=h.getImageData(0,0,l.width,l.height),y=g.data,m=y.length/4;m--;){var b=4*m+3,u=y[b]/256,f=Math.floor(u*(n-1));y[b-3]=r[4*f],y[b-2]=r[4*f+1],y[b-1]=r[4*f+2],y[b]*=this.option.opacity}return h.putImageData(g,0,0),l},_getBrush:function(){if(!this._brushCanvas){this._brushCanvas=document.createElement("canvas");var e=i+this.option.blurSize,t=2*e;this._brushCanvas.width=t,this._brushCanvas.height=t;var n=this._brushCanvas.getContext("2d");n.shadowOffsetX=t,n.shadowBlur=this.option.blurSize,n.shadowColor="black",n.beginPath(),n.arc(-e,e,i,0,2*Math.PI,!0),n.closePath(),n.fill()}return this._brushCanvas},_getGradient:function(){if(!this._gradientPixels){var e=n,t=document.createElement("canvas");t.width=1,t.height=e;for(var i=t.getContext("2d"),a=i.createLinearGradient(0,0,0,e),o=this.option.gradientColors.length,r=0;o>r;++r)"string"==typeof this.option.gradientColors[r]?a.addColorStop((r+1)/o,this.option.gradientColors[r]):a.addColorStop(this.option.gradientColors[r].offset,this.option.gradientColors[r].color);i.fillStyle=a,i.fillRect(0,0,1,e),this._gradientPixels=i.getImageData(0,0,1,e).data}return this._gradientPixels}},e}); -------------------------------------------------------------------------------- /static/js/echarts2/chart/k.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/k",["require","./base","../util/shape/Candle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("../util/shape/Candle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.k={zlevel:0,z:2,clickable:!0,hoverable:!0,legendHoverLink:!1,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"},label:{show:!1}},emphasis:{label:{show:!1}}}};var o=e("../util/ecData"),r=e("zrender/tool/util");return t.prototype={type:a.CHART_TYPE_K,_buildShape:function(){var e=this.series;this.selectedMap={};for(var t,i={top:[],bottom:[]},n=0,o=e.length;o>n;n++)e[n].type===a.CHART_TYPE_K&&(e[n]=this.reformOption(e[n]),this.legendHoverLink=e[n].legendHoverLink||this.legendHoverLink,t=this.component.xAxis.getAxis(e[n].xAxisIndex),t.type===a.COMPONENT_TYPE_AXIS_CATEGORY&&i[t.getPosition()].push(n));for(var r in i)i[r].length>0&&this._buildSinglePosition(r,i[r]);this.addShapeList()},_buildSinglePosition:function(e,t){var i=this._mapData(t),n=i.locationMap,a=i.maxDataLength;if(0!==a&&0!==n.length){this._buildHorizontal(t,a,n);for(var o=0,r=t.length;r>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,i,n=this.series,a=this.component.legend,o=[],r=0,s=0,l=e.length;l>s;s++)t=n[e[s]],i=t.name,this.selectedMap[i]=a?a.isSelected(i):!0,this.selectedMap[i]&&o.push(e[s]),r=Math.max(r,t.data.length);return{locationMap:o,maxDataLength:r}},_buildHorizontal:function(e,t,i){for(var n,a,o,r,s,l,h,d,c,m,p=this.series,u={},g=0,V=i.length;V>g;g++){n=i[g],a=p[n],o=a.xAxisIndex||0,r=this.component.xAxis.getAxis(o),h=a.barWidth||Math.floor(r.getGap()/2),m=a.barMaxWidth,m&&h>m&&(h=m),s=a.yAxisIndex||0,l=this.component.yAxis.getAxis(s),u[n]=[];for(var U=0,y=t;y>U&&null!=r.getNameByIndex(U);U++)d=a.data[U],c=this.getDataFromOption(d,"-"),"-"!==c&&4==c.length&&u[n].push([r.getCoordByIndex(U),h,l.getCoord(c[0]),l.getCoord(c[1]),l.getCoord(c[2]),l.getCoord(c[3]),U,r.getNameByIndex(U)])}this._buildKLine(e,u)},_buildKLine:function(e,t){for(var i,n,o,r,s,l,h,d,c,m,p,u,g,V,U,y,f,_=this.series,b=0,x=e.length;x>b;b++)if(f=e[b],p=_[f],V=t[f],this._isLarge(V)&&(V=this._getLargePointList(V)),p.type===a.CHART_TYPE_K&&null!=V){u=p,i=this.query(u,"itemStyle.normal.lineStyle.width"),n=this.query(u,"itemStyle.normal.lineStyle.color"),o=this.query(u,"itemStyle.normal.lineStyle.color0"),r=this.query(u,"itemStyle.normal.color"),s=this.query(u,"itemStyle.normal.color0"),l=this.query(u,"itemStyle.emphasis.lineStyle.width"),h=this.query(u,"itemStyle.emphasis.lineStyle.color"),d=this.query(u,"itemStyle.emphasis.lineStyle.color0"),c=this.query(u,"itemStyle.emphasis.color"),m=this.query(u,"itemStyle.emphasis.color0");for(var k=0,v=V.length;v>k;k++)U=V[k],g=p.data[U[6]],u=g,y=U[3]a;a++)n[a]=e[Math.floor(i/t*a)];return n},_getCandle:function(e,t,i,a,r,s,l,h,d,c,m,p,u,g,V){var U=this.series,y=U[e],f=y.data[t],_=[f,y],b={zlevel:y.zlevel,z:y.z,clickable:this.deepQuery(_,"clickable"),hoverable:this.deepQuery(_,"hoverable"),style:{x:a,y:[s,l,h,d],width:r,color:c,strokeColor:p,lineWidth:m,brushType:"both"},highlightStyle:{color:u,strokeColor:V,lineWidth:g},_seriesIndex:e};return b=this.addLabel(b,y,f,i),o.pack(b,y,e,f,t,i),b=new n(b)},getMarkCoord:function(e,t){var i=this.series[e],n=this.component.xAxis.getAxis(i.xAxisIndex),a=this.component.yAxis.getAxis(i.yAxisIndex);return["string"!=typeof t.xAxis&&n.getCoordByIndex?n.getCoordByIndex(t.xAxis||0):n.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&a.getCoordByIndex?a.getCoordByIndex(t.yAxis||0):a.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e,t){function i(){u--,0===u&&t&&t()}for(var n=this.series,a={},r=0,s=e.length;s>r;r++)a[e[r][0]]=e[r];for(var l,h,d,c,m,p,u=0,r=0,s=this.shapeList.length;s>r;r++)if(m=this.shapeList[r]._seriesIndex,a[m]&&!a[m][3]&&"candle"===this.shapeList[r].type){if(p=o.get(this.shapeList[r],"dataIndex"),c=n[m],a[m][2]&&p===c.data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!a[m][2]&&0===p){this.zr.delShape(this.shapeList[r].id);continue}h=this.component.xAxis.getAxis(c.xAxisIndex||0).getGap(),l=a[m][2]?h:-h,d=0,u++,this.zr.animate(this.shapeList[r].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[l,d]}).done(i).start()}u||t&&t()}},r.inherits(t,i),e("../chart").define("k",t),t}); -------------------------------------------------------------------------------- /static/js/echarts2/chart/line.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/line",["require","./base","zrender/shape/Polyline","../util/shape/Icon","../util/shape/HalfSmoothPolygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}function i(e,t,i){var n=t.x,a=t.y,r=t.width,s=t.height,l=s/2;t.symbol.match("empty")&&(e.fillStyle="#fff"),t.brushType="both";var h=t.symbol.replace("empty","").toLowerCase();h.match("star")?(l=h.replace("star","")-0||5,a-=1,h="star"):("rectangle"===h||"arrow"===h)&&(n+=(r-s)/2,r=s);var d="";if(h.match("image")&&(d=h.replace(new RegExp("^image:\\/\\/"),""),h="image",n+=Math.round((r-s)/2)-1,r=s+=2),h=o.prototype.iconLibrary[h]){var c=t.x,m=t.y;e.moveTo(c,m+l),e.lineTo(c+5,m+l),e.moveTo(c+t.width-5,m+l),e.lineTo(c+t.width,m+l);var p=this;h(e,{x:n+4,y:a+4,width:r-8,height:s-8,n:l,image:d},function(){p.modSelf(),i()})}else e.moveTo(n,a+l),e.lineTo(n+r,a+l)}var n=e("./base"),a=e("zrender/shape/Polyline"),o=e("../util/shape/Icon"),r=e("../util/shape/HalfSmoothPolygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var s=e("../config");s.line={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,dataFilter:"nearest",itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1};var l=e("../util/ecData"),h=e("zrender/tool/util"),d=e("zrender/tool/color");return t.prototype={type:s.CHART_TYPE_LINE,_buildShape:function(){this.finalPLMap={},this._buildPosition()},_buildHorizontal:function(e,t,i,n){for(var a,o,r,s,l,h,d,c,m,p=this.series,u=i[0][0],V=p[u],U=this.component.xAxis.getAxis(V.xAxisIndex||0),g={},f=0,y=t;y>f&&null!=U.getNameByIndex(f);f++){o=U.getCoordByIndex(f);for(var b=0,_=i.length;_>b;b++){a=this.component.yAxis.getAxis(p[i[b][0]].yAxisIndex||0),l=s=d=h=a.getCoord(0);for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],c=V.data[f],m=this.getDataFromOption(c,"-"),g[u]=g[u]||[],n[u]=n[u]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==m?(m>=0?(s-=x>0?a.getCoordSize(m):l-a.getCoord(m),r=s):0>m&&(h+=x>0?a.getCoordSize(m):a.getCoord(m)-d,r=h),g[u].push([o,r,f,U.getNameByIndex(f),o,l]),n[u].min>m&&(n[u].min=m,n[u].minY=r,n[u].minX=o),n[u].max0&&(this.finalPLMap[u]=this.finalPLMap[u]||[],this.finalPLMap[u].push(g[u]),g[u]=[])}s=this.component.grid.getY();for(var v,b=0,_=i.length;_>b;b++)for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],c=V.data[f],m=this.getDataFromOption(c,"-"),"-"==m&&this.deepQuery([c,V,this.option],"calculable")&&(v=this.deepQuery([c,V],"symbolSize"),s+=2*v+5,r=s,this.shapeList.push(this._getCalculableItem(u,f,U.getNameByIndex(f),o,r,"horizontal")))}for(var L in g)g[L].length>0&&(this.finalPLMap[L]=this.finalPLMap[L]||[],this.finalPLMap[L].push(g[L]),g[L]=[]);this._calculMarkMapXY(n,i,"y"),this._buildBorkenLine(e,this.finalPLMap,U,"horizontal")},_buildVertical:function(e,t,i,n){for(var a,o,r,s,l,h,d,c,m,p=this.series,u=i[0][0],V=p[u],U=this.component.yAxis.getAxis(V.yAxisIndex||0),g={},f=0,y=t;y>f&&null!=U.getNameByIndex(f);f++){r=U.getCoordByIndex(f);for(var b=0,_=i.length;_>b;b++){a=this.component.xAxis.getAxis(p[i[b][0]].xAxisIndex||0),l=s=d=h=a.getCoord(0);for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],c=V.data[f],m=this.getDataFromOption(c,"-"),g[u]=g[u]||[],n[u]=n[u]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==m?(m>=0?(s+=x>0?a.getCoordSize(m):a.getCoord(m)-l,o=s):0>m&&(h-=x>0?a.getCoordSize(m):d-a.getCoord(m),o=h),g[u].push([o,r,f,U.getNameByIndex(f),l,r]),n[u].min>m&&(n[u].min=m,n[u].minX=o,n[u].minY=r),n[u].max0&&(this.finalPLMap[u]=this.finalPLMap[u]||[],this.finalPLMap[u].push(g[u]),g[u]=[])}s=this.component.grid.getXend();for(var v,b=0,_=i.length;_>b;b++)for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],c=V.data[f],m=this.getDataFromOption(c,"-"),"-"==m&&this.deepQuery([c,V,this.option],"calculable")&&(v=this.deepQuery([c,V],"symbolSize"),s-=2*v+5,o=s,this.shapeList.push(this._getCalculableItem(u,f,U.getNameByIndex(f),o,r,"vertical")))}for(var L in g)g[L].length>0&&(this.finalPLMap[L]=this.finalPLMap[L]||[],this.finalPLMap[L].push(g[L]),g[L]=[]);this._calculMarkMapXY(n,i,"x"),this._buildBorkenLine(e,this.finalPLMap,U,"vertical")},_buildOther:function(e,t,i,n){for(var a,o=this.series,r={},s=0,l=i.length;l>s;s++)for(var h=0,d=i[s].length;d>h;h++){var c=i[s][h],m=o[c];a=this.component.xAxis.getAxis(m.xAxisIndex||0);var p=this.component.yAxis.getAxis(m.yAxisIndex||0),u=p.getCoord(0);r[c]=r[c]||[],n[c]=n[c]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var V=0,U=m.data.length;U>V;V++){var g=m.data[V],f=this.getDataFromOption(g,"-");if(f instanceof Array){var y=a.getCoord(f[0]),b=p.getCoord(f[1]);r[c].push([y,b,V,f[0],y,u]),n[c].min0>f[0]&&(n[c].min0=f[0],n[c].minY0=b,n[c].minX0=y),n[c].max0f[1]&&(n[c].min1=f[1],n[c].minY1=b,n[c].minX1=y),n[c].max10&&(this.finalPLMap[_]=this.finalPLMap[_]||[],this.finalPLMap[_].push(r[_]),r[_]=[]);this._calculMarkMapXY(n,i,"xy"),this._buildBorkenLine(e,this.finalPLMap,a,"other")},_buildBorkenLine:function(e,t,i,n){for(var o,s="other"==n?"horizontal":n,c=this.series,m=e.length-1;m>=0;m--){var p=e[m],u=c[p],V=t[p];if(u.type===this.type&&null!=V)for(var U=this._getBbox(p,s),g=this._sIndex2ColorMap[p],f=this.query(u,"itemStyle.normal.lineStyle.width"),y=this.query(u,"itemStyle.normal.lineStyle.type"),b=this.query(u,"itemStyle.normal.lineStyle.color"),_=this.getItemStyleColor(this.query(u,"itemStyle.normal.color"),p,-1),x=null!=this.query(u,"itemStyle.normal.areaStyle"),k=this.query(u,"itemStyle.normal.areaStyle.color"),v=0,L=V.length;L>v;v++){var w=V[v],W="other"!=n&&this._isLarge(s,w);if(W)w=this._getLargePointList(s,w,u.dataFilter);else for(var X=0,I=w.length;I>X;X++)o=u.data[w[X][2]],(this.deepQuery([o,u,this.option],"calculable")||this.deepQuery([o,u],"showAllSymbol")||"categoryAxis"===i.type&&i.isMainAxis(w[X][2])&&"none"!=this.deepQuery([o,u],"symbol"))&&this.shapeList.push(this._getSymbol(p,w[X][2],w[X][3],w[X][0],w[X][1],s));var S=new a({zlevel:u.zlevel,z:u.z,style:{miterLimit:f,pointList:w,strokeColor:b||_||g,lineWidth:f,lineType:y,smooth:this._getSmooth(u.smooth),smoothConstraint:U,shadowColor:this.query(u,"itemStyle.normal.lineStyle.shadowColor"),shadowBlur:this.query(u,"itemStyle.normal.lineStyle.shadowBlur"),shadowOffsetX:this.query(u,"itemStyle.normal.lineStyle.shadowOffsetX"),shadowOffsetY:this.query(u,"itemStyle.normal.lineStyle.shadowOffsetY")},hoverable:!1,_main:!0,_seriesIndex:p,_orient:s});if(l.pack(S,c[p],p,0,v,c[p].name),this.shapeList.push(S),x){var K=new r({zlevel:u.zlevel,z:u.z,style:{miterLimit:f,pointList:h.clone(w).concat([[w[w.length-1][4],w[w.length-1][5]],[w[0][4],w[0][5]]]),brushType:"fill",smooth:this._getSmooth(u.smooth),smoothConstraint:U,color:k?k:d.alpha(g,.5)},highlightStyle:{brushType:"fill"},hoverable:!1,_main:!0,_seriesIndex:p,_orient:s});l.pack(K,c[p],p,0,v,c[p].name),this.shapeList.push(K)}}}},_getBbox:function(e,t){var i=this.component.grid.getBbox(),n=this.xMarkMap[e];return null!=n.minX0?[[Math.min(n.minX0,n.maxX0,n.minX1,n.maxX1),Math.min(n.minY0,n.maxY0,n.minY1,n.maxY1)],[Math.max(n.minX0,n.maxX0,n.minX1,n.maxX1),Math.max(n.minY0,n.maxY0,n.minY1,n.maxY1)]]:("horizontal"===t?(i[0][1]=Math.min(n.minY,n.maxY),i[1][1]=Math.max(n.minY,n.maxY)):(i[0][0]=Math.min(n.minX,n.maxX),i[1][0]=Math.max(n.minX,n.maxX)),i)},_isLarge:function(e,t){return t.length<2?!1:"horizontal"===e?Math.abs(t[0][0]-t[1][0])<.5:Math.abs(t[0][1]-t[1][1])<.5},_getLargePointList:function(e,t,i){var n;n="horizontal"===e?this.component.grid.getWidth():this.component.grid.getHeight();var a=t.length,o=[];if("function"!=typeof i)switch(i){case"min":i=function(e){return Math.max.apply(null,e)};break;case"max":i=function(e){return Math.min.apply(null,e)};break;case"average":i=function(e){for(var t=0,i=0;is;s++){var l=Math.floor(a/n*s),h=Math.min(Math.floor(a/n*(s+1)),a);if(!(l>=h)){for(var d=l;h>d;d++)r[d-l]="horizontal"===e?t[d][1]:t[d][0];r.length=h-l;for(var c=i(r),m=-1,p=1/0,d=l;h>d;d++){var u="horizontal"===e?t[d][1]:t[d][0],V=Math.abs(u-c);p>V&&(m=d,p=V)}var U=t[m].slice();"horizontal"===e?U[1]=c:U[0]=c,o.push(U)}}return o},_getSmooth:function(e){return e?.3:0},_getCalculableItem:function(e,t,i,n,a,o){var r=this.series,l=r[e].calculableHolderColor||this.ecTheme.calculableHolderColor||s.calculableHolderColor,h=this._getSymbol(e,t,i,n,a,o);return h.style.color=l,h.style.strokeColor=l,h.rotation=[0,0],h.hoverable=!1,h.draggable=!1,h.style.text=void 0,h},_getSymbol:function(e,t,i,n,a,o){var r=this.series,s=r[e],l=s.data[t],h=this.getSymbolShape(s,e,l,t,i,n,a,this._sIndex2ShapeMap[e],this._sIndex2ColorMap[e],"#fff","vertical"===o?"horizontal":"vertical");return h.zlevel=s.zlevel,h.z=s.z+1,this.deepQuery([l,s,this.option],"calculable")&&(this.setCalculable(h),h.draggable=!0),h},getMarkCoord:function(e,t){var i=this.series[e],n=this.xMarkMap[e],a=this.component.xAxis.getAxis(i.xAxisIndex),o=this.component.yAxis.getAxis(i.yAxisIndex);if(t.type&&("max"===t.type||"min"===t.type||"average"===t.type)){var r=null!=t.valueIndex?t.valueIndex:null!=n.maxX0?"1":"";return[n[t.type+"X"+r],n[t.type+"Y"+r],n[t.type+"Line"+r],n[t.type+r]]}return["string"!=typeof t.xAxis&&a.getCoordByIndex?a.getCoordByIndex(t.xAxis||0):a.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&o.getCoordByIndex?o.getCoordByIndex(t.yAxis||0):o.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ontooltipHover:function(e,t){for(var i,n,a=e.seriesIndex,o=e.dataIndex,r=a.length;r--;)if(i=this.finalPLMap[a[r]])for(var s=0,l=i.length;l>s;s++){n=i[s];for(var h=0,d=n.length;d>h;h++)o===n[h][2]&&t.push(this._getSymbol(a[r],n[h][2],n[h][3],n[h][0],n[h][1],"horizontal"))}},addDataAnimation:function(e,t){function i(){V--,0===V&&t&&t()}function n(e){e.style.controlPointList=null}for(var a=this.series,o={},r=0,s=e.length;s>r;r++)o[e[r][0]]=e[r];for(var l,h,d,c,m,p,u,V=0,r=this.shapeList.length-1;r>=0;r--)if(m=this.shapeList[r]._seriesIndex,o[m]&&!o[m][3]){if(this.shapeList[r]._main&&this.shapeList[r].style.pointList.length>1){if(p=this.shapeList[r].style.pointList,h=Math.abs(p[0][0]-p[1][0]),c=Math.abs(p[0][1]-p[1][1]),u="horizontal"===this.shapeList[r]._orient,o[m][2]){if("half-smooth-polygon"===this.shapeList[r].type){var U=p.length;this.shapeList[r].style.pointList[U-3]=p[U-2],this.shapeList[r].style.pointList[U-3][u?0:1]=p[U-4][u?0:1],this.shapeList[r].style.pointList[U-2]=p[U-1]}this.shapeList[r].style.pointList.pop(),u?(l=h,d=0):(l=0,d=-c)}else{if(this.shapeList[r].style.pointList.shift(),"half-smooth-polygon"===this.shapeList[r].type){var g=this.shapeList[r].style.pointList.pop();u?g[0]=p[0][0]:g[1]=p[0][1],this.shapeList[r].style.pointList.push(g)}u?(l=-h,d=0):(l=0,d=c)}this.shapeList[r].style.controlPointList=null,this.zr.modShape(this.shapeList[r])}else{if(o[m][2]&&this.shapeList[r]._dataIndex===a[m].data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!o[m][2]&&0===this.shapeList[r]._dataIndex){this.zr.delShape(this.shapeList[r].id);continue}}this.shapeList[r].position=[0,0],V++,this.zr.animate(this.shapeList[r].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[l,d]}).during(n).done(i).start()}V||t&&t()}},o.prototype.iconLibrary.legendLineIcon=i,h.inherits(t,n),e("../chart").define("line",t),t}),define("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("zrender/shape/util/smoothBezier"),a=e("zrender/tool/util");return t.prototype={type:"half-smooth-polygon",buildPath:function(t,i){var a=i.pointList;if(!(a.length<2))if(i.smooth){var o=n(a.slice(0,-2),i.smooth,!1,i.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var r,s,l,h=a.length,d=0;h-3>d;d++)r=o[2*d],s=o[2*d+1],l=a[d+1],t.bezierCurveTo(r[0],r[1],s[0],s[1],l[0],l[1]);t.lineTo(a[h-2][0],a[h-2][1]),t.lineTo(a[h-1][0],a[h-1][1]),t.lineTo(a[0][0],a[0][1])}else e("zrender/shape/Polygon").prototype.buildPath(t,i)}},a.inherits(t,i),t}); -------------------------------------------------------------------------------- /static/js/echarts2/chart/pie.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/pie",["require","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/Polyline","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o);var r=this;r.shapeHandler.onmouseover=function(e){var t=e.target,i=h.get(t,"seriesIndex"),n=h.get(t,"dataIndex"),a=h.get(t,"special"),o=[t.style.x,t.style.y],s=t.style.startAngle,l=t.style.endAngle,d=((l+s)/2+360)%360,c=t.highlightStyle.color,m=r.getLabel(i,n,a,o,d,c,!0);m&&r.zr.addHoverShape(m);var p=r.getLabelLine(i,n,o,t.style.r0,t.style.r,d,c,!0);p&&r.zr.addHoverShape(p)},this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Ring"),o=e("zrender/shape/Circle"),r=e("zrender/shape/Sector"),s=e("zrender/shape/Polyline"),l=e("../config");l.pie={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}};var h=e("../util/ecData"),d=e("zrender/tool/util"),c=e("zrender/tool/math"),m=e("zrender/tool/color");return t.prototype={type:l.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var i,n,r;this._selectedMode=!1;for(var s,d=0,c=e.length;c>d;d++)if(e[d].type===l.CHART_TYPE_PIE){if(e[d]=this.reformOption(e[d]),this.legendHoverLink=e[d].legendHoverLink||this.legendHoverLink,s=e[d].name||"",this.selectedMap[s]=t?t.isSelected(s):!0,!this.selectedMap[s])continue;i=this.parseCenter(this.zr,e[d].center),n=this.parseRadius(this.zr,e[d].radius),this._selectedMode=this._selectedMode||e[d].selectedMode,this._selected[d]=[],this.deepQuery([e[d],this.option],"calculable")&&(r={zlevel:e[d].zlevel,z:e[d].z,hoverable:!1,style:{x:i[0],y:i[1],r0:n[0]<=10?0:n[0]-10,r:n[1]+10,brushType:"stroke",lineWidth:1,strokeColor:e[d].calculableHolderColor||this.ecTheme.calculableHolderColor||l.calculableHolderColor}},h.pack(r,e[d],d,void 0,-1),this.setCalculable(r),r=n[0]<=10?new o(r):new a(r),this.shapeList.push(r)),this._buildSinglePie(d),this.buildMark(d)}this.addShapeList()},_buildSinglePie:function(e){for(var t,i=this.series,n=i[e],a=n.data,o=this.component.legend,r=0,s=0,l=0,h=Number.NEGATIVE_INFINITY,d=[],c=0,m=a.length;m>c;c++)t=a[c].name,this.selectedMap[t]=o?o.isSelected(t):!0,this.selectedMap[t]&&!isNaN(a[c].value)&&(0!==+a[c].value?r++:s++,l+=+a[c].value,h=Math.max(h,+a[c].value));if(0!==l){for(var p,u,g,V,U,y,f=100,_=n.clockWise,b=(n.startAngle.toFixed(2)-0+360)%360,x=n.minAngle||.01,k=360-x*r-.01*s,v=n.roseType,c=0,m=a.length;m>c;c++)if(t=a[c].name,this.selectedMap[t]&&!isNaN(a[c].value)){if(u=o?o.getColor(t):this.zr.getColor(c),f=a[c].value/l,p="area"!=v?_?b-f*k-(0!==f?x:.01):f*k+b+(0!==f?x:.01):_?b-360/m:360/m+b,p=p.toFixed(2)-0,f=(100*f).toFixed(2),g=this.parseCenter(this.zr,n.center),V=this.parseRadius(this.zr,n.radius),U=+V[0],y=+V[1],"radius"===v?y=a[c].value/h*(y-U)*.8+.2*(y-U)+U:"area"===v&&(y=Math.sqrt(a[c].value/h)*(y-U)+U),_){var L;L=b,b=p,p=L}this._buildItem(d,e,c,f,a[c].selected,g,U,y,b,p,u),_||(b=p)}this._autoLabelLayout(d,g,y);for(var c=0,m=d.length;m>c;c++)this.shapeList.push(d[c]);d=null}},_buildItem:function(e,t,i,n,a,o,r,s,l,d,c){var m=this.series,p=((d+l)/2+360)%360,u=this.getSector(t,i,n,a,o,r,s,l,d,c);h.pack(u,m[t],t,m[t].data[i],i,m[t].data[i].name,n),e.push(u);var g=this.getLabel(t,i,n,o,p,c,!1),V=this.getLabelLine(t,i,o,r,s,p,c,!1);V&&(h.pack(V,m[t],t,m[t].data[i],i,m[t].data[i].name,n),e.push(V)),g&&(h.pack(g,m[t],t,m[t].data[i],i,m[t].data[i].name,n),g._labelLine=V,e.push(g))},getSector:function(e,t,i,n,a,o,s,l,h,d){var p=this.series,u=p[e],g=u.data[t],V=[g,u],U=this.deepMerge(V,"itemStyle.normal")||{},y=this.deepMerge(V,"itemStyle.emphasis")||{},f=this.getItemStyleColor(U.color,e,t,g)||d,_=this.getItemStyleColor(y.color,e,t,g)||("string"==typeof f?m.lift(f,-.2):f),b={zlevel:u.zlevel,z:u.z,clickable:this.deepQuery(V,"clickable"),style:{x:a[0],y:a[1],r0:o,r:s,startAngle:l,endAngle:h,brushType:"both",color:f,lineWidth:U.borderWidth,strokeColor:U.borderColor,lineJoin:"round"},highlightStyle:{color:_,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(n){var x=((b.style.startAngle+b.style.endAngle)/2).toFixed(2)-0;b.style._hasSelected=!0,b.style._x=b.style.x,b.style._y=b.style.y;var k=this.query(u,"selectedOffset");b.style.x+=c.cos(x,!0)*k,b.style.y-=c.sin(x,!0)*k,this._selected[e][t]=!0}else this._selected[e][t]=!1;return this._selectedMode&&(b.onclick=this.shapeHandler.onclick),this.deepQuery([g,u,this.option],"calculable")&&(this.setCalculable(b),b.draggable=!0),(this._needLabel(u,g,!0)||this._needLabelLine(u,g,!0))&&(b.onmouseover=this.shapeHandler.onmouseover),b=new r(b)},getLabel:function(e,t,i,a,o,r,s){var l=this.series,h=l[e],m=h.data[t];if(this._needLabel(h,m,s)){var p,u,g,V=s?"emphasis":"normal",U=d.merge(d.clone(m.itemStyle)||{},h.itemStyle),y=U[V].label,f=y.textStyle||{},_=a[0],b=a[1],x=this.parseRadius(this.zr,h.radius),k="middle";y.position=y.position||U.normal.label.position,"center"===y.position?(p=_,u=b,g="center"):"inner"===y.position||"inside"===y.position?(x=(x[0]+x[1])*(y.distance||.5),p=Math.round(_+x*c.cos(o,!0)),u=Math.round(b-x*c.sin(o,!0)),r="#fff",g="center"):(x=x[1]- -U[V].labelLine.length,p=Math.round(_+x*c.cos(o,!0)),u=Math.round(b-x*c.sin(o,!0)),g=o>=90&&270>=o?"right":"left"),"center"!=y.position&&"inner"!=y.position&&"inside"!=y.position&&(p+="left"===g?20:-20),m.__labelX=p-("left"===g?5:-5),m.__labelY=u;var v=new n({zlevel:h.zlevel,z:h.z+1,hoverable:!1,style:{x:p,y:u,color:f.color||r,text:this.getLabelText(e,t,i,V),textAlign:f.align||g,textBaseline:f.baseline||k,textFont:this.getFont(f)},highlightStyle:{brushType:"fill"}});return v._radius=x,v._labelPosition=y.position||"outer",v._rect=v.getRect(v.style),v._seriesIndex=e,v._dataIndex=t,v}},getLabelText:function(e,t,i,n){var a=this.series,o=a[e],r=o.data[t],s=this.deepQuery([r,o],"itemStyle."+n+".label.formatter");return s?"function"==typeof s?s.call(this.myChart,{seriesIndex:e,seriesName:o.name||"",series:o,dataIndex:t,data:r,name:r.name,value:r.value,percent:i}):"string"==typeof s?(s=s.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),s=s.replace("{a0}",o.name).replace("{b0}",r.name).replace("{c0}",r.value).replace("{d0}",i)):void 0:r.name},getLabelLine:function(e,t,i,n,a,o,r,l){var h=this.series,m=h[e],p=m.data[t];if(this._needLabelLine(m,p,l)){var u=l?"emphasis":"normal",g=d.merge(d.clone(p.itemStyle)||{},m.itemStyle),V=g[u].labelLine,U=V.lineStyle||{},y=i[0],f=i[1],_=a,b=this.parseRadius(this.zr,m.radius)[1]- -V.length,x=c.cos(o,!0),k=c.sin(o,!0);return new s({zlevel:m.zlevel,z:m.z+1,hoverable:!1,style:{pointList:[[y+_*x,f-_*k],[y+b*x,f-b*k],[p.__labelX,p.__labelY]],strokeColor:U.color||r,lineType:U.type,lineWidth:U.width},_seriesIndex:e,_dataIndex:t})}},_needLabel:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".labelLine.show")},_autoLabelLayout:function(e,t,i){for(var n=[],a=[],o=0,r=e.length;r>o;o++)("outer"===e[o]._labelPosition||"outside"===e[o]._labelPosition)&&(e[o]._rect._y=e[o]._rect.y,e[o]._rect.xa;a++)if(e[a]._rect.y+=n,e[a].style.y+=n,e[a]._labelLine&&(e[a]._labelLine.style.pointList[1][1]+=n,e[a]._labelLine.style.pointList[2][1]+=n),a>t&&i>a+1&&e[a+1]._rect.y>e[a]._rect.y+e[a]._rect.height)return void o(a,n/2);o(i-1,n/2)}function o(t,i){for(var n=t;n>=0&&(e[n]._rect.y-=i,e[n].style.y-=i,e[n]._labelLine&&(e[n]._labelLine.style.pointList[1][1]-=i,e[n]._labelLine.style.pointList[2][1]-=i),!(n>0&&e[n]._rect.y>e[n-1]._rect.y+e[n-1]._rect.height));n--);}function r(e,t,i,n,a){for(var o,r,s,l=i[0],h=i[1],d=a>0?t?Number.MAX_VALUE:0:t?Number.MAX_VALUE:0,c=0,m=e.length;m>c;c++)r=Math.abs(e[c]._rect.y-h),s=e[c]._radius-n,o=n+s>r?Math.sqrt((n+s+20)*(n+s+20)-Math.pow(e[c]._rect.y-h,2)):Math.abs(e[c]._rect.x+(a>0?0:e[c]._rect.width)-l),t&&o>=d&&(o=d-10),!t&&d>=o&&(o=d+10),e[c]._rect.x=e[c].style.x=l+o*a,e[c]._labelLine&&(e[c]._labelLine.style.pointList[2][0]=l+(o-5)*a,e[c]._labelLine.style.pointList[1][0]=l+(o-20)*a),d=o}e.sort(function(e,t){return e._rect.y-t._rect.y});for(var s,l=0,h=e.length,d=[],c=[],m=0;h>m;m++)s=e[m]._rect.y-l,0>s&&a(m,h,-s,n),l=e[m]._rect.y+e[m]._rect.height;this.zr.getHeight()-l<0&&o(h-1,l-this.zr.getHeight());for(var m=0;h>m;m++)e[m]._rect.y>=t[1]?c.push(e[m]):d.push(e[m]);r(c,!0,t,i,n),r(d,!1,t,i,n)},reformOption:function(e){var t=d.merge;return e=t(t(e||{},d.clone(this.ecTheme.pie||{})),d.clone(l.pie)),e.itemStyle.normal.label.textStyle=this.getTextStyle(e.itemStyle.normal.label.textStyle),e.itemStyle.emphasis.label.textStyle=this.getTextStyle(e.itemStyle.emphasis.label.textStyle),this.z=e.z,this.zlevel=e.zlevel,e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e,t){function i(){s--,0===s&&t&&t()}for(var n=this.series,a={},o=0,r=e.length;r>o;o++)a[e[o][0]]=e[o];var s=0,h={},d={},c={},m=this.shapeList;this.shapeList=[];for(var p,u,g,V={},o=0,r=e.length;r>o;o++)p=e[o][0],u=e[o][2],g=e[o][3],n[p]&&n[p].type===l.CHART_TYPE_PIE&&(u?(g||(h[p+"_"+n[p].data.length]="delete"),V[p]=1):g?V[p]=0:(h[p+"_-1"]="delete",V[p]=-1),this._buildSinglePie(p));for(var U,y,o=0,r=this.shapeList.length;r>o;o++)switch(p=this.shapeList[o]._seriesIndex,U=this.shapeList[o]._dataIndex,y=p+"_"+U,this.shapeList[o].type){case"sector":h[y]=this.shapeList[o];break;case"text":d[y]=this.shapeList[o];break;case"polyline":c[y]=this.shapeList[o]}this.shapeList=[];for(var f,o=0,r=m.length;r>o;o++)if(p=m[o]._seriesIndex,a[p]){if(U=m[o]._dataIndex+V[p],y=p+"_"+U,f=h[y],!f)continue;if("sector"===m[o].type)"delete"!=f?(s++,this.zr.animate(m[o].id,"style").when(400,{startAngle:f.style.startAngle,endAngle:f.style.endAngle}).done(i).start()):(s++,this.zr.animate(m[o].id,"style").when(400,V[p]<0?{startAngle:m[o].style.startAngle}:{endAngle:m[o].style.endAngle}).done(i).start());else if("text"===m[o].type||"polyline"===m[o].type)if("delete"===f)this.zr.delShape(m[o].id);else switch(m[o].type){case"text":s++,f=d[y],this.zr.animate(m[o].id,"style").when(400,{x:f.style.x,y:f.style.y}).done(i).start();break;case"polyline":s++,f=c[y],this.zr.animate(m[o].id,"style").when(400,{pointList:f.style.pointList}).done(i).start()}}this.shapeList=m,s||t&&t()},onclick:function(e){var t=this.series;if(this.isClick&&e.target){this.isClick=!1;for(var i,n=e.target,a=n.style,o=h.get(n,"seriesIndex"),r=h.get(n,"dataIndex"),s=0,d=this.shapeList.length;d>s;s++)if(this.shapeList[s].id===n.id){if(o=h.get(n,"seriesIndex"),r=h.get(n,"dataIndex"),a._hasSelected)n.style.x=n.style._x,n.style.y=n.style._y,n.style._hasSelected=!1,this._selected[o][r]=!1;else{var m=((a.startAngle+a.endAngle)/2).toFixed(2)-0;n.style._hasSelected=!0,this._selected[o][r]=!0,n.style._x=n.style.x,n.style._y=n.style.y,i=this.query(t[o],"selectedOffset"),n.style.x+=c.cos(m,!0)*i,n.style.y-=c.sin(m,!0)*i}this.zr.modShape(n.id)}else this.shapeList[s].style._hasSelected&&"single"===this._selectedMode&&(o=h.get(this.shapeList[s],"seriesIndex"),r=h.get(this.shapeList[s],"dataIndex"),this.shapeList[s].style.x=this.shapeList[s].style._x,this.shapeList[s].style.y=this.shapeList[s].style._y,this.shapeList[s].style._hasSelected=!1,this._selected[o][r]=!1,this.zr.modShape(this.shapeList[s].id));this.messageCenter.dispatch(l.EVENT.PIE_SELECTED,e.event,{selected:this._selected,target:h.get(n,"name")},this.myChart),this.zr.refreshNextFrame()}}},d.inherits(t,i),e("../chart").define("pie",t),t}); -------------------------------------------------------------------------------- /static/js/echarts2/chart/radar.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/radar",["require","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Polygon");e("../component/polar");var a=e("../config");a.radar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;for(var e,t=this.series,i=this.component.legend,n=0,o=t.length;o>n;n++)t[n].type===a.CHART_TYPE_RADAR&&(this.serie=this.reformOption(t[n]),this.legendHoverLink=t[n].legendHoverLink||this.legendHoverLink,e=this.serie.name||"",this.selectedMap[e]=i?i.isSelected(e):!0,this.selectedMap[e]&&(this._queryTarget=[this.serie,this.option],this.deepQuery(this._queryTarget,"calculable")&&this._addDropBox(n),this._buildSingleRadar(n),this.buildMark(n)));this.addShapeList()},_buildSingleRadar:function(e){for(var t,i,n,a,o=this.component.legend,r=this.serie.data,s=this.deepQuery(this._queryTarget,"calculable"),l=0;lr;r++)n=this.getDataFromOption(t.value[r]),i="-"!=n?o.getVector(e,r,n):!1,i&&a.push(i);return a},_addSymbol:function(e,t,i,n,a){for(var r,s=this.series,l=this.component.polar,h=0,d=e.length;d>h;h++)r=this.getSymbolShape(this.deepMerge([s[n].data[i],s[n]]),n,s[n].data[i].value[h],h,l.getIndicatorText(a,h),e[h][0],e[h][1],this._symbol[this._radarDataCounter%this._symbol.length],t,"#fff","vertical"),r.zlevel=this.getZlevelBase(),r.z=this.getZBase()+1,o.set(r,"data",s[n].data[i]),o.set(r,"value",s[n].data[i].value),o.set(r,"dataIndex",i),o.set(r,"special",h),this.shapeList.push(r)},_addDataShape:function(e,t,i,a,r,l){var h=this.series,d=[i,this.serie],c=this.getItemStyleColor(this.deepQuery(d,"itemStyle.normal.color"),a,r,i),p=this.deepQuery(d,"itemStyle.normal.lineStyle.width"),m=this.deepQuery(d,"itemStyle.normal.lineStyle.type"),u=this.deepQuery(d,"itemStyle.normal.areaStyle.color"),g=this.deepQuery(d,"itemStyle.normal.areaStyle"),V={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:g?"both":"stroke",color:u||c||("string"==typeof t?s.alpha(t,.5):t),strokeColor:c||t,lineWidth:p,lineType:m},highlightStyle:{brushType:this.deepQuery(d,"itemStyle.emphasis.areaStyle")||g?"both":"stroke",color:this.deepQuery(d,"itemStyle.emphasis.areaStyle.color")||u||c||("string"==typeof t?s.alpha(t,.5):t),strokeColor:this.getItemStyleColor(this.deepQuery(d,"itemStyle.emphasis.color"),a,r,i)||c||t,lineWidth:this.deepQuery(d,"itemStyle.emphasis.lineStyle.width")||p,lineType:this.deepQuery(d,"itemStyle.emphasis.lineStyle.type")||m}};o.pack(V,h[a],a,i,r,i.name,this.component.polar.getIndicator(h[a].polarIndex)),l&&(V.draggable=!0,this.setCalculable(V)),V=new n(V),this.shapeList.push(V)},_addDropBox:function(e){var t=this.series,i=this.deepQuery(this._queryTarget,"polarIndex");if(!this._dropBoxList[i]){var n=this.component.polar.getDropBox(i);n.zlevel=this.getZlevelBase(),n.z=this.getZBase(),this.setCalculable(n),o.pack(n,t,e,void 0,-1),this.shapeList.push(n),this._dropBoxList[i]=!0}},ondragend:function(e,t){var i=this.series;if(this.isDragend&&e.target){var n=e.target,a=o.get(n,"seriesIndex"),r=o.get(n,"dataIndex");this.component.legend&&this.component.legend.del(i[a].data[r].name),i[a].data.splice(r,1),t.dragOut=!0,t.needRefresh=!0,this.isDragend=!1}},ondrop:function(t,i){var n=this.series;if(this.isDrop&&t.target){var a,r,s=t.target,l=t.dragged,h=o.get(s,"seriesIndex"),d=o.get(s,"dataIndex"),c=this.component.legend;if(-1===d)a={value:o.get(l,"value"),name:o.get(l,"name")},n[h].data.push(a),c&&c.add(a.name,l.style.color||l.style.strokeColor);else{var p=e("../util/accMath");a=n[h].data[d],c&&c.del(a.name),a.name+=this.option.nameConnector+o.get(l,"name"),r=o.get(l,"value");for(var m=0;mh;h++)t=d.polar2cartesian(s,o*Math.PI/180+r*h),l.push({vector:[t[1],-t[0]]})},_getRadius:function(){var e=this.polar[this._index];return this.parsePercent(e.radius,Math.min(this.zr.getWidth(),this.zr.getHeight())/2)},_buildSpiderWeb:function(e){var t=this.polar[e],i=t.__ecIndicator,n=t.splitArea,a=t.splitLine,o=this.getCenter(e),r=t.splitNumber,s=a.lineStyle.color,l=a.lineStyle.width,h=a.show,d=this.deepQuery(this._queryTarget,"axisLine");this._addArea(i,r,o,n,s,l,h),d.show&&this._addLine(i,o,d)},_addAxisLabel:function(t){for(var i,a,o,r,a,s,l,d,c,p,m=e("../util/accMath"),u=this.polar[t],g=this.deepQuery(this._queryTarget,"indicator"),V=u.__ecIndicator,y=this.deepQuery(this._queryTarget,"splitNumber"),U=this.getCenter(t),f=0;f=x;x+=p+1)r=h.merge({},o),l=m.accAdd(s.min,m.accMul(s.step,x)),l="function"==typeof b?b(l):"string"==typeof b?b.replace("{a}","{a0}").replace("{a0}",l):this.numAddCommas(l),r.text=l,r.x=x*a[0]/y+Math.cos(d)*c+U[0],r.y=x*a[1]/y+Math.sin(d)*c+U[1],this.shapeList.push(new n({zlevel:this.getZlevelBase(),z:this.getZBase(),style:r,draggable:!1,hoverable:!1}))}},_buildText:function(e){for(var t,i,a,o,r,s,l,h=this.polar[e],d=h.__ecIndicator,c=this.deepQuery(this._queryTarget,"indicator"),p=this.getCenter(e),m=0,u=0,g=0;g0?"left":Math.round(t[0])<0?"right":"center",null==o.margin?t=this._mapVector(t,p,1.1):(s=o.margin,m=t[0]>0?s:-s,u=t[1]>0?s:-s,m=0===t[0]?0:m,u=0===t[1]?0:u,t=this._mapVector(t,p,1)),i.textAlign=a,i.x=t[0]+m,i.y=t[1]+u,r=o.rotate?[o.rotate/180*Math.PI,t[0],t[1]]:[0,0,0],this.shapeList.push(new n({zlevel:this.getZlevelBase(),z:this.getZBase(),style:i,draggable:!1,hoverable:!1,rotation:r})))},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var t,i,e=e||0,n=this.polar[e],a=this.getCenter(e),o=n.__ecIndicator,r=o.length,s=[],l=n.type;if("polygon"==l){for(var h=0;r>h;h++)t=o[h].vector,s.push(this._mapVector(t,a,1.2));i=this._getShape(s,"fill","rgba(0,0,0,0)","",1)}else"circle"==l&&(i=this._getCircle("",1,1.2,a,"fill","rgba(0,0,0,0)"));return i},_addArea:function(e,t,i,n,a,o,r){for(var s,l,h,d,c=this.deepQuery(this._queryTarget,"type"),p=0;t>p;p++)l=(t-p)/t,r&&("polygon"==c?(d=this._getPointList(e,l,i),s=this._getShape(d,"stroke","",a,o)):"circle"==c&&(s=this._getCircle(a,o,l,i,"stroke")),this.shapeList.push(s)),n.show&&(h=(t-p-1)/t,this._addSplitArea(e,n,l,h,i,p))},_getCircle:function(e,t,i,n,a,o){var s=this._getRadius();return new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:n[0],y:n[1],r:s*i,brushType:a,strokeColor:e,lineWidth:t,color:o},hoverable:!1,draggable:!1})},_getRing:function(e,t,i,n){var a=this._getRadius();return new s({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:n[0],y:n[1],r:t*a,r0:i*a,color:e,brushType:"fill"},hoverable:!1,draggable:!1})},_getPointList:function(e,t,i){for(var n,a=[],o=e.length,r=0;o>r;r++)n=e[r].vector,a.push(this._mapVector(n,i,t));return a},_getShape:function(e,t,i,n,a){return new o({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:t,color:i,strokeColor:n,lineWidth:a},hoverable:!1,draggable:!1})},_addSplitArea:function(e,t,i,n,a,o){var r,s,l,h,d,c=e.length,p=t.areaStyle.color,m=[],c=e.length,u=this.deepQuery(this._queryTarget,"type");if("string"==typeof p&&(p=[p]),s=p.length,r=p[o%s],"polygon"==u)for(var g=0;c>g;g++)m=[],l=e[g].vector,h=e[(g+1)%c].vector,m.push(this._mapVector(l,a,i)),m.push(this._mapVector(l,a,n)),m.push(this._mapVector(h,a,n)),m.push(this._mapVector(h,a,i)),d=this._getShape(m,"fill",r,"",1),this.shapeList.push(d);else"circle"==u&&(d=this._getRing(r,i,n,a),this.shapeList.push(d))},_mapVector:function(e,t,i){return[e[0]*i+t[0],e[1]*i+t[1]]},getCenter:function(e){var e=e||0;return this.parseCenter(this.zr,this.polar[e].center)},_addLine:function(e,t,i){for(var n,a,o=e.length,r=i.lineStyle,s=r.color,l=r.width,h=r.type,d=0;o>d;d++)a=e[d].vector,n=this._getLine(t[0],t[1],a[0]+t[0],a[1]+t[1],s,l,h),this.shapeList.push(n)},_getLine:function(e,t,i,n,o,r,s){return new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:e,yStart:t,xEnd:i,yEnd:n,strokeColor:o,lineWidth:r,lineType:s},hoverable:!1})},_adjustIndicatorValue:function(t){for(var i,n,a,o=this.polar[t],r=this.deepQuery(this._queryTarget,"indicator"),s=r.length,l=o.__ecIndicator,h=this._getSeriesData(t),d=o.boundaryGap,c=o.splitNumber,p=o.scale,m=e("../util/smartSteps"),u=0;s>u;u++){if("number"==typeof r[u].max)i=r[u].max,n=r[u].min||0,a={max:i,min:n};else{var g=this._findValue(h,u,c,d);n=g.min,i=g.max}!p&&n>=0&&i>=0&&(n=0),!p&&0>=n&&0>=i&&(i=0);var V=m(n,i,c,a);l[u].value={min:V.min,max:V.max,step:V.step}}},_getSeriesData:function(e){for(var t,i,n,a=[],o=this.component.legend,r=0;ro||void 0===o)&&(o=e),(r>e||void 0===r)&&(r=e)}var o,r,s;if(e&&0!==e.length){if(1==e.length&&(r=0),1!=e.length)for(var l=0;l0?r=o/i:o/=i),{max:o,min:r}}},getVector:function(e,t,i){e=e||0,t=t||0;var n=this.polar[e].__ecIndicator;if(!(t>=n.length)){var a,o=this.polar[e].__ecIndicator[t],r=this.getCenter(e),s=o.vector,l=o.value.max,h=o.value.min;if("undefined"==typeof i)return r;switch(i){case"min":i=h;break;case"max":i=l;break;case"center":i=(l+h)/2}return a=l!=h?(i-h)/(l-h):.5,this._mapVector(s,r,a)}},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){for(var t,i,n,a,o,r,s,l,h,c=0;ca[0])return{polarIndex:c,valueIndex:Math.floor((h+l/2)/l)%s}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},h.inherits(t,i),e("../component").define("polar",t),t}),define("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function t(e,t){return[e*n.sin(t),e*n.cos(t)]}function i(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var n=e("zrender/tool/math");return{polar2cartesian:t,cartesian2polar:i}}); -------------------------------------------------------------------------------- /static/js/echarts2/chart/tree.js: -------------------------------------------------------------------------------- 1 | define("echarts/chart/tree",["require","./base","../util/shape/Icon","zrender/shape/Image","zrender/shape/Line","zrender/shape/BezierCurve","../layout/Tree","../data/Tree","../config","../util/ecData","zrender/config","zrender/tool/event","zrender/tool/util","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=.618,a=e("../util/shape/Icon"),o=e("zrender/shape/Image"),r=e("zrender/shape/Line"),s=e("zrender/shape/BezierCurve"),l=e("../layout/Tree"),h=e("../data/Tree"),m=e("../config");m.tree={zlevel:1,z:2,calculable:!1,clickable:!0,rootLocation:{},orient:"vertical",symbol:"circle",symbolSize:20,nodePadding:30,layerPadding:100,itemStyle:{normal:{label:{show:!0},lineStyle:{width:1,color:"#777",type:"curve"}},emphasis:{}}};var V=e("../util/ecData"),U=(e("zrender/config"),e("zrender/tool/event"),e("zrender/tool/util"));return t.prototype={type:m.CHART_TYPE_TREE,_buildShape:function(e,t){var i=e.data[0];this.tree=h.fromOptionData(i.name,i.children),this.tree.root.data=i,this._setTreeShape(e),this.tree.traverse(function(i){this._buildItem(i,e,t),i.children.length>0&&this._buildLink(i,e)},this);var n=e.roam===!0||"move"===e.roam,a=e.roam===!0||"scale"===e.roam;this.zr.modLayer(this.getZlevelBase(),{panable:n,zoomable:a}),(this.query("markPoint.effect.show")||this.query("markLine.effect.show"))&&this.zr.modLayer(m.EFFECT_ZLEVEL,{panable:n,zoomable:a}),this.addShapeList()},_buildItem:function(e,t,i){var n=[e.data,t],r=this.deepQuery(n,"symbol"),s=this.deepMerge(n,"itemStyle.normal")||{},l=this.deepMerge(n,"itemStyle.emphasis")||{},h=s.color||this.zr.getColor(),m=l.color||this.zr.getColor(),U=-e.layout.angle||0;e.id===this.tree.root.id&&(U=0);var d="right";Math.abs(U)>=Math.PI/2&&Math.abs(U)<3*Math.PI/2&&(U+=Math.PI,d="left");var p=[U,e.layout.position[0],e.layout.position[1]],c=new a({zlevel:this.getZlevelBase(),z:this.getZBase()+1,rotation:p,clickable:this.deepQuery(n,"clickable"),style:{x:e.layout.position[0]-.5*e.layout.width,y:e.layout.position[1]-.5*e.layout.height,width:e.layout.width,height:e.layout.height,iconType:r,color:h,brushType:"both",lineWidth:s.borderWidth,strokeColor:s.borderColor},highlightStyle:{color:m,lineWidth:l.borderWidth,strokeColor:l.borderColor}});c.style.iconType.match("image")&&(c.style.image=c.style.iconType.replace(new RegExp("^image:\\/\\/"),""),c=new o({rotation:p,style:c.style,highlightStyle:c.highlightStyle,clickable:c.clickable,zlevel:this.getZlevelBase(),z:this.getZBase()})),this.deepQuery(n,"itemStyle.normal.label.show")&&(c.style.text=null==e.data.label?e.id:e.data.label,c.style.textPosition=this.deepQuery(n,"itemStyle.normal.label.position"),"radial"===t.orient&&"inside"!==c.style.textPosition&&(c.style.textPosition=d),c.style.textColor=this.deepQuery(n,"itemStyle.normal.label.textStyle.color"),c.style.textFont=this.getFont(this.deepQuery(n,"itemStyle.normal.label.textStyle")||{})),this.deepQuery(n,"itemStyle.emphasis.label.show")&&(c.highlightStyle.textPosition=this.deepQuery(n,"itemStyle.emphasis.label.position"),c.highlightStyle.textColor=this.deepQuery(n,"itemStyle.emphasis.label.textStyle.color"),c.highlightStyle.textFont=this.getFont(this.deepQuery(n,"itemStyle.emphasis.label.textStyle")||{})),V.pack(c,t,i,e.data,0,e.id),this.shapeList.push(c)},_buildLink:function(e,t){var i=t.itemStyle.normal.lineStyle;if("broken"===i.type)return void this._buildBrokenLine(e,i,t);for(var n=0;nr&&(t=r),r>n&&(n=r)}e.layout.position[0]=e.children.length>0?(t+n)/2:0;var s=this._layerOffsets[e.depth]||0;if(s>e.layout.position[0]){var l=s-e.layout.position[0];this._shiftSubtree(e,l);for(var a=e.depth+1;a=0&&(t.splice(i,1),e.parent=null)},t.prototype.traverse=function(e,t){e.call(t,this);for(var i=0;it&&(t=n.height)}this.height=t+1},t.prototype.getNodeById=function(e){if(this.id===e)return this;for(var t=0;tt.width||e.normal.label.y+U>t.height)&&(h=""):h="",e.emphasis.label.show?(s.x+u>t.width||s.y+y>t.height)&&(p=""):p="";var g={style:{textX:t.x+e.normal.label.x,textY:t.y+e.normal.label.y,text:h,textPosition:"specific",textColor:o.color,textFont:m},highlightStyle:{textX:t.x+e.emphasis.label.x,textY:t.y+e.emphasis.label.y,text:p,textColor:s.color,textPosition:"specific"}};return g},getLabelText:function(e,t,i){return i?"function"==typeof i?i.call(this.myChart,e,t):"string"==typeof i?(i=i.replace("{b}","{b0}").replace("{c}","{c0}"),i=i.replace("{b0}",e).replace("{c0}",t)):void 0:e},_buildChildrenTreemap:function(e,t,i,n){for(var a=i.width*i.height,o=0,r=[],l=0;l ":"")},V),clickable:!0,highlightStyle:p});m.set(u,"seriesIndex",t),m.set(u,"name",a[c]),i+=u.getRect(u.style).width,this.shapeList.push(u)}},__onclick:function(e){var t=e.target;if(t){var i=m.get(t,"seriesIndex"),n=m.get(t,"name"),a=this._treesMap[i],o=a.getNodeById(n);o&&o.children.length&&this._buildTreemap(o,i)}}},U.inherits(t,i),e("../chart").define("treemap",t),t}),define("echarts/layout/TreeMap",["require"],function(){function e(e){({x:e.x,y:e.y,width:e.width,height:e.height});this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height}return e.prototype.run=function(e){var t=[];return this._squarify(e,{x:this.x,y:this.y,width:this.width,height:this.height},t),t},e.prototype._squarify=function(e,t,i){var n="VERTICAL",a=t.width,o=t.height;t.widthl;l++)r[s].y+=r[l].height}var h={};if("VERTICAL"==n){for(var m=0;ml;l++){var h=i*e[l]/o;a.push({width:s,height:h})}return a},e.prototype._isFirstBetter=function(e,t){var i=e[0].height/e[0].width;i=i>1?1/i:i;var n=t[0].height/t[0].width;return n=n>1?1/n:n,Math.abs(i-1)<=Math.abs(n-1)?!0:!1},e}),define("echarts/data/Tree",["require","zrender/tool/util"],function(e){function t(e,t){this.id=e,this.depth=0,this.height=0,this.children=[],this.parent=null,this.data=t||null}function i(e){this.root=new t(e)}var n=e("zrender/tool/util");return t.prototype.add=function(e){var t=this.children;e.parent!==this&&(t.push(e),e.parent=this)},t.prototype.remove=function(e){var t=this.children,i=n.indexOf(t,e);i>=0&&(t.splice(i,1),e.parent=null)},t.prototype.traverse=function(e,t){e.call(t,this);for(var i=0;it&&(t=n.height)}this.height=t+1},t.prototype.getNodeById=function(e){if(this.id===e)return this;for(var t=0;ta[1].value?(t=this.zr.getHeight()/3,i=t*Math.sqrt(a[1].value)/Math.sqrt(a[0].value)):(i=this.zr.getHeight()/3,t=i*Math.sqrt(a[0].value)/Math.sqrt(a[1].value));var o=this.zr.getWidth()/2-t,r=(t+i)/2*Math.sqrt(a[2].value)/Math.sqrt((a[0].value+a[1].value)/2),s=t+i;0!==a[2].value&&(s=this._getCoincideLength(a[0].value,a[1].value,a[2].value,t,i,r,Math.abs(t-i),t+i));var l=o+s,h=this.zr.getHeight()/2;if(this._buildItem(e,0,a[0],o,h,t),this._buildItem(e,1,a[1],l,h,i),0!==a[2].value&&a[2].value!==a[0].value&&a[2].value!==a[1].value){var m=(t*t-i*i)/(2*s)+s/2,V=s/2-(t*t-i*i)/(2*s),U=Math.sqrt(t*t-m*m),d=0,p=0;a[0].value>a[1].value&&o+m>l&&(p=1),a[0].valuel&&(d=1),this._buildCoincideItem(e,2,a[2],o+m,h-U,h+U,t,i,d,p)}},_getCoincideLength:function(e,t,i,n,a,o,r,s){var l=(n*n-a*a)/(2*o)+o/2,h=o/2-(n*n-a*a)/(2*o),m=Math.acos(l/n),V=Math.acos(h/a),U=n*n*Math.PI,d=m*n*n-l*n*Math.sin(m)+V*a*a-h*a*Math.sin(V),p=d/U,c=i/e,u=Math.abs(p/c);return u>.999&&1.001>u?o:.999>=u?(s=o,o=(o+r)/2,this._getCoincideLength(e,t,i,n,a,o,r,s)):(r=o,o=(o+s)/2,this._getCoincideLength(e,t,i,n,a,o,r,s))},_buildItem:function(e,t,i,n,a,o){var r=this.series,l=r[e],h=this.getCircle(e,t,i,n,a,o);if(s.pack(h,l,e,i,t,i.name),this.shapeList.push(h),l.itemStyle.normal.label.show){var m=this.getLabel(e,t,i,n,a,o);s.pack(m,l,e,l.data[t],t,l.data[t].name),this.shapeList.push(m)}},_buildCoincideItem:function(e,t,i,n,a,r,l,h,m,V){var U=this.series,d=U[e],p=[i,d],c=this.deepMerge(p,"itemStyle.normal")||{},u=this.deepMerge(p,"itemStyle.emphasis")||{},y=c.color||this.zr.getColor(t),g=u.color||this.zr.getColor(t),b="M"+n+","+a+"A"+l+","+l+",0,"+m+",1,"+n+","+r+"A"+h+","+h+",0,"+V+",1,"+n+","+a,f={color:y,path:b},k={zlevel:d.zlevel,z:d.z,style:f,highlightStyle:{color:g,lineWidth:u.borderWidth,strokeColor:u.borderColor}};k=new o(k),k.buildPathArray&&(k.style.pathArray=k.buildPathArray(f.path)),s.pack(k,U[e],0,i,t,i.name),this.shapeList.push(k)},getCircle:function(e,t,i,n,o,r){var s=this.series[e],l=[i,s],h=this.deepMerge(l,"itemStyle.normal")||{},m=this.deepMerge(l,"itemStyle.emphasis")||{},V=h.color||this.zr.getColor(t),U=m.color||this.zr.getColor(t),d={zlevel:s.zlevel,z:s.z,clickable:!0,style:{x:n,y:o,r:r,brushType:"fill",opacity:1,color:V},highlightStyle:{color:U,lineWidth:m.borderWidth,strokeColor:m.borderColor}};return this.deepQuery([i,s,this.option],"calculable")&&(this.setCalculable(d),d.draggable=!0),new a(d)},getLabel:function(e,t,i,a,o,r){var s=this.series[e],l=s.itemStyle,h=[i,s],m=this.deepMerge(h,"itemStyle.normal")||{},V="normal",U=l[V].label,d=U.textStyle||{},p=this.getLabelText(t,i,V),c=this.getFont(d),u=m.color||this.zr.getColor(t),y=d.fontSize||12,g={zlevel:s.zlevel,z:s.z,style:{x:a,y:o-r-y,color:d.color||u,text:p,textFont:c,textAlign:"center"}};return new n(g)},getLabelText:function(e,t,i){var n=this.series,a=n[0],o=this.deepQuery([t,a],"itemStyle."+i+".label.formatter");return o?"function"==typeof o?o(a.name,t.name,t.value):"string"==typeof o?(o=o.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),o=o.replace("{a0}",a.name).replace("{b0}",t.name).replace("{c0}",t.value)):void 0:t.name},refresh:function(e){e&&(this.option=e,this.series=e.series),this._buildShape()}},l.inherits(t,i),e("../chart").define("venn",t),t}),define("zrender/shape/Path",["require","./Base","./util/PathProxy","../tool/util"],function(e){var t=e("./Base"),i=e("./util/PathProxy"),n=i.PathSegment,a=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},o=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(a(e)*a(t))},r=function(e,t){return(e[0]*t[1]0&&""===d[0]&&d.shift();for(var p=0;p0&&!isNaN(d[0]);){var c,u,y,g,b,f,k,_,x=null,L=[],W=h,X=m;switch(U){case"l":h+=d.shift(),m+=d.shift(),x="L",L.push(h,m);break;case"L":h=d.shift(),m=d.shift(),L.push(h,m);break;case"m":h+=d.shift(),m+=d.shift(),x="M",L.push(h,m),U="l";break;case"M":h=d.shift(),m=d.shift(),x="M",L.push(h,m),U="L";break;case"h":h+=d.shift(),x="L",L.push(h,m);break;case"H":h=d.shift(),x="L",L.push(h,m);break;case"v":m+=d.shift(),x="L",L.push(h,m);break;case"V":m=d.shift(),x="L",L.push(h,m);break;case"C":L.push(d.shift(),d.shift(),d.shift(),d.shift()),h=d.shift(),m=d.shift(),L.push(h,m);break;case"c":L.push(h+d.shift(),m+d.shift(),h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),x="C",L.push(h,m);break;case"S":c=h,u=m,y=l[l.length-1],"C"===y.command&&(c=h+(h-y.points[2]),u=m+(m-y.points[3])),L.push(c,u,d.shift(),d.shift()),h=d.shift(),m=d.shift(),x="C",L.push(h,m);break;case"s":c=h,u=m,y=l[l.length-1],"C"===y.command&&(c=h+(h-y.points[2]),u=m+(m-y.points[3])),L.push(c,u,h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),x="C",L.push(h,m);break;case"Q":L.push(d.shift(),d.shift()),h=d.shift(),m=d.shift(),L.push(h,m);break;case"q":L.push(h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),x="Q",L.push(h,m);break;case"T":c=h,u=m,y=l[l.length-1],"Q"===y.command&&(c=h+(h-y.points[0]),u=m+(m-y.points[1])),h=d.shift(),m=d.shift(),x="Q",L.push(c,u,h,m);break;case"t":c=h,u=m,y=l[l.length-1],"Q"===y.command&&(c=h+(h-y.points[0]),u=m+(m-y.points[1])),h+=d.shift(),m+=d.shift(),x="Q",L.push(c,u,h,m);break;case"A":g=d.shift(),b=d.shift(),f=d.shift(),k=d.shift(),_=d.shift(),W=h,X=m,h=d.shift(),m=d.shift(),x="A",L=this._convertPoint(W,X,h,m,k,_,g,b,f);break;case"a":g=d.shift(),b=d.shift(),f=d.shift(),k=d.shift(),_=d.shift(),W=h,X=m,h+=d.shift(),m+=d.shift(),x="A",L=this._convertPoint(W,X,h,m,k,_,g,b,f)}for(var v=0,K=L.length;K>v;v+=2)L[v]+=t,L[v+1]+=i;l.push(new n(x||U,L))}("z"===U||"Z"===U)&&l.push(new n("z",[]))}return l},_convertPoint:function(e,t,i,n,a,s,l,h,m){var V=m*(Math.PI/180),U=Math.cos(V)*(e-i)/2+Math.sin(V)*(t-n)/2,d=-1*Math.sin(V)*(e-i)/2+Math.cos(V)*(t-n)/2,p=U*U/(l*l)+d*d/(h*h);p>1&&(l*=Math.sqrt(p),h*=Math.sqrt(p));var c=Math.sqrt((l*l*h*h-l*l*d*d-h*h*U*U)/(l*l*d*d+h*h*U*U));a===s&&(c*=-1),isNaN(c)&&(c=0);var u=c*l*d/h,y=c*-h*U/l,g=(e+i)/2+Math.cos(V)*u-Math.sin(V)*y,b=(t+n)/2+Math.sin(V)*u+Math.cos(V)*y,f=r([1,0],[(U-u)/l,(d-y)/h]),k=[(U-u)/l,(d-y)/h],_=[(-1*U-u)/l,(-1*d-y)/h],x=r(k,_);return o(k,_)<=-1&&(x=Math.PI),o(k,_)>=1&&(x=0),0===s&&x>0&&(x-=2*Math.PI),1===s&&0>x&&(x+=2*Math.PI),[g,b,l,h,f,x,V,s]},buildPath:function(e,t){var i=t.path,n=t.x||0,a=t.y||0;t.pathArray=t.pathArray||this.buildPathArray(i,n,a);for(var o=t.pathArray,r=t.pointList=[],s=[],l=0,h=o.length;h>l;l++){"M"==o[l].command.toUpperCase()&&(s.length>0&&r.push(s),s=[]);for(var m=o[l].points,V=0,U=m.length;U>V;V+=2)s.push([m[V],m[V+1]])}s.length>0&&r.push(s);for(var l=0,h=o.length;h>l;l++){var d=o[l].command,m=o[l].points;switch(d){case"L":e.lineTo(m[0],m[1]);break;case"M":e.moveTo(m[0],m[1]);break;case"C":e.bezierCurveTo(m[0],m[1],m[2],m[3],m[4],m[5]);break;case"Q":e.quadraticCurveTo(m[0],m[1],m[2],m[3]);break;case"A":var p=m[0],c=m[1],u=m[2],y=m[3],g=m[4],b=m[5],f=m[6],k=m[7],_=u>y?u:y,x=u>y?1:u/y,L=u>y?y/u:1;e.translate(p,c),e.rotate(f),e.scale(x,L),e.arc(0,0,_,g,g+b,1-k),e.scale(1/x,1/L),e.rotate(-f),e.translate(-p,-c);break;case"z":e.closePath()}}},getRect:function(e){if(e.__rect)return e.__rect;var t;t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0;for(var i=Number.MAX_VALUE,n=Number.MIN_VALUE,a=Number.MAX_VALUE,o=Number.MIN_VALUE,r=e.x||0,s=e.y||0,l=e.pathArray||this.buildPathArray(e.path),h=0;hn&&(n=m[V])):(m[V]+so&&(o=m[V]));var U;return U=i===Number.MAX_VALUE||n===Number.MIN_VALUE||a===Number.MAX_VALUE||o===Number.MIN_VALUE?{x:0,y:0,width:0,height:0}:{x:Math.round(i-t/2),y:Math.round(a-t/2),width:n-i+t,height:o-a+t},e.__rect=U,U}},e("../tool/util").inherits(s,t),s}); -------------------------------------------------------------------------------- /static/js/svgcheckbx.js: -------------------------------------------------------------------------------- 1 | if( document.createElement('svg').getAttributeNS ) { 2 | 3 | var checkbxsCross = Array.prototype.slice.call( document.querySelectorAll( 'div.ac-cross input[type="checkbox"]' ) ), 4 | radiobxsFill = Array.prototype.slice.call( document.querySelectorAll( 'div.ac-fill input[type="radio"]' ) ), 5 | checkbxsCheckmark = Array.prototype.slice.call( document.querySelectorAll( 'div.ac-checkmark input[type="checkbox"]' ) ), 6 | radiobxsCircle = Array.prototype.slice.call( document.querySelectorAll( 'div.ac-circle input[type="radio"]' ) ), 7 | checkbxsBoxfill = Array.prototype.slice.call( document.querySelectorAll( 'div.ac-boxfill input[type="checkbox"]' ) ), 8 | radiobxsSwirl = Array.prototype.slice.call( document.querySelectorAll( 'div.ac-swirl input[type="radio"]' ) ), 9 | checkbxsDiagonal = Array.prototype.slice.call( document.querySelectorAll( 'div.ac-diagonal input[type="checkbox"]' ) ), 10 | checkbxsList = Array.prototype.slice.call( document.querySelectorAll( 'div.ac-list input[type="checkbox"]' ) ), 11 | pathDefs = { 12 | cross : ['M 10 10 L 90 90','M 90 10 L 10 90'], 13 | fill : ['M15.833,24.334c2.179-0.443,4.766-3.995,6.545-5.359 c1.76-1.35,4.144-3.732,6.256-4.339c-3.983,3.844-6.504,9.556-10.047,13.827c-2.325,2.802-5.387,6.153-6.068,9.866 c2.081-0.474,4.484-2.502,6.425-3.488c5.708-2.897,11.316-6.804,16.608-10.418c4.812-3.287,11.13-7.53,13.935-12.905 c-0.759,3.059-3.364,6.421-4.943,9.203c-2.728,4.806-6.064,8.417-9.781,12.446c-6.895,7.477-15.107,14.109-20.779,22.608 c3.515-0.784,7.103-2.996,10.263-4.628c6.455-3.335,12.235-8.381,17.684-13.15c5.495-4.81,10.848-9.68,15.866-14.988 c1.905-2.016,4.178-4.42,5.556-6.838c0.051,1.256-0.604,2.542-1.03,3.672c-1.424,3.767-3.011,7.432-4.723,11.076 c-2.772,5.904-6.312,11.342-9.921,16.763c-3.167,4.757-7.082,8.94-10.854,13.205c-2.456,2.777-4.876,5.977-7.627,8.448 c9.341-7.52,18.965-14.629,27.924-22.656c4.995-4.474,9.557-9.075,13.586-14.446c1.443-1.924,2.427-4.939,3.74-6.56 c-0.446,3.322-2.183,6.878-3.312,10.032c-2.261,6.309-5.352,12.53-8.418,18.482c-3.46,6.719-8.134,12.698-11.954,19.203 c-0.725,1.234-1.833,2.451-2.265,3.77c2.347-0.48,4.812-3.199,7.028-4.286c4.144-2.033,7.787-4.938,11.184-8.072 c3.142-2.9,5.344-6.758,7.925-10.141c1.483-1.944,3.306-4.056,4.341-6.283c0.041,1.102-0.507,2.345-0.876,3.388 c-1.456,4.114-3.369,8.184-5.059,12.212c-1.503,3.583-3.421,7.001-5.277,10.411c-0.967,1.775-2.471,3.528-3.287,5.298 c2.49-1.163,5.229-3.906,7.212-5.828c2.094-2.028,5.027-4.716,6.33-7.335c-0.256,1.47-2.07,3.577-3.02,4.809'], 14 | checkmark : ['M16.667,62.167c3.109,5.55,7.217,10.591,10.926,15.75 c2.614,3.636,5.149,7.519,8.161,10.853c-0.046-0.051,1.959,2.414,2.692,2.343c0.895-0.088,6.958-8.511,6.014-7.3 c5.997-7.695,11.68-15.463,16.931-23.696c6.393-10.025,12.235-20.373,18.104-30.707C82.004,24.988,84.802,20.601,87,16'], 15 | circle : ['M34.745,7.183C25.078,12.703,13.516,26.359,8.797,37.13 c-13.652,31.134,9.219,54.785,34.77,55.99c15.826,0.742,31.804-2.607,42.207-17.52c6.641-9.52,12.918-27.789,7.396-39.713 C85.873,20.155,69.828-5.347,41.802,13.379'], 16 | boxfill : ['M6.987,4.774c15.308,2.213,30.731,1.398,46.101,1.398 c9.74,0,19.484,0.084,29.225,0.001c2.152-0.018,4.358-0.626,6.229,1.201c-5.443,1.284-10.857,2.58-16.398,2.524 c-9.586-0.096-18.983,2.331-28.597,2.326c-7.43-0.003-14.988-0.423-22.364,1.041c-4.099,0.811-7.216,3.958-10.759,6.81 c8.981-0.104,17.952,1.972,26.97,1.94c8.365-0.029,16.557-1.168,24.872-1.847c2.436-0.2,24.209-4.854,24.632,2.223 c-14.265,5.396-29.483,0.959-43.871,0.525c-12.163-0.368-24.866,2.739-36.677,6.863c14.93,4.236,30.265,2.061,45.365,2.425 c7.82,0.187,15.486,1.928,23.337,1.903c2.602-0.008,6.644-0.984,9,0.468c-2.584,1.794-8.164,0.984-10.809,1.165 c-13.329,0.899-26.632,2.315-39.939,3.953c-6.761,0.834-13.413,0.95-20.204,0.938c-1.429-0.001-2.938-0.155-4.142,0.436 c5.065,4.68,15.128,2.853,20.742,2.904c11.342,0.104,22.689-0.081,34.035-0.081c9.067,0,20.104-2.412,29.014,0.643 c-4.061,4.239-12.383,3.389-17.056,4.292c-11.054,2.132-21.575,5.041-32.725,5.289c-5.591,0.124-11.278,1.001-16.824,2.088 c-4.515,0.885-9.461,0.823-13.881,2.301c2.302,3.186,7.315,2.59,10.13,2.694c15.753,0.588,31.413-0.231,47.097-2.172 c7.904-0.979,15.06,1.748,22.549,4.877c-12.278,4.992-25.996,4.737-38.58,5.989c-8.467,0.839-16.773,1.041-25.267,0.984 c-4.727-0.031-10.214-0.851-14.782,1.551c12.157,4.923,26.295,2.283,38.739,2.182c7.176-0.06,14.323,1.151,21.326,3.07 c-2.391,2.98-7.512,3.388-10.368,4.143c-8.208,2.165-16.487,3.686-24.71,5.709c-6.854,1.685-13.604,3.616-20.507,4.714 c-1.707,0.273-3.337,0.483-4.923,1.366c2.023,0.749,3.73,0.558,5.95,0.597c9.749,0.165,19.555,0.31,29.304-0.027 c15.334-0.528,30.422-4.721,45.782-4.653'], 17 | swirl : ['M49.346,46.341c-3.79-2.005,3.698-10.294,7.984-8.89 c8.713,2.852,4.352,20.922-4.901,20.269c-4.684-0.33-12.616-7.405-14.38-11.818c-2.375-5.938,7.208-11.688,11.624-13.837 c9.078-4.42,18.403-3.503,22.784,6.651c4.049,9.378,6.206,28.09-1.462,36.276c-7.091,7.567-24.673,2.277-32.357-1.079 c-11.474-5.01-24.54-19.124-21.738-32.758c3.958-19.263,28.856-28.248,46.044-23.244c20.693,6.025,22.012,36.268,16.246,52.826 c-5.267,15.118-17.03,26.26-33.603,21.938c-11.054-2.883-20.984-10.949-28.809-18.908C9.236,66.096,2.704,57.597,6.01,46.371 c3.059-10.385,12.719-20.155,20.892-26.604C40.809,8.788,58.615,1.851,75.058,12.031c9.289,5.749,16.787,16.361,18.284,27.262 c0.643,4.698,0.646,10.775-3.811,13.746'], 18 | diagonal : ['M16.053,91.059c0.435,0,0.739-0.256,0.914-0.768 c3.101-2.85,5.914-6.734,8.655-9.865C41.371,62.438,56.817,44.11,70.826,24.721c3.729-5.16,6.914-10.603,10.475-15.835 c0.389-0.572,0.785-1.131,1.377-1.521'], 19 | list : ['M1.986,8.91c41.704,4.081,83.952,5.822,125.737,2.867 c17.086-1.208,34.157-0.601,51.257-0.778c21.354-0.223,42.706-1.024,64.056-1.33c18.188-0.261,36.436,0.571,54.609,0.571','M3.954,25.923c9.888,0.045,19.725-0.905,29.602-1.432 c16.87-0.897,33.825-0.171,50.658-2.273c14.924-1.866,29.906-1.407,44.874-1.936c19.9-0.705,39.692-0.887,59.586,0.45 c35.896,2.407,71.665-1.062,107.539-1.188'] 20 | }, 21 | animDefs = { 22 | cross : { speed : .2, easing : 'ease-in-out' }, 23 | fill : { speed : .8, easing : 'ease-in-out' }, 24 | checkmark : { speed : .2, easing : 'ease-in-out' }, 25 | circle : { speed : .2, easing : 'ease-in-out' }, 26 | boxfill : { speed : .8, easing : 'ease-in' }, 27 | swirl : { speed : .8, easing : 'ease-in' }, 28 | diagonal : { speed : .2, easing : 'ease-in-out' }, 29 | list : { speed : .3, easing : 'ease-in-out' } 30 | }; 31 | 32 | function createSVGEl( def ) { 33 | var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); 34 | if( def ) { 35 | svg.setAttributeNS( null, 'viewBox', def.viewBox ); 36 | svg.setAttributeNS( null, 'preserveAspectRatio', def.preserveAspectRatio ); 37 | } 38 | else { 39 | svg.setAttributeNS( null, 'viewBox', '0 0 100 100' ); 40 | } 41 | svg.setAttribute( 'xmlns', 'http://www.w3.org/2000/svg' ); 42 | return svg; 43 | } 44 | 45 | function controlCheckbox( el, type, svgDef ) { 46 | var svg = createSVGEl( svgDef ); 47 | el.parentNode.appendChild( svg ); 48 | 49 | el.addEventListener( 'change', function() { 50 | if( el.checked ) { 51 | draw( el, type ); 52 | } 53 | else { 54 | reset( el ); 55 | } 56 | } ); 57 | } 58 | 59 | function controlRadiobox( el, type ) { 60 | var svg = createSVGEl(); 61 | el.parentNode.appendChild( svg ); 62 | el.addEventListener( 'change', function() { 63 | resetRadio( el ); 64 | draw( el, type ); 65 | } ); 66 | } 67 | 68 | checkbxsCross.forEach( function( el, i ) { controlCheckbox( el, 'cross' ); } ); 69 | radiobxsFill.forEach( function( el, i ) { controlRadiobox( el, 'fill' ); } ); 70 | checkbxsCheckmark.forEach( function( el, i ) { controlCheckbox( el, 'checkmark' ); } ); 71 | radiobxsCircle.forEach( function( el, i ) { controlRadiobox( el, 'circle' ); } ); 72 | checkbxsBoxfill.forEach( function( el, i ) { controlCheckbox( el, 'boxfill' ); } ); 73 | radiobxsSwirl.forEach( function( el, i ) { controlRadiobox( el, 'swirl' ); } ); 74 | checkbxsDiagonal.forEach( function( el, i ) { controlCheckbox( el, 'diagonal' ); } ); 75 | checkbxsList.forEach( function( el ) { controlCheckbox( el, 'list', { viewBox : '0 0 300 100', preserveAspectRatio : 'none' } ); } ); 76 | 77 | function draw( el, type ) { 78 | var paths = [], pathDef, 79 | animDef, 80 | svg = el.parentNode.querySelector( 'svg' ); 81 | 82 | switch( type ) { 83 | case 'cross': pathDef = pathDefs.cross; animDef = animDefs.cross; break; 84 | case 'fill': pathDef = pathDefs.fill; animDef = animDefs.fill; break; 85 | case 'checkmark': pathDef = pathDefs.checkmark; animDef = animDefs.checkmark; break; 86 | case 'circle': pathDef = pathDefs.circle; animDef = animDefs.circle; break; 87 | case 'boxfill': pathDef = pathDefs.boxfill; animDef = animDefs.boxfill; break; 88 | case 'swirl': pathDef = pathDefs.swirl; animDef = animDefs.swirl; break; 89 | case 'diagonal': pathDef = pathDefs.diagonal; animDef = animDefs.diagonal; break; 90 | case 'list': pathDef = pathDefs.list; animDef = animDefs.list; break; 91 | }; 92 | 93 | paths.push( document.createElementNS('http://www.w3.org/2000/svg', 'path' ) ); 94 | 95 | if( type === 'cross' || type === 'list' ) { 96 | paths.push( document.createElementNS('http://www.w3.org/2000/svg', 'path' ) ); 97 | } 98 | 99 | for( var i = 0, len = paths.length; i < len; ++i ) { 100 | var path = paths[i]; 101 | svg.appendChild( path ); 102 | 103 | path.setAttributeNS( null, 'd', pathDef[i] ); 104 | 105 | var length = path.getTotalLength(); 106 | // Clear any previous transition 107 | //path.style.transition = path.style.WebkitTransition = path.style.MozTransition = 'none'; 108 | // Set up the starting positions 109 | path.style.strokeDasharray = length + ' ' + length; 110 | if( i === 0 ) { 111 | path.style.strokeDashoffset = Math.floor( length ) - 1; 112 | } 113 | else path.style.strokeDashoffset = length; 114 | // Trigger a layout so styles are calculated & the browser 115 | // picks up the starting position before animating 116 | path.getBoundingClientRect(); 117 | // Define our transition 118 | path.style.transition = path.style.WebkitTransition = path.style.MozTransition = 'stroke-dashoffset ' + animDef.speed + 's ' + animDef.easing + ' ' + i * animDef.speed + 's'; 119 | // Go! 120 | path.style.strokeDashoffset = '0'; 121 | } 122 | } 123 | 124 | function reset( el ) { 125 | Array.prototype.slice.call( el.parentNode.querySelectorAll( 'svg > path' ) ).forEach( function( el ) { el.parentNode.removeChild( el ); } ); 126 | } 127 | 128 | function resetRadio( el ) { 129 | Array.prototype.slice.call( document.querySelectorAll( 'input[type="radio"][name="' + el.getAttribute( 'name' ) + '"]' ) ).forEach( function( el ) { 130 | var path = el.parentNode.querySelector( 'svg > path' ); 131 | if( path ) { 132 | path.parentNode.removeChild( path ); 133 | } 134 | } ); 135 | } 136 | 137 | } -------------------------------------------------------------------------------- /templates/layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 魔镜杯 | 数据产品分析可视化平台 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 147 | {% block style %} {% endblock %} 148 | 161 | 162 | 163 | 164 | 185 |
186 |
187 | {% block body %} {% endblock %} 188 |
189 |
190 | 193 | 194 | 195 | --------------------------------------------------------------------------------