Skip to content

Fix #791 by handling interactive_data_values properly#792

Merged
rich-iannone merged 9 commits intoposit-dev:mainfrom
lorenzo-w:main
Mar 2, 2026
Merged

Fix #791 by handling interactive_data_values properly#792
rich-iannone merged 9 commits intoposit-dev:mainfrom
lorenzo-w:main

Conversation

@lorenzo-w
Copy link
Contributor

Summary

This changes a single line in nanoplot_options() to handle interactive_data_values option properly instead of overriding it.

Related GitHub Issues and PRs

Checklist

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.31%. Comparing base (f657d81) to head (60f996a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #792   +/-   ##
=======================================
  Coverage   92.31%   92.31%           
=======================================
  Files          48       48           
  Lines        6039     6039           
=======================================
  Hits         5575     5575           
  Misses        464      464           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rich-iannone
Copy link
Member

The submitter's fix changes a single line in nanoplot_options() in _helpers.py. The original code used interactive_data_values = interactive_data_values or True, which always evaluates to True (so users could never disable interactive data values). The fix replaces it with:

interactive_data_values = True if interactive_data_values is None else interactive_data_values, matching the pattern already used for the other boolean options directly above it (e.g., show_data_points, show_data_line, etc.).

I added a few tests to verify this behavior in tests/test__utils_nanoplots.py‎. This example now works correctly:

from great_tables import GT, nanoplot_options
from great_tables.data import islands

islands_mini = islands.head(10).astype({"size": float})

(
  GT(islands_mini)
  .fmt_nanoplot(
    columns="size",
    plot_type="bar",
    options=nanoplot_options(interactive_data_values=False)
  )
)
image

And what we get are persistent data labels that aren't 'interactive' (meaning, appearing only on hover; all are shown).

@machow machow assigned rich-iannone and unassigned machow Mar 2, 2026
@machow
Copy link
Collaborator

machow commented Mar 2, 2026

@rich-iannone I've pushed a simple test up. If it looks good to you, do you mind merging?

@rich-iannone rich-iannone merged commit 9874b7c into posit-dev:main Mar 2, 2026
14 checks passed
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.

3 participants