提交 82455c7c 编写于 作者: S sushuang

Fix module

上级 6c003cb0
此差异已折叠。
import './src/config';
export * from './src/echarts';
\ No newline at end of file
import './src/config';
export * from './src/echarts';
......
import './src/config';
export * from './src/echarts';
......
import './src/config';
export * from './src/echarts';
......
......@@ -2,6 +2,8 @@ import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import uglify from 'rollup-plugin-uglify';
var watching = process.argv.indexOf('--watch') >= 0 || process.argv.indexOf('-w') >= 0;
function getPlugins(production) {
let plugins = [
resolve({
......@@ -44,7 +46,6 @@ function getPlugins(production) {
return plugins;
}
// ??????????
// en lang
......@@ -70,19 +71,23 @@ function createBuild(type, production) {
file: `dist/echarts${type}${postfix}.js`
},
watch: {
include: ['./src/**', './index*.js']
include: ['./src/**', './echarts*.js']
}
};
}
export default [
createBuild('blank', false),
createBuild('simple', false),
createBuild('common', false),
createBuild('', false),
var configs = watching
? createBuild('', false)
: [
createBuild('blank', false),
createBuild('simple', false),
createBuild('common', false),
createBuild('', false),
createBuild('blank', true),
createBuild('simple', true),
createBuild('common', true),
createBuild('', true)
];
createBuild('blank', true),
createBuild('simple', true),
createBuild('common', true),
createBuild('', true)
];
\ No newline at end of file
export default configs;
\ No newline at end of file
// Enable DEV mode when using source code without build. which has no __DEV__ variable
// In build process 'typeof __DEV__' will be replace with 'boolean'
// So this code will be removed or disabled anyway after built.
if (typeof __DEV__ === 'undefined') {
// In browser
if (typeof window !== 'undefined') {
window.__DEV__ = true;
}
// In node
else if (typeof global !== 'undefined') {
global.__DEV__ = true;
}
}
......@@ -111,8 +111,8 @@ export default Component.extend({
var axisModels = zrUtil.filter(this.dependentModels.parallelAxis, function (axisModel) {
// Can not use this.contains here, because
// initialization has not been completed yet.
return axisModel.get('parallelIndex') === this.componentIndex;
});
return (axisModel.get('parallelIndex') || 0) === this.componentIndex;
}, this);
zrUtil.each(axisModels, function (axisModel) {
dimensions.push('dim' + axisModel.get('dim'));
......
// Enable DEV mode when using source code without build. which has no __DEV__ variable
// In build process 'typeof __DEV__' will be replace with 'boolean'
// So this code will be removed or disabled anyway after built.
if (typeof __DEV__ === 'undefined') {
// In browser
if (typeof window !== 'undefined') {
window.__DEV__ = true;
}
// In node
else if (typeof global !== 'undefined') {
global.__DEV__ = true;
}
}
/*!
* ECharts, a javascript interactive chart library.
......@@ -57,6 +44,17 @@ export var dependencies = {
zrender: '3.6.2'
};
var PRIORITY_PROCESSOR_FILTER = 1000;
var PRIORITY_PROCESSOR_STATISTIC = 5000;
var PRIORITY_VISUAL_LAYOUT = 1000;
var PRIORITY_VISUAL_GLOBAL = 2000;
var PRIORITY_VISUAL_CHART = 3000;
var PRIORITY_VISUAL_COMPONENT = 4000;
// FIXME
// necessary?
var PRIORITY_VISUAL_BRUSH = 5000;
export var PRIORITY = {
PROCESSOR: {
FILTER: PRIORITY_PROCESSOR_FILTER,
......@@ -71,17 +69,6 @@ export var PRIORITY = {
}
};
var PRIORITY_PROCESSOR_FILTER = 1000;
var PRIORITY_PROCESSOR_STATISTIC = 5000;
var PRIORITY_VISUAL_LAYOUT = 1000;
var PRIORITY_VISUAL_GLOBAL = 2000;
var PRIORITY_VISUAL_CHART = 3000;
var PRIORITY_VISUAL_COMPONENT = 4000;
// FIXME
// necessary?
var PRIORITY_VISUAL_BRUSH = 5000;
// Main process have three entries: `setOption`, `dispatchAction` and `resize`,
// where they must not be invoked nestedly, except the only case: invoke
// dispatchAction with updateMethod "none" in main process.
......
......@@ -2,8 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<script src="esl.js"></script>
<script src="config.js"></script>
<script src="../dist/echarts.js"></script>
<script src="lib/jquery.min.js"></script>
<script src="lib/facePrint.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
......@@ -26,7 +25,6 @@
}
</style>
<h2>cartesian category axis | xAxis: {min: 'dataMin', max: 'dataMax'}</h2>
<div class="chart" id="main1"></div>
<h2>cartesian category axis | xAxis: {min: undefined, max: undefined}</h2>
......@@ -78,47 +76,34 @@
<script>
function makeChart(id, option, noDataZoom) {
require([
'echarts',
'echarts/chart/line',
'echarts/chart/scatter',
'echarts/chart/parallel',
'echarts/component/polar',
'echarts/component/grid',
'echarts/component/legend',
'echarts/component/singleAxis',
'echarts/component/tooltip',
'echarts/component/dataZoom'
], function (echarts) {
var main = document.getElementById(id);
if (main) {
var chartMain = document.createElement('div');
chartMain.style.cssText = 'height:100%';
main.appendChild(chartMain);
var chart = echarts.init(chartMain);
chart.setOption(option);
if (!noDataZoom) {
var controller = document.createElement('div');
controller.style.cssText = 'position: absolute; right: 10px; top: 10px;';
main.appendChild(controller);
controller.innerHTML = [
'<button>Add DataZoom</button>',
'<button>Remove DataZoom</button>'
].join('');
var btns = $(controller).children();
$(btns[0]).on('click', function () {
option.dataZoom = [{type: 'inside'}, {type: 'slider'}];
chart.setOption(option, true);
});
$(btns[1]).on('click', function () {
delete option.dataZoom;
chart.setOption(option, true);
});
}
var main = document.getElementById(id);
if (main) {
var chartMain = document.createElement('div');
chartMain.style.cssText = 'height:100%';
main.appendChild(chartMain);
var chart = echarts.init(chartMain);
chart.setOption(option);
if (!noDataZoom) {
var controller = document.createElement('div');
controller.style.cssText = 'position: absolute; right: 10px; top: 10px;';
main.appendChild(controller);
controller.innerHTML = [
'<button>Add DataZoom</button>',
'<button>Remove DataZoom</button>'
].join('');
var btns = $(controller).children();
$(btns[0]).on('click', function () {
option.dataZoom = [{type: 'inside'}, {type: 'slider'}];
chart.setOption(option, true);
});
$(btns[1]).on('click', function () {
delete option.dataZoom;
chart.setOption(option, true);
});
}
});
}
}
</script>
......
......@@ -31,23 +31,23 @@
(testHelper.hasURLParam('en')
? [
'echarts',
'echarts/lang/en',
// 'echarts/lang/en',
]
: [
'echarts'
]
).concat(
[
'echarts/chart/bar',
'echarts/chart/line',
'echarts/component/legend',
'echarts/component/graphic',
'echarts/component/grid',
'echarts/component/tooltip',
'echarts/component/brush',
'echarts/component/toolbox',
'echarts/component/title',
'zrender/vml/vml'
// 'echarts/chart/bar',
// 'echarts/chart/line',
// 'echarts/component/legend',
// 'echarts/component/graphic',
// 'echarts/component/grid',
// 'echarts/component/tooltip',
// 'echarts/component/brush',
// 'echarts/component/toolbox',
// 'echarts/component/title',
// 'zrender/vml/vml'
]
),
function (echarts) {
......
......@@ -9,14 +9,19 @@ require.config({
packages: [
{
main: 'echarts',
location: '../src',
location: '../dist',
name: 'echarts'
},
{
main: 'zrender',
location: '../../zrender/src',
name: 'zrender'
}
// {
// main: 'echarts',
// location: '../src',
// name: 'echarts'
// },
// {
// main: 'zrender',
// location: '../../zrender/src',
// name: 'zrender'
// }
]
// urlArgs: '_v_=' + +new Date()
});
\ No newline at end of file
......@@ -2,7 +2,6 @@
basePath=$(cd `dirname $0`; pwd)
cd ${basePath}
rm -r dist
./node_modules/rollup/bin/rollup --config --watch
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册