Skip to content

animint.js: remove unnecessary Selectors.hasOwnProperty checks#306

Open
ANAMASGARD wants to merge 8 commits intomasterfrom
Remove-Selectors-hasOwnProperty
Open

animint.js: remove unnecessary Selectors.hasOwnProperty checks#306
ANAMASGARD wants to merge 8 commits intomasterfrom
Remove-Selectors-hasOwnProperty

Conversation

@ANAMASGARD
Copy link
Copy Markdown
Contributor

@ANAMASGARD ANAMASGARD commented Mar 2, 2026

Fixes #278

  • Replaced Selectors.hasOwnProperty(selector_name) with a simple selector_name check in draw_geom and geom_label_aligned.
  • Removed redundant guard in update_selector.
  • Removed Selectors.hasOwnProperty check in update_axes.

I confirm I have not used any AI code generation tools for this PR.

Fixes #278. Replaced Selectors.hasOwnProperty(selector_name) with a
simple selector_name check in draw_geom and geom_label_aligned.
Removed redundant guard in update_selector. Removed
Selectors.hasOwnProperty check in update_axes.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 73.08%. Comparing base (543d0d9) to head (80f1208).

Files with missing lines Patch % Lines
inst/htmljs/animint.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #306      +/-   ##
==========================================
- Coverage   73.09%   73.08%   -0.01%     
==========================================
  Files         164      164              
  Lines        8769     8766       -3     
==========================================
- Hits         6410     6407       -3     
  Misses       2359     2359              
Flag Coverage Δ
javascript 80.76% <50.00%> (-0.03%) ⬇️
r 69.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ANAMASGARD ANAMASGARD requested a review from tdhock March 2, 2026 14:00
Copy link
Copy Markdown
Collaborator

@tdhock tdhock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also please investigate CI failure

Comment thread inst/htmljs/animint.js Outdated
Comment thread inst/htmljs/animint.js Outdated
Comment thread inst/htmljs/animint.js Outdated
@ANAMASGARD
Copy link
Copy Markdown
Contributor Author

Sir @tdhock , if(selector_name) guards in Changes 1 and 2 cannot be removed safely — [selector_name] is null on initial geom rendering, so without the guards, Selectors[null].duration throws a TypeError and breaks all 149 JS tests.
The guards are not about checking hasOwnProperty on [Selectors]; they handle the case where no selector is active at all.
I removed them in previous commit which caused error , please give your feedback .

@ANAMASGARD ANAMASGARD requested a review from tdhock March 9, 2026 00:27
Copy link
Copy Markdown
Collaborator

@tdhock tdhock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revise

Comment thread inst/htmljs/animint.js Outdated
Comment thread inst/htmljs/animint.js Outdated
@tdhock
Copy link
Copy Markdown
Collaborator

tdhock commented Mar 10, 2026

ok i see now " [selector_name] is null on initial geom rendering" why and when does that happen?
i thought none of these blocks should run (and we can do no rendering) if we don’t have json info? (including selectors)

ANAMASGARD and others added 2 commits March 11, 2026 05:48
…e only

Replace bare if(selector_name) guards in geom_label_aligned and draw_geom
with if(selector_name && Selectors[selector_name].hasOwnProperty("duration"))
to match the same pattern already used in update_axes (Change 3).
@ANAMASGARD ANAMASGARD requested review from suhaani-agarwal and tdhock and removed request for tdhock March 11, 2026 06:03
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.

animint.js Selectors does not need hasOwnProperty

2 participants