An example of the d3.geom.contour plugin.
function formatJSONTime(jsonTime){ | |
var matches = jsonTime.match(/date\((\d{13})\)/), | |
date = matches !== null ? formatTime(new Date(+matches[0])) : +new Date(); | |
return date; | |
} |
function formatTime(e) | |
{ | |
var _hour = e.getHours(), | |
_min = e.getMinutes(), | |
_ampm = +_hour >= 12 ? " PM" : " AM", | |
_nice_hour = ((+_hour % 12)+"").replace(/^0$/, "12"); | |
return _nice_hour + ":" + _min + _ampm; | |
} |
function IsNumeric(e) | |
return Object.prototype.toString.call(e) == '[object Number]'; | |
} |
function formatCurrency(amount) | |
{ | |
var i = parseFloat(amount); | |
if (isNaN(i)) { i = 0.00; } | |
var minus = ''; | |
if (i < 0) { minus = '-'; } | |
i = Math.abs(i); | |
i = parseInt((i + 0.005) * 100, 10); | |
i = i / 100; | |
s = ''; |
#ifdef GL_ES | |
precision highp float; | |
#endif | |
#define M_PI 3.14159265358979323846 /* pi */ | |
// General parameters | |
uniform sampler2D from; | |
uniform sampler2D to; | |
uniform float progress; |
#ifdef GL_ES | |
precision highp float; | |
#endif | |
// General parameters | |
uniform sampler2D from; | |
uniform sampler2D to; | |
uniform float progress; | |
uniform vec2 resolution; | |
#ifdef GL_ES | |
precision highp float; | |
#endif | |
uniform sampler2D from, to; | |
uniform float progress; | |
uniform vec2 resolution; | |
float snoise(vec3 uv, float res) // by trisomie21 | |
{ | |
const vec3 s = vec3(1e0, 1e2, 1e4); |
$(function() { | |
// good opportunity to combine into a single statement | |
// qq w cw <esc> A, <esc> 0 j q | |
var a = 10; | |
var b = 20; | |
var c = 30; | |
var d = 40; | |
var e = 50; | |
// opportunity to simplify syntax |
Interesting part (unmounting & API) is at the end if you're not interested in the rest =).
This animation proposal is just an attempt. In case it doesn't work out, I've gathered a few examples that can test the power of a future animation system.
-
Parent is an infinitely spinning ball, and has a child ball that is also spinning. Clicking on the parent causes child to reverse spinning direction. This tests the ability of the animation system to compose animation, not in the sense of applying multiple interpolations to one or more variables passed onto the child (this should be trivial), but in the sense that the parent's constantly updating at the same time as the child, and has to ensure that it passes the animation commands correctly to it. This also tests that we can still intercept these animations (the clicking) and immediately change their configuration instead of queueing them.
-
Typing letters and let them fly in concurrently. This tests concurrency, coordination of an array of ch