How to add line, arrow, text #548
Replies: 10 comments 19 replies
-
|
Hi, I'm afraid adding new shape types to Annotorious is not trivial. Here are the steps you'd need to take:
Step 3. and 4. can be done as plugins, outside of Annotorious (see here for an example). But the foundational rendering capability (steps 1 and 2) would have to be added to the core codebase. If you really just want to draw things on an image, without using the rest of Annotorious' capabilities (like annotation payload handling, real-time capable state management, large numbers of annotations, etc.) my recommendation is usually to go with something like Konva or Fabric.js instead, which is going to be easier to customize. |
Beta Was this translation helpful? Give feedback.
-
|
When might line and arrows be ready?
…On Sat, 7 Jun 2025, 15:13 Rainer Simon, ***@***.***> wrote:
P.S.: I'm planning to add lines (polyline + freehand) and points as
features. I'm less sure about arrows and text. I think I'd rather handle
those as special cases of point annotations, with some kind of custom
representation. That would require a bit of an architecture addition, I
guess. But it could be interesting in the long run.
—
Reply to this email directly, view it on GitHub
<#548 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIFXO4EOQ2VNXZ53SVU5ED3CKWFBAVCNFSM6AAAAAB6ZVXJBCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGMZZGY2TIOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
Surely lines are much simpler than rectangles and polygons? I'm happy to implement this and contribute the code if you could guide me step by step to adding lines thanks! |
Beta Was this translation helpful? Give feedback.
-
|
@alexandrep-explorai let me know once you've implemented it, i need this feature too ASAP. thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Wonderful looking forward to this. If you can add arrows too (its really just a simple variation of lines) that would be wonderful and very useful too. |
Beta Was this translation helpful? Give feedback.
-
|
I opened two PRs for what's been discussed here. #550: PR in this repo to add the line shape and update the rendering capabilities so it can be rendered both with the standalone library and with the OpenSeaDragon version Unfortunately all we really need for our project is the line functionality, so I didn't really do anything about arrows, but the PR may give you an idea of the work required. Although yes it would technically just a variation of a line, it can still get a little more complicated once you start thinking about the size of the arrow tip itself, and if you want to be able to control this aspect at all. |
Beta Was this translation helpful? Give feedback.
-
|
Is there a possibility to change the colour of the lines easily? |
Beta Was this translation helpful? Give feedback.
-
|
Yes I know about that but the user should be able to have a colour picker
and select the colour?
…On Fri, 13 Jun 2025 at 16:49, Rainer Simon ***@***.***> wrote:
See here: https://annotorious.dev/api-reference/drawing-style/
—
Reply to this email directly, view it on GitHub
<#548 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIFXO2TMBGWYEY2B4ZUSWD3DKV2ZAVCNFSM6AAAAAB6ZVXJBCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNBVHE4TQNY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
Yes, I very much appreciate that approach but it's also an openseadragon
plugin. It would be lovely to have it with all the features that users want
and need so there is no need for each user to have to fork it and make a
custom version?
…On Fri, 13 Jun 2025 at 17:02, Rainer Simon ***@***.***> wrote:
Annotorious is a JavaScript library. It provides the nuts and bolts that
you need in order to build your own, custom annotation applications.
But–in case that wasn't clear–building the application is up to you! If
you want to allow the user to use a color picker in your annotation, you
can take any color picker component of your choice, and wire it up with a
dynamic drawing style. You'd also need to store the color information in
the annotation. You would usually do this via a custom body, and using a
dynamic style as shown in the docs above.
—
Reply to this email directly, view it on GitHub
<#548 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIFXO2WRGPOW75ELK2NYCL3DKXOJAVCNFSM6AAAAAB6ZVXJBCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNBWGAYDQNY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
|
You mention support for points being added - I can see in one sense how to do this, but points feel unusual because of... the many ways they could render. My case is - I have annotation data that could be points, or rects, or polys; rects and polys render as their boundaries, but you don't want points to render as a single pixel, which is the literal representation of a single |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Greetings, how would I add a line, arrow or text annotation?
With kindest wishes
Martin
Beta Was this translation helpful? Give feedback.
All reactions