Skip to content

Add Multi Sparkline Visualization - #5

Open
google-labs-jules[bot] wants to merge 2 commits into
luka-testingfrom
multi-sparkline-viz-7398582887190052917
Open

Add Multi Sparkline Visualization#5
google-labs-jules[bot] wants to merge 2 commits into
luka-testingfrom
multi-sparkline-viz-7398582887190052917

Conversation

@google-labs-jules

Copy link
Copy Markdown

This PR adds a new custom visualization multi_sparkline as requested.

Key Changes:

  1. New Package: packages/multi_sparkline initialized.
  2. Dependencies: Added @visx/shape, @visx/curve, @visx/scale, @visx/gradient, @visx/responsive, @visx/group, d3-array, d3-time-format.
  3. Data Logic: Implemented processData in utils.ts to group flat Looker data by dimensions and calculate sparkline metrics (Current Value, Percent Change). Verified with unit tests.
  4. Visualization: Created SparklineRow component to render each group as a row with a sparkline, labels, and metrics.
    • Used AreaClosed with curveMonotoneX and linear gradient fill.
    • Used DrillableCell for all text elements.
  5. Testing:
    • Added unit.test.ts to test_app to verify data grouping and calculation logic.
    • Updated test_app/jest.config.js to transform ESM modules (d3-array, internmap, etc.).
    • Updated test_app test templates to handle cases where no query IDs are provided (skipping visual regression tests gracefully).
    • Moved queries.ts to mocks to avoid it being treated as a test file by Jest.

Note: Integration tests (visual regression) were skipped as no query ID was provided to fetch data from a Looker instance. The logic was verified via unit tests with mock data.


PR created automatically by Jules for task 7398582887190052917 started by @LukaFontanilla

- Create new package `multi_sparkline`
- Implement sparkline visualization using `visx`
- Support 3 dimensions (Date, Group 1, Group 2) and 1 measure
- Display current value and percent change
- Add unit tests for data processing logic
- Configure `test_app` to handle ESM dependencies and empty query lists for tests
@google-labs-jules

Copy link
Copy Markdown
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

- Create new package `multi_sparkline` using `yarn new`
- Implement sparkline visualization with `@visx` components
- Handle grouping by 2nd/3rd dimensions and sorting by date
- Configure `test_app` to support ESM dependencies and correctly locate query mocks
- Add unit tests for data processing logic
- Update query mock with requested slug `WI9e1KGncX4zhZ2Qy3o1B`
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.

0 participants