You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Examples: panels C, D, and E. The plotting is basically a scatter plot with a categorical X axis, but the dots need to "spread" on the X axis when they become clustered. Unknown: what is the algorithm for determining that spread?
The text was updated successfully, but these errors were encountered:
Not sure yet how to implement the off-axis displacement, but terms for search engines include "beeswarm plot" and "jitter". One possible implementation is: https://observablehq.com/@d3/beeswarm
Add two ChartStyle properties: jitterRadius and jitterMaxSpread.
A bin starts when two points are less than one jitter diameter apart
All of the points until the next point that is at least one jitter diameter apart are placed in the bin
The first point in the bin is the anchor: the next point is moved along the off-axis in the positive direction until it is a jitter diameter away
The second point is moved left along the off-axis in the negative direction until it is one jitter diameter away from the anchor
The third point is moved along the off-axis in the positive direction until it is one jitter diameter from the first point
continue moving even indexed points in the negative direction and odd indexed points in the positive direction
If any offset exceeds the jitterMaxSpread / 2, stop working on this bin. The next point begins a new bin. (Similarly if a point is more than 1 diameter away on the main axis, begin a new bin).
After all the offsets for a bin have been calculated, adjust the whole bin so that the total offset is 0. (In other words, if there are an even number of points, the anchor is moved left so the whole "weight" of the bin is even over the center line).
Possibly bins should alternate starting to the right and starting to the left.
Examples: panels C, D, and E. The plotting is basically a scatter plot with a categorical X axis, but the dots need to "spread" on the X axis when they become clustered. Unknown: what is the algorithm for determining that spread?
The text was updated successfully, but these errors were encountered: