Skip to content

Commit

Permalink
Fix for issue #61
Browse files Browse the repository at this point in the history
change to ES1 syntax
  • Loading branch information
bwlewis committed May 24, 2017
1 parent adf6f79 commit 36aabb8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions inst/htmlwidgets/scatterplotThree.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,10 @@ Widget.scatter = function(w, h)
{
/* discard vertices with tiny alpha */
var idx = I.map(function(x) {
return I[0].object.geometry.attributes.color.array[x.index * 4 + 3];
}).findIndex(function(v) {return(v > 0.1);});
return I[0].object.geometry.attributes.color.array[x.index * 4 + 3] > 0.1;
}).indexOf(true);
// return I[0].object.geometry.attributes.color.array[x.index * 4 + 3];
// }).findIndex(function(v) {return(v > 0.1);});
if(idx > -1 && I[idx].object.geometry.labels[I[idx].index].length > 0) printInfo(I[idx].object.geometry.labels[I[idx].index]);
} else if(I[0].object.type == "Mesh")
{
Expand Down Expand Up @@ -229,8 +231,9 @@ Widget.scatter = function(w, h)
{
/* ignore vertices with tiny alpha */
var idx = I.map(function(x) {
return I[0].object.geometry.attributes.color.array[x.index * 4 + 3];
}).findIndex(function(v) {return(v > 0.1);});
return I[0].object.geometry.attributes.color.array[x.index * 4 + 3] > 0.1;
// }).findIndex(function(v) {return(v > 0.1);});
}).indexOf(true);
if(idx < 0) return;
// XXX DEBUG raycasting
//if(I[idx].object.geometry.labels[I[idx].index].length > 0) console.log("click " +I[idx].index+" "+ I[idx].object.geometry.labels[I[idx].index]);
Expand Down

1 comment on commit 36aabb8

@lintr-bot
Copy link

Choose a reason for hiding this comment

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

R/scatterplot.R:265:30: style: Remove spaces before the left parenthesis in a function call.

x <- lapply(x, function(x) (x[, 1:3, drop=FALSE] - rep(mn, each = n)) / (rep(mx - mn, each = n)))
                             ^

Please sign in to comment.