mirror of
https://gitlab.com/JKANetwork/CheckServer.git
synced 2026-06-16 05:06:21 +02:00
Start again
This commit is contained in:
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "echarts",
|
||||
"homepage": "https://github.com/ecomfe/echarts",
|
||||
"version": "3.1.10",
|
||||
"_release": "3.1.10",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "3.1.10",
|
||||
"commit": "5b08696ef103314c827907907432b15146940c45"
|
||||
},
|
||||
"_source": "https://github.com/ecomfe/echarts.git",
|
||||
"_target": "^3.1.7",
|
||||
"_originalSource": "echarts"
|
||||
}
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[**.js]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[**.css]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[**.less]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[**.styl]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[**.html]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[**.tpl]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[**.json]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
如果你想帮助 **ECharts** 的话,请首先阅读指导原则:
|
||||
|
||||
- 如果你希望提 bug:
|
||||
|
||||
- 清楚地描述问题,注意:**别人是否能通过你的描述理解这是什么问题**。
|
||||
- 说明版本(ECharts 版本,浏览器版本,设备、操作系统版本等)
|
||||
- 最好提供完整的ECharts option,截图或线上实例(可以使用JSFiddle/JSBin/Codepen)。
|
||||
|
||||
- 如果你想问问题:
|
||||
|
||||
- 首先是否在这些文档中寻找过问题的答案:[option文档](http://echarts.baidu.com/option.html),[API文档](http://echarts.baidu.com/api.html),[教程](http://echarts.baidu.com/tutorial.html)
|
||||
- 简单的问题,可以在QQ群中求助(群号:465958031)
|
||||
|
||||
- 如何取得能运行的 `ECharts option`
|
||||
|
||||
一个参考方式:
|
||||
在你的程序的
|
||||
```javascript
|
||||
chart.setOption(option);
|
||||
```
|
||||
前加入这句话
|
||||
```javascript
|
||||
console.log(JSON.stringify(option, null, 4));
|
||||
```
|
||||
|
||||
然后打开浏览器的调试工具(如 `Chrome Deverloper Tool`)的 `控制台(console)`,可以得到option输出。
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<!--
|
||||
为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
|
||||
-->
|
||||
#### 问题简述 (One-line summary)
|
||||
|
||||
|
||||
|
||||
#### 版本及环境 (Version & Environment)
|
||||
+ ECharts 版本 (ECharts version):
|
||||
+ 浏览器类型和版本 (Browser version):
|
||||
+ 操作系统类型和版本 (OS Version):
|
||||
|
||||
|
||||
#### 重现步骤 (Steps to reproduce)
|
||||
1.
|
||||
2.
|
||||
|
||||
|
||||
#### 期望结果 (Expected behaviour)
|
||||
|
||||
|
||||
|
||||
#### 可能哪里有问题 (What went wrong)
|
||||
|
||||
|
||||
|
||||
#### ECharts配置项 (ECharts option)
|
||||
<!-- 下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。
|
||||
最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing
|
||||
-->
|
||||
```javascript
|
||||
option = {
|
||||
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
#### 其他信息 (Other comments)
|
||||
<!-- 例如,截图或线上实例 (JSFiddle/JSBin/Codepen) (For example: Screenshot or Online demo) -->
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
#################
|
||||
## Eclipse
|
||||
#################
|
||||
|
||||
*.pydevproject
|
||||
.project
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
.svn
|
||||
local.properties
|
||||
.classpath
|
||||
.settings/
|
||||
.loadpath
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# CDT-specific
|
||||
.cproject
|
||||
|
||||
# PDT-specific
|
||||
.buildpath
|
||||
|
||||
|
||||
#################
|
||||
## Visual Studio
|
||||
#################
|
||||
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.sln.docstates
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Rr]elease/
|
||||
*_i.c
|
||||
*_p.c
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.vspscc
|
||||
.builds
|
||||
*.dotCover
|
||||
|
||||
## TODO: If you have NuGet Package Restore enabled, uncomment this
|
||||
#packages/
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish
|
||||
|
||||
# Others
|
||||
[Bb]in
|
||||
[Oo]bj
|
||||
sql
|
||||
TestResults
|
||||
*.Cache
|
||||
ClientBin
|
||||
stylecop.*
|
||||
~$*
|
||||
*.dbmdl
|
||||
Generated_Code #added for RIA/Silverlight projects
|
||||
|
||||
# Backup & report files from converting an old project file to a newer
|
||||
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
|
||||
|
||||
|
||||
############
|
||||
## Windows
|
||||
############
|
||||
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
|
||||
#############
|
||||
## Python
|
||||
#############
|
||||
|
||||
*.py[co]
|
||||
|
||||
# Packages
|
||||
*.egg
|
||||
*.egg-info
|
||||
# dist
|
||||
eggs
|
||||
parts
|
||||
bin
|
||||
var
|
||||
sdist
|
||||
develop-eggs
|
||||
.installed.cfg
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
.coverage
|
||||
.tox
|
||||
|
||||
#Translations
|
||||
*.mo
|
||||
|
||||
#Mr Developer
|
||||
.mr.developer.cfg
|
||||
|
||||
# Mac crap
|
||||
.DS_Store
|
||||
|
||||
node_modules
|
||||
|
||||
map/tool
|
||||
theme/thumb
|
||||
/lib
|
||||
todo
|
||||
**/*.log
|
||||
Vendored
+71
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"bitwise": false,
|
||||
"camelcase": true,
|
||||
"curly": true,
|
||||
"es3": true,
|
||||
"eqeqeq": false,
|
||||
"forin": false,
|
||||
"immed": true,
|
||||
"latedef": false,
|
||||
"newcap": true,
|
||||
"noarg": false,
|
||||
"noempty": true,
|
||||
"nonew": true,
|
||||
"plusplus": false,
|
||||
"quotmark": "single",
|
||||
"regexp": false,
|
||||
"undef": true,
|
||||
"unused": "vars",
|
||||
"strict": false,
|
||||
"trailing": false,
|
||||
"maxparams": 20,
|
||||
"maxdepth": 6,
|
||||
"maxlen": 200,
|
||||
|
||||
"asi": false,
|
||||
"boss": false,
|
||||
"debug": false,
|
||||
"eqnull": true,
|
||||
"esnext": false,
|
||||
"evil": true,
|
||||
"expr": true,
|
||||
"funcscope": false,
|
||||
"globalstrict": false,
|
||||
"iterator": false,
|
||||
"lastsemic": false,
|
||||
"laxbreak": true,
|
||||
"laxcomma": false,
|
||||
"loopfunc": false,
|
||||
"multistr": false,
|
||||
"onecase": false,
|
||||
"proto": false,
|
||||
"regexdash": false,
|
||||
"scripturl": false,
|
||||
"smarttabs": false,
|
||||
"shadow": true,
|
||||
"sub": true,
|
||||
"supernew": false,
|
||||
"validthis": true,
|
||||
|
||||
"browser": true,
|
||||
"couch": false,
|
||||
"devel": true,
|
||||
"dojo": false,
|
||||
"jquery": true,
|
||||
"mootools": false,
|
||||
"node": false,
|
||||
"nonstandard": false,
|
||||
"prototypejs": false,
|
||||
"rhino": false,
|
||||
"wsh": false,
|
||||
|
||||
"nomen": false,
|
||||
"onevar": false,
|
||||
"passfail": false,
|
||||
"white": false,
|
||||
|
||||
"predef": [
|
||||
"define",
|
||||
"require"
|
||||
]
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
/build
|
||||
/test
|
||||
/map/tool
|
||||
/theme/tool
|
||||
/theme/thumb
|
||||
todo
|
||||
npm-debug.log
|
||||
|
||||
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
Copyright (c) 2013, Baidu Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
Vendored
+48
@@ -0,0 +1,48 @@
|
||||
# ECharts
|
||||
|
||||
<a href="http://echarts.baidu.com">
|
||||
<img style="vertical-align: top;" src="./asset/logo.png?raw=true" alt="logo" height="50px">
|
||||
</a>
|
||||
|
||||
ECharts is a free, powerful charting and visualization library offering an easy way of adding intuitive, interactive, and highly customizable charts to your commercial products. It is written in pure JavaScript and based on <a href="https://github.com/ecomfe/zrender">zrender</a>, which is a whole new lightweight canvas library.
|
||||
|
||||
## Get ECharts
|
||||
|
||||
+ Download on [echarts.baidu.com](http://echarts.baidu.com/download.html)
|
||||
+ `npm install echarts --save`
|
||||
|
||||
## Docs
|
||||
|
||||
+ [Tutorial](http://echarts.baidu.com/tutorial.html)
|
||||
+ [API](http://echarts.baidu.com/api.html)
|
||||
+ [Option Manual](http://echarts.baidu.com/option.html)
|
||||
|
||||
We will release the English doc soon:)
|
||||
|
||||
## License
|
||||
Copyright (c) 2013, Baidu Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
Vendored
BIN
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
Vendored
+160
@@ -0,0 +1,160 @@
|
||||
var glob = require('glob');
|
||||
var fsExtra = require('fs-extra');
|
||||
var esprima = require('esprima');
|
||||
|
||||
function run(cb) {
|
||||
glob('**/*.js', {
|
||||
cwd: __dirname + '/../src/'
|
||||
}, function (err, files) {
|
||||
files.forEach(function (filePath) {
|
||||
var code = parse(fsExtra.readFileSync(
|
||||
__dirname + '/../src/' + filePath, 'utf-8'));
|
||||
code = code.replace(/require\(([\'"])zrender\//g, 'require($1zrender/lib/');
|
||||
fsExtra.outputFileSync(
|
||||
__dirname + '/../lib/' + filePath,
|
||||
code, 'utf-8');
|
||||
});
|
||||
|
||||
cb && cb();
|
||||
});
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
run();
|
||||
}
|
||||
else {
|
||||
module.exports = run;
|
||||
}
|
||||
|
||||
var MAGIC_DEPS = {
|
||||
'exports' : true,
|
||||
'module' : true,
|
||||
'require' : true
|
||||
};
|
||||
|
||||
var SIMPLIFIED_CJS = ['require', 'exports', 'module'];
|
||||
|
||||
// Convert AMD-style JavaScript string into node.js compatible module
|
||||
function parse (raw){
|
||||
var output = '';
|
||||
var ast = esprima.parse(raw, {
|
||||
range: true,
|
||||
raw: true
|
||||
});
|
||||
|
||||
var defines = ast.body.filter(isDefine);
|
||||
|
||||
if ( defines.length > 1 ){
|
||||
throw new Error('Each file can have only a single define call. Found "'+ defines.length +'"');
|
||||
} else if (!defines.length){
|
||||
return raw;
|
||||
}
|
||||
|
||||
var def = defines[0];
|
||||
var args = def.expression['arguments'];
|
||||
var factory = getFactory( args );
|
||||
var useStrict = getUseStrict( factory );
|
||||
|
||||
// do replacements in-place to avoid modifying the code more than needed
|
||||
if (useStrict) {
|
||||
output += useStrict.expression.raw +';\n';
|
||||
}
|
||||
output += raw.substring( 0, def.range[0] ); // anything before define
|
||||
output += getRequires(args, factory); // add requires
|
||||
output += getBody(raw, factory.body, useStrict); // module body
|
||||
|
||||
output += raw.substring( def.range[1], raw.length ); // anything after define
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
function getRequires(args, factory){
|
||||
var requires = [];
|
||||
var deps = getDependenciesNames( args );
|
||||
var params = factory.params.map(function(param, i){
|
||||
return {
|
||||
name : param.name,
|
||||
// simplified cjs doesn't have deps
|
||||
dep : (deps.length)? deps[i] : SIMPLIFIED_CJS[i]
|
||||
};
|
||||
});
|
||||
|
||||
params.forEach(function(param){
|
||||
if ( MAGIC_DEPS[param.dep] && !MAGIC_DEPS[param.name] ) {
|
||||
// if user remaped magic dependency we declare a var
|
||||
requires.push( 'var '+ param.name +' = '+ param.dep +';' );
|
||||
} else if ( param.dep && !MAGIC_DEPS[param.dep] ) {
|
||||
// only do require for params that have a matching dependency also
|
||||
// skip "magic" dependencies
|
||||
requires.push( 'var '+ param.name +' = require(\''+ param.dep +'\');' );
|
||||
}
|
||||
});
|
||||
|
||||
return requires.join('\n');
|
||||
}
|
||||
|
||||
|
||||
function getDependenciesNames(args){
|
||||
var deps = [];
|
||||
var arr = args.filter(function(arg){
|
||||
return arg.type === 'ArrayExpression';
|
||||
})[0];
|
||||
|
||||
if (arr) {
|
||||
deps = arr.elements.map(function(el){
|
||||
return el.value;
|
||||
});
|
||||
}
|
||||
|
||||
return deps;
|
||||
}
|
||||
|
||||
|
||||
function isDefine(node){
|
||||
return node.type === 'ExpressionStatement' &&
|
||||
node.expression.type === 'CallExpression' &&
|
||||
node.expression.callee.type === 'Identifier' &&
|
||||
node.expression.callee.name === 'define';
|
||||
}
|
||||
|
||||
|
||||
function getFactory(args){
|
||||
return args.filter(function(arg){
|
||||
return arg.type === 'FunctionExpression';
|
||||
})[0];
|
||||
}
|
||||
|
||||
|
||||
function getBody(raw, factoryBody, useStrict){
|
||||
var returnStatement = factoryBody.body.filter(function(node){
|
||||
return node.type === 'ReturnStatement';
|
||||
})[0];
|
||||
|
||||
var body = '';
|
||||
var bodyStart = useStrict ? useStrict.expression.range[1] + 1 : factoryBody.range[0] + 1;
|
||||
|
||||
if (returnStatement) {
|
||||
body += raw.substring( bodyStart, returnStatement.range[0] );
|
||||
// "return ".length === 7 so we add "6" to returnStatement start
|
||||
body += 'module.exports ='+ raw.substring( returnStatement.range[0] + 6, factoryBody.range[1] - 1 );
|
||||
} else {
|
||||
// if using exports or module.exports or just a private module we
|
||||
// simply return the factoryBody content
|
||||
body = raw.substring( bodyStart, factoryBody.range[1] - 1 );
|
||||
}
|
||||
|
||||
return body;
|
||||
}
|
||||
|
||||
|
||||
function getUseStrict(factory){
|
||||
return factory.body.body.filter(isUseStrict)[0];
|
||||
}
|
||||
|
||||
|
||||
function isUseStrict(node){
|
||||
return node.type === 'ExpressionStatement' &&
|
||||
node.expression.type === 'Literal' &&
|
||||
node.expression.value === 'use strict';
|
||||
}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
basePath=$(cd `dirname $0`; pwd)
|
||||
cd ${basePath}/../
|
||||
rm -r dist
|
||||
|
||||
npm run prepublish
|
||||
|
||||
./node_modules/.bin/webpack
|
||||
./node_modules/.bin/webpack -p
|
||||
./node_modules/.bin/webpack --config extension/webpack.config.js
|
||||
./node_modules/.bin/webpack --config extension/webpack.config.js -p
|
||||
|
||||
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
var esprima = require('esprima');
|
||||
var escodegen = require('escodegen');
|
||||
var estraverse = require('estraverse');
|
||||
|
||||
var SYNTAX = estraverse.Syntax;
|
||||
|
||||
var STR_MIN_LENGTH = 5;
|
||||
var STR_MIN_DIST = 1000;
|
||||
var STR_MIN_COUNT = 2;
|
||||
|
||||
function createDeclaration(declarations) {
|
||||
return {
|
||||
type: SYNTAX.VariableDeclaration,
|
||||
declarations: declarations,
|
||||
kind: 'var'
|
||||
};
|
||||
}
|
||||
|
||||
function createDeclarator(id, init) {
|
||||
return {
|
||||
type: SYNTAX.VariableDeclarator,
|
||||
id: {
|
||||
type: SYNTAX.Identifier,
|
||||
name: id
|
||||
},
|
||||
init: {
|
||||
type: SYNTAX.Literal,
|
||||
value: init
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function base54Digits() {
|
||||
return 'etnrisouaflchpdvmgybwESxTNCkLAOM_DPHBjFIqRUzWXV$JKQGYZ0516372984';
|
||||
}
|
||||
|
||||
var base54 = (function(){
|
||||
var DIGITS = base54Digits();
|
||||
return function(num) {
|
||||
var ret = '';
|
||||
var base = 54;
|
||||
do {
|
||||
ret += DIGITS.charAt(num % base);
|
||||
num = Math.floor(num / base);
|
||||
base = 64;
|
||||
} while (num > 0);
|
||||
return ret;
|
||||
};
|
||||
})();
|
||||
|
||||
function mangleString(source) {
|
||||
|
||||
var ast = esprima.parse(source, {
|
||||
loc: true
|
||||
});
|
||||
|
||||
var stringVariables = {};
|
||||
|
||||
var stringRelaceCount = 0;
|
||||
|
||||
estraverse.traverse(ast, {
|
||||
enter: function (node, parent) {
|
||||
if (node.type === SYNTAX.Literal
|
||||
&& typeof node.value === 'string'
|
||||
) {
|
||||
// Ignore if string is the key of property
|
||||
if (parent.type === SYNTAX.Property) {
|
||||
return;
|
||||
}
|
||||
var value = node.value;
|
||||
if (value.length > STR_MIN_LENGTH) {
|
||||
if (!stringVariables[value]) {
|
||||
stringVariables[value] = {
|
||||
count: 0,
|
||||
lastLoc: node.loc.start.line,
|
||||
name: '__echartsString__' + base54(stringRelaceCount++)
|
||||
};
|
||||
}
|
||||
var diff = node.loc.start.line - stringVariables[value].lastLoc;
|
||||
// GZIP ?
|
||||
if (diff >= STR_MIN_DIST) {
|
||||
stringVariables[value].lastLoc = node.loc.start.line;
|
||||
stringVariables[value].count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (node.type === SYNTAX.MemberExpression && !node.computed) {
|
||||
if (node.property.type === SYNTAX.Identifier) {
|
||||
var value = node.property.name;
|
||||
if (value.length > STR_MIN_LENGTH) {
|
||||
if (!stringVariables[value]) {
|
||||
stringVariables[value] = {
|
||||
count: 0,
|
||||
lastLoc: node.loc.start.line,
|
||||
name: '__echartsString__' + base54(stringRelaceCount++)
|
||||
};
|
||||
}
|
||||
var diff = node.loc.start.line - stringVariables[value].lastLoc;
|
||||
if (diff >= STR_MIN_DIST) {
|
||||
stringVariables[value].lastLoc = node.loc.start.line;
|
||||
stringVariables[value].count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
estraverse.replace(ast, {
|
||||
enter: function (node, parent) {
|
||||
if ((node.type === SYNTAX.Literal
|
||||
&& typeof node.value === 'string')
|
||||
) {
|
||||
// Ignore if string is the key of property
|
||||
if (parent.type === SYNTAX.Property) {
|
||||
return;
|
||||
}
|
||||
var str = node.value;
|
||||
if (stringVariables[str] && stringVariables[str].count > STR_MIN_COUNT) {
|
||||
return {
|
||||
type: SYNTAX.Identifier,
|
||||
name: stringVariables[str].name
|
||||
};
|
||||
}
|
||||
}
|
||||
if (node.type === SYNTAX.MemberExpression && !node.computed) {
|
||||
if (node.property.type === SYNTAX.Identifier) {
|
||||
var str = node.property.name;
|
||||
if (stringVariables[str] && stringVariables[str].count > STR_MIN_COUNT) {
|
||||
return {
|
||||
type: SYNTAX.MemberExpression,
|
||||
object: node.object,
|
||||
property: {
|
||||
type: SYNTAX.Identifier,
|
||||
name: stringVariables[str].name
|
||||
},
|
||||
computed: true
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Add variables in the top
|
||||
for (var str in stringVariables) {
|
||||
// Used more than once
|
||||
if (stringVariables[str].count > STR_MIN_COUNT) {
|
||||
ast.body.unshift(createDeclaration([
|
||||
createDeclarator(stringVariables[str].name, str)
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
return escodegen.generate(
|
||||
ast,
|
||||
{
|
||||
format: {escapeless: true},
|
||||
comment: true
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
exports = module.exports = mangleString;
|
||||
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
var UglifyJS = require('uglify-js');
|
||||
var fs = require('fs');
|
||||
var etpl = require('etpl');
|
||||
var argv = require('optimist').argv;
|
||||
|
||||
etpl.config({
|
||||
commandOpen: '/**',
|
||||
commandClose: '*/'
|
||||
});
|
||||
|
||||
var mode = argv.m || 'all';
|
||||
var configPath = mode === 'all' ? 'config/echarts.js' : 'config/echarts.' + mode + '.js';
|
||||
var outPath = mode === 'all' ? '../dist/echarts.js' : '../dist/echarts.' + mode + '.js';
|
||||
|
||||
var config = eval('(' + fs.readFileSync(configPath, 'utf-8') + ')');
|
||||
var mainCode = fs.readFileSync(outPath, 'utf-8');
|
||||
var startCode = fs.readFileSync('wrap/start.js', 'utf-8');
|
||||
var nutCode = fs.readFileSync('wrap/nut.js', 'utf-8');
|
||||
var endCode = fs.readFileSync('wrap/end.js', 'utf-8');
|
||||
|
||||
endCode = etpl.compile(endCode)({
|
||||
parts: config.include
|
||||
});
|
||||
|
||||
// FIXME
|
||||
var sourceCode = [startCode, nutCode, require('./mangleString')(mainCode), endCode].join('\n');
|
||||
|
||||
var ast = UglifyJS.parse(sourceCode);
|
||||
/* jshint camelcase: false */
|
||||
// compressor needs figure_out_scope too
|
||||
ast.figure_out_scope();
|
||||
ast = ast.transform(UglifyJS.Compressor( {} ));
|
||||
|
||||
// need to figure out scope again so mangler works optimally
|
||||
ast.figure_out_scope();
|
||||
ast.compute_char_frequency();
|
||||
ast.mangle_names();
|
||||
|
||||
fs.writeFileSync(outPath, [startCode, nutCode, mainCode, endCode].join('\n'), 'utf-8');
|
||||
fs.writeFileSync(outPath.replace('.js', '.min.js'), ast.print_to_string(), 'utf-8');
|
||||
+37230
File diff suppressed because it is too large
Load Diff
+27
File diff suppressed because one or more lines are too long
Vendored
+56282
File diff suppressed because it is too large
Load Diff
Vendored
+33
File diff suppressed because one or more lines are too long
+26780
File diff suppressed because it is too large
Load Diff
+24
File diff suppressed because one or more lines are too long
+364
@@ -0,0 +1,364 @@
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory(require("echarts"));
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define(["echarts"], factory);
|
||||
else if(typeof exports === 'object')
|
||||
exports["bmap"] = factory(require("echarts"));
|
||||
else
|
||||
root["echarts"] = root["echarts"] || {}, root["echarts"]["bmap"] = factory(root["echarts"]);
|
||||
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ exports: {},
|
||||
/******/ id: moduleId,
|
||||
/******/ loaded: false
|
||||
/******/ };
|
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true;
|
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/**
|
||||
* BMap component extension
|
||||
*/
|
||||
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
||||
|
||||
__webpack_require__(1).registerCoordinateSystem(
|
||||
'bmap', __webpack_require__(2)
|
||||
);
|
||||
__webpack_require__(3);
|
||||
__webpack_require__(4);
|
||||
|
||||
// Action
|
||||
__webpack_require__(1).registerAction({
|
||||
type: 'bmapRoam',
|
||||
event: 'bmapRoam',
|
||||
update: 'updateLayout'
|
||||
}, function (payload, ecModel) {
|
||||
ecModel.eachComponent('bmap', function (bMapModel) {
|
||||
var bmap = bMapModel.getBMap();
|
||||
var center = bmap.getCenter();
|
||||
bMapModel.setCenterAndZoom([center.lng, center.lat], bmap.getZoom());
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
version: '1.0.0'
|
||||
};
|
||||
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
|
||||
/***/ },
|
||||
/* 1 */
|
||||
/***/ function(module, exports) {
|
||||
|
||||
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
|
||||
|
||||
/***/ },
|
||||
/* 2 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
||||
|
||||
var echarts = __webpack_require__(1);
|
||||
|
||||
function BMapCoordSys(bmap, api) {
|
||||
this._bmap = bmap;
|
||||
this.dimensions = ['lng', 'lat'];
|
||||
this._mapOffset = [0, 0];
|
||||
|
||||
this._api = api;
|
||||
}
|
||||
|
||||
BMapCoordSys.prototype.dimensions = ['lng', 'lat'];
|
||||
|
||||
BMapCoordSys.prototype.setMapOffset = function (mapOffset) {
|
||||
this._mapOffset = mapOffset;
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.getBMap = function () {
|
||||
return this._bmap;
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.dataToPoint = function (data) {
|
||||
var point = new BMap.Point(data[0], data[1]);
|
||||
var px = this._bmap.pointToOverlayPixel(point);
|
||||
var mapOffset = this._mapOffset;
|
||||
return [px.x - mapOffset[0], px.y - mapOffset[1]];
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.pointToData = function (pt) {
|
||||
var mapOffset = this._mapOffset;
|
||||
var pt = this._bmap.overlayPixelToPoint({
|
||||
x: pt[0] + mapOffset[0],
|
||||
y: pt[1] + mapOffset[1]
|
||||
});
|
||||
return [pt.lng, pt.lat];
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.getViewRect = function () {
|
||||
var api = this._api;
|
||||
return new echarts.graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight());
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.getRoamTransform = function () {
|
||||
return echarts.matrix.create();
|
||||
};
|
||||
|
||||
var Overlay;
|
||||
|
||||
// For deciding which dimensions to use when creating list data
|
||||
BMapCoordSys.dimensions = BMapCoordSys.prototype.dimensions;
|
||||
|
||||
function createOverlayCtor() {
|
||||
function Overlay(root) {
|
||||
this._root = root;
|
||||
}
|
||||
|
||||
Overlay.prototype = new BMap.Overlay();
|
||||
/**
|
||||
* 初始化
|
||||
*
|
||||
* @param {BMap.Map} map
|
||||
* @override
|
||||
*/
|
||||
Overlay.prototype.initialize = function (map) {
|
||||
map.getPanes().labelPane.appendChild(this._root);
|
||||
return this._root;
|
||||
};
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
Overlay.prototype.draw = function () {};
|
||||
|
||||
return Overlay;
|
||||
}
|
||||
|
||||
BMapCoordSys.create = function (ecModel, api) {
|
||||
var bmapCoordSys;
|
||||
var root = api.getDom();
|
||||
|
||||
// TODO Dispose
|
||||
ecModel.eachComponent('bmap', function (bmapModel) {
|
||||
var viewportRoot = api.getZr().painter.getViewportRoot();
|
||||
if (typeof BMap === 'undefined') {
|
||||
throw new Error('BMap api is not loaded');
|
||||
}
|
||||
Overlay = Overlay || createOverlayCtor();
|
||||
if (bmapCoordSys) {
|
||||
throw new Error('Only one bmap component can exist');
|
||||
}
|
||||
if (!bmapModel.__bmap) {
|
||||
// Not support IE8
|
||||
var bmapRoot = root.querySelector('.ec-extension-bmap');
|
||||
if (bmapRoot) {
|
||||
// Reset viewport left and top, which will be changed
|
||||
// in moving handler in BMapView
|
||||
viewportRoot.style.left = '0px';
|
||||
viewportRoot.style.top = '0px';
|
||||
root.removeChild(bmapRoot);
|
||||
}
|
||||
bmapRoot = document.createElement('div');
|
||||
bmapRoot.style.cssText = 'width:100%;height:100%';
|
||||
// Not support IE8
|
||||
bmapRoot.classList.add('ec-extension-bmap');
|
||||
root.appendChild(bmapRoot);
|
||||
var bmap = bmapModel.__bmap = new BMap.Map(bmapRoot);
|
||||
|
||||
var overlay = new Overlay(viewportRoot);
|
||||
bmap.addOverlay(overlay);
|
||||
}
|
||||
var bmap = bmapModel.__bmap;
|
||||
|
||||
// Set bmap options
|
||||
// centerAndZoom before layout and render
|
||||
var center = bmapModel.get('center');
|
||||
var zoom = bmapModel.get('zoom');
|
||||
if (center && zoom) {
|
||||
var pt = new BMap.Point(center[0], center[1]);
|
||||
bmap.centerAndZoom(pt, zoom);
|
||||
}
|
||||
|
||||
bmapCoordSys = new BMapCoordSys(bmap, api);
|
||||
bmapCoordSys.setMapOffset(bmapModel.__mapOffset || [0, 0]);
|
||||
bmapModel.coordinateSystem = bmapCoordSys;
|
||||
});
|
||||
|
||||
ecModel.eachSeries(function (seriesModel) {
|
||||
if (seriesModel.get('coordinateSystem') === 'bmap') {
|
||||
seriesModel.coordinateSystem = bmapCoordSys;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return BMapCoordSys;
|
||||
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
|
||||
/***/ },
|
||||
/* 3 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
||||
|
||||
function v2Equal(a, b) {
|
||||
return a && b && a[0] === b[0] && a[1] === b[1];
|
||||
}
|
||||
|
||||
return __webpack_require__(1).extendComponentModel({
|
||||
type: 'bmap',
|
||||
|
||||
getBMap: function () {
|
||||
// __bmap is injected when creating BMapCoordSys
|
||||
return this.__bmap;
|
||||
},
|
||||
|
||||
setCenterAndZoom: function (center, zoom) {
|
||||
this.option.center = center;
|
||||
this.option.zoom = zoom;
|
||||
},
|
||||
|
||||
centerOrZoomChanged: function (center, zoom) {
|
||||
var option = this.option;
|
||||
return !(v2Equal(center, option.center) && zoom === option.zoom);
|
||||
},
|
||||
|
||||
defaultOption: {
|
||||
center: null,
|
||||
|
||||
zoom: 1,
|
||||
|
||||
mapStyle: {},
|
||||
|
||||
roam: false
|
||||
}
|
||||
});
|
||||
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
|
||||
/***/ },
|
||||
/* 4 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
||||
|
||||
return __webpack_require__(1).extendComponentView({
|
||||
type: 'bmap',
|
||||
|
||||
render: function (bMapModel, ecModel, api) {
|
||||
var rendering = true;
|
||||
|
||||
var bmap = bMapModel.getBMap();
|
||||
var viewportRoot = api.getZr().painter.getViewportRoot();
|
||||
var coordSys = bMapModel.coordinateSystem;
|
||||
var moveHandler = function (type, target) {
|
||||
if (rendering) {
|
||||
return;
|
||||
}
|
||||
var offsetEl = viewportRoot.parentNode.parentNode.parentNode;
|
||||
var mapOffset = [
|
||||
-parseInt(offsetEl.style.left, 10) || 0,
|
||||
-parseInt(offsetEl.style.top, 10) || 0
|
||||
];
|
||||
viewportRoot.style.left = mapOffset[0] + 'px';
|
||||
viewportRoot.style.top = mapOffset[1] + 'px';
|
||||
|
||||
coordSys.setMapOffset(mapOffset);
|
||||
bMapModel.__mapOffset = mapOffset;
|
||||
|
||||
api.dispatchAction({
|
||||
type: 'bmapRoam'
|
||||
});
|
||||
};
|
||||
|
||||
function zoomEndHandler() {
|
||||
if (rendering) {
|
||||
return;
|
||||
}
|
||||
api.dispatchAction({
|
||||
type: 'bmapRoam'
|
||||
});
|
||||
}
|
||||
|
||||
bmap.removeEventListener('moving', this._oldMoveHandler);
|
||||
// FIXME
|
||||
// Moveend may be triggered by centerAndZoom method when creating coordSys next time
|
||||
// bmap.removeEventListener('moveend', this._oldMoveHandler);
|
||||
bmap.removeEventListener('zoomend', this._oldZoomEndHandler);
|
||||
bmap.addEventListener('moving', moveHandler);
|
||||
// bmap.addEventListener('moveend', moveHandler);
|
||||
bmap.addEventListener('zoomend', zoomEndHandler);
|
||||
|
||||
this._oldMoveHandler = moveHandler;
|
||||
this._oldZoomEndHandler = zoomEndHandler;
|
||||
|
||||
var roam = bMapModel.get('roam');
|
||||
if (roam && roam !== 'scale') {
|
||||
bmap.enableDragging();
|
||||
}
|
||||
else {
|
||||
bmap.disableDragging();
|
||||
}
|
||||
if (roam && roam !== 'move') {
|
||||
bmap.enableScrollWheelZoom();
|
||||
bmap.enableDoubleClickZoom();
|
||||
bmap.enablePinchToZoom();
|
||||
}
|
||||
else {
|
||||
bmap.disableScrollWheelZoom();
|
||||
bmap.disableDoubleClickZoom();
|
||||
bmap.disablePinchToZoom();
|
||||
}
|
||||
|
||||
var originalStyle = bMapModel.__mapStyle;
|
||||
|
||||
var newMapStyle = bMapModel.get('mapStyle') || {};
|
||||
// FIXME, Not use JSON methods
|
||||
var mapStyleStr = JSON.stringify(newMapStyle);
|
||||
if (JSON.stringify(originalStyle) !== mapStyleStr) {
|
||||
bmap.setMapStyle(newMapStyle);
|
||||
bMapModel.__mapStyle = JSON.parse(mapStyleStr);
|
||||
}
|
||||
|
||||
rendering = false;
|
||||
}
|
||||
});
|
||||
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
|
||||
/***/ }
|
||||
/******/ ])
|
||||
});
|
||||
;
|
||||
+1
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],t):"object"==typeof exports?exports.bmap=t(require("echarts")):(e.echarts=e.echarts||{},e.echarts.bmap=t(e.echarts))}(this,function(e){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){var n;n=function(e){return o(1).registerCoordinateSystem("bmap",o(2)),o(3),o(4),o(1).registerAction({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},function(e,t){t.eachComponent("bmap",function(e){var t=e.getBMap(),o=t.getCenter();e.setCenterAndZoom([o.lng,o.lat],t.getZoom())})}),{version:"1.0.0"}}.call(t,o,t,e),!(void 0!==n&&(e.exports=n))},function(t,o){t.exports=e},function(e,t,o){var n;n=function(e){function t(e,t){this._bmap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}function n(){function e(e){this._root=e}return e.prototype=new BMap.Overlay,e.prototype.initialize=function(e){return e.getPanes().labelPane.appendChild(this._root),this._root},e.prototype.draw=function(){},e}var r=o(1);t.prototype.dimensions=["lng","lat"],t.prototype.setMapOffset=function(e){this._mapOffset=e},t.prototype.getBMap=function(){return this._bmap},t.prototype.dataToPoint=function(e){var t=new BMap.Point(e[0],e[1]),o=this._bmap.pointToOverlayPixel(t),n=this._mapOffset;return[o.x-n[0],o.y-n[1]]},t.prototype.pointToData=function(e){var t=this._mapOffset,e=this._bmap.overlayPixelToPoint({x:e[0]+t[0],y:e[1]+t[1]});return[e.lng,e.lat]},t.prototype.getViewRect=function(){var e=this._api;return new r.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},t.prototype.getRoamTransform=function(){return r.matrix.create()};var a;return t.dimensions=t.prototype.dimensions,t.create=function(e,o){var r,i=o.getDom();e.eachComponent("bmap",function(e){var p=o.getZr().painter.getViewportRoot();if("undefined"==typeof BMap)throw new Error("BMap api is not loaded");if(a=a||n(),r)throw new Error("Only one bmap component can exist");if(!e.__bmap){var s=i.querySelector(".ec-extension-bmap");s&&(p.style.left="0px",p.style.top="0px",i.removeChild(s)),s=document.createElement("div"),s.style.cssText="width:100%;height:100%",s.classList.add("ec-extension-bmap"),i.appendChild(s);var c=e.__bmap=new BMap.Map(s),m=new a(p);c.addOverlay(m)}var c=e.__bmap,l=e.get("center"),d=e.get("zoom");if(l&&d){var f=new BMap.Point(l[0],l[1]);c.centerAndZoom(f,d)}r=new t(c,o),r.setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=r}),e.eachSeries(function(e){"bmap"===e.get("coordinateSystem")&&(e.coordinateSystem=r)})},t}.call(t,o,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,o){var n;n=function(e){function t(e,t){return e&&t&&e[0]===t[0]&&e[1]===t[1]}return o(1).extendComponentModel({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(e,t){this.option.center=e,this.option.zoom=t},centerOrZoomChanged:function(e,o){var n=this.option;return!(t(e,n.center)&&o===n.zoom)},defaultOption:{center:null,zoom:1,mapStyle:{},roam:!1}})}.call(t,o,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,o){var n;n=function(e){return o(1).extendComponentView({type:"bmap",render:function(e,t,o){function n(){r||o.dispatchAction({type:"bmapRoam"})}var r=!0,a=e.getBMap(),i=o.getZr().painter.getViewportRoot(),p=e.coordinateSystem,s=function(t,n){if(!r){var a=i.parentNode.parentNode.parentNode,s=[-parseInt(a.style.left,10)||0,-parseInt(a.style.top,10)||0];i.style.left=s[0]+"px",i.style.top=s[1]+"px",p.setMapOffset(s),e.__mapOffset=s,o.dispatchAction({type:"bmapRoam"})}};a.removeEventListener("moving",this._oldMoveHandler),a.removeEventListener("zoomend",this._oldZoomEndHandler),a.addEventListener("moving",s),a.addEventListener("zoomend",n),this._oldMoveHandler=s,this._oldZoomEndHandler=n;var c=e.get("roam");c&&"scale"!==c?a.enableDragging():a.disableDragging(),c&&"move"!==c?(a.enableScrollWheelZoom(),a.enableDoubleClickZoom(),a.enablePinchToZoom()):(a.disableScrollWheelZoom(),a.disableDoubleClickZoom(),a.disablePinchToZoom());var m=e.__mapStyle,l=e.get("mapStyle")||{},d=JSON.stringify(l);JSON.stringify(m)!==d&&(a.setMapStyle(l),e.__mapStyle=JSON.parse(d)),r=!1}})}.call(t,o,t,e),!(void 0!==n&&(e.exports=n))}])});
|
||||
+405
@@ -0,0 +1,405 @@
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory(require("echarts"));
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define(["echarts"], factory);
|
||||
else if(typeof exports === 'object')
|
||||
exports["dataTool"] = factory(require("echarts"));
|
||||
else
|
||||
root["echarts"] = root["echarts"] || {}, root["echarts"]["dataTool"] = factory(root["echarts"]);
|
||||
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ exports: {},
|
||||
/******/ id: moduleId,
|
||||
/******/ loaded: false
|
||||
/******/ };
|
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true;
|
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
||||
var echarts = __webpack_require__(1);
|
||||
echarts.dataTool = {
|
||||
version: '1.0.0',
|
||||
gexf: __webpack_require__(5),
|
||||
prepareBoxplotData: __webpack_require__(6)
|
||||
};
|
||||
return echarts.dataTool;
|
||||
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
|
||||
/***/ },
|
||||
/* 1 */
|
||||
/***/ function(module, exports) {
|
||||
|
||||
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
|
||||
|
||||
/***/ },
|
||||
/* 2 */,
|
||||
/* 3 */,
|
||||
/* 4 */,
|
||||
/* 5 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;// GEXF File Parser
|
||||
// http://gexf.net/1.2draft/gexf-12draft-primer.pdf
|
||||
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
||||
|
||||
'use strict';
|
||||
var zrUtil = __webpack_require__(1).util;
|
||||
|
||||
function parse(xml) {
|
||||
var doc;
|
||||
if (typeof xml === 'string') {
|
||||
var parser = new DOMParser();
|
||||
doc = parser.parseFromString(xml, 'text/xml');
|
||||
}
|
||||
else {
|
||||
doc = xml;
|
||||
}
|
||||
if (!doc || doc.getElementsByTagName('parsererror').length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var gexfRoot = getChildByTagName(doc, 'gexf');
|
||||
|
||||
if (!gexfRoot) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var graphRoot = getChildByTagName(gexfRoot, 'graph');
|
||||
|
||||
var attributes = parseAttributes(getChildByTagName(graphRoot, 'attributes'));
|
||||
var attributesMap = {};
|
||||
for (var i = 0; i < attributes.length; i++) {
|
||||
attributesMap[attributes[i].id] = attributes[i];
|
||||
}
|
||||
|
||||
return {
|
||||
nodes: parseNodes(getChildByTagName(graphRoot, 'nodes'), attributesMap),
|
||||
links: parseEdges(getChildByTagName(graphRoot, 'edges'))
|
||||
};
|
||||
}
|
||||
|
||||
function parseAttributes(parent) {
|
||||
return parent ? zrUtil.map(getChildrenByTagName(parent, 'attribute'), function (attribDom) {
|
||||
return {
|
||||
id: getAttr(attribDom, 'id'),
|
||||
title: getAttr(attribDom, 'title'),
|
||||
type: getAttr(attribDom, 'type')
|
||||
};
|
||||
}) : [];
|
||||
}
|
||||
|
||||
function parseNodes(parent, attributesMap) {
|
||||
return parent ? zrUtil.map(getChildrenByTagName(parent, 'node'), function (nodeDom) {
|
||||
|
||||
var id = getAttr(nodeDom, 'id');
|
||||
var label = getAttr(nodeDom, 'label');
|
||||
|
||||
var node = {
|
||||
id: id,
|
||||
name: label,
|
||||
itemStyle: {
|
||||
normal: {}
|
||||
}
|
||||
};
|
||||
|
||||
var vizSizeDom = getChildByTagName(nodeDom, 'viz:size');
|
||||
var vizPosDom = getChildByTagName(nodeDom, 'viz:position');
|
||||
var vizColorDom = getChildByTagName(nodeDom, 'viz:color');
|
||||
// var vizShapeDom = getChildByTagName(nodeDom, 'viz:shape');
|
||||
|
||||
var attvaluesDom = getChildByTagName(nodeDom, 'attvalues');
|
||||
|
||||
if (vizSizeDom) {
|
||||
node.symbolSize = parseFloat(getAttr(vizSizeDom, 'value'));
|
||||
}
|
||||
if (vizPosDom) {
|
||||
node.x = parseFloat(getAttr(vizPosDom, 'x'));
|
||||
node.y = parseFloat(getAttr(vizPosDom, 'y'));
|
||||
// z
|
||||
}
|
||||
if (vizColorDom) {
|
||||
node.itemStyle.normal.color = 'rgb(' +[
|
||||
getAttr(vizColorDom, 'r') | 0,
|
||||
getAttr(vizColorDom, 'g') | 0,
|
||||
getAttr(vizColorDom, 'b') | 0
|
||||
].join(',') + ')';
|
||||
}
|
||||
// if (vizShapeDom) {
|
||||
// node.shape = getAttr(vizShapeDom, 'shape');
|
||||
// }
|
||||
if (attvaluesDom) {
|
||||
var attvalueDomList = getChildrenByTagName(attvaluesDom, 'attvalue');
|
||||
|
||||
node.attributes = {};
|
||||
|
||||
for (var j = 0; j < attvalueDomList.length; j++) {
|
||||
var attvalueDom = attvalueDomList[j];
|
||||
var attId = getAttr(attvalueDom, 'for');
|
||||
var attValue = getAttr(attvalueDom, 'value');
|
||||
var attribute = attributesMap[attId];
|
||||
|
||||
if (attribute) {
|
||||
switch (attribute.type) {
|
||||
case 'integer':
|
||||
case 'long':
|
||||
attValue = parseInt(attValue, 10);
|
||||
break;
|
||||
case 'float':
|
||||
case 'double':
|
||||
attValue = parseFloat(attValue);
|
||||
break;
|
||||
case 'boolean':
|
||||
attValue = attValue.toLowerCase() == 'true';
|
||||
break;
|
||||
default:
|
||||
}
|
||||
node.attributes[attId] = attValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
}) : [];
|
||||
}
|
||||
|
||||
function parseEdges(parent) {
|
||||
return parent ? zrUtil.map(getChildrenByTagName(parent, 'edge'), function (edgeDom) {
|
||||
var id = getAttr(edgeDom, 'id');
|
||||
var label = getAttr(edgeDom, 'label');
|
||||
|
||||
var sourceId = getAttr(edgeDom, 'source');
|
||||
var targetId = getAttr(edgeDom, 'target');
|
||||
|
||||
var edge = {
|
||||
id: id,
|
||||
name: label,
|
||||
source: sourceId,
|
||||
target: targetId,
|
||||
lineStyle: {
|
||||
normal: {}
|
||||
}
|
||||
};
|
||||
|
||||
var lineStyle = edge.lineStyle.normal;
|
||||
|
||||
var vizThicknessDom = getChildByTagName(edgeDom, 'viz:thickness');
|
||||
var vizColorDom = getChildByTagName(edgeDom, 'viz:color');
|
||||
// var vizShapeDom = getChildByTagName(edgeDom, 'viz:shape');
|
||||
|
||||
if (vizThicknessDom) {
|
||||
lineStyle.width = parseFloat(vizThicknessDom.getAttribute('value'));
|
||||
}
|
||||
if (vizColorDom) {
|
||||
lineStyle.color = 'rgb(' + [
|
||||
getAttr(vizColorDom, 'r') | 0,
|
||||
getAttr(vizColorDom, 'g') | 0,
|
||||
getAttr(vizColorDom, 'b') | 0
|
||||
].join(',') + ')';
|
||||
}
|
||||
// if (vizShapeDom) {
|
||||
// edge.shape = vizShapeDom.getAttribute('shape');
|
||||
// }
|
||||
|
||||
return edge;
|
||||
}) : [];
|
||||
}
|
||||
|
||||
function getAttr(el, attrName) {
|
||||
return el.getAttribute(attrName);
|
||||
}
|
||||
|
||||
function getChildByTagName (parent, tagName) {
|
||||
var node = parent.firstChild;
|
||||
|
||||
while (node) {
|
||||
if (
|
||||
node.nodeType != 1 ||
|
||||
node.nodeName.toLowerCase() != tagName.toLowerCase()
|
||||
) {
|
||||
node = node.nextSibling;
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function getChildrenByTagName (parent, tagName) {
|
||||
var node = parent.firstChild;
|
||||
var children = [];
|
||||
while (node) {
|
||||
if (node.nodeName.toLowerCase() == tagName.toLowerCase()) {
|
||||
children.push(node);
|
||||
}
|
||||
node = node.nextSibling;
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
return {
|
||||
parse: parse
|
||||
};
|
||||
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
|
||||
/***/ },
|
||||
/* 6 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
||||
|
||||
var quantile = __webpack_require__(7);
|
||||
var numberUtil = __webpack_require__(1).number;
|
||||
|
||||
/**
|
||||
* Helper method for preparing data.
|
||||
* @param {Array.<number>} rawData like
|
||||
* [
|
||||
* [12,232,443], (raw data set for the first box)
|
||||
* [3843,5545,1232], (raw datat set for the second box)
|
||||
* ...
|
||||
* ]
|
||||
* @param {Object} [opt]
|
||||
*
|
||||
* @param {(number|string)} [opt.boundIQR=1.5] Data less than min bound is outlier.
|
||||
* default 1.5, means Q1 - 1.5 * (Q3 - Q1).
|
||||
* If pass 'none', min bound will not be used.
|
||||
* @param {(number|string)} [opt.layout='horizontal']
|
||||
* Box plot layout, can be 'horizontal' or 'vertical'
|
||||
*/
|
||||
return function (rawData, opt) {
|
||||
opt = opt || [];
|
||||
var boxData = [];
|
||||
var outliers = [];
|
||||
var axisData = [];
|
||||
var boundIQR = opt.boundIQR;
|
||||
|
||||
for (var i = 0; i < rawData.length; i++) {
|
||||
axisData.push(i + '');
|
||||
var ascList = numberUtil.asc(rawData[i].slice());
|
||||
|
||||
var Q1 = quantile(ascList, 0.25);
|
||||
var Q2 = quantile(ascList, 0.5);
|
||||
var Q3 = quantile(ascList, 0.75);
|
||||
var IQR = Q3 - Q1;
|
||||
|
||||
var low = boundIQR === 'none'
|
||||
? ascList[0]
|
||||
: Q1 - (boundIQR == null ? 1.5 : boundIQR) * IQR;
|
||||
var high = boundIQR === 'none'
|
||||
? ascList[ascList.length - 1]
|
||||
: Q3 + (boundIQR == null ? 1.5 : boundIQR) * IQR;
|
||||
|
||||
boxData.push([low, Q1, Q2, Q3, high]);
|
||||
|
||||
for (var j = 0; j < ascList.length; j++) {
|
||||
var dataItem = ascList[j];
|
||||
if (dataItem < low || dataItem > high) {
|
||||
var outlier = [i, dataItem];
|
||||
opt.layout === 'vertical' && outlier.reverse();
|
||||
outliers.push(outlier);
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
boxData: boxData,
|
||||
outliers: outliers,
|
||||
axisData: axisData
|
||||
};
|
||||
};
|
||||
|
||||
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
|
||||
/***/ },
|
||||
/* 7 */
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/**
|
||||
* Copyright (c) 2010-2015, Michael Bostock
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* * The name Michael Bostock may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require) {
|
||||
|
||||
/**
|
||||
* @see <https://github.com/mbostock/d3/blob/master/src/arrays/quantile.js>
|
||||
* @see <http://en.wikipedia.org/wiki/Quantile>
|
||||
* @param {Array.<number>} ascArr
|
||||
*/
|
||||
return function(ascArr, p) {
|
||||
var H = (ascArr.length - 1) * p + 1,
|
||||
h = Math.floor(H),
|
||||
v = +ascArr[h - 1],
|
||||
e = H - h;
|
||||
return e ? v + e * (ascArr[h] - v) : v;
|
||||
};
|
||||
|
||||
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
||||
|
||||
/***/ }
|
||||
/******/ ])
|
||||
});
|
||||
;
|
||||
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],t):"object"==typeof exports?exports.dataTool=t(require("echarts")):(e.echarts=e.echarts||{},e.echarts.dataTool=t(e.echarts))}(this,function(e){return function(e){function t(o){if(r[o])return r[o].exports;var n=r[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){var o;o=function(e){var t=r(1);return t.dataTool={version:"1.0.0",gexf:r(5),prepareBoxplotData:r(6)},t.dataTool}.call(t,r,t,e),!(void 0!==o&&(e.exports=o))},function(t,r){t.exports=e},,,,function(e,t,r){var o;o=function(e){"use strict";function t(e){var t;if("string"==typeof e){var r=new DOMParser;t=r.parseFromString(e,"text/xml")}else t=e;if(!t||t.getElementsByTagName("parsererror").length)return null;var i=l(t,"gexf");if(!i)return null;for(var u=l(i,"graph"),s=o(l(u,"attributes")),c={},f=0;f<s.length;f++)c[s[f].id]=s[f];return{nodes:n(l(u,"nodes"),c),links:a(l(u,"edges"))}}function o(e){return e?s.map(u(e,"attribute"),function(e){return{id:i(e,"id"),title:i(e,"title"),type:i(e,"type")}}):[]}function n(e,t){return e?s.map(u(e,"node"),function(e){var r=i(e,"id"),o=i(e,"label"),n={id:r,name:o,itemStyle:{normal:{}}},a=l(e,"viz:size"),s=l(e,"viz:position"),c=l(e,"viz:color"),f=l(e,"attvalues");if(a&&(n.symbolSize=parseFloat(i(a,"value"))),s&&(n.x=parseFloat(i(s,"x")),n.y=parseFloat(i(s,"y"))),c&&(n.itemStyle.normal.color="rgb("+[0|i(c,"r"),0|i(c,"g"),0|i(c,"b")].join(",")+")"),f){var p=u(f,"attvalue");n.attributes={};for(var v=0;v<p.length;v++){var d=p[v],g=i(d,"for"),h=i(d,"value"),b=t[g];if(b){switch(b.type){case"integer":case"long":h=parseInt(h,10);break;case"float":case"double":h=parseFloat(h);break;case"boolean":h="true"==h.toLowerCase()}n.attributes[g]=h}}}return n}):[]}function a(e){return e?s.map(u(e,"edge"),function(e){var t=i(e,"id"),r=i(e,"label"),o=i(e,"source"),n=i(e,"target"),a={id:t,name:r,source:o,target:n,lineStyle:{normal:{}}},u=a.lineStyle.normal,s=l(e,"viz:thickness"),c=l(e,"viz:color");return s&&(u.width=parseFloat(s.getAttribute("value"))),c&&(u.color="rgb("+[0|i(c,"r"),0|i(c,"g"),0|i(c,"b")].join(",")+")"),a}):[]}function i(e,t){return e.getAttribute(t)}function l(e,t){for(var r=e.firstChild;r;){if(1==r.nodeType&&r.nodeName.toLowerCase()==t.toLowerCase())return r;r=r.nextSibling}return null}function u(e,t){for(var r=e.firstChild,o=[];r;)r.nodeName.toLowerCase()==t.toLowerCase()&&o.push(r),r=r.nextSibling;return o}var s=r(1).util;return{parse:t}}.call(t,r,t,e),!(void 0!==o&&(e.exports=o))},function(e,t,r){var o;o=function(e){var t=r(7),o=r(1).number;return function(e,r){r=r||[];for(var n=[],a=[],i=[],l=r.boundIQR,u=0;u<e.length;u++){i.push(u+"");var s=o.asc(e[u].slice()),c=t(s,.25),f=t(s,.5),p=t(s,.75),v=p-c,d="none"===l?s[0]:c-(null==l?1.5:l)*v,g="none"===l?s[s.length-1]:p+(null==l?1.5:l)*v;n.push([d,c,f,p,g]);for(var h=0;h<s.length;h++){var b=s[h];if(d>b||b>g){var x=[u,b];"vertical"===r.layout&&x.reverse(),a.push(x)}}}return{boxData:n,outliers:a,axisData:i}}}.call(t,r,t,e),!(void 0!==o&&(e.exports=o))},function(e,t,r){var o;o=function(e){return function(e,t){var r=(e.length-1)*t+1,o=Math.floor(r),n=+e[o-1],a=r-o;return a?n+a*(e[o]-n):n}}.call(t,r,t,e),!(void 0!==o&&(e.exports=o))}])});
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
define(function (require) {
|
||||
|
||||
var echarts = require('echarts');
|
||||
|
||||
function BMapCoordSys(bmap, api) {
|
||||
this._bmap = bmap;
|
||||
this.dimensions = ['lng', 'lat'];
|
||||
this._mapOffset = [0, 0];
|
||||
|
||||
this._api = api;
|
||||
}
|
||||
|
||||
BMapCoordSys.prototype.dimensions = ['lng', 'lat'];
|
||||
|
||||
BMapCoordSys.prototype.setMapOffset = function (mapOffset) {
|
||||
this._mapOffset = mapOffset;
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.getBMap = function () {
|
||||
return this._bmap;
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.dataToPoint = function (data) {
|
||||
var point = new BMap.Point(data[0], data[1]);
|
||||
var px = this._bmap.pointToOverlayPixel(point);
|
||||
var mapOffset = this._mapOffset;
|
||||
return [px.x - mapOffset[0], px.y - mapOffset[1]];
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.pointToData = function (pt) {
|
||||
var mapOffset = this._mapOffset;
|
||||
var pt = this._bmap.overlayPixelToPoint({
|
||||
x: pt[0] + mapOffset[0],
|
||||
y: pt[1] + mapOffset[1]
|
||||
});
|
||||
return [pt.lng, pt.lat];
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.getViewRect = function () {
|
||||
var api = this._api;
|
||||
return new echarts.graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight());
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.getRoamTransform = function () {
|
||||
return echarts.matrix.create();
|
||||
};
|
||||
|
||||
var Overlay;
|
||||
|
||||
// For deciding which dimensions to use when creating list data
|
||||
BMapCoordSys.dimensions = BMapCoordSys.prototype.dimensions;
|
||||
|
||||
function createOverlayCtor() {
|
||||
function Overlay(root) {
|
||||
this._root = root;
|
||||
}
|
||||
|
||||
Overlay.prototype = new BMap.Overlay();
|
||||
/**
|
||||
* 初始化
|
||||
*
|
||||
* @param {BMap.Map} map
|
||||
* @override
|
||||
*/
|
||||
Overlay.prototype.initialize = function (map) {
|
||||
map.getPanes().labelPane.appendChild(this._root);
|
||||
return this._root;
|
||||
};
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
Overlay.prototype.draw = function () {};
|
||||
|
||||
return Overlay;
|
||||
}
|
||||
|
||||
BMapCoordSys.create = function (ecModel, api) {
|
||||
var bmapCoordSys;
|
||||
var root = api.getDom();
|
||||
|
||||
// TODO Dispose
|
||||
ecModel.eachComponent('bmap', function (bmapModel) {
|
||||
var viewportRoot = api.getZr().painter.getViewportRoot();
|
||||
if (typeof BMap === 'undefined') {
|
||||
throw new Error('BMap api is not loaded');
|
||||
}
|
||||
Overlay = Overlay || createOverlayCtor();
|
||||
if (bmapCoordSys) {
|
||||
throw new Error('Only one bmap component can exist');
|
||||
}
|
||||
if (!bmapModel.__bmap) {
|
||||
// Not support IE8
|
||||
var bmapRoot = root.querySelector('.ec-extension-bmap');
|
||||
if (bmapRoot) {
|
||||
// Reset viewport left and top, which will be changed
|
||||
// in moving handler in BMapView
|
||||
viewportRoot.style.left = '0px';
|
||||
viewportRoot.style.top = '0px';
|
||||
root.removeChild(bmapRoot);
|
||||
}
|
||||
bmapRoot = document.createElement('div');
|
||||
bmapRoot.style.cssText = 'width:100%;height:100%';
|
||||
// Not support IE8
|
||||
bmapRoot.classList.add('ec-extension-bmap');
|
||||
root.appendChild(bmapRoot);
|
||||
var bmap = bmapModel.__bmap = new BMap.Map(bmapRoot);
|
||||
|
||||
var overlay = new Overlay(viewportRoot);
|
||||
bmap.addOverlay(overlay);
|
||||
}
|
||||
var bmap = bmapModel.__bmap;
|
||||
|
||||
// Set bmap options
|
||||
// centerAndZoom before layout and render
|
||||
var center = bmapModel.get('center');
|
||||
var zoom = bmapModel.get('zoom');
|
||||
if (center && zoom) {
|
||||
var pt = new BMap.Point(center[0], center[1]);
|
||||
bmap.centerAndZoom(pt, zoom);
|
||||
}
|
||||
|
||||
bmapCoordSys = new BMapCoordSys(bmap, api);
|
||||
bmapCoordSys.setMapOffset(bmapModel.__mapOffset || [0, 0]);
|
||||
bmapModel.coordinateSystem = bmapCoordSys;
|
||||
});
|
||||
|
||||
ecModel.eachSeries(function (seriesModel) {
|
||||
if (seriesModel.get('coordinateSystem') === 'bmap') {
|
||||
seriesModel.coordinateSystem = bmapCoordSys;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return BMapCoordSys;
|
||||
});
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
define(function (require) {
|
||||
|
||||
function v2Equal(a, b) {
|
||||
return a && b && a[0] === b[0] && a[1] === b[1];
|
||||
}
|
||||
|
||||
return require('echarts').extendComponentModel({
|
||||
type: 'bmap',
|
||||
|
||||
getBMap: function () {
|
||||
// __bmap is injected when creating BMapCoordSys
|
||||
return this.__bmap;
|
||||
},
|
||||
|
||||
setCenterAndZoom: function (center, zoom) {
|
||||
this.option.center = center;
|
||||
this.option.zoom = zoom;
|
||||
},
|
||||
|
||||
centerOrZoomChanged: function (center, zoom) {
|
||||
var option = this.option;
|
||||
return !(v2Equal(center, option.center) && zoom === option.zoom);
|
||||
},
|
||||
|
||||
defaultOption: {
|
||||
center: null,
|
||||
|
||||
zoom: 1,
|
||||
|
||||
mapStyle: {},
|
||||
|
||||
roam: false
|
||||
}
|
||||
});
|
||||
});
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
define(function (require) {
|
||||
|
||||
return require('echarts').extendComponentView({
|
||||
type: 'bmap',
|
||||
|
||||
render: function (bMapModel, ecModel, api) {
|
||||
var rendering = true;
|
||||
|
||||
var bmap = bMapModel.getBMap();
|
||||
var viewportRoot = api.getZr().painter.getViewportRoot();
|
||||
var coordSys = bMapModel.coordinateSystem;
|
||||
var moveHandler = function (type, target) {
|
||||
if (rendering) {
|
||||
return;
|
||||
}
|
||||
var offsetEl = viewportRoot.parentNode.parentNode.parentNode;
|
||||
var mapOffset = [
|
||||
-parseInt(offsetEl.style.left, 10) || 0,
|
||||
-parseInt(offsetEl.style.top, 10) || 0
|
||||
];
|
||||
viewportRoot.style.left = mapOffset[0] + 'px';
|
||||
viewportRoot.style.top = mapOffset[1] + 'px';
|
||||
|
||||
coordSys.setMapOffset(mapOffset);
|
||||
bMapModel.__mapOffset = mapOffset;
|
||||
|
||||
api.dispatchAction({
|
||||
type: 'bmapRoam'
|
||||
});
|
||||
};
|
||||
|
||||
function zoomEndHandler() {
|
||||
if (rendering) {
|
||||
return;
|
||||
}
|
||||
api.dispatchAction({
|
||||
type: 'bmapRoam'
|
||||
});
|
||||
}
|
||||
|
||||
bmap.removeEventListener('moving', this._oldMoveHandler);
|
||||
// FIXME
|
||||
// Moveend may be triggered by centerAndZoom method when creating coordSys next time
|
||||
// bmap.removeEventListener('moveend', this._oldMoveHandler);
|
||||
bmap.removeEventListener('zoomend', this._oldZoomEndHandler);
|
||||
bmap.addEventListener('moving', moveHandler);
|
||||
// bmap.addEventListener('moveend', moveHandler);
|
||||
bmap.addEventListener('zoomend', zoomEndHandler);
|
||||
|
||||
this._oldMoveHandler = moveHandler;
|
||||
this._oldZoomEndHandler = zoomEndHandler;
|
||||
|
||||
var roam = bMapModel.get('roam');
|
||||
if (roam && roam !== 'scale') {
|
||||
bmap.enableDragging();
|
||||
}
|
||||
else {
|
||||
bmap.disableDragging();
|
||||
}
|
||||
if (roam && roam !== 'move') {
|
||||
bmap.enableScrollWheelZoom();
|
||||
bmap.enableDoubleClickZoom();
|
||||
bmap.enablePinchToZoom();
|
||||
}
|
||||
else {
|
||||
bmap.disableScrollWheelZoom();
|
||||
bmap.disableDoubleClickZoom();
|
||||
bmap.disablePinchToZoom();
|
||||
}
|
||||
|
||||
var originalStyle = bMapModel.__mapStyle;
|
||||
|
||||
var newMapStyle = bMapModel.get('mapStyle') || {};
|
||||
// FIXME, Not use JSON methods
|
||||
var mapStyleStr = JSON.stringify(newMapStyle);
|
||||
if (JSON.stringify(originalStyle) !== mapStyleStr) {
|
||||
bmap.setMapStyle(newMapStyle);
|
||||
bMapModel.__mapStyle = JSON.parse(mapStyleStr);
|
||||
}
|
||||
|
||||
rendering = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* BMap component extension
|
||||
*/
|
||||
define(function (require) {
|
||||
|
||||
require('echarts').registerCoordinateSystem(
|
||||
'bmap', require('./BMapCoordSys')
|
||||
);
|
||||
require('./BMapModel');
|
||||
require('./BMapView');
|
||||
|
||||
// Action
|
||||
require('echarts').registerAction({
|
||||
type: 'bmapRoam',
|
||||
event: 'bmapRoam',
|
||||
update: 'updateLayout'
|
||||
}, function (payload, ecModel) {
|
||||
ecModel.eachComponent('bmap', function (bMapModel) {
|
||||
var bmap = bMapModel.getBMap();
|
||||
var center = bmap.getCenter();
|
||||
bMapModel.setCenterAndZoom([center.lng, center.lat], bmap.getZoom());
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
version: '1.0.0'
|
||||
};
|
||||
});
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
// GEXF File Parser
|
||||
// http://gexf.net/1.2draft/gexf-12draft-primer.pdf
|
||||
define(function (require) {
|
||||
|
||||
'use strict';
|
||||
var zrUtil = require('echarts').util;
|
||||
|
||||
function parse(xml) {
|
||||
var doc;
|
||||
if (typeof xml === 'string') {
|
||||
var parser = new DOMParser();
|
||||
doc = parser.parseFromString(xml, 'text/xml');
|
||||
}
|
||||
else {
|
||||
doc = xml;
|
||||
}
|
||||
if (!doc || doc.getElementsByTagName('parsererror').length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var gexfRoot = getChildByTagName(doc, 'gexf');
|
||||
|
||||
if (!gexfRoot) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var graphRoot = getChildByTagName(gexfRoot, 'graph');
|
||||
|
||||
var attributes = parseAttributes(getChildByTagName(graphRoot, 'attributes'));
|
||||
var attributesMap = {};
|
||||
for (var i = 0; i < attributes.length; i++) {
|
||||
attributesMap[attributes[i].id] = attributes[i];
|
||||
}
|
||||
|
||||
return {
|
||||
nodes: parseNodes(getChildByTagName(graphRoot, 'nodes'), attributesMap),
|
||||
links: parseEdges(getChildByTagName(graphRoot, 'edges'))
|
||||
};
|
||||
}
|
||||
|
||||
function parseAttributes(parent) {
|
||||
return parent ? zrUtil.map(getChildrenByTagName(parent, 'attribute'), function (attribDom) {
|
||||
return {
|
||||
id: getAttr(attribDom, 'id'),
|
||||
title: getAttr(attribDom, 'title'),
|
||||
type: getAttr(attribDom, 'type')
|
||||
};
|
||||
}) : [];
|
||||
}
|
||||
|
||||
function parseNodes(parent, attributesMap) {
|
||||
return parent ? zrUtil.map(getChildrenByTagName(parent, 'node'), function (nodeDom) {
|
||||
|
||||
var id = getAttr(nodeDom, 'id');
|
||||
var label = getAttr(nodeDom, 'label');
|
||||
|
||||
var node = {
|
||||
id: id,
|
||||
name: label,
|
||||
itemStyle: {
|
||||
normal: {}
|
||||
}
|
||||
};
|
||||
|
||||
var vizSizeDom = getChildByTagName(nodeDom, 'viz:size');
|
||||
var vizPosDom = getChildByTagName(nodeDom, 'viz:position');
|
||||
var vizColorDom = getChildByTagName(nodeDom, 'viz:color');
|
||||
// var vizShapeDom = getChildByTagName(nodeDom, 'viz:shape');
|
||||
|
||||
var attvaluesDom = getChildByTagName(nodeDom, 'attvalues');
|
||||
|
||||
if (vizSizeDom) {
|
||||
node.symbolSize = parseFloat(getAttr(vizSizeDom, 'value'));
|
||||
}
|
||||
if (vizPosDom) {
|
||||
node.x = parseFloat(getAttr(vizPosDom, 'x'));
|
||||
node.y = parseFloat(getAttr(vizPosDom, 'y'));
|
||||
// z
|
||||
}
|
||||
if (vizColorDom) {
|
||||
node.itemStyle.normal.color = 'rgb(' +[
|
||||
getAttr(vizColorDom, 'r') | 0,
|
||||
getAttr(vizColorDom, 'g') | 0,
|
||||
getAttr(vizColorDom, 'b') | 0
|
||||
].join(',') + ')';
|
||||
}
|
||||
// if (vizShapeDom) {
|
||||
// node.shape = getAttr(vizShapeDom, 'shape');
|
||||
// }
|
||||
if (attvaluesDom) {
|
||||
var attvalueDomList = getChildrenByTagName(attvaluesDom, 'attvalue');
|
||||
|
||||
node.attributes = {};
|
||||
|
||||
for (var j = 0; j < attvalueDomList.length; j++) {
|
||||
var attvalueDom = attvalueDomList[j];
|
||||
var attId = getAttr(attvalueDom, 'for');
|
||||
var attValue = getAttr(attvalueDom, 'value');
|
||||
var attribute = attributesMap[attId];
|
||||
|
||||
if (attribute) {
|
||||
switch (attribute.type) {
|
||||
case 'integer':
|
||||
case 'long':
|
||||
attValue = parseInt(attValue, 10);
|
||||
break;
|
||||
case 'float':
|
||||
case 'double':
|
||||
attValue = parseFloat(attValue);
|
||||
break;
|
||||
case 'boolean':
|
||||
attValue = attValue.toLowerCase() == 'true';
|
||||
break;
|
||||
default:
|
||||
}
|
||||
node.attributes[attId] = attValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
}) : [];
|
||||
}
|
||||
|
||||
function parseEdges(parent) {
|
||||
return parent ? zrUtil.map(getChildrenByTagName(parent, 'edge'), function (edgeDom) {
|
||||
var id = getAttr(edgeDom, 'id');
|
||||
var label = getAttr(edgeDom, 'label');
|
||||
|
||||
var sourceId = getAttr(edgeDom, 'source');
|
||||
var targetId = getAttr(edgeDom, 'target');
|
||||
|
||||
var edge = {
|
||||
id: id,
|
||||
name: label,
|
||||
source: sourceId,
|
||||
target: targetId,
|
||||
lineStyle: {
|
||||
normal: {}
|
||||
}
|
||||
};
|
||||
|
||||
var lineStyle = edge.lineStyle.normal;
|
||||
|
||||
var vizThicknessDom = getChildByTagName(edgeDom, 'viz:thickness');
|
||||
var vizColorDom = getChildByTagName(edgeDom, 'viz:color');
|
||||
// var vizShapeDom = getChildByTagName(edgeDom, 'viz:shape');
|
||||
|
||||
if (vizThicknessDom) {
|
||||
lineStyle.width = parseFloat(vizThicknessDom.getAttribute('value'));
|
||||
}
|
||||
if (vizColorDom) {
|
||||
lineStyle.color = 'rgb(' + [
|
||||
getAttr(vizColorDom, 'r') | 0,
|
||||
getAttr(vizColorDom, 'g') | 0,
|
||||
getAttr(vizColorDom, 'b') | 0
|
||||
].join(',') + ')';
|
||||
}
|
||||
// if (vizShapeDom) {
|
||||
// edge.shape = vizShapeDom.getAttribute('shape');
|
||||
// }
|
||||
|
||||
return edge;
|
||||
}) : [];
|
||||
}
|
||||
|
||||
function getAttr(el, attrName) {
|
||||
return el.getAttribute(attrName);
|
||||
}
|
||||
|
||||
function getChildByTagName (parent, tagName) {
|
||||
var node = parent.firstChild;
|
||||
|
||||
while (node) {
|
||||
if (
|
||||
node.nodeType != 1 ||
|
||||
node.nodeName.toLowerCase() != tagName.toLowerCase()
|
||||
) {
|
||||
node = node.nextSibling;
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function getChildrenByTagName (parent, tagName) {
|
||||
var node = parent.firstChild;
|
||||
var children = [];
|
||||
while (node) {
|
||||
if (node.nodeName.toLowerCase() == tagName.toLowerCase()) {
|
||||
children.push(node);
|
||||
}
|
||||
node = node.nextSibling;
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
return {
|
||||
parse: parse
|
||||
};
|
||||
});
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
define(function (require) {
|
||||
var echarts = require('echarts');
|
||||
echarts.dataTool = {
|
||||
version: '1.0.0',
|
||||
gexf: require('./gexf'),
|
||||
prepareBoxplotData: require('./prepareBoxplotData')
|
||||
};
|
||||
return echarts.dataTool;
|
||||
});
|
||||
@@ -0,0 +1,63 @@
|
||||
define(function (require) {
|
||||
|
||||
var quantile = require('./quantile');
|
||||
var numberUtil = require('echarts').number;
|
||||
|
||||
/**
|
||||
* Helper method for preparing data.
|
||||
* @param {Array.<number>} rawData like
|
||||
* [
|
||||
* [12,232,443], (raw data set for the first box)
|
||||
* [3843,5545,1232], (raw datat set for the second box)
|
||||
* ...
|
||||
* ]
|
||||
* @param {Object} [opt]
|
||||
*
|
||||
* @param {(number|string)} [opt.boundIQR=1.5] Data less than min bound is outlier.
|
||||
* default 1.5, means Q1 - 1.5 * (Q3 - Q1).
|
||||
* If pass 'none', min bound will not be used.
|
||||
* @param {(number|string)} [opt.layout='horizontal']
|
||||
* Box plot layout, can be 'horizontal' or 'vertical'
|
||||
*/
|
||||
return function (rawData, opt) {
|
||||
opt = opt || [];
|
||||
var boxData = [];
|
||||
var outliers = [];
|
||||
var axisData = [];
|
||||
var boundIQR = opt.boundIQR;
|
||||
|
||||
for (var i = 0; i < rawData.length; i++) {
|
||||
axisData.push(i + '');
|
||||
var ascList = numberUtil.asc(rawData[i].slice());
|
||||
|
||||
var Q1 = quantile(ascList, 0.25);
|
||||
var Q2 = quantile(ascList, 0.5);
|
||||
var Q3 = quantile(ascList, 0.75);
|
||||
var IQR = Q3 - Q1;
|
||||
|
||||
var low = boundIQR === 'none'
|
||||
? ascList[0]
|
||||
: Q1 - (boundIQR == null ? 1.5 : boundIQR) * IQR;
|
||||
var high = boundIQR === 'none'
|
||||
? ascList[ascList.length - 1]
|
||||
: Q3 + (boundIQR == null ? 1.5 : boundIQR) * IQR;
|
||||
|
||||
boxData.push([low, Q1, Q2, Q3, high]);
|
||||
|
||||
for (var j = 0; j < ascList.length; j++) {
|
||||
var dataItem = ascList[j];
|
||||
if (dataItem < low || dataItem > high) {
|
||||
var outlier = [i, dataItem];
|
||||
opt.layout === 'vertical' && outlier.reverse();
|
||||
outliers.push(outlier);
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
boxData: boxData,
|
||||
outliers: outliers,
|
||||
axisData: axisData
|
||||
};
|
||||
};
|
||||
|
||||
});
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Copyright (c) 2010-2015, Michael Bostock
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* * The name Michael Bostock may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
define(function (require) {
|
||||
|
||||
/**
|
||||
* @see <https://github.com/mbostock/d3/blob/master/src/arrays/quantile.js>
|
||||
* @see <http://en.wikipedia.org/wiki/Quantile>
|
||||
* @param {Array.<number>} ascArr
|
||||
*/
|
||||
return function(ascArr, p) {
|
||||
var H = (ascArr.length - 1) * p + 1,
|
||||
h = Math.floor(H),
|
||||
v = +ascArr[h - 1],
|
||||
e = H - h;
|
||||
return e ? v + e * (ascArr[h] - v) : v;
|
||||
};
|
||||
|
||||
});
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
define('echarts', [], function () {return echarts;});
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
var PROD = process.argv.indexOf('-p') >= 0;
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
'bmap': __dirname + '/../extension/bmap/bmap.js',
|
||||
'dataTool': __dirname + '/../extension/dataTool'
|
||||
},
|
||||
output: {
|
||||
libraryTarget: 'umd',
|
||||
library: ['echarts', '[name]'],
|
||||
path: __dirname + '/../dist/extension',
|
||||
filename: PROD ? '[name].min.js' : '[name].js'
|
||||
},
|
||||
externals: {
|
||||
'echarts': 'echarts'
|
||||
}
|
||||
};
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Export echarts as CommonJS module
|
||||
*/
|
||||
module.exports = require('./lib/echarts');
|
||||
|
||||
require('./lib/chart/line');
|
||||
require('./lib/chart/bar');
|
||||
require('./lib/chart/pie');
|
||||
require('./lib/chart/scatter');
|
||||
require('./lib/component/tooltip');
|
||||
require('./lib/component/legend');
|
||||
|
||||
require('./lib/component/grid');
|
||||
require('./lib/component/title');
|
||||
|
||||
require('./lib/component/markPoint');
|
||||
require('./lib/component/markLine');
|
||||
require('./lib/component/dataZoom');
|
||||
require('./lib/component/toolbox');
|
||||
|
||||
require('zrender/lib/vml/vml');
|
||||
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Export echarts as CommonJS module
|
||||
*/
|
||||
module.exports = require('./lib/echarts');
|
||||
|
||||
// Import all charts and components
|
||||
require('./lib/chart/line');
|
||||
require('./lib/chart/bar');
|
||||
require('./lib/chart/pie');
|
||||
require('./lib/chart/scatter');
|
||||
require('./lib/chart/radar');
|
||||
|
||||
require('./lib/chart/map');
|
||||
require('./lib/chart/treemap');
|
||||
require('./lib/chart/graph');
|
||||
require('./lib/chart/gauge');
|
||||
require('./lib/chart/funnel');
|
||||
require('./lib/chart/parallel');
|
||||
require('./lib/chart/sankey');
|
||||
require('./lib/chart/boxplot');
|
||||
require('./lib/chart/candlestick');
|
||||
require('./lib/chart/effectScatter');
|
||||
require('./lib/chart/lines');
|
||||
require('./lib/chart/heatmap');
|
||||
|
||||
require('./lib/component/grid');
|
||||
require('./lib/component/legend');
|
||||
require('./lib/component/tooltip');
|
||||
require('./lib/component/polar');
|
||||
require('./lib/component/geo');
|
||||
require('./lib/component/parallel');
|
||||
|
||||
require('./lib/component/title');
|
||||
|
||||
require('./lib/component/dataZoom');
|
||||
require('./lib/component/visualMap');
|
||||
|
||||
require('./lib/component/markPoint');
|
||||
require('./lib/component/markLine');
|
||||
|
||||
require('./lib/component/timeline');
|
||||
require('./lib/component/toolbox');
|
||||
|
||||
require('zrender/lib/vml/vml');
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Export echarts as CommonJS module
|
||||
*/
|
||||
module.exports = require('./lib/echarts');
|
||||
|
||||
require('./lib/chart/line');
|
||||
require('./lib/chart/bar');
|
||||
require('./lib/chart/pie');
|
||||
require('./lib/component/grid');
|
||||
+27
File diff suppressed because one or more lines are too long
Vendored
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
@@ -0,0 +1,27 @@
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['exports', 'echarts'], factory);
|
||||
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
|
||||
// CommonJS
|
||||
factory(exports, require('echarts'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory({}, root.echarts);
|
||||
}
|
||||
}(this, function (exports, echarts) {
|
||||
var log = function (msg) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console && console.error && console.error(msg);
|
||||
}
|
||||
}
|
||||
if (!echarts) {
|
||||
log('ECharts is not Loaded');
|
||||
return;
|
||||
}
|
||||
if (!echarts.registerMap) {
|
||||
log('ECharts Map is not loaded')
|
||||
return;
|
||||
}
|
||||
echarts.registerMap('澳门', {"type":"FeatureCollection","features":[{"id":"820001","geometry":{"type":"Polygon","coordinates":["@@LADC^umZ@DONWEBDCLHBH@DFBBNA"],"encodeOffsets":[[116285,22746]]},"properties":{"cp":[113.5528956,22.20787],"name":"花地瑪堂區","childNum":1}},{"id":"820002","geometry":{"type":"Polygon","coordinates":["@@MK@CA@AAGDEB@NVFHE"],"encodeOffsets":[[116281,22734]]},"properties":{"cp":[113.5489608,22.1992075],"name":"花王堂區","childNum":1}},{"id":"820003","geometry":{"type":"Polygon","coordinates":["@@EGOB@DNLHE@C"],"encodeOffsets":[[116285,22729]]},"properties":{"cp":[113.5501828,22.19372083],"name":"望德堂區","childNum":1}},{"id":"820004","geometry":{"type":"Polygon","coordinates":["@@YIPEL@JFCBBFADHDBBFDHIJJEFDPCHHlY"],"encodeOffsets":[[116313,22707]]},"properties":{"cp":[113.5536475,22.18853944],"name":"大堂區","childNum":1}},{"id":"820005","geometry":{"type":"Polygon","coordinates":["@@JICGAECACGEBAAEDP^"],"encodeOffsets":[[116266,22728]]},"properties":{"cp":[113.5419278,22.18736806],"name":"風順堂區","childNum":1}},{"id":"820006","geometry":{"type":"Polygon","coordinates":["@@ ZNWRquZCBCC@AEA@@ADCDCAACEAGBQ@IN"],"encodeOffsets":[[116265,22694]]},"properties":{"cp":[113.5587044,22.15375944],"name":"嘉模堂區","childNum":1}},{"id":"820007","geometry":{"type":"Polygon","coordinates":["@@MOIAIEI@@GE@AAUCBdCFIFR@HAFBBDDBDCBCDB@BFDDC"],"encodeOffsets":[[116316,22676]]},"properties":{"cp":[113.5695992,22.13663],"name":"路氹填海區","childNum":1}},{"id":"820008","geometry":{"type":"Polygon","coordinates":["@@DKMMa_GC_COD@dVDBBF@@HJ@JFJBNP"],"encodeOffsets":[[116329,22670]]},"properties":{"cp":[113.5599542,22.12348639],"name":"聖方濟各堂區","childNum":1}}],"UTF8Encoding":true});
|
||||
}));
|
||||
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
+27
File diff suppressed because one or more lines are too long
Vendored
+27
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"type":"FeatureCollection","features":[{"id":"820001","geometry":{"type":"Polygon","coordinates":["@@LADC^umZ@DONWEBDCLHBH@DFBBNA"],"encodeOffsets":[[116285,22746]]},"properties":{"cp":[113.5528956,22.20787],"name":"花地瑪堂區","childNum":1}},{"id":"820002","geometry":{"type":"Polygon","coordinates":["@@MK@CA@AAGDEB@NVFHE"],"encodeOffsets":[[116281,22734]]},"properties":{"cp":[113.5489608,22.1992075],"name":"花王堂區","childNum":1}},{"id":"820003","geometry":{"type":"Polygon","coordinates":["@@EGOB@DNLHE@C"],"encodeOffsets":[[116285,22729]]},"properties":{"cp":[113.5501828,22.19372083],"name":"望德堂區","childNum":1}},{"id":"820004","geometry":{"type":"Polygon","coordinates":["@@YIPEL@JFCBBFADHDBBFDHIJJEFDPCHHlY"],"encodeOffsets":[[116313,22707]]},"properties":{"cp":[113.5536475,22.18853944],"name":"大堂區","childNum":1}},{"id":"820005","geometry":{"type":"Polygon","coordinates":["@@JICGAECACGEBAAEDP^"],"encodeOffsets":[[116266,22728]]},"properties":{"cp":[113.5419278,22.18736806],"name":"風順堂區","childNum":1}},{"id":"820006","geometry":{"type":"Polygon","coordinates":["@@ ZNWRquZCBCC@AEA@@ADCDCAACEAGBQ@IN"],"encodeOffsets":[[116265,22694]]},"properties":{"cp":[113.5587044,22.15375944],"name":"嘉模堂區","childNum":1}},{"id":"820007","geometry":{"type":"Polygon","coordinates":["@@MOIAIEI@@GE@AAUCBdCFIFR@HAFBBDDBDCBCDB@BFDDC"],"encodeOffsets":[[116316,22676]]},"properties":{"cp":[113.5695992,22.13663],"name":"路氹填海區","childNum":1}},{"id":"820008","geometry":{"type":"Polygon","coordinates":["@@DKMMa_GC_COD@dVDBBF@@HJ@JFJBNP"],"encodeOffsets":[[116329,22670]]},"properties":{"cp":[113.5599542,22.12348639],"name":"聖方濟各堂區","childNum":1}}],"UTF8Encoding":true}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user