Skip to content

feat(path): support metric-based color scales & line width by metric#39165

Open
chaselynisabella wants to merge 9 commits intoapache:masterfrom
chaselynisabella:deckgl-path-line-width-by-metric
Open

feat(path): support metric-based color scales & line width by metric#39165
chaselynisabella wants to merge 9 commits intoapache:masterfrom
chaselynisabella:deckgl-path-line-width-by-metric

Conversation

@chaselynisabella
Copy link
Copy Markdown

SUMMARY

The Deck.gl Path visualization now allows users to set line width by a metric value. It also allows users to set the color of paths to a fixed color, color based on categories, or colors based on breakpoint values. These two features follow similar functionality of the Scatterplot visualization.

Linked discussions:
#38134
#38135

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshot 2026-04-07 at 3 50 12 PM Screenshot 2026-04-07 at 3 49 56 PM

TESTING INSTRUCTIONS

Users can make and saves changes to the line widths and path colors on the frontend and see the immediate modifications.

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

@bito-code-review
Copy link
Copy Markdown
Contributor

AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).

@dosubot dosubot bot added the viz:charts:deck.gl Related to deck.gl charts label Apr 7, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 7, 2026

Code Review Agent Run #493e16

Actionable Suggestions - 0
Additional Suggestions - 5
  • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/Path.tsx - 1
    • Prevent NaN in highlight width · Line 164-164
      In the highlight layer's data mapping, if `feature.width` is null, multiplying by `fd.line_width_multiplier` results in NaN, which can cause deck.gl rendering failures or incorrect display. It looks like this should default to 1, similar to the fixed width mode in the main layer, to prevent runtime errors.
  • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/buildQuery.test.ts - 3
    • Missing error case test · Line 1-353
      The buildQuery function throws an error if line_column is not provided, but no test covers this required input validation. Adding this test would ensure the error handling is maintained.
    • Incomplete test assertion · Line 353-353
      The test checks metrics but misses verifying that groupby includes 'path_json', which buildQuery adds when metrics require aggregation. This gap could allow regressions in grouping logic to go undetected.
      Code suggestion
       @@ -351,3 +351,4 @@
      -  expect(query.metrics).toContain('SUM(distance)');
      -  expect(query.metrics).toContain('AVG(speed)');
      -});
      +  expect(query.metrics).toContain('SUM(distance)');
      +  expect(query.metrics).toContain('AVG(speed)');
      +  expect(query.groupby).toContain('path_json');
      +});
    • Test naming inconsistency · Line 335-335
      The test name contains a typo ('together together') and inconsistent terminology ('breakpoint_metrics' instead of 'breakpoint_metric'). This can confuse readers and maintainers.
      Code suggestion
       @@ -335,1 +335,1 @@
      - test('Path buildQuery should handle line_width and breakpoint_metrics together together', () => {
      + test('Path buildQuery should handle line_width and breakpoint_metric together', () => {
  • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/transformProps.ts - 1
    • Variable naming typo · Line 144-144
      The variable name 'parsedFixedWith' appears to be a typo and should be 'parsedFixedWidth' to match the intended meaning of 'parsed fixed width'. This improves code readability without affecting functionality.
      Code suggestion
       @@ -144,3 +144,3 @@
      -      const parsedFixedWith = parseMetricValue(fixedWidthValue);
      -      if (parsedFixedWith !== undefined) {
      -        feature.width = parsedFixedWith;
      +      const parsedFixedWidth = parseMetricValue(fixedWidthValue);
      +      if (parsedFixedWidth !== undefined) {
      +        feature.width = parsedFixedWidth;
Review Details
  • Files reviewed - 8 · Commit Range: 96f674f..9b432e1
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/Path.tsx
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/buildQuery.test.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/buildQuery.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/controlPanel.test.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/controlPanel.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/transformProps.test.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/transformProps.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 8, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit e3a0c2d
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69d64f24035fac0008bda519
😎 Deploy Preview https://deploy-preview-39165--superset-docs-preview.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 project configuration.

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 8, 2026

Code Review Agent Run #aafef3

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/buildQuery.ts - 1
    • Dead code in line_width logic · Line 39-39
      The type definition for line_width has been updated to allow strings for legacy metric support, consistent with point_radius_fixed in Scatter charts. However, the logic in buildQuery.ts still includes dead code for handling top-level number values that are no longer permitted by the type. This should be cleaned up to avoid confusion and maintain code consistency.
      Code suggestion
       @@ -87,6 +87,4 @@
      -      const rawWidthValue =
      -        typeof line_width === 'string'
      -          ? line_width
      -        : typeof line_width === 'number'
      -            ? undefined
      -            : line_width?.value;
      +      const rawWidthValue =
      +        typeof line_width === 'string'
      +          ? line_width
      +          : line_width?.value;
Review Details
  • Files reviewed - 5 · Commit Range: 9b432e1..a3798fa
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/transformProps.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/Path.tsx
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/buildQuery.test.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/buildQuery.ts
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/transformProps.test.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Copy link
Copy Markdown
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

This is great! I left a vew minor comments with suggestions on making it a bit more protective, in case we have bad data.

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 8, 2026

Code Review Agent Run #942ed1

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/Path.test.tsx - 1
    • Unused test mock variable · Line 56-62
      The mockLayerParams object is defined but not used in the test, creating dead code. It appears intended to reduce duplication in test setup; either use it in the getLayer calls or remove it if unnecessary.
Review Details
  • Files reviewed - 2 · Commit Range: a3798fa..e791a8e
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/Path.test.tsx
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/Path.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 8, 2026

Code Review Agent Run #1afc56

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: e791a8e..2bd5f3b
    • superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/Path.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

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.

2 participants