Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
0e7adc32
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,发现更多精彩内容 >>
提交
0e7adc32
编写于
3月 19, 2020
作者:
P
pissang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ts: bug squash
上级
469259df
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
28 addition
and
31 deletion
+28
-31
src/chart/gauge/GaugeView.ts
src/chart/gauge/GaugeView.ts
+2
-2
src/chart/graph/GraphView.ts
src/chart/graph/GraphView.ts
+1
-1
src/chart/helper/LargeLineDraw.ts
src/chart/helper/LargeLineDraw.ts
+4
-5
src/chart/helper/LargeSymbolDraw.ts
src/chart/helper/LargeSymbolDraw.ts
+4
-6
src/chart/helper/Line.ts
src/chart/helper/Line.ts
+2
-2
src/chart/helper/Symbol.ts
src/chart/helper/Symbol.ts
+1
-3
src/chart/pie/PieView.ts
src/chart/pie/PieView.ts
+3
-7
src/chart/radar/RadarView.ts
src/chart/radar/RadarView.ts
+1
-1
src/component/legend/ScrollableLegendView.ts
src/component/legend/ScrollableLegendView.ts
+4
-1
src/coord/polar/AngleAxis.ts
src/coord/polar/AngleAxis.ts
+4
-1
src/preprocessor/helper/compatStyle.ts
src/preprocessor/helper/compatStyle.ts
+1
-1
test/radar4.html
test/radar4.html
+1
-1
未找到文件。
src/chart/gauge/GaugeView.ts
浏览文件 @
0e7adc32
...
...
@@ -50,10 +50,10 @@ function parsePosition(seriesModel: GaugeSeriesModel, api: ExtensionAPI): PosInf
}
function
formatLabel
(
value
:
number
,
labelFormatter
:
string
|
((
value
:
number
)
=>
string
)):
string
{
let
label
=
value
+
''
;
let
label
=
value
==
null
?
''
:
(
value
+
''
)
;
if
(
labelFormatter
)
{
if
(
typeof
labelFormatter
===
'
string
'
)
{
label
=
labelFormatter
.
replace
(
'
{value}
'
,
value
!=
null
?
value
+
''
:
''
);
label
=
labelFormatter
.
replace
(
'
{value}
'
,
label
);
}
else
if
(
typeof
labelFormatter
===
'
function
'
)
{
label
=
labelFormatter
(
value
);
...
...
src/chart/graph/GraphView.ts
浏览文件 @
0e7adc32
...
...
@@ -217,7 +217,7 @@ class GraphView extends ChartView {
api
.
dispatchAction
({
type
:
'
focusNodeAdjacency
'
,
seriesId
:
seriesModel
.
id
,
dataIndex
:
el
.
dataIndex
dataIndex
:
graphic
.
getECData
(
el
)
.
dataIndex
});
});
el
.
on
(
'
mouseout
'
,
(
el
as
any
)[
UNFOCUS_ADJACENCY
]
=
function
()
{
...
...
src/chart/helper/LargeLineDraw.ts
浏览文件 @
0e7adc32
...
...
@@ -55,8 +55,6 @@ type LargeLinesData = List<Model<LargeLinesCommonOption> & {
class
LargeLinesPath
extends
graphic
.
Path
{
shape
:
LargeLinesPathShape
seriesIndex
:
number
dataIndex
:
number
__startIndex
:
number
constructor
(
opts
?:
LargeLinesPathProps
)
{
...
...
@@ -262,15 +260,16 @@ class LargeLineDraw {
lineEl
.
setStyle
(
'
fill
'
);
if
(
!
isIncremental
)
{
let
ecData
=
graphic
.
getECData
(
lineEl
);
// Enable tooltip
// PENDING May have performance issue when path is extremely large
lineEl
.
seriesIndex
=
hostModel
.
seriesIndex
;
ecData
.
seriesIndex
=
hostModel
.
seriesIndex
;
lineEl
.
on
(
'
mousemove
'
,
function
(
e
)
{
lineEl
.
dataIndex
=
null
;
ecData
.
dataIndex
=
null
;
var
dataIndex
=
lineEl
.
findDataIndex
(
e
.
offsetX
,
e
.
offsetY
);
if
(
dataIndex
>
0
)
{
// Provide dataIndex for tooltip
lineEl
.
dataIndex
=
dataIndex
+
lineEl
.
__startIndex
;
ecData
.
dataIndex
=
dataIndex
+
lineEl
.
__startIndex
;
}
});
}
...
...
src/chart/helper/LargeSymbolDraw.ts
浏览文件 @
0e7adc32
...
...
@@ -57,9 +57,6 @@ class LargeSymbolPath extends graphic.Path<LargeSymbolPathProps> {
startIndex
:
number
endIndex
:
number
dataIndex
:
number
seriesIndex
:
number
constructor
(
opts
?:
LargeSymbolPathProps
)
{
super
(
opts
,
null
,
new
LargeSymbolPathShape
());
}
...
...
@@ -296,15 +293,16 @@ class LargeSymbolDraw {
}
if
(
!
isIncremental
)
{
let
ecData
=
graphic
.
getECData
(
symbolEl
);
// Enable tooltip
// PENDING May have performance issue when path is extremely large
symbolEl
.
seriesIndex
=
(
hostModel
as
SeriesModel
).
seriesIndex
;
ecData
.
seriesIndex
=
(
hostModel
as
SeriesModel
).
seriesIndex
;
symbolEl
.
on
(
'
mousemove
'
,
function
(
e
)
{
symbolEl
.
dataIndex
=
null
;
ecData
.
dataIndex
=
null
;
var
dataIndex
=
symbolEl
.
findDataIndex
(
e
.
offsetX
,
e
.
offsetY
);
if
(
dataIndex
>=
0
)
{
// Provide dataIndex for tooltip
symbolEl
.
dataIndex
=
dataIndex
+
(
symbolEl
.
startIndex
||
0
);
ecData
.
dataIndex
=
dataIndex
+
(
symbolEl
.
startIndex
||
0
);
}
});
}
...
...
src/chart/helper/Line.ts
浏览文件 @
0e7adc32
...
...
@@ -262,7 +262,7 @@ class Line extends graphic.Group {
// values have to be set on `normalStyle`.
if
(
normalText
!=
null
||
emphasisText
!=
null
)
{
graphic
.
setTextStyle
(
label
.
style
,
labelModel
,
{
text
:
normalText
+
''
text
:
normalText
as
string
},
{
autoColor
:
defaultLabelColor
});
...
...
@@ -282,7 +282,7 @@ class Line extends graphic.Group {
if
(
emphasisText
!=
null
)
{
// Only these properties supported in this emphasis style here.
label
.
hoverStyle
=
{
text
:
emphasisText
+
''
,
text
:
emphasisText
as
string
,
textFill
:
hoverLabelModel
.
getTextColor
(
true
),
// For merging hover style to normal style, do not use
// `hoverLabelModel.getFont()` here.
...
...
src/chart/helper/Symbol.ts
浏览文件 @
0e7adc32
...
...
@@ -42,8 +42,6 @@ type ECSymbol = ReturnType<typeof createSymbol> & {
class
Symbol
extends
graphic
.
Group
{
dataIndex
:
number
private
_seriesModel
:
SeriesModel
private
_symbolType
:
string
...
...
@@ -329,7 +327,7 @@ class Symbol extends graphic.Group {
scale
:
[
0
,
0
]
},
this
.
_seriesModel
,
this
.
dataIndex
,
graphic
.
getECData
(
this
)
.
dataIndex
,
cb
);
}
...
...
src/chart/pie/PieView.ts
浏览文件 @
0e7adc32
...
...
@@ -24,7 +24,7 @@ import * as graphic from '../../util/graphic';
import
ChartView
from
'
../../view/Chart
'
;
import
GlobalModel
from
'
../../model/Global
'
;
import
ExtensionAPI
from
'
../../ExtensionAPI
'
;
import
{
Payload
,
DisplayState
}
from
'
../../util/types
'
;
import
{
Payload
,
DisplayState
,
ECElement
}
from
'
../../util/types
'
;
import
List
from
'
../../data/List
'
;
import
PieSeriesModel
,
{
PieDataItemOption
}
from
'
./PieSeries
'
;
import
{
Dictionary
}
from
'
zrender/src/core/types
'
;
...
...
@@ -39,7 +39,7 @@ function updateDataSelected(
api
:
ExtensionAPI
):
void
{
var
data
=
seriesModel
.
getData
();
var
dataIndex
=
this
.
dataIndex
;
var
dataIndex
=
graphic
.
getECData
(
this
)
.
dataIndex
;
var
name
=
data
.
getName
(
dataIndex
);
var
selectedOffset
=
seriesModel
.
get
(
'
selectedOffset
'
);
...
...
@@ -96,10 +96,6 @@ interface PieceElementExtension extends Displayable {
*/
class
PiePiece
extends
graphic
.
Group
{
// FIXME:TS add a type in `util/graphic.ts` for `highDownOnUpdate`.
highDownOnUpdate
:
any
;
dataIndex
:
number
;
constructor
(
data
:
List
,
idx
:
number
)
{
super
();
...
...
@@ -197,7 +193,7 @@ class PiePiece extends graphic.Group {
var
withAnimation
=
!
firstCreate
&&
animationTypeUpdate
===
'
transition
'
;
this
.
_updateLabel
(
data
,
idx
,
withAnimation
);
this
.
highDownOnUpdate
=
(
itemModel
.
get
(
'
hoverAnimation
'
)
&&
seriesModel
.
isAnimationEnabled
())
(
this
as
ECElement
)
.
highDownOnUpdate
=
(
itemModel
.
get
(
'
hoverAnimation
'
)
&&
seriesModel
.
isAnimationEnabled
())
?
function
(
fromState
:
DisplayState
,
toState
:
DisplayState
):
void
{
if
(
toState
===
'
emphasis
'
)
{
labelLine
.
ignore
=
labelLine
.
hoverIgnore
;
...
...
src/chart/radar/RadarView.ts
浏览文件 @
0e7adc32
...
...
@@ -228,7 +228,7 @@ class RadarView extends ChartView {
labelFetcher
:
data
.
hostModel
,
labelDataIndex
:
idx
,
labelDimIndex
:
symbolPath
.
__dimIdx
,
defaultText
:
defaultText
+
''
,
defaultText
:
defaultText
as
string
,
autoColor
:
color
,
isRectText
:
true
}
...
...
src/component/legend/ScrollableLegendView.ts
浏览文件 @
0e7adc32
...
...
@@ -136,6 +136,8 @@ class ScrollableLegendView extends LegendView {
controllerGroup
.
add
(
new
graphic
.
Text
({
name
:
'
pageText
'
,
style
:
{
// Placeholder to calculate a proper layout.
text
:
'
xx/xx
'
,
textFill
:
pageTextStyleModel
.
getTextColor
(),
font
:
pageTextStyleModel
.
getFont
(),
textVerticalAlign
:
'
middle
'
,
...
...
@@ -386,7 +388,8 @@ class ScrollableLegendView extends LegendView {
pageText
&&
pageFormatter
&&
pageText
.
setStyle
(
'
text
'
,
zrUtil
.
isString
(
pageFormatter
)
?
pageFormatter
.
replace
(
'
{current}
'
,
current
+
''
).
replace
(
'
{total}
'
,
total
+
''
)
?
pageFormatter
.
replace
(
'
{current}
'
,
current
==
null
?
''
:
current
+
''
)
.
replace
(
'
{total}
'
,
total
==
null
?
''
:
total
+
''
)
:
pageFormatter
({
current
:
current
,
total
:
total
})
);
}
...
...
src/coord/polar/AngleAxis.ts
浏览文件 @
0e7adc32
...
...
@@ -77,7 +77,10 @@ class AngleAxis extends Axis {
// Not precise, just use height as text width
// and each distance from axis line yet.
var
rect
=
textContain
.
getBoundingRect
(
tickValue
+
''
,
labelModel
.
getFont
(),
'
center
'
,
'
top
'
tickValue
==
null
?
''
:
tickValue
+
''
,
labelModel
.
getFont
(),
'
center
'
,
'
top
'
);
var
maxH
=
Math
.
max
(
rect
.
height
,
7
);
...
...
src/preprocessor/helper/compatStyle.ts
浏览文件 @
0e7adc32
...
...
@@ -292,7 +292,7 @@ export default function (option: any, isTheme?: boolean) {
each
(
toArr
(
option
.
radar
),
function
(
radarOpt
)
{
compatTextStyle
(
radarOpt
,
'
name
'
);
// Use axisName instead of name because component has name property
if
(
radarOpt
.
name
&&
!
radarOpt
.
axisName
)
{
if
(
radarOpt
.
name
&&
radarOpt
.
axisName
==
null
)
{
radarOpt
.
axisName
=
radarOpt
.
name
;
delete
radarOpt
.
name
;
if
(
__DEV__
)
{
...
...
test/radar4.html
浏览文件 @
0e7adc32
...
...
@@ -52,7 +52,7 @@ under the License.
x
:
'
left
'
,
data
:[
'
图一
'
,
'
图二
'
,
'
图三
'
]
},
pol
ar
:
[
rad
ar
:
[
{
indicator
:
[
{
text
:
'
指标一
'
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录