-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
remove plotly/colors.py in favour of utils #1279
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
…n_colors to utils
…rect all PLOTLY_SCALES = {
…unction to utils from colors.py
…to colors.py function over to utils function
ready for a review @jonmmease |
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 working on this cleanup @Kully, I'll look it over in more detail soon.
In the meantime, I'm a little worried about deleting plotly/colors.py
in case people have found it and are relying on functions in there. Can you add a plotly/colors.py
file back in that just imports all of the public functions/variables from their new locations?
Sure! |
The issue I'm running into is that I haven't found a way to slickly import only the Any suggestions on how to proceed? Perhaps a 1-liner of python code in |
@Kully, I see what you mean about the numpy dependency. Let's leave the plotly/colors.py where it is then for now. Also, I don't see any fundamental reason why we wouldn't use these functions from the core (non figure factory) code at some point. If we leave colors.py where it is, are there other things from the PR that you want to keep? |
By this I understand you mean to leave functions defined directly from plotly/colors.py rather than importing from figure_factory
I agree with this too.
There are duplicate functions in here that I removed a few commits above. I think we should for sure keep the duplicate functions removed. |
… done on PR is removing duplicate functions and putting appropriate functions in a suitable module (colors.py or uitls.py) and changing variable method calls to the correct functions
closing in favor of #1301 |
Since
figure_factory
is 100% of the code that is usingcolors.py
, it makes more sense to move thecolors.py
that are not inplotly.figure_factory/utils.py
in there.In favour of PR: #878
TODOs for this PR:
utils.py
functionsFor another PR:
_scatter
,_gantt
,_bullet
(and maybe others) use the plotly color scales. Right now, the modules are built such that if a user inputsViridis
for instance, the color functions will return just a list of the colors found in the Viridis colorscale, but without the appropriate colorscale numbers to indicate how the interpolation works between each color (i.e. these modules linearly interpolate between the colors of the Plotly colorscales)