GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — Update quiver trace API by emilykl · Pull Request #7945 · plotly/plotly.js Conversation
|
| // TODO: How to handle the case where there is just one point in a trace, | ||
| // or all points have the same x or y value? This will give a boxArea of 0. | ||
| // For now I'm going to just normalize to a vector of unit length (1) in that case, | ||
| // but that's not a great solution |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can this comment be addressed?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Addressed by 1315d07. I updated the point distance calculation to be more accurate, and as a bonus now it covers the case where all the points are in a horizontal or vertical line.
There's nothing we can do about the case where all points have the same x or y value; I think it's reasonable to just default to 1 in that case.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Cameron DeCoster <[email protected]>
b46f29c to
1507db6
Compare
… case where all points are in a horizontal or vertical line
1507db6 to
1315d07
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
arrowref is also a good choice.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| * D = (dX + dY + sqrt((dX - dY)^2 + 4N * dX * dY)) / (2 * (N - 1)) | ||
| * which is the forumla we'll use below. | ||
| * | ||
| * Note: this formula was derived and documented by a human ;) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
👏
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Glad you're OK with it. It occurred to me that in the future we may want to add the option to specify vectors by angle and magnitude, rather than |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Update quiver trace API for clarity and consistency
There was an error while loading. Please reload this page.