Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 59 additions & 7 deletions modules/ROOT/pages/dashboards/parameters-and-filters.adoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
= Parameters and filters
:description: Use parameters in your dashboards to further customize queries or use them in filters for node and relationship properties.

The main way to make dashboard charts interactive is to add a filter and link it to a card using a parameter.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a main way implies there are more - are there? which ones?


== Parameters

Parameters are associated with a specific dashboard.
Each parameter has a value and type both of which you can set initially.

Display the parameters of a dashboard by using the parentheses button to show the **Parameters** drawer.
.How to access the parameters drawer
[.shadow]
image::dashboards/parameters-and-filters/access-parameters-drawer.png[]

Display the parameters of a dashboard by using the parentheses button `{}` to show the **Parameters** drawer.
Comment on lines +10 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is, arguably, an avoidable screenshot. the description should be hint enough :)


.The parameters drawer
[.shadow]
Expand Down Expand Up @@ -36,6 +40,10 @@ Each parameter has an icon next to it hinting at its data type:

=== Using a parameter in a query

.How to set up a parameter with a number value of 4 and the name "unit_param"
[.shadow]
image::dashboards/parameters-and-filters/dashboard-unit-param-4.png[width=500]

To use a parameter in a query, prefix the parameter name with `$`.
For example, to use a parameter with a number value of 4 and the name "unit_param", use `$unit_param` in your query:

Expand Down Expand Up @@ -71,11 +79,55 @@ You can use a filter to dynamically set parameter values inside queries.
=== Adding a filter

. In the **Dashboards** page, use **Add filter** at the bottom right.
. In the **Add filter** dialog, select a filter type: a node or relationship type, and a property.
. Use either an existing parameter or create a new one, then **Save**.
. In the **Add filter** dialog, select a filter type: a node or relationship property, date or datetime.
. Link to an existing parameter or create a new one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

. On the right side of the dialog, there's a preview of the filter card that will be added to the dashboard - it's dynamic so you can use the dropdown too.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. On the right side of the dialog, there's a preview of the filter card that will be added to the dashboard - it's dynamic so you can use the dropdown too.
On the right side of the dialog, thereis an interactive preview of the filter card that is added to the dashboard.

. Then **Save**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. Then **Save**.
. **Save** when you're happy with the filter.

. Then the next step is to take that parameter use it in a Cypher query.
. Create a card.
Comment on lines +87 to +88
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. Then the next step is to take that parameter use it in a Cypher query.
. Create a card.
You can now use the parameter in a Cypher query.


.Example: Filter by customer city
image::dashboards/parameters-and-filters/filter-by-customer-city.png[]
Comment on lines +90 to +91
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this should be moved to the example section


=== Example

We'll make a filter to see which companies are based in a city.

==== Define the filter:

. In the **Dashboards** page, use **Add filter** at the bottom right.
. Select the filter type `Node property`
. Select the label `Customer`
. Select the propery `City`

==== Link the parameter:

. A parameter called `$customer_city` will be created automatically
. Set the default value to `London`
. **Save**
Comment on lines +100 to +108
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. Select the filter type `Node property`
. Select the label `Customer`
. Select the propery `City`
==== Link the parameter:
. A parameter called `$customer_city` will be created automatically
. Set the default value to `London`
. **Save**
. Select the filter type `Node property`.
. Select the label `Customer`.
. Select the property `City`.
==== Link the parameter:
. A parameter called `$customer_city` is created automatically.
. Set the default value to `London`.
. **Save**.


==== Add a card:

In the Cypher input, use the following Cypher query:

.Cypher query for a table which displays customers within a city
[source,cypher]
----
MATCH (n:Customer)
WHERE n.city = $customer_city
RETURN n.companyName
----

Like this:

.Cypher query for a table which displays customers within a city
image::dashboards/parameters-and-filters/london-cypher-query-example.png[]
Comment on lines +122 to +125
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this screenshot could be omitted too


Then, in your dashboard, you'll have cards with the filter and the table - use the filter to change cities, and you'll see the info in the customer name table change too.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then, in your dashboard, you'll have cards with the filter and the table - use the filter to change cities, and you'll see the info in the customer name table change too.
Then, in your dashboard, you have cards with the filter and the table.
When you use the filter to change cities, the information in the customer name table changes too.


.Creating a filter for the product node property `unitsInStock`
image::dashboards/parameters-and-filters/filter-units-in-stock.png[]
.Filter and table showing customers located at selected city
image::dashboards/parameters-and-filters/customers-located-at-selected-city.png[]

[NOTE]
====
Expand Down Expand Up @@ -111,4 +163,4 @@ You can select a value from the filter card drop down to let the dashboard assig
.Selecting a new value for the unitsInStock filter
image::dashboards/parameters-and-filters/filter-and-card.gif[]

All cards which make use of the parameter are updated with the new value.
All cards which make use of the parameter are updated with the new value.