Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
z1593
incubator-echarts
提交
8abf36c2
I
incubator-echarts
项目概览
z1593
/
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,发现更多精彩内容 >>
未验证
提交
8abf36c2
编写于
3月 31, 2023
作者:
C
cvSoldier
提交者:
GitHub
3月 31, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(lines): symbolSize should be updated #18350
上级
6dbe25ca
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
127 addition
and
2 deletion
+127
-2
src/chart/helper/Line.ts
src/chart/helper/Line.ts
+18
-2
test/lines-symbolSize-update.html
test/lines-symbolSize-update.html
+107
-0
test/runTest/actions/__meta__.json
test/runTest/actions/__meta__.json
+1
-0
test/runTest/actions/lines-symbolSize-update.json
test/runTest/actions/lines-symbolSize-update.json
+1
-0
未找到文件。
src/chart/helper/Line.ts
浏览文件 @
8abf36c2
...
@@ -64,6 +64,22 @@ interface InnerLineLabel extends LineLabel {
...
@@ -64,6 +64,22 @@ interface InnerLineLabel extends LineLabel {
function
makeSymbolTypeKey
(
symbolCategory
:
'
fromSymbol
'
|
'
toSymbol
'
)
{
function
makeSymbolTypeKey
(
symbolCategory
:
'
fromSymbol
'
|
'
toSymbol
'
)
{
return
'
_
'
+
symbolCategory
+
'
Type
'
as
'
_fromSymbolType
'
|
'
_toSymbolType
'
;
return
'
_
'
+
symbolCategory
+
'
Type
'
as
'
_fromSymbolType
'
|
'
_toSymbolType
'
;
}
}
function
makeSymbolTypeValue
(
name
:
'
fromSymbol
'
|
'
toSymbol
'
,
lineData
:
LineList
,
idx
:
number
)
{
const
symbolType
=
lineData
.
getItemVisual
(
idx
,
name
);
if
(
!
symbolType
||
symbolType
===
'
none
'
)
{
return
symbolType
;
}
const
symbolSize
=
lineData
.
getItemVisual
(
idx
,
name
+
'
Size
'
as
'
fromSymbolSize
'
|
'
toSymbolSize
'
);
const
symbolRotate
=
lineData
.
getItemVisual
(
idx
,
name
+
'
Rotate
'
as
'
fromSymbolRotate
'
|
'
toSymbolRotate
'
);
const
symbolOffset
=
lineData
.
getItemVisual
(
idx
,
name
+
'
Offset
'
as
'
fromSymbolOffset
'
|
'
toSymbolOffset
'
);
const
symbolKeepAspect
=
lineData
.
getItemVisual
(
idx
,
name
+
'
KeepAspect
'
as
'
fromSymbolKeepAspect
'
|
'
toSymbolKeepAspect
'
);
const
symbolSizeArr
=
symbolUtil
.
normalizeSymbolSize
(
symbolSize
);
const
symbolOffsetArr
=
symbolUtil
.
normalizeSymbolOffset
(
symbolOffset
||
0
,
symbolSizeArr
);
return
symbolType
+
symbolSizeArr
+
symbolOffsetArr
+
(
symbolRotate
||
''
)
+
(
symbolKeepAspect
||
''
);
}
/**
/**
* @inner
* @inner
...
@@ -164,7 +180,7 @@ class Line extends graphic.Group {
...
@@ -164,7 +180,7 @@ class Line extends graphic.Group {
// it will be updated after line#update.
// it will be updated after line#update.
// Or symbol position and rotation update in line#beforeUpdate will be one frame slow
// Or symbol position and rotation update in line#beforeUpdate will be one frame slow
this
.
add
(
symbol
);
this
.
add
(
symbol
);
this
[
makeSymbolTypeKey
(
symbolCategory
)]
=
lineData
.
getItemVisual
(
idx
,
symbolCategory
);
this
[
makeSymbolTypeKey
(
symbolCategory
)]
=
makeSymbolTypeValue
(
symbolCategory
,
lineData
,
idx
);
},
this
);
},
this
);
this
.
_updateCommonStl
(
lineData
,
idx
,
seriesScope
);
this
.
_updateCommonStl
(
lineData
,
idx
,
seriesScope
);
...
@@ -184,7 +200,7 @@ class Line extends graphic.Group {
...
@@ -184,7 +200,7 @@ class Line extends graphic.Group {
graphic
.
updateProps
(
line
,
target
,
seriesModel
,
idx
);
graphic
.
updateProps
(
line
,
target
,
seriesModel
,
idx
);
each
(
SYMBOL_CATEGORIES
,
function
(
symbolCategory
)
{
each
(
SYMBOL_CATEGORIES
,
function
(
symbolCategory
)
{
const
symbolType
=
(
lineData
as
LineList
).
getItemVisual
(
idx
,
symbolCategory
);
const
symbolType
=
makeSymbolTypeValue
(
symbolCategory
,
lineData
as
LineList
,
idx
);
const
key
=
makeSymbolTypeKey
(
symbolCategory
);
const
key
=
makeSymbolTypeKey
(
symbolCategory
);
// Symbol changed
// Symbol changed
if
(
this
[
key
]
!==
symbolType
)
{
if
(
this
[
key
]
!==
symbolType
)
{
...
...
test/lines-symbolSize-update.html
0 → 100644
浏览文件 @
8abf36c2
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<script
src=
"lib/simpleRequire.js"
></script>
<script
src=
"lib/config.js"
></script>
<script
src=
"lib/jquery.min.js"
></script>
<script
src=
"lib/facePrint.js"
></script>
<script
src=
"lib/testHelper.js"
></script>
<!-- <script src="ut/lib/canteen.js"></script> -->
<link
rel=
"stylesheet"
href=
"lib/reset.css"
/>
</head>
<body>
<div
id=
"main0"
></div>
<script>
// See
<
https
:
//github.com/apache/echarts/issues/18350>
require
([
'
echarts
'
,
],
function
(
echarts
)
{
var
maxValue
=
10
;
var
linesData
=
Array
.
from
(
Array
(
maxValue
).
keys
()).
map
((
value
)
=>
{
return
{
coords
:
[
[
value
*
Math
.
random
(),
value
*
Math
.
random
()],
[
value
*
Math
.
random
(),
value
*
Math
.
random
()]
]
};
});
var
option
=
{
xAxis
:
{
type
:
'
value
'
,
min
:
0
,
max
:
maxValue
},
yAxis
:
{
type
:
'
value
'
,
min
:
0
,
max
:
maxValue
},
series
:
[
{
id
:
'
1
'
,
type
:
'
lines
'
,
symbol
:
[
'
none
'
,
'
arrow
'
],
symbolSize
:
10
,
coordinateSystem
:
'
cartesian2d
'
,
lineStyle
:
{
color
:
'
#c46e54
'
,
width
:
1
},
data
:
linesData
}
]
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main0
'
,
{
title
:
[
'
Lines series symbolSize should be updated
'
],
option
:
option
,
buttons
:
[{
text
:
'
Click to change symbolSize
'
,
onclick
:
function
()
{
chart
.
setOption
(
{
series
:
[
{
id
:
'
1
'
,
type
:
'
lines
'
,
symbol
:
[
'
none
'
,
'
arrow
'
],
symbolSize
:
30
,
}
]
},
);
}
}],
});
});
</script>
</body>
</html>
test/runTest/actions/__meta__.json
浏览文件 @
8abf36c2
...
@@ -130,6 +130,7 @@
...
@@ -130,6 +130,7 @@
"line-sampling"
:
2
,
"line-sampling"
:
2
,
"line-visual2"
:
2
,
"line-visual2"
:
2
,
"lines-bus"
:
1
,
"lines-bus"
:
1
,
"lines-symbolSize-update"
:
1
,
"map"
:
3
,
"map"
:
3
,
"map-contour"
:
2
,
"map-contour"
:
2
,
"map-default"
:
1
,
"map-default"
:
1
,
...
...
test/runTest/actions/lines-symbolSize-update.json
0 → 100644
浏览文件 @
8abf36c2
[{
"name"
:
"Action 1"
,
"ops"
:[{
"type"
:
"mousemove"
,
"time"
:
484
,
"x"
:
83
,
"y"
:
96
},{
"type"
:
"mousemove"
,
"time"
:
685
,
"x"
:
91
,
"y"
:
83
},{
"type"
:
"mousemove"
,
"time"
:
899
,
"x"
:
92
,
"y"
:
83
},{
"type"
:
"mousedown"
,
"time"
:
1506
,
"x"
:
92
,
"y"
:
83
},{
"type"
:
"mouseup"
,
"time"
:
1511
,
"x"
:
92
,
"y"
:
83
},{
"time"
:
1512
,
"delay"
:
400
,
"type"
:
"screenshot-auto"
}],
"scrollY"
:
0
,
"scrollX"
:
0
,
"timestamp"
:
1679391497375
}]
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录