Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
0984b093
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,发现更多精彩内容 >>
提交
0984b093
编写于
12月 02, 2019
作者:
S
SHUANG SU
提交者:
sushuang
12月 02, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: remove BrushController clamp if drag out of zrender area. And add test case for geo scatter.
上级
534ad9b5
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
149 addition
and
8 deletion
+149
-8
src/component/helper/BrushController.js
src/component/helper/BrushController.js
+6
-6
test/drag-out.html
test/drag-out.html
+141
-0
test/runTest/actions/__meta__.json
test/runTest/actions/__meta__.json
+1
-1
test/runTest/actions/drag-out.json
test/runTest/actions/drag-out.json
+1
-1
未找到文件。
src/component/helper/BrushController.js
浏览文件 @
0984b093
...
...
@@ -919,12 +919,12 @@ function handleDragEnd(controller, e) {
function
getLocalMouseXY
(
event
,
zr
)
{
var
x
=
event
.
offsetX
;
var
y
=
event
.
offsetY
;
var
w
=
zr
.
getWidth
();
var
h
=
zr
.
getHeight
();
x
<
0
&&
(
x
=
0
);
x
>
w
&&
(
x
=
w
);
y
<
0
&&
(
y
=
0
);
y
>
h
&&
(
y
=
h
);
//
var w = zr.getWidth();
//
var h = zr.getHeight();
//
x < 0 && (x = 0);
//
x > w && (x = w);
//
y < 0 && (y = 0);
//
y > h && (y = h);
return
[
x
,
y
];
}
...
...
test/drag-out.html
浏览文件 @
0984b093
...
...
@@ -76,6 +76,7 @@ under the License.
<div
id=
"main0"
></div>
</div>
<div
id=
"main1"
></div>
<div
id=
"main2"
></div>
...
...
@@ -222,6 +223,146 @@ under the License.
</script>
<script>
require
([
'
echarts
'
,
'
map/js/china
'
],
function
(
echarts
)
{
var
testGeoJson1
=
{
'
type
'
:
'
FeatureCollection
'
,
'
features
'
:
[
{
'
geometry
'
:
{
'
type
'
:
'
Polygon
'
,
'
coordinates
'
:
[
[
[
2000
,
3000
],
[
5000
,
3000
],
[
5000
,
8000
],
[
2000
,
8000
]
]
]
},
'
properties
'
:
{
'
name
'
:
'
Some Area
'
,
'
childNum
'
:
1
}
}
]
};
echarts
.
registerMap
(
'
test1
'
,
testGeoJson1
);
var
data
=
[];
var
step
=
200
;
var
lngStart
=
2000
;
var
latStart
=
4000
;
for
(
var
i
=
0
;
i
<
10
;
i
++
)
{
for
(
var
j
=
0
;
j
<
20
;
j
++
)
{
data
.
push
({
value
:
[
lngStart
+
j
*
step
,
latStart
+
i
*
step
],
symbolSize
:
5
+
j
*
2
});
}
}
var
option
=
{
geo
:
[{
map
:
'
test1
'
,
zoom
:
8
,
roam
:
true
}],
brush
:
{
geoIndex
:
0
},
series
:
[{
type
:
'
scatter
'
,
coordinateSystem
:
'
geo
'
,
symbol
:
'
roundRect
'
,
symbolSize
:
30
,
data
:
data
},
{
type
:
'
bar
'
,
data
:
[]
}],
xAxis
:
{},
yAxis
:
{},
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main2
'
,
{
title
:
[
'
brush out of the area, the points that out of the chart area should be selected.
'
,
],
option
:
option
,
width
:
350
,
height
:
260
});
if
(
!
chart
)
{
return
;
}
chart
.
on
(
'
brushselected
'
,
function
(
params
)
{
var
selectedDataIndices
=
fetchSelected
(
params
);
txtEl
.
style
.
text
=
'
selected data indices:
'
+
selectedDataIndices
.
join
(
'
,
'
);
txtEl
.
dirty
();
});
function
fetchSelected
(
params
)
{
var
selectedDataIndices
=
[];
for
(
var
i
=
0
;
i
<
params
.
batch
.
length
;
i
++
)
{
var
item
=
params
.
batch
[
i
];
var
selected
=
item
.
selected
;
for
(
var
j
=
0
;
j
<
selected
.
length
;
j
++
)
{
selectedDataIndices
=
selectedDataIndices
.
concat
(
selected
[
j
].
dataIndex
);
}
}
return
selectedDataIndices
;
}
var
txtEl
=
new
echarts
.
graphic
.
Text
({
style
:
{
x
:
10
,
y
:
10
,
color
:
'
blue
'
,
fontSize
:
9
},
z
:
9999
});
var
zr
=
chart
.
getZr
();
zr
.
add
(
txtEl
);
});
</script>
</body>
</html>
test/runTest/actions/__meta__.json
浏览文件 @
0984b093
...
...
@@ -68,7 +68,7 @@
"dataZoom-sync"
:
1
,
"dataZoom-toolbox"
:
6
,
"dataZoomHighPrecision"
:
3
,
"drag-out"
:
2
,
"drag-out"
:
3
,
"dynamic-splitNumber"
:
1
,
"ec-event"
:
4
,
"funnel"
:
2
,
...
...
test/runTest/actions/drag-out.json
浏览文件 @
0984b093
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录