Skip to content

Instantly share code, notes, and snippets.

View hugolpz's full-sized avatar
🎯
Focusing

Lopez Hugo hugolpz

🎯
Focusing
View GitHub Profile
@hugolpz
hugolpz / README.md
Last active August 29, 2015 14:06
Minimal D3js reusable module
@hugolpz
hugolpz / index.html
Last active July 24, 2020 06:26 — forked from emeeks/index.html
From pixelized to curvy lines
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Interpolating Geodata</title>
<meta charset="utf-8" />
</head>
<style>
html,body {
height: 100%;
width: 100%;
margin: 0;
@hugolpz
hugolpz / README.md
Last active August 29, 2015 14:05 — forked from jasondavies/README.md
World tour WP guidelines

World tour using Wikipedia Map guidelines, more precisely the soon to come new globe locator convention. Inspired from Jason Davies world tour, merged into my localisator code.

V.2 Change log

This code is a second wave of customization.

  • Base: Own made Wikiatlas localisator and some of Jason Davies codes.
  • Dependencies: Migration to topojson v.1.0
  • CSS: migration to Wikipedia map guidelines and internalize to svg
@hugolpz
hugolpz / index.html
Created August 27, 2014 19:11 — forked from biovisualize/index.html
Download as bitmap (test)
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<title>Download SVG</title>
<style type="text/css">
#download{
cursor: pointer;
text-decoration: none;
color: black;
@hugolpz
hugolpz / README.md
Last active August 29, 2015 14:05 — forked from emeeks/README.md
D3-svg-legend (test)

d3.svg.legend provides for a simple legend that can be displayed horizontally or vertically and accepts a few different d3 scale types.

@hugolpz
hugolpz / README.md
Last active August 29, 2015 14:05
WikiAtlas ramp (beta)

This gist is a starting point to code a function buiding wikiatlas keys. It also gather helpful resources to learn and code further. Collaborative and versionned coding, fork, can be done on Codio.

We dream of...

Ideally, the function should take as input :

  • the range [zmin, zmax] (?),
  • an array for positives values [0, 50 200, 500, <zmax>],
  • an array for negative values [, -200, -100, -50, 0]
@hugolpz
hugolpz / README.md
Last active December 7, 2023 17:18
.data() vs .datum()

This project aim to illustrate with code the similarities and differences between .data() and .datum(). Feel free to fork and add other parallel examples, where .data() and .datum() do the same work with different syntaxes.

.data() and .datum()'s generated elements are taggued and get collored accordingly using CSS class) :

.data:hover  { fill: #B10000; opacity: 1; } /*  data = RED   */
.datum:hover { fill: #00B100; opacity: 1; } /*  datum= GREEN */

Syntax

@hugolpz
hugolpz / README.md
Last active August 29, 2015 14:05
Wikiatlas Localisator using D3.geo

A complete, automatic and flexible orthographic localisator for Wikipedia maps.

var bb = { "item":"India", "W": 67.0, "N":37.5, "E": 99.0, "S": 5.0 }, 
localisator("body", 200, bb.item, bb.W, bb.N, bb.E, bb.S);

It take as input :

  • a JS selector: a target html element's selector such as "body", "#hook", to be appended to,
@hugolpz
hugolpz / README.md
Last active August 23, 2017 04:24
Elegant map

D3js try for elegant map out of OSM data.

@hugolpz
hugolpz / README.md
Last active October 21, 2016 15:21 — forked from mbostock/.block
Topography via D3js image processing

Proof of concept of grayscale image recolored directly via D3js color scale. Wikimaps colors used.

Source: The source image is a global heightmap from the Shuttle Radar Topography Mission, released as part of NASA’s Blue Marble collection at 8km resolution. The topography data is stored in a simple 130KB black&white, 8-bit PNG. In it, darker values represent lower elevations (sea floor), lighter values represent higher elevations (mountains).

Colors are read out of the image using the Canvas API.

Data properties: