Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mirador annotations
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
Service Desk
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IIIF
Mirador
Mirador annotations
Commits
bd700549
Commit
bd700549
authored
1 year ago
by
Anthony
Browse files
Options
Downloads
Patches
Plain Diff
WIP Saving fake data + recover last data from drawing
parent
a6e095fa
No related branches found
No related tags found
1 merge request
!10
Draft: MigratingAnnotationCreation to MUI5.
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/AnnotationCreation.js
+4
-0
4 additions, 0 deletions
src/AnnotationCreation.js
src/AnnotationCreationUtils.js
+1
-0
1 addition, 0 deletions
src/AnnotationCreationUtils.js
src/WebAnnotation.js
+16
-6
16 additions, 6 deletions
src/WebAnnotation.js
with
21 additions
and
6 deletions
src/AnnotationCreation.js
+
4
−
0
View file @
bd700549
...
...
@@ -95,6 +95,10 @@ function AnnotationCreation(props) {
annoState
.
xywh
=
geomFromAnnoTarget
(
props
.
annotation
.
target
);
[
tstart
,
tend
]
=
timeFromAnnoTarget
(
props
.
annotation
.
target
);
}
if
(
props
.
annotation
.
drawingState
)
{
setDrawingState
(
JSON
.
parse
(
props
.
annotation
.
drawingState
));
}
}
// If we don't have tstart setted, we are creating a new annotation.
...
...
This diff is collapsed.
Click to expand it.
src/AnnotationCreationUtils.js
+
1
−
0
View file @
bd700549
...
...
@@ -53,6 +53,7 @@ export function isShapesTool(activeTool) {
export
async
function
getSvg
(
windowId
)
{
const
stage
=
window
.
Konva
.
stages
.
find
((
s
)
=>
s
.
attrs
.
id
===
windowId
);
const
svg
=
await
exportStageSVG
(
stage
,
false
);
// TODO clean
console
.
log
(
'
SVG:
'
,
svg
);
return
svg
;
};
...
...
This diff is collapsed.
Click to expand it.
src/WebAnnotation.js
+
16
−
6
View file @
bd700549
...
...
@@ -10,7 +10,8 @@ export default class WebAnnotation {
this
.
body
=
body
;
this
.
tags
=
tags
;
this
.
svg
=
svg
;
this
.
image
=
image
;
//this.image = image;
this
.
image
=
null
;
this
.
manifestId
=
manifestId
;
this
.
drawingState
=
drawingStateSerialized
;
...
...
@@ -19,14 +20,16 @@ export default class WebAnnotation {
/** */
toJson
()
{
return
{
const
result
=
{
body
:
this
.
createBody
(),
id
:
this
.
id
,
motivation
:
'
commenting
'
,
target
:
this
.
target
(),
type
:
'
Annotation
'
,
drawingState
Serialized
:
this
.
drawingState
Serialized
,
drawingState
:
this
.
drawingState
,
};
console
.
log
(
'
WebAnnotation toJson
'
,
result
);
return
result
;
}
/** */
...
...
@@ -41,13 +44,20 @@ export default class WebAnnotation {
}
if
(
this
.
image
)
{
// TODO dumb image { this.image.id}
const
imgBody
=
{
id
:
this
.
image
.
id
,
id
:
'
https://tetras-libre.fr/themes/tetras/img/logo.svg
'
,
type
:
'
Image
'
,
format
:
'
image/svg+xml
'
,
};
bodies
.
push
(
imgBody
);
//bodies.push(imgBody);
const
testImageBody
=
{
"
id
"
:
"
http://iiif.tetras-libre.fr/data/Hakanai/media/10_HKN-Garges_A2B4243.JPG
"
,
"
type
"
:
"
Image
"
,
"
format
"
:
"
image/jpg
"
,
"
value
"
:
"
<a href=
\"
http://iiif.tetras-libre.fr/data/Hakanai/media/10_HKN-Garges_A2B4243.JPG
\"
target=
\"
_blank
\"
>Dispositif</a>
"
};
bodies
.
push
(
testImageBody
);
}
// if (this.tags) {
...
...
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