Svg in Mirador 3 viewer

147 views Asked by At

I'm using Mirador viewer with annotation file that include 'xywh' values to set rectangels on the image. I want to use Svg instea, so i can draw polygons on the image. I found here: IIIF Api the annotation item struct to include svg, but it's not working for me. Can anybody help please? Thanks

1

There are 1 answers

0
Jack On

Can you provide an example of the SvgAnnotation that you are trying to use?

Mirador 3 should support this style of SvgAnnotation:

              "motivation": "commenting",
              "target": {
                "id": "https://iiif.bodleian.ox.ac.uk/iiif/canvas/9cca8fdd-4a61-4429-8ac1-f648764b4d6d.json",
                "selector": {
                  "type": "SvgSelector",
                  "value": "<path xmlns=\"http://www.w3.org/2000/svg\" d=\"M3548.40946,1221.66399c0,-84.79382 68.73897,-153.53279 153.53279,-153.53279c84.79382,0 153.53279,68.73897 153.53279,153.53279c0,84.79382 -68.73897,153.53279 -153.53279,153.53279c-84.79382,0 -153.53279,-68.73897 -153.53279,-153.53279z\" fill=\"none\" fill-rule=\"nonzero\" stroke=\"#00bfff\" stroke-width=\"1\" stroke-linecap=\"butt\" stroke-linejoin=\"miter\" stroke-miterlimit=\"10\" stroke-dasharray=\"\" stroke-dashoffset=\"0\" font-family=\"none\" font-weight=\"none\" font-size=\"none\" text-anchor=\"none\" style=\"mix-blend-mode: normal\"/>"
                }
              },
              "type": "Annotation"
            },

https://github.com/ProjectMirador/mirador/blob/5ca33205bf9bac636ba5ef0faf820f58c0d9751d/__tests__/fixtures/version-3/001.json#L301-L310