-
Notifications
You must be signed in to change notification settings - Fork 2
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($point): New point
parameter for LineChart
#2
base: master
Are you sure you want to change the base?
Conversation
This adds a `point` parameter for modifying color, opacity radius and stroke props on rendered SVG
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.
Thanks for the PR! Added some minor remarks. Also, an additional example graph would be great!
@@ -80,6 +83,7 @@ export default class AbstractChart { | |||
* @param {Function} [tooltipFunction] function that receives a data object and returns the string displayed as tooltip. | |||
* @param {Array} [legend] names of the sub-arrays of data, used as legend labels. | |||
* @param {String | Object} [legendTarget] DOM node to which the legend should be mounted. | |||
* @param {Object} [point={ color: null, radius: 3, fillOpacity: 1, strokeWidth: 0, strokeColor: null }] point object specifying color, radius, fillOpacity, strokeWidth and strokeColor. |
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 can be split up to multiple lines, see https://github.com/documentationjs/documentation/blob/master/docs/RECIPES.md#destructuring-parameters
radius: this.point.radius || 3, | ||
color: this.point.color || this.colors[index], | ||
fillOpacity: this.point.fillOpacity, | ||
strokeWidth: this.point.strokeWidth, | ||
strokeColor: this.point.strokeColor |
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.point?
const color = this.point.color || this.colors[index] | ||
const fillOpacity = this.point.fillOpacity | ||
const strokeWidth = this.point.strokeWidth | ||
const strokeColor = this.point.strokeColor |
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.point?
Also, rebasing to master should fix the build issues from Netlify 😅 |
This adds a
point
parameter for modifying color, opacity radius and stroke props on rendered SVG rather than using CSS-based modifiers.