Skip to content

Add link support for Label#231

Merged
freegroup merged 5 commits intofreegroup:masterfrom
imedico:links
Feb 1, 2023
Merged

Add link support for Label#231
freegroup merged 5 commits intofreegroup:masterfrom
imedico:links

Conversation

@kusigit
Copy link
Copy Markdown
Contributor

@kusigit kusigit commented Feb 1, 2023

How to use it:

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

@freegroup
Copy link
Copy Markdown
Owner

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

@freegroup
Copy link
Copy Markdown
Owner

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

@freegroup
Copy link
Copy Markdown
Owner

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

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

@freegroup freegroup merged commit 6eb89a6 into freegroup:master Feb 1, 2023
@kusigit kusigit deleted the links branch February 1, 2023 12:37
@freegroup
Copy link
Copy Markdown
Owner

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
Copy link
Copy Markdown
Owner

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants