Skip to content

Commit

Permalink
issue #60 fix for reveal.js
Browse files Browse the repository at this point in the history
just use jquery
  • Loading branch information
bwlewis committed May 24, 2017
1 parent 6d7c9aa commit 9b5be2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 44 deletions.
44 changes: 0 additions & 44 deletions inst/htmlwidgets/scatterplotThree.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ Widget.scatter = function(w, h)
info.style.left = "0px";
el.appendChild(info);

// semi-ugly hack for case:
// subscribe to custom shown event (fired by ioslides to trigger
// shiny reactivity but we can use it as well). this is necessary
// because if a widget starts out as display:none it has height
Expand All @@ -175,49 +174,6 @@ Widget.scatter = function(w, h)
controls.handleResize();
_this.animate();
});
} else {
if(el.closest('slide') !== null)
{
el.closest('slide').addEventListener('slideenter', function(ev) {
_this.width = _this.el.offsetWidth;
_this.height = _this.el.offsetHeight;
_this.camera.aspect = _this.width / _this.height;
_this.camera.updateProjectionMatrix();
_this.renderer.setSize(_this.width, _this.height);
controls.handleResize();
_this.animate();
}, false);
} else if(el.closest('section.slide') !== null)
{
// see https://github.com/hakimel/reveal.js/tree/master#slide-changed-event
// XXX this seems wrong -- is triggered on every slide change. But I could
// not find a way to make this work on a per-slide basis without this (the
// code in the else block below didn't trigger). These JS frameworks give
// me headaches.
if (typeof Reveal != 'undefined')
{
Reveal.addEventListener('slidechanged', function(ev) {
_this.width = _this.el.offsetWidth;
_this.height = _this.el.offsetHeight;
_this.camera.aspect = _this.width / _this.height;
_this.camera.updateProjectionMatrix();
_this.renderer.setSize(_this.width, _this.height);
controls.handleResize();
_this.animate();
}, false);
} else
{
el.closest('slide').addEventListener('slideenter', function(ev) {
_this.width = _this.el.offsetWidth;
_this.height = _this.el.offsetHeight;
_this.camera.aspect = _this.width / _this.height;
_this.camera.updateProjectionMatrix();
_this.renderer.setSize(_this.width, _this.height);
controls.handleResize();
_this.animate();
}, false);
}
}
}

el.onmousemove = function(ev)
Expand Down
4 changes: 4 additions & 0 deletions inst/htmlwidgets/scatterplotThree.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
dependencies:
- name: jquery
version: 1.12.4
src: "htmlwidgets/lib/jquery"
script: jquery.min.js
- name: threejs
version: 83
src: "htmlwidgets/lib/threejs-83"
Expand Down

1 comment on commit 9b5be2b

@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.