8000 Add "raw" `sizemode` to cone trace by archmoj · Pull Request #6938 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Add "raw" sizemode to cone trace #6938

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

Merged
merged 9 commits into from
Mar 28, 2024
Merged
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
Next Next commit
update stackgl-bundle
  • Loading branch information
archmoj committed Mar 20, 2024
commit e5be742fee37baf63749e8b26cffc9b1cf7137ee
7 changes: 5 additions & 2 deletions stackgl_modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13782,6 +13782,7 @@ module.exports = function(vectorfield, bounds) {
var positionVectors = [];
var vectorScale = Infinity;
var skipIt = false;
var vectorSizemode = vectorfield.coneSizemode === 'vector';
for (var i = 0; i < positions.length; i++) {
var p = positions[i];
minX = Math.min(p[0], minX);
Expand All @@ -13795,7 +13796,7 @@ module.exports = function(vectorfield, bounds) {
if (vec3.length(u) > maxNorm) {
maxNorm = vec3.length(u);
}
if (i) {
if (i && !vectorSizemode) {
// Find vector scale [w/ units of time] using "successive" positions
// (not "adjacent" with would be O(n^2)),
//
Expand Down Expand Up @@ -13834,7 +13835,9 @@ module.exports = function(vectorfield, bounds) {
}
geo.vectorScale = vectorScale;

var coneScale = vectorfield.coneSize || 0.5;
var coneScale = vectorfield.coneSize || (
vectorSizemode ? 1 :0.5
);

if (vectorfield.absoluteConeSize) {
coneScale = vectorfield.absoluteConeSize * invertedMaxNorm;
Expand Down
0