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
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
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
<!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; |
Solution for a question on stackoverflow
code forked from a Mike Bostock example gist
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.
<!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"] |