Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
network-assets-topology
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
network-assets-topology
Commits
b8bac284
Commit
b8bac284
authored
Aug 03, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:debug
parent
b3961490
Pipeline
#657
failed with stages
Changes
11
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1396 additions
and
1795 deletions
+1396
-1795
datav3.q.common.js
js/q/datav3.q.common.js
+2
-0
datav3.q.exportdata.js
js/q/datav3.q.exportdata.js
+1
-0
datav3.q.initwebgl.js
js/q/datav3.q.initwebgl.js
+2
-0
datav3.q.left.js
js/q/datav3.q.left.js
+2
-0
datav3.q.lemap.js
js/q/datav3.q.lemap.js
+348
-343
datav3.q.map.js
js/q/datav3.q.map.js
+6
-3
datav3.q.right.js
js/q/datav3.q.right.js
+144
-123
datav3.q.utils.js
js/q/datav3.q.utils.js
+392
-890
json.js
js/q/json.js
+81
-58
svgHeader2.js
js/q/svgHeader2.js
+65
-67
text.js
js/q/text.js
+353
-311
No files found.
js/q/datav3.q.common.js
View file @
b8bac284
console
.
log
(
"------ datav3.q.common.js debug ------"
)
var
map
=
null
;
var
phyTopoin
=
null
;
var
phyInterRouter
=
null
;
...
...
js/q/datav3.q.exportdata.js
View file @
b8bac284
console
.
log
(
"------ datav3.q.exportdata.js debug ------"
)
$
(
'#logic-export'
).
click
(
function
(){
var
inputValue
=
$
(
this
).
siblings
(
'input'
).
val
();
...
...
js/q/datav3.q.initwebgl.js
View file @
b8bac284
console
.
log
(
"------ datav3.q.initwebgl.js debug ------"
)
// 声明变量,用于存储渲染器、场景、相机、容器宽高、控制器和克隆相机
var
renderer
;
var
scene
;
...
...
js/q/datav3.q.left.js
View file @
b8bac284
console
.
log
(
"------ datav3.q.left.js debug ------"
)
$
(
function
(){
var
leftinfo
=
$
(
'.leftinfo'
);
var
leftinfoR
=
$
(
'.right'
);
...
...
js/q/datav3.q.lemap.js
View file @
b8bac284
This diff is collapsed.
Click to expand it.
js/q/datav3.q.map.js
View file @
b8bac284
//自动执行函数
(
function
()
{
console
.
log
(
"------ datav3.q.map debug ------"
)
console
.
log
(
"------ datav3.q.map debug ------"
)
;
// 公共鼠标拾取变量
var
raycaster
=
new
THREE
.
Raycaster
();
var
mouse
=
new
THREE
.
Vector2
();
...
...
@@ -492,7 +492,10 @@
transformSVGPathExposed
(
path
(
feature
)),
extrudeSettings
),
new
THREE
.
MeshLambertMaterial
({
color
:
0xffffff
,
depthTest
:
true
})
new
THREE
.
MeshLambertMaterial
({
color
:
0xffffff
,
depthTest
:
true
,
})
);
map_mesh
.
name
=
"map_"
+
country_code
;
country_geomap_map
.
add
(
map_mesh
);
...
...
@@ -525,7 +528,7 @@
country_AScount_list
.
push
(
_
.
size
(
country_ASes
));
}
var
country_AScount_max
=
_
.
max
(
country_AScount_list
);
console
.
log
(
"------------"
)
console
.
log
(
"------------"
)
;
// 点处理
var
Land_points
=
new
THREE
.
Geometry
();
valid_country_names
=
[];
// 实际有效的绘图国家列表
...
...
js/q/datav3.q.right.js
View file @
b8bac284
console
.
log
(
"------ datav3.q.right.js debug ------"
);
//***********右侧信息展示中供index调用的接口封装***********/
// 右下按钮动画
$
(
function
(){
var
right_btm
=
$
(
'.right-btm'
);
var
content
=
right_btm
.
find
(
'.content'
);
var
content_list
=
content
.
find
(
'.content-list'
);
right_btm
.
find
(
'.rb-btn'
).
each
(
function
(){
rbBtnAnimate
(
$
(
this
));
})
// rbBtnAnimate(right_btm.find('.rb-btn2'));
function
rbBtnAnimate
(
$ele
){
var
btn_country
=
$ele
.
find
(
'.rb-btn-center'
);
var
rb_btn_outer
=
$ele
.
find
(
'.rb-btn-outer'
);
var
btn_transition_time
=
500
;
var
img_len
=
rb_btn_outer
.
find
(
'img'
).
length
;
var
per_deg
=
360
/
img_len
;
// var init_rotate = 140;
if
(
img_len
==
2
){
btn_country
.
click
(
function
(){
$_this
=
$
(
this
);
var
anim1
=
scaleBtnCountry
(
$_this
);
anim1
.
then
(
function
(){
resetBtnCountry
(
$_this
);
;
})
})
}
else
{
btn_country
.
click
(
function
(){
$_this
=
$
(
this
);
var
anim1
=
transiteBtnOuterDown
(
$_this
,
-
200
);
anim1
.
then
(
function
(){
resetBtnOuter
(
$_this
);
;
})
})
}
function
scaleBtnCountry
(
$_el
){
var
dtd
=
$
.
Deferred
();
$_el
.
transition
({
transform
:
'scale(0.8) rotate(-40deg)'
},
btn_transition_time
,
function
(){
dtd
.
resolve
();
})
return
dtd
.
promise
();
}
function
resetBtnCountry
(
$_el
){
var
dtd
=
$
.
Deferred
();
$
(
function
()
{
var
right_btm
=
$
(
".right-btm"
);
var
content
=
right_btm
.
find
(
".content"
);
var
content_list
=
content
.
find
(
".content-list"
);
right_btm
.
find
(
".rb-btn"
).
each
(
function
()
{
rbBtnAnimate
(
$
(
this
));
});
// rbBtnAnimate(right_btm.find('.rb-btn2'));
function
rbBtnAnimate
(
$ele
)
{
var
btn_country
=
$ele
.
find
(
".rb-btn-center"
);
var
rb_btn_outer
=
$ele
.
find
(
".rb-btn-outer"
);
var
btn_transition_time
=
500
;
var
img_len
=
rb_btn_outer
.
find
(
"img"
).
length
;
var
per_deg
=
360
/
img_len
;
// var init_rotate = 140;
if
(
img_len
==
2
)
{
btn_country
.
click
(
function
()
{
$_this
=
$
(
this
);
var
anim1
=
scaleBtnCountry
(
$_this
);
anim1
.
then
(
function
()
{
resetBtnCountry
(
$_this
);
});
});
}
else
{
btn_country
.
click
(
function
()
{
$_this
=
$
(
this
);
var
anim1
=
transiteBtnOuterDown
(
$_this
,
-
200
);
anim1
.
then
(
function
()
{
resetBtnOuter
(
$_this
);
});
});
}
$_el
.
transition
({
transform
:
'scale(1) rotate(-40deg)'
},
btn_transition_time
,
function
(){
dtd
.
resolve
();
})
function
scaleBtnCountry
(
$_el
)
{
var
dtd
=
$
.
Deferred
();
return
dtd
.
promise
();
}
$_el
.
transition
(
{
transform
:
"scale(0.8) rotate(-40deg)"
,
},
btn_transition_time
,
function
()
{
dtd
.
resolve
();
}
);
rb_btn_outer
.
find
(
'img'
).
each
(
function
(
i
,
d
){
$
(
this
).
on
(
'click.animate'
,
function
(){
var
$_this
=
$
(
this
);
var
rotate_deg
=
i
*
per_deg
;
var
anim1
=
transiteBtnOuterDown
(
$_this
);
anim1
.
then
(
function
(){
transiteBtnOuterUp
(
$_this
)
return
rotateBtn
(
$_this
,
rotate_deg
);
}).
then
(
function
(){
resetBtnOuter
(
$_this
);
})
// $_this.addClass('active');
})
})
return
dtd
.
promise
();
}
function
transiteBtnOuterDown
(
$_el
,
transZ
){
var
dtd
=
$
.
Deferred
();
var
transZ
=
transZ
||
-
40
;
function
resetBtnCountry
(
$_el
)
{
var
dtd
=
$
.
Deferred
();
$_el
.
transition
({
transform
:
'translate3d(0px,0px,'
+
transZ
+
'px)'
},
btn_transition_time
,
function
(){
dtd
.
resolve
();
})
$_el
.
transition
(
{
transform
:
"scale(1) rotate(-40deg)"
,
},
btn_transition_time
,
function
()
{
dtd
.
resolve
();
}
);
return
dtd
.
promise
();
}
return
dtd
.
promise
();
}
function
transiteBtnOuterUp
(
$_el
,
transZ
){
var
dtd
=
$
.
Deferred
();
var
transZ
=
transZ
||
50
;
rb_btn_outer
.
find
(
"img"
).
each
(
function
(
i
,
d
)
{
$
(
this
).
on
(
"click.animate"
,
function
()
{
var
$_this
=
$
(
this
);
var
rotate_deg
=
i
*
per_deg
;
$_el
.
transition
({
transform
:
'translate3d(0px,0px,'
+
transZ
+
'px)'
},
btn_transition_time
,
function
(){
dtd
.
resolve
();
var
anim1
=
transiteBtnOuterDown
(
$_this
);
anim1
.
then
(
function
()
{
transiteBtnOuterUp
(
$_this
);
return
rotateBtn
(
$_this
,
rotate_deg
);
})
.
then
(
function
()
{
resetBtnOuter
(
$_this
);
});
// $_this.addClass('active');
});
});
function
transiteBtnOuterDown
(
$_el
,
transZ
)
{
var
dtd
=
$
.
Deferred
();
var
transZ
=
transZ
||
-
40
;
$_el
.
transition
(
{
transform
:
"translate3d(0px,0px,"
+
transZ
+
"px)"
,
},
btn_transition_time
,
function
()
{
dtd
.
resolve
();
}
);
return
dtd
.
promise
();
}
return
dtd
.
promise
();
}
function
rotateBtn
(
$_el
,
rotate_deg
){
var
dtd
=
$
.
Deferred
();
$_el
.
parent
().
transition
({
transform
:
'rotate(-'
+
rotate_deg
+
'deg)'
},
btn_transition_time
,
function
(){
dtd
.
resolve
();
})
function
transiteBtnOuterUp
(
$_el
,
transZ
)
{
var
dtd
=
$
.
Deferred
();
var
transZ
=
transZ
||
50
;
$_el
.
transition
(
{
transform
:
"translate3d(0px,0px,"
+
transZ
+
"px)"
,
},
btn_transition_time
,
function
()
{
dtd
.
resolve
();
}
);
return
dtd
.
promise
();
}
return
dtd
.
promise
();
}
function
rotateBtn
(
$_el
,
rotate_deg
)
{
var
dtd
=
$
.
Deferred
();
function
resetBtnOuter
(
$_el
){
$_el
.
parent
().
transition
(
{
transform
:
"rotate(-"
+
rotate_deg
+
"deg)"
,
},
btn_transition_time
,
function
()
{
dtd
.
resolve
();
}
);
$_el
.
transition
({
transform
:
'translate3d(0px,0px,0px)'
},
btn_transition_time
)
}
return
dtd
.
promise
();
}
function
resetBtnOuter
(
$_el
)
{
$_el
.
transition
(
{
transform
:
"translate3d(0px,0px,0px)"
,
},
btn_transition_time
);
}
}
//右下信息中交互操作
$
(
'.aslist .content-list'
).
each
(
function
(){
$
(
this
).
hover
(
function
(){
$
(
this
).
addClass
(
'active'
);
},
function
(){
$
(
this
).
removeClass
(
'active'
)
})
})
})
$
(
".aslist .content-list"
).
each
(
function
()
{
$
(
this
).
hover
(
function
()
{
$
(
this
).
addClass
(
"active"
);
},
function
()
{
$
(
this
).
removeClass
(
"active"
);
}
);
});
});
js/q/datav3.q.utils.js
View file @
b8bac284
This diff is collapsed.
Click to expand it.
js/q/json.js
View file @
b8bac284
console
.
log
(
"------ q/json.js debug ------"
);
/** @license
* RequireJS plugin for loading JSON files
* - depends on Text plugin and it was HEAVILY "inspired" by it as well.
...
...
@@ -5,68 +7,89 @@
* Version: 0.4.0 (2014/04/10)
* Released under the MIT license
*/
define
([
'text'
],
function
(
text
){
var
CACHE_BUST_QUERY_PARAM
=
'bust'
,
CACHE_BUST_FLAG
=
'!bust'
,
jsonParse
=
(
typeof
JSON
!==
'undefined'
&&
typeof
JSON
.
parse
===
'function'
)?
JSON
.
parse
:
function
(
val
){
return
eval
(
'('
+
val
+
')'
);
//quick and dirty
},
buildMap
=
{};
function
cacheBust
(
url
){
url
=
url
.
replace
(
CACHE_BUST_FLAG
,
''
);
url
+=
(
url
.
indexOf
(
'?'
)
<
0
)?
'?'
:
'&'
;
return
url
+
CACHE_BUST_QUERY_PARAM
+
'='
+
Math
.
round
(
2147483647
*
Math
.
random
());
}
define
([
"text"
],
function
(
text
)
{
var
CACHE_BUST_QUERY_PARAM
=
"bust"
,
CACHE_BUST_FLAG
=
"!bust"
,
jsonParse
=
typeof
JSON
!==
"undefined"
&&
typeof
JSON
.
parse
===
"function"
?
JSON
.
parse
:
function
(
val
)
{
return
eval
(
"("
+
val
+
")"
);
//quick and dirty
},
buildMap
=
{};
//API
return
{
function
cacheBust
(
url
)
{
url
=
url
.
replace
(
CACHE_BUST_FLAG
,
""
);
url
+=
url
.
indexOf
(
"?"
)
<
0
?
"?"
:
"&"
;
return
(
url
+
CACHE_BUST_QUERY_PARAM
+
"="
+
Math
.
round
(
2147483647
*
Math
.
random
())
);
}
load
:
function
(
name
,
req
,
onLoad
,
config
)
{
if
((
config
.
isBuild
&&
(
config
.
inlineJSON
===
false
||
name
.
indexOf
(
CACHE_BUST_QUERY_PARAM
+
'='
)
!==
-
1
))
||
(
req
.
toUrl
(
name
).
indexOf
(
'empty:'
)
===
0
))
{
//avoid inlining cache busted JSON or if inlineJSON:false
//and don't inline files marked as empty!
onLoad
(
null
);
//API
return
{
load
:
function
(
name
,
req
,
onLoad
,
config
)
{
if
(
(
config
.
isBuild
&&
(
config
.
inlineJSON
===
false
||
name
.
indexOf
(
CACHE_BUST_QUERY_PARAM
+
"="
)
!==
-
1
))
||
req
.
toUrl
(
name
).
indexOf
(
"empty:"
)
===
0
)
{
//avoid inlining cache busted JSON or if inlineJSON:false
//and don't inline files marked as empty!
onLoad
(
null
);
}
else
{
text
.
get
(
req
.
toUrl
(
name
),
function
(
data
)
{
var
parsed
;
if
(
config
.
isBuild
)
{
buildMap
[
name
]
=
data
;
onLoad
(
data
);
}
else
{
text
.
get
(
req
.
toUrl
(
name
),
function
(
data
){
var
parsed
;
if
(
config
.
isBuild
)
{
buildMap
[
name
]
=
data
;
onLoad
(
data
);
}
else
{
try
{
parsed
=
jsonParse
(
data
);
}
catch
(
e
)
{
onLoad
.
error
(
e
);
}
onLoad
(
parsed
);
}
},
onLoad
.
error
,
{
accept
:
'application/json'
}
);
try
{
parsed
=
jsonParse
(
data
);
}
catch
(
e
)
{
onLoad
.
error
(
e
);
}
onLoad
(
parsed
);
}
},
},
onLoad
.
error
,
{
accept
:
"application/json"
,
}
);
}
},
normalize
:
function
(
name
,
normalize
)
{
// used normalize to avoid caching references to a "cache busted" request
if
(
name
.
indexOf
(
CACHE_BUST_FLAG
)
!==
-
1
)
{
name
=
cacheBust
(
name
);
}
// resolve any relative paths
return
normalize
(
name
);
},
//write method based on RequireJS official text plugin by James Burke
//https://github.com/jrburke/requirejs/blob/master/text.js
write
:
function
(
pluginName
,
moduleName
,
write
){
if
(
moduleName
in
buildMap
){
var
content
=
buildMap
[
moduleName
];
write
(
'define("'
+
pluginName
+
'!'
+
moduleName
+
'", function(){ return '
+
content
+
';});
\
n'
);
}
}
normalize
:
function
(
name
,
normalize
)
{
// used normalize to avoid caching references to a "cache busted" request
if
(
name
.
indexOf
(
CACHE_BUST_FLAG
)
!==
-
1
)
{
name
=
cacheBust
(
name
);
}
// resolve any relative paths
return
normalize
(
name
);
},
};
//write method based on RequireJS official text plugin by James Burke
//https://github.com/jrburke/requirejs/blob/master/text.js
write
:
function
(
pluginName
,
moduleName
,
write
)
{
if
(
moduleName
in
buildMap
)
{
var
content
=
buildMap
[
moduleName
];
write
(
'define("'
+
pluginName
+
"!"
+
moduleName
+
'", function(){ return '
+
content
+
";});
\n
"
);
}
},
};
});
js/q/svgHeader2.js
View file @
b8bac284
var
SvgHeader
=
function
(
el
,
textid
){
var
el
=
el
;
var
width
=
180
;
var
height
=
180
;
var
NS
=
"http://www.w3.org/2000/svg"
;
var
xlinkNS
=
"http://www.w3.org/1999/xlink"
;
var
svg
=
document
.
createElementNS
(
NS
,
"svg"
);
// var rec1 = document.createElementNS(NS, "path");
// var rec2 = document.createElementNS(NS, "path");
var
circle
=
document
.
createElementNS
(
NS
,
"path"
);
var
text
=
document
.
createElementNS
(
NS
,
"text"
);
var
textPath
=
document
.
createElementNS
(
NS
,
"textPath"
);
svg
.
setAttribute
(
"viewBox"
,
"0 0"
+
' '
+
width
+
' '
+
height
);
circle
.
setAttribute
(
"d"
,
"m 90,12 A 78,78 0 1,0 91,12"
);
circle
.
setAttribute
(
"id"
,
textid
);
circle
.
setAttribute
(
"class"
,
"text_circle"
);
textPath
.
setAttributeNS
(
xlinkNS
,
"xlink:href"
,
"#"
+
textid
);
textPath
.
setAttribute
(
'id'
,
'textpath'
+
textid
);
text
.
appendChild
(
textPath
);
svg
.
appendChild
(
circle
);
svg
.
appendChild
(
text
);
textPath
.
textContent
=
''
;
el
.
appendChild
(
svg
);
var
textend_deg
=
120
;
var
r_text
=
80
;
svg
.
querySelectorAll
(
'.circle'
)
function
setContent
(
content
){
// textPath.textContent = '';
textPath
.
textContent
=
content
;
// console.log('content')
// console.log(content)
// console.log(text.textLength)//暂不能删除
// console.log(text.getComputedTextLength())
// console.log(text.getNumberOfChars())
// var textstart_deg =text.textLength.animVal.value; //使用svg内部精确的计算值计算
var
textstart_deg
=
186
-
content
.
length
*
9
/
2
;
// 每个字符按10度计算
// console.log(textstart_deg)
function
degToArc
(
deg
){
return
deg
*
2
*
Math
.
PI
*
r_text
/
360
;
}
// var m=document.querySelectorAll("circle")[3];
circle
.
setAttribute
(
'transform'
,
'rotate(-'
+
textstart_deg
+
' 90 90)'
);
// midcircle.setAttribute('stroke-dasharray', arc_length+' '+(2*Math.PI*r_text-arc_length));
textstart_deg
=
0
;
}
return
{
setContent
:
setContent
}
}
console
.
log
(
"------ q/svgHeader2.js debug ------"
);
var
SvgHeader
=
function
(
el
,
textid
)
{
var
el
=
el
;
var
width
=
180
;
var
height
=
180
;
var
NS
=
"http://www.w3.org/2000/svg"
;
var
xlinkNS
=
"http://www.w3.org/1999/xlink"
;
var
svg
=
document
.
createElementNS
(
NS
,
"svg"
);
// var rec1 = document.createElementNS(NS, "path");
// var rec2 = document.createElementNS(NS, "path");
var
circle
=
document
.
createElementNS
(
NS
,
"path"
);
var
text
=
document
.
createElementNS
(
NS
,
"text"
);
var
textPath
=
document
.
createElementNS
(
NS
,
"textPath"
);
svg
.
setAttribute
(
"viewBox"
,
"0 0"
+
" "
+
width
+
" "
+
height
);
circle
.
setAttribute
(
"d"
,
"m 90,12 A 78,78 0 1,0 91,12"
);
circle
.
setAttribute
(
"id"
,
textid
);
circle
.
setAttribute
(
"class"
,
"text_circle"
);
textPath
.
setAttributeNS
(
xlinkNS
,
"xlink:href"
,
"#"
+
textid
);
textPath
.
setAttribute
(
"id"
,
"textpath"
+
textid
);
text
.
appendChild
(
textPath
);
svg
.
appendChild
(
circle
);
svg
.
appendChild
(
text
);
textPath
.
textContent
=
""
;
el
.
appendChild
(
svg
);
var
textend_deg
=
120
;
var
r_text
=
80
;
svg
.
querySelectorAll
(
".circle"
);
function
setContent
(
content
)
{
// textPath.textContent = '';
textPath
.
textContent
=
content
;
// console.log('content')
// console.log(content)
// console.log(text.textLength)//暂不能删除
// console.log(text.getComputedTextLength())
// console.log(text.getNumberOfChars())
// var textstart_deg =text.textLength.animVal.value; //使用svg内部精确的计算值计算
var
textstart_deg
=
186
-
(
content
.
length
*
9
)
/
2
;
// 每个字符按10度计算
// console.log(textstart_deg)
function
degToArc
(
deg
)
{
return
(
deg
*
2
*
Math
.
PI
*
r_text
)
/
360
;
}
// var m=document.querySelectorAll("circle")[3];
circle
.
setAttribute
(
"transform"
,
"rotate(-"
+
textstart_deg
+
" 90 90)"
);
// midcircle.setAttribute('stroke-dasharray', arc_length+' '+(2*Math.PI*r_text-arc_length));
textstart_deg
=
0
;
}
return
{
setContent
:
setContent
,
};
};
// var circular_as = $('.circular').eq(0).get()[0];
// var svgHeaderAs = new SvgHeader(circular_as,'textcircleas');
// svgHeaderAs.setContent('333333333333')
js/q/text.js
View file @
b8bac284
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment