Skip to content

Conversation

DamianPendrak
Copy link
Contributor

@DamianPendrak DamianPendrak commented Sep 24, 2025

SUMMARY

I discovered an issue with the deck.gl polygon chart's elevation when set to a fixed value like "1000". This PR resolves that.

BEFORE/AFTER

Before
Screenshot 2025-09-24 at 16 07 42

After
Screenshot 2025-09-24 at 16 07 17

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added the viz:charts:deck.gl Related to deck.gl charts label Sep 24, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Design Suboptimal Union Type Design ▹ view 🧠 Not in scope
Functionality Missing legacy metric handling in elevation logic ▹ view 🧠 Not in scope
Files scanned
File Path Reviewed
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/buildQuery.ts
superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/transformProps.ts

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines 30 to +46
export interface DeckPolygonFormData extends SqlaFormData {
line_column?: string;
line_type?: string;
metric?: string;
point_radius_fixed?: {
value?: string;
};
point_radius_fixed?:
| {
value?: string;
}
| {
type: 'fix';
value: string;
}
| {
type: 'metric';
value: QueryFormMetric;
};

This comment was marked as resolved.

Comment on lines +89 to +96
if ('type' in point_radius_fixed) {
if (
point_radius_fixed.type === 'metric' &&
point_radius_fixed.value != null
) {
metrics.push(point_radius_fixed.value);
}
}

This comment was marked as resolved.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue with deck.gl polygon chart elevation when set to a fixed value. The problem was that fixed elevation values (like "1000") were not being properly handled, resulting in no elevation being applied to polygons.

  • Adds proper support for fixed elevation values in the polygon transform props logic
  • Updates type definitions to handle both fixed values and metric-based elevation configurations
  • Implements comprehensive test coverage for elevation handling scenarios

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
transformProps.ts Adds fixed elevation value parsing and conditional logic to prioritize fixed values over metric-based elevation
transformProps.test.ts New comprehensive test suite covering fixed elevation, metric elevation, and edge cases
buildQuery.ts Updates type definitions to support both legacy and new elevation configuration structures
buildQuery.test.ts New comprehensive test suite for query building with various elevation configurations

Comment on lines +35 to +46
point_radius_fixed?:
| {
value?: string;
}
| {
type: 'fix';
value: string;
}
| {
type: 'metric';
value: QueryFormMetric;
};
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The union type has inconsistent nullability for the value field. The first variant allows value?: string (optional), while the second variant requires value: string. This inconsistency could lead to runtime errors. Consider making the value field consistently optional or required across all variants.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The optional value type makes it backward compatible and it's handled properly in Polygon's transformProps and FixedOrMetricControl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant