-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix color clustering #2377
Fix color clustering #2377
Changes from all commits
5de6918
ce01ea7
20559c0
7c944c9
4fada56
87b22b2
64f112f
f2e80a7
1154589
d604a76
9532210
7cb3295
ba40db9
20c3a00
eae6da2
f8b4e52
48e1124
0e746bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -779,9 +779,9 @@ function plot(container, subplot, cdata) { | |
} | ||
// fill requires linked traces, so we generate it's positions here | ||
if(scene.fill2d) { | ||
scene.fillOptions.forEach(function(fillOptions, i) { | ||
scene.fillOptions = scene.fillOptions.map(function(fillOptions, i) { | ||
var cdscatter = cdata[i]; | ||
if(!fillOptions || !cdscatter || !cdscatter[0] || !cdscatter[0].trace) return; | ||
if(!fillOptions || !cdscatter || !cdscatter[0] || !cdscatter[0].trace) return null; | ||
var cd = cdscatter[0]; | ||
var trace = cd.trace; | ||
var stash = cd.t; | ||
|
@@ -861,6 +861,8 @@ function plot(container, subplot, cdata) { | |
|
||
fillOptions.opacity = trace.opacity; | ||
fillOptions.positions = pos; | ||
|
||
return fillOptions; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you briefly explain why this fixes #2376 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That fixes #2354. That is internal |
||
}); | ||
|
||
scene.fill2d.update(scene.fillOptions); | ||
|
@@ -945,7 +947,7 @@ function plot(container, subplot, cdata) { | |
scene.select2d = createScatter(layout._glcanvas.data()[1].regl, {clone: scene.scatter2d}); | ||
} | ||
|
||
if(scene.scatter2d) { | ||
if(scene.scatter2d && scene.selectBatch && scene.selectBatch.length) { | ||
// update only traces with selection | ||
scene.scatter2d.update(scene.unselectedOptions.map(function(opts, i) { | ||
return scene.selectBatch[i] ? opts : null; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"data": [{ | ||
"type": "scattergl", | ||
"mode": "lines", | ||
"x": [1, 2, 3], | ||
"y": [1, 2, 1] | ||
}], | ||
"layout": { | ||
"dragmode": "select", | ||
"showlegend": false, | ||
"width": 400, | ||
"height": 400 | ||
} | ||
} |
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea - I bet we'll find other places this should be used too.