-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Gantt chart to scatterplots #1665
Conversation
Gantt chart now uses scatter plots: - updating all the functions accordingly - unit tests updated - new param: show_hover_fill for hiding the text for the filled area
Hi @csabaszan, this sounds like a great update. Thanks for taking it on. Don't worry about the |
Yeah, first ever pull request... but I'm on it! Thanks for the feedback |
Thanks for the PR! Can you tell us a bit more about the motivation for this change? I'd love some more insight into what is causing a problem with the existing figure factory that can't be solved by remaining within the |
Sorry, I just looked into it a bit more and the current implementation isn't using |
@nicolaskruchten I was trying to toogle the traces and when they failed I found #1371 where @jonmmease mentioned that fill "toself" could be a way to go. Now except for the *-plot_ly tests the tests are successful |
Hi @csabaszan, Now that we merged the Basically, all of the files you modified have moved under the If you run into trouble doing this as a merge resolution with git, feel free to start over and create a new pull request. Thanks! |
Having looked at this a bit more closely, I would actually recommend using |
* only set plotlyServerURL using the plotly_domain in the .config file if one isn't specified in the config dict passed to iplot/plot * make it clear that the default in clean_config.get is None
* scraper function for sphinx-gallery, in plotly.io. scraper function + skeleton of sphinx doc with minimal gallery (two examples) * added psutil dep to tox.ini * python 2 compatibility * added orca dep to package.json for tests * removed typo * corrected bug * python 2 compatibility * added electron * try to configure orca * Moved test file so that it's tested by the orca build only. * use custom renderer for sphinx-gallery * removed sphinx files which are now in plotly-sphinx-gallery + changed name of renderer sphinx -> sphinx-gallery, and changed wording of documentation * Modified test with new renderer name * try to fix py2 compatibility * write_html instead of offline.plot * change import order
Gantt chart now uses scatter plots: - updating all the functions accordingly - unit tests updated - new param: show_hover_fill for hiding the text for the filled area
# Conflicts: # packages/python/plotly/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py # packages/python/plotly/tox.ini
# Conflicts: # packages/python/plotly/plotly/figure_factory/_gantt.py # packages/python/plotly/plotly/tests/test_optional/test_figure_factory/test_figure_factory.py # packages/python/plotly/plotly/tests/test_optional/test_tools/test_figure_factory.py
I honestly don't remember if there was a good reason why I mentioned scatter+fill in #1371 rather than @csabaszan, do you see any reason to use scatter+fill rather than bar? For the |
@jonmmease I've just looked into bar and yes, I think with horizontal mode and using the base it can be done. I'll try do the switch and update the PR. |
btw what would be the best way to handle timedelta in the x-axis? I can set the type of the axis to date, but I don't know what should x take as an input. I was trying to use it with seconds and milliseconds but it was somewhat strange, because 23-hours is displayed as 1 day. The code below produces the plot in the image. Resource 2 is shown to be occupied for 1 day, but according to the data it is only 23 hours
What really interesting, though, is that if I set x to 0 then a 1-hour long bar is displayed, so could it be that somehow this 1 hour offset is always there? |
Hi @csabaszan, Yeah, that's interesting. It looks like there might be something timezone related creeping in when specifying the In any case, plotly.js doesn't have a timedelta axis type, and I don't think it will be possible to use the |
Hi @jonmmease, Do you think there is some workaround to use bar for Gantt charts? Displaying the length of the period in a readable format is pretty important for a Gantt, imo. |
Hi @csabaszan, Since the current API is to specify the start and end of each "bar" as a date, it might be better to stick with your current scatter+fill approach. Maybe this is what I was thinking when I brought up @nicolaskruchten, do you any thoughts on what might be going on with the bar lengths above? |
Thanks @csabaszan, this looks great! It's really nice to have the legend control. In addition to the inline comments, there's one other change that would be nice to have. Right now, when you click the legend to hide the bars, the hover points are still visible as small dots. I made some inline comments about making these invisible by setting thanks again! |
If you put multiple traces in the same legend group, it’s nice to have all but one per group not appear in the legend, that way it looks like just a single legend entry |
legendgroups for markers marker opacity is 0
Thanks for the last round of updates @csabaszan. Looks good to me! |
Gantt chart now uses scatter plots:
I updated the Gantt chart to use scatter plots with "toself" fills to draw the recantgles, instead of shapes. This allows hiding and isolating traces.
I tested on all the examples and the results were visually the same as with the shapes.