Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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
Show file tree
Hide file tree
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
rename option to raw
  • Loading branch information
archmoj committed Mar 28, 2024
commit df7ad4517c229907e1254e3b314f27654f2d73f4
2 changes: 2 additions & 0 deletions 2 draftlogs/6938_add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add "raw" sizemode to cone trace [[#6938](https://github.com/plotly/plotly.js/pull/6938)]

8 changes: 4 additions & 4 deletions 8 src/traces/cone/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ var attrs = {

sizemode: {
valType: 'enumerated',
values: ['scaled', 'absolute', 'vector'],
values: ['scaled', 'absolute', 'raw'],
editType: 'calc',
dflt: 'scaled',
description: [
'Determines whether `sizeref` is set as a *scaled* (i.e unitless) scalar',
'(normalized by the max u/v/w norm in the vector field) or as',
'*absolute* value (in the same units as the vector field).',
'To display sizes in actual vector scale use *vector*.'
'To display sizes in actual vector length use *raw*.'
].join(' ')
},
sizeref: {
Expand All @@ -116,8 +116,8 @@ var attrs = {
'This factor (computed internally) corresponds to the minimum "time" to travel across',
'two successive x/y/z positions at the average velocity of those two successive positions.',
'All cones in a given trace use the same factor.',
'With `sizemode` set to *vector*, its default value is *1*',
'With `sizemode` set to *scaled*, `sizeref` is unitless, its default value is *0.5*',
'With `sizemode` set to *raw*, its default value is *1*.',
'With `sizemode` set to *scaled*, `sizeref` is unitless, its default value is *0.5*.',
'With `sizemode` set to *absolute*, `sizeref` has the same units as the u/v/w vector field,',
'its the default value is half the sample\'s maximum vector norm.'
].join(' ')
Expand Down
2 changes: 1 addition & 1 deletion 2 src/traces/cone/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function convert(scene, trace) {
coneOpts.coneSize = trace.sizeref && trace._normMax ?
trace.sizeref / trace._normMax :
0.5;
} else if(sizemode === 'vector') {
} else if(sizemode === 'raw') {
coneOpts.coneSize = trace.sizeref;
}
coneOpts.coneSizemode = sizemode;
Expand Down
2 changes: 1 addition & 1 deletion 2 src/traces/cone/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
}

var sizemode = coerce('sizemode');
coerce('sizeref', sizemode === 'vector' ? 1 : 0.5);
coerce('sizeref', sizemode === 'raw' ? 1 : 0.5);

coerce('anchor');

Expand Down
2 changes: 1 addition & 1 deletion 2 stackgl_modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13782,7 +13782,7 @@ module.exports = function(vectorfield, bounds) {
var positionVectors = [];
var vectorScale = Infinity;
var skipIt = false;
var vectorSizemode = vectorfield.coneSizemode === 'vector';
var vectorSizemode = vectorfield.coneSizemode === 'raw';
for (var i = 0; i < positions.length; i++) {
var p = positions[i];
minX = Math.min(p[0], minX);
Expand Down
12 changes: 6 additions & 6 deletions 12 stackgl_modules/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 2 stackgl_modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"box-intersect": "plotly/box-intersect#v1.1.0",
"convex-hull": "^1.0.3",
"delaunay-triangulate": "^1.1.6",
"gl-cone3d": "github:gl-vis/gl-cone3d#9cf07db8d3526dbe85e9fa671857416cc3ed63e2",
"gl-cone3d": "github:gl-vis/gl-cone3d#846764e2c95157fcfcf1ef264401c3cf665faaaa",
archmoj marked this conversation as resolved.
Show resolved Hide resolved
"gl-error3d": "^1.0.16",
"gl-heatmap2d": "^1.1.1",
"gl-line3d": "1.2.1",
Expand Down
Binary file modified BIN -423 Bytes (99%) test/image/baselines/zz-gl3d_cone-sizemode_vector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified BIN -481 Bytes (99%) test/image/baselines/zz-gl3d_cone-sizemode_vector2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions 8 test/image/mocks/zz-gl3d_cone-sizemode_vector.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"u": [1, 0, 0],
"v": [0, 3, 0],
"w": [0, 0, 2],
"sizemode": "vector",
"sizemode": "raw",
"anchor": "tip",
"colorbar": {
"title": { "text": "vector<br>sizeref: 1" },
"title": { "text": "raw<br>sizeref: 1" },
"x": 0,
"xanchor": "right"
}
Expand All @@ -24,10 +24,10 @@
"u": [0.5, 0, 0],
"v": [0, 1.5, 0],
"w": [0, 0, 1],
"sizemode": "vector",
"sizemode": "raw",
"anchor": "tip",
"colorbar": {
"title": { "text": "vector<br>sizeref: 1" }
"title": { "text": "rawr<br>sizeref: 1" }
},
"scene": "scene2"
}
Expand Down
8 changes: 4 additions & 4 deletions 8 test/image/mocks/zz-gl3d_cone-sizemode_vector2.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"u": [1, 0, 0],
"v": [0, 3, 0],
"w": [0, 0, 2],
"sizemode": "vector",
"sizemode": "raw",
"anchor": "tip",
"sizeref": 0.5,
"colorbar": {
"title": { "text": "vector<br>sizeref: 2" },
"title": { "text": "raw<br>sizeref: 2" },
"x": 0,
"xanchor": "right"
}
Expand All @@ -25,11 +25,11 @@
"u": [0.5, 0, 0],
"v": [0, 1.5, 0],
"w": [0, 0, 1],
"sizemode": "vector",
"sizemode": "raw",
"anchor": "tip",
"sizeref": 2,
"colorbar": {
"title": { "text": "vector<br>sizeref: 2" }
"title": { "text": "raw<br>sizeref: 2" }
},
"scene": "scene2"
}
Expand Down
2 changes: 1 addition & 1 deletion 2 test/image/mocks/zz-gl3d_cone-sizemode_vector3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"data": [
{
"type": "cone",
"sizemode": "vector",
"sizemode": "raw",
"anchor": "tip",
"u": [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Expand Down
6 changes: 3 additions & 3 deletions 6 test/plot-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22456,18 +22456,18 @@
"valType": "boolean"
},
"sizemode": {
"description": "Determines whether `sizeref` is set as a *scaled* (i.e unitless) scalar (normalized by the max u/v/w norm in the vector field) or as *absolute* value (in the same units as the vector field). To display sizes in actual vector scale use *vector*.",
"description": "Determines whether `sizeref` is set as a *scaled* (i.e unitless) scalar (normalized by the max u/v/w norm in the vector field) or as *absolute* value (in the same units as the vector field). To display sizes in actual vector length use *raw*.",
"dflt": "scaled",
"editType": "calc",
"valType": "enumerated",
"values": [
"scaled",
"absolute",
"vector"
"raw"
]
},
"sizeref": {
"description": "Adjusts the cone size scaling. The size of the cones is determined by their u/v/w norm multiplied a factor and `sizeref`. This factor (computed internally) corresponds to the minimum \"time\" to travel across two successive x/y/z positions at the average velocity of those two successive positions. All cones in a given trace use the same factor. With `sizemode` set to *vector*, its default value is *1* With `sizemode` set to *scaled*, `sizeref` is unitless, its default value is *0.5* With `sizemode` set to *absolute*, `sizeref` has the same units as the u/v/w vector field, its the default value is half the sample's maximum vector norm.",
"description": "Adjusts the cone size scaling. The size of the cones is determined by their u/v/w norm multiplied a factor and `sizeref`. This factor (computed internally) corresponds to the minimum \"time\" to travel across two successive x/y/z positions at the average velocity of those two successive positions. All cones in a given trace use the same factor. With `sizemode` set to *raw*, its default value is *1*. With `sizemode` set to *scaled*, `sizeref` is unitless, its default value is *0.5*. With `sizemode` set to *absolute*, `sizeref` has the same units as the u/v/w vector field, its the default value is half the sample's maximum vector norm.",
"editType": "calc",
"min": 0,
"valType": "number"
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.