-
Notifications
You must be signed in to change notification settings - Fork 32
NEW Dashboard actions #928
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
Merged
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
81f3320
NEW Dashboard actions
fiquick 4b05993
update
fiquick 2119d54
update actions docs
fiquick 027a74a
Update
fiquick 8243d58
update
fiquick a3a8b97
update
fiquick 454d4ac
update
fiquick f2710e5
Merge branch 'console' into report-actions
fiquick 63b9d0c
update based on Jennie's feedback
fiquick 386f523
update
fiquick a5c20e5
update cypher examples
fiquick 77e293a
update
fiquick 4c252ee
add custom URL
fiquick edbfea9
update to latest designs
fiquick 3cf8e16
Apply suggestion from @jehellqvist
fiquick 17c0f25
onsite update
fiquick f782076
actions are available for tables
fiquick 5db2f59
awesome
fiquick bdb7394
great example
fiquick becb6f3
Merge branch 'console' into report-actions
fiquick 7997339
update nav
fiquick 3f832d8
add admonition
fiquick 7dfab59
update
fiquick 57cdd81
update
fiquick 22e228f
update
fiquick ce25847
update
fiquick f144fd9
update
fiquick b939ab3
update
fiquick 401bbd1
update
fiquick ee966c9
update
fiquick c244deb
update
fiquick 4892537
update nav
fiquick 81f5818
update nav
fiquick c8b608a
add list params
fiquick 4c5c9e2
update nav
fiquick 1ee8373
update
fiquick b500828
update
fiquick 4a59160
update
fiquick ead44c0
update cell click screenshots
fiquick f6e5ba3
remove dupe info
fiquick 11c2d47
add actions index
fiquick 987a100
update
fiquick 46bd07c
Update modules/ROOT/pages/dashboards/actions/index.adoc
fiquick b7c4fab
based on jennie's great feedback
fiquick f7728cf
update
fiquick 2e0088a
update desc
fiquick 7e922a1
Update modules/ROOT/pages/dashboards/actions/index.adoc
fiquick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
modules/ROOT/images/dashboards/actions/navigate-dashboard.svg
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 added
BIN
+86.5 KB
modules/ROOT/images/dashboards/parameters-and-filters/list-parameter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+346 KB
(2100%)
modules/ROOT/images/dashboards/parameters-and-filters/parameters-drawer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| = Cell click action | ||
| :description: Use the cell click dashboard action to connect cards, set parameters, and navigate between pages or external link URLS in cards. | ||
|
|
||
| The cell click action is available for xref:dashboards/visualizations/table.adoc[Tables]. | ||
|
|
||
| Use it to: | ||
|
|
||
| * *Set a parameter*: A cell click will always set a parameter, which can update the rest of the dashboard so visualizations respond to the selection. | ||
|
|
||
| * *Navigate to a dashboard page*: Opens a specific page within the current dashboard. | ||
| This is typically used to create a drill-down effect, where the *set parameter* action filters the visualizations on the destination page. | ||
|
|
||
| * *Navigate to an external URL*: The *set parameter* value can be embedded directly into a URL string to pass the parameter value to the external target. | ||
| For example, insert the `$employee` parameter value into the URL e.g. `https://neo4j.com/name=\{employee}` | ||
|
|
||
| [WARNING] | ||
| ==== | ||
| To keep data secure, avoid including sensitive data in URL parameters. | ||
| For example, a URL including `name=John` exposes personal information directly. | ||
| Data in URLs may also appear in browser history and server logs. | ||
| ==== | ||
|
|
||
| == Action icons | ||
|
|
||
| Action icons appear next to values that can be set as a parameter. | ||
|
|
||
| [cols="1,20", frame="none", grid="none"] | ||
| |=== | ||
| |image:dashboards/actions/filter.svg[] | ||
| |Set parameter | ||
|
|
||
| |image:dashboards/actions/navigate-url.svg[] | ||
| |Set parameter and navigate to URL | ||
|
|
||
| |image:dashboards/actions/navigate-dashboard.svg[] | ||
| |Set parameter and navigate to dashboard page | ||
| |=== | ||
|
|
||
| == Example | ||
|
|
||
| The following example uses the Northwind dataset to show how to *set a parameter* and *navigate to a dashboard page*. | ||
| Click the name of a top order and revenue generator to open that employee’s dashboard. | ||
|
|
||
| * The example starts with the default *Main page*. | ||
| * Add a second page called *Employee info*. | ||
| * Use an action on the *Main page* to set a parameter and navigate to *Employee info*. | ||
|
|
||
| 1) On the *Main page*, add a card with a Cypher query that returns each employee’s name, number of orders, and total revenue. | ||
|
|
||
| [source,cypher] | ||
| ---- | ||
| MATCH (e:Employee)-[:SOLD]->(o:Order)-[orders:ORDERS]->(:Product) | ||
| RETURN | ||
| e.firstName AS employee, | ||
| count(DISTINCT o) AS orders, | ||
| round(sum(orders.quantity * orders.unitPrice), 2) AS revenue | ||
| ORDER BY revenue DESC | ||
| ---- | ||
|
|
||
| 2) Add an action to the `employee` column's values | ||
|
|
||
| In the actions panel set: | ||
|
|
||
| . *TRIGGER* *Cell click* | ||
| . *ON CELL* *employee* | ||
| . *UPDATE PARAMETER* *employee* | ||
| . *TO CELL VALUE* *employee* | ||
| . *NAVIGATE TO PAGE* *Employee info* | ||
|
|
||
| .Add action | ||
| [.shadow] | ||
| image::dashboards/actions/add-action.png[width=900] | ||
|
|
||
| Once the action is configured, the action preview shows its structure | ||
|
|
||
| *action trigger → parameter action → optional navigation action* | ||
|
|
||
| .Action preview | ||
| [.shadow] | ||
| image::dashboards/actions/action-preview.png[width=900] | ||
|
|
||
|
|
||
| 3) Use the `$employee` parameter on the `Employee info` page's visualizations | ||
|
|
||
| On the *Employee info* page, add a Cypher query to a card that reads the parameter and returns details for the selected employee. | ||
|
|
||
| [source,cypher] | ||
| ---- | ||
| MATCH (e:Employee) | ||
| WHERE e.firstName = $employee | ||
| RETURN | ||
| $employee AS employee, | ||
| e.notes AS notes | ||
| ---- | ||
|
|
||
| 4) Click on a name on the `Main page` | ||
|
|
||
| .Top employees selected on the Main page, with hover over the filter icon | ||
| [.shadow] | ||
| image::dashboards/actions/top-employees.png[width=400] | ||
|
|
||
| 5) This navigates you to the `Employee info` page and updates the visualization based on the value that was selected | ||
|
|
||
| .Employee info | ||
| [.shadow] | ||
| image::dashboards/actions/employee-notes.png[width=600] | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| = Actions | ||
|
|
||
| An action is event-driven. | ||
| When an action trigger within a visualization is clicked, it assigns a value to a parameter. | ||
| Any card with a Cypher query that includes that parameter responds immediately, so visualizations update dynamically based on the selection. | ||
|
|
||
| There are two types of actions, used with xref:dashboards/visualizations/table.adoc[tables]: | ||
|
|
||
| * xref:dashboards/actions/cell-click.adoc[Cell click action] - Triggered when a person clicks a specific cell value. | ||
| * xref:dashboards/actions/row-select.adoc[Row select action] - Triggered when a person selects one or more rows. | ||
|
|
||
| [.shadow] | ||
| .Dashboard actions | ||
| image::dashboards/actions/dashboard-actions.png[] | ||
|
|
||
| Use cases: | ||
|
|
||
| * Click a person's name → filters other charts with their data | ||
| * Click a cell → navigates to another dashboard page with context applied, allowing drill-down into the data | ||
| * Select multiple rows of orders → another card calculates total order weight | ||
|
|
||
| For many use cases, especially proof-of-concepts, this level of interactivity significantly expands what dashboards can do. | ||
| This enables rapid prototyping, with your dashboard behaving like an app. | ||
|
|
||
| Instead of building a graph app with frontend code, sketch one directly in your dashboard. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| = Row select action | ||
| :description: Select multiple values for a table to be used in a parameter. | ||
|
|
||
| The row select action is available for xref:dashboards/visualizations/table.adoc[Tables]. | ||
|
|
||
| Select a value from a table row by clicking a checkbox. and assign it to a parameter. | ||
| Reuse this parameter in another card or query. | ||
| Only the selected cell value is passed, not the full row. | ||
|
|
||
| You can select multiple rows, and multiple values from the same column will be selected and added to a xref:dashboards/list-parameters.adoc[list parameter]. | ||
|
|
||
| == Example | ||
|
|
||
| The examples on this page use the xref::/dashboards/index.adoc#_sample_dataset[Northwind sample dataset] which you can also use. | ||
|
|
||
| The selected OrderID values are passed to `$orderID`. | ||
| We'll then use that in another card to calculate the total freight. | ||
|
|
||
| === Step 1: Add the first card | ||
|
|
||
| To return orders in a table, paste the following Cypher into the card, then select *Save*: | ||
|
|
||
| .Return orders in a table | ||
| [source,cypher] | ||
| ---- | ||
| MATCH (c:Customer)-[:PURCHASED]->(o:Order) | ||
| RETURN o.orderID AS OrderID, c.companyName AS CustomerCompanyName, o.freight AS Freight | ||
| ---- | ||
|
fiquick marked this conversation as resolved.
|
||
|
|
||
| === Step 2: Add an action | ||
|
fiquick marked this conversation as resolved.
|
||
|
|
||
| In the actions panel set: | ||
|
|
||
| 1. *TRIGGER Row selection* | ||
| 2. *UPDATE PARAMETER orderID* | ||
| 3. *TO CELL VALUE OrderID* | ||
|
|
||
| When you select a row, the OrderID value from that row is stored in `$orderID`. | ||
| If you select multiple rows, $orderID stores a list of OrderID values. | ||
|
|
||
| === Step 3: Add a second card | ||
|
|
||
| Now you can use the `$orderID` value in another card. | ||
|
|
||
| For example: | ||
|
|
||
| .Calculate the total freight across selected orders | ||
| [source,cypher] | ||
| ---- | ||
| MATCH (o:Order) | ||
| WHERE toString(o.orderID) IN $orderID | ||
| RETURN sum(toFloat(o.freight)) AS TotalFreight | ||
| ---- | ||
|
fiquick marked this conversation as resolved.
|
||
|
|
||
| Selecting multiple rows adds the OrderID values to a list, allowing you to calculate the total freight across those orders. | ||
|
fiquick marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| = List parameters | ||
|
|
||
| List parameters allow you to pass multiple values into a parameter and use them in Cypher queries. | ||
| Define the parameter once, then reference it using the `$` prefix. | ||
| See link:https://neo4j.com/docs/cypher-manual/current/values-and-types/lists/[Cypher Manual -> Lists] | ||
|
|
||
| == Example | ||
|
|
||
| Examples used here use the Northwind dataset as outlined in xref::/dashboards/index.adoc#_sample_dataset[Northwind sample dataset] and you can recreate them in your own dashboard. | ||
|
|
||
| This example compares how many items are ordered by selected countries. | ||
|
|
||
| 1. Set the list parameter `$list = ["UK", "France", "Germany"]` | ||
|
|
||
| 2. Add a card and set the visualization to a bar chart. | ||
|
|
||
| 3. Paste the Cypher query: | ||
|
|
||
| [source,cypher] | ||
| ---- | ||
| MATCH (o:Order)-[r:ORDERS]->(p:Product) | ||
| WHERE o.shipCountry IN $list | ||
| RETURN o.shipCountry AS country, | ||
| sum(r.quantity) AS unitsOrdered | ||
| ORDER BY unitsOrdered DESC | ||
| ---- | ||
|
|
||
| As a result, we can see in the Northwind dataset that Germany orders the most units, followed by the UK, then France. | ||
|
|
||
| [.shadow] | ||
| .Compare how many items are ordered by selected countries. | ||
| image::dashboards/parameters-and-filters/list-parameter.png[example] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| = Parameters | ||
|
|
||
| The parameters drawer lets you adjust values that shape your dashboard results. | ||
| It's on the top right side of a dasboard. | ||
| Use the curly brackets icon `{}` to | ||
| link:https://neo4j.com/docs/aura/dashboards/parameters-and-filters/#_step_1_open_the_parameters_drawer[open the parameters drawer]. | ||
|
|
||
| * *Default value*: The default value if there is no initial current value. It is not required. | ||
| * *Current value*: The current value is used even if there is a default value. | ||
|
|
||
| == Parameters drawer | ||
|
|
||
| .The parameters drawer | ||
| [.shadow] | ||
| image::dashboards/parameters-and-filters/parameters-drawer.png[] | ||
|
|
||
| The drawer shows the dashboard parameters in alphabetical order. | ||
| Each parameter has an icon next to it hinting at its data type: | ||
|
|
||
| * A text icon for strings. | ||
| * A toggle icon for boolean. | ||
| * A hashtag icon for numbers. | ||
| * A calendar icon for dates. | ||
| * A filter icon for unspecified data types. | ||
|
|
||
| === Creating a parameter in the parameter drawer | ||
|
|
||
| . From the **Parameters** drawer, use the **Add** button. | ||
| . In the dialog, enter a parameter name, select a data type and optionally an initial value for the parameter, then **Save**. | ||
|
|
||
| === Editing a parameter | ||
|
|
||
| . From the **Parameters** drawer, hover over the parameter you wish to edit. | ||
| . In the dialog, edit the parameter name, data type and/or initial value, then **Save**. | ||
|
|
||
| === Using a parameter in a query | ||
|
|
||
| To use a parameter in a Cypher query, prefix the parameter name with `$`. | ||
| See link:http://localhost:8000/aura/dashboards/parameters-and-filters/#_step_2_add_a_parameter[add a parameter]. | ||
|
|
||
| // .Cypher query for a table which displays products with a certain number of units in stock | ||
|
|
||
| // MATCH (p:Product) | ||
| // WHERE p.unitsInStock = $unit_param | ||
| // RETURN p.productName as product, p.unitsInStock AS units | ||
| // LIMIT 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Thanks for this text Niels, really cool!