Skip to content

Create a new function to get HL plots from a PKNCAdata object#932

Merged
Gero1999 merged 11 commits intomainfrom
931-enhancement-create-a-new-function-to-get-hl-plots
Jan 27, 2026
Merged

Create a new function to get HL plots from a PKNCAdata object#932
Gero1999 merged 11 commits intomainfrom
931-enhancement-create-a-new-function-to-get-hl-plots

Conversation

@Gero1999
Copy link
Copy Markdown
Collaborator

@Gero1999 Gero1999 commented Jan 23, 2026

Issue

Closes #931

Description

  • Added get_halflife_plots to generate Plotly-based half-life plots from PKNCA data, including fit lines, scatter points, and customizable annotations. Handles missing/excluded data robustly and supports grouping.
  • Introduced internal helper get_halflife_plots_single to encapsulate the logic for rendering a single plot, managing marker colors, shapes, and hover text for individual data points.
  • Added a comprehensive test suite (test-get_halflife_plots.R) covering:
    • Basic valid output and type checking.
    • Edge cases such as empty data or missing exclusion columns.
    • Correct rendering of marker colors and shapes under various inclusion/exclusion scenarios.

Definition of Done

  • new fun can take as input a PKNCAdata
  • new fun count with tests

How to test

No need to open the App. Just check the code logic and the tests. Run the testing file with the example input. Feel free to try with any other PKNCAdata input (although this is just optional homework 😉 )

Contributor checklist

  • Code passes lintr checks
  • Code passes all unit tests
  • New logic covered by unit tests
  • New logic is documented
  • App or package changes are reflected in NEWS
  • Package version is incremented
  • R script works with the new implementation (if applicable)

Notes to reviewer

Tidyverse style is not followed in this PR

@Gero1999 Gero1999 linked an issue Jan 23, 2026 that may be closed by this pull request
2 tasks
Copy link
Copy Markdown
Collaborator

@js3110 js3110 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some nitpicks and a couple of comments/questions

Comment thread R/get_halflife_plots.R
Comment thread R/get_halflife_plots.R
Comment thread R/get_halflife_plots.R
Comment thread R/get_halflife_plots.R
Comment thread R/get_halflife_plots.R
Comment thread R/get_halflife_plots.R
Comment thread R/get_halflife_plots.R
Comment thread R/get_halflife_plots.R Outdated
Comment thread R/get_halflife_plots.R Outdated
Comment thread R/get_halflife_plots.R
@Gero1999 Gero1999 removed the request for review from m-kolomanski January 26, 2026 13:10
@Gero1999
Copy link
Copy Markdown
Collaborator Author

Tidyverse style will be ignored for this case (PKNCA), the rest of points will be addressed

@js3110
Copy link
Copy Markdown
Collaborator

js3110 commented Jan 26, 2026

Tidyverse style will be ignored for this case (PKNCA), the rest of points will be addressed

What do you mean by this? I am assuming you have plans to integrate this as a PKNCA function and that PKNCA doesn't use tidyverse?

@Gero1999 Gero1999 requested a review from js3110 January 26, 2026 15:57
Copy link
Copy Markdown
Collaborator

@js3110 js3110 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

Copy link
Copy Markdown
Collaborator

@Shaakon35 Shaakon35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Gero1999 Gero1999 merged commit 2d2f324 into main Jan 27, 2026
9 of 10 checks passed
@Gero1999 Gero1999 deleted the 931-enhancement-create-a-new-function-to-get-hl-plots branch January 27, 2026 12:39
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.

Enhancement: Create a new function to get HL plots

3 participants