template for showcasing interactive visualizations via blog posts.
- implemented as a standalone JavaScript function called viz_blog().
- accepts a list of iframe URLs in array format and binds them to the existing DIV elements containing
data-type="true"
metadata (i.e. "key divs"). - issues a console log statement if the number of URLs does not match the number DIVs.
algorithm design is summarized below:
- each visualization is loaded as an iframe
- horizontal line halfway down the window is used to measure the distances of each key div
- current visualization starts fading out each when the nearest-neighboring visualization is within
dTol = 0.3 * windowHeight
pixels of the center-line - current visualization finishes fading out as soon as the nearest-neighboring visualization is within
dcut = 0.1 * windowHeight
pixels of the center-line - current visualization opacity is updated each time the page is scrolled.
- these parameters are hard-coded for now, and there is also a new concept of a "center line" which is also hard-coded for now.
- new visualizations are loaded at 100% opacity, allowing them to execute their normal "onload" event(s).