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

Docs updates for Plotly.py version 6 #4840

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open

Conversation

LiamConnors
Copy link
Member

@LiamConnors LiamConnors commented Oct 28, 2024

  • Migration guide from v5 to v6
  • Add new performance page with info on
  • Add new dataframe support information
  • Remove pages for removed features

@gvwilson gvwilson added feature something new P1 needed for current cycle documentation written for humans labels Oct 31, 2024

* Accelerated versions of SVG trace types: `scattergl`, `scatterpolargl`,
* High-performance multidimensional trace types: `splom`, or `parcoords`
* 3-d trace types `scatter3d`, `surface`, `mesh3d`, `cone`, `streamtube`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm more used to seeing 3D rather than 3-d (but if we use 3-d elsewhere in the docs we should keep it for consistency)

Copy link
Member Author

@LiamConnors LiamConnors Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree 3D is better. This is mostly existing content that has been moved to this page. We seem to have a mix, but 3D is used more, so I'll update it.

doc/python/performance.md Outdated Show resolved Hide resolved
doc/python/px-arguments.md Outdated Show resolved Hide resolved

### Supported Dataframes

`px` functions natively support pandas, Polars, and PyArrow dataframes. `px` uses [Narwhals](https://narwhals-dev.github.io/narwhals/) to provide this native dataframe support. Other types of dataframes that are currently supported by Narwhals, for example cuDF and Modin, may also work with `px`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Need to make sure we are consistent with messaging about whether Modin is supported (it's included in the list of supported DataFrame types in doc/python/performance.md)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I'd changed it in one but not the other. Thanks!


#### Additional Dependencies Required

- To use Polars, PyArrow, or other dataframes supported natively with Plotly Express, you'll need to have NumPy installed. You can install it with: `pip install numpy`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little misleading, since NumPy is required for Pandas dataframes as well, it's just that NumPy is a dependency of Pandas so it's likely to be already installed if you're instantiating a Pandas dataframe.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a fair point. Updated

doc/python/px-arguments.md Outdated Show resolved Hide resolved
@LiamConnors
Copy link
Member Author

@marthacryan could you take a look at the typed arrays info and let me know if it looks good to you


Here's an example using `layout.titlefont`:

```python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LiamConnors I don't love the idea of including code in the docs which specifically won't work.

What if you combine the two code snippets into one, and include the old layout definition as commented-out code, followed by the new layout definition?

Also, maybe it would be clearer to define the layout using a dict(title=dict(...)) rather than go.Layout() since the former is much more common in my experience — I'm not sure I've ever seen anyone use go.Layout().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's a fair point. The complete example probably isn't needed anyway. Reworked to add just a comment with the old method and to use dict rather than go.Layout

@emilykl
Copy link
Contributor

emilykl commented Nov 16, 2024

@LiamConnors I've been through the whole set of changes -- looks good!

Some high-level comments:

  • Consistency about what dataframes are supported (already discussed, but I wonder if there's a way to avoid having to update the docs in multiple places if/when we add additional supported dataframes -- is it possible to link to a single source of truth for every one of those mentions?
  • Usage of "DataFrame" vs. "dataframe" — It seems to me like the docs are mostly consistent about using "dataframe" when referring to the general concept of a dataframe, and "DataFrame" specifically when referring to the specific Python DataFrame objects, but there are a few cases that feel borderline to me so maybe worth a look over. (Can point out specific cases if helpful.)

@LiamConnors
Copy link
Member Author

Consistency about what dataframes are supported (already discussed, but I wonder if there's a way to avoid having to update the docs in multiple places if/when we add additional supported dataframes -- is it possible to link to a single source of truth for every one of those mentions?

That's a great point. I think the px-arguments page can be the source of truth. So I've update the performance page to link that for full details on supported dataframe libraries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation written for humans feature something new P1 needed for current cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants