Skip to content

Instantly share code, notes, and snippets.

@beemyfriend
beemyfriend / index.html
Last active April 20, 2017 17:03
D3 Makeover: Week 1
<head>
<link rel='stylesheet' href='../styles.css'>
<style>
div.tooltip{
position: absolute;
text-align: left;
width: 250px;
height: 90px;
padding: 5px;
font-size: 14px;
@beemyfriend
beemyfriend / index.txt
Last active March 25, 2017 21:12
Fractals With Canvas and D3: Fractal Creater
<body>
<div style = 'position: absolute; top:0px; left:-500px'><canvas id = 'myCanvas' width = '500' height = '500' ></canvas></div>
<div style = 'position: absolute; top:70px; left:10px'><canvas id = 'otherCanvas' width = '500' height = '500'></canvas></div>
<form name = 'createRule' style = 'position: absolute; top:60px; left:520px'>
<br>
<br>
<h3>Create Fractal Rules</h3>
<label id = 'xslabel'>X-Scale: 0.5</label>
<input id = 'xscale' type = 'range' min = '-1' max = '1' step = '.05' value = '.5' onchange="document.getElementById('xslabel').innerHTML = 'X-Scale: ' + this.value;"/>
<br>
@beemyfriend
beemyfriend / index.html
Last active March 21, 2017 19:44
Fractals in D3 and Canvas: Sierpinski Gasket
<body>
<div id = 'sg'></div>
<script src = "https://d3js.org/d3.v4.js"></script>
<script>
var img_width = 400,
img_height = 400;
//create original canvas that will be iterated on
function init(){