Git Product home page Git Product logo

Comments (7)

KristofferStrube avatar KristofferStrube commented on May 29, 2024

Hey @ABIOLI-COM,

Thanks a lot. You are right that a lot of the internal structure that parses the SVGs isn't available which would make it tough to extend for others.

And you are correct that you currently can't add elements to the editor without having the same element defined in SVG first since all the components for editing each individual SVG element type uses that as its backing storage. I have tinkered with using the editor in a distributed setting with multiple clients and here it becomes especially clear that it could be smart to have the components have their own storage so that they are not dependent on the SVG DOM tree. For now, it isn't really a flaw since the goal of the project is to edit SVG definitions so storing every change in an SVG definition suits this need.

Thanks for your interest in the project.

from blazor.svgeditor.

ABIOLI-COM avatar ABIOLI-COM commented on May 29, 2024

It's surely not a flaw, of course! :-)
I'm still spending the day playing with it, and there are really many interesting things. For the moment, it could be enough if I could obtain the list of instructions from the 'Input' string.
I'm making progresses, but I'm still not there: if I can get this working, then recreating the 'Input' string from that would be easy, and I could work more properly with the data outside the editor.
Do you have any ideas? :-)
Thanks again.

from blazor.svgeditor.

KristofferStrube avatar KristofferStrube commented on May 29, 2024

If you just want to parse a list of path instructions then take a look at this:
https://github.com/KristofferStrube/Blazor.SVGEditor/blob/main/src/KristofferStrube.Blazor.SVGEditor/PathDataSequences/PathData.cs#L8

from blazor.svgeditor.

KristofferStrube avatar KristofferStrube commented on May 29, 2024

I likewise have this helper method that takes a list of path instructions and turns them into a string.
https://github.com/KristofferStrube/Blazor.SVGEditor/blob/main/src/KristofferStrube.Blazor.SVGEditor/PathDataSequences/PathData.cs#L166

from blazor.svgeditor.

KristofferStrube avatar KristofferStrube commented on May 29, 2024

If you want to parse actual SVG elements and then get the instructions from the ones that are paths then you would need to change the list of ISVGElements in the SVG class to be public.
https://github.com/KristofferStrube/Blazor.SVGEditor/blob/main/src/KristofferStrube.Blazor.SVGEditor/SVG.razor.cs#L17

from blazor.svgeditor.

ABIOLI-COM avatar ABIOLI-COM commented on May 29, 2024

Thank you again, I'm wasting your time. But actually, I have the opposite need. When the user interacts with the editor, the only thing I can explore is the 'Input' string, that is now the actual svg representation. From that, I would like to have the original list of instructions, to manipulate/store/whatever them...

from blazor.svgeditor.

ABIOLI-COM avatar ABIOLI-COM commented on May 29, 2024

Oh, easy solution! Your last comment was what I was looking for! :-) Thanks, now I think I have everything! :-)
Really thank you again!

from blazor.svgeditor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.