Skip to content

add after_stat() support + geom_histogram() - #108

Merged
JosephBARBIERDARNAL merged 3 commits into
mainfrom
patch21
Jul 6, 2026
Merged

add after_stat() support + geom_histogram()#108
JosephBARBIERDARNAL merged 3 commits into
mainfrom
patch21

Conversation

@JosephBARBIERDARNAL

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 270d1b78-71a7-4474-b1f5-b5fb25e8dc63

📥 Commits

Reviewing files that changed from the base of the PR and between 675668d and 9f88adf.

📒 Files selected for processing (68)
  • docs/examples/animation-art.py
  • docs/examples/animation-hover.py
  • docs/examples/animation-line.py
  • docs/examples/animation.py
  • docs/examples/area-hover-to-show.py
  • docs/examples/area.py
  • docs/examples/bar-plot.py
  • docs/examples/climate-vulnerability-co2.py
  • docs/examples/coal-production.py
  • docs/examples/effects-confetti.py
  • docs/examples/europe-co2.py
  • docs/examples/facet.py
  • docs/examples/grouping.py
  • docs/examples/household-wealth.py
  • docs/examples/hover-nearest.py
  • docs/examples/javascript.py
  • docs/examples/linked-map-bars.py
  • docs/examples/matplotlib-annotation.py
  • docs/examples/mondrian.py
  • docs/examples/mtcars-linked-panels.py
  • docs/examples/on-click-custom-alert.py
  • docs/examples/on-click-new-window.py
  • docs/examples/on-click-stroke.py
  • docs/examples/sao-paulo-hdi.py
  • docs/examples/south-france-restaurants.py
  • docs/examples/tooltip-after-stat.py
  • docs/examples/tooltip-custom.py
  • docs/gallery/household-wealth.md
  • docs/gallery/mtcars-linked-panels.md
  • docs/gallery/sao-paulo-hdi.md
  • docs/guide/matplotlib.md
  • docs/how-to-add-an-example.md
  • docs/iframes/animation-art.html
  • docs/iframes/animation-hover.html
  • docs/iframes/animation-line.html
  • docs/iframes/animation.html
  • docs/iframes/area-chart.html
  • docs/iframes/area-hover-to-show.html
  • docs/iframes/bar.html
  • docs/iframes/climate-vulnerability-co2.html
  • docs/iframes/coal-production.html
  • docs/iframes/effects-confetti.html
  • docs/iframes/europe-co2.html
  • docs/iframes/facet_wrap.html
  • docs/iframes/household-wealth.html
  • docs/iframes/hover-nearest.html
  • docs/iframes/javascript-animate.html
  • docs/iframes/javascript-click-color.html
  • docs/iframes/javascript-hello.html
  • docs/iframes/linked-map-bars.html
  • docs/iframes/matplotlib-annotation.html
  • docs/iframes/mondrian.html
  • docs/iframes/mtcars-linked-panels.html
  • docs/iframes/on-click-custom-alert.html
  • docs/iframes/on-click-new-window.html
  • docs/iframes/on-click-stroke.html
  • docs/iframes/quickstart2.html
  • docs/iframes/sao-paulo-hdi.html
  • docs/iframes/saving-rate.html
  • docs/iframes/south-france-restaurants.html
  • docs/iframes/tooltip-after-stat.html
  • docs/iframes/tooltip-custom-css.html
  • docs/iframes/tooltip-custom-css2.html
  • docs/iframes/tooltip-default.html
  • docs/iframes/tooltip-html-injection.html
  • docs/iframes/zoom.html
  • tests/test-browser/test_interactions.py
  • tests/test-python/test_export.py
✅ Files skipped from review due to trivial changes (8)
  • docs/gallery/mtcars-linked-panels.md
  • docs/examples/hover-nearest.py
  • docs/examples/matplotlib-annotation.py
  • docs/guide/matplotlib.md
  • docs/gallery/sao-paulo-hdi.md
  • docs/examples/mondrian.py
  • docs/examples/bar-plot.py
  • docs/how-to-add-an-example.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/examples/tooltip-after-stat.py

📝 Walkthrough

Walkthrough

Adds _mapping_column in ninejs/utils.py, uses it in ninejs/main.py for tooltip-related mapping lookup, and adds after_stat() histogram tooltip coverage through tests, an example, and guide documentation. It also removes explicit iframe HTML minification from example and documentation save calls, then regenerates the affected iframe outputs.

Changes

Tooltip Mapping and after_stat Support

Layer / File(s) Summary
Mapping column helper
ninejs/utils.py
Adds _mapping_column(df, mapping, key) to resolve mapped dataframe columns only when the dataframe and mapping entry are valid; also reformats an unrelated length computation.
Tooltip extraction using helper
ninejs/main.py
Imports _mapping_column and uses it in _add_ggplot_tooltips for tooltip, hover_group, hover_key, and on_click, while preserving the hover_group fallback to data_id.
after_stat tooltip coverage
tests/test-python/test_main.py, docs/examples/tooltip-after-stat.py, docs/guide/tooltip.md
Adds a histogram test for after_stat-derived bar tooltips, a runnable example that renders the same pattern to HTML, and guide text showing aggregated-chart tooltips with after_stat().

Iframe Save Calls and Regenerated HTML Outputs

Layer / File(s) Summary
Update example and docs save calls
docs/examples/*.py, docs/guide/matplotlib.md, docs/how-to-add-an-example.md, docs/gallery/*.md
Removes minify=True from the example and documentation save calls that write iframe HTML files.
Regenerate iframe HTML outputs
docs/iframes/*.html
Regenerates the affected iframe HTML files and updates embedded SVG timestamps, serialized plot data, and adjacent inline script spacing where shown.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • y-sunflower/ninejs#46: Shares the tooltip-group data path used by hover-nearest behavior, which depends on the tooltip metadata resolved in ninejs/main.py.
  • y-sunflower/ninejs#58: Touches the on_click tooltip configuration path that now uses _mapping_column for mapping lookup.
  • y-sunflower/ninejs#94: Modifies tooltip configuration propagation based on Plotnine mappings, matching the same tooltip metadata flow updated here.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided, so the change summary can't be validated beyond the title. Add a short description summarizing the after_stat() histogram tooltip support and the related docs, example, and test updates.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: adding after_stat() tooltip support and histogram-related coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch patch21

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.44.1)
docs/iframes/bar.html

ast-grep timed out on this file

docs/iframes/hover-nearest.html

ast-grep retry budget exhausted before isolating this batch

docs/iframes/javascript-animate.html

ast-grep retry budget exhausted before isolating this batch

  • 13 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JosephBARBIERDARNAL JosephBARBIERDARNAL linked an issue Jul 6, 2026 that may be closed by this pull request
@JosephBARBIERDARNAL
JosephBARBIERDARNAL merged commit c8ea62b into main Jul 6, 2026
23 checks passed
@JosephBARBIERDARNAL
JosephBARBIERDARNAL deleted the patch21 branch July 6, 2026 12:26
@coderabbitai coderabbitai Bot mentioned this pull request Jul 11, 2026
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.

feat: geom_histogram

1 participant