|
| 1 | +HTML Visualization Features |
| 2 | +=========================== |
| 3 | + |
| 4 | +*Last updated 2021-10-08 with kmapper version 2.0.1* |
| 5 | + |
| 6 | +This page demonstrates some of the options available when using |
| 7 | +``kmapper.KeplerMapper.visualize`` to create KeplerMapper html visualizations. |
| 8 | + |
| 9 | +.. contents:: Contents |
| 10 | + :local: |
| 11 | + |
| 12 | + |
| 13 | +Colors for samples and nodes |
| 14 | +---------------------------- |
| 15 | + |
| 16 | +A set (or sets) of ``color_values`` associate values with samples. These values |
| 17 | +are mapped to a specified ``colorscale`` via min-max scaling. These mapped |
| 18 | +colorvalues are used for two things on the visualization: |
| 19 | + |
| 20 | +1. Histogram distributions |
| 21 | + |
| 22 | + The "details" pane for a node displays a histogram distribution of that node's |
| 23 | + samples' colorvalues. |
| 24 | + |
| 25 | +2. Node colors |
| 26 | + |
| 27 | + Each node is assigned a color based on its samples' colorvalues. |
| 28 | + ``node_color_function`` determines the assignation function. |
| 29 | + |
| 30 | +If more than one set of colorvalues or node color functions is specified, then |
| 31 | +dropdowns in the visualization allow toggling between them. |
| 32 | + |
| 33 | +.. image:: images/html-visualization-multiple-color-values-and-node-functions.gif |
| 34 | + :width: 600 |
| 35 | + |
| 36 | + |
| 37 | +Searchbar |
| 38 | +--------- |
| 39 | + |
| 40 | +The searchbar can be used to highlight (i.e., visually resize) nodes based on |
| 41 | +whether their samples' ``custom_tooltips`` match a query. Currently, the |
| 42 | +searchbar can do three types of queries. See the docs for details. |
| 43 | + |
| 44 | +.. image:: images/html-visualization-search-bar.gif |
| 45 | + :width: 600 |
| 46 | + |
| 47 | + |
| 48 | +Min-intersection selector |
| 49 | +------------------------- |
| 50 | + |
| 51 | +Min-intersection, an argument passed to ``KeplerMapper.map``, is used to determine |
| 52 | +whether an edge should be drawn between pairs of nodes. The html visualization |
| 53 | +can dynamically change the min-intersection it uses to draw edges. Submitting a |
| 54 | +new value uses javascript to perform the same logic as is done in python in |
| 55 | +``.map``. The starting value for the html visualization is the value that was |
| 56 | +used to create the graph, which is read from metadata saved in the html file. |
| 57 | + |
| 58 | +.. image:: images/html-visualization-search-bar.gif |
| 59 | + :width: 600 |
| 60 | + |
| 61 | + |
| 62 | +Lock focus on and reposition nodes |
| 63 | +---------------------------------- |
| 64 | + |
| 65 | +Normally, nodes are free to float around the visualization, acted upon by |
| 66 | +gravity and repulsion forces decided by the underlying d3-force simulation. |
| 67 | +However, clicking-and-dragging a node will cause that node to become "frozen" -- |
| 68 | +it will stay where you drag it. |
| 69 | + |
| 70 | +Individual frozen nodes can be unfrozen, and all nodes can be unfrozen (or frozen) at once: |
| 71 | + |
| 72 | +.. image:: images/html-visualization-click-freeze-doubleclick-unfreeze.gif |
| 73 | + :width: 600 |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | +Nodes' positions and "frozen"-settings can saved to a ``.json`` config file. Node |
| 78 | +positions can be loaded from that file. Useful if the ``.html`` file and the ``.json`` |
| 79 | +file to be stored and transferred in tandem, potentially for collaboration |
| 80 | +purposes. |
| 81 | + |
| 82 | +.. image:: images/html-visualization-save-and-reload.gif |
| 83 | + :width: 600 |
| 84 | + |
| 85 | + |
| 86 | +Light and dark modes |
| 87 | +-------------------- |
| 88 | + |
| 89 | +The visualization can be changed to a white background which may be better for |
| 90 | +printing. |
0 commit comments