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

Update when figure changes regardless of revision #126

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
dmt0 merged 1 commit into master from plot-refresh-fix
Feb 21, 2019
Merged

Conversation

Copy link
Contributor

@dmt0 dmt0 commented Feb 21, 2019
edited
Loading

Addresses #59

  1. Ensure that update happens when one of data, layout or config or number of frames has changed as per the readme - regardless of whether revision changes.
  2. Remove ambiguity in readme props section.

Tested with RCE

const revisionDefined = nextProps.revision !== void 0;
const revisionChanged = nextProps.revision !== this.props.revision;

if (!figureChanged && (!revisionDefined || (revisionDefined && !revisionChanged))) {
Copy link
Contributor

@nicolaskruchten nicolaskruchten Feb 21, 2019

Choose a reason for hiding this comment

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

I think this condition should be ( (!revisionDefined && !figureChanged) || (revisionDefined && !revisionChanged) )

Copy link
Contributor

@nicolaskruchten nicolaskruchten Feb 21, 2019

Choose a reason for hiding this comment

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

or even clearer:

if(revisionDefined) {
 if (!revisionChanged) return;
}
else {
 if (!figureChanged) return;
}

Copy link
Member

@bpostlethwaite bpostlethwaite Feb 21, 2019

Choose a reason for hiding this comment

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

ooh you want clear?

let revisionNotDefinedAndFigureNotChanged = !revisionDefined && !figureChanged;
let revisionDefinedAndRevisionNotChanged = revisionDefined && !figureChanged;
if (revisionNotDefinedAndFigureNotChanged || revisionDefinedAndRevisionNotChanged) { 
 return;
}

Copy link
Member

@bpostlethwaite bpostlethwaite Feb 21, 2019

Choose a reason for hiding this comment

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

Or may as well just keep going here

let revisionNotDefinedAndFigureNotChangedOrRevisionDefinedAndRevisionNotChanged = revisionNotDefinedAndFigureNotChanged || revisionDefinedAndRevisionNotChanged;
if (revisionNotDefinedAndFigureNotChangedOrRevisionDefinedAndRevisionNotChanged) {
 return;
}

Copy link
Member

@bpostlethwaite bpostlethwaite Feb 21, 2019

Choose a reason for hiding this comment

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

#126 (comment) is great :)

Copy link
Contributor

@nicolaskruchten nicolaskruchten Feb 21, 2019

Choose a reason for hiding this comment

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

You're right, I was still holding on to an earlier viewpoint.

I'm 💃 on the current code actually. Sorry for allll the back and forth and thanks for continuing to push this thing in the right direction.

Copy link
Contributor

@nicolaskruchten nicolaskruchten Feb 21, 2019

Choose a reason for hiding this comment

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

It's just hard to read because it's defining the do-nothing case. It might be more readable to say if(! (<define the positive case>) )...

Copy link
Contributor Author

@dmt0 dmt0 Feb 21, 2019
edited
Loading

Choose a reason for hiding this comment

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

Mine can be simplified to
(!figureChanged || revisionDefined || revisionChanged))
Forgot all my propositional calculus, tools to the rescue :)
http://logictools.org/
(-figureChanged & (-revisionDefined | (revisionDefined & -revisionChanged)))

Copy link
Contributor Author

@dmt0 dmt0 Feb 21, 2019
edited
Loading

Choose a reason for hiding this comment

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

Tools showed that @nicolaskruchten's and mine are not equivalent. Upon further inspection, ((!revisionDefined && !figureChanged) || (revisionDefined && !revisionChanged)) fails the same test as #126 (comment). So I'm gonna use my original. The simplified version above was my error... Any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, github didn't show the comments above until I refreshed, will merge...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@bpostlethwaite bpostlethwaite bpostlethwaite left review comments

+1 more reviewer

@nicolaskruchten nicolaskruchten nicolaskruchten left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /