Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Dumb Model</title>
<script src="https://d3js.org/d3.v4.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
@MariosRichards
MariosRichards / force.css
Last active October 26, 2024 14:17
2d Hotelling Downs Interactive Model
path.link {
fill: none;
stroke: #666;
stroke-width: 1.5px;
}
circle {
fill: #ccc;
stroke: #fff;
stroke-width: 1.5px;
@MariosRichards
MariosRichards / index.html
Last active January 7, 2020 15:07
2015 Parliament MPs divided automatically by voting behaviour
<style>
</style>
<div id="fig_el1207046588700004430085474"></div>
<script>
function mpld3_load_lib(url, callback){
var s = document.createElement('script');
@MariosRichards
MariosRichards / grid2.js
Last active January 6, 2020 14:00
Hotelling-Downs
function gridData(granularity) {
var data = new Array();
var xpos = 1; //starting xpos and ypos at 1 so the stroke will show when we make the grid below
var ypos = 1;
for(var cell = 0; cell < granularity * granularity; cell++) {
data.push( {
id: cell,
color: '#ffffff',
xpos: cell % granularity,
@MariosRichards
MariosRichards / force.css
Created January 2, 2017 20:09
Man 2017 Bayesian Belief Network
path.link {
fill: none;
stroke: #666;
stroke-width: 1.5px;
}
circle {
fill: #ccc;
stroke: #fff;
stroke-width: 1.5px;
@MariosRichards
MariosRichards / force.css
Last active December 28, 2016 16:06
British Election Study dataset as a (thresholded) Bayesian Belief Network (displayed as force-directed digraph)
path.link {
fill: none;
stroke: #666;
stroke-width: 1.5px;
}
circle {
fill: #ccc;
stroke: #fff;
stroke-width: 1.5px;
@MariosRichards
MariosRichards / .block
Created August 22, 2016 11:26 — forked from mbostock/.block
Spermatozoa
license: gpl-3.0