rough-notation icon indicating copy to clipboard operation
rough-notation copied to clipboard

Idea: Arrows

Open beeing opened this issue 5 years ago • 9 comments

Hi, thanks for this great library. I've been searching for hand drawn arrow for many years and this looks a great potential to do it.

Arrows

Will be useful for libraries such as tourjs or introjs.

Thanks!

beeing avatar Jun 14 '20 07:06 beeing

I had thought of arrows. Never hashed out the details of it though . From an API perspective should the arrow go from one element to another? Describing all the properties of the arrow - shape, direction, thickness, length, etc

pshihn avatar Jun 14 '20 10:06 pshihn

Hi @pshihn, the easiest is to go from one element to the other and then add thing incrementally.

Since your API is based on object, it is quite extensible. I would think the API would be something like:

annotate(e, {
  type: 'arrow',
  from: 'element'
});

that will draw a straight arrow, or with more options:

annotate(e, {
  type: 'arrow',
  from: 'element',
  bents: [['10%', +10, -20]],
  start: () => {},
  end: () => {}
});

Just a sketchy idea. Thanks.

beeing avatar Jun 15 '20 01:06 beeing

RoughAnnotationConfig should be the common properties, and those arrow only properties maybe should be wrapped in arrowOptions ?

Leecason avatar Jun 15 '20 05:06 Leecason

There are a lot of things to consider if arrow is "bound" to 2 elements. As the elements move around or change in size due to layout, updating the arrow could be tricky.

A simpler first step would be to just annotate arrows bound an element. Specify direction and length.

It would be nice to document some discrete examples or use cases for this.

pshihn avatar Jun 16 '20 22:06 pshihn

Just wanted to say how awesome this would be.

feliperaul avatar Jun 28 '22 04:06 feliperaul

+1

Bevebage avatar Jul 14 '22 21:07 Bevebage

i like this!

lucasverra avatar Jul 29 '22 18:07 lucasverra