-
Notifications
You must be signed in to change notification settings - Fork 28
new filters #860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new filters #860
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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. | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| == 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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] | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -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: | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
|
@@ -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. | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||
| . Then **Save**. | ||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+87
to
+88
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| .Example: Filter by customer city | ||||||||||||||||||||||||||||||||||||||
| image::dashboards/parameters-and-filters/filter-by-customer-city.png[] | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+90
to
+91
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| ==== 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| .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] | ||||||||||||||||||||||||||||||||||||||
| ==== | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -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. | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
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?