Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide better tooltip offset in relation to points. #2045

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Prefer const over let if not mutating
  • Loading branch information
brochington committed Dec 12, 2022
commit d01e298c959ded0ea128fbc374e449d12435807e
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ export function pointSeriesCanvas(
// `size(d.size)` is area (A) of circle.
// A = pi * r^2
// r = sqrt(A / pi)
let r = Math.sqrt((scale_factor * size(d.size)) / Math.PI);
const r = Math.sqrt((scale_factor * size(d.size)) / Math.PI);

// Determine point on circle at 45 degrees using Pythagorean theorem.
let c = Math.sqrt(2 * r * r) / 2;
const c = Math.sqrt(2 * r * r) / 2;

// Add padding to offset.
const padding = PADDING_FACTOR / c;
Expand Down