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] New page presenting the apiRef #5273

Merged
merged 20 commits into from
Jul 19, 2022

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Jun 21, 2022

Part of #1826 (12)
Fixes #5269

Doc preview: https://deploy-preview-5273--material-ui-x.netlify.app/x/react-data-grid/api-object/

  • Group the advanced pages in a doc folder (maybe other could go there too, I'd like to create a Typescript page in the future)
  • Create a new "API object" doc page presenting how to access the apiRef and linking to the basic examples

We could probably use this new page to link to other basic use cases.
For instance a section Accessing the row model inside one of the row pages and linked here would make a lot of sense.

@flaviendelangle flaviendelangle added docs Improvements or additions to the documentation component: data grid This is the name of the generic UI component, not the React module! labels Jun 21, 2022
@flaviendelangle flaviendelangle self-assigned this Jun 21, 2022

## What is the API object ?

The API object is an interface containing the state and all the methods needed to interact imperatively with the grid.
Copy link
Member Author

Choose a reason for hiding this comment

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

This section is probably a little succinct for now

@mui-bot
Copy link

mui-bot commented Jun 21, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 272.9 563.3 437 422.98 127.087
Sort 100k rows ms 470.4 948.9 909.7 804.42 182.183
Select 100k rows ms 199.1 307.3 270.3 261.2 40.197
Deselect 100k rows ms 139.2 363.7 228.1 237.6 74.514

Generated by 🚫 dangerJS against 4947a6c

@flaviendelangle flaviendelangle changed the title [docs] New page presenting the apiRef [docs] New page presenting the apiRef Jun 23, 2022
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved

You can find a detailed example in the [State page](/x/react-data-grid/state/#access-the-state).

### Listen to grid events
Copy link
Member

Choose a reason for hiding this comment

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

Another suggestion is #5109

Copy link
Member Author

Choose a reason for hiding this comment

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

What would you like to document exactly here ?

Copy link
Member

Choose a reason for hiding this comment

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

It could be an example of how to save the state before unmounting the grid. Using the cleanup of useEffect doesn't work in this case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would you agree to add a section on the State page in a follow up PR and link it here ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes.

Copy link
Member

@joserodolfofreitas joserodolfofreitas left a comment

Choose a reason for hiding this comment

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

A few suggestions and thoughts:

docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
You can find the list of all the available API methods on the [GridApi page](/x/api/data-grid/grid-api/).

:::warning
All the methods prefixed by `unstable_` are private.
Copy link
Member

Choose a reason for hiding this comment

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

I thought unstable_ was used more in the direction of an alpha version of an API method.
Would it make sense to consider private_ in these cases?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right now it's the same prefix
And right now no unstable_ is documented in a markdown file, even if theoretically we could indeed be used for features in alpha phase.

I suggest we leave it as is (with rewording if you want).
And we discuss if it's worth splitting in two prefixes in another PR.

docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
flaviendelangle and others added 8 commits July 4, 2022 08:46
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
Co-authored-by: José Rodolfo Freitas <joserodolfo.freitas@gmail.com>
Co-authored-by: José Rodolfo Freitas <joserodolfo.freitas@gmail.com>
Co-authored-by: Matheus Wichman <matheushw@outlook.com>
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
flaviendelangle and others added 5 commits July 12, 2022 17:02
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Co-authored-by: Sam Sycamore <71297412+samuelsycamore@users.noreply.github.com>
Copy link
Member

@m4theushw m4theushw left a comment

Choose a reason for hiding this comment

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

Looks good!

docs/data/data-grid/api-object/api-object.md Outdated Show resolved Hide resolved
@flaviendelangle flaviendelangle merged commit f260e44 into mui:master Jul 19, 2022
@flaviendelangle flaviendelangle deleted the api-doc branch July 19, 2022 15:15
alexfauquette pushed a commit to alexfauquette/mui-x that referenced this pull request Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] How to instanciate the api object
6 participants