Skip to content

Instantly share code, notes, and snippets.

@phil-pedruco
phil-pedruco / index.html
Last active January 16, 2020 13:43
Shopping Center Layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Shopping Mall Messing</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
@phil-pedruco
phil-pedruco / index.html
Last active August 29, 2015 13:56
Map of the Netherlands
<!DOCTYPE html>
<meta charset="utf-8">
<style>
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
var width = 960,
@phil-pedruco
phil-pedruco / data.csv
Last active August 29, 2015 13:57
Simple Line Chart
first second
2 2
3 3
4 4
5 4
5.5 5
6 6
6 7
6.5 8
6.5 16
@phil-pedruco
phil-pedruco / defaultData.csv
Last active May 31, 2024 17:29
3D Scatter Plot Using three.js
x y z lp_x lp_y lp_z hp_x hp_y hp_z
0.235458 -0.597702 -0.724487 0.232433 -0.593757 -0.717156 0.003025 -0.003945 -0.007332
0.235458 -0.597702 -0.724487 0.232735 -0.594152 -0.717889 0.002723 -0.003550 -0.006598
0.217346 -0.597702 -0.724487 0.231197 -0.594507 -0.718549 -0.013850 -0.003195 -0.005939
0.217346 -0.579590 -0.724487 0.229812 -0.593015 -0.719143 -0.012465 0.013425 -0.005345
0.199234 -0.579590 -0.724487 0.226754 -0.591673 -0.719677 -0.027520 0.012083 -0.004810
0.199234 -0.597702 -0.760712 0.224002 -0.592276 -0.723781 -0.024768 -0.005426 -0.036931
0.163010 -0.579590 -0.706375 0.217903 -0.591007 -0.722040 -0.054893 0.011417 0.015665
0.108673 -0.597702 -0.724487 0.206980 -0.591676 -0.722285 -0.098307 -0.006026 -0.002203
0.090561 -0.615814 -0.724487 0.195338 -0.594090 -0.722505 -0.104777 -0.021724 -0.001982
@phil-pedruco
phil-pedruco / data.csv
Last active April 1, 2021 14:14
3D Scatterplot with csv upload
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 9 columns, instead of 8. in line 7.
"V1","V2","V3","V4","V5","V6","V7","V8","V9"
"x1a","y1","z1","x2","y2","z2","x3","y3","z3"
-1.3491290435195,10.1059510260448,-0.411264965906754,-1.21421613916755,6.06357061562689,0.911515840683922,-2.02369356527925,14.1483314364628,-0.451187952584759
1.67610622942448,-28.2861370876445,0.50256601859036,1.50849560648203,-16.9716822525867,0.864538834846784,2.51415934413671,-39.6005919227022,0.581311097123157
1.02121502161026,43.936226125781,0.315348776470193,0.919093519449234,26.3617356754686,0.948975842252453,1.53182253241539,61.5107165760934,0.332304324756775
-4.41415354143828,-37.6643429680954,-0.983110722246539,-3.97273818729445,-22.5986057808573,0.183011769577503,-6.62123031215742,-52.7300801553336,-5.37184425087046
7.45797323063016,16.3056215847584,0.716380879596842,6.71217590756714,9.78337295085503,-0.697709420423757,11.1869598459452,22.8278702186617,-1.02676108223069
-6.40974662732333,-13.3321990741625,-0.903519079437189,-5.768771964591,-7.99931944449751,-0.428547865579768,-9.61461994098499,-18.665078703
@phil-pedruco
phil-pedruco / index.html
Last active February 7, 2017 08:30
Contours of Nepal using topojson and d3.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Nepal Topographic Contours</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="http://d3js.org/topojson.v1.min.js"></script>
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 5 columns, instead of 6. in line 3.
Date First Second Third Fourth
1917 14.3 2.8 11.7 11.2
1918 11.5 1.3 11.6 11.2
1919 13.2 1.1 9.8 9.9
1920 12.1 1.2 8.3 9.6
1921 13.4 2.1 8.4 10.6
1922 14.2 2 9.8 11.7
1923 13.4 1.9 9.1 10.9
1924 14.5 2.3 10.4 11.1
1925 15.8 3.1 14.2 12.2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Channel Velocity Conversion Value
Banner Ads 116.282838326879 0.0777953412150964 2586.09978249297
Email 110.74304234935 0.0529536268208176 3761.50209223852
Search 124.261170288082 0.0693502774462104 6119.40218368545
Events 23.7619550898671 0.0889248474035412 5757.40572996438
Social 121.343896351755 0.0824868025956675 5425.63441209495
Content Syndication 36.7841859231703 0.0890633624512702 2396.92708943039
Nurture 30.726479308214 0.0241480510216206 6321.72799669206
Sponsorship 55.1225619041361 0.0389538716059178 5938.49707627669
Display 143.331882997882 0.00218722021672875 8178.07669518515
/*! @license Copyright 2011 Dan Vanderkam (danvdk@gmail.com) MIT-licensed (http://opensource.org/licenses/MIT) */
Date.ext={};Date.ext.util={};Date.ext.util.xPad=function(a,c,b){if(typeof(b)=="undefined"){b=10}for(;parseInt(a,10)<b&&b>1;b/=10){a=c.toString()+a}return a.toString()};Date.prototype.locale="en-GB";if(document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang){Date.prototype.locale=document.getElementsByTagName("html")[0].lang}Date.ext.locales={};Date.ext.locales.en={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%T"};Date.ext.locales["en-US"]=Date.ext.locales.en;Date.ext.locales["en-US"].c="%a %d %b %Y %r %Z";Date.ext.locales["en-US"].x="%D";Date.