InCHlib
In this section InCHlib’s methods, events, attributes and color schemes are documented. Attributes influence various parameters of the visualization. The only obligatory attribute is the target attribute which defines the ID of the HTML target element.
Methods
read_data()
read data in a JSON format
Example:
inchlib_instance.read_data(json_data)
read_data_from_file()
read data from JSON data file
Example:
inchlib_instance.read_data_from_file("/path/to/file.json")
draw()
draw visualization
Example:
inchlib_instance.draw()
update_settings()
update InCHlib instance settings (e.g., heatmap_colors, metadata_colors etc.), changes occur after redraw() method call
Example:
inchlib_instance.update_settings({"heatmap_colors": "Blues"})
redraw()
redraw InCHlib instance e.g., with updated settings when using update_settings() method
Example:
inchlib_instance.redraw()
redraw_heatmap()
redraw only the heatmap part of the visualization when only coloring settings have been changed
Example:
inchlib_instance.redraw_heatmap()
highlight_rows()
highlight rows specified by row IDs
Example:
inchlib_instance.highlight_rows(["row_id_1", "row_id_2", "row_id_3"])
unhighlight_rows()
unhighlight highlighted rows
Example:
inchlib_instance.unhighlight_rows()
highlight_cluster()
highlight cluster (dendrogram node) specified by node ID
Example:
inchlib_instance.highlight_cluster("node_id_1")
unhighlight_cluster()
unhighlight current highlighted cluster (dendrogram node)
Example:
inchlib_instance.unhighlight_cluster()
highlight_column_cluster()
highlight column cluster (column dendrogram node) specified by node ID
Example:
inchlib_instance.highlight_column_cluster("node_id_1")
unhighlight_column_cluster()
unhighlight currently highlighted column cluster (dendrogram node)
Example:
inchlib_instance.unhighlight_column_cluster()
get_features_for_object()
get features for object given by the object_id parameter
Example:
inchlib_instance.get_features_for_object(object_id)
add_color_scale()
add custom color scale in the format shown below, the middle color is optional, first parameter is the color scale name and the second its definition
Example:
inchlib_instance.add_color_scale("WhBk",
{"start": {"r":255, "g": 255, "b": 255},
"middle": {"r": 236, "g": 158, "b": 56},
"end": {"r": 0, "g": 0, "b": 0}
})
Events
column_dendrogram_node_highlight
callback for column dendrogram highlight event, the function is called with underlying column indexes and node_id parameters
Default:
column_dendrogram_node_onclick
callback for column dendrogram node click event, the function is called with underlying column indexes, node ID and event parameters
Default:
column_dendrogram_node_unhighlight
callback for column dendrogram node unhighlight event, the function is called with node_id parameter
Default:
dendrogram_node_highlight
callback for dendrogram highlight event, the function is called with underlying object ID/IDs and node_id parameters
Default:
dendrogram_node_onclick
callback for dendrogram node click event, the function is called with underlying object ID/IDs, node ID and event parameters
Default:
dendrogram_node_unhighlight
callback for dendrogram node unhighlight event, the function is called with node_id parameter
Default:
empty_space_onclick
callback for click on empty (inactive) space in visualization (e.g., space around the heatmap), the function is called with event parameter
Default:
heatmap_onmouseout
callback function for event when the mouse cursor leaves the heatmap, the function is called with event parameter
Default:
on_columns_unzoom
callback for columns unzoom, the function is called with unzoomed node_id parameter
Default:
on_columns_zoom
callback for columns zoom, the function is called with zoomed column_indexes and node_id parameter
Default:
on_refresh
callback for refresh icon click
Default:
on_unzoom
callback for unzoom icon click, the function is called with unzoomed node_id parameter
Default:
on_zoom
callback for zoom icon click, the function is called with underlying object IDs and zoomed node_id parameter
Default:
row_onclick
callback for heatmap row click event, the function is called with underlying object ID/IDs and event parameter
Default:
row_onmouseout
callback function for mouseout event of heatmap row, the function is called with event parameter
Default:
row_onmouseover
callback function for mouseover event of heatmap row, the function is called with object ID/IDs represented by row and event parameter
Default:
Attributes
alternative_data
turn on/off the alternative data
Default:
column_dendrogram
turn on/off the column dendrogram
Default:
column_metadata
turn on/off the column metadata
Default:
column_metadata_colors
the column metadata color scale
Default:
columns_order
array of column indexes which enables to set the order of columns
Default:
count_column
turn on/off the count column
Default:
dendrogram
turn on/off the row dendrogram
Default:
draw_row_ids
draw row (object) ids next to the heatmap (only when there is enough space)
Default:
fixed_row_id_size
set fixed font size of row ids
Default:
font
font family
Default:
heatmap
turn on/off the heatmap
Default:
heatmap_font_color
the color of text values in the heatmap
Default:
heatmap_part_width
define the width of the heatmap as the percentage of the width of the cluster heatmap
Default:
highlighted_rows
array of row IDs to highlight
Default:
images_as_alternative_data
enables to display images determined by their names as alternative data
Default:
images_path
definition of image directory and image extension, when images_as_alternative_data option is set to true
Default:
independent_columns
determines whether the color scale is based on the values from all columns together or for each column separately
Default:
max_column_width
maximum column width in pixels
Default:
max_height
maximum height of the cluster heatmap in pixels
Default:
max_percentile
the value percentile above which the color will be equal to the terminal color of the color scale
Default:
max_row_height
maximum row height in pixels
Default:
metadata
turn on/off the metadata
Default:
middle_percentile
the value percentile which defines where the middle color of the color scale will be used
Default:
min_percentile
the value percentile below which the color will be equal to the beginning color of the color scale
Default:
min_row_height
minimum row height in pixels
Default:
turn on/off certain navigation button/feature (color_scale, distance_scale, export_button, filter_button, hint_button)
Default:
target
the ID of the target DIV
Default:
width
width of the cluster heatmap in pixels
Default:
Color scales
set of color scales contained in InCHlib
Name |