Sizing icons for cytoscape.js

811 views
Skip to first unread message

Michael Thomson

unread,
Dec 2, 2013, 8:39:05 PM12/2/13
to cytoscap...@googlegroups.com
Hi,

I have a number of icons I was using with cytoscape web. 

They are png sized at 128x128

When I display these same icons with cytoscape.js  (css : background-image)  I get a very truncated image.

on screen



icon is:



Is there any mechanism to control this image resize, if I create and icon of a differnt size would it be better,what are my options

regards
Michael.

Max Franz

unread,
Dec 3, 2013, 4:50:49 PM12/3/13
to cytoscap...@googlegroups.com
Hi — Currently, the implementation of `background-image` is very simple because other properties would be needed as is the case for HTML+CSS (`background-repeat`, etc …).  We are planning to add these properties (now that I’ve taken over the renderer and refactored it a bit it should be a more straightforward task), but in the meantime you can size your images to the size of your nodes.  I believe the images currently are just drawn centred 1:1 on the node.  So, if you make the background images appropriately small enough and also set an appropriate background colour (light grey in your example), then the cash picture should be the same size on all nodes and extra space should be padded by the background colour.  You can follow the progress of the addition of background image features in this ticket : https://github.com/cytoscape/cytoscape.js/issues/357 -M
--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-disc...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.
Visit this group at http://groups.google.com/group/cytoscape-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

signature0.png
signature1.png
Reply all
Reply to author
Forward
0 new messages