Skip to content
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

Update sankey-diagram.md #2291

Merged
merged 3 commits into from
Mar 27, 2020
Merged

Update sankey-diagram.md #2291

merged 3 commits into from
Mar 27, 2020

Conversation

SylwiaOliwia2
Copy link
Contributor

@SylwiaOliwia2 SylwiaOliwia2 commented Mar 19, 2020

Add colorful links to the Sankey diagram.
#1965

Please uncomment this block and take a look at this checklist if your PR is making substantial changes to documentation/impacts files in the doc directory. Check all that apply to your PR, and leave the rest unchecked to discuss with your reviewer! Not all boxes must be checked for every PR :)

  • I've seen the doc/README.md file
  • This change runs in the current version of Plotly on PyPI and targets the doc-prod branch OR it targets the master branch
  • If this PR modifies the first example in a page or adds a new one, it is a px example if at all possible
  • Every new/modified example has a descriptive title and motivating sentence or paragraph
  • Every new/modified example is independently runnable
  • Every new/modified example is optimized for short line count and focuses on the Plotly/visualization-related aspects of the example rather than the computation required to produce the data being visualized
  • Meaningful/relatable datasets are used for all new examples instead of randomly-generated data where possible
  • The random seed is set if using randomly-generated data in new/modified examples
  • New/modified remote datasets are loaded from https://plotly.github.io/datasets and added to https://github.com/plotly/datasets
  • Large computations are avoided in the new/modified examples in favour of loading remote datasets that represent the output of such computations
  • Imports are plotly.graph_objects as go / plotly.express as px / plotly.io as pio
  • Data frames are always called df
  • fig = <something> call is high up in each new/modified example (either px.<something> or make_subplots or go.Figure)
  • Liberal use is made of fig.add_* and fig.update_* rather than go.Figure(data=..., layout=...) in every new/modified example
  • Specific adders and updaters like fig.add_shape and fig.update_xaxes are used instead of big fig.update_layout calls in every new/modified example
  • fig.show() is at the end of each new/modified example
  • plotly.plot() and plotly.iplot() are not used in any new/modified example
  • Hex codes for colors are not used in any new/modified example in favour of these nice ones

@emmanuelle
Copy link
Contributor

This is a very nice example, thank you so much @SylwiaOliwia2 ! Could you please add a few explanations:

  • change the title to "More complex Sankey diagram with colored links" (titles appear in the sidebar and are indexed by search engines)
  • add a comment within the example to explain why you replace magenta (for the opacity)

I also left an inline suggestion.

@emmanuelle
Copy link
Contributor

Thank you very much @SylwiaOliwia2 ! Can you also change the title? If you can't do it now, I think I'll merge this afternoon and we can change the title later, since a question on the user forum would benefit from your example :-) 🎉 (https://community.plotly.com/t/how-to-set-the-color-of-sankey-diagram-lines/36766 - what a timing!)

@SylwiaOliwia2
Copy link
Contributor Author

On my way to do it @emmanuelle. Just try to update the branch to pass all the tests. Even if it's not necessary, I want to improve my skills. I guess in the evening it will be ready to merge along with the changed title :)

SylwiaOliwia2 and others added 3 commits March 27, 2020 16:54
Add colorful links to the Sankey diagram.
More complex Sankey diagram with colored links - setting the link color in one line, add the comment why 'magenta' is changed to its rgba value.

Co-Authored-By: Emmanuelle Gouillart <emma@plot.ly>
@SylwiaOliwia2
Copy link
Contributor Author

I've changed the title. The test ci/circleci: python-2.7-plot_ly still fails. If it's not a problem, you can merge.

@emmanuelle
Copy link
Contributor

thanks @SylwiaOliwia2 I'm merging. You would need to merge master (after pulling) to get the commit which fixes the python-2.7 build but it's ok, it is already in master so no problem for merging here. Thanks again!

@emmanuelle emmanuelle merged commit bd9d849 into plotly:doc-prod Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants