-
Notifications
You must be signed in to change notification settings - Fork 117
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 treatment and control bars #81
Conversation
bindings/jupyter-modules/jupyter-ma-causal/src/containers/index.js
Outdated
Show resolved
Hide resolved
<div> | ||
<StaticbarContainer | ||
index={i} | ||
lineName={d.name} |
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.
shall we revisit for this prop name, or at least add inlines comments on where getLineDataFactory is used? lineName
is not indicative for what it is.
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.
Added comments at where getLineDataFactory is used.
const {sliderValue, data, lineName} = this.props; | ||
if (sliderValue === null || sliderValue === undefined) { | ||
return '1.0'; | ||
return format(data[data.length - 1].y); |
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.
please add sanity checks for data (null and isArray) is we were to call .length
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.
Data is assumed to be an array, as specified in the prop-types of the component. However, data can be an empty array, so added the check for empty array.
> | ||
{groupName === 'treatment' | ||
? format(data[data.length - 1].y) | ||
: format(data[0].y)} |
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.
same as above, please add sanity checks for data
.
|
||
const mapStateToProps = (state, props) => { | ||
const {index, lineName} = props; | ||
// lineName: the name of the line representing the uplifting effect |
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.
Added the comment to indicate what lineName represents.
<div> | ||
<StaticbarContainer | ||
index={i} | ||
lineName={d.name} |
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.
Added comments at where getLineDataFactory is used.
const {sliderValue, data, lineName} = this.props; | ||
if (sliderValue === null || sliderValue === undefined) { | ||
return '1.0'; | ||
return format(data[data.length - 1].y); |
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.
Data is assumed to be an array, as specified in the prop-types of the component. However, data can be an empty array, so added the check for empty array.
Summary | Related Issue(s)
Checklist
[ ] I have added tests to cover my changes (for features and bug fixes).[ ] I have updated the documentation and changelogs accordingly.