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

feat: implement chart component #377

Merged
merged 8 commits into from
Nov 3, 2018
Merged

feat: implement chart component #377

merged 8 commits into from
Nov 3, 2018

Conversation

AlejandroYanes
Copy link
Collaborator

No description provided.

@AlejandroYanes
Copy link
Collaborator Author

fixes #347

return (
<div>
<span className="rainbow-chart_dataset-container" aria-hidden>
<Provider value={{ privateRegister: this.registerDataset }}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

every time you do something like prop={{ value }} ... the object gets create in every execution of the render method. You can cache this instead by doing

this.contextValue = {
    privateRegister: this.registerDataset.bind(this),
}

then in the component render you pass the contextValue directly .. created only one time

Copy link
Collaborator

Choose a reason for hiding this comment

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

other observation, use Symbol to hide private methods and variables

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "react-rainbow-components",
"version": "0.6.0",
"version": "0.5.1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is incorrect. Are we going back in time? :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sorry a got mixed on the merge

@coveralls
Copy link

coveralls commented Nov 2, 2018

Pull Request Test Coverage Report for Build 193

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 75.145%

Totals Coverage Status
Change from base Build 169: 0.0%
Covered Lines: 1118
Relevant Lines: 1420

💛 - Coveralls

@reiniergs
Copy link
Collaborator

can we implement this without React context, since inside of component you can pass We can just iterate for the dataset in componentDidUpdate ... get the data passed then update the charts

this implementation does not guarantee reactivity since the charts only is created and updated one time. Every time props values change in Chart or DataSet the chart must be updated.

tips:

Copy link
Collaborator

@reiniergs reiniergs left a comment

Choose a reason for hiding this comment

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

done with the first pass

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.

5 participants