Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yqlh-dataEase
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
frontend
yqlh-dataEase
Commits
7f442311
Commit
7f442311
authored
Aug 11, 2023
by
韩艳丽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
漂浮地图
parent
f262b416
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
237 行增加
和
9 行删除
+237
-9
src/lang/en.js
+2
-1
src/lang/tw.js
+2
-1
src/lang/zh.js
+3
-2
src/views/chart/chart/float/float_antv.js
+181
-0
src/views/chart/chart/util.js
+41
-0
src/views/chart/components/ChartComponentG2.vue
+8
-5
没有找到文件。
src/lang/en.js
查看文件 @
7f442311
...
@@ -1180,7 +1180,7 @@ export default {
...
@@ -1180,7 +1180,7 @@ export default {
chart_pie_rose
:
'Rose Pie'
,
chart_pie_rose
:
'Rose Pie'
,
chart_pie_donut_rose
:
'Rose Donut Pie'
,
chart_pie_donut_rose
:
'Rose Donut Pie'
,
chart_funnel
:
'Funnel'
,
chart_funnel
:
'Funnel'
,
chart_sankey
:
'Sankey'
,
chart_sankey
:
'Sankey'
,
chart_radar
:
'Radar'
,
chart_radar
:
'Radar'
,
chart_gauge
:
'Gauge'
,
chart_gauge
:
'Gauge'
,
chart_map
:
'Map'
,
chart_map
:
'Map'
,
...
@@ -1533,6 +1533,7 @@ export default {
...
@@ -1533,6 +1533,7 @@ export default {
no_function
:
'Function not enter,please input.'
,
no_function
:
'Function not enter,please input.'
,
chart_flow_map
:
'Flow Map'
,
chart_flow_map
:
'Flow Map'
,
chart_city_brightness_map
:
'City Brightness Map'
,
chart_city_brightness_map
:
'City Brightness Map'
,
chart_float_map
:
'Float Map Module'
,
start_point
:
'Start point(Lat/Long)'
,
start_point
:
'Start point(Lat/Long)'
,
end_point
:
'End point(Lat/Long)'
,
end_point
:
'End point(Lat/Long)'
,
line
:
'Line'
,
line
:
'Line'
,
...
...
src/lang/tw.js
查看文件 @
7f442311
...
@@ -1178,7 +1178,7 @@ export default {
...
@@ -1178,7 +1178,7 @@ export default {
chart_pie_rose
:
'南丁格爾玫瑰圖'
,
chart_pie_rose
:
'南丁格爾玫瑰圖'
,
chart_pie_donut_rose
:
'南丁格爾玫瑰環形圖'
,
chart_pie_donut_rose
:
'南丁格爾玫瑰環形圖'
,
chart_funnel
:
'漏鬥圖'
,
chart_funnel
:
'漏鬥圖'
,
chart_sankey
:
'桑基圖'
,
chart_sankey
:
'桑基圖'
,
chart_radar
:
'雷達圖'
,
chart_radar
:
'雷達圖'
,
chart_gauge
:
'儀表盤'
,
chart_gauge
:
'儀表盤'
,
chart_map
:
'地圖'
,
chart_map
:
'地圖'
,
...
@@ -1526,6 +1526,7 @@ export default {
...
@@ -1526,6 +1526,7 @@ export default {
no_function
:
'函數尚未支持直接引用,請在字段表達式中手動輸入。'
,
no_function
:
'函數尚未支持直接引用,請在字段表達式中手動輸入。'
,
chart_flow_map
:
'流向地圖'
,
chart_flow_map
:
'流向地圖'
,
chart_city_brightness_map
:
'城市亮度圖'
,
chart_city_brightness_map
:
'城市亮度圖'
,
chart_float_map
:
'漂浮地圖模塊'
,
start_point
:
'起點經緯度'
,
start_point
:
'起點經緯度'
,
end_point
:
'終點經緯度'
,
end_point
:
'終點經緯度'
,
line
:
'線條'
,
line
:
'線條'
,
...
...
src/lang/zh.js
查看文件 @
7f442311
...
@@ -1178,7 +1178,7 @@ export default {
...
@@ -1178,7 +1178,7 @@ export default {
chart_pie_rose
:
'南丁格尔玫瑰图'
,
chart_pie_rose
:
'南丁格尔玫瑰图'
,
chart_pie_donut_rose
:
'南丁格尔玫瑰环形图'
,
chart_pie_donut_rose
:
'南丁格尔玫瑰环形图'
,
chart_funnel
:
'漏斗图'
,
chart_funnel
:
'漏斗图'
,
chart_sankey
:
'桑基图'
,
chart_sankey
:
'桑基图'
,
chart_radar
:
'雷达图'
,
chart_radar
:
'雷达图'
,
chart_gauge
:
'仪表盘'
,
chart_gauge
:
'仪表盘'
,
chart_map
:
'地图'
,
chart_map
:
'地图'
,
...
@@ -1558,7 +1558,8 @@ export default {
...
@@ -1558,7 +1558,8 @@ export default {
map_line_color_target_color
:
'结束颜色'
,
map_line_color_target_color
:
'结束颜色'
,
map_line_theta_offset
:
'弧度'
,
map_line_theta_offset
:
'弧度'
,
chart_bubble_map
:
'气泡地图'
,
chart_bubble_map
:
'气泡地图'
,
chart_city_brightness_map
:
'城市亮度图'
chart_city_brightness_map
:
'城市亮度图'
,
chart_float_map
:
'漂浮地图模块'
},
},
dataset
:
{
dataset
:
{
scope_edit
:
'仅编辑时生效'
,
scope_edit
:
'仅编辑时生效'
,
...
...
src/views/chart/chart/float/float_antv.js
0 → 100644
查看文件 @
7f442311
import
{
Scene
,
PointLayer
,
PolygonLayer
,
LineLayer
}
from
'@antv/l7'
import
{
GaodeMap
}
from
'@antv/l7-maps'
import
{
getLanguage
}
from
'@/lang'
export
function
baseFloatMapOption
(
chartDom
,
chartId
,
chart
,
action
)
{
// console.log(chart)
const
xAxis
=
JSON
.
parse
(
chart
.
xaxis
)
// console.log(xAxis)
const
yAxis
=
JSON
.
parse
(
chart
.
yaxis
)
let
customAttr
if
(
chart
.
customAttr
)
{
customAttr
=
JSON
.
parse
(
chart
.
customAttr
)
}
const
size
=
customAttr
.
size
const
color
=
customAttr
.
color
const
mapStyle
=
`amap://styles/
${
color
.
mapStyle
?
color
.
mapStyle
:
'normal'
}
`
const
lang
=
getLanguage
().
includes
(
'zh'
)
?
'zh'
:
'en'
let
init
=
false
if
(
!
chartDom
?.
map
)
{
try
{
chartDom
.
destroy
()
}
catch
(
e
)
{
// ignore
}
chartDom
=
new
Scene
({
id
:
chartId
,
map
:
new
GaodeMap
({
lang
:
lang
,
// pitch: size.mapPitch,
style
:
mapStyle
,
// style: 'dark',
center
:
[
104.58631
,
30.71882
],
// 成阿中心经纬度
zoom
:
6.2
,
maxZoom
:
10
}),
logoVisible
:
false
})
init
=
true
}
else
{
if
(
chartDom
.
map
)
{
chartDom
.
setPitch
(
size
.
mapPitch
)
chartDom
.
setMapStyle
(
mapStyle
)
}
}
// if (xAxis?.length < 3) {
// chartDom.removeAllLayer()
// return chartDom
// }
const
texts
=
[]
const
newTableRow
=
chart
.
data
.
tableRow
.
map
((
item
,
index
)
=>
{
const
name
=
item
[
xAxis
[
0
].
dataeaseName
]
const
center
=
item
[
xAxis
[
1
].
dataeaseName
]
const
[
lng
,
lat
]
=
center
texts
.
push
({
name
,
lng
,
lat
})
return
{
type
:
'Feature'
,
geometry
:
{
type
:
'MultiPolygon'
,
coordinates
:
item
[
xAxis
[
2
].
dataeaseName
]
},
properties
:
{
name
:
item
[
xAxis
[
0
].
dataeaseName
],
center
:
item
[
xAxis
[
1
].
dataeaseName
]
}
}
})
const
mapData
=
{
type
:
'FeatureCollection'
,
features
:
newTableRow
}
const
proData
=
{
type
:
'FeatureCollection'
,
features
:
[
newTableRow
[
0
]]
}
console
.
log
(
mapData
,
proData
)
chartDom
.
removeAllLayer
()
.
then
(()
=>
{
const
textLayer
=
new
PointLayer
({
zIndex
:
2
})
.
source
(
texts
,
{
parser
:
{
type
:
'json'
,
x
:
'lng'
,
y
:
'lat'
}
})
.
shape
(
'name'
,
'text'
)
.
size
(
14
)
.
color
(
'#0ff'
)
.
style
({
textAnchor
:
'center'
,
// 文本相对锚点的位置 center|left|right|top|bottom|top-left
spacing
:
2
,
// 字符间距
padding
:
[
1
,
1
],
// 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近
stroke
:
'#0ff'
,
// 描边颜色
strokeWidth
:
0.2
,
// 描边宽度
raisingHeight
:
200000
+
150000
+
10000
,
textAllowOverlap
:
true
})
const
lineDown
=
new
LineLayer
()
.
source
(
mapData
)
.
shape
(
'line'
)
.
color
(
'#0DCCFF'
)
.
size
(
1
)
.
style
({
raisingHeight
:
200000
})
const
lineUp
=
new
LineLayer
({
zIndex
:
1
})
.
source
(
mapData
)
.
shape
(
'line'
)
.
color
(
'#0DCCFF'
)
.
size
(
1
)
.
style
({
raisingHeight
:
200000
+
150000
})
const
lineLayer
=
new
LineLayer
()
.
source
(
proData
)
.
shape
(
'wall'
)
.
size
(
150000
)
.
style
({
heightfixed
:
true
,
opacity
:
0.6
,
sourceColor
:
'#0DCCFF'
,
targetColor
:
'rbga(255,255,255, 0)'
})
chartDom
.
addLayer
(
lineLayer
)
// 底部地图上的线
const
provincelayer
=
new
PolygonLayer
({})
.
source
(
proData
)
.
size
(
150000
)
.
shape
(
'extrude'
)
// shape 为 extrude 几何图层用于绘制 3D 的几何体
.
color
(
'#0DCCFF'
)
.
active
({
color
:
'rgb(100,230,255)'
})
.
style
({
heightfixed
:
true
,
// heightFixed 设置 3D 填充图的高度时候固定
pickLight
:
true
,
// pickLight 设置 3D 填充图的拾取高亮色是否计算光照。
raisingHeight
:
200000
,
opacity
:
0.8
})
chartDom
.
addLayer
(
provincelayer
)
// 省份
provincelayer
.
on
(
'mousemove'
,
()
=>
{
provincelayer
.
style
({
raisingHeight
:
200000
+
100000
})
lineDown
.
style
({
raisingHeight
:
200000
+
100000
})
lineUp
.
style
({
raisingHeight
:
200000
+
150000
+
100000
})
textLayer
.
style
({
raisingHeight
:
200000
+
150000
+
10000
+
100000
})
})
provincelayer
.
on
(
'unmousemove'
,
()
=>
{
provincelayer
.
style
({
raisingHeight
:
200000
})
lineDown
.
style
({
raisingHeight
:
200000
})
lineUp
.
style
({
raisingHeight
:
200000
+
150000
})
textLayer
.
style
({
raisingHeight
:
200000
+
150000
+
10000
})
})
if
(
!
init
)
{
chartDom
.
addLayer
(
textLayer
)
// 地图文字
chartDom
.
addLayer
(
lineDown
)
// 漂浮块底部
chartDom
.
addLayer
(
lineUp
)
// 漂浮块顶部线
chartDom
.
addLayer
(
lineLayer
)
chartDom
.
addLayer
(
provincelayer
)
}
chartDom
.
on
(
'loaded'
,
()
=>
{
chartDom
.
addLayer
(
textLayer
)
// 地图文字
chartDom
.
addLayer
(
lineDown
)
// 漂浮块底部
chartDom
.
addLayer
(
lineUp
)
// 漂浮块顶部线
chartDom
.
addLayer
(
lineLayer
)
chartDom
.
addLayer
(
provincelayer
)
})
})
return
chartDom
}
src/views/chart/chart/util.js
查看文件 @
7f442311
...
@@ -2145,6 +2145,47 @@ export const TYPE_CONFIGS = [
...
@@ -2145,6 +2145,47 @@ export const TYPE_CONFIGS = [
]
]
}
}
},
},
// 漂浮地图模块
{
render
:
'antv'
,
category
:
'chart.chart_type_space'
,
value
:
'float'
,
title
:
'chart.chart_float_map'
,
icon
:
'bubble_map'
,
properties
:
[
'color-selector'
,
'size-selector-ant-v'
,
'title-selector-ant-v'
],
propertyInner
:
{
'color-selector'
:
[
'mapStyle'
,
'value'
],
'size-selector-ant-v'
:
[
'mapPitch'
,
'mapLineType'
,
'mapLineWidth'
,
'mapLineAnimate'
,
'mapLineAnimateDuration'
,
'mapLineAnimateInterval'
,
'mapLineAnimateTrailLength'
],
'title-selector-ant-v'
:
[
'show'
,
'title'
,
'fontSize'
,
'color'
,
'hPosition'
,
'isItalic'
,
'isBolder'
,
'remarkShow'
,
'fontFamily'
,
'letterSpace'
,
'fontShadow'
]
}
},
/* 下面是echarts图表类型 */
/* 下面是echarts图表类型 */
{
{
render
:
'echarts'
,
render
:
'echarts'
,
...
...
src/views/chart/components/ChartComponentG2.vue
查看文件 @
7f442311
...
@@ -65,8 +65,9 @@ import { mapState } from 'vuex'
...
@@ -65,8 +65,9 @@ import { mapState } from 'vuex'
import
{
baseFlowMapOption
}
from
'@/views/chart/chart/map/map_antv'
import
{
baseFlowMapOption
}
from
'@/views/chart/chart/map/map_antv'
import
{
baseBubbleMapOption
}
from
'@/views/chart/chart/bubble/bubble_antv'
import
{
baseBubbleMapOption
}
from
'@/views/chart/chart/bubble/bubble_antv'
import
{
baseCityBrightnessMapOptionAntV
}
from
'@/views/chart/chart/cityBrightness/cityBrightness_antv'
import
{
baseCityBrightnessMapOptionAntV
}
from
'@/views/chart/chart/cityBrightness/cityBrightness_antv'
import
{
baseFloatMapOption
}
from
'@/views/chart/chart/float/float_antv'
import
{
clear
}
from
'size-sensor'
import
{
clear
}
from
'size-sensor'
import
{
baseSankeyOptionAntV
}
from
"@/views/chart/chart/sankey/sankey_antv"
;
import
{
baseSankeyOptionAntV
}
from
'@/views/chart/chart/sankey/sankey_antv'
export
default
{
export
default
{
name
:
'ChartComponentG2'
,
name
:
'ChartComponentG2'
,
components
:
{
TitleRemark
,
ViewTrackBar
,
ChartTitleUpdate
},
components
:
{
TitleRemark
,
ViewTrackBar
,
ChartTitleUpdate
},
...
@@ -312,18 +313,20 @@ export default {
...
@@ -312,18 +313,20 @@ export default {
this
.
myChart
=
baseBubbleMapOption
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
this
.
myChart
=
baseBubbleMapOption
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
}
else
if
(
chart
.
type
===
'city-brightness'
)
{
}
else
if
(
chart
.
type
===
'city-brightness'
)
{
this
.
myChart
=
baseCityBrightnessMapOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
this
.
myChart
=
baseCityBrightnessMapOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
}
else
if
(
chart
.
type
===
'chart_sankey'
)
{
}
else
if
(
chart
.
type
===
'chart_sankey'
)
{
this
.
myChart
=
baseSankeyOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
this
.
myChart
=
baseSankeyOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
}
else
if
(
chart
.
type
===
'threeDColumn'
)
{
}
else
if
(
chart
.
type
===
'threeDColumn'
)
{
this
.
myChart
=
base3DColumnOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
this
.
myChart
=
base3DColumnOptionAntV
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
}
else
{
}
else
if
(
chart
.
type
===
'float'
)
{
this
.
myChart
=
baseFloatMapOption
(
this
.
myChart
,
this
.
chartId
,
chart
,
this
.
antVAction
)
}
else
{
if
(
this
.
myChart
)
{
if
(
this
.
myChart
)
{
this
.
antVRenderStatus
=
false
this
.
antVRenderStatus
=
false
this
.
myChart
.
destroy
()
this
.
myChart
.
destroy
()
}
}
}
}
if
(
this
.
myChart
&&
!
equalsAny
(
chart
.
type
,
'liquid'
,
'flow-map'
,
'bubble'
,
'city-brightness'
)
&&
this
.
searchCount
>
0
)
{
if
(
this
.
myChart
&&
!
equalsAny
(
chart
.
type
,
'liquid'
,
'flow-map'
,
'bubble'
,
'city-brightness'
,
'float'
)
&&
this
.
searchCount
>
0
)
{
this
.
myChart
.
options
.
animation
=
false
this
.
myChart
.
options
.
animation
=
false
}
}
if
(
this
.
myChart
?.
options
?.
legend
)
{
if
(
this
.
myChart
?.
options
?.
legend
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论