-
Notifications
You must be signed in to change notification settings - Fork 3
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 AxisDisplayMode functionality #56
Conversation
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.
LGTM
if (axisDisplayMode === AxisDisplayMode.COLLAPSED) { | ||
axes.push(this.renderPlaceholderAxis()); | ||
} | ||
// We need to render all of the axes (even if they're hidden) in order 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.
This points to another problem about how state is kept and updated in the YAxis
, i'll file an issue to remember this.
Add support for several y-axis display modes: ALL: Show all of the axes. NONE: Don't show any of the axes. COLLAPSED: Hide the real axes and instead render a single generic axis without values or color. The yAxisDisplayMode property can be specified on an individual series object, too. In this case, it overrides the one set on the LineChart component, by rules of specificity. This also adds event listeners to AxisCollection, as specified via onAxisMouseEnter / onAxisMouseExit properties on LineChart.
Merge conflicts resolved, and I also added partial collapsing, after feedback from @danlevings and @hamzaque . Please take another look, especially at the new stories. |
Is this still open for one more iteration? |
// It might be nice to support zooming all of the axes when you zoom on | ||
// the collapsed one. Experiment with this and either add it or remove | ||
// all of this unused code. | ||
zoomable: PropTypes.bool, |
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.
Completely agree, having an all-series zoom feature through a collapsed axis would be really nice. It can be moved to another issue though.
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.
Created a new issue for this #66.
this.props.height | ||
); | ||
}; | ||
|
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.
Having a strong feeling we could move common with YAxis component functionality into a separate component or a factory.
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.
Yeah, this is pretty hideous -- I want to fix all of this pixel-math in a separate PR.
} | ||
|
||
renderPlaceholderAxis() { | ||
const { axisDisplayMode, height, yAxisWidth, series } = this.props; |
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.
eslint screaming on axisDisplayMode and series unused variables, we should probably add pre commit hooks in a separate issue.
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.
Done
@hamzaque yes, but depending on what the request is, we might push that to another PR. What's up? |
[pr-server] |
Add support for several y-axis display modes:
ALL: Show all of the axes.
NONE: Don't show any of the axes.
COLLAPSED: Hide the real axes and instead render a single generic axis
without values or color.
This also adds event listeners to AxisCollection, as specified via
onAxisMouseEnter / onAxisMouseExit properties on LineChart.