Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
05ed207e
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,发现更多精彩内容 >>
提交
05ed207e
编写于
4月 06, 2021
作者:
P
pissang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(z): use z2 to represent overlay in treemap
上级
17b2ba0e
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
24 addition
and
21 deletion
+24
-21
src/chart/line/LineView.ts
src/chart/line/LineView.ts
+1
-1
src/chart/treemap/TreemapView.ts
src/chart/treemap/TreemapView.ts
+12
-11
src/core/echarts.ts
src/core/echarts.ts
+11
-9
未找到文件。
src/chart/line/LineView.ts
浏览文件 @
05ed207e
...
...
@@ -843,7 +843,7 @@ class LineView extends ChartView {
// ensure label text of the temporal symbol is on the top of line and area polygon
const
symbolLabel
=
symbol
.
getSymbolPath
().
getTextContent
();
symbolLabel
&&
(
symbolLabel
.
z
=
this
.
_polyline
.
z
+
1
);
symbolLabel
&&
(
symbolLabel
.
z
2
=
this
.
_polyline
.
z2
+
1
);
(
symbol
as
SymbolExtended
).
__temp
=
true
;
data
.
setItemGraphicEl
(
dataIndex
,
symbol
);
...
...
src/chart/treemap/TreemapView.ts
浏览文件 @
05ed207e
...
...
@@ -17,14 +17,15 @@
* under the License.
*/
import
{
bind
,
each
,
indexOf
,
curry
,
extend
,
retrieve
,
normalizeCssArray
,
isFunction
}
from
'
zrender/src/core/util
'
;
import
{
bind
,
each
,
indexOf
,
curry
,
extend
,
normalizeCssArray
,
isFunction
}
from
'
zrender/src/core/util
'
;
import
*
as
graphic
from
'
../../util/graphic
'
;
import
{
getECData
}
from
'
../../util/innerStore
'
;
import
{
isHighDownDispatcher
,
setAsHighDownDispatcher
,
setDefaultStateProxy
,
enableHoverFocus
enableHoverFocus
,
Z2_EMPHASIS_LIFT
}
from
'
../../util/states
'
;
import
DataDiffer
from
'
../../data/DataDiffer
'
;
import
*
as
helper
from
'
../helper/treeHelper
'
;
...
...
@@ -64,9 +65,10 @@ const Rect = graphic.Rect;
const
DRAG_THRESHOLD
=
3
;
const
PATH_LABEL_NOAMAL
=
'
label
'
;
const
PATH_UPPERLABEL_NORMAL
=
'
upperLabel
'
;
const
Z_BASE
=
10
;
// Should bigger than every z.
const
Z_BG
=
1
;
const
Z_CONTENT
=
2
;
// Should larger than emphasis states lift z
const
Z2_BASE
=
Z2_EMPHASIS_LIFT
*
10
;
// Should bigger than every z2.
const
Z2_BG
=
Z2_EMPHASIS_LIFT
*
2
;
const
Z2_CONTENT
=
Z2_EMPHASIS_LIFT
*
3
;
const
getStateItemStyle
=
makeStyleMapper
([
[
'
fill
'
,
'
color
'
],
...
...
@@ -797,7 +799,7 @@ function renderNode(
}
// Background
const
bg
=
giveGraphic
(
'
background
'
,
Rect
,
depth
,
Z_BG
);
const
bg
=
giveGraphic
(
'
background
'
,
Rect
,
depth
,
Z
2
_BG
);
bg
&&
renderBackground
(
group
,
bg
,
isParent
&&
thisLayout
.
upperLabelHeight
);
const
focus
=
nodeModel
.
get
([
'
emphasis
'
,
'
focus
'
]);
...
...
@@ -824,7 +826,7 @@ function renderNode(
}
}
else
{
const
content
=
giveGraphic
(
'
content
'
,
Rect
,
depth
,
Z_CONTENT
);
const
content
=
giveGraphic
(
'
content
'
,
Rect
,
depth
,
Z
2
_CONTENT
);
content
&&
renderContent
(
group
,
content
);
if
(
bg
&&
isHighDownDispatcher
(
bg
))
{
...
...
@@ -1034,7 +1036,7 @@ function renderNode(
else
if
(
!
thisInvisible
)
{
element
=
new
Ctor
();
if
(
element
instanceof
Displayable
)
{
element
.
z
=
calculateZ
(
depth
,
z
);
element
.
z
2
=
calculateZ2
(
depth
,
z
);
}
prepareAnimationWhenNoOld
(
lasts
,
element
);
}
...
...
@@ -1096,9 +1098,8 @@ function renderNode(
// upper ones. So we calculate z based on depth.
// Moreover, we try to shrink down z interval to [0, 1] to avoid that
// treemap with large z overlaps other components.
function
calculateZ
(
depth
:
number
,
zInLevel
:
number
)
{
const
zb
=
depth
*
Z_BASE
+
zInLevel
;
return
(
zb
-
1
)
/
zb
;
function
calculateZ2
(
depth
:
number
,
z2InLevel
:
number
)
{
return
depth
*
Z2_BASE
+
z2InLevel
;
}
export
default
TreemapView
;
\ No newline at end of file
src/core/echarts.ts
浏览文件 @
05ed207e
...
...
@@ -2158,7 +2158,12 @@ class ECharts extends Eventful<ECEventDefinition> {
return
;
}
// Set z and zlevel
_updateZ
(
view
.
group
,
model
.
get
(
'
z
'
),
model
.
get
(
'
zlevel
'
),
-
Infinity
);
_updateZ
(
view
.
group
,
model
.
get
(
'
z
'
)
||
0
,
model
.
get
(
'
zlevel
'
)
||
0
,
-
Infinity
);
};
function
_updateZ
(
el
:
Element
,
z
:
number
,
zlevel
:
number
,
maxZ2
:
number
):
number
{
...
...
@@ -2177,8 +2182,8 @@ class ECharts extends Eventful<ECEventDefinition> {
}
else
{
// not Group
z
!=
null
&&
((
el
as
Displayable
).
z
=
z
)
;
zlevel
!=
null
&&
((
el
as
Displayable
).
zlevel
=
zlevel
)
;
(
el
as
Displayable
).
z
=
z
;
(
el
as
Displayable
).
zlevel
=
zlevel
;
maxZ2
=
Math
.
max
((
el
as
Displayable
).
z2
,
maxZ2
);
}
...
...
@@ -2189,17 +2194,14 @@ class ECharts extends Eventful<ECEventDefinition> {
label
.
zlevel
=
zlevel
;
// lift z2 of text content
// TODO if el.emphasis.z2 is spcefied, what about textContent.
if
(
isFinite
(
maxZ2
))
{
label
.
z2
=
maxZ2
+
2
;
}
isFinite
(
maxZ2
)
&&
(
label
.
z2
=
maxZ2
+
2
);
}
if
(
labelLine
)
{
const
textGuideLineConfig
=
el
.
textGuideLineConfig
;
labelLine
.
z
=
z
;
labelLine
.
zlevel
=
zlevel
;
if
(
isFinite
(
maxZ2
))
{
labelLine
.
z2
=
maxZ2
+
((
textGuideLineConfig
&&
textGuideLineConfig
.
showAbove
)
?
1
:
-
1
);
}
isFinite
(
maxZ2
)
&&
(
labelLine
.
z2
=
maxZ2
+
(
textGuideLineConfig
&&
textGuideLineConfig
.
showAbove
?
1
:
-
1
));
}
return
maxZ2
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录