Skip to content

DM-8302 options for opposite axis location: X on top, Y on right #265

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 2 commits into from
Jan 6, 2017

Conversation

tgoldina
Copy link
Contributor

@tgoldina tgoldina commented Jan 5, 2017

Separated reversed and opposite ("top" for X, "right" for Y) axis options.
Refactored code to use ColumnOrExpression field in histogram or other charts.

https://jira.lsstcorp.org/browse/DM-8302

To test, open chart options and play with axis options in collapsible for X or Y axes.

Also refactored code to separate ColumnOrExpression field to use in histogram.
Copy link
Contributor

@loitly loitly left a comment

Choose a reason for hiding this comment

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

Changes look good. I tried it on multiple browsers and it was working fine. I made several comments in code, but they are only questions or comment and does not need to be changed.

Unrelated to this pull request, I noticed that histogram chart does not have a line border on the y-axis label.

let doUpdate = false;
if (height !== nextProps.height || width !== nextProps.width ) {
chart.setSize(nextProps.width, nextProps.height, false);
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

this function is a bit confusing to me. beside returning should update, it also does a chart.redraw.
but here, a setSize() does not need to be redrawn?

}
if (doUpdate) { chart.redraw(false); }
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

this return false statement should be moved outside of the if(chart) block.

};


// when more than one histogram is defined use series
Histogram.propTypes = {
series: PropTypes.arrayOf(PropTypes.object), // array of objects with data, binColor, and name properties
xAxis: PropTypes.object,
yAxis: PropTypes.object,
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be useful if you made this a shape type with defined props. just a thought. I am not sure how useful it is.

@@ -22,7 +22,7 @@ export const axisParamsShape = PropTypes.shape({
label : PropTypes.string,
unit : PropTypes.string,
error: PropTypes.string,
options : PropTypes.string // ex. 'grid,log,flip'
options : PropTypes.string // ex. 'grid,log,flip,opposite'
Copy link
Contributor

Choose a reason for hiding this comment

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

can you use oneOf here?

@tgoldina
Copy link
Contributor Author

tgoldina commented Jan 6, 2017 via email

@tgoldina
Copy link
Contributor Author

tgoldina commented Jan 6, 2017 via email

@tgoldina tgoldina merged commit f092f19 into dev Jan 6, 2017
@tgoldina tgoldina deleted the dm-8302_axislocation branch January 6, 2017 16:36
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