Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
8fd367cb
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8fd367cb
编写于
1月 12, 2018
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix graph in cartesian.
上级
361b7694
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
34 addition
and
24 deletion
+34
-24
src/chart/graph/simpleLayout.js
src/chart/graph/simpleLayout.js
+14
-11
src/chart/helper/createGraphFromNodeEdge.js
src/chart/helper/createGraphFromNodeEdge.js
+1
-1
src/chart/helper/createListFromArray.js
src/chart/helper/createListFromArray.js
+6
-1
src/data/List.js
src/data/List.js
+1
-1
src/data/helper/linkList.js
src/data/helper/linkList.js
+7
-7
src/model/Component.js
src/model/Component.js
+1
-1
src/stream/Scheduler.js
src/stream/Scheduler.js
+3
-1
src/util/component.js
src/util/component.js
+1
-1
未找到文件。
src/chart/graph/simpleLayout.js
浏览文件 @
8fd367cb
import
{
each
}
from
'
zrender/src/core/util
'
;
import
{
simpleLayout
,
simpleLayoutEdge
}
from
'
./simpleLayoutHelper
'
;
import
{
simpleLayout
,
simpleLayoutEdge
}
from
'
./simpleLayoutHelper
'
;
export
default
function
(
ecModel
,
api
)
{
export
default
function
(
ecModel
,
api
)
{
...
@@ -6,28 +7,30 @@ export default function (ecModel, api) {
...
@@ -6,28 +7,30 @@ export default function (ecModel, api) {
var
coordSys
=
seriesModel
.
coordinateSystem
;
var
coordSys
=
seriesModel
.
coordinateSystem
;
if
(
coordSys
&&
coordSys
.
type
!==
'
view
'
)
{
if
(
coordSys
&&
coordSys
.
type
!==
'
view
'
)
{
var
data
=
seriesModel
.
getData
();
var
data
=
seriesModel
.
getData
();
var
dimensions
=
coordSys
.
dimensions
;
data
.
each
(
dimensions
,
function
()
{
var
dimensions
=
[];
var
hasValue
;
each
(
coordSys
.
dimensions
,
function
(
coordDim
)
{
var
args
=
arguments
;
dimensions
=
dimensions
.
concat
(
data
.
mapDimension
(
coordDim
,
true
));
});
for
(
var
dataIndex
=
0
;
dataIndex
<
data
.
count
();
dataIndex
++
)
{
var
value
=
[];
var
value
=
[];
var
hasValue
=
false
;
for
(
var
i
=
0
;
i
<
dimensions
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
dimensions
.
length
;
i
++
)
{
if
(
!
isNaN
(
args
[
i
]))
{
var
val
=
data
.
get
(
dimensions
[
i
],
dataIndex
);
if
(
!
isNaN
(
val
))
{
hasValue
=
true
;
hasValue
=
true
;
}
}
value
.
push
(
args
[
i
]
);
value
.
push
(
val
);
}
}
var
idx
=
args
[
args
.
length
-
1
];
if
(
hasValue
)
{
if
(
hasValue
)
{
data
.
setItemLayout
(
id
x
,
coordSys
.
dataToPoint
(
value
));
data
.
setItemLayout
(
dataInde
x
,
coordSys
.
dataToPoint
(
value
));
}
}
else
{
else
{
// Also {Array.<number>}, not undefined to avoid if...else... statement
// Also {Array.<number>}, not undefined to avoid if...else... statement
data
.
setItemLayout
(
id
x
,
[
NaN
,
NaN
]);
data
.
setItemLayout
(
dataInde
x
,
[
NaN
,
NaN
]);
}
}
}
);
}
simpleLayoutEdge
(
data
.
graph
);
simpleLayoutEdge
(
data
.
graph
);
}
}
...
...
src/chart/helper/createGraphFromNodeEdge.js
浏览文件 @
8fd367cb
...
@@ -35,7 +35,7 @@ export default function (nodes, edges, seriesModel, directed, beforeLink) {
...
@@ -35,7 +35,7 @@ export default function (nodes, edges, seriesModel, directed, beforeLink) {
var
coordSys
=
seriesModel
.
get
(
'
coordinateSystem
'
);
var
coordSys
=
seriesModel
.
get
(
'
coordinateSystem
'
);
var
nodeData
;
var
nodeData
;
if
(
coordSys
===
'
cartesian2d
'
||
coordSys
===
'
polar
'
)
{
if
(
coordSys
===
'
cartesian2d
'
||
coordSys
===
'
polar
'
)
{
nodeData
=
createListFromArray
(
{
data
:
nodes
}
,
seriesModel
);
nodeData
=
createListFromArray
(
nodes
,
seriesModel
);
}
}
else
{
else
{
// FIXME
// FIXME
...
...
src/chart/helper/createListFromArray.js
浏览文件 @
8fd367cb
...
@@ -6,12 +6,17 @@ import {getDimensionTypeByAxis} from '../../data/helper/dimensionHelper';
...
@@ -6,12 +6,17 @@ import {getDimensionTypeByAxis} from '../../data/helper/dimensionHelper';
import
{
getDataItemValue
}
from
'
../../util/model
'
;
import
{
getDataItemValue
}
from
'
../../util/model
'
;
import
CoordinateSystem
from
'
../../CoordinateSystem
'
;
import
CoordinateSystem
from
'
../../CoordinateSystem
'
;
import
{
getCoordSysDefineBySeries
}
from
'
../../model/referHelper
'
;
import
{
getCoordSysDefineBySeries
}
from
'
../../model/referHelper
'
;
import
Source
from
'
../../data/Source
'
;
/**
/**
* @param {module:echarts/data/Source
} source
* @param {module:echarts/data/Source
|Array} source Or raw data.
* @param {module:echarts/model/Series} seriesModel
* @param {module:echarts/model/Series} seriesModel
*/
*/
function
createListFromArray
(
source
,
seriesModel
)
{
function
createListFromArray
(
source
,
seriesModel
)
{
if
(
!
Source
.
isInstance
(
source
))
{
source
=
Source
.
seriesDataToSource
(
source
);
}
var
coordSysName
=
seriesModel
.
get
(
'
coordinateSystem
'
);
var
coordSysName
=
seriesModel
.
get
(
'
coordinateSystem
'
);
var
registeredCoordSys
=
CoordinateSystem
.
get
(
coordSysName
);
var
registeredCoordSys
=
CoordinateSystem
.
get
(
coordSysName
);
...
...
src/data/List.js
浏览文件 @
8fd367cb
...
@@ -1651,6 +1651,6 @@ listProto.wrapMethod = function (methodName, injectFunction) {
...
@@ -1651,6 +1651,6 @@ listProto.wrapMethod = function (methodName, injectFunction) {
// Notice that those method should `RETURN` the new list.
// Notice that those method should `RETURN` the new list.
listProto
.
TRANSFERABLE_METHODS
=
[
'
cloneShallow
'
,
'
downSample
'
,
'
map
'
];
listProto
.
TRANSFERABLE_METHODS
=
[
'
cloneShallow
'
,
'
downSample
'
,
'
map
'
];
// Methods that change indices of this list should be listed here.
// Methods that change indices of this list should be listed here.
// listProto.CHANGABLE_METHODS = ['filterSelf
'];
listProto
.
CHANGABLE_METHODS
=
[
'
filterSelf
'
,
'
selectRange
'
];
export
default
List
;
export
default
List
;
src/data/helper/linkList.js
浏览文件 @
8fd367cb
...
@@ -52,9 +52,9 @@ function linkList(opt) {
...
@@ -52,9 +52,9 @@ function linkList(opt) {
// Only mainData trigger change, because struct.update may trigger
// Only mainData trigger change, because struct.update may trigger
// another changable methods, which may bring about dead lock.
// another changable methods, which may bring about dead lock.
//
each(mainData.CHANGABLE_METHODS, function (methodName) {
each
(
mainData
.
CHANGABLE_METHODS
,
function
(
methodName
)
{
//
mainData.wrapMethod(methodName, zrUtil.curry(changeInjection, opt));
mainData
.
wrapMethod
(
methodName
,
zrUtil
.
curry
(
changeInjection
,
opt
));
//
});
});
// Make sure datas contains mainData.
// Make sure datas contains mainData.
zrUtil
.
assert
(
datas
[
mainData
.
dataType
]
===
mainData
);
zrUtil
.
assert
(
datas
[
mainData
.
dataType
]
===
mainData
);
...
@@ -74,10 +74,10 @@ function transferInjection(opt, res) {
...
@@ -74,10 +74,10 @@ function transferInjection(opt, res) {
return
res
;
return
res
;
}
}
//
function changeInjection(opt, res) {
function
changeInjection
(
opt
,
res
)
{
//
opt.struct && opt.struct.update(this);
opt
.
struct
&&
opt
.
struct
.
update
(
this
);
//
return res;
return
res
;
//
}
}
function
cloneShallowInjection
(
opt
,
res
)
{
function
cloneShallowInjection
(
opt
,
res
)
{
// cloneShallow, which brings about some fragilities, may be inappropriate
// cloneShallow, which brings about some fragilities, may be inappropriate
...
...
src/model/Component.js
浏览文件 @
8fd367cb
...
@@ -97,7 +97,7 @@ var ComponentModel = Model.extend({
...
@@ -97,7 +97,7 @@ var ComponentModel = Model.extend({
$constructor
:
function
(
option
,
parentModel
,
ecModel
,
extraOpt
)
{
$constructor
:
function
(
option
,
parentModel
,
ecModel
,
extraOpt
)
{
Model
.
call
(
this
,
option
,
parentModel
,
ecModel
,
extraOpt
);
Model
.
call
(
this
,
option
,
parentModel
,
ecModel
,
extraOpt
);
this
.
uid
=
componentUtil
.
getUID
(
'
componentM
odel
'
);
this
.
uid
=
componentUtil
.
getUID
(
'
ec_cpt_m
odel
'
);
},
},
init
:
function
(
option
,
parentModel
,
ecModel
,
extraOpt
)
{
init
:
function
(
option
,
parentModel
,
ecModel
,
extraOpt
)
{
...
...
src/stream/Scheduler.js
浏览文件 @
8fd367cb
...
@@ -163,7 +163,9 @@ function performStageTasks(scheduler, stageHandlers, ecModel, payload, opt) {
...
@@ -163,7 +163,9 @@ function performStageTasks(scheduler, stageHandlers, ecModel, payload, opt) {
updatePayload
(
overallTask
,
payload
);
updatePayload
(
overallTask
,
payload
);
var
performArgs
=
scheduler
.
getPerformArgs
(
overallTask
,
opt
.
block
);
var
performArgs
=
scheduler
.
getPerformArgs
(
overallTask
,
opt
.
block
);
// Execute stubs firstly, which may set the overall task dirty,
// Execute stubs firstly, which may set the overall task dirty,
// then execute the overall task.
// then execute the overall task. And stub will call seriesModel.setData,
// which ensures that in the overallTask seriesModel.getData() will not
// return incorrect data.
ecModel
.
eachRawSeries
(
function
(
seriesModel
)
{
ecModel
.
eachRawSeries
(
function
(
seriesModel
)
{
var
task
=
agentStubMap
.
get
(
seriesModel
.
uid
);
var
task
=
agentStubMap
.
get
(
seriesModel
.
uid
);
task
&&
task
.
perform
(
performArgs
);
task
&&
task
.
perform
(
performArgs
);
...
...
src/util/component.js
浏览文件 @
8fd367cb
...
@@ -11,7 +11,7 @@ var base = 0;
...
@@ -11,7 +11,7 @@ var base = 0;
export
function
getUID
(
type
)
{
export
function
getUID
(
type
)
{
// Considering the case of crossing js context,
// Considering the case of crossing js context,
// use Math.random to make id as unique as possible.
// use Math.random to make id as unique as possible.
return
[(
type
||
''
),
base
++
,
Math
.
random
()].
join
(
'
_
'
);
return
[(
type
||
''
),
base
++
,
Math
.
random
()
.
toFixed
(
5
)
].
join
(
'
_
'
);
}
}
/**
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录