-
-
Notifications
You must be signed in to change notification settings - Fork 111
Merging Hub into Editor #176
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
71ba63b
merging hub into editor
nicolaskruchten e1ddddc
adding react back in
nicolaskruchten 83f8d07
fixing some tests
nicolaskruchten 947a74e
bugfix
nicolaskruchten aec613c
fixing all tests
nicolaskruchten dceb164
explanatory comments
nicolaskruchten 90a60f3
PR feedback
nicolaskruchten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this, when the plot component updates, it sets graphDiv to the actual dom element:
https://github.com/plotly/react-plotly.js/blob/master/src/factory.js#L167
it's that actual dom element that we're passing around and deriving all our values from, so making it seem like it is not the case is confusing to me
@bpostlethwaite is this not the case, am I missing something here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I don't think I understand how that state.figure used to work and update, what was making it update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plotly.js would basically copy the
figure.data
andfigure.layout
references intographDiv
and pass it to the Editor via the Hub... Now it's just more explicit that the App has a handle ongraphDiv
: it partially-constructs it (i.e. gives itdata
andlayout
) and then Plotly.js adds all the other stuff it needs to (basically by overwriting it every time it updates)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but to me it seems like the graphDiv that plotly.js passes is the actual dom div element.. when looking at the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/plotly/react-plotly.js/blob/master/src/factory.js#L189
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re the code here, we could also just have an
initialFigure = {data, layout}
type thing, with the initial value ofgraphDiv
asnull
... I had it this way earlier and it worked as well, if we want to make it really explicit what's happening.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what note would you add?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that graphDiv is later on replaced by a full dom node with all the other properties of plotly.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then no note is really needed :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment per your suggestion. The reason I removed the
initialFigure
thing is that inrender()
it looked really weird to have<Plot data={this.initialFigure.data} layout={this.initialFigure.layout} ... />
because it seemed like it would never get new data.