Skip to content
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

[DO NOT MERGE] #119 global filter and #159 code sanitisation #192

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

phuongdoan13
Copy link
Contributor

@phuongdoan13 phuongdoan13 commented May 8, 2023

DO NOT MERGE
#159: I created a file that contains all the columns's name as variables. This file has no effect on the current work, because it doesn't get called anywhere. To make this file effective, you will use Find and Replace, and change the raw strings to variables wherever you find them. We will not proceed any futher on this issue, because we have other issues to focus on. If you find it useful, we will leave it here for future developers.

#119:

  1. I made a global filter file (my_project/callbackMonthHourFilter.py), containing global callbacks. There is an issue with this file that I have to comment out the callbacks. The callback will throw error because it listens to all the ID, including those that are not currently rendered on the tab. Would you have any coding pattern to solve this?

  2. I set the initial values for all the month/time filters based on the global values. However, the charts on the tab when initally loaded are not based on the filter, they used the default values of [1,12], [1,24], no invert. The reason for this is because of this if time_filter: . When first initally loaded, time_filter is 0, thus this if-else is not executed => the dataframe is not filtered.

@phuongdoan13
Copy link
Contributor Author

@FedericoTartarini Hi Federico, can I hear your comments on this?

@FedericoTartarini
Copy link
Contributor

I really like the idea of having a file with the column names.

Regarding the global filter issue, point 2 should work. We could keep the code as it is, each page has its own Store, but then when the Store which contains information about the time and months selected is changed then a callback is triggered and the information is saved in a Global Store. The data in the global store are used to populate the filter on each page each time the page is loaded up. Does this make sense? I will need to try to code it to check if the above logic would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants