Add Background image to edge in Cytoscape JS - cytoscape.js

I wanted to add an SVG to the edges of the Graph in Cytoscape instead of just color.

Related

react native allowing users to apply color using different svg paths with animation and blend on top of a background image

I have an original svg image (like an interior of a room) and different svg paths (walls,ceiling in a room) which are positioned on top of the original image. OnPress of different svg paths color is applied.
Challenge is it does not get blend with the backgroung image.
Second while the color is applied on the path not able to animate the color fill something like starting from center and then applying to the entire path withTiming.
Packages used are react-native-svg and react-native-reanimated
Is there any other way to approach this in react native? Is such animation possible , if yes how can it be achieved.

Who can fill this shape with color using JQuery animation?

I am thinking if you can fill this shape with color using JQuery animation starting from point A to point B to make color flow gradually.
This is the shape:
https://www.dropbox.com/s/x19dcjcqdoh3j9i/spiral%20shape.jpg?dl=0
This could be done with jQuery, but you would need your shape outline to have a solid white background, and transparent where the fill will go.
You could then place an image behind it which rotates and reduces in size as the animation progresses.

Crop Image in specific shape Cocos2d

I have an UIImageView* shape which is in fixed position. Behind that view I have another view which I can move, scale and rotate with gestures. I would like when I finish with customising the view behind the "shape" to press a button crop and crop the image. You can see video here of what exactly I am trying to do.
Video: https://www.youtube.com/watch?v=4CTNGire1gQ&feature=youtu.be
You can mask one image with another image to get custom shape image. See tutorial to get some idea about masking
http://www.raywenderlich.com/4421/how-to-mask-a-sprite-with-cocos2d-1-0

Font size for exporting iOS UIView to svg

Developing a drawing app on ipad. I am trying to export whatever I draw on canvas (overriding UIView drawRect). Everything works fine except for the text. The problem is with the font size.
I am creating the font using systemFontOfSize:size for drawing on the canvas
and while exporting, I am using using the same size with pt. For example if the size is 15 then in the exported svg, adding a style attribute of text tag as
style="font-size:15pt;"
The Apple documentation says that the systemFontOfSize takes fontSize in points. So whatever I draw on the canvas should be of same size to the size of text in svg (rendered by firefox, Inkscape)
But the size of the text rendered by svg seems to be bigger. I have other drawing on the canvas e.g a rectangle, the size of the text relative to rectangle is bigger in svg than that is displayed on ipad screen. I am also drawing rectangle using point unit on both UIView and svg.
Is there anything I am missing? I am using both places point unit, so DPI should not matter..

base div height on dynamic canvas height

I have a canvas element that changes in height after some user interaction.
The canvas is contained in a div. When the canvas changes in height, it currently overflows the div vertically.
Can I add a (javascript or jquery) listener (or something like that) to the height of the canvas, that dynamically changes the div's height according to the canvas height? Or is there a css way to let the div automatically enlarge (like in a table row).
thanks
Have you tried adding this style to the div : height:auto;
As a workaround, I've put the canvas in a table. A bit ugly, but it works.