yWorks / yfiles-jupyter-graphs

The home of the Jupyter notebook graph visualization widget powered by yFiles for HTML
https://www.yworks.com/products/yfiles-graphs-for-jupyter
Other
162 stars 15 forks source link

Document which styles can be specified #20

Closed vmarkovtsev closed 2 years ago

vmarkovtsev commented 2 years ago

I haven't found the list of styles which I can override for a node or for an edge. There are examples, sure, but I saw nothing definitive. E.g., I know that I can change the node "color" and the node "shape" via set_node_styles_mapping(). Is there anything else? Can I set the node width to fit the label, for example? Or set a gradient background for the node? Change stroke color? Etc.

fskpf commented 2 years ago

The full documentation can be found here: https://yworks.github.io/yfiles-jupyter-graphs/ and sample notebooks for each available option are here https://github.com/yWorks/yfiles-jupyter-graphs/tree/main/examples

The default node style mapping describes the available style properties. There is also a sample notebook (node_styles_mapping.ipynb) that demonstrates the different settings.

Currently, the color option is limited to a single color and no gradient (the stroke color is automatically deduced from this) and supports the common CSS string shorthand notation.

The size of the node can be mapped separately with the node_scale_factor_mapping, see also the corresponding sample notebook element_size_mapping.ipynb. There is currently not automatic label <-> node fitting. Although the diagramming SDK (yFiles for HTML) that powers this widget provides options to support something like this, it is not available through the widget.

If you are missing a certain feature, feel free to create a separate feature request issue. Maybe others are missing it as well and/or provide more use cases for the respective feature suggestion.

vmarkovtsev commented 2 years ago

Thanks. I just expected more structured documentation of what was possible and what wasn't. Your answer resolved all the issues :+1: