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(1852): fix property issues with interfaces used by demos #1853

Merged
merged 3 commits into from
Jun 16, 2024

Conversation

nstuyvesant
Copy link
Contributor

@nstuyvesant nstuyvesant commented Jun 16, 2024

Updates

  • Demos tried to use canvasZoom.enabled but got eslint errors.
  • Demos tried to use points and curve properties but got eslint errors
  • Missing functions (used by demos) on interface MeterChartOptions.
  • Misspelled property on CirclePackChartOptions
  • Property circle for CirclePackChartOptions is not required
  • HeatmapChartOptions should extend AxisChartOptions instead of BaseChartOptions
  • Interface ChoroplethChartOptions has top-level property geoData not choropleth.geoData.
  • Bump dependencies

@nstuyvesant nstuyvesant requested review from theiliad and a team as code owners June 16, 2024 03:12
Copy link

netlify bot commented Jun 16, 2024

Deploy Preview for carbon-charts-angular ready!

Name Link
🔨 Latest commit 4837d88
🔍 Latest deploy log https://app.netlify.com/sites/carbon-charts-angular/deploys/666f018995110e0008b6b3bf
😎 Deploy Preview https://deploy-preview-1853--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 Jun 16, 2024

Deploy Preview for carbon-charts-react ready!

Name Link
🔨 Latest commit 4837d88
🔍 Latest deploy log https://app.netlify.com/sites/carbon-charts-react/deploys/666f0189b55ed7000862d4b6
😎 Deploy Preview https://deploy-preview-1853--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.

Copy link

netlify bot commented Jun 16, 2024

Deploy Preview for carbon-charts-core ready!

Name Link
🔨 Latest commit 4837d88
🔍 Latest deploy log https://app.netlify.com/sites/carbon-charts-core/deploys/666f0189a739a7000739f454
😎 Deploy Preview https://deploy-preview-1853--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.

@@ -109,6 +109,10 @@ export interface BasedAxisOptions {
* axis that's being broken into bins
*/
binned?: boolean
/**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used by more than just combo charts

@@ -106,6 +106,9 @@ export interface BaseChartOptions {
*/
prefix?: string
}
canvasZoom?: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was missing

/**
* options for the points
*/
points?: {
Copy link
Contributor Author

@nstuyvesant nstuyvesant Jun 16, 2024

Choose a reason for hiding this comment

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

points property used by Lollipop, Combo, and Area chart demos so moved it to AxisChartOptions.

/**
* options for the points
*/
points?: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

While having this on ScatterChartOptions served Lollipops which use the same options, did nothing for Area and Combo charts

/**
* options for the curve of the line
*/
curve?: string | { name: string }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to AxisChartOptions since it's needed for combo and line chart demos as well.

@@ -435,6 +432,8 @@ export interface MeterChartOptions extends BaseChartOptions {
proportional?: {
total?: number
unit?: string
totalFormatter?: (total: number) => string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Meter chart demos use both of these functions yet they were not established properties

@@ -509,11 +508,11 @@ export interface TreeChartOptions extends BaseChartOptions {
*/
export interface CirclePackChartOptions extends BaseChartOptions {
circlePack?: {
circles: {
circles?: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of the circle pack chart demos did not have this property so making it optional

@@ -28,7 +28,7 @@ export class CirclePackChartModel extends ChartModel {
updateLegendAdditionalItems(options, zoomOptions)

const depth = this.getHierarchyLevel()
const userProvidedDepth = getProperty(options, 'circlePack', 'hierarchyLevel')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you looked at functions like getHierarchyLevel(), you'll see that they expected a depth property - not hierarchyLevel.

@@ -206,7 +210,7 @@ export class Tooltip extends Component {
return valueFormatter(value, label)
}

if (typeof value.getTime === 'function') {
if (this.isDate(value)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaner check with TypeScript type predicate

@@ -44,7 +44,7 @@ export const circlePack = {
mainGroup: 4,
children: 2
},
hierarchyLevel: 2
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implementation always expected depth - not hierarchyLevel

@@ -224,7 +224,7 @@ export const circlePackThreeLevelsMonochromeData = [
export const circlePackThreeLevelNoZoomOptions = {
title: 'Three Levels Hierarchy (No Zoom)',
circlePack: {
hierarchyLevel: 3
depth: 3
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implementation always expected depth - not hierarchyLevel

/**
* options for the curve of the line
*/
curve?: string | { name: string }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

curve is not just for AreaChart (used by line and combo, too).

Copy link
Member

@theiliad theiliad left a comment

Choose a reason for hiding this comment

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

LGTM

@theiliad theiliad merged commit cb0705b into carbon-design-system:master Jun 16, 2024
5 checks passed
@nstuyvesant nstuyvesant deleted the fix-1852 branch June 16, 2024 22:15
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