Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
quiver-frontend-local
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
subugoe
OCR-D
quiver-frontend-local
Commits
3579bbb4
Commit
3579bbb4
authored
2 years ago
by
Paul Pestov
Browse files
Options
Downloads
Patches
Plain Diff
Fix workflows table according to latest API changes
parent
51cd86df
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/workflows/WorkflowsTable.vue
+20
-10
20 additions, 10 deletions
src/components/workflows/WorkflowsTable.vue
src/helpers/shorten-cer.js
+7
-0
7 additions, 0 deletions
src/helpers/shorten-cer.js
with
27 additions
and
10 deletions
src/components/workflows/WorkflowsTable.vue
+
20
−
10
View file @
3579bbb4
...
@@ -38,15 +38,16 @@
...
@@ -38,15 +38,16 @@
</td>
</td>
<td
class=
"vertical-align-top pt-2"
>
{{
subject
.
label
}}
</td>
<td
class=
"vertical-align-top pt-2"
>
{{
subject
.
label
}}
</td>
<td
<td
v-for=
"(
evaluation
, k) in subject.evaluations"
v-for=
"(
{ name, value }
, k) in subject.evaluations"
:key="k"
:key="k"
class="text-center border-left-1 border-gray-400 pt-2"
class="text-center border-left-1 border-gray-400 pt-2"
:class="(j === groupedData[key].subjects.length - 1) ? 'pb-5' : ''"
:class="(j === groupedData[key].subjects.length - 1) ? 'pb-5' : ''"
>
>
<span
<span
class=
"border-round-3xl py-1 px-3"
class=
"border-round-3xl py-1 px-3"
:class=
"getEvalColor(name, value)"
>
:class=
"getEvalColor(evaluation.name, evaluation.value)"
>
<template
v-if=
" name === 'cer'"
>
{{
shortenCER
(
value
)
}}
</
template
>
{{
evaluation
.
value
}}
<
template
v-else-if=
"name === 'cer_min_max'"
>
{{
shortenCER
(
value
[
0
])
+
'
/
'
+
shortenCER
(
value
[
1
])
}}
</
template
>
<
template
v-else
>
{{
value
}}
</
template
>
</span>
</span>
</td>
</td>
</tr>
</tr>
...
@@ -60,6 +61,7 @@
...
@@ -60,6 +61,7 @@
import
{
watch
,
ref
}
from
"
vue
"
;
import
{
watch
,
ref
}
from
"
vue
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
useI18n
}
from
"
vue-i18n
"
;
import
{
getEvalColor
}
from
"
@/helpers/eval-colors
"
;
import
{
getEvalColor
}
from
"
@/helpers/eval-colors
"
;
import
{
shortenCER
}
from
"
@/helpers/shorten-cer
"
;
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
props
=
defineProps
([
'
data
'
,
'
defs
'
]);
const
props
=
defineProps
([
'
data
'
,
'
defs
'
]);
...
@@ -84,13 +86,13 @@ const groupByWorkflows = () => {
...
@@ -84,13 +86,13 @@ const groupByWorkflows = () => {
const
ocrWorkflowId
=
cur
.
metadata
.
ocr_workflow
[
'
@id
'
];
const
ocrWorkflowId
=
cur
.
metadata
.
ocr_workflow
[
'
@id
'
];
const
label
=
cur
.
metadata
.
ocr_workflow
.
label
;
const
label
=
cur
.
metadata
.
ocr_workflow
.
label
;
evals
.
value
=
Object
.
keys
(
cur
.
evaluation
.
document_wide
);
evals
.
value
=
Object
.
keys
(
cur
.
evaluation
_results
.
document_wide
);
const
subject
=
{
const
subject
=
{
label
:
cur
.
metadata
.
gt_workspace
.
label
,
label
:
cur
.
metadata
.
gt_workspace
.
label
,
evaluations
:
Object
.
keys
(
cur
.
evaluation
.
document_wide
).
map
(
key
=>
({
evaluations
:
Object
.
keys
(
cur
.
evaluation
_results
.
document_wide
).
map
(
key
=>
({
name
:
key
,
name
:
key
,
value
:
cur
.
evaluation
.
document_wide
[
key
]
value
:
cur
.
evaluation
_results
.
document_wide
[
key
]
}))
}))
};
};
if
(
!
acc
[
ocrWorkflowId
])
{
if
(
!
acc
[
ocrWorkflowId
])
{
...
@@ -100,6 +102,10 @@ const groupByWorkflows = () => {
...
@@ -100,6 +102,10 @@ const groupByWorkflows = () => {
};
};
}
else
{
}
else
{
acc
[
ocrWorkflowId
].
subjects
.
push
(
subject
);
acc
[
ocrWorkflowId
].
subjects
.
push
(
subject
);
acc
[
ocrWorkflowId
].
subjects
.
sort
((
a
,
b
)
=>
{
if
(
a
.
label
>
b
.
label
)
return
1
;
else
return
-
1
;
});
}
}
return
acc
;
return
acc
;
},
{});
},
{});
...
@@ -109,12 +115,12 @@ const groupByDocuments = () => {
...
@@ -109,12 +115,12 @@ const groupByDocuments = () => {
groupedData
.
value
=
props
.
data
.
filter
(
item
=>
!!
(
item
.
metadata
.
gt_workspace
)).
reduce
((
acc
,
cur
)
=>
{
groupedData
.
value
=
props
.
data
.
filter
(
item
=>
!!
(
item
.
metadata
.
gt_workspace
)).
reduce
((
acc
,
cur
)
=>
{
const
gtWorkspaceId
=
cur
.
metadata
.
gt_workspace
[
'
@id
'
];
const
gtWorkspaceId
=
cur
.
metadata
.
gt_workspace
[
'
@id
'
];
const
label
=
cur
.
metadata
.
gt_workspace
.
label
;
const
label
=
cur
.
metadata
.
gt_workspace
.
label
;
evals
.
value
=
Object
.
keys
(
cur
.
evaluation
.
document_wide
);
evals
.
value
=
Object
.
keys
(
cur
.
evaluation
_results
.
document_wide
);
const
subject
=
{
const
subject
=
{
label
:
cur
.
metadata
.
ocr_workflow
.
label
,
label
:
cur
.
metadata
.
ocr_workflow
.
label
,
evaluations
:
Object
.
keys
(
cur
.
evaluation
.
document_wide
).
map
(
key
=>
({
evaluations
:
Object
.
keys
(
cur
.
evaluation
_results
.
document_wide
).
map
(
key
=>
({
name
:
key
,
name
:
key
,
value
:
cur
.
evaluation
.
document_wide
[
key
]
value
:
cur
.
evaluation
_results
.
document_wide
[
key
]
}))
}))
};
};
if
(
!
acc
[
gtWorkspaceId
])
{
if
(
!
acc
[
gtWorkspaceId
])
{
...
@@ -124,6 +130,10 @@ const groupByDocuments = () => {
...
@@ -124,6 +130,10 @@ const groupByDocuments = () => {
};
};
}
else
{
}
else
{
acc
[
gtWorkspaceId
].
subjects
.
push
(
subject
);
acc
[
gtWorkspaceId
].
subjects
.
push
(
subject
);
acc
[
gtWorkspaceId
].
subjects
.
sort
((
a
,
b
)
=>
{
if
(
a
.
label
>
b
.
label
)
return
1
;
else
return
-
1
;
});
}
}
return
acc
;
return
acc
;
},
{});
},
{});
...
...
This diff is collapsed.
Click to expand it.
src/helpers/shorten-cer.js
0 → 100644
+
7
−
0
View file @
3579bbb4
const
shortenCER
=
(
value
)
=>
{
return
Math
.
round
(
value
*
1000
)
/
1000
;
};
export
{
shortenCER
};
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