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 svg = d3.select("#chart1") | |
.append('div') | |
.classed('svg-container', true) | |
.append('svg') | |
.attr("preserveAspectRatio", "xMinYMin meet") | |
.attr("viewBox", `0 0 ${width} ${height}`) | |
.classed('svg-content-responsive', true) | |
.style("background-color", svgBackgroundColor) | |
.append("g") | |
.attr('transform', `translate(${margin.left}, ${margin.top})`); |
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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v6.min.js"></script> | |
</head> | |
<body> | |
<div id="chart"></div> | |
</body> |
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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
</head> | |
<body> | |
<div id="chart"></div> | |
</body> |
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
function rectCollide() { | |
var nodes,sizes,masses; | |
var strength = 1; | |
var iterations = 1; | |
var nodeCenterX; | |
var nodeMass; | |
var nodeCenterY; | |
function force() { |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<html> | |
<head> | |
<script src="http://d3js.org/d3.v4.js"></script> | |
</head> | |
<body> | |
<div id='grid-container'> | |
<div id='grid-chart'></div> |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<html> | |
<head> | |
<script src="http://d3js.org/d3.v4.js"></script> | |
</head> | |
<body> | |
<div id='grid-container'> | |
<div id='grid-chart'></div> |
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
import random | |
m =[[2,3,3,3,3,3,4,4,4,4,4,4], | |
[2,3,3,3,3,3,4,4,4,4,4,4], | |
[3,3,3,1,3,3,4,1,4,4,0,4], | |
[3,3,1,1,1,3,1,1,1,4,4,4], | |
[3,1,1,1,1,1,1,1,1,1,4,4], | |
[3,1,1,0,0,0,0,0,1,1,4,4], | |
[3,1,1,0,0,0,0,0,1,1,4,4], | |
[2,1,1,1,1,0,0,0,1,1,2,2], |
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
import random | |
from PIL import Image | |
""" | |
Implements the flood fill algorithm in Python with depth-first search. | |
Inputs: | |
-image file | |
-new image file to write the new image to | |
-threshold for the color matching |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<html> | |
<head> | |
<script src="http://d3js.org/d3.v4.js"></script> | |
<link href="https://fonts.googleapis.com/css?family=Kanit:400,700&display=swap" rel="stylesheet"> | |
</head> | |
<body> | |
<div id='tgif-container'> | |
<div id="tgif-chart"></div> |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<html> | |
<head> | |
<script src="http://d3js.org/d3.v4.js"></script> | |
<link href="https://fonts.googleapis.com/css?family=Assistant&display=swap" rel="stylesheet"> | |
</head> | |
<body> | |
<div id="chart"></div> |