Skip to content

Instantly share code, notes, and snippets.

<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">.lst-kix_ltk9e9jr8w77-0>li:before{content:"\0025cf "}.lst-kix_ltk9e9jr8w77-1>li:before{content:"\0025cb "}ul.lst-kix_ozbimzt2zbqm-5{list-style-type:none}ul.lst-kix_ozbimzt2zbqm-4{list-style-type:none}ul.lst-kix_hjjcnlx2j62y-8{list-style-type:none}ul.lst-kix_ozbimzt2zbqm-7{list-style-type:none}ul.lst-kix_hjjcnlx2j62y-7{list-style-type:none}ul.lst-kix_ozbimzt2zbqm-6{list-style-type:none}ul.lst-kix_hjjcnlx2j62y-6{list-style-type:none}ul.lst-kix_ozbimzt2zbqm-1{list-style-type:none}ul.lst-kix_hjjcnlx2j62y-5{list-style-type:none}ul.lst-kix_ozbimzt2zbqm-0{list-style-type:none}.lst-kix_ltk9e9jr8w77-2>li:before{content:"\0025a0 "}ul.lst-kix_hjjcnlx2j62y-4{list-style-type:none}ul.lst-kix_ozbimzt2zbqm-3{list-style-type:none}ul.lst-kix_hjjcnlx2j62y-3{list-style-type:none}ul.lst-kix_ozbimzt2zbqm-2{list-style-type:none}.lst-kix_ltk9e9jr8w77-5>li:before{content:"\0025a0 "}ul.lst-kix_hjjcnlx2j62y-2{list-style-type:none}u
@RobinfWu
RobinfWu / d3-lasso.min.js
Last active October 10, 2018 13:43
Visualizing Bon Voyage
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-selection"),require("d3-drag")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-drag"],n):n(t.d3=t.d3||{},t.d3,t.d3)}(this,function(t,n,r){"use strict";function e(t,n){return n={exports:{}},t(n,n.exports),n.exports}function o(){function t(t){function u(){p=[],h="",_.attr("d",null),m.attr("d",null),r.nodes().forEach(function(t){t.__lasso.possible=!1,t.__lasso.selected=!1,t.__lasso.hoverSelect=!1,t.__lasso.loopSelect=!1;var n=t.getBoundingClientRect();t.__lasso.lassoPoint=[Math.round(n.left+n.width/2),Math.round(n.top+n.height/2)]}),s&&r.on("mouseover.lasso",function(){this.__lasso.hoverSelect=!0}),i.start()}function l(){var t,n;"touchmove"===d3.event.sourceEvent.type?(t=d3.event.sourceEvent.touches[0].clientX,n=d3.event.sourceEvent.touches[0].clientY):(t=d3.event.sourceEvent.clientX,n=d3.event.sourceEvent.clientY);var s=d3.mouse(this)[0],u=d3.mouse(this)[1];""===h?(h=h+"M "+s+" "+u,v=[t,n],d=[s,
@RobinfWu
RobinfWu / d3.layout.cloud.js
Last active May 3, 2018 21:15
Text Visualizations
// Word cloud layout by Jason Davies, https://www.jasondavies.com/wordcloud/
// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g=(g.d3||(g.d3 = {}));g=(g.layout||(g.layout = {}));g.cloud = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[fun
@RobinfWu
RobinfWu / d3-lasso.min.js
Last active April 21, 2018 02:14
One Piece Graph + Scatterplot
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-selection"),require("d3-drag")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-drag"],n):n(t.d3=t.d3||{},t.d3,t.d3)}(this,function(t,n,r){"use strict";function e(t,n){return n={exports:{}},t(n,n.exports),n.exports}function o(){function t(t){function u(){p=[],h="",_.attr("d",null),m.attr("d",null),r.nodes().forEach(function(t){t.__lasso.possible=!1,t.__lasso.selected=!1,t.__lasso.hoverSelect=!1,t.__lasso.loopSelect=!1;var n=t.getBoundingClientRect();t.__lasso.lassoPoint=[Math.round(n.left+n.width/2),Math.round(n.top+n.height/2)]}),s&&r.on("mouseover.lasso",function(){this.__lasso.hoverSelect=!0}),i.start()}function l(){var t,n;"touchmove"===d3.event.sourceEvent.type?(t=d3.event.sourceEvent.touches[0].clientX,n=d3.event.sourceEvent.touches[0].clientY):(t=d3.event.sourceEvent.clientX,n=d3.event.sourceEvent.clientY);var s=d3.mouse(this)[0],u=d3.mouse(this)[1];""===h?(h=h+"M "+s+" "+u,v=[t,n],d=[s,
@RobinfWu
RobinfWu / index.html
Last active April 7, 2018 03:43
Calender View
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
background: lightgrey;
}
#calendar {
margin: 50px;
}
.month {
@RobinfWu
RobinfWu / index.html
Last active April 7, 2018 03:44
Time Series Line Chart
<!DOCTYPE html>
<meta charset="utf-8">
<style> /* set the CSS */
svg {
background: lightgrey;
display: block;
margin: auto;
}
.axis-label
{
@RobinfWu
RobinfWu / index.html
Last active March 19, 2018 01:23
Visualization of WiFi Hotspots in New York
<html>
<head>
<title>A D3 map</title>
<script src="http://d3js.org/d3.v4.min.js" charset="utf-8"></script>
<script src="https://cdn.rawgit.com/BlacKitten/Coursera/master/NYC%20Wi-Fi%20Hotspot%20Locations.js"></script>
<script src="https://cdn.rawgit.com/BlacKitten/Coursera/master/Borough%20Boundaries.js"></script>
<script src="https://d3js.org/d3-zoom.v1.min.js"></script>
<style>
svg {
background: Bisque;
@RobinfWu
RobinfWu / Pokemon.csv
Last active February 18, 2018 23:48
Homework 2: Visualizing Pokemon
# Name Type 1 Type 2 Total HP Attack Defense Sp. Atk Sp. Def Speed Generation Legendary
1 Bulbasaur Grass Poison 318 45 49 49 65 65 45 1 FALSE
2 Ivysaur Grass Poison 405 60 62 63 80 80 60 1 FALSE
3 Venusaur Grass Poison 525 80 82 83 100 100 80 1 FALSE
3 Venusaur Mega Venusaur Grass Poison 625 80 100 123 122 120 80 1 FALSE
4 Charmander Fire 309 39 52 43 60 50 65 1 FALSE
5 Charmeleon Fire 405 58 64 58 80 65 80 1 FALSE
6 Charizard Fire Flying 534 78 84 78 109 85 100 1 FALSE
6 CharizardMega Charizard X Fire Dragon 634 78 130 111 130 85 100 1 FALSE
6 CharizardMega Charizard Y Fire Flying 634 78 104 78 159 115 100 1 FALSE
@RobinfWu
RobinfWu / X-Poinz.csv
Last active February 4, 2018 17:37
Bon Voyage Visualization
Spent Xpz Total Xpz Name Affiliation Devil Fruit Race Gender FiSt Class Link
0 6750 Pluto Revo Zoan Human M 5 A
3850 4305 Syphalia Minalion Pirate None Human F 4 B http://strawhatforum.proboards.com/thread/24842/syph-firefly
4150 4220 Scarlette Grimm-Rosa Pirate Paramecia Human F 3 C http://strawhatforum.proboards.com/thread/24812/grimm-rosa-scarlette
1700 2131 Kano Toro Pirate Paramecia Human M 3 C http://strawhatforum.proboards.com/thread/24846/kano-wild-spark
225 300 Kenro Sordan None None Human M 1 E
525 800 Balenciaga Sapphira Pirate None Hybrid F 2 D
300 300 Red Hihiro Cook Paramecia Human M 1 E http://strawhatforum.proboards.com/thread/24758/red-hihiro-new-template
150 300 Pierrot Marceline None Human F 1 E http://strawhatforum.proboards.com/thread/24765/pierrot-marceline
800 800 Whitaker Bryony Revo Zoan Human F 2 D http://strawhatforum.proboards.com/thread/24802/whitaker-bryony
@RobinfWu
RobinfWu / Pokemon.csv
Last active February 3, 2018 23:47
Scatterplot of Pokemon Stats
# Name Type 1 Type 2 Total HP Attack Defense Sp. Atk Sp. Def Speed Generation Legendary
1 Bulbasaur Grass Poison 318 45 49 49 65 65 45 1 False
2 Ivysaur Grass Poison 405 60 62 63 80 80 60 1 False
3 Venusaur Grass Poison 525 80 82 83 100 100 80 1 False
3 VenusaurMega Venusaur Grass Poison 625 80 100 123 122 120 80 1 False
4 Charmander Fire 309 39 52 43 60 50 65 1 False
5 Charmeleon Fire 405 58 64 58 80 65 80 1 False
6 Charizard Fire Flying 534 78 84 78 109 85 100 1 False
6 CharizardMega Charizard X Fire Dragon 634 78 130 111 130 85 100 1 False
6 CharizardMega Charizard Y Fire Flying 634 78 104 78 159 115 100 1 False