-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
9,683 additions
and
0 deletions.
There are no files selected for viewing
729 changes: 729 additions & 0 deletions
729
docs/articles/FAFB-FlyWire_files/CanvasMatrix4-1.0.1/CanvasMatrix.src.js
Large diffs are not rendered by default.
Oops, something went wrong.
901 changes: 901 additions & 0 deletions
901
docs/articles/FAFB-FlyWire_files/htmlwidgets-1.6.1/htmlwidgets.js
Large diffs are not rendered by default.
Oops, something went wrong.
939 changes: 939 additions & 0 deletions
939
docs/articles/FAFB-FlyWire_files/plotly-binding-4.10.1/plotly.js
Large diffs are not rendered by default.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
docs/articles/FAFB-FlyWire_files/plotly-htmlwidgets-css-2.11.1/plotly-htmlwidgets.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
just here so that plotly works | ||
correctly with ioslides. | ||
see https://github.com/ropensci/plotly/issues/463 | ||
*/ | ||
|
||
slide:not(.current) .plotly.html-widget{ | ||
display: none; | ||
} |
69 changes: 69 additions & 0 deletions
69
docs/articles/FAFB-FlyWire_files/plotly-main-2.11.1/plotly-latest.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
79 changes: 79 additions & 0 deletions
79
docs/articles/FAFB-FlyWire_files/rglWebGL-binding-1.0.1/rglWebGL.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* el is the div, holding the rgl object as el.rglinstance, | ||
which holds x as el.rglinstance.scene | ||
x is the JSON encoded rglwidget. | ||
*/ | ||
|
||
|
||
HTMLWidgets.widget({ | ||
|
||
name: 'rglWebGL', | ||
|
||
type: 'output', | ||
|
||
factory: function(el, width, height) { | ||
el.width = width; | ||
el.height = height; | ||
var rgl = new rglwidgetClass(), | ||
onchangeselection = function(e) { | ||
for (var i = 0; i < rgl.scene.crosstalk.sel_handle.length; i++) | ||
rgl.clearBrush(except = e.rglSubsceneId); | ||
rgl.selection(e, false); | ||
}, | ||
onchangefilter = function(e) { | ||
rgl.selection(e, true); | ||
}; | ||
|
||
return { | ||
renderValue: function(x) { | ||
var i, pel, player, groups, | ||
inShiny = (typeof Shiny !== "undefined"); | ||
|
||
x.crosstalk.group = groups = [].concat(x.crosstalk.group); | ||
x.crosstalk.id = [].concat(x.crosstalk.id); | ||
x.crosstalk.key = [].concat(x.crosstalk.key); | ||
x.crosstalk.sel_handle = new Array(groups.length); | ||
x.crosstalk.fil_handle = new Array(groups.length); | ||
x.crosstalk.selection = []; | ||
for (i = 0; i < groups.length; i++) { | ||
x.crosstalk.sel_handle[i] = new crosstalk.SelectionHandle(groups[i], {sharedId: x.crosstalk.id[i]}); | ||
x.crosstalk.sel_handle[i].on("change", onchangeselection); | ||
x.crosstalk.fil_handle[i] = new crosstalk.FilterHandle(groups[i], {sharedId: x.crosstalk.id[i]}); | ||
x.crosstalk.fil_handle[i].on("change", onchangefilter); | ||
} | ||
if (inShiny) { | ||
// Shiny calls this multiple times, so we need extra cleanup | ||
// between | ||
rgl.sphere = undefined; | ||
} | ||
rgl.initialize(el, x); | ||
rgl.initGL(); | ||
|
||
/* We might have been called after (some of) the players were rendered. | ||
We need to make sure we respond to their initial values. */ | ||
|
||
if (typeof x.players !== "undefined") { | ||
var players = [].concat(x.players); | ||
for (i = 0; i < players.length; i++) { | ||
pel = document.getElementById(players[i]); | ||
if (pel) { | ||
player = pel.rglPlayer; | ||
if (player && (!player.initialized || inShiny)) { | ||
rgl.Player(pel, player); | ||
player.initialized = true; | ||
} | ||
} | ||
} | ||
} | ||
rgl.drag = 0; | ||
rgl.drawScene(); | ||
}, | ||
|
||
resize: function(width, height) { | ||
el.width = width; | ||
el.height = height; | ||
el.rglinstance.resize(el); | ||
el.rglinstance.drawScene(); | ||
} | ||
}; | ||
} | ||
}); |
153 changes: 153 additions & 0 deletions
153
docs/articles/FAFB-FlyWire_files/rglwidgetClass-1.0.1/animation.src.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
/** | ||
* Methods related to animations | ||
* @name ___METHODS_FOR_ANIMATION___ | ||
* @memberof rglwidgetClass | ||
* @kind function | ||
* @instance | ||
*/ | ||
/** | ||
* Binary search | ||
* @param x - x coordinates in increasing order | ||
* @param newx - value to find, assumed to be in the range of x | ||
* @result index of largest x value below newx | ||
*/ | ||
rglwidgetClass.bisect = function(x, newx) { | ||
var lo = 0, hi = x.length - 1, mid; | ||
while (lo < hi - 1) { | ||
mid = Math.round((lo + hi)/2); | ||
if (x[mid] < newx) | ||
lo = mid; | ||
else | ||
hi = mid; | ||
} | ||
return lo; | ||
}; | ||
|
||
/** | ||
* Step interpolation (constant outside bounds) | ||
* @param x - x coordinates in increasing order | ||
* @param v - values at x; either a vector or matrix | ||
* @param newx - value at which to evaluate | ||
*/ | ||
rglwidgetClass.step = function(x, v, newx) { | ||
var n, lo; | ||
if (newx <= x[0]) | ||
return v[0]; | ||
n = x.length; | ||
if (newx >= x[n-1]) | ||
return v[n-1]; | ||
lo = this.bisect(x, newx); | ||
return v[lo]; | ||
}; | ||
|
||
/** | ||
* Linear interpolation (constant outside bounds) | ||
* @param x - x coordinates in increasing order | ||
* @param v - values at x; either a vector or matrix | ||
* @param newx - value at which to evaluate | ||
*/ | ||
rglwidgetClass.lerp = function(x, v, newx) { | ||
var i, n, lo, hi, alpha, result; | ||
if (newx <= x[0]) | ||
return v[0]; | ||
n = x.length; | ||
if (newx >= x[n-1]) | ||
return v[n-1]; | ||
lo = this.bisect(x, newx); | ||
if (newx === x[lo]) | ||
return v[lo]; | ||
hi = lo + 1; | ||
if (newx === x[hi]) | ||
return v[hi]; | ||
alpha = (newx - x[lo])/(x[hi] - x[lo]); | ||
result = v[lo]; | ||
n = result.length; | ||
if (typeof n !== "undefined") { | ||
for (i = 0; i < n; i++) | ||
result[i] = (1 - alpha)*result[i] + alpha*v[hi][i]; | ||
} else | ||
result = (1 - alpha)*result + alpha*v[hi]; | ||
return result; | ||
}; | ||
|
||
/** | ||
* Spherical linear interpolation (constant outside bounds) | ||
* @param x - x coordinates in increasing order | ||
* @param v - a matrix of unit quaternions | ||
* @param newx - value at which to evaluate | ||
*/ | ||
rglwidgetClass.slerp = function(x, v, newx) { | ||
var n, lo, hi, alpha, result, | ||
p0, p1, dot, Omega, alpha0, alpha1, len; | ||
if (newx <= x[0]) | ||
return v[0]; | ||
if (newx >= x[n-1]) | ||
return v[n-1]; | ||
lo = this.bisect(x, newx); | ||
if (newx === x[lo]) | ||
return v[lo]; | ||
hi = lo + 1; | ||
if (newx === x[hi]) | ||
return v[hi]; | ||
p0 = v[lo]; | ||
p1 = v[hi]; | ||
dot = p0[0]*p1[0] + | ||
p0[1]*p1[1] + | ||
p0[2]*p1[2] + | ||
p0[3]*p1[3]; | ||
if (dot < 0) { | ||
p1 = [-p1[0], -p1[1], -p1[2], -p1[3]]; | ||
dot = -dot; | ||
} | ||
if (dot >= 1) | ||
result = p1; | ||
else { | ||
alpha = (newx - x[lo])/(x[hi] - x[lo]); | ||
Omega = Math.acos(dot); | ||
alpha0 = Math.sin((1 - alpha)*Omega); | ||
alpha1 = Math.sin(alpha*Omega); | ||
result = [alpha0*p0[0] + alpha1*p1[0], | ||
alpha0*p0[1] + alpha1*p1[1], | ||
alpha0*p0[2] + alpha1*p1[2], | ||
alpha0*p0[3] + alpha1*p1[3]]; | ||
} | ||
len = Math.sqrt(result[0]*result[0] + | ||
result[1]*result[1] + | ||
result[2]*result[2] + | ||
result[3]*result[3]); | ||
return [result[0]/len, | ||
result[1]/len, | ||
result[2]/len, | ||
result[3]/len]; | ||
}; | ||
|
||
/** | ||
* Rotate using unit quaternion | ||
* @param q - a single unit quaternion | ||
*/ | ||
rglwidgetClass.rotateByQuaternion = function(M, q) { | ||
|
||
var xx = q[0]*q[0], | ||
xy = q[0]*q[1], | ||
xz = q[0]*q[2], | ||
xw = q[0]*q[3], | ||
yy = q[1]*q[1], | ||
yz = q[1]*q[2], | ||
yw = q[1]*q[3], | ||
zz = q[2]*q[2], | ||
zw = q[2]*q[3], | ||
matrix = new CanvasMatrix4(); | ||
matrix.m11 = 1 - 2*(yy + zz); | ||
matrix.m12 = 2*(xy + zw); | ||
matrix.m13 = 2*(xz - yw); | ||
|
||
matrix.m21 = 2*(xy - zw); | ||
matrix.m22 = 1 - 2*(xx + zz); | ||
matrix.m23 = 2*(yz + xw); | ||
|
||
matrix.m31 = 2*(xz + yw); | ||
matrix.m32 = 2*(yz - xw); | ||
matrix.m33 = 1 - 2*(xx + yy); | ||
|
||
M.multRight(matrix); | ||
}; |
Oops, something went wrong.