Skip to content

Instantly share code, notes, and snippets.

View xhinking's full-sized avatar

Wang xhinking

  • HangZhou
  • 07:08 (UTC +08:00)
View GitHub Profile
@xhinking
xhinking / .block
Created May 25, 2016 05:18 — forked from tonyhschu/.block
Small Scroll-linked Animation Demo
scrolling: yes
@xhinking
xhinking / README.md
Created November 20, 2015 01:22 — forked from micahstubbs/README.md
programmatic control of a d3 brush - specify zoom

Forked from timelyportfolio's bl.ock which in turn forked Mike Bostock's focus+context zoom gist to demonstrate how we can drive a d3 brush with code.

anybody know how to brush with code in #d3js?

— klr (@timelyportfolio) September 10, 2014
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

So timelyportfolio found this discussion, but he could not find an example demonstrating the steps proposed by Athan Reines.

For auto-redraw so that the focus of a 1D brush matches the graphed domain, you need to do as fol
// MWWebSnapshot
//
// Created by Jim McGowan on 08/09/2010.
// Copyright 2010 Jim McGowan. All rights reserved.
//
// This code is made available under the BSD license.
// Please see the accompanying license.txt file
// or view the license online at http://www.malkinware.com/developer/License.txt
//
//
// jshint devel: true
// make a copy of each `console` methods and adds them
// to the global object so that you can call `log('foobar')`
// instead of the verbose `console.log('foobar')`
// DO NOT USE IT IN PRODUCTION MODE
// @623HS
(function(global) {
'use strict';
var name, value;
@xhinking
xhinking / crop.js
Created December 26, 2013 08:13 — forked from arian/crop.js
var spawn = require('child_process').spawn;
var Stream = require('stream');
/**
* crops and resizes images to our desired size
* @param {Stream} streamIn in stream containing the raw image
* @return {Stream}
*/
exports.cropImage = function(streamIn){