Add API surface image on top of documentation page, with links#1266
Add API surface image on top of documentation page, with links#1266nevencaplar wants to merge 12 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1266 +/- ##
==========================================
+ Coverage 96.65% 96.82% +0.16%
==========================================
Files 48 48
Lines 2960 3052 +92
==========================================
+ Hits 2861 2955 +94
+ Misses 99 97 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Click here to view all benchmarks. |
The previous script put raw Excalidraw canvas coordinates into <area coords> while the JS was treating them as 1441×822-authored-space values, causing visible misalignment. Changes: - Compute the exact Excalidraw-export transform (pad=9, scale≈3.0075) so every text-element bbox is expressed in 3719×2164 PNG-pixel coordinates. - Set data-original-map-width/height equal to data-map-width/height (3719×2164) so the JS authored→native step is a no-op; only rendered scaling remains. - Update validator defaults to 3719×2164. - All 65 hotspot <area coords> rewritten with correct positions.
…ens, remove debug labels
- updater: compute visual_h_excal = line_h_excal * min(1, 1.2/lineHeight) so
text elements with large lineHeight (write_catalog 4.29x, MarginCatalog
4.57x) produce correctly-sized boxes instead of bloated slots
- updater: skip strokeColor '#1e1e1e' black elements from TOKEN candidates so
section headers ('Crossmatch', 'Join/Merge/Nest') don't shadow the real
purple function-list entries for crossmatch and join areas
- updater: require 60% length overlap for both partial_token and line match to
prevent short substrings ('catalog') matching long names ('margincatalog')
- api_surface_map.js: remove function-name label from debug overlay boxes
- validate_api_surface_map.py: update default bounds to 3719x2164
There was a problem hiding this comment.
Pull request overview
This PR adds an interactive “API surface” image map to the documentation landing page, along with supporting tooling to regenerate/validate hotspot coordinates from an Excalidraw source.
Changes:
- Replace the existing hero figure on
docs/index.rstwith a raw-HTML<img usemap>+<map><area>hotspot definition. - Add client-side JS/CSS to scale image-map coordinates to the rendered image size (plus optional debug overlay).
- Add maintainer scripts + Excalidraw source data to update and validate the hotspot coordinates; update several reference autosummary lists.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
docs/index.rst |
Adds the API surface image + image-map <area> links on the docs home page. |
docs/conf.py |
Loads the new api_surface_map.js as a global Sphinx static JS file. |
docs/_static/custom.css |
Adds styling for the API surface wrapper/image and debug overlay. |
docs/_static/api_surface_map.js |
Implements responsive scaling for <area coords> and optional debug overlay. |
docs/tools/update_api_surface_coords_from_excalidraw.py |
Regenerates <area coords> from Excalidraw geometry/text. |
docs/tools/validate_api_surface_map.py |
Validates <area> rectangles and link targets in docs/index.rst. |
docs/tools/README.md |
Documents how to run the update/validation tools and build a local preview. |
docs/tools/data/API_Surface_Feb_12.excalidraw |
Adds the Excalidraw “source of truth” used for hotspot regeneration. |
docs/reference/io.rst |
Adds show_versions to the autosummary list. |
docs/reference/catalog_inspection.rst |
Adds Catalog.estimate_size to the autosummary list. |
docs/reference/catalog_filtering.rst |
Adds Catalog.rename to the autosummary list. |
docs/reference/catalog_dataframe.rst |
Adds Catalog.to_delayed to the autosummary list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ons/lsdb into API_surface_links
hombit
left a comment
There was a problem hiding this comment.
Thanks!
- It is not clear that these methods are clickable. Maybe add a caption?
- Image is really large, almost a megabyte. The load time would be significant on a bad connection. I propose to make it x2 resolution and convert to webp.
- On Safari, my pointer is trying to select a word from the image, so it is not clickable. Please ask your imaginary friend ChatGPT for help (I guess the image should become a "background" or something like that).
Screen.Recording.2026-03-19.at.12.52.28.mov
- Font is small. If it is hard to change, let's open a new issue to make the central part of the page wider, so the plot gets larger at least on larger monitors. (Note the large unused white area on the right)
dougbrn
left a comment
There was a problem hiding this comment.
This is really cool, just following on from Kostya's points. I think a callout box above the plot saying things are interactive would be good here, and when uploading excalidraw drawings for nested-pandas I found that svg was better format for filesize compared to png, so would encourage the same switch here (or exporting to something else if you want).
|
@dougbrn SVG actually sounds really good. It is small, scalable, and scripting should be more straightforward with it. |
As discussed at LINCCup, replaces non-informative HATS partitioning of GAIA DR3 with API surface graph, with links embedded.
Codex helped me create a JavaScript file that handles rescaling of the coordinates of the boxes, as well as visual debug overlay (activated b appending
?mapdebug=1to the url of the webpage containing the graph, e.g., https://lsdb--1266.org.readthedocs.build/en/1266/?mapdebug=1).The source plot is an Excalidraw file (
docs/tools/data/API_Surface_Feb_12.excalidraw), and a python script (docs/tools/update_api_surface_coords_from_excalidraw.py) that should regenerate the boxes from the source file.docs/tools/validate_api_surface_map.pyshould validate the result. This procedure is also described indocs/tools/README.md.