Draft: Feature: Export data to PDF
Why this change?
This pull request introduces a new feature that allows users to export data as PDF as the only options currently available are csv export or taking screenshots (both of which are not the most human-friendly:)). The addition of PDF export enables users to conveniently share data with healthcare professionals such as doctors or simply take a look themselves. The look is
Description
I have tested this MR:
-
tested this PR on iOS simulator/physical device, -
tested this PR on Android simulator/physical device, -
ran e2e tests.
Using the React-Native-Html-to-PDF library, this feature dynamically generates html & svg elements that are then rendered as a pdf containing an overview and a chart corresponding to one cycle that can be shared via the native Share dialog.
Steps to Test or Reproduce
Pull -> Settings -> Export -> Export as PDF
Reviewing
Here's what I am looking for feedback on in particular:
- How are different symptoms best represented in a cell? Is the way I decided to represent "Mood" too much?
- What are some other statistics that could be interesting for the overview page? I was thinking something with pain & heaviest day, but not sure how to calculate.
In addition:
- Writing to local drive in Android should be the first step before deploying this to Android. This is also why I have not yet tested this.
- I noticed lots of i18n misunderstandings in other parts of the code- I will create an issue for this but this is why there are some i18n changes in here as well.
- There are some improvements that would be great - not sure if they should be implemented immediately or rather at a later point, after merging this
- Adjusting font size to match number of entries
- Making line graph more readable & copying scale to right-hand side as well
- Dealing with really long cycles > 99? Split into multiple pages?
- Customizing which categories show up in the pdf
- Adding more information to the legend
"Regular cycle" (note that there is one temperature tracked which is why the text does not show up)
Very long cycle & no temperatures added
Very short cycle (this screenshot is older, this now also has the drip logo at the top)