Skip to content

Instantly share code, notes, and snippets.

View sgruhier's full-sized avatar

Sébastien Gruhier sgruhier

  • https://xilinus.com
  • Saint-Paul en Forêt
  • X @sgruhier
View GitHub Profile
@sgruhier
sgruhier / .block
Created April 23, 2017 09:58
zoom/pan d3v4
license: mit
@sgruhier
sgruhier / pie.ts
Created September 30, 2016 07:52
ng2
import { Component, OnChanges, OnDestroy, SimpleChange, ElementRef, Input } from '@angular/core';
import { D3Service } from 'd3-ng2-service';
import { BaseChart } from '../base.chart';
@Component({
selector: 'app-piechart',
template: `<ng-content></ng-content>`,
styleUrls: ['./piechart.component.scss'],
})

Simplest way to add pan/zoom to a d3js visualisation

git clone git://github.com/sstephenson/rbenv.git .rbenv
git clone git://github.com/sstephenson/ruby-build.git
echo 'export PATH="$HOME/.rbenv/bin:$HOME/ruby-build/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
. .bash_profile
rbenv install 2.1.2
rbenv global 2.1.2
// instantiate the addressPicker suggestion engine (based on bloodhound)
var addressPicker = new AddressPicker({map: {id: '#map'}});
// instantiate the typeahead UI
$('#address').typeahead(null, {
displayKey: 'description',
source: addressPicker.ttAdapter()
});
// Bind some event to update map on autocomplete selection
require "redis"
worker_processes 8
preload_app true
timeout 600
listen '/tmp/vodeclic.sock', :backlog => 1024
pid '/tmp/vodeclic.pid'
##
# REE
@sgruhier
sgruhier / Guardfile
Created September 8, 2012 14:45
Quick (and dirty) Guardfile for CoffeeScriptRedux and SourceMap
DEBUG = 1
module ::Guard
class Coffee < Guard
DEFAULT_OPTIONS = {compiler: 'coffee', input: 'coffee', output: 'js'}
def initialize(watchers = [], options = {})
watchers = [] if !watchers
defaults = DEFAULT_OPTIONS.clone
if options[:input]
<body>
<article>
<h1 class="fixie"></h1>
<p> Check us out at <a class="fixie"></a>,
and don't forget to view source.</p>
<section class="fixie">
<p></p>
<img/>
<ul></ul>
<p></p>
class MyView extends Backbone.View
constructor: ->
super
# Votre code ....
var marker = addresspickerMap.addresspicker( "marker");
var map = addresspickerMap.addresspicker( "map");
google.maps.event.addListener(marker, 'click', function() {
var infowindow = new google.maps.InfoWindow({content: "bla bla bla"})
infowindow.open(map,marker);
});
});