Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
raven-administration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
raven
raven-administration
Commits
b9be90b7
Commit
b9be90b7
authored
1 year ago
by
Christoffer Stoll
Browse files
Options
Downloads
Patches
Plain Diff
add: toggle between valid only values
parent
b0b19ddc
No related branches found
No related tags found
1 merge request
!14
new version - various bug fixes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/endpoints/qualitycontrol/validate/routes.py
+2
-1
2 additions, 1 deletion
api/endpoints/qualitycontrol/validate/routes.py
client/src/views/qualitycontrol/validate/Validate.vue
+23
-3
23 additions, 3 deletions
client/src/views/qualitycontrol/validate/Validate.vue
with
25 additions
and
4 deletions
api/endpoints/qualitycontrol/validate/routes.py
+
2
−
1
View file @
b9be90b7
...
...
@@ -26,7 +26,8 @@ def timevalues():
o.sampling_point_id as
"
sampling_point_id
"
,
o.validation_flag,
o.verification_flag,
case when o.value = -9900 then null else o.value::double PRECISION end as
"
value
"
case when o.value = -9900 then null else o.value::double PRECISION end as
"
value
"
,
case when o.validation_flag not in (1,2,3) then null else o.value::double PRECISION end as
"
valid_value_only
"
FROM observations o
WHERE 1=1
AND o.from_time >= %(from_dt)s
...
...
This diff is collapsed.
Click to expand it.
client/src/views/qualitycontrol/validate/Validate.vue
+
23
−
3
View file @
b9be90b7
...
...
@@ -16,6 +16,7 @@ import Plot from "./plot";
import
IconLink
from
"
~icons/ph/link-simple-duotone
"
;
import
Container
from
"
../../../components/Container.vue
"
;
import
{
watch
}
from
"
vue
"
;
const
timeseries
=
ref
([]);
...
...
@@ -27,6 +28,7 @@ const timevalues = ref([]);
const
ev
=
ref
({});
const
showContextmenu
=
ref
(
false
);
const
selectedRows
=
ref
([]);
const
showValidOnly
=
ref
(
false
);
const
showPlotAndTable
=
ref
(
false
);
...
...
@@ -44,6 +46,13 @@ onMounted(async () => {
if
(
route
.
query
.
ids
||
route
.
query
.
from
||
route
.
query
.
to
)
showData
();
});
watch
(
()
=>
showValidOnly
.
value
,
()
=>
{
formatAndLoad
();
}
);
const
cmp_timeseries
=
computed
(()
=>
{
return
timeseries
.
value
.
filter
((
t
)
=>
{
if
(
!
t
.
fromtime
&&
!
t
.
totime
)
return
true
;
...
...
@@ -72,6 +81,10 @@ const load = async () => {
if
(
!
chart
)
{
chart
=
new
Chart
(
"
chart
"
,
Plot
.
config
(
onDatapointSelection
));
}
formatAndLoad
();
};
const
formatAndLoad
=
()
=>
{
console
.
log
(
"
formatAndLoad
"
);
chart
.
data
=
formatValues
();
chart
.
update
();
};
...
...
@@ -127,11 +140,12 @@ const formatValues = () => {
let
colors
=
[];
let
data
=
[];
timevalues
.
value
.
forEach
((
o
)
=>
{
var
v
=
o
.
value
==
-
9900
?
null
:
o
.
value
;
var
value_to_use
=
showValidOnly
.
value
?
o
.
valid_value_only
:
o
.
value
;
var
v
=
value_to_use
==
-
9900
?
null
:
value_to_use
;
var
c
=
o
.
validation_flag
<
1
?
"
#BF616A
"
:
"
#A3BE8C
"
;
const
n
=
Object
.
assign
({},
o
);
colors
.
push
(
c
);
data
.
push
({
x
:
o
.
totime
.
replace
(
"
"
,
"
T
"
),
y
:
o
.
value
,
obj
:
n
});
data
.
push
({
x
:
o
.
totime
.
replace
(
"
"
,
"
T
"
),
y
:
v
,
obj
:
n
});
});
return
{
datasets
:
[
Plot
.
dataset
(
"
Value
"
,
data
,
colors
)]
};
};
...
...
@@ -201,7 +215,13 @@ const onDatapointSelection = (event, sel, chart) => {
</container>
<div
v-show=
"showPlotAndTable"
>
<container
class=
"mt-4 !p-4 h-72"
><canvas
id=
"chart"
></canvas></container>
<container
class=
"mt-4 !p-4 h-72"
>
<div
class=
"px-2 flex w-fit gap-2"
>
<div
class=
"font-bold self-center flex-1 cursor-pointer"
@
click=
"showValidOnly = !showValidOnly"
>
Show only valid values
</div>
<n-checkbox
v-model=
"showValidOnly"
class=
"self-center"
/>
</div>
<canvas
id=
"chart"
></canvas>
</container>
<div
class=
"mt-4"
>
<table
id=
"validationId"
class=
"n-table"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment