Blazor-Diagrams / Blazor.Diagrams

A fully customizable and extensible all-purpose diagrams library for Blazor
https://blazor-diagrams.zhaytam.com
MIT License
1.01k stars 205 forks source link

Added Classes to LinkRenderer #386

Open snakex64 opened 11 months ago

snakex64 commented 11 months ago

I added a "Classes" property to BaseLinkModel which is then used in the LinkRenderer. This allow users to add a css class to the element of a link

SleemMostafa commented 7 months ago

hello @snakex64 i need added style to link like image or control in size arrow can inform me how can i do this ?

snakex64 commented 7 months ago

hello @snakex64 i need added style to link like image or control in size arrow can inform me how can i do this ?

Sorry mate, no idea! After 5 months I'm still waiting for the simplest ever PR to be merged 😴. Slowly giving up

Etzix commented 4 months ago

This is highly needed, and seeing that its not been merged after so long even though its such a simple addition doesn't leave one feeling very hopeful for this repository.

zHaytam commented 2 months ago

Hello, sorry that this took A LOT of time for me to check it, I was dealing with some stuff.

The "issue" I see in this PR is that I am trying not to put UI properties in the models (Core project) to separate the two, so Classes doesn't fit in BaseLinkModel because it's only UI related, not behavior related.

I'm not sure what to do in this case...

fernandomondo commented 2 months ago

Hi everyone, I was looking for the exact same feature.

I need to conditionally add a class to a Link (the "g" tag) to change its color, animate it, etc.

The ideal approach, in my view, is to use a custom LinkRenderer. Is it possible to have my own CustomLinkRenderer.cs file being used?

How can I do that?

Etzix commented 1 month ago

@zHaytam I apologize for my previous comment, it was insensitive and i will act better in the future.

I still really want this feature so that we are able to individually style links between nodes. Right now you are only able to style all links at the same time as far as i know (except color).

Perhaps its possible to add the "Classes" to the LinkModel instead, and then consume it in the LinkWidget , like we do with Color today? It would give us a way to target individual links for styling, or even behaviour with DOM manipulation.

snakex64 commented 1 month ago

Hello, sorry that this took A LOT of time for me to check it, I was dealing with some stuff.

The "issue" I see in this PR is that I am trying not to put UI properties in the models (Core project) to separate the two, so Classes doesn't fit in BaseLinkModel because it's only UI related, not behavior related.

I'm not sure what to do in this case...

Hey! Never got a notification that you replied on here. Kinda forgot about it, I have been using my own fork for a while now.

Do you have any idea how to allow modifying the look of the link renderer other than the proposed implementation ? Being able to change the look of the links is important in many cases.

Thanks for your help,