-
Notifications
You must be signed in to change notification settings - Fork 25
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
Navigation between dashboard pages #23
Comments
I wonder what this will look like in the configuration. Our first use case is that clicking on a bar uses the value for that bar as the value for a query parameter. Currently, adding the barChart.onBarClick((d) => console.log(JSON.stringify(d, null, 2))); Clicking on each of the 3 bars prints the following: {
"key": "myApp-0",
"doc_count": 23744,
"Sum of MB": 86.69855308532715
}
{
"key": "myApp-1",
"doc_count": 21277,
"Sum of MB": 71.80753326416016
}
{
"key": "myApp-2",
"doc_count": 4448,
"Sum of MB": 15.981668472290039
} We ultimately want to take the value of
Therefore the configuration should be able to specify an Here's a very rough sketch of what it might look like: "navigation": {
"event": "onBarClick",
"destinationRoute": "/dashboards/appDetails",
"sourceKey": "key"
"destinationParam": "app"
} @t00f Any thoughts on this? |
It looks like a great idea to store these information in the configuration file ! We have two kinds of event: A) Those which will change the route completely I have a few questions about the example you gave above:
I will think deeper to this question to see how it could work ! |
Coming back on this ticket as promised. I feel it's a flexible approach to allow the graph send some events by name and let the visualization configuration specify which event should be used. We might need an easy way to retrieve all event names for a specific graph. Perhaps using an The visualization configuration can then register listeners. Each listener can have a targeted action. "listeners": [{
"event": "onBarClick",
"action" : {
"type": "redirect", // Can be "redirect" or "override" to specify the action that should be done on the URL.
"url": "/dashboards/appDetails" // In case of "redirect", we should specify the destination url. Otherwise, the same URL is used and parameters are appended to the query part.
"params": [ // List of params that needs to be passed in the URL (both "redirect" and "override" cases
{
"name": "app", // Specify the name of the param (i.e ?app=123)
"key": "ID" // Specify the key of the object that has been clicked as you suggested previously
},
{
"name": "enterprise", // We should also be able to pass a parameter that comes from the context.
"key": "enterpriseID" // Maybe we can consider the following: If the key is not present in the object clicked, the key can be retrieved within the context ?
]
}
}] |
@t00f I like your suggestions regarding:
I'm thinking to go with the following configuration structure, a hybrid of my original and your suggestions: {
"navigation": {
"redirect": "/dashboards/appDetails",
"params": {
"app": "ID", // Key is the destination param, value is source column from clicked data object.
"enterprise": "enterpriseID"
}
}
} If "redirect" is unspecified, stay on current route and change params only (keeping existing params from the context). |
I'm realizing that we may need multiple listeners at some point, so making the configuration an array as you suggested. Also I do like the idea of the name "listeners" instead of "navigation", as it is more general and leaves the door open for functionality other than navigation.
|
Great thoughts here. I like the implementation you suggested. |
Add navigation functionality such that clicking on a bar (which represents an app) in the overview dashboard navigates to the app-specific dashboard (parameterized by the clicked app).
Depends on #22, #21, and #20
The text was updated successfully, but these errors were encountered: