Comments (7)
I forked this repo in hopes of fixing this but realized this uses https://github.com/gliffy/canvas2svg under the hood and I wasn't really ready to dig into that.
I wrote a temporary fix for my case which uses DOMParser to edit the generated svg and patch the missing fill colors. Maybe it will work for your use case? You may have to adjust the fill color accordingly.
const svgStr = cy.current.svg({ full: true, scale: 2 });
const domparser = new DOMParser();
let svgEl = domparser.parseFromString(svgStr, "image/svg+xml");
let squares = [...svgEl.children[0].querySelectorAll("path")].filter(
(x) =>
!x.getAttribute("fill") &&
x.getAttribute("paint-order") === "fill stroke markers"
);
squares = [...squares, ...svgEl.children[0].querySelectorAll("rect")];
squares.forEach((el) => el.setAttribute("fill", "#ffffff")); // <- set appropriate fill color here
const correctedSvgStr = svgEl.documentElement.outerHTML;
from cytoscape-svg.
It looks like once the rotation of text is set, all parameters of existing nodes are reset. This is the commit that causes this issue: gliffy/canvas2svg@c7df7fa I revered it in my fork: kinimesi/canvas2svg@68b8ef8 It looks like it works, but I'm not exactly sure if it breaks something else. I pushed the fixed version to unstable branch. Could you please test it and let me know if it works?
from cytoscape-svg.
Hello @kinimesi .
I tried your fork and it looks like it is #working!
Other entities of the graph are not affected by this forked repo.
It looks like not only text-rotation: autorotate, but whole text-rotation attribute is not working.
Node and links to be shown:
Master branch:
and the result with the fork:
Can you propose the pull request to the canvas2svg? Or perhaps make cytoscape-svg dependant on your forked fix?
Best regards,
Maroš
from cytoscape-svg.
Hi @karasma3, I'm confused by this: It looks like not only text-rotation: autorotate, but whole text-rotation attribute is not working.
Does the fix solve all of these issues?
from cytoscape-svg.
Is there an update on this?
from cytoscape-svg.
Hi, could you please try v0.4.0 and let me if it solves your problem?
from cytoscape-svg.
Yes, it works, thanks a lot!
from cytoscape-svg.
Related Issues (12)
- Cytoscape svg not rendering images HOT 6
- Cannot download .svg picture HOT 2
- Export to PDF HOT 2
- border not exported HOT 1
- Ability to drag and drop svg images HOT 3
- Export nodeHTML content HOT 1
- background color HOT 1
- Add element's id in SVG HOT 1
- Background color (not fixed ?) HOT 5
- Shape and color issues HOT 5
- Error: Attempted to apply path command to node g HOT 1
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 cytoscape-svg.