freegroup / draw2d

Create Visio like drawings, diagrams or workflows with JavaScript and HTML5
https://freegroup.github.io/draw2d/#/examples
MIT License
734 stars 226 forks source link

Add link support for Label #231

Closed kusigit closed 1 year ago

kusigit commented 1 year ago

How to use it:

const attr = {
  text: 'Page 1',
  href: '/page/1'
};
const label = new draw2d.shape.basic.Label(attr);
freegroup commented 1 year ago

why not implement a new element instead of changing the existing one?

freegroup commented 1 year ago

...and - thanks a lot for your contribution!

freegroup commented 1 year ago

maybe something like this? https://electra.academy/simulator/?shared=805eb6104c2f4b7b29c48628c5ad22f7c26b875c

You can even use "markdown" in a textbox ...with link support.

freegroup commented 1 year ago

this is the code for the markdown (or HTML) overlay. https://github.com/freegroup/electra/blob/main/shapes/data/global/widget/Markdown.js

It's not perfectly integrated....but works for my use-case.

the method getParameterSettings can be ignored. It is a callback of the application itself.

freegroup commented 1 year ago

https://github.com/freegroup/draw2d/tree/master/examples/shape_custom_markdown

markdown examples now support zooming the canvas - and links...