yWorks / yfiles-jupyter-graphs-for-neo4j

The open-source adapter for working with neo4j graphs and cypher queries in jupyter notebooks leveraging the yFiles Graphs for Jupyter plugin.
https://www.yworks.com/jupyter
MIT License
32 stars 3 forks source link

Allow adding (style) configurations for a given item set or single items particularly #9

Open fskpf opened 1 month ago

fskpf commented 1 month ago

The current API makes it easy to style nodes/relationships based on their label/type.

This approach falls short when trying to style items across labels/type (and maybe only some of those labels/items). Think about a path that crosses single nodes/relationships of different types. There is no easy way to highlight this path then.

Maybe we could add something like

add_node_configuration(<cypher-query>, configuration)

Which is then applied to the set of nodes (same for relationships).

Not sure if the query approach would work well here. We would need to make sure to only query nodes that are already in the result of show_cypher, or would it be a good idea to potentially run the query against the entire database and just load those items as well?

yGuy commented 1 month ago

I guess this could be done with some cypher magic, where you "embed" that information into the query result. It should be possible to yield nodes that have "properties" which are computed, live. Just like it is possible to create virtual nodes and relationships.

I don't like adding a cypher query as configuration. We could however let the user modify the data, before it gets visualized. So instead of passing in a query, allow the user to pass in a neo4j graph (or graph-like object) and then just modify the values in memory before visualizing them?