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
define([], function() { | |
return function(update) { | |
var windowAspectRatio = window.innerWidth/window.innerHeight, | |
isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/.test(navigator.userAgent); | |
// console.log(windowAspectRatio); | |
var scrollYAtScan = 0, | |
// screenMeasure = windowAspectRatio < 0.7 && isMobile ? 0.8 : 0.5; // measurement point for page progress - 0.5 = vertical center of the window. |
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
<script> | |
var width = 960, | |
height = 500; | |
var randomX = d3.random.normal(width / 2, 80), | |
randomY = d3.random.normal(height / 2, 80); | |
var data = d3.range(2000).map(function() { | |
return [ |
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
var totalLength = path.node().getTotalLength(); | |
path | |
.attr("stroke-dasharray", totalLength + " " + totalLength) | |
.attr("stroke-dashoffset", totalLength) | |
.transition() | |
.duration(2000) | |
.ease("linear") | |
.attr("stroke-dashoffset", 0); |
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
<!--- HTML AND SVG ---> | |
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" | |
width="340px" height="333px" viewBox="0 0 340 333" enable-background="new 0 0 340 333" xml:space="preserve"> | |
<path class="path" fill="#FFFFFF" stroke="#000000" stroke-width="4" stroke-miterlimit="10" d="M66.039,133.545c0,0-21-57,18-67s49-4,65,8 | |
s30,41,53,27s66,4,58,32s-5,44,18,57s22,46,0,45s-54-40-68-16s-40,88-83,48s11-61-11-80s-79-7-70-41 | |
C46.039,146.545,53.039,128.545,66.039,133.545z"/> | |
</svg> |
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
d3.timer(function() { | |
var angle = velocity * (Date.now() - then); | |
canvas.each(function(i) { | |
var rotate = [0, 0, 0], context = this.getContext("2d"); | |
rotate[i] = angle, projection.rotate(rotate); | |
context.clearRect(0, 0, diameter, diameter); | |
context.beginPath(), path.context(context)(land), context.fill(); | |
context.beginPath(), path(globe), context.stroke(); | |
}); | |
}); |
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
var tickChanger = fl.add(config, "tick") | |
tickChanger.onChange(function(value) { | |
value ? force.start() : force.stop() | |
}) | |
var frictionChanger = fl.add(config, "friction", 0, 1) | |
frictionChanger.onChange(function(value) { | |
force.friction(value) | |
force.start() | |
}) |
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
startup: function() { | |
this.inherited(arguments); | |
NlsStrings.value = this.nls; | |
// summary: | |
// this function will be called when widget is started. | |
// description: | |
// according to webmap or basemap to create LayerInfos instance | |
// and initialize operLayerInfos; | |
// show layers list; | |
// bind events for layerLis; |
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
startup: function() { | |
this.inherited(arguments); | |
NlsStrings.value = this.nls; | |
// summary: | |
// this function will be called when widget is started. | |
// description: | |
// according to webmap or basemap to create LayerInfos instance | |
// and initialize operLayerInfos; | |
// show layers list; | |
// bind events for layerLis; |
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
startup: function() { | |
this.inherited(arguments); | |
NlsStrings.value = this.nls; | |
// summary: | |
// this function will be called when widget is started. | |
// description: | |
// according to webmap or basemap to create LayerInfos instance | |
// and initialize operLayerInfos; | |
// show layers list; | |
// bind events for layerLis; |
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
//begin grouping feature layers for rooms and labels | |
if (this.map.itemId) { | |
LayerInfos.getInstance(this.map, this.map.itemInfo) | |
.then(lang.hitch(this, function(operLayerInfos) { | |
this.operLayerInfos = operLayerInfos; | |
//create feature collections (groups) from feature layers | |
NewerOlder