Skip to content
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

Merged
merged 2 commits into from
Dec 9, 2019
Merged

Add treatment and control bars #81

merged 2 commits into from
Dec 9, 2019

Conversation

kenns29
Copy link
Collaborator

@kenns29 kenns29 commented Dec 7, 2019

Summary | Related Issue(s)

image

Checklist

  • I have made this PR atomic.
  • I have provided enough context for others to review.
  • [ ] I have added tests to cover my changes (for features and bug fixes).
  • [ ] I have updated the documentation and changelogs accordingly.
  • All new and existing tests passed.

@kenns29 kenns29 changed the base branch from master to ma-causal December 7, 2019 02:14
@kenns29 kenns29 requested a review from gnavvy December 7, 2019 02:14
<div>
<StaticbarContainer
index={i}
lineName={d.name}
Copy link
Contributor

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.

Copy link
Collaborator Author

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);
Copy link
Contributor

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

Copy link
Collaborator Author

@kenns29 kenns29 Dec 9, 2019

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)}
Copy link
Contributor

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
Copy link
Collaborator Author

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}
Copy link
Collaborator Author

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);
Copy link
Collaborator Author

@kenns29 kenns29 Dec 9, 2019

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.

@kenns29 kenns29 merged commit 19aaaa7 into ma-causal Dec 9, 2019
@kenns29 kenns29 deleted the ma-causal-dev branch December 9, 2019 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants