Platform
Resources
Pricing
Sign in
Contact us
Fil
Vocateur.
Workspace
Fork
Published
2 collections
By
Fil
Edited
Aug 31, 2019
Fork of
Modified Shepard’s method
1 star
Tricontours
Tricontour labels
Tricontours
Hexagotriangulation
Spherical contours
Manhattan Voronoi II
Graph Voronoi
H3 oddities
H3 hexagons & geoContours
d3-hexbin & tricontours heatmap
Tricontour iterator
Volcano Tricontours
Blurry contours
Spherical contours iterator
Spherical contours as a gradient
Reusing a Tricontour triangulation
Modified Shepard’s method II (with geoContour)
Mapfill
Spherical isobands
Planar tricontours on geo data (bad!)
Tricontour flower
UK Tricontours
Tricontour isobands
Also listed in…
Interpolation
Insert cell
Insert cell
mapfillContours
(
d
=>
interpolate
(
d
,
sources
)
,
d3
.
geoAirocean
(
)
,
{
// N: 10000,
// color,
thresholds
:
40
,
graticule
:
land
}
)
Insert cell
Insert cell
Insert cell
nn
=
100
// in this case nn is high; the limiting factor being R
Insert cell
R
=
0.1
// geoDistances are in radians
Insert cell
color
=
d3
.
scaleSequential
(
d3
.
interpolatePRGn
)
.
domain
(
[
-
1
,
1
]
)
Insert cell
function
interpolate
(
p
,
sources
)
{
let
value
=
0
,
weight
=
0
;
tree
.
nearest
(
cartesian
(
[
p
[
0
]
*
radians
,
p
[
1
]
*
radians
]
)
,
nn
,
R
)
.
forEach
(
(
[
q
,
dist
]
)
=>
{
const
k
=
kernel
(
dist
)
;
value
+=
k
*
q
[
3
]
;
weight
+=
k
;
}
)
;
return
weight
?
value
/
weight
:
0
;
}
Insert cell
function
kernel
(
dist
)
{
return
Math
.
pow
(
dist
,
-
P
)
;
}
Insert cell
sources
=
Array
.
from
(
{
length
:
5000
}
,
(
)
=>
{
const
lon
=
360
*
(
Math
.
random
(
)
-
0.5
)
,
lat
=
90
*
(
Math
.
random
(
)
-
Math
.
random
(
)
)
,
t
=
(
d3
.
geoContains
(
land
,
[
lon
,
lat
]
)
?
1
:
-
1
)
*
(
0.3
+
Math
.
random
(
)
)
;
return
[
lon
,
lat
,
t
]
;
}
)
Insert cell
import
{
mapfill
,
mapfillContours
}
from
"@fil/mapfill"
Insert cell
d3
=
require
(
"d3@5"
,
"d3-geo-polygon@1"
)
Insert cell
kd
=
require
(
"kd-tree-javascript"
)
Insert cell
distance
=
(
a
,
b
)
=>
Math
.
hypot
(
a
[
0
]
-
b
[
0
]
,
a
[
1
]
-
b
[
1
]
,
a
[
2
]
-
b
[
2
]
)
// d3.geoDistance
Insert cell
tree
=
new
kd
.
kdTree
(
sources
.
map
(
d
=>
[
...
cartesian
(
[
d
[
0
]
*
radians
,
d
[
1
]
*
radians
]
)
,
d
[
2
]
]
)
,
distance
,
[
0
,
1
,
2
]
)
Insert cell
land
=
d3
.
json
(
"https://unpkg.com/visionscarto-world-atlas@0.0.6/world/110m_land.geojson"
)
Insert cell
import
{
slider
}
from
"@jashkenas/inputs"
Insert cell
import
{
cartesian
}
from
"@fil/cartesian"
Insert cell
import
{
radians
}
from
"@fil/math"
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Compare fork
Fork
View
Export
Listed in...
Tricontours
Fil
Interpolation
Fil
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
P
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
nn
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
R
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
color
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
interpolate
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
kernel
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
sources
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
kd
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
distance
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
tree
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
land
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML