KristofferStrube / Blazor.SVGEditor

A basic SVG editor written in Blazor.
https://kristofferstrube.github.io/Blazor.SVGEditor/
MIT License
310 stars 51 forks source link

Refactoring with interfaces #10

Closed ABIOLI-COM closed 1 year ago

ABIOLI-COM commented 1 year ago

Kristoffer,
your work has been really impressive, in this project.

In particular, I found it incredibly useful to use the editor for Bezier curves, in a project I'm working on.

image

My only (small) concern is that I had to create a new SVG element, removing all the things I don't need. I attach the resulting set of projects, where you can see that I had to duplicate a lot of other classes, because creating an SVG2 element, there is a strong dependency on the concrete class in other elements.
I'm wondering if it could be possible to refactor things a little bit to make things cleaner... I'm available to help, if you want...

Blazor.SVGEditor.zip

KristofferStrube commented 1 year ago

Hey @ABIOLI-COM awesome that you found the project useful once again. 😁

I've been thinking of releasing the project as a NuGet package and making all features configurable and togglable which I think is what you have tried to achieve by copying the SVG, Path, Shape, etc. classes. This is a list of the things I would like to be configurable on the SVG component so that people don't need to modify (or copy) it. If you have any other things that you would like to be configurable or be able to toggle off then please note so. 😀

All of the above would then be configurable but with the defaults that are the current ones. What do you think of this and are there any settings that you would be missing for your use case?

I'm updating the above checklist as I add support for configuring each part.

KristofferStrube commented 1 year ago

@ABIOLI-COM I have released the project to NuGet now with features that should make it more configurable so that you don't have to do source code copying. Here is a link to the NuGet package: https://www.nuget.org/packages/KristofferStrube.Blazor.SVGEditor

You can check out two examples of how to use this here: https://kristofferstrube.github.io/Blazor.SVGEditor/Minimal/ https://kristofferstrube.github.io/Blazor.SVGEditor/CustomElements/

If you would like to test using it in one of your projects then I would be very happy to get any feedback you might have.