Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: React to config changes#7475

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
camdecoster merged 8 commits intomasterfromreact-to-config-changes
Sep 4, 2025
Merged

Conversation

@archmoj
Copy link
Contributor

@archmojarchmoj commentedJul 17, 2025
edited by camdecoster
Loading

Description

UsenewPlot if config has changed instead of_doPlot insidePlotly.react.

Closes#7551.
Supersedes#6395.

Changes

  • Adds check to determine ifnewPlot should be used
  • Updates tests per above change

Testing

  • Be on master
  • Launch Plotly DevTools
  • Open mockline_scatter (other mocks could work, but I know this one does)
  • Run the following snippet to update the mode bar buttons:
    lettoggle=truePlotly.react(gd,gd.data,gd.layout,{displaylogo:false,modeBarButtonsToAdd:[{name:'custombutton',title:toggle ?'Take PICTURE' :'Record MOVIE',icon:toggle ?Plotly.Icons.camera :Plotly.Icons.movie,click:()=>{}},],modeBarButtonsToRemove:["autoscale","pan2d","lasso2d","resetScale2d","select2d","toImage","zoom","zoomIn2d","zoomOut2d"]})
  • Run this other snippet to update the label of the custom button:
    toggle=falsePlotly.react(gd,gd.data,gd.layout,{displaylogo:false,modeBarButtonsToAdd:[{name:'custombutton',title:toggle ?'Take PICTURE' :'Record MOVIE',icon:toggle ?Plotly.Icons.camera :Plotly.Icons.movie,click:()=>{}},],modeBarButtonsToRemove:["autoscale","pan2d","lasso2d","resetScale2d","select2d","toImage","zoom","zoomIn2d","zoomOut2d"]})
  • Note that the button title and icon have not updated
  • Switch to this branch
  • Reload the mock
  • Run the two snippets again
  • Note that the button title and icon have changed

Notes

@archmojarchmoj self-assigned thisJul 17, 2025
@archmojarchmoj added bugsomething broken cscustomer success P1needed for current cycle labelsJul 17, 2025
Copy link
Contributor

@camdecostercamdecoster left a comment

Choose a reason for hiding this comment

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

This seems okay, but before I approve could you please provide a description and some steps to reproduce the issue? Then I can test before/after changes and see the fix in action.

@emilykl
Copy link
Contributor

emilykl commentedSep 3, 2025
edited
Loading

@camdecoster This is intended to address#6394, correct?

Never mind, just saw your comment in the PR description. In that case, would it make sense to open another issue which can be closed by this PR?

Copy link
Contributor

@emilyklemilykl left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me.

Call react again to ensure transitions are triggeredRemove obsolete references to configChanged
@camdecoster
Copy link
Contributor

@camdecoster This is intended to address#6394, correct?

Never mind, just saw your comment in the PR description. In that case, would it make sense to open another issue which can be closed by this PR?

Yes. I have a comment drafted about that, but never submitted it. 🤦

layout:layout
});
returnplotDone.then(()=>{
if(!configChanged)gd.emit('plotly_react',{ config, data, layout});
Copy link
Contributor

Choose a reason for hiding this comment

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

@camdecoster Is there a reason we don't want to emit aplotly_react event if the config changed?

Copy link
Contributor

Choose a reason for hiding this comment

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

It will emit twice for one call toreact without that check. This is because we callnewPlot and thenreact again after that, all within the first call toreact.

emilykl reacted with thumbs up emoji
@camdecostercamdecoster changed the titleReact to config changesfix: React to config changesSep 4, 2025
@camdecostercamdecoster merged commit4f7a513 intomasterSep 4, 2025
5 of 6 checks passed
@camdecostercamdecoster deleted the react-to-config-changes branchSeptember 4, 2025 22:07
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@camdecostercamdecostercamdecoster left review comments

@emilyklemilyklemilykl approved these changes

@alexcjohnsonalexcjohnsonAwaiting requested review from alexcjohnson

Assignees

@camdecostercamdecoster

Labels

bugsomething brokencscustomer successP1needed for current cycle

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Some configuration changes aren't reflected during calls toPlotly.react

4 participants

@archmoj@emilykl@camdecoster

[8]ページ先頭

©2009-2025 Movatter.jp