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 August 29, 2015 14:15
JSL 2015: Usando sphere para el fondo
@rveciana
rveciana / README.md
Last active August 29, 2015 14:15
JSL 2015: Bubble map

Undécimo ejemplo del taller Mapas web interactivos con D3.js en el programa de las 9as Jornadas SIG Libre .

Dibuja un mapa de burbujas a partir de los datos de los conflictos bélicos actuales. Datos de la Wikipedia.

@rveciana
rveciana / README.md
Last active April 8, 2020 10:24
JSL 2015: Coropletas

Duodécimo ejemplo del taller Mapas web interactivos con D3.js en el programa de las 9as Jornadas SIG Libre .

Dibuja un mapa de coropletas con los resultados electorales de las elecciones de 2011. Fuente: Wikipedia

@rveciana
rveciana / README.md
Last active August 29, 2015 14:15
JSL 2015: Coropletas con tooltip

Décimotercer ejemplo del taller Mapas web interactivos con D3.js en el programa de las 9as Jornadas SIG Libre .

Dibuja un mapa de coropletas con los resultados electorales de las elecciones de 2011. Al pasar el ratón por las provincias, aparece un +tooltip* con el resultado. Fuente: Wikipedia

@rveciana
rveciana / README.md
Last active November 12, 2024 10:49
Automatic colouring World Map using Canvas

This example is the same as this Jason Davies GIST, but using Canvas instead of SVG.

How is the color selected:

The place was easy to find

context.fillStyle = color(d.color = d3.max(neighbors[i], function(n) { return countries[n].color; }) + 1 | 0);

I had to think for some time to understand how does this work. Let's separate it:

@rveciana
rveciana / README.md
Last active August 29, 2015 14:19
Drop shadow map using Canvas

This example shows how to create the drop shadow effect in a map using Canvas.

Since the Canvas object already has the tools to do that, the code is really simple.

@rveciana
rveciana / README.md
Last active August 29, 2015 14:19
Map styling: Erode filter in canvas

Another experiment, this time using an erode filter to make the coastline more visible

@rveciana
rveciana / README.md
Last active June 21, 2018 10:41
conicConformalSpain

A modified conic conformal projection that shows the Canary Islands next to the Iberian Peninsula so working with data in Spain becomes easier.

@rveciana
rveciana / README.md
Last active March 1, 2016 10:59
d3-composite-projections albersUsa
@rveciana
rveciana / README.md
Last active March 1, 2016 10:58
d3-composite-projections conicConformalPortugal

This file shows how to use the conicConformalPortugal projection from d3-composite-projections. Since the world layer is used, note that the Iberian Peninsula is clipped at the projection border. These projections work well when used at the place they are intended for.