A htmlwidget that creates a scatterplot. Combines plotly and Displayr/rhtmlLabeledScatter to produce a scatterplot with optimally positioned labels.
To install from GitHub:
require(devtools)
install_github("Displayr/rhtmlCombinedScatter", dependencies = NA)
If you have not set up a GitHub Personal Access Token, you will likely need to do so to avoid
GitHub rate limits, which will manifest as 403 errors when downloading packages via
install_github. Please see the documentation in the usethis package or see the
instructions here and here.
If you are using Windows, you will need to have a version of Rtools installed that matches your version of R in order to build packages from source. Rtools can be downloaded from here.
Specifying dependencies = NA in install_github will not install packages listed
in Suggests in the DESCRIPTION file (some of which may be proprietary and unavailable for download).
The JS tests workflow runs automatically on every push. Its Visual regression tests job compares
rendered output against the committed baselines in theSrc/test/snapshots/ci/master (CI always
compares against master's baselines, whatever branch it is running on). The pixel threshold is
0.0001%, so any intended change to rendering, layout or label placement will turn the job red and the
baselines have to be regenerated. A missing baseline also fails, rather than being silently accepted.
Baselines are environment specific — locally generated snapshots (npm run localTest, which writes
to theSrc/test/snapshots/local/<branch>) will not match CI's fonts and Chromium build, so do not
copy them into theSrc/test/snapshots/ci. Regenerate through CI instead:
- Inspect the failure first. Download the
snapshot-diffsartifact from the failed run and check the__diff_output__images. Only regenerate once you are satisfied every diff is intended. - Dispatch a regeneration run. Actions →
JS tests→ Run workflow, select your branch, and tickupdate_snapshots. Optionally settest_filter(passed tojest -t) to regenerate only the tests matching a name pattern; leave it blank to regenerate all of them. - Download the
regenerated-baselinesartifact from that run. Its contents are rooted atmaster/, so extract it intotheSrc/test/snapshots/ci/— not over the repository root. - Review, commit and push the changed snapshots yourself. Use
git status/git diff --statto confirm only the snapshots you expected have changed.
Steps 2 and 3 can be done from the command line with the GitHub CLI instead of the Actions UI:
# Dispatch a regeneration run on the current branch (add -f test_filter=<pattern> to narrow it)
gh workflow run "JS tests" --ref "$(git rev-parse --abbrev-ref HEAD)" -f update_snapshots=true
# Get the run id, then follow it to completion
gh run list --workflow "JS tests" --event workflow_dispatch --limit 1
gh run watch <run-id>
# Extract the baselines straight into place -- the artifact is rooted at master/
gh run download <run-id> -n regenerated-baselines -D theSrc/test/snapshots/ci
# And the diffs from a failed comparison run, if you want them on disk
gh run download <run-id> -n snapshot-diffs -D .tmp/diffsCI deliberately does not commit the baselines for you. A push made with the default GITHUB_TOKEN
does not trigger any workflow, and workflow_dispatch check runs are excluded from a pull request's
status rollup — so a bot-authored head commit would leave the PR reporting no checks. Pushing the
snapshots yourself produces the full set of checks on the PR.
If you encounter a problem using the package, please open an issue. To achieve a resolution as quickly as possible, please include a minimal, reproducible example of the bug, along with the exact error message or output you receive and the behavior you expect. Including the output of sessionInfo() in R can be helpful to reproduce the issue. Please see this FAQ, which has a number of useful tips on creating great reproducible examples.
