-
Notifications
You must be signed in to change notification settings - Fork 23
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
Change from pie charts to 100% stacked bar chart #123
Merged
shankari
merged 202 commits into
e-mission:main
from
iantei:Change-from-Pie-Charts-to-100%-Stacked-Bar-Chart
May 6, 2024
+609
−467
Merged
Changes from 1 commit
Commits
Show all changes
202 commits
Select commit
Hold shift + click to select a range
581b492
Function to create 100% Stacked Bar Chart
iantei d6f1b82
Add calculate_pct(labels, values) to calculate the proportion.
iantei 5ddc396
Introduce a process_trip_data() to create a dataframe with cols Mode,…
iantei 1165562
Merge list of all dataframes into one.
iantei 2e9ad7d
Remove functions related with Pie Chart from plots.py.
iantei a55e9f6
Remove code and markdown blocks related with Pie Chart from generic_m…
iantei 7e71308
Add sensed_algo_prefix for generic_metrics notebook.
iantei 45db963
Added load_viz_notebook_sensor_inference_data() function in generic m…
iantei ec9037b
Filter for mode_of_interest.
iantei ebeb9dd
Remove Generic Metrics markdown.
iantei a1283bb
Markdown and code for 100% Stacked Bar Charts based on Number of Trips.
iantei 441019c
2. 100% Stacked Bar Charts representing 80th of number of trips.
iantei e53c0cc
3. 100% Stacked Bar Charts representing commute trips.
iantei eb3dcfc
Clean up.
iantei e582011
4. 100% Stacked Bar Charts representing Distance by Mode.
iantei 5fedbb0
5. 100% Stacked Bar Charts representing Count by Purpose.
iantei f31e43e
6. 100% Stacked Bar Charts representing Replaced mode.
iantei 7b6cef2
Update markdown for 6.
iantei 428982c
7. 100% Stacked Bar Charts representing Trip Distance based on Replac…
iantei 119d707
Update Markdown text.
iantei 1c5e00a
Copied the bar plots from generic_metrics_sensed notebook to generic_…
iantei 4d58d4c
Copied the bar plots from mode_specific_metrics notebook to generic_m…
iantei 7f31c5d
Added Store alt text function for stacked bar charts. Added html tabl…
iantei 3388258
Added alt_text for stacked bar charts in generic metric notebook.
iantei 11345f6
Retrieve htmlFile in index.html.
iantei 2f7b0da
Update data-sizex to 8 from 4 for ntrips_mode_confirm.
iantei c17027d
Add X and Y axis labels.
iantei 5d83605
Update the quality text for sensed in scaffolding.py
iantei f91f379
Update the default loaded configs.
iantei 339f0cd
Remove older file names and option values associated with it. Update …
iantei 1cc1254
Update the file names. Remove print statements.
iantei c2c0576
Rotate the X- axis ticks by 90, and provide last updated text below X…
iantei c639d89
For Stacked Bar Charts: 1. Update the plots title. 2. rename file fro…
iantei 687633f
Experiment with adding html file in the same widget as image.
iantei 66cb274
Changed the option value from miles_ to distance for Stacked Bar Chart.
iantei ddcfb1c
Added new widget for the additional information table with a checkbox…
iantei a95225a
Round up the pct values in the table to one decimal place, and format…
iantei cad3b1d
Update the data-sizex for distance_ option value.
iantei 328c185
Update the legend to showcase (Sensed) for all the Sensed modes. Adde…
iantei 07b08c8
Enable the checkbox only for the Stacked Bar Charts.
iantei eed9a0e
Uncheck the checkbox when switching to non-Stacked Bar Chart related …
iantei eb83f5c
Revert changes implemented for checkbox.
iantei ce3e38d
Added More Info button alongside the plot title for Stacked Bar Charts.
iantei c3a7273
Removed ntrips_ebike_purpose, and introduced ntrips_ebike_replaced_mode.
iantei ef5574f
Fix the ntrips_replaced_mode value.
iantei 4c8eb68
Update to keep both alt_text as well as alt_html in a single function.
iantei 41324d2
Removed store_alt_text function related with pie chart.
iantei 90e2bf9
Update merged_debug_df to appropriate functions.
iantei 052fb54
Update all Stacked Bar Charts to store both alt_text and alt_html fil…
iantei 77e963d
Refactor Stacked Bar Chart 1. Now handles case when we have only one …
iantei 6718f5f
Refactor Stacked Bar Chart 2. Now handles case when we have only one …
iantei 7fa150e
Refactor Stacked Bar Chart 3. Now handles case when we have only one …
iantei 1b9a15c
Refactor Stacked Bar Chart 4. Now handles case when we have only one …
iantei 7e4d3aa
Refactor Stacked Bar Chart 5. Now handles case when we have only one …
iantei 2e84f41
Refactor Stacked Bar Chart 6. Now handles case when we have only one …
iantei 4112448
Refactor Stacked Bar Chart 7. Now handles case when we have only one …
iantei 64abfb3
Update dist block for average_miles_mode_confirm.
iantei a9b2fa3
Removed and merged number of trips and distance related Mode_Specific…
iantei ac7475d
Remove all changes associated with Mode Specific ntrips and distance …
iantei 5aafc02
Mode_of_interest needs to not None for it be available.
iantei 87289ab
Update <= for the cutoff.
iantei 2bae83c
Handle expanded_ct, expanded_ct empty cases. 2. Fill up the empty lis…
iantei e97c20b
Remove generic_metrics_sensed and mode_specific_metrics notebooks. Re…
iantei b554005
Corrected the heading for under 80th Stack Chart.
iantei 8450622
Added the metric/imperial notation of distance in chart title.
iantei 01cadb4
Fix text representation for distance_mode.
iantei 2819568
Update the data-sizex of average_miles_replaced_mode identical to oth…
iantei d033234
Update option value from distance_mode to total_trip_length, and upda…
iantei 067e242
Simplify the selection of stacked metrics using boolean check only.
iantei 8e7292a
Updated the text to showcase as under 80th percentile for ntrips_unde…
iantei 4542530
frontend/metrics_program.html
iantei 29b60d4
Shortened the text for ntrips_purpose.
iantei 66b2397
Update use_imperial for Miles in average_miles_replaced_mode.
iantei 376e064
Simplify process_data_for_cutoff().
iantei d5c15bd
Simplify process_data_frame() for Based on Number of Trips.
iantei 59236a1
Re-used process_data_frame() instead of process_trip_purpose_data().
iantei 21716f8
Renamed data_frame to df and column_name to df_col, and third param t…
iantei ae9c309
Update the text value for total_trip_length to align with others.
iantei 976c636
Changes to reduce size when there is single bar present in the 100% S…
iantei 5b82f6e
Update the legend box to pin it to the upper left corner and with fon…
iantei d3e531d
Update the plot_title_no_quality for Total Trip Length stacked bar ch…
iantei 64c02e4
Change from label_units to label_units_lower for Total trip length ch…
iantei cda15cc
Shorten Stacked Bar Charts' Trip Type labels.
iantei f6c7144
Update trip type param text for df_purpose_trip_eb.
iantei d354641
Segregate sensed land, Replace mode based charts into different Stack…
iantei b5da35b
Fix for the error RuntimeError(Unknown return type) in Stacked Bar Ch…
iantei b33426e
Added metrics dropdown for 1.Number of total trips by replaced mode. …
iantei 4dd2f8f
Remove process_distance_data() function from Replaced Mode block.
iantei 30b7f68
Update Labeled bar for land based distance computation (Stacked Bar C…
iantei bfba1f1
Limit generation of charts in accordance with study_type.
iantei ba1c038
Remove unnecessary extra block of code.
iantei 531e510
Update the study_type to program from study.
iantei 541a973
Update the metric list description for ntrips_total_replaced_mode.
iantei 9270ea9
Update access to data_eb and expanded_ct after the check of it not be…
iantei 310f36e
Update else statement.
iantei 6a3684b
Added by land in plot_title_no_quality.
iantei 9954f40
Update Markdown for individual Stacked Bar Charts.
iantei 98eabec
Merge remote-tracking branch 'origin/main' into Change-from-Pie-Chart…
iantei 4b1a6dc
Remove Bar Charts code block related to mode_specific_metrics.
iantei 4816be9
Remove Pie Chart related code from mode_specific_metrics notebook.
iantei fbf8494
Update data_eb groupby computation for the Average miles per trip for…
iantei b126cb3
Shift the implementation of mode specific trips by purpose to mode_sp…
iantei 259ee32
Shift the implementation of mode specific Total Trip Length to mode_s…
iantei e4a81a1
Shift the implementation of mode specific Number of Trips to mode_spe…
iantei a6535a7
Remove mode_specific_metrics related computation of data_eb and quali…
iantei 1f4259a
1. Create dictionary of sensed mode from this list of sensed labels. …
iantei d03357a
Remove mapping with Sensed prefix for legend since we will have disti…
iantei 4c8e726
Add colors_combined dictionary as the arg for stacked_bar_chart_gener…
iantei cee1111
Update colors_combined dictionary returned from mapping_color_labels …
iantei cc6c436
Replace calculate_pct with merge_small_entries, and use it to compute…
iantei d25b3b5
Keep index for enumerate inside stacked_bar_chart_generic()
iantei e4cad01
Update subplot implementation for stacked bar chart.
iantei 432c5ec
Change from stacked_bar_chart_generic to plot_stacked_bar_chart().
iantei e004a7d
Change from stacked_bar_chart_generic to plot_stacked_bar_chart() for…
iantei df92dfb
Fix alt html function call for generic_metrics notebook.
iantei 753331a
Fix alt html function call for mode_specific_metrics notebook.
iantei a569ead
1. Initilize all_data_frames_commute for commute metrics. 2. Update t…
iantei 78c724e
1. Update to use all_data_frames instead of list of individual df for…
iantei 90957da
Fix for alt_html u80 metric chart in generic_metrics notebook.
iantei c3fc043
Fix for mode_specific_metrics notebook alt_html.
iantei 0766b2e
Only return and store alt_html. alt_txt removed.
iantei b0030aa
Use expanded dataframe to create alt_html.
iantei dcf4290
Update all Stacked Bar Chart metrics with expansion button option.
iantei 96bd2fe
Update option value for mode specifc metrics.
iantei bca500f
Update file names for mode_specific_metrics Stacked Bar Chart files.
iantei e583900
Add mode_specific_metrics notebook for generate_plots.py in crontab.
iantei 4eb6f8a
Scale down the stacked bar chart to maintain aspect ratio.
iantei 00cd1de
1. Remove mode_of_interest from generic_metrics notebook. 2. Split me…
iantei 59cd9b2
Restore changes with alt_text.
iantei e627a86
Update changes for ntrips_mode_of_interest_purpose metric.
iantei deccaa8
Update input param description for process_trip_data().
iantei ed835a5
Shift process_data_frame(), process_distance_data(), process_data_for…
iantei 277e4f8
Update the button name from addButton to additionalInfoButton.
iantei f785d59
Use mode_studied instead of data.intro.mode_studied.
iantei 625a65f
Remove unnecessary console.log statements.
iantei bf09575
Remove 'Other' since it's already part of purpose_labels.csv.
iantei 874108c
Remove extra lines. Remove unnecessary import.
iantei ccb7126
1. Split plot_stacked_bar_chart() to plot fig title separately. 2. Wh…
iantei de6f326
1. Remove consolidated list of dataframes call to plot_stacked_bar_ch…
iantei 6e6936a
1. Remove consolidated list of dataframes call to plot_stacked_bar_ch…
iantei cac7b7f
Update index for Stacked Bar Charts.
iantei 8ea9e15
Restore default use_imperial to True.
iantei 477b213
Merge branch 'main' into Change-from-Pie-Charts-to-100%-Stacked-Bar-C…
iantei f993363
Refactor to add comments. Update variable names.
iantei dcfe978
Move the call to plot_stacked_bar_chart() inside the check of their d…
iantei 4bfe65f
Move the call to plot_stacked_bar_chart() inside the check of their d…
iantei f9e2cde
Remove use of combined all_frames_expanded list. Remove existing appr…
iantei 6749182
Create call to create_alt_text/html_title() and store_alt_text/html_s…
iantei a02bb8d
Remove use of combined all_frames_expanded list. Remove existing appr…
iantei de9b086
Remove use of combined all_frames_expanded list. Remove existing appr…
iantei b796302
1. Update the arg in access_alt_text/html with write_permission. 2. R…
iantei d993181
Introduce create_alt_text/html() to add overall plot title in text/html.
iantei fa0da1f
1. Remove arg write_permission. 2. Pass 'w' or 'a' based from the fun…
iantei 0cc2cc8
1. Remove write_permission args. 2. Move plot_stacked_bar_chart() out…
iantei 37dc0aa
1. Remove write_permission args. 2. Move plot_stacked_bar_chart() out…
iantei 44bbb03
Update the plot title when none of the dataframe is available for gen…
iantei 8b918aa
Fix alt_text formatting of extra new line.
iantei 704df5a
Remove write_persmission info. Update the function comment for create…
iantei a83e15d
1. Remove the initialization of empty data frame. 2. Remove check for…
iantei dde65d0
1. Remove empty df initialization. 2. Remove check for empty data fra…
iantei d5d1bff
Change Mode to Label and Count to Value in plots.py.
iantei 16b389d
Update the text formatting for store_alt_text_stacked_bar_chart.
iantei d8e73a6
Remove Trip Type as column from the data frame for Stacked Bar Chart.…
iantei 3e0c2b2
Remove Labeled/Sensed by ... message from call to process_*() and use…
iantei 46e3a4a
Remove Labeled/Sensed by ... message from call to process_*() and use…
iantei fca63a3
Add try except block in process_*() so that we catch exception for ea…
iantei e4bd690
1. Handle specialized quality_text to return empty string if the data…
iantei 7f8ad02
Split colors_combined, use individual color dict mapping.
iantei d00faf1
Resolve merge conflict in viz_scripts/generic_metrics.ipynb.
iantei 9b5bd1a
Resolve merge conflict in generic_metrics notebook.
iantei 50d38ce
Merge store_alt_text and store_alt_html into a single function.
iantei 179dd25
Merge store_alt_text and store_alt_html into a single function for mo…
iantei 893f69d
Merge create_alt_text/html into a single function.
iantei 4f1c385
Refactor code block for Commute Trips in generic_metrics.
iantei 12b00e3
♻️ Heavy lift on the refactoring
shankari 89ff25d
🔥 Remove the commute processing since it is the same as the general p…
shankari ffbde93
🔥 ♻️ Remove the write permission flag for the text file outputs
shankari 099c8bc
🔥 Remove the merged_debug_df
shankari ffb3d81
Fix formatting
shankari 013ca55
🔥 Remove the code to preprocess cutoffs
shankari f7f3590
♻️ Refactor commute and "short trip" charts to fit the new pattern
shankari 41a5fde
♻️ Change the ordering in which charts are generated in the notebooks
shankari 271b35f
♻️ Revert extraneous changes
shankari 996ba7d
♻️ Hopefully last round of refactoring
shankari 71c2353
Really final refactor
shankari 008d8a9
♻️ Restore unmodified code to the generic_sensed_metrics notebook
shankari ce6f527
♻️ Change the trip purpose to also use the new methods
shankari 8410d33
🐛 Fixed minor issues found while testing with non-zero data
shankari d84833e
🐛 Other minor bug fixes to get the plots that we expect to work to work
shankari a22915f
♻️ Final refactor: pass in the aggregation type
shankari 3542105
Integrate the code refactor changes for Stacked Bar Charts in mode_sp…
iantei 6b4edf1
🐛 Fix the generation of alt text and HTML for a single bar chart
shankari fd0693b
Merge branch 'Change-from-Pie-Charts-to-100%-Stacked-Bar-Chart' of ht…
shankari afda252
Showcase the html information as a table with border = 1.
iantei 139a469
Revert changes from commit id - afda25209125419f50b695f4f57bab9afa22d…
iantei c16e4eb
♻️ More clearly delineate the pre-processing and plotting
shankari 4dbb34c
🥅 Improve error handling across the board
shankari 3ac8e0f
💄 Handling TODO to display the missing HTML properly
shankari 5e5bc42
💄 💩 Fix legend display
shankari 1fcd100
🐛 Fix regression while generating sensed quality text with testers an…
shankari 238cf8e
♻️A Add the quality text to the bars instead of to the chart title
shankari d30503f
♻️ Change the mode specific metrics to use the new library interface
shankari 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
5. 100% Stacked Bar Charts representing Count by Purpose.
commit 5fedbb043f4cd138740aaa3414834f146ead0784
There are no files selected for viewing
This file contains 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
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.
This will change significantly once the plotting method is changed, so I will wait until that is resolved to review.