This PR adds the ability to display stickiness results as percentages in addition to the current absolute count. It includes changes to both the backend and frontend code.
Backend Changes
Modified the StickinessQuery class in the posthog/schema.py file to include a method for calculating the percentage of stickiness.
Added a new method calculate_percentage to the StickinessQuery class that takes the total count and individual count as parameters and returns the percentage.
Frontend Changes
Updated the FunnelBarGraph component in the frontend/src/scenes/funnels/FunnelBarGraph/FunnelBarGraph.tsx file to include the display of the percentage data in the bar graph.
Added a new field in the data object for the graph that includes the percentage data.
Modified the FunnelBarGraph component in the frontend/src/scenes/funnels/FunnelBarGraph/FunnelBarGraph.scss file to correctly display the percentage data in the bar graph.
Updated the CSS rules to accommodate the new data and ensure the correct display of the percentage values.
Summary
This PR addresses the feature request to show stickiness as a percentage in addition to the absolute count. It includes changes to both the backend and frontend code to calculate and display the percentage data. These changes enhance the usability of the stickiness results by providing a more comprehensive view of the data.
Fixes #13.
To checkout this PR branch, run the following command in your terminal:
Description
This PR adds the ability to display stickiness results as percentages in addition to the current absolute count. It includes changes to both the backend and frontend code.
Backend Changes
StickinessQuery
class in theposthog/schema.py
file to include a method for calculating the percentage of stickiness.calculate_percentage
to theStickinessQuery
class that takes the total count and individual count as parameters and returns the percentage.Frontend Changes
FunnelBarGraph
component in thefrontend/src/scenes/funnels/FunnelBarGraph/FunnelBarGraph.tsx
file to include the display of the percentage data in the bar graph.FunnelBarGraph
component in thefrontend/src/scenes/funnels/FunnelBarGraph/FunnelBarGraph.scss
file to correctly display the percentage data in the bar graph.Summary
This PR addresses the feature request to show stickiness as a percentage in addition to the absolute count. It includes changes to both the backend and frontend code to calculate and display the percentage data. These changes enhance the usability of the stickiness results by providing a more comprehensive view of the data.
Fixes #13.
To checkout this PR branch, run the following command in your terminal: