11# Generated by using Rcpp::compileAttributes() -> do not edit by hand
22# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
33
4+ # ' Size diff literal for C++ arrays / vectors
5+ # ' @noRd
6+ NULL
7+
48# ' Size literal for C++ arrays / vectors
59# ' @noRd
610NULL
913# ' @noRd
1014NULL
1115
12- # ' Can we place `candidate` at this position given the last placed dot and
13- # ' the previous rows of dots placed so far?
14- # ' @param reverse <scalar [logical]> are we placing dots in reverse order?
15- # ' @param candidate <scalar [numeric]> candidate x position
16- # ' @param rows <[list] of [numeric]> list of previous rows of placed dots
17- # ' @param n_rows_back <scalar [integer]> actual number of previous rows to consider
18- # ' @param ygrid <scalar [integer]> max possible number of previous rows in the
19- # ' y grid that could overlap with this candidate
20- # ' @param xsize <scalar [numeric]> horizontal spacing between dots
21- # ' @returns <scalar [logical]> can we place candidate here?
16+ # ' Attempt to place a candidate dot in a target row
17+ # ' @param candidate candidate x position
18+ # ' @param xsize horizontal spacing between dots
19+ # ' @param ygrid size of the y grid (corresponding to 1 + the number of adjacent rows above or
20+ # ' below this row that could overlap with dots in this row)
21+ # ' @param rows rows of already-placed dots
22+ # ' @param target_row iterator pointing at row in `rows` to attempt to place `candidate` in
23+ # ' @returns `true` if the candidate was placed successfully
2224# ' @noRd
2325NULL
2426
3133
3234# ' const end iterator for forward or reverse iteration
3335# ' @param reverse iterate in reverse?
34- # ' @param T iterable type
35- # ' @param vec object to iterate over
36+ # ' @param C iterable type
37+ # ' @param container object to iterate over
3638# ' @noRd
3739NULL
3840
39- # ' Place dots in a single row in the grid_swarm algorithm
41+ # ' push onto front or back of a container
42+ # ' @param front push onto front?
43+ # ' @param C container type
44+ # ' @param container object to push onto
45+ # ' @noRd
46+ NULL
47+
48+ # ' Attempt to place dots in a specific row in the grid_swarm algorithm
4049# ' @param reverse are we placing dots in reverse order?
4150# ' @param both is this a mirrored layout (`side == "both"`?)
42- # ' @param xsize <scalar [numeric]> horizontal spacing between dots
43- # ' @param ygrid <scalar [integer]> max possible number of previous rows in the
44- # ' y grid that could overlap with this candidate
45- # ' @param remaining vector of dots to be placed
46- # ' @param rows <[list] of [numeric]> list of previous rows of placed dots
47- # ' @param rows_bottom <[list] of [numeric]> list of previous bottom rows of placed dots
48- # ' (when `both == true`)
51+ # ' @param candidates dots to be placed
52+ # ' @param next_candidates swap space used for next `candidates`
53+ # ' @param xsize horizontal spacing between dots
54+ # ' @param ygrid size of the y grid (corresponding to 1 + the number of adjacent rows above or
55+ # ' below this row that could overlap with dots in this row)
56+ # ' @param rows rows of already-placed dots
57+ # ' @param rows_bottom bottom rows of already-placed dots (when `both == true`)
58+ # ' @param row_i index of `rows` and `rows_bottom` to place candidates in.
4959# ' @returns `true` if `remaining` may still have dots to place and `false` otherwise
5060# ' @noRd
5161NULL
5262
53- # ' Place dots in `n` rows in the grid_swarm algorithm
63+ # ' Place dots in `n` rows in the grid_swarm algorithm, alternating `reverse`
5464# ' See `place_row()`
5565# ' @returns `true` if `remaining` may still have dots to place and `false` otherwise
5666# ' @noRd
@@ -71,3 +81,14 @@ grid_swarm_ <- function(xs, xsize, ysize, ygrid, side) {
7181 .Call(`_ggdist_grid_swarm_` , xs , xsize , ysize , ygrid , side )
7282}
7383
84+ # ' Re-center contiguous clusters around their mean y position so that
85+ # ' small clusters are visually centered (rather than e.g. a cluster of
86+ # ' two points having one point on the origin line and one above it)
87+ # ' @param x sorted numeric vector of dot positions
88+ # ' @param y sorted numeric vector of dot heights, same length as x
89+ # ' @returns modified `y`
90+ # ' @noRd
91+ recenter_swarm_clusters_ <- function (x , y , binwidth ) {
92+ .Call(`_ggdist_recenter_swarm_clusters_` , x , y , binwidth )
93+ }
94+
0 commit comments