How to lay out the connection according to different edge colors in cytoscape? - layout

Here is a connection plot I created in CytoScape. The edge color was set according to a categorical variable. I just want to know how can I lay out the connection according to different edge colors (I want the green edge to be mainly on the right side and the gray left for example). I want to lay out the connection automatically rather than manually.
Any help is appreciated.

The Boundary Layout app may be helpful for this: http://apps.cytoscape.org/apps/boundarylayout
I think the path would be to use Cytoscape's filter functionality to group nodes that are only connected via grey edges in one group, and nodes that are only connected via green edges in another group, and arrange the layout boundaries where you want them.
http://manual.cytoscape.org/en/stable/Finding_and_Filtering_Nodes_and_Edges.html#filters

Related

How to increase polygens in 3dsmax

I am beginner in modelling. Can I increase object's polygen in 3dsmax? I want have smooth object that have not low polygens.
You can increase the polygon count of you model so many ways:
Use subdivide modifier.
Use the turbo smooth modifier.
Use tessellate modifier.
You can use TurboSmooth modifier for this purpose, but before use it, you should make sure your model have enough edges and check if the edges are correct. for example, make sure your vertex not connect to odd number edges( like 3 or 5 edges ) always try to keep it in even numbers, 4 edges is standard, check image below :
both of them used odd numbers ( 3 and 5 ) which is not correct.
try to add more edges to your model and Chamfer them if necessery, before applying turbosmooth or other smooth Modifier's.
You can smooth it by adding a smooth or turbo smooth modifier, then convert it to polygon edit again - or collapse the object class from modify tab - this will reproduce polygon evenly all over the object faces.
Alternately you can select a ring or loop of faces then use the connect tool to add more resolution (polygons) to these selected polygons only
As for the fish model in your image, you can select one of the height faces, then from the polygon edit section in the modify panel on the right, click ring it'll select all the height faces all around the fish, then scroll down on the modify panel click on connect and set the number to add more resolution
UPDATE:
Please take in consideration that there's nothing like infinite segments even spheres (balls) or cylinders in 3D just have a higher number of segments - usually 32+), you can double or triple it but not more, increasing objects segments for very high values can bring your computer down to its knees while modeling or rendering
New versions of 3dsmax (2015, 2016) have a new subdivision modifier called OpenSubDiv modifier. This can be used to subdivide your model, and give it more polygons. There is also the Turbosmooth, Meshsmooth, Tessellate, and Subdivide modifiers available. All of these will add more geometry to your model, based on different algorithms.

GEF: How to draw diagram bottom up

I'm trying to draw a tree within a GEF editor. The problem is that I need to draw it bottom up. I have a primary layer for the node figures, and a connection layer for the connections.
The primary layer is a FreeformLayer, the root edit part a ScalableFreeformLayeredPane. The primary layer has a XYLayout.
Now I need to find the bottom edge of the editor (= viewport???) in order to be able to draw the bottom level of figures ("tokens") at that position (bottom y of primary layer - height of tokens = y of tokens). How can I get that?
I've tried to do it with BorderLayout so the tokens get painted at the bottom of the editor (BorderLayout.BOTTOM), and the nodes above it in BorderLayout.CENTER, but I've run into trouble with selections, and the layout is far from what I want to achieve.
So basically I want to have all nodes in one layer. I can set the position of the tokens, but the nodes above them must be calculated dynamically. How can I do this within XYLayout?
Many thanks in advance!
(Alternatively, positioning the tokens in the y-centered would be acceptable if it's easier to achieve)
You could look at Zest Layout Algorithms to have some inspiration:
http://www.eclipse.org/gef/zest/

SVG plot from point-value pairs

I need to write some code (for a web.py webapp with a straight-HTML/JS client) that will generate a visual representation of a set of point-values. Each point has an X and Y coordinate, and the value is an integer. If I can use SVG to do this, then I can scale the image client-side with no extra code. Can I actually do this? I am concerned about a couple of things:
The points don't necessarily have any relation to each other. They aren't necessarily in a grid, nor can we say how many points are nearby, etc.
Gradients are primarily one-direction, and multiple gradients on the same shape seems to be a foreign concept.
Fills require an existing image, at which point, I'd be better off generating the entire image server-side anyway.
Objects always have a layering, even if it isn't specified, which can change how the image is rendered.
If it helps, consider a situation where we have a point surrounded by 5 others, where one of them is a bit closer than the others (exact distances and sizes can be adjusted). All six of the points have different colors (Red, Green, Blue, Cyan, Magenta, Yellow, with red in the center and Yellow being slightly closer), and the outer five points are arranged roughly in a pentagon. Note that this situation is not the only option, just a theoretically possible situation.
Can I do this with SVG, or should I render an image server-side?
EDIT: The main difficulty isn't in drawing the points, it is in filling the space between the points so that there is no whitespace, and color transitions aren't harsh/unpredictable if you know the data.
I don't entirely understand the different issues you are having with wanting to use svg. I am currently using the set up you are describing to render X-Y scatter plots and gaussian curves and found that it works great.
Regarding the last point about object layering, you have to be particularly careful when layering objects with less than 100% opacity which are different colors. The way the colors "add" depends on the order in which you add the objects to your svg drawing.
Thankfully you can use different filters to overlay the colors without blending them. Specifically I am using the FeComposite filter element. There is a good example of its usage here:
http://www.w3.org/TR/SVG/filters.html#feCompositeElement

My iOS Views are off half a pixel?

My graphics are looking blurry unless I add or subtract a half pixel to the Y coordinate.
I know this is a symptom that usually happens when the coordinates are set to sub-pixel values. Which leads me to believe one of my views must be off or something.
But I inspected the window, view controller and subviews, and I don't see any origins or centers with sub-pixel values.
I am stumped, any ideas?
See if somewhere you are using the center property of a view. If you assign that to other subviews, depending on their sizes they may position themselves in half pixel values.
Also, if you are using code to generate the UI I would suggest using https://github.com/domesticcatsoftware/DCIntrospect. This tools allows you in the simulator to look at all the geometry of visible widgets. Half pixel views are highlighted in red vs blue for integer coordinates. It helps a lot.

Graphviz DOT arrange Nodes in circles, layout too "compact"

I'm halfway there please see the edit
OK here's my problem, I'm generating a graph of a python module, including all the files with their functions/methods/classes.
I want to arrange it so, that nodes gather in circles around their parent nodes, currently everything is on one gargantuan horizontal row, which makes the thing >50k pixels wide and also let's the svg converter fail(only renders about the half of the graph).
I went through the docs but couldn't find anything that seems to do the trick.
So the question is:
Is there a simple way to do this or do I have to layout the whole thing by myself? :/
EDIT:
Thanks to Andrews comment I've got the right layout, the only problem now is that it's a bit to "compact"... so the question now is, how to fix this?
i've mentioned all of the most significant parameters that influence your current layout and then suggested values for those parameters. Still, i suspect you can get the layout that you want just from applying a couple of these suggestions.
reduce the edge weight, eg, [weight=0.5]; this will make the
edges longer, causing the tight
clusters you currently see in your
graph to 'fan out'.
get rid of the node borders, node_A
[color=none; shape=plaintext];
especially for oval-shaped nodes, a
substantial fraction of the total
node space is 'unused' (ie, not used
to display the node label).
explicitly set the font size for
the nodes (the node borders are
enlarged so that they surround the
node text, which means that the font
size and amount of text for a given
node has a significant effect on its
size); [fontsize=11] should be large
enough to be legible yet also reduce
the 'cluttered' appearance (the
default size is 14).
increase minimum separation between
nodes, via 'nodesep'; eg, nodesep=2.0; this will
directly address your objection
regarding your graph being "too
compact." ('nodesep' and 'ranksep'
probably affect how dot draws a graph
more than any other parameters for
node, edge, or graph. In your case,
it looks like you have only two ranks
of nodes; 'ranksep' sets the minimum
distance between nodes of different
ranks--it looks like all of the nodes
that comprise your graph are of the
same rank (except for few top level
nodes in the centers).
explicitly set total graph size, eg,
size="7.75,10.25" (ensures that your
graph fits on an 8.5 x 11 page and
that it occupies the entire space)
And one purely aesthetic suggestion
that at most will only help your
graph appear less cluttered: the
default fontcolor for both edges and
nodes is black. The majority of the
ink on your graph is from those two
structures (particularly if you
remove the node borders), so i would
for instance set either the node
(text) fontcolor or the edge
fontcolor to "blue" to help the eye
distinguish the two sets of graph
structures.
If it is too compact, you will want to mess with the edge length. You have a couple options depending on the graph layout:
If your layout is sfdp or fdp, tweak the graph property K. Default is 0.3.
For neato (or fdp), tweak the edge property len. Default is 1.0 for neato and 0.3 for fdp.
For dot you can use the edge property minlen which is the minimum edge length. Default is 1.
You might also want to mess with the graph property model which determines clustering behavior. Specifically, try subset. I believe this handles len for you:
http://www.graphviz.org/doc/info/attrs.html#d:model
Also, you can remove overlaps all together with scaling techniques: http://www.graphviz.org/doc/info/attrs.html#d:overlap
I have around 500 nodes and used doug's recommendation.
This is my sample code that works (in python):
f = Digraph('companies',filename='companies.gv',
edge_attr={'weight':'1',
'fontsize':'11',
'fontcolor':'blue',
'len':'4'},
graph_attr={'fixedsize':'false',
'bgcolor':'transparent'},
node_attr={'fontsize':'11',
'shape':'plaintext',
'color':'none',
'fontcolor':'black'})
f.attr(layout="neato")
f.attr(nodesep='3')
f.attr(ranksep='3')
f.attr(size='5000,5000')

Resources