Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
graph
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
李伟@五瓣科技
graph
Commits
3b088723
Commit
3b088723
authored
Nov 09, 2022
by
wenli.huang@wuban.net.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
f61f2feb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
17 deletions
+48
-17
App.js
src/App.js
+48
-17
No files found.
src/App.js
View file @
3b088723
...
@@ -20,7 +20,9 @@ class App extends Component {
...
@@ -20,7 +20,9 @@ class App extends Component {
time
:
-
100
,
time
:
-
100
,
getTime
:
-
100
,
getTime
:
-
100
,
blockOld
:
0
,
blockOld
:
0
,
endblockOld
:
0
,
count
:
0
,
count
:
0
,
endCount
:
0
,
}
}
inputChangeValue
=
(
e
)
=>
{
inputChangeValue
=
(
e
)
=>
{
this
.
setState
({
this
.
setState
({
...
@@ -111,7 +113,7 @@ class App extends Component {
...
@@ -111,7 +113,7 @@ class App extends Component {
newData
.
result
.
Links
=
allLinksArr
newData
.
result
.
Links
=
allLinksArr
that
.
initChart
(
newData
)
that
.
initChart
(
newData
)
})
})
},
5
000
);
},
60
000
);
}
}
var
chartDom
=
document
.
getElementById
(
'
main
'
);
var
chartDom
=
document
.
getElementById
(
'
main
'
);
var
myChart
=
echarts
.
init
(
chartDom
);
var
myChart
=
echarts
.
init
(
chartDom
);
...
@@ -191,23 +193,37 @@ class App extends Component {
...
@@ -191,23 +193,37 @@ class App extends Component {
myChart
.
showLoading
()
myChart
.
showLoading
()
console
.
log
(
startBlock
,
'
startBlock
'
)
console
.
log
(
startBlock
,
'
startBlock
'
)
if
(
startBlock
!=
0
){
//
if(startBlock !=0 ){
that
.
setState
({
//
that.setState({
blockOld
:
startBlock
,
//
blockOld:startBlock,
count
:
0
,
//
count:0,
})
//
})
}
else
if
(
startBlock
==
0
||
startBlock
==
""
||
startBlock
==
undefined
){
//
} else if(startBlock == 0 || startBlock == "" || startBlock == undefined){
that
.
setState
({
//
that.setState({
startBlock
:
that
.
state
.
blockOld
,
//
startBlock:that.state.blockOld,
count
:
that
.
state
.
count
+
1
,
//
count:that.state.count+1,
requestDuration
:
that
.
state
.
requestDuration
*
(
that
.
state
.
count
+
1
)
//
requestDuration:that.state.requestDuration*(that.state.count+1)
})
//
})
}
//
}
that
.
setState
({
that
.
setState
({
requestDuration
:
-
100
,
requestDuration
:
-
100
,
duration
:
-
10
,
duration
:
-
10
,
},()
=>
{
},()
=>
{
if
(
startBlock
!=
0
){
that
.
setState
({
blockOld
:
startBlock
,
count
:
0
,
})
}
else
if
(
startBlock
==
0
||
startBlock
==
""
||
startBlock
==
undefined
){
that
.
setState
({
startBlock
:
that
.
state
.
blockOld
,
count
:
that
.
state
.
count
+
1
,
requestDuration
:
that
.
state
.
requestDuration
*
(
that
.
state
.
count
+
1
)
})
}
console
.
log
(
that
.
state
.
requestDuration
,
'
requestDurationfgfgf
'
)
console
.
log
(
startBlock
,
'
startBlock
'
)
console
.
log
(
that
.
state
.
count
,
'
count
'
)
fetch
(
`/api/graph_by_height_and_duration?height=
${
startBlock
}
&duration=
${
that
.
state
.
requestDuration
}
`
,{
fetch
(
`/api/graph_by_height_and_duration?height=
${
startBlock
}
&duration=
${
that
.
state
.
requestDuration
}
`
,{
method
:
'
GET
'
,
method
:
'
GET
'
,
headers
:{
headers
:{
...
@@ -243,6 +259,21 @@ class App extends Component {
...
@@ -243,6 +259,21 @@ class App extends Component {
requestDuration
:
100
,
requestDuration
:
100
,
duration
:
10
,
duration
:
10
,
},()
=>
{
},()
=>
{
if
(
startBlock
!=
0
){
that
.
setState
({
endblockOld
:
endBlock
,
endCount
:
0
,
})
}
else
if
(
startBlock
==
0
||
startBlock
==
""
||
startBlock
==
undefined
){
that
.
setState
({
endBlock
:
that
.
state
.
endblockOld
,
endCount
:
that
.
state
.
endCount
+
1
,
requestDuration
:
that
.
state
.
requestDuration
*
(
that
.
state
.
endCount
+
1
)
})
}
console
.
log
(
that
.
state
.
requestDuration
,
'
requestDurationfgfgf
'
)
console
.
log
(
endBlock
,
'
startBlock
'
)
console
.
log
(
that
.
state
.
endCount
,
'
endCount
'
)
fetch
(
`/api/graph_by_height_and_duration?height=
${
endBlock
}
&duration=
${
that
.
state
.
requestDuration
}
`
,{
fetch
(
`/api/graph_by_height_and_duration?height=
${
endBlock
}
&duration=
${
that
.
state
.
requestDuration
}
`
,{
method
:
'
GET
'
,
method
:
'
GET
'
,
headers
:{
headers
:{
...
@@ -312,7 +343,7 @@ class App extends Component {
...
@@ -312,7 +343,7 @@ class App extends Component {
newData
.
result
.
Links
=
allLinksArr
newData
.
result
.
Links
=
allLinksArr
that
.
initChart
(
newData
)
that
.
initChart
(
newData
)
})
})
},
5
000
);
},
60
000
);
}
else
{
}
else
{
clearInterval
(
that
.
interval
)
clearInterval
(
that
.
interval
)
}
}
...
@@ -665,13 +696,13 @@ class App extends Component {
...
@@ -665,13 +696,13 @@ class App extends Component {
<
div
style
=
{{
width
:
'
50%
'
,
display
:
'
flex
'
,
justifyContent
:
'
space-around
'
}}
>
<
div
style
=
{{
width
:
'
50%
'
,
display
:
'
flex
'
,
justifyContent
:
'
space-around
'
}}
>
<
div
>
<
div
>
<
input
value
=
{
this
.
state
.
value
}
onChange
=
{
this
.
inputChangeValue
}
style
=
{{
width
:
'
30%
'
,
textAlign
:
'
center
'
}}
/
>
<
input
value
=
{
this
.
state
.
value
}
onChange
=
{
this
.
inputChangeValue
}
style
=
{{
width
:
'
30%
'
,
textAlign
:
'
center
'
}}
/
>
<
button
onClick
=
{
this
.
getInputHeight
}
style
=
{{
cursor
:
'
pointer
'
}}
>
切换高度
<
/button
>
<
button
onClick
=
{
this
.
getInputHeight
}
style
=
{{
cursor
:
'
pointer
'
}}
>
双击
切换高度
<
/button
>
<
/div
>
<
/div
>
{
/* <div>
{
/* <div>
<input value={this.state.time} onChange={this.inputChangeTime} style={{width:'30%',textAlign:'center'}}/>
<input value={this.state.time} onChange={this.inputChangeTime} style={{width:'30%',textAlign:'center'}}/>
<button onClick={this.getInputTime} style={{cursor:'pointer'}}>切换时间</button>
<button onClick={this.getInputTime} style={{cursor:'pointer'}}>切换时间</button>
</div> */
}
</div> */
}
<
div
>
当前高度:
{
this
.
state
.
v
alue
}
<
/div
>
<
div
>
当前高度:
{
this
.
state
.
getV
alue
}
<
/div
>
<
div
>
当前时间:
{
this
.
state
.
requestDuration
}
<
/div
>
<
div
>
当前时间:
{
this
.
state
.
requestDuration
}
<
/div
>
<
/div
>
<
/div
>
<
div
style
=
{{
position
:
'
relative
'
}}
>
<
div
style
=
{{
position
:
'
relative
'
}}
>
...
...
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