Skip to content

Instantly share code, notes, and snippets.

View AndrewStaroscik's full-sized avatar

Andrew Staroscik AndrewStaroscik

View GitHub Profile
@AndrewStaroscik
AndrewStaroscik / index.html
Last active March 3, 2016 16:56 — forked from katsumitakano/index.html
D3.js Easing Checker
<!doctype html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Easing Test</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<script>
var dataset = ["linear", "quad", "cubic", "sin", "exp", "exp-in", "exp-out", "exp-in-out", "circle", "elastic", "back", "bounce"]
@AndrewStaroscik
AndrewStaroscik / README.md
Last active November 29, 2015 20:41 — forked from mbostock/.block
Wave Motion

A modification of Mike Bostock's recreation of the wave GIF by Dave Whyte.

This version is more representative of the motion seen in surface waves.

Maximum motion occurs at the surface (the top row of circles) and decreases with distance from the surface.

More here

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<style type="text/css">
#line{
width: 700px;
margin: 20px 0;
height: 300px;
background: #eee;

This example demonstrates how to create a gradient that follows a stroke. This technique is sometimes used to indicate directionality along a curved edge, such as with hierarchical edge bundling.

To start, take any SVG path element and uniformly sample points along the path using getPointAtLength. (This method can also be used for path tweening.) Then, for each segment between adjacent points, compute the miter joint via line-line intersection. Lastly fill each segment by interpolating the start and end colors, here green to red, using the normalized length t along the path. Although each segment is a constant color, there are many segments to give the appearance of a continuous gradient.

This example uses a thin stroke in addition to filling the segments. This avoids antialiasing artifacts due to most

@AndrewStaroscik
AndrewStaroscik / README.md
Last active December 13, 2015 23:59 — forked from mbostock/.block

Forked from bl.ocks.org/mbostock/3037015 to show how a click event can be used to change the content of a div using jQuery

Click on the atoms to see the name and atomic weight