-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Split and reuse functions reside inside index files of scattergl scatterpolargl and splom traces #3967
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
Conversation
src/traces/scattergl/style.js
Outdated
|
||
var DESELECTDIM = require('../../constants/interactions').DESELECTDIM; | ||
|
||
function styleTextSelection(cd) { |
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.
Hmm, yeah this one isn't ideal. It is under a style.js
, but it's not really a _module.style
method. Ok if we move this thing to ./helpers.js
instead?
src/traces/splom/style.js
Outdated
var calcColorscale = require('../scatter/colorscale_calc'); | ||
var convertMarkerStyle = require('../scattergl/convert').markerStyle; | ||
|
||
function editStyle(gd, cd0) { |
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.
Same here, I'm not sure this belongs in a style.js
file. I'd be ok we either:
- moving this logic to
splom/index.js
- renaming this file to
edit_style.js
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.
Done in e27ea9c.
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.
Ooops I made review by accident.
src/traces/scattergl/index.js
Outdated
sceneUpdate: sceneUpdate, | ||
calcHover: calcHover, | ||
sceneUpdate: require('./scene_update'), | ||
calcHover: hover.calcHover, |
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.
No need to export these off ScatterGl
anymore (I think).
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.
Good point!
Done in bb12f68.
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.
Ooops I made review by accident.
Thanks for doing this @archmoj !! I like the way you split the cross-trace plot logic into an |
Nicely done @archmoj !! 💃 |
Currently the
index
files of all traces exceptscattergl
,scatterpolargl
&splom
are compact and only declare different functionalities of the trace.Having similar pattern in
scattegl
and other two can help improve the readability & requiring of different parts (e.g. when requiring parts ofscattergl
inscatterpolargl
).In this PR the functions inside the
index
files of the three are separated and moved tocalc
,plot
,select
,hover
,helpers
andupdate_scene
files.@plotly/plotly_js