Plot builder fixes - #480
Conversation
|
@vandenman I pushed this two months ago, but I'm only now seeing all these failed tests. What's causing this? Also, could someone take a look at it to see if it can be fixed using the plot builder? |
5afcd00 to
ff65f78
Compare
|
I deleted the last commit because the issue has already been resolved in version 0.97 |
|
Hmm the unit tests are still failing. No clue why... @vandenman ? |
|
I'd like to remove the "beta" label from the plot builder eventually, but unfortunately, my current pull request always gets left behind in the new releases, so things aren't moving forward. Could you take a look at it? |
|
Yes, let's remove that label please! |
|
@boutinb @vandenman |
|
Are these failing unit tests being worked on? If we want to get rid of the beta-label it would be really important to get this in, would it not? |
|
Is there any progress here? There are already a lot of issues with the plot builder, and I'd like to update it, too. |
|
@matyasbukva |
|
@boutinb : can we have a review on this one please or an explanation on the failing unit tests or what can be done? |
better axis and margin and p value handling logic.
better axis and margin and p value handling logic.
ff65f78 to
c14dde8
Compare
…dding Rewriting the Y axis block lost two options along the way. The Y axis title (titleYPlotBuilder) and the "cut short scale" checkbox (cutShortScaleY) were no longer passed to tidyplots::adjust_y_axis, so both fields sat in the interface doing nothing while their X axis counterparts kept working. The padding then went the other way and became too strict: an option that is not in the options at all reads back as numeric(0), and is.finite() on that gives logical(0), which makes `||` stop with "missing value where TRUE/FALSE needed". So a plot whose options predate these fields errored out instead of falling back. Fall back per value on anything that is not a single finite number, to the 0.1 the qml offers rather than the 0.05 that was written here, and give the X axis the same treatment since it passed the raw option straight through. Finally, translate the comments to English. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
I'm not a R expert, and @vandenman is not maintaining anymore the module. I have asked Claude, below is what I get, and I asked him (it?) to fix the main issues (in the last commit). The core idea is sound, but the rewrite dropped three Y-axis options, and two of them are now dead. Blocking
titleValueY <- tab[["titleYPlotBuilder"]] and nothing replaces it — there is no title anywhere in the tidyplots block (~L1690–1900) except the X one at L1702. Meanwhile titleYPlotBuilder is still a live QML field (inst/qml/jaspPlotBuilder.qml:2299), so a user typing a Y-axis title now sees nothing happen, while the X title still works. Looks like collateral damage from restructuring the block rather than intent.
Worth checking
ifelse(is.finite(bottom_padding), bottom_padding, 0.05) but the QML default is now 0.1. Also, the new is.finite guarding applies only to Y — X still does adjust_args_xaxis$padding <- c(XPaddingFirst, XPaddingSecond) raw (L1746–1748), so an empty X padding field passes NA straight to tidyplots. Either give X the same treatment or make the fallback 0.1 to match the QML.
What's good The empty-title guard (nchar(trimws(...)) > 0) is a real fix — previously a whitespace-only title added an empty title element. The indentation corrections around the isRM block are fine. And restructuring the Y block into limits → breaks → padding is genuinely more readable than what it replaced. One thing I checked that is not a problem: removing adjust_args_yaxis$rotate_labels does not break rotateYLabel — it's still applied via the ggplot2 theme at L2160. If anything that removes a double rotation for Y; note X is still rotated twice (L1740 and L2156), which may be worth a follow-up. |
|
The unit tests are still failing. Copilot tells that it's probably due to dependency update (particularly ggplot2 or scales package). I know that there is are a lot of things going on with ggplot2, so I think it's better that someone knowing more about it tries to solve this problem. @FBartos maybe? |
fix issue: jasp-stats/jasp-issues#4118 (comment)