Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
fe0d94a2
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,发现更多精彩内容 >>
提交
fe0d94a2
编写于
7月 15, 2020
作者:
P
pissang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(treemap): add borderRadius
上级
e6c0f31f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
54 addition
and
10 deletion
+54
-10
src/chart/treemap/TreemapSeries.ts
src/chart/treemap/TreemapSeries.ts
+4
-2
src/chart/treemap/TreemapView.ts
src/chart/treemap/TreemapView.ts
+4
-3
test/treemap-obama.html
test/treemap-obama.html
+46
-5
未找到文件。
src/chart/treemap/TreemapSeries.ts
浏览文件 @
fe0d94a2
...
...
@@ -52,6 +52,8 @@ interface TreemapSeriesLabelOption extends LabelOption {
}
interface
TreemapSeriesItemStyleOption
extends
ItemStyleOption
{
borderRadius
?:
number
|
number
[]
colorAlpha
?:
number
colorSaturation
?:
number
...
...
@@ -253,7 +255,7 @@ class TreemapSeriesModel extends SeriesModel<TreemapSeriesOption> {
position
:
'
inside
'
,
// Can be [5, '5%'] or position stirng like 'insideTopLeft', ...
// formatter: null,
color
:
'
#fff
'
,
ellipsis
:
true
overflow
:
'
truncate
'
// align
// verticalAlign
},
...
...
@@ -263,7 +265,7 @@ class TreemapSeriesModel extends SeriesModel<TreemapSeriesOption> {
height
:
20
,
// formatter: null,
// color: '#fff',
ellipsis
:
true
,
overflow
:
'
truncate
'
,
// align: null,
verticalAlign
:
'
middle
'
},
...
...
src/chart/treemap/TreemapView.ts
浏览文件 @
fe0d94a2
...
...
@@ -767,6 +767,7 @@ function renderNode(
const
itemStyleEmphasisModel
=
nodeModel
.
getModel
([
'
emphasis
'
,
'
itemStyle
'
]);
const
itemStyleBlurModel
=
nodeModel
.
getModel
([
'
blur
'
,
'
itemStyle
'
]);
const
itemStyleSelectModel
=
nodeModel
.
getModel
([
'
select
'
,
'
itemStyle
'
]);
const
borderRadius
=
itemStyleNormalModel
.
get
(
'
borderRadius
'
)
||
0
;
// End of closure ariables available in "Procedures in renderNode".
// -----------------------------------------------------------------
...
...
@@ -843,7 +844,7 @@ function renderNode(
ecData
.
dataIndex
=
thisNode
.
dataIndex
;
ecData
.
seriesIndex
=
seriesModel
.
seriesIndex
;
bg
.
setShape
({
x
:
0
,
y
:
0
,
width
:
thisWidth
,
height
:
thisHeight
});
bg
.
setShape
({
x
:
0
,
y
:
0
,
width
:
thisWidth
,
height
:
thisHeight
,
r
:
borderRadius
});
if
(
thisInvisible
)
{
// If invisible, do not set visual, otherwise the element will
...
...
@@ -901,7 +902,8 @@ function renderNode(
x
:
borderWidth
,
y
:
borderWidth
,
width
:
contentWidth
,
height
:
contentHeight
height
:
contentHeight
,
r
:
borderRadius
});
if
(
thisInvisible
)
{
...
...
@@ -981,7 +983,6 @@ function renderNode(
const
textEl
=
rectEl
.
getTextContent
();
const
textStyle
=
textEl
.
style
;
textStyle
.
overflow
=
'
truncate
'
;
textStyle
.
truncateMinChar
=
2
;
textStyle
.
width
=
width
;
...
...
test/treemap-obama.html
浏览文件 @
fe0d94a2
...
...
@@ -24,6 +24,8 @@ under the License.
<script
src=
"lib/esl.js"
></script>
<script
src=
"lib/config.js"
></script>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<!-- <link href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300&display=swap" rel="stylesheet"> -->
<link
href=
"https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@300&family=Open+Sans+Condensed:wght@300&display=swap"
rel=
"stylesheet"
>
</head>
<body>
<style>
...
...
@@ -234,14 +236,31 @@ under the License.
colorMappingBy
:
'
id
'
,
itemStyle
:
{
borderWidth
:
3
,
gapWidth
:
3
gapWidth
:
3
,
borderRadius
:
5
,
shadowBlur
:
20
,
shadowColor
:
'
rgba(20, 20, 40, 1)
'
,
}
},
{
colorAlpha
:
mode
===
2
?
[
0.
5
,
1
]
:
null
,
?
[
0.
3
,
0.5
]
:
null
,
itemStyle
:
{
gapWidth
:
1
borderWidth
:
2
,
gapWidth
:
1
,
borderRadius
:
5
,
shadowBlur
:
5
,
shadowColor
:
'
rgba(20, 20, 40, 0.5)
'
}
},
{
upperLabel
:
{
show
:
false
},
itemStyle
:
{
borderWidth
:
0
,
gapWidth
:
0
,
borderRadius
:
1
}
}
];
...
...
@@ -297,6 +316,7 @@ under the License.
});
chart
.
setOption
({
// backgroundColor: '#000',
legend
:
{
data
:
[
SERIES_NAME
]
...
...
@@ -315,10 +335,31 @@ under the License.
label
:
{
show
:
true
,
formatter
:
"
{b}
"
,
ellipsis
:
true
fontSize
:
10
,
fontWeight
:
100
,
fontFamily
:
'
Barlow Condensed
'
,
overflow
:
'
break
'
},
labelLayout
:
function
(
params
)
{
if
(
params
.
rect
.
width
<
5
||
params
.
rect
.
height
<
5
)
{
return
{
fontSize
:
0
};
}
return
{
fontSize
:
Math
.
min
(
Math
.
sqrt
(
params
.
rect
.
width
*
params
.
rect
.
height
)
/
10
,
20
)
};
},
itemStyle
:
{
borderColor
:
'
black
'
borderColor
:
'
rgba(100, 100, 200, 0.2)
'
,
borderWidth
:
0
},
upperLabel
:
{
show
:
true
,
height
:
15
,
fontSize
:
10
,
fontFamily
:
'
Barlow Condensed
'
,
color
:
null
},
levels
:
getLevelOption
(
0
),
data
:
buildData
(
'
2012 Amount
'
,
window
.
obama_budget_2012
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录