Filters & Exclusions


Using filters and exclusions is a great way to prune down a large graph to see just the elements that you want to explore. They are based on a subset of SQL (see bottom of page). In this example, we'll look at how to filter down to only the most highly connected characters within a Les Mis graph.

Responsive image

Filter Example

To filter for only the most highly connected nodes, we need to first choose which attribute we want to filter by. In this case, we use the attribute Degree to describe the number of incoming and outgoing edges of a single node. Both nodes and edges have attributes so we'll use the selector point: instead of edge:.

Responsive image

1. Select An Attribute

Open the filter panel and find point:degree(node:attribute) to create a new filter

Responsive image

2. Enter A Value

We want to only look at nodes with a degree value of over 15, we’ll set our filter value to…

point:degree >= 15

Responsive image


Now we can see that we only have a handful of nodes, and we can recluster the graph to see connections (use the play button in the main navbar up top).


Exclusions work very similary to filters, except they specify elements of the graph to remove. This example will exclude all of the highly connected nodes and reveal the remaining structure.

Responsive image

1. Select an Attribute

Fist, open the exclusions panel and find point:degree again to create a new exclusion

Responsive image

2. Enter a Value

This time we want to take out all the nodes with a degree of connection higher than 5, so our value will be...

point:degree >= 5

Responsive image


Now we can see all of the least connected nodes in our graph, as we've excluded all of the nodes with a degree of connection higher than 5.

Common Expressions

numeric comparison point:degree < 10 compare the attribute on the left with a constant on the right using comparators <, <=, ==, !=, >, >=
exact string match point:title = "mytitle"
point:title != "mytitle"
compare the attribute on the left to the string on the right
partial string match point:title like "%the%"
point:title ilike "%the%"
check the attribute on the left for having the word "the" anywhere in it, and whether to be case sensitive
set inclusion point:degree in (1, 3, 5) check if the attribute on the left is any of the values in the list on the right
null comparison point:title != null
point:title in (null, "sometitle")
check if the attribute has no value

Next Up: Histograms!

Looking for more information?

Browse our in depth UI guide slideshow to take you through all the details of the Graphistry tool suite.

Browse UI Guide slideshow