Skip to content

Instantly share code, notes, and snippets.

View rveciana's full-sized avatar
🐢

Roger Veciana i Rovira rveciana

🐢
View GitHub Profile
@rveciana
rveciana / README.md
Last active September 23, 2016 21:51
geoAlbersUsaTerritories example

This file shows how to use the geoAlbersUsaTerritories projection from d3-composite-projections.

To change the file, edit draw.js and run

browserify draw.js > bundle.js

The dependencies are installed with:

npm install d3-composite-projections d3-geo d3-request d3-selection d3-transition topojson

@rveciana
rveciana / .gistup
Last active September 12, 2016 08:07
Comparing two topojson for the congressional districts
gistup
@rveciana
rveciana / README.md
Last active September 9, 2016 20:25
Testing AlbersUsa with all territories

Testing the new albsersUsaTerritories projection, which includes all the territories represented in US Congress:

  • American Samoa
  • Guam
  • Northern Mariana Islands
  • Puerto Rico
  • U.S. Virgin Islands

The next d3-composite-projections will include it.

The idea was by Micah Stubbs

@rveciana
rveciana / README.md
Last active May 15, 2019 17:58
Map scroller associated with video position

Play the video once loaded to see the example.

I took the idea from this tweet.

I created the path with the help of Geojson.io, and it's not exact. The idea was showing the possibility of syncing the video with the path.

The video is a timelapse (I don't dare driving this fast) taken at the paradise valley close to Agadir, Morocco. Go there if you have the opportunity!

The code should be improved. I think that some times don't work if play is pressed beffore the video ends loading.

@rveciana
rveciana / README.md
Last active July 28, 2016 12:35
isobands and isolines from a geotiff with d3js

This exampe shows the temperature at 840 hPa and the geopotential height at 850 hPa from the GFS model (date 27/7/2016).

The idea is showing how to use the d3-marching-squares library as in the previous example, but adding isolines.

The colors represent the temperature and the lines the geopotential height. The example should have a scale, but the d3-legend library doesn't seem to work with d3 v4. The isolines should be labaled too, and this is a quite difficult task.

The example is created with npm and browserify, so if you want to play a little with it:

  • Download the package.json, index.html and draw.js files
  • run npm install
@rveciana
rveciana / README.md
Last active July 27, 2016 13:19
Isobands from a geotiff with d3

This example shows how to use the d3-marching-squares library.

The gist reads a GeoTIFF file, gets its data, calculates the zones for each interval and draws it on an html5 canvas element.

The data is an output of the GFS meteorological model (surface temperature), transformed using the grib api tools

The d3-marching-squares library is based on the MarchingSquares.js library.

The GeoTIFF file is read using the npm geotiff library

@rveciana
rveciana / README.md
Last active May 15, 2019 17:01
Chalkboard map

Based on this awesome post by John Nelson, the example simulates a chalk drawing on a blackboard.

I've used the new D3js 4.0 version and Canvas instead of SVG, since this could be a nice background for some visalization.

@rveciana
rveciana / README.md
Last active November 9, 2016 14:17
Basic map with new d3js 4.0

The most basic map using d3js v4.0. Just to learn a little about using the new version...

@rveciana
rveciana / .block
Last active June 8, 2016 17:52
Animated path using canvas
licence: mit
@rveciana
rveciana / .block
Last active January 25, 2017 16:21
ramadan times along meridian 30
licence: mit
height: 550