Skip to content

Allow Points to be Dragged - #52

Open
DonIsaac wants to merge 11 commits into
nomic-ai:masterfrom
DonIsaac:don/feat/d3-drag
Open

DonIsaac wants to merge 11 commits into
nomic-ai:masterfrom
DonIsaac:don/feat/d3-drag

Conversation

@DonIsaac

@DonIsaac DonIsaac commented Sep 5, 2022

Copy link
Copy Markdown
Contributor

What This PR Does

This PR allows users to click and drag any point on the screen. I would record a Loom to demonstrate dragging behavior but recording is bugged out for me right now. As points are dragged, both the SVG circle and the corresponding dot on the scatterplot are updated. Releasing the mouse invokes a DragHandler function, which is similar to a ClickHandler.

Additional Features

  • New public methods for QuadTile:
    • visit_at_point(ix, callback): Finds a tile that contains a desired point and invokes a callback function. Uses a breadth-first search to check the targeted tile and it's children
    • find_point(ix): Finds a point with the target index. Consumes visit_at_point.
    • update_point(ix, new_point): Updates the data for the point at ix. Consumes visit_at_point.
  • Add assert utility. Behaves similarly to node's assert, but does not require a polyfill

This branch has not been deployed

No deployments
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.

1 participant