Comments (7)
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.
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.
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.
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.
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.
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.
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)
- Refactoring with interfaces HOT 2
- Feature: Panning and zooming on mobile HOT 1
- Feature: Possible natural mapping for stroke-dasharray
- Feature: Virtualization
- Could not find 'blazorContextMenu.SetMenuHandlerReference' ('blazorContextMenu' was undefined) HOT 16
- Feature: Background graphics HOT 2
- Feature: Rotation
- Awesome Project, I want to integrate SVG into my Blazor Canvas HOT 1
- Feature: Fit viewport to Shapes HOT 1
- Bug: Selection is lost when zooming with touch
- Bug: Complete Without Close Instruction gets `ArgumentOutOfRangeException`.
- Feature: Have Stroke Dash Offset animation value change reflect on keyup and change.
- Self Closing Tags Not Supported HOT 2
- Feature: Add automatic centering and scaling function after svg file loaded HOT 4
- cannot run this project in Linux HOT 2
- Color Picker css not load HOT 1
- Bugix : `Elements.IndexOf(element)` value should be checked to avoid crashes HOT 2
- Annotations on an image HOT 4
- Any idea on how to export such an SVG to some image format (jpg, png...)? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazor.svgeditor.