Styles

Basic Styles

Functions for managing STYLES and retrieving general lists of properties relevant to multiple style modes. Functions specific to Default, Mapping, Bypass, Dependencies and Values are in separate files.

  1. Style management functions

  2. General property functions

Style Management

copy_visual_style(from_style, to_style[, …])

Create a new visual style by copying a specified style.

create_visual_style(style_name[, defaults, …])

Create a style from defaults and predefined mappings.

delete_visual_style(style_name[, base_url])

Delete the specified visual style from current session.

delete_all_visual_styles([base_url])

Delete all visual styles from current Cytoscape session.

export_visual_styles([filename, type, …])

Save one or more visual styles to file.

get_current_style([network, base_url])

Get the current visual style applied to a network.

get_visual_style_JSON(style_name[, css, …])

Get all defaults and mappings for a visual style

get_visual_style_names([base_url])

Retrieve a list of all visual style names.

import_visual_styles([filename, base_url])

Load styles from an XML file and returns the names of the loaded styles.

set_visual_style(style_name[, network, base_url])

Apply a visual style to a network.

Visual Property Names and Values

get_arrow_shapes([base_url])

Get Arrow Shapes.

get_line_styles([base_url])

Get Line Styles.

get_node_shapes([base_url])

Get Node Shapes.

get_visual_property_names([base_url])

Retrieve the names of all possible visual properties.

Style Automatic Mappings

Functions for defining automatic MAPPINGS between table column values and visual properties, organized into sections:

  1. Palettes for color mapping generators

  2. Schemes for discrete and numerical mapping generators

  3. Functions for automatically mapping discrete values to colors, opacities, sizes, heights, widths and shapes

See style_mappings for manual mapping generation

Node Style Mapping Generators

gen_node_color_map(table_column[, palette, …])

Generate color map parameters for discrete or continuous values in a node table

gen_node_height_map(table_column[, …])

Generate height map parameters for discrete or continuous values in a node table

gen_node_opacity_map(table_column[, …])

Generate opacity map parameters for discrete or continuous values in a node table

gen_node_shape_map(table_column[, …])

Generate shape map parameters for discrete values in a node table

gen_node_size_map(table_column[, …])

Generate size map parameters for discrete or continuous values in a node table

gen_node_width_map(table_column[, …])

Generate width map parameters for discrete or continuous values in a node table

Edge Style Mapping Generators

gen_edge_arrow_map(table_column[, …])

Generate arrow shape map parameters for discrete values in an edge table

gen_edge_color_map(table_column[, palette, …])

Generate color map parameters for discrete or continuous values in an edge table

gen_edge_line_style_map(table_column[, …])

Generate line style map parameters for discrete values in an edge table

gen_edge_opacity_map(table_column[, …])

Generate opacity map parameters for discrete or continuous values in an edge table

gen_edge_size_map(table_column[, …])

Generate size map parameters for discrete or continuous values in an edge table

gen_edge_width_map(table_column[, …])

Generate width map parameters for discrete or continuous values in an edge table

Schemes for Discrete Shape and Numeric Generators

scheme_c_number_continuous([start_value, …])

Generate a continuous series

scheme_d_arrow_shapes()

Generate list of arrow shapes of a given size

scheme_d_line_styles()

Generate list of line styles of a given size

scheme_d_number_random([min_value, max_value])

Generate list of random integers in a given range

scheme_d_number_series([start_value, step])

Generate list of numbers in a given series

scheme_d_shapes()

Generate list of node shapes of a given size

Palettes for Discrete (Qualitative) Color Generators

palette_color_brewer_q_Accent([reverse])

Generate accent Brewer palette of a given size .

palette_color_brewer_q_Dark2([reverse])

Generate pastel2 Dark2 palette of a given size .

palette_color_brewer_q_Paired([reverse])

Generate paired Brewer palette of a given size .

palette_color_brewer_q_Pastel1([reverse])

Generate pastel1 Brewer palette of a given size .

palette_color_brewer_q_Pastel2([reverse])

Generate pastel2 Brewer palette of a given size .

palette_color_brewer_q_Set1([reverse])

Generate set1 Brewer palette of a given size .

palette_color_brewer_q_Set2([reverse])

Generate set2 Brewer palette of a given size .

palette_color_brewer_q_Set3([reverse])

Generate set3 Brewer palette of a given size .

palette_color_random()

Generate random color map of a given size

Palettes for One-Tailed Continuous (Sequential) Color Generators

palette_color_brewer_s_Blues([reverse])

Generate Blues Brewer palette of a given size .

palette_color_brewer_s_BuGn([reverse])

Generate BuGn Brewer palette of a given size .

palette_color_brewer_s_BuPu([reverse])

Generate BuPu Brewer palette of a given size .

palette_color_brewer_s_GnBu([reverse])

Generate GnBu Brewer palette of a given size .

palette_color_brewer_s_Greens([reverse])

Generate Greens Brewer palette of a given size .

palette_color_brewer_s_Greys([reverse])

Generate Greys Brewer palette of a given size .

palette_color_brewer_s_Oranges([reverse])

Generate Oranges Brewer palette of a given size .

palette_color_brewer_s_OrRd([reverse])

Generate OrRd Brewer palette of a given size .

palette_color_brewer_s_PuBu([reverse])

Generate PuBu Brewer palette of a given size .

palette_color_brewer_s_PuBuGn([reverse])

Generate PuBuGn Brewer palette of a given size .

palette_color_brewer_s_RdPu([reverse])

Generate RdPu Brewer palette of a given size .

palette_color_brewer_s_PuRd([reverse])

Generate PuRd Brewer palette of a given size .

palette_color_brewer_s_Purples([reverse])

Generate Purples Brewer palette of a given size .

palette_color_brewer_s_Reds([reverse])

Generate Reds Brewer palette of a given size .

palette_color_brewer_s_YlGn([reverse])

Generate YlGn Brewer palette of a given size .

palette_color_brewer_s_YlGnBu([reverse])

Generate YlGnBu Brewer palette of a given size .

palette_color_brewer_s_YlOrBr([reverse])

Generate YlOrBr Brewer palette of a given size .

palette_color_brewer_s_YlOrRd([reverse])

Generate YlOrRd Brewer palette of a given size .

Palettes for Two-Tailed Continuous (Diverging) Color Generators

palette_color_brewer_d_BrBG([reverse])

Generate BrBG Brewer palette of a given size .

palette_color_brewer_d_PiYG([reverse])

Generate PiYG Brewer palette of a given size .

palette_color_brewer_d_PRGn([reverse])

Generate PRGn Brewer palette of a given size .

palette_color_brewer_d_PuOr([reverse])

Generate PuOr Brewer palette of a given size .

palette_color_brewer_d_RdBu([reverse])

Generate RdBu Brewer palette of a given size .

palette_color_brewer_d_RdGy([reverse])

Generate RdGy Brewer palette of a given size .

palette_color_brewer_d_RdYlBu([reverse])

Generate RdYlBu Brewer palette of a given size .

palette_color_brewer_d_RdYlGn([reverse])

Generate RdYlGn Brewer palette of a given size .

palette_color_brewer_d_Spectral([reverse])

Generate Spectral Brewer palette of a given size .

Style Bypasses

Functions for getting and setting BYPASS values for visual properties, organized into sections:

  1. General functions for setting/clearing node, edge and network properties

  2. Specific functions for setting particular node, edge and network properties

NOTE: The CyREST ‘bypass’ endpoint is essential to properly set values that will persist for a given network independent of applied style and style changes, and from session to session if saved.

General Style Bypasses

set_node_property_bypass(node_names, …[, …])

Set Node Property Bypass.

set_edge_property_bypass(edge_names, …[, …])

Set Edge Property Bypass.

Node Style Bypasses

clear_node_opacity_bypass(node_names[, …])

Clear Node Opacity Bypass.

clear_node_property_bypass(node_names, …)

Clear Node Property Bypass.

hide_nodes(node_names[, network, base_url])

Hide Nodes.

hide_selected_nodes([network, base_url])

Hide Selected Nodes.

set_node_border_color_bypass(node_names, …)

Override the border color for particular nodes.

set_node_border_opacity_bypass(node_names, …)

Override the border opacity for particular nodes.

set_node_border_width_bypass(node_names, …)

Override the border width for particular nodes.

set_node_color_bypass(node_names, new_colors)

Set the bypass value for fill color for the specified node or nodes.

set_node_fill_opacity_bypass(node_names, …)

Override the fill opacity for particular nodes.

set_node_font_face_bypass(node_names, new_fonts)

Override the font face for particular nodes.

set_node_font_size_bypass(node_names, new_sizes)

Override the font size for particular nodes.

set_node_height_bypass(node_names, new_heights)

Override the height for particular nodes.

set_node_label_bypass(node_names, new_labels)

Override the label for particular nodes.

set_node_label_color_bypass(node_names, …)

Override the label color for particular nodes.

set_node_label_opacity_bypass(node_names, …)

Override the label opacity for particular nodes.

set_node_opacity_bypass(node_names, new_values)

Set the bypass value for node fill, label and border opacity for the specified node or nodes.

set_node_position_bypass(node_names[, …])

Sets the bypass value of node position for one or more nodes.

set_node_label_position_bypass(node_names, …)

Override the label position for particular nodes.

set_node_shape_bypass(node_names, new_shapes)

Override the shape for particular nodes

set_node_size_bypass(node_names, new_sizes)

Set Node Size Bypass.

set_node_tooltip_bypass(node_names, new_tooltip)

Sets a bypass tooltip for one or more nodes.

set_node_width_bypass(node_names, new_widths)

Override the width for particular nodes.

unhide_nodes(node_names[, network, base_url])

Unhide Nodes.

Edge Style Bypasses

clear_edge_property_bypass(edge_names, …)

Clear Edge Property Bypass.

hide_edges(edge_names[, network, base_url])

Hide Edges.

hide_selected_edges([network, base_url])

Hide Selected Edges.

set_edge_color_bypass(edge_names, new_colors)

Set the bypass value for fill color for the specified edge or edges.

set_edge_font_face_bypass(edge_names, new_fonts)

Override the font face for particular edges.

set_edge_font_size_bypass(edge_names, new_sizes)

Override the font size for particular edges.

set_edge_label_bypass(edge_names, new_labels)

Override the label for particular edges.

set_edge_label_color_bypass(edge_names, …)

Override the label color for particular edges.

set_edge_label_opacity_bypass(edge_names, …)

Override the label opacity for particular edges.

set_edge_line_style_bypass(edge_names, …)

Override the style for particular edges.

set_edge_line_width_bypass(edge_names, …)

Override the width for particular edges.

set_edge_opacity_bypass(edge_names, new_values)

Override the opacity for particular edges.

set_edge_source_arrow_color_bypass(…[, …])

Override the target arrow color for particular edges.

set_edge_source_arrow_shape_bypass(…[, …])

Override the source arrow shape for particular edges.

set_edge_target_arrow_color_bypass(…[, …])

Override the target arrow color for particular edges.

set_edge_target_arrow_shape_bypass(…[, …])

Override the target arrow shape for particular edges.

set_edge_tooltip_bypass(edge_names, new_tooltip)

Sets a bypass tooltip for one or more edges.

unhide_edges(edge_names[, network, base_url])

Unhide Edges.

Network Style Bypasses

clear_network_center_bypass([network, base_url])

Clear the bypass value for center x and y for the network, effectively restoring prior default values.

clear_network_property_bypass(visual_property)

Clear Network Property Bypass.

clear_network_zoom_bypass([network, base_url])

Clear the bypass value for the scale factor for the network, effectively restoring prior default values.

set_network_center_bypass(x, y[, bypass, …])

Set the bypass value for center x and y for the network.

set_network_property_bypass(new_value, …)

Set Network Property Bypass.

set_network_zoom_bypass(new_value[, bypass, …])

Set the bypass value for scale factor for the network.

unhide_all([network, base_url])

Unhide all previously hidden nodes and edges, by clearing the Visible property bypass value.

Style Defaults

Functions for getting and setting DEFAULT values for visual properties, organized into sections:

  1. General functions for setting node, edge and network defaults

  2. Specific functions for setting particular node, edge and network defaults

General Style Defaults

get_visual_property_default(property[, …])

Retrieve the default value for a visual property.

set_visual_property_default(style_string[, …])

Set the default value for a visual property.

update_style_defaults(style_name, defaults)

Update the default values of visual properties in a style.

Custom Graphics

remove_node_custom_graphics([slot, …])

Remove Node Custom Graphics.

set_node_custom_bar_chart(columns[, type, …])

Set Node Custom Bar Chart.

set_node_custom_box_chart(columns[, colors, …])

Set Node Custom Box Chart.

set_node_custom_heat_map_chart(columns[, …])

Set Node Custom HeatMap Chart.

set_node_custom_line_chart(columns[, …])

Set Node Custom Line Chart.

set_node_custom_linear_gradient([colors, …])

Set Node Custom Linear Gradient.

set_node_custom_pie_chart(columns[, colors, …])

Set Node Custom Pie Chart.

set_node_custom_position([node_anchor, …])

Set Node Custom Position.

set_node_custom_radial_gradient([colors, …])

Set Node Custom Radial Gradient.

set_node_custom_ring_chart(columns[, …])

Set Node Custom Ring Chart.

Node Style Defaults

get_node_label_position_default([…])

Retrieve the default node label position.

get_node_selection_color_default([…])

Retrieve the default selection node color.

set_node_border_color_default(new_color[, …])

Set the default node border color.

set_node_border_opacity_default(new_opacity)

Set defaults opacity value for all unmapped node borders.

set_node_border_width_default(new_width[, …])

Set the default node border width.

set_node_color_default(new_color[, …])

Set the default node color.

set_node_fill_opacity_default(new_opacity[, …])

Set default opacity value for all unmapped nodes.

set_node_font_face_default(new_font[, …])

Set the default node font.

set_node_font_size_default(new_size[, …])

Set the default node font size.

set_node_height_default(new_height[, …])

Set the default node height.

set_node_label_color_default(new_color[, …])

Set the default node label color.

set_node_label_default(new_label[, …])

Set the default node label.

set_node_label_opacity_default(new_opacity)

Set default opacity value for all unmapped node labels.

set_node_label_position_default(…[, …])

Set the default node label position.

set_node_selection_color_default(new_color)

Set the default node border color.

set_node_shape_default(new_shape[, …])

Set the default node shape.

set_node_size_default(new_size[, …])

Set the default node font size.

set_node_tooltip_default(new_tooltip[, …])

Set the default node tooltip.

set_node_width_default(new_width[, …])

Set the default node width.

Edge Style Defaults

get_edge_selection_color_default([…])

Retrieve the default selected edge color.

set_edge_color_default(new_color[, …])

Set the default edge color.

set_edge_font_face_default(new_font[, …])

Set the default edge font.

set_edge_font_size_default(new_size[, …])

Set the default edge font size.

set_edge_label_color_default(new_color[, …])

Set the default edge label color.

set_edge_label_default(new_label[, …])

Set the default edge label.

set_edge_label_opacity_default(new_opacity)

Set default opacity value for all unmapped edges.

set_edge_line_style_default(new_line_style)

Set the default edge style.

set_edge_line_width_default(new_width[, …])

Set the default edge width.

set_edge_opacity_default(new_opacity[, …])

Set default opacity value for all unmapped edges.

set_edge_selection_color_default(new_color)

Set the default selected edge color.

set_edge_source_arrow_color_default(new_color)

Set the default edge source arrow color.

set_edge_source_arrow_shape_default(new_shape)

Set the default edge source arrow shape.

set_edge_target_arrow_color_default(new_color)

Set the default edge target arrow color.

set_edge_target_arrow_shape_default(new_shape)

Set the default edge target arrow shape.

set_edge_tooltip_default(new_tooltip[, …])

Set the default edge tooltip.

Network Style Defaults

get_background_color_default([style_name, …])

Retrieve the default background color.

set_background_color_default(new_color[, …])

Set the default background color.

Style Dependencies

# Functions for getting and setting style DEPEDENDENCIES, organized into sections:

  1. General functions for getting and setting dependencies

  2. Specific functions for setting particular dependencies

General Style Dependencies

get_style_dependencies([style_name, base_url])

Get the values of dependencies in a style.

set_style_dependencies([style_name, …])

Set the values of dependencies in a style, overriding any prior setting.

Custom Graphics

sync_node_custom_graphics_size(new_state[, …])

Set a boolean value to have the size of custom graphics match that of the node.

Node Style Dependencies

lock_node_dimensions(new_state[, …])

Set a boolean value to have node width and height fixed to a single size value.

Edge Style Dependencies

match_arrow_color_to_edge(new_state[, …])

Set a boolean value to have arrow shapes share the same color as the edge.

Style Mappings

Functions for defining MAPPINGS between table column values and visual properties, organized into sections:

  1. General functions for creating and applying mappings for node, edge and network properties

  2. Specific functions for defining particular node, edge and network properties

See style_auto_mappings for automatic mapping generation

General Style Mappings

delete_style_mapping(style_name, visual_prop)

Delete a specified visual style mapping from specified style.

get_style_all_mappings(style_name[, base_url])

Fetch all visual property mapping in a style.

get_style_mapping(style_name, visual_prop[, …])

Fetch a visual property mapping in a style.

map_visual_property(visual_prop, …[, …])

Create a mapping between an attribute and a visual property.

update_style_mapping(style_name, mapping[, …])

Update a visual property mapping in a style.

Node Style Mappings

set_node_border_color_mapping(table_column)

Map table column values to colors to set the node border color.

set_node_border_opacity_mapping(table_column)

Set opacity for node border only.

set_node_border_width_mapping(table_column)

Map table column values to widths to set the node border width.

set_node_color_mapping(table_column[, …])

Map table column values to colors to set the node fill color.

set_node_combo_opacity_mapping(table_column)

Set opacity for node fill, border and label all together.

set_node_fill_opacity_mapping(table_column)

Set opacity for node fill only.

set_node_font_face_mapping(table_column[, …])

Sets font face for node labels.

set_node_font_size_mapping(table_column[, …])

Map table column values to sizes to set the node size.

set_node_height_mapping(table_column[, …])

Map table column values to the node heights.

set_node_label_color_mapping(table_column[, …])

Map table column values to colors to set the node border color.

set_node_label_mapping(table_column[, …])

Pass the values from a table column to display as node labels.

set_node_label_opacity_mapping(table_column)

Sets opacity for node label only.

set_node_shape_mapping(table_column[, …])

Map table column values to shapes to set the node shape.

set_node_size_mapping(table_column[, …])

Map table column values to node sizes.

set_node_tooltip_mapping(table_column[, …])

Pass the values from a table column to display as node tooltips.

set_node_width_mapping(table_column[, …])

Map table column values to the node widths.

Edge Style Mappings

set_edge_color_mapping(table_column[, …])

Map table column values to colors to set the edge color.

set_edge_font_face_mapping(table_column[, …])

Sets font face for edge labels.

set_edge_font_size_mapping(table_column[, …])

Map table column values to sizes to set the edge size.

set_edge_label_color_mapping(table_column[, …])

Map table column values to colors to set the edge border color.

set_edge_label_mapping(table_column[, …])

Pass the values from a table column to display as edge labels.

set_edge_label_opacity_mapping(table_column)

Sets opacity for edge label only.

set_edge_line_style_mapping(table_column[, …])

Map table column values to styles to set the edge style.

set_edge_line_width_mapping(table_column[, …])

Map table column values to widths to set the node border width.

set_edge_opacity_mapping(table_column[, …])

Map table column values to opacities to set the edge opacity.

set_edge_source_arrow_color_mapping(table_column)

Map table column values to colors to set the source arrow color.

set_edge_source_arrow_mapping(table_column)

Map table column values to shapes to set the source arrow shape.

set_edge_source_arrow_shape_mapping(table_column)

Map table column values to colors to set the source arrow color.

set_edge_target_arrow_color_mapping(table_column)

Map table column values to colors to set the target arrow color.

set_edge_target_arrow_maping(table_column[, …])

Map table column values to shapes to set the target arrow shape.

set_edge_target_arrow_shape_mapping(table_column)

Map table column values to colors to set the target arrow color.

set_edge_tooltip_mapping(table_column[, …])

Pass the values from a table column to display as edge tooltips.

Style Values

Functions for retrieving current values for visual properties.

  1. General functions for getting node, edge and network properties

  2. Specific functions for getting particular node, edge and network properties

Node Style Values

get_node_color([node_names, network, base_url])

Retrieve the actual fill color of specified nodes.

get_node_height([node_names, network, base_url])

Retrieve the actual height of specified nodes.

get_node_label_position([node_names, …])

Retrieve the actual label position of specified nodes.

get_node_position([node_names, network, …])

Retrieve the actual x,y position of specified nodes.

get_node_property([node_names, …])

Get values for any node property of the specified nodes.

get_node_size([node_names, network, base_url])

Retrieve the actual size of specified nodes.

get_node_width([node_names, network, base_url])

Retrieve the actual width of specified nodes.

Edge Style Values

get_edge_color([edge_names, network, base_url])

Retrieve the actual line color of specified edges.

get_edge_line_style([edge_names, network, …])

Retrieve the actual line style of specified edges.

get_edge_line_width([edge_names, network, …])

Retrieve the actual line width of specified edge.

get_edge_property([edge_names, …])

Get values for any edge property of the specified edges.

get_edge_target_arrow_shape([edge_names, …])

Retrieve the actual target arrow shape of specified edges.

Network Style Values

get_network_center([network, base_url])

Retrieve the center of specified network.

get_network_property(visual_property[, …])

Get values for any network property.

get_network_zoom([network, base_url])

Retrieve the scale factor of specified network.