Skip to content

adjustments for dash 3 support #353

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

Merged
merged 11 commits into from
Feb 7, 2025
Merged

adjustments for dash 3 support #353

merged 11 commits into from
Feb 7, 2025

Conversation

BSd3v
Copy link
Collaborator

@BSd3v BSd3v commented Feb 3, 2025

No description provided.

@gvwilson gvwilson requested a review from T4rk1n February 3, 2025 16:03
@gvwilson gvwilson added feature something new P1 needed for current cycle labels Feb 3, 2025
@BSd3v
Copy link
Collaborator Author

BSd3v commented Feb 3, 2025

This is ran as dash 3, and passing:

https://github.com/plotly/dash-ag-grid/actions/runs/13117864371/job/36596481157

I'm going to revert the pinning of the dash 3 rc.

@AnnMarieW
Copy link
Collaborator

You can't get use loading_state in dash 3. Need to use

static contextType = window.dash_component_api.DashContext;

async loading() {
    while (this.context.isLoading()) {
        await wait(100);
    }
}

@BSd3v
Copy link
Collaborator Author

BSd3v commented Feb 5, 2025

The loading isnt for supporting dash 3, its for support dash 2. As the alterations to dash 3 decreased the number of times the component is rerendered.

Also, this is a test to see if loading exists, and if so test it, if not, do nothing.

You can see an example here:

plotly/dash#3066 (comment)


Essentially, there is no equivalent to the Previous Loading state as everything in Dash 3 is for the current state. However, because Dash is no longer passing this data back to the component (forcing a rerender) there is no reason to check the previous state.

This was mainly to combat things like selectedRows and columnState coming from the Dash server being overwritten by the grid component.

Dash 2:

  • callback triggered to update selectedRows or columnState
  • dash adjusts the state of loading_state to trigger the props.
  • When it hits this check, the previous state of loading_state was not loading, therefore it passes over this section and doesnt try to perform anything with the props. Freezing the component in time until the callback is completely done loading
  • the loading_state gets flipped again
  • now props that were adjusted in the callback are realized in the grid

Dash 3:

  • no flipping of the prop for loading state
  • assumes all readjustments to the grid coming through are to be realized immediately unless other catches happen (selections paused, or data updated)

@gvwilson gvwilson merged commit 9ffe139 into plotly:main Feb 7, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P1 needed for current cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants