2)When i change a node (single specific node) fillColor or/and shape
it works fine but when i call the method view.redrawGraph(true,false);
or in any other combination or when the user change any information
(like the canonicalName ) of a node i lose the shape and color that i
have specified to a node, is a way to stop that behavior of
cytoscape ??
See http://www.cytoscape.org/cgi-bin/moin.cgi/Visual_Mapping_System_Guide
For how to change visualization from within a plugin.
Or http://www.cytoscape.org/cgi-bin/moin.cgi/Cytoscape_User_Manual/Visual_Styles
For how to change visualization from within cytoscape.
Cheers,
Willem Ligtenberg
On Sep 21, 8:51 am, "WLigtenb...@gmail.com" <WLigtenb...@gmail.com>
wrote:
> If you want to change the colour or shape of the node, you should
> specify a new VisualStyle.
> In that way everything will get visualized in the way you want when
> redrawGraph is being called.
> What you do now, seems that you manually set the colour ans shape.
> Then everytime Cytoscape visualizes the network anew, it will call
> upon the calculators of the VisualStyle to calculate the colours and
> shapes. (and they are still the same)
>
> Seehttp://www.cytoscape.org/cgi-bin/moin.cgi/Visual_Mapping_System_Guide
> For how to change visualization from within a plugin.
> Orhttp://www.cytoscape.org/cgi-bin/moin.cgi/Cytoscape_User_Manual/Visua...
private void createNodeShape() {
VisualStyle v_style = view.getVisualStyle();
NodeAppearanceCalculator node_calc = v_style.getNodeAppearanceCalculator();
Appearance dap = node_calc.getDefaultAppearance();
dap.set(VisualPropertyType.NODE_SHAPE, NodeShape.DIAMOND);
}
Let me know if it worked for you.
Lana Pacifico
So, it's better to create a new VS first, then create
Node/EdgeAppearenceCalcs, and apply it to the network you are working.
Thanks.
Kei
2007/9/21, T_even <grys...@gmail.com>:
--
Keiichiro Ono ko...@ucsd.edu
Cytoscape Core Developer Team: http://www.cytoscape.org/
UCSD Bioengineering Ideker Lab: http://chianti.ucsd.edu/idekerlab/
Lana
NodeAppearanceCalculator node_calc = v_style.getNodeAppearanceCalculator();
Appearance dap = node_calc.getDefaultAppearance();
dap.set(VisualPropertyType.NODE_SHAPE, NodeShape.DIAMOND);
}
defines overall (default) appearance and not individual appearance of node/edge.
Thanks.
Kei
2007/9/25, T_even <grys...@gmail.com>:
On Sep 25, 6:36 pm, "Mike Smoot" <msm...@ucsd.edu> wrote:
> VisualStyles are used to define the visualization for all nodes based on
> attributes, however you can also override this visualization by
> right-clicking on a node and then selecting the Visual Mapping Bypass menu
> item, and then manually changing the attribute you're interested in. The
> way that the bypass works is by creating a specially named attribute. For
> example, for node color, the attribute name is "node.fillColor" and value
> for that attribute for that node is set to a string that encodes the RGB
> value for a color. When a bypass attribute is set for a given node (or
> edge), that attribute will be used instead of the VisualStyle.
>
> To create bypass attributes programmatically, you just need to define an
> attribute with the proper name and then set the value for that attribute for
> the given node. To find out the bypass attribute names, your best bet is to
> try the override from cytoscape to see what new attributes are created. The
> definitions are found in VisualPropertyType.java. This should also give you
> an idea of how the attribute string should be formatted. So, the code would
> look something like this:
>
> CyAttributes nodeAtts = Cytoscape.getNodeAttributes();
> nodeAtts.setAttribute(yourNodeID,"node.fillColor","25,25,125");
>
> Let me know if you have any questions.
>
> Mike
>
> tel: 858-822-4756 University of California San Diego- Hide quoted text -
>
> - Show quoted text -