Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: animint2
Title: Animated Interactive Grammar of Graphics
Version: 2025.12.3
Version: 2025.12.4
URL: https://animint.github.io/animint2
BugReports: https://github.com/animint/animint2/issues
Authors@R: c(
Expand Down Expand Up @@ -64,7 +64,10 @@ Authors@R: c(
comment="Animint2 GSoC 2025"),
person("Gaurav", "Chaudhary",
role="ctb",
comment="Remove unused css.file parameter; fix issue #233 selector values; fix issue #273 update_axes tick font-size"))
comment="Remove unused css.file parameter; fix issue #233 selector values; fix issue #273 update_axes tick font-size; Collaborated on fixing issue #278 hasOwnProperty checks in animint.js"),
person("Harshit","Gangwar",
role="ctb",
comment="Removed unnecessary hasOwnProperty checks in animint.js; fix issue #278 animint.js Selectors does not need hasOwnProperty checks"))
Description: Functions are provided for defining animated,
interactive data visualizations in R code, and rendering
on a web page. The 2018 Journal of Computational and
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Changes in version 2025.12.4 (PR#284)

- issue #278 Removed unnecessary hasOwnProperty selector checks in `animint.js`.

# Changes in version 2025.12.3 (PR#282)

- URL hash handling: Removed old `window.location.hash` parsing code from `animint.js` (issue #280).
Expand Down
14 changes: 7 additions & 7 deletions inst/htmljs/animint.js
Original file line number Diff line number Diff line change
Expand Up @@ -1567,8 +1567,8 @@ var animint = function (to_select, json_file) {
eActions = function(groups) {
// Handle transitions seperately due to unique structure of geom_label_aligned
var transitionDuration = 0;
if (Selectors.hasOwnProperty(selector_name)) {
transitionDuration = +Selectors[selector_name].duration || 0;
if(Selectors[selector_name]){
transitionDuration = Selectors[selector_name].duration || 0;
}
groups.each(function(d) {
var group = d3.select(this);
Expand Down Expand Up @@ -1863,7 +1863,7 @@ var animint = function (to_select, json_file) {
positionTooltip(tooltip, tooltip.html());
});
}
if(Selectors.hasOwnProperty(selector_name)){
if(Selectors[selector_name]){
var milliseconds = Selectors[selector_name].duration;
elements = elements.transition().duration(milliseconds);
}
Expand Down Expand Up @@ -2084,11 +2084,11 @@ var animint = function (to_select, json_file) {
}

var update_selector = function (v_name, value) {
if(!Selectors.hasOwnProperty(v_name)){
var s_info = Selectors[v_name];
if(!s_info){
return;
}
value = value + "";
var s_info = Selectors[v_name];
if(s_info.type == "single"){
// value is the new selection.
s_info.selected = value;
Expand Down Expand Up @@ -2531,9 +2531,9 @@ var animint = function (to_select, json_file) {
var selector_widgets_hidden =
show_hide_selector_widgets.text() == toggle_message;
var has_no_clickSelects =
!Selectors[s_name].hasOwnProperty("clickSelects")
!Selectors[s_name].clickSelects
var has_no_legend =
!Selectors[s_name].hasOwnProperty("legend")
!Selectors[s_name].legend
if(selector_widgets_hidden && has_no_clickSelects && has_no_legend){
var node = show_hide_selector_widgets.node();
show_or_hide_fun.apply(node);
Expand Down
Loading