Added "Classes" that is then consumed by LinkWidget to make custom links possible.#478
Added "Classes" that is then consumed by LinkWidget to make custom links possible.#478Etzix wants to merge 1 commit intoBlazor-Diagrams:developfrom
Conversation
|
Hey, please see my comment on the other PR, I'd like your opinion as well! |
|
Its a bit more complicated to use but it the end it does provide the same functionality so why not! Good job |
I'm not sure what you mean. There are no inline styles here. This adds a parameter called Class that lets you set your own classes on the component. This is how it's done in nearly all modern component libraries. |
This example changes the style of all links. This PR solves the issue of being able to style multiple links differently. |
No, that would not solve the problem. |
No, it is only possible to change color at the moment, by using the "Color" parameter. It Is not possible to target specific links with CSS without my PR. |
|
It would be nice if we could get this feature merged (or even this one #386) . I think allowing for more distinguishable links (other than by color and width) within a single diagram helps a lot of projects 🙂. |
|
Unless I am missing something can't this already be achieved (but with a bit more work), by creating a custom Link Model that extends the LinkModel and takes in a string for a class. And then registering it The componenent would look something like: I have already done something like this in my own project to give some lines a lower opacity then others. |
|



While i do prefer the other solution, this one avoids the usage of BaseLinkModel in favour of LinkModel.
Since we already accept "Color" in LinkModel, "Classes" should be fine here too.
Using CSS ":has" you are also able to target the
<g>tag in this way if you want to:This PR is in response to this one: #386