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

fix(getFillColor):data parameter missing from the arguments #1736

Merged
merged 4 commits into from
Feb 27, 2024

Conversation

RiyaJethwa
Copy link
Contributor

Updates

  • Data parameter previously missing, is added to getFillColor and getStrokeColor

@RiyaJethwa RiyaJethwa requested review from theiliad and a team as code owners February 1, 2024 07:26
Copy link

netlify bot commented Feb 1, 2024

Deploy Preview for carbon-charts-core ready!

Name Link
🔨 Latest commit 37dc1a1
🔍 Latest deploy log https://app.netlify.com/sites/carbon-charts-core/deploys/65d447de5f4e6500098ea6e4
😎 Deploy Preview https://deploy-preview-1736--carbon-charts-core.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 1, 2024

Deploy Preview for carbon-charts-angular ready!

Name Link
🔨 Latest commit 37dc1a1
🔍 Latest deploy log https://app.netlify.com/sites/carbon-charts-angular/deploys/65d447de3258d70008a8660a
😎 Deploy Preview https://deploy-preview-1736--carbon-charts-angular.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 1, 2024

Deploy Preview for carbon-charts-react ready!

Name Link
🔨 Latest commit 37dc1a1
🔍 Latest deploy log https://app.netlify.com/sites/carbon-charts-react/deploys/65d447de96f1e60008967714
😎 Deploy Preview https://deploy-preview-1736--carbon-charts-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@RiyaJethwa
Copy link
Contributor Author

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)
Copy link
Member

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

Copy link
Member

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

Copy link
Contributor Author

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)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.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))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.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))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.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))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.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))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.style('stroke', (group: any) => colorScale(group.name, undefined, group.data))
.style('stroke', (group: any) => colorScale(group.name, null, group.data))

@theiliad theiliad merged commit ffab983 into carbon-design-system:master Feb 27, 2024
4 checks passed
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.

2 participants