Skip to content

Instantly share code, notes, and snippets.

@steveharoz
steveharoz / .block
Last active April 10, 2024 07:11 — forked from mbostock/.block
d3-force testing ground
license: gpl-3.0
height: 1030
scrolling: yes
@cmpolis
cmpolis / .block
Last active September 20, 2016 08:44
Scatterplot with d3-annotate
license: gpl-3.0
@emeeks
emeeks / d3-force.js
Created September 16, 2016 17:03
Working Rectangular Collide
// https://d3js.org/d3-force/ Version 1.0.0. Copyright 2016 Mike Bostock.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-quadtree'), require('d3-collection'), require('d3-dispatch'), require('d3-timer')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3-quadtree', 'd3-collection', 'd3-dispatch', 'd3-timer'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3,global.d3));
}(this, function (exports,d3Quadtree,d3Collection,d3Dispatch,d3Timer) { 'use strict';
function center(x, y) {
var nodes;
@d3noob
d3noob / index.html
Last active August 7, 2021 01:06
Sankey Diagram with v4
<!DOCTYPE html>
<meta charset="utf-8">
<title>SANKEY Experiment</title>
<style>
.node rect {
cursor: move;
fill-opacity: .9;
shape-rendering: crispEdges;
}
@wjmazza
wjmazza / google-sheets-colour-preview.js
Last active April 19, 2024 06:15 — forked from Pathoschild/google-sheets-color-preview.js
A Google Sheets script which adds colour preview to cells. When you edit a cell containing a valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to that colour and the font colour will be changed to the inverse colour for readability.
/*
This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a
valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to
that colour and the font colour will be changed to the inverse colour for readability.
To use this script in a Google Sheets spreadsheet:
1. go to Tools » Script Editor » Spreadsheet;
2. erase everything in the text editor;
3. change the title to "Set colour preview on edit";
@veltman
veltman / README.md
Last active October 28, 2019 10:45
Strip map

Version with labels

Creating an automatic strip map based on some geographic features and a chosen "spine." The approximate steps:

  1. Pick a LineString (e.g. the California coast) to straighten out.
  2. Simplify that LineString.
  3. Turn that simplified LineString into a set of zones, one per segment.
  4. Rotate/translate each zone to its destination position, anchoring it to the end of the previous segment and rotating it to match the desired angle (e.g. horizontal).
  5. Warp the contents of each zone to the resulting rectangle with a bilinear warp.
@susielu
susielu / README.md
Last active October 10, 2023 14:26
Radar Plot Annual Temperature

Radar Plot Example

In the example we're looking at historical weather data for San Francisco provided by intellicast.com.

@emeeks
emeeks / firm.csv
Last active March 17, 2016 02:08
Modularity Mini-Map
source target weight
1 3 5
1 8 3
1 9 3
1 12 3
1 15 2
1 23 3
1 26 2
1 37 2
1 46 2
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 26, 2024 17:22
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}