-
Notifications
You must be signed in to change notification settings - Fork 35
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
Refactor dashboard code #1876
Comments
@marla-singer Could you co-pilot this task, i.e. mentor @brylie when he is working with modularizing? |
@bajiat yes, sure. |
After meeting with @marla-singer, we are suggesting that:
@philippeluickx also suggested that each chart template could trigger a server side request for only the data it needs. That would mean that multiple requests could be made in parallel, and each chart would render as its data became available. Ping @bajiat @frenchbread @jykae @NNN |
I think also from the "perceived performance" point of view, it's always nice to see some results already. So even if I only see the first graph and the others are still loading, that will feel faster than having everything shown at the same time. |
Break the dashboard code into submodules. At the same time, ensure that the charts will work with multiproxy.
Definition of done
Notes from exploratory session
List of things to refactor in Dashboard code:
Current structure
The Dashboard code has the following structure:
Complexity
The main areas of complexity are within
charts.js
anddashboard.js
.charts.js
What is in the charts.js file? What does it do?
The charts.js file manages
Methods
The dashboardCharts template has the following instance methods:
Some of these template methods could be moved into the templates where they are directly used. Then, the 'chartData' would just be passed directly into each chart component, or we could even make a request specifically for the chart component.
Event handlers
The dashboardCharts has the following event handlers:
It may be possible to combine, or even remove, the tick (day, week, month) handlers and move the result methods to
tickButtons
templatedashboard.js
What is in the dashboard.js file? What does it do?
Methods
The dashboard template has the following instance methods:
Desired structure
We would like to structure the dashboard code in a simpler manner, such as:
The text was updated successfully, but these errors were encountered: