Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Jan 3, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

Add a new "geoTipScaled" plot example showcasing the use of scaled x and y channels with the geo mark and tip option. Update the centroid transform to use the context's path generator, simplifying its logic and removing the need for direct projection access. Refactor the line and link marks to use the context's path generator for sphere rendering, improving consistency.

New Features:

  • Add a "geoTipScaled" plot example that demonstrates the geo mark with the tip option and scaled x and y channels.

Tests:

  • Add a new SVG snapshot test for the "geoTipScaled" plot.

* Set context.path early

* adopt context.path

* don't scale twice! adds a unit test

* define path with projection

* pretty

* better test
@pull pull bot added the ⤵️ pull label Jan 3, 2025
@pull pull bot merged commit 164fb66 into admariner:main Jan 3, 2025
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 3, 2025

Reviewer's Guide by Sourcery

This pull request adds a new geo mark with the tip option and scaled x and y channels. It also modifies the centroid transform to use the context's path generator instead of the projection directly. Lastly, it updates the line and link marks to use the context's path generator for sphere rendering.

Sequence diagram for updated geo path generation flow

sequenceDiagram
    participant Mark as Mark (Line/Link)
    participant Context as Plot Context
    participant Path as Path Generator
    Mark->>Context: Request path()
    Context->>Context: Check projection
    alt Has projection
        Context->>Path: Create with projection
    else No projection
        Context->>Path: Create with xyProjection(scales)
    end
    Context-->>Mark: Return path generator
    Mark->>Path: Use for rendering (centroid/line/link)
Loading

Class diagram showing updated context and mark relationships

classDiagram
    class PlotContext {
        +projection
        +path()
        +filterFacets()
    }

    class Mark {
        <<abstract>>
        +scale()
        +render()
    }

    class Line {
        +render()
        -sphereLine()
    }

    class Link {
        +render()
        -sphereLink()
    }

    Mark <|-- Line
    Mark <|-- Link

    note for PlotContext "New path() method for
centralized path generation"
    note for Line "Updated to use context.path()"
    note for Link "Updated to use context.path()"
Loading

File-Level Changes

Change Details Files
Added a new geo mark with the tip option and scaled x and y channels.
  • Created a new example plot named geoTipScaled that demonstrates the use of the geo mark with scaled x and y channels and a tip.
test/plots/geo-tip.ts
Modified the centroid transform to use the context's path generator instead of the projection directly.
  • Updated the centroid transform to use context.path().centroid instead of geoPath(projection).centroid.
src/transforms/centroid.js
Updated the plot function to create a path generator for marks.
  • Added a path function to the plot context that returns a geoPath generator using the current projection or a default xy projection.
src/plot.js
Updated the line and link marks to use the context's path generator for sphere rendering.
  • Modified the line and link marks to use context.path() for sphere rendering instead of directly accessing context.projection.
src/marks/line.js
src/marks/link.js
Added a new output file for the geoTipScaled plot.
  • Added a new SVG output file for the geoTipScaled plot example.
test/output/geoTipScaled.svg

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@pull pull bot had a problem deploying to github-pages January 3, 2025 17:41 Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant