Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
WidgetUI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WuFeiyang
WidgetUI
Commits
51e6a7d8
Commit
51e6a7d8
authored
Dec 30, 2019
by
WuFeiyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重载更改
parent
33b6de67
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
7 deletions
+48
-7
src/components/WaveView/setBasicParams.vue
src/components/WaveView/setBasicParams.vue
+48
-7
No files found.
src/components/WaveView/setBasicParams.vue
View file @
51e6a7d8
...
...
@@ -74,6 +74,7 @@ export default class setBasicParams extends Vue {
temp
:
any
=
{};
ExpectedDotNum
:
number
=
1000
;
ExpansionMultiple
:
number
=
1
;
annotations
:
any
;
created
()
{
this
.
config
.
data
.
userInputData
=
this
.
userInputData
;
...
...
@@ -356,11 +357,11 @@ export default class setBasicParams extends Vue {
x
:
data_initial
[
0
].
x
[
nearestIndex
],
y
:
data_initial
[
0
].
y
[
nearestIndex
]
}
var
annotations
=
[];
annotations
.
push
(
annotation
);
this
.
annotations
=
[];
this
.
annotations
.
push
(
annotation
);
var
layout_update
=
{
annotations
:
annotations
annotations
:
this
.
annotations
};
...
...
@@ -449,20 +450,23 @@ export default class setBasicParams extends Vue {
var
pathProcessor
=
this
.
pathProcessor
var
config
=
this
.
config
;
var
tempUserInputData
=
this
.
tempUserInputData
;
var
addAnnotations
=
this
.
addAnnotations
;
zoom
();
function
zoom
()
{
console
.
log
(
"
c
"
);
myPlot
.
on
(
"
plotly_relayout
"
,
function
(
data
:
any
)
{
myPlot
.
on
(
"
plotly_relayout
"
,
(
data
:
any
)
=>
{
console
.
log
(
"
d
"
);
if
(
!
data
[
"
xaxis.autorange
"
])
{
console
.
log
(
data
);
if
(
!
data
[
"
xaxis.autorange
"
]
&&
data
[
"
xaxis.range[0]
"
])
{
var
nowZoom_xmin
=
data
[
"
xaxis.range[0]
"
];
var
nowZoom_xmax
=
data
[
"
xaxis.range[1]
"
];
var
x_range
=
nowZoom_xmax
-
nowZoom_xmin
;
expansionStartTime
=
Number
(
nowZoom_xmin
)
-
expansionMultiple
*
x_range
>=
xmin
?
Number
(
nowZoom_xmin
)
-
expansionMultiple
*
x_range
:
xmin
;
expansionEndTime
=
Number
(
nowZoom_xmax
)
+
expansionMultiple
*
x_range
<=
xmax
?
Number
(
nowZoom_xmax
)
+
expansionMultiple
*
x_range
:
xmax
;
console
.
log
(
nowDotNum
);
console
.
log
((
x_range
/
nowRange
)
*
nowDotNum
);
if
(
expansionStartTime
<
zoom_xmin
||
expansionEndTime
>
zoom_xmax
||
...
...
@@ -509,6 +513,7 @@ export default class setBasicParams extends Vue {
getDataTimeAxis
(
timeUrl
);
nowDotNum
=
temp
.
dataTimeAxis
.
length
;
getConfig
.
data
.
position
.
x1
=
zoom_xmin
;
...
...
@@ -542,10 +547,39 @@ export default class setBasicParams extends Vue {
createChannelChart
(
myPlot
,
data_initial
);
zoom
();
});
myPlot
.
on
(
"
plotly_click
"
,
function
(
data
:
any
){
//当前区域的范围
console
.
log
(
"
plotly_click
"
)
console
.
log
(
data
.
points
[
0
].
xaxis
.
range
);
console
.
log
(
data
.
points
[
0
].
yaxis
.
range
);
console
.
log
(
data
);
var
pts
=
''
;
for
(
var
i
=
0
;
i
<
data
.
points
.
length
;
i
++
){
var
annotate_text
=
'
x =
'
+
data
.
points
[
i
].
x
+
'
y =
'
+
data
.
points
[
i
].
y
.
toPrecision
(
4
);
var
annotation
=
{
text
:
annotate_text
,
x
:
data
.
points
[
i
].
x
,
y
:
parseFloat
(
data
.
points
[
i
].
y
.
toPrecision
(
4
))
}
var
annotations
=
[];
annotations
.
push
(
annotation
);
addAnnotations
(
annotations
);
Plotly
.
relayout
(
myPlot
,{
annotations
:
annotations
});
PubSub
.
publish
(
'
PlotlyClick
'
,{
x
:
data
.
points
[
i
].
x
,
y
:
data
.
points
[
i
].
y
.
toPrecision
(
4
)});
}
});
}
}
addAnnotations
(
annotations
:
any
)
{
this
.
annotations
=
annotations
;
}
createChannelChart
(
myPlot
:
any
,
data_update
:
any
,
data_layout
:
any
=
{})
{
data_layout
.
margin
=
{
t
:
20
};
...
...
@@ -555,7 +589,14 @@ export default class setBasicParams extends Vue {
};
Plotly
.
newPlot
(
myPlot
,
data_update
,
data_layout
,
config
);
if
(
this
.
annotations
)
{
console
.
log
(
"
createChannelChart
"
);
Plotly
.
relayout
(
myPlot
,{
annotations
:
this
.
annotations
});
}
}
async
getData
(
url
:
any
)
{
var
apiLoad
=
url
;
console
.
log
(
"
getData
"
);
//改
...
...
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