Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
missman
incubator-echarts
提交
cb8cadec
I
incubator-echarts
项目概览
missman
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
cb8cadec
编写于
3月 17, 2020
作者:
1
100pah
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ts: enable Event check for Eventful
上级
765ded9b
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
12 addition
and
18 deletion
+12
-18
src/component/axisPointer/globalListener.ts
src/component/axisPointer/globalListener.ts
+1
-1
src/component/dataZoom/roams.ts
src/component/dataZoom/roams.ts
+3
-4
src/component/helper/RoamController.ts
src/component/helper/RoamController.ts
+2
-2
src/echarts.ts
src/echarts.ts
+6
-11
未找到文件。
src/component/axisPointer/globalListener.ts
浏览文件 @
cb8cadec
...
...
@@ -96,7 +96,7 @@ function initGlobalListeners(zr: ZRenderType, api?: ExtensionAPI) {
eventType
:
string
,
cb
:
(
record
:
Record
,
e
:
ZRElementEvent
,
dispatchAction
:
DispatchActionMethod
)
=>
void
)
{
zr
.
on
(
eventType
,
function
(
e
)
{
zr
.
on
(
eventType
,
function
(
e
:
ZRElementEvent
)
{
var
dis
=
makeDispatchAction
(
api
);
each
(
inner
(
zr
).
records
,
function
(
record
)
{
...
...
src/component/dataZoom/roams.ts
浏览文件 @
cb8cadec
...
...
@@ -27,7 +27,6 @@ import RoamController, { RoamType, RoamEventParams } from '../../component/helpe
import
*
as
throttleUtil
from
'
../../util/throttle
'
;
import
{
makeInner
}
from
'
../../util/model
'
;
import
{
Dictionary
,
ZRElementEvent
}
from
'
../../util/types
'
;
import
DataZoomModel
from
'
./DataZoomModel
'
;
import
ExtensionAPI
from
'
../../ExtensionAPI
'
;
import
InsideZoomModel
from
'
./InsideZoomModel
'
;
import
{
each
,
indexOf
,
curry
,
Curry1
}
from
'
zrender/src/core/util
'
;
...
...
@@ -44,7 +43,7 @@ interface DataZoomInfo {
zoom
:
(
controller
:
RoamController
,
e
:
RoamEventParams
[
'
zoom
'
])
=>
[
number
,
number
]
scrollMove
:
(
controller
:
RoamController
,
e
:
RoamEventParams
[
'
scrollMove
'
])
=>
[
number
,
number
]
}
dataZoomModel
:
Data
ZoomModel
dataZoomModel
:
Inside
ZoomModel
}
interface
Record
{
// key is dataZoomId
...
...
@@ -150,8 +149,8 @@ function createController(api: ExtensionAPI, newRecord: Record) {
return
;
}
var
method
=
(
info
.
getRange
||
{})[
eventName
];
var
range
=
method
&&
method
(
newRecord
.
controller
,
event
);
var
method
=
(
info
.
getRange
||
{}
as
DataZoomInfo
[
'
getRange
'
]
)[
eventName
];
var
range
=
method
&&
method
(
newRecord
.
controller
,
event
as
any
);
!
(
info
.
dataZoomModel
as
InsideZoomModel
).
get
(
'
disabled
'
,
true
)
&&
range
&&
batch
.
push
({
dataZoomId
:
info
.
dataZoomId
,
...
...
src/component/helper/RoamController.ts
浏览文件 @
cb8cadec
...
...
@@ -39,7 +39,7 @@ interface RoamOption {
preventDefaultMouseMove
?:
boolean
}
type
RoamEventType
=
'
zoom
'
|
'
scrollMove
'
|
'
pan
'
type
RoamEventType
=
keyof
RoamEventParams
;
type
RoamBehavior
=
'
zoomOnMouseWheel
'
|
'
moveOnMouseMove
'
|
'
moveOnMouseWheel
'
...
...
@@ -79,7 +79,7 @@ export interface RoamControllerHost {
}
}
class
RoamController
extends
Eventful
{
class
RoamController
extends
Eventful
<
RoamEventParams
>
{
pointerChecker
:
(
e
:
ZRElementEvent
,
x
:
number
,
y
:
number
)
=>
boolean
...
...
src/echarts.ts
浏览文件 @
cb8cadec
...
...
@@ -168,7 +168,7 @@ messageCenterProto.off = createRegisterEventWithLowercaseMessageCenter('off');
// messageCenterProto.one = createRegisterEventWithLowercaseMessageCenter('one');
class
ECharts
{
class
ECharts
extends
Eventful
{
/**
* @readonly
...
...
@@ -210,7 +210,7 @@ class ECharts {
// Can't dispatch action during rendering procedure
private
_pendingActions
:
Payload
[]
=
[];
pr
ivate
_ecE
ventProcessor
:
ECEventProcessor
;
pr
otected
_$e
ventProcessor
:
ECEventProcessor
;
private
_disposed
:
boolean
;
...
...
@@ -232,6 +232,8 @@ class ECharts {
height
?:
number
}
)
{
super
(
new
ECEventProcessor
());
opts
=
opts
||
{};
// Get theme by name
...
...
@@ -276,9 +278,6 @@ class ECharts {
this
.
_scheduler
=
new
Scheduler
(
this
,
api
,
dataProcessorFuncs
,
visualFuncs
);
this
.
_ecEventProcessor
=
new
ECEventProcessor
();
Eventful
.
call
(
this
,
this
.
_ecEventProcessor
);
this
.
_messageCenter
=
new
MessageCenter
();
// Init mouse events
...
...
@@ -825,7 +824,7 @@ class ECharts {
params
.
event
=
e
;
params
.
type
=
eveName
;
this
.
_
ecE
ventProcessor
.
eventInfo
=
{
this
.
_
$e
ventProcessor
.
eventInfo
=
{
targetEl
:
el
,
packedEvent
:
params
,
model
:
model
,
...
...
@@ -1741,7 +1740,7 @@ class ECharts {
}
each
(
eventActionMap
,
function
(
actionType
,
eventType
)
{
chart
.
_messageCenter
.
on
(
eventType
,
function
(
event
)
{
chart
.
_messageCenter
.
on
(
eventType
,
function
(
event
:
ECEvent
)
{
if
(
connectedGroups
[
chart
.
group
]
&&
chart
[
CONNECT_STATUS_KEY
]
!==
CONNECT_STATUS_PENDING
)
{
if
(
event
&&
event
.
escapeConnect
)
{
return
;
...
...
@@ -1815,10 +1814,6 @@ var createExtensionAPI: (ecIns: ECharts) => ExtensionAPI;
var
enableConnect
:
(
chart
:
ECharts
)
=>
void
;
interface
ECharts
extends
Eventful
{}
zrUtil
.
mixin
(
ECharts
,
Eventful
);
var
echartsProto
=
ECharts
.
prototype
;
echartsProto
.
on
=
createRegisterEventWithLowercaseECharts
(
'
on
'
);
echartsProto
.
off
=
createRegisterEventWithLowercaseECharts
(
'
off
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录