Giter VIP home page Giter VIP logo

Comments (6)

phyng avatar phyng commented on September 21, 2024 1

I understand, for now, I'll use this patch. It works reasonably well in my current scenario, as the node text isn't extensive. If possible, could you add an option or another method that doesn't require modifying the mind-elixir source code? I anticipate that this patch could become unstable with future mind-elixir updates.

from mind-elixir-core.

SSShooter avatar SSShooter commented on September 21, 2024 1

https://github.com/ssshooter/mind-elixir-core/blob/3a7271d026e64e53a3841d77c24e36d30456bfd3/api/mind-elixir.api.md?plain=1#L29

Have a try~

from mind-elixir-core.

SSShooter avatar SSShooter commented on September 21, 2024

I'm curious as to why generateSvgText isn't used universally.

Because svg text doesn't wrap by default. You have to calculate width of each character to decide when to wrap a line, which is difficult and slow.

So If you don't care about text wrapping, you can just replace generateSvgTextUsingForeignObject with generateSvgText. 😂

from mind-elixir-core.

phyng avatar phyng commented on September 21, 2024

@SSShooter Thanks! It works!

But 4dddb32#diff-22661bb30bb26ab73ab4ec6375682479d6635ce978aaa6b8a3f2ae02e68a9db0R50-R56 breaking another things:

When calling the exportSvg() or exportSvg(true), an error message appears in the console: Error: <rect> attribute width: Expected length, "auto".

Upon checking, it appears that <rect> elements are being generated as <rect x="661" y="821" rx="0px" ry="0px" width="auto" height="auto">

This issue seems to arise because the getComputedStyle function, when used on a span element, returns a width value of auto.

from mind-elixir-core.

SSShooter avatar SSShooter commented on September 21, 2024

@SSShooter Thanks! It works!

But 4dddb32#diff-22661bb30bb26ab73ab4ec6375682479d6635ce978aaa6b8a3f2ae02e68a9db0R50-R56 breaking another things:

When calling the exportSvg() or exportSvg(true), an error message appears in the console: Error: <rect> attribute width: Expected length, "auto".

Upon checking, it appears that <rect> elements are being generated as <rect x="661" y="821" rx="0px" ry="0px" width="auto" height="auto">

This issue seems to arise because the getComputedStyle function, when used on a span element, returns a width value of auto.

please check 3.2.6

from mind-elixir-core.

phyng avatar phyng commented on September 21, 2024

@SSShooter Thanks! It works!
But 4dddb32#diff-22661bb30bb26ab73ab4ec6375682479d6635ce978aaa6b8a3f2ae02e68a9db0R50-R56 breaking another things:
When calling the exportSvg() or exportSvg(true), an error message appears in the console: Error: <rect> attribute width: Expected length, "auto".
Upon checking, it appears that <rect> elements are being generated as <rect x="661" y="821" rx="0px" ry="0px" width="auto" height="auto">
This issue seems to arise because the getComputedStyle function, when used on a span element, returns a width value of auto.

please check 3.2.6

Test successful, the functionality is now working as expected.

from mind-elixir-core.

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.