cyau
cyau

Reputation: 449

How can I show an edge's label only if it is highlighted or clicked in Memgraph's Graph Style Script?

I am working with the examples in Memgraph showing a simple social relationships graph. It has people (nodes) and the relationships between them (edges). Each edge is labelled with the type of the relationships (in the example - IS_FRIENDS_WITH, but it could be anything else).

However, with too many nodes and edges these labels become hardly readable.

I want to show the labels only when the edge is highlighted or clicked. In Memgraph's GSS this would look something like the below snippet, but it seems Memgraph doesn't have functions akin to IsHovered or IsSelected.

@EdgeStyle Or(IsHovered(edge), IsSelected(edge)) {
  label: Type(edge)
}

How would be possible to achieve such conditional label rendering?

Upvotes: 0

Views: 19

Answers (1)

MPesi
MPesi

Reputation: 357

Unfortunately, Memgraph's GSS doesn't have that option, but there is an option to display edge text only if there is a small number of edges in the view. After you select the edge, its type will be shown in the pop-up. Here's an example of how you can set the number of edges after which the text will not be shown:

@EdgeStyle Less(EdgeCount(graph), 30) {
  label: Type(edge)
}

Does this help?

Upvotes: 0

Related Questions