[go: nahoru, domu]

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

Add outputs_list to window.dash_clientside.callback_context #2881

Merged
merged 7 commits into from
Jun 13, 2024

Conversation

insistence
Copy link
Contributor
@insistence insistence commented Jun 11, 2024

Start with a description of this PR. Then edit the list below to the items that make sense for your PR scope, and check off the boxes as you go!

Contributor Checklist

  • I have broken down my PR scope into the following TODO tasks
    • Add outputs_list to window.dash_clientside.callback_context
  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

optionals

  • I have added entry in the CHANGELOG.md
  • If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follows
    • this GitHub #PR number updates the dash docs
    • here is the show and tell thread in Plotly Dash community

Closes #2877

Comment on lines 272 to 276
dc.callback_context.outputs_list =
Object.prototype.toString.call(outputs) === '[object Object]'
? [outputs]
: outputs;
dc.callback_context.outputs = output;
Copy link
Collaborator
@AnnMarieW AnnMarieW Jun 12, 2024

Choose a reason for hiding this comment

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

It would be best to make the client side callback_context be the same as what's available on the server side. To achieve this, I think all that's necessary is to add the following here:

dc.callback_context.outputs_list = outputs;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, indeed! I made a mistake. I will make the necessary changes. Thank you!

@insistence insistence changed the title Add outputs and outputs_list to window.dash_clientside.callback_context Add outputs_list to window.dash_clientside.callback_context Jun 13, 2024
Copy link
Contributor
@T4rk1n T4rk1n 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, just need to change the changelog section then it's good to merge.

@@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](https://semver.org/).

## [2.17.1] - 2024-06-12

## Added
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to go in a new section above the ## [2.17.1] with a ## [UNRELEASED] title.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your correction. I have made the necessary changes as per your suggestion.

Copy link
Contributor
@T4rk1n T4rk1n left a comment

Choose a reason for hiding this comment

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

💃

@T4rk1n T4rk1n merged commit 71b1e6f into plotly:dev Jun 13, 2024
3 checks passed
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.

[Feature Request] Add outputs and outputs_list to window.dash_clientside.callback_context
3 participants