Skip to content

Instantly share code, notes, and snippets.

View ThomasG77's full-sized avatar

Thomas Gratier ThomasG77

View GitHub Profile
@ThomasG77
ThomasG77 / .block
Created March 3, 2017 23:20 — forked from veltman/.block
Scribble map
height: 600
@ThomasG77
ThomasG77 / Readme.md
Last active January 6, 2017 00:13 — forked from timelyportfolio/Readme.md
vega for time series chart with shaded blocks

vega stocks spec forked to add shaded blocks

Often time series charts can be enhanced by shaded blocks to highlight events or periods as shown by this example which uses the R package xtsExtra. Vega specs already allow this functionality, and it is fairly easy to implement.

I added an events object to the JSON data array.

    {
      "name": "events",
      "values": [
        {"name":"Test1", "start":"Apr 2000", "end":"Mar 2003"},
@ThomasG77
ThomasG77 / index.html
Created February 19, 2016 23:45 — forked from nolanlawson/index.html
Minimal WebWorker example
<html>
<body>
<h1>Minimal WebWorker example</h1>
<p>Look in the console!</p>
<script src="main.js"></script>
</body>
</html>
@ThomasG77
ThomasG77 / README.md
Last active July 5, 2018 11:16 — forked from elemoine/README.md
OpenLayers 3 Google Maps API

Use OL3 and Google Maps together

This GIST provides an example of a Google Maps map with an OL3 map as control, to give users a Google base map with OL3 content on top.

Open the corresponding bl.ock to view the example in your browser.

Warning!

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OpenLayers.Layer.D3 = OpenLayers.Class(OpenLayers.Layer.Vector, {
d3FeaturesNodeClass:'d3features',
d3Features:[],
afterAdd:function(){
var self = this;
if(this.renderer.CLASS_NAME.match(/SVG$/)){
this.d3InitSVG();
this.events.register('moveend',this,this.onMoveEnd);
@ThomasG77
ThomasG77 / README.md
Last active August 29, 2015 14:08 — forked from wrobstory/README.md

A Leaflet.js map created with Folium and a custom D3 threshold scale, with data bound between the Pandas DataFrame and the TopoJSON. See the Gist for the python code to generate the dataframe. The map was generated with the following Python code:

map_3 = folium.Map(location=[40, -99], zoom_start=4)
map_3.geo_json(geo_path=county_geo, data_out='data3.json', data=df,
               columns=['GEO_ID', 'Median_Household_Income_2011'],
               key_on='feature.id',
               fill_color='PuRd', line_opacity=0.3,
               legend_name='Median Household Income 2011 ($)',
 topojson='objects.us_counties_20m')
from __future__ import with_statement
from fabric.api import local, settings, abort, run, cd, env
from fabric.contrib.console import confirm
from fabric.contrib.files import exists, contains
# We reuse config from $HOME/.ssh/config
# Try
# fab --hosts=alwaysdata -f deploy_python_27_alwaysdata.py deploy_python
# or to set a specific version
# fab --hosts=alwaysdata -f deploy_python_27_alwaysdata.py deploy_python:version=2.7.5
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="http://openlayers.org/en/v3.0.0/css/ol.css" type="text/css">
<style>
body {
margin: 0;
padding: 0;
}
.map {
define([
'my/superModule',
'wrapper';
], function (superModule, wrapper) {
// Let's wrap it, aspect style
wrapper(superModule, 'superModule');
// Tada, all superModule methods will now log
});