Skip to content

Instantly share code, notes, and snippets.

@phil-pedruco
phil-pedruco / defaultData.csv
Last active March 8, 2024 21:10
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phil-pedruco
phil-pedruco / index.html
Created August 19, 2014 19:45
Plotting a bell (Gaussian) curve in d3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Normal Plot</title>
<meta name="description" content="">
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style type="text/css">
@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 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
Created October 8, 2013 11:13
Spline Transition together with Static Plot
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
font: 10px sans-serif;
}
.line {
fill: none;
@phil-pedruco
phil-pedruco / 50m.json
Last active October 28, 2019 09:01
Do you know your capitals?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@phil-pedruco
phil-pedruco / index.html
Last active September 9, 2018 12:23
Plotting points on a map in D3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Point on a map D3</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<style type="text/css">
@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>
@phil-pedruco
phil-pedruco / index.html
Last active January 30, 2017 02:04
Click to zoom with table and map in D3
<!DOCTYPE html>
<meta charset="utf-8">
<style>
@import url(mapStyle.css);
</style>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<body>