Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Feat: BarChart axis and icons #52

Merged
merged 4 commits into from
Mar 21, 2017
Merged

Feat: BarChart axis and icons #52

merged 4 commits into from
Mar 21, 2017

Conversation

eddier
Copy link
Contributor

@eddier eddier commented Mar 20, 2017

Enables axis date display and icons on bar chart. See styleguidist example for usage.

adds a label option and icon option to the bar chart
adds axis and graph icon support
@wa11-e
Copy link

wa11-e commented Mar 20, 2017

Woohoo! new surge deployment available for viewing! 🎉 surgereview23604592.surge.sh

Copy link
Contributor

@jhegg jhegg left a comment

Choose a reason for hiding this comment

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

This is great, thanks!

Oh, one comment - the tooltip for the BarChart has a hardcoded label of "operations"; I think it would be great if that were a prop instead, do you agree? But that could of course be changed outside of this PR.

/>
</div>

Icons are driven from the currentState property of every record. Warning and critical will display icons while 'normal' does not.
Set the showIcon & showXLabel props to respectively enable those display properties.
Copy link
Contributor

Choose a reason for hiding this comment

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

Great explanation, thanks!


// const xScale = ChartUtils.xScaleBand(data, innerWidth, barPadding);
const data = Immutable.fromJS(this.props.data).toJS()
const xScaleTimeLineData = Immutable.fromJS(this.props.data).toJS()
Copy link
Contributor

Choose a reason for hiding this comment

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

why use immutable here? were essentially just running an identity fn. this is opinion, but I think it's the responsibility of the consumer to manage the mutability of his/her data. if all we're lookin' for is a copy we could consider using Object.assign/clone, and shave a dep!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a bit of carryover from the prototype where we used immutable in the charts. Object.assign isn't a good fit here since this is an array of objects - but I can put in an alternative solution. I'll update the branch with an update that removes the dependency.

@eddier
Copy link
Contributor Author

eddier commented Mar 21, 2017

@jhegg The tooltip should be earmarked for an update when the data that is feeding it is solidified. Right now the props for the tooltip are a best guess from the prototype. I'll add a 'tooltipTitle' prop to the chart that lets you specify a text string for that specific piece you mentioned.

@jhegg
Copy link
Contributor

jhegg commented Mar 21, 2017

Great, thanks. So I think we're just waiting on the immutable dependency change before merging, right?

@eddier
Copy link
Contributor Author

eddier commented Mar 21, 2017

That and I'll change the ability to send a prop title to the tooltip component.

removes dependency on immutable and adds title prop support for tooltip
@wa11-e
Copy link

wa11-e commented Mar 21, 2017

Woohoo! new surge deployment available for viewing! 🎉 surgereview23639783.surge.sh

@jhegg
Copy link
Contributor

jhegg commented Mar 21, 2017

Awesome, that's looking great!

@jhegg jhegg merged commit f305208 into master Mar 21, 2017
@jhegg jhegg deleted the graphlabels branch March 21, 2017 20:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants