Skip to content

Instantly share code, notes, and snippets.

View rsimon's full-sized avatar

Rainer Simon rsimon

View GitHub Profile
{
"annotation_id":"e8698b97-1722-49ee-9752-c8a4ae2863ba", # UUID for this annotation
"version_id":"6c89639b-87c7-4f75-8f37-96212e8eef36", # separate UUID for this specific version
"annotates":{
"document_id":"7tqppvg1uo4qdo", # ID & content type of document/filepart the annotation annotates
"filepart_id":"5db80aa5-8a27-4539-aeb3-bddf3abc0098",
"content_type":[
"TEXT",
"TEXT_PLAIN"
]
@rsimon
rsimon / webanno_example.md
Last active November 21, 2019 14:31
Recogito IIIF + WebAnno example
@rsimon
rsimon / annotorious-firebase.html
Last active December 16, 2023 20:19
Using Firebase as Annotation Backend for Annotorious
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Annotorious | Firebase Demo</title>
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
<style>
html, body {
padding:20px;
margin:0px;
@rsimon
rsimon / annotorious-helloworld-plugin.js
Created September 11, 2020 09:45
Annotorious/Recogito 'Hello World' Example plugin
var HelloWorldPlugin = function(args) {
var currentColorBody = args.annotation ? args.annotation.bodies.find(function(b) {
return b.purpose == 'highlighting';
}) : null;
var currentColorValue = currentColorBody ? currentColorBody.value : null;
var addTag = function(evt) {
if (currentColorBody) {
@rsimon
rsimon / annotorious-opencv-find-contours.js
Last active March 1, 2024 08:00
Sample code for AnnotoriousOSD that automates polygon selection by tracing contours in the selected image section.
import OpenSeadragon from 'openseadragon';
import * as Annotorious from '@recogito/annotorious-openseadragon';
import '@recogito/annotorious-openseadragon/dist/annotorious.min.css';
/*************************************************************************
*
* Basic concept for this is from the official OpenCV docs:
* https://docs.opencv.org/3.4/dc/dcf/tutorial_js_contour_features.html
*
@rsimon
rsimon / App.jsx
Last active April 25, 2021 11:30
Minimal example for using https://annotorious.com in React
import { useEffect, useRef, useState } from 'react';
import { Annotorious } from '@recogito/annotorious';
import '@recogito/annotorious/dist/annotorious.min.css';
function App() {
// Ref to the image DOM element
const imgEl = useRef();
@rsimon
rsimon / linked-places-sample.json
Last active August 26, 2022 08:48
A Peripleo-compatible "gazetteer" (with a single LP place record)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsimon
rsimon / record-sample.json
Last active August 26, 2022 09:00
An example record list (with a single record)
[
{
"@id": "http://www.example.com/access-link",
"title": "Record title",
"type": {
"label": "Video"
},
"descriptions": [
{
"value": "This record's description",
{"@context":"http://iiif.io/api/presentation/3/context.json","id":"https://www.goudatijdmachine.nl/omeka/iiif/2/13/manifest","type":"Manifest","viewingDirection":"left-to-right","rights":"http://rightsstatements.org/vocab/CNE/1.0/","metadata":[{"label":{"none":["Naam"]},"value":{"none":["Gemeente-Atlas van Nederland naar officieele bronnen bewerkt, Gouda (1865-1870)"]}},{"label":{"none":["Plaats vervaardigd"]},"value":{"none":["<a class=\"resource-link\" href=\"https://www.goudatijdmachine.nl/omeka/s/data/item/37823\"><span class=\"resource-name\">Gouda</span></a>"]}},{"label":{"none":["Uitgever"]},"value":{"none":["<a class=\"resource-link\" href=\"https://www.goudatijdmachine.nl/omeka/s/data/item/37866\"><span class=\"resource-name\">Nationaal Archief</span></a>"]}},{"label":{"none":["Collectie"]},"value":{"none":["<a class=\"uri-value-link\" target=\"_blank\" href=\"https&#x3A;&#x2F;&#x2F;www.nationaalarchief.nl&#x2F;onderzoeken&#x2F;zoeken&#x3F;activeTab&#x3D;map_legacy\">Kaarten Zuid-Holland</a>"]}},{"la
@rsimon
rsimon / simple-image.json
Last active January 15, 2025 06:32
Test Manifest
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "https://iiif.io/api/cookbook/recipe/0001-mvm-image/manifest.json",
"type": "Manifest",
"label": {
"en": [
"Single Image Example"
]
},
"items": [