-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Transform react #2577
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
Transform react #2577
Changes from 1 commit
bbe3533
ed24765
fcc459d
7044a13
88b7b43
cf4c9c3
e84d4b9
b436d52
2a41f9e
965bcfb
6fae229
79295f1
5e9aa65
690eb95
a244cec
92bd5d2
dc6de2f
03956e1
f439e41
e47e6a9
aa30ad6
4c70826
7279b55
3e250df
cd08479
0414147
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,7 @@ function heatmappishCalc(gd, trace) { | |
z: z, | ||
}; | ||
|
||
if(trace.contours.type === 'levels') { | ||
if(trace.contours.type === 'levels' && trace.contours.coloring !== 'none') { | ||
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. Did omitting 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. possibly for the editor - |
||
// auto-z and autocolorscale if applicable | ||
colorscaleCalc(trace, z, '', 'z'); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,7 +161,8 @@ function transformOne(trace, state) { | |
var groupNameObj; | ||
|
||
var opts = state.transform; | ||
var groups = trace.transforms[state.transformIndex].groups; | ||
var transformIndex = state.transformIndex; | ||
var groups = trace.transforms[transformIndex].groups; | ||
var originalPointsAccessor = pointsAccessorFunction(trace.transforms, opts); | ||
|
||
if(!(Array.isArray(groups)) || groups.length === 0) { | ||
|
@@ -196,7 +197,10 @@ function transformOne(trace, state) { | |
// Start with a deep extend that just copies array references. | ||
newTrace = newData[i] = Lib.extendDeepNoArrays({}, trace); | ||
newTrace._group = groupName; | ||
newTrace.transforms[state.transformIndex]._indexToPoints = {}; | ||
// helper function for when we need to push updates back to the input, | ||
// outside of the normal restyle/relayout pathway, like filling in auto values | ||
newTrace.updateStyle = styleUpdater(groupName, transformIndex); | ||
newTrace.transforms[transformIndex]._indexToPoints = {}; | ||
|
||
var suppliedName = null; | ||
if(groupNameObj) { | ||
|
@@ -254,7 +258,7 @@ function transformOne(trace, state) { | |
for(j = 0; j < len; j++) { | ||
newTrace = newData[indexLookup[groups[j]]]; | ||
|
||
var indexToPoints = newTrace.transforms[state.transformIndex]._indexToPoints; | ||
var indexToPoints = newTrace.transforms[transformIndex]._indexToPoints; | ||
indexToPoints[indexCnts[groups[j]]] = originalPointsAccessor(j); | ||
indexCnts[groups[j]]++; | ||
} | ||
|
@@ -272,3 +276,14 @@ function transformOne(trace, state) { | |
|
||
return newData; | ||
} | ||
|
||
function styleUpdater(groupName, transformIndex) { | ||
return function(trace, attr, value) { | ||
Lib.keyedContainer( | ||
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. Ricky's dream lives on 🌈 |
||
trace, | ||
'transforms[' + transformIndex + '].styles', | ||
'target', | ||
'value.' + attr | ||
).set(String(groupName), value); | ||
}; | ||
} |
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.
thanks for 📚