-
-
Notifications
You must be signed in to change notification settings - Fork 125
Explicitly set Cytoscape's elements default values, fix interactions test #96
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
Conversation
| imageData: null, | ||
| responsive: false | ||
| responsive: false, | ||
| elements: {} |
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.
Not []?
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.
Both {} and [] are fine since 0.1, so I don't think it matters a lot.
Not according to the propType:
| elements: PropTypes.arrayOf(PropTypes.object), |
So either we should change this to something like
elements: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object])Or we should change the default to []
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.
Good catch. I'll update the proptypes.
|
Both {} and [] are fine since 0.1, so I don't think it matters a lot.
…On Mon, Jul 6, 2020, 3:27 PM alexcjohnson ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/lib/components/Cytoscape.react.js
<#96 (comment)>:
> @@ -818,7 +818,8 @@ Cytoscape.defaultProps = {
autoRefreshLayout: true,
generateImage: {},
imageData: null,
- responsive: false
+ responsive: false,
+ elements: {}
Not []?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#96 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFBTAWMIXW74NXUSONYA7UDR2IQQ3ANCNFSM4OQCXMHQ>
.
|
|
By the way, this is the PR that added support for Re-reading that PR, i realize that perhaps setting in which case initializing an empty cytoscape graph with |
Default prop values don't come back in callbacks, so I think for a use case like this you'll still need to do something like |
alexcjohnson
left a comment
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 haven't looked into the test failures, but assuming those get sorted out this looks good to me. 💃
40b78a2 to
cbb7516
Compare
About
This fixes the problem where creating a
cyto.Cytoscape()without specifyingelementswould throw an error.Description of changes
Pre-Merge checklist
npm run build:all.Reference Issues
Closes #61
Other comments