-
Notifications
You must be signed in to change notification settings - Fork 189
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
fix(getFillColor):data parameter missing from the arguments #1736
fix(getFillColor):data parameter missing from the arguments #1736
Conversation
✅ Deploy Preview for carbon-charts-core ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-charts-angular ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-charts-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I have read the DCO document and I hereby sign the DCO. |
@@ -73,7 +72,9 @@ export class StackedArea extends Component { | |||
originalClassName: 'area' | |||
}) | |||
) | |||
.style('fill', (d: any) => self.model.getFillColor(getProperty(d, 0, groupMapsTo))) | |||
.style('fill', (d: any) => | |||
self.model.getFillColor(getProperty(d, 0, groupMapsTo), undefined, d) |
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.
we shouldn't send undefined
over.
Here's an example in scatter.ts
return this.model.getFillColor(d[groupMapsTo], d[domainIdentifier], d)
Let's try to send all of that info over pls, and in case we can't locate the data, use null
instead of undefined
pls
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 applies to all the files in the PR
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.
https://charts.carbondesignsystem.com/documentation/classes/Chart.html
the charts in this list don't have access to cartesianScale hence I couldn't use getDomainIdentifier with those and some of the charts receive binned and stacked data. I'll be sending null as mentioned.
@@ -216,7 +216,9 @@ export class Area extends Component { | |||
if (boundsEnabled) { | |||
enteringAreas | |||
.attr('fill-opacity', areaConfigs.opacity.selected) | |||
.style('stroke', (group: any) => self.model.getStrokeColor(group.name)) | |||
.style('stroke', (group: any) => | |||
self.model.getStrokeColor(group.name, undefined, group.data) |
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.
self.model.getStrokeColor(group.name, undefined, group.data) | |
self.model.getStrokeColor(group.name, null, group.data) |
@@ -94,7 +94,7 @@ export class Line extends Component { | |||
originalClassName: 'line' | |||
}) | |||
) | |||
.style('stroke', (group: any) => this.model.getStrokeColor(group.name)) | |||
.style('stroke', (group: any) => this.model.getStrokeColor(group.name, undefined, group.data)) |
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.
.style('stroke', (group: any) => this.model.getStrokeColor(group.name, undefined, group.data)) | |
.style('stroke', (group: any) => this.model.getStrokeColor(group.name, null, group.data)) |
@@ -366,9 +367,9 @@ export class Radar extends Component { | |||
? () => `translate(${c.x}, ${c.y}) scale(${1 + Math.random() * 0.35})` | |||
: `translate(${c.x}, ${c.y})` | |||
) | |||
.style('fill', (group: any) => colorScale(group.name)) | |||
.style('fill', (group: any) => colorScale(group.name, undefined, group.data)) |
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.
.style('fill', (group: any) => colorScale(group.name, undefined, group.data)) | |
.style('fill', (group: any) => colorScale(group.name, null, group.data)) |
.style('fill-opacity', radarConfigs.opacity.selected) | ||
.style('stroke', (group: any) => colorScale(group.name)) | ||
.style('stroke', (group: any) => colorScale(group.name, undefined, group.data)) |
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.
.style('stroke', (group: any) => colorScale(group.name, undefined, group.data)) | |
.style('stroke', (group: any) => colorScale(group.name, null, group.data)) |
@@ -397,8 +398,8 @@ export class Radar extends Component { | |||
originalClassName: 'blob' | |||
}) | |||
) | |||
.style('fill', (group: any) => colorScale(group.name)) | |||
.style('stroke', (group: any) => colorScale(group.name)) | |||
.style('fill', (group: any) => colorScale(group.name, undefined, group.data)) |
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.
.style('fill', (group: any) => colorScale(group.name, undefined, group.data)) | |
.style('fill', (group: any) => colorScale(group.name, null, group.data)) |
.style('fill', (group: any) => colorScale(group.name)) | ||
.style('stroke', (group: any) => colorScale(group.name)) | ||
.style('fill', (group: any) => colorScale(group.name, undefined, group.data)) | ||
.style('stroke', (group: any) => colorScale(group.name, undefined, group.data)) |
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.
.style('stroke', (group: any) => colorScale(group.name, undefined, group.data)) | |
.style('stroke', (group: any) => colorScale(group.name, null, group.data)) |
Updates