Skip to content

Instantly share code, notes, and snippets.

View timelyportfolio's full-sized avatar

timelyportfolio timelyportfolio

View GitHub Profile
@timelyportfolio
timelyportfolio / README.md
Last active April 1, 2024 12:45 — forked from mbostock/.block
demo programmatic control of a d3 brush

Programmatically Control a d3 brush

Forked from 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 I found this discussion, but I could not find an example demonstrating the steps proposed by Athan Reines.

For auto-redraw such that the focus of a 1D brush matches the graphed domain, you need to do as follows:
@timelyportfolio
timelyportfolio / README.md
Created April 19, 2016 18:11 — forked from jcheng5/README.md
Using arbitrary Leaflet plugins with Leaflet for R

Using arbitrary Leaflet JS plugins with Leaflet for R

The Leaflet JS mapping library has lots of plugins available. The Leaflet package for R provides direct support for some, but far from all, of these plugins, by providing R functions for invoking the plugins.

If you as an R user find yourself wanting to use a Leaflet plugin that isn't directly supported in the R package, you can use the technique shown here to load the plugin yourself and invoke it using JS code.

source target value
Agricultural Energy Use Carbon Dioxide 1.4
Agriculture Agriculture Soils 5.2
Agriculture Livestock and Manure 5.4
Agriculture Other Agriculture 1.7
Agriculture Rice Cultivation 1.5
Agriculture Soils Nitrous Oxide 5.2
Air Carbon Dioxide 1.7
Aluminium Non-Ferrous Metals Carbon Dioxide 1
Aluminium Non-Ferrous Metals HFCs - PFCs 0.2
@timelyportfolio
timelyportfolio / .block
Last active August 18, 2019 17:07 — forked from ramnathv/concaveman.R
Using Concaveman in R using V8 with beeswarm (fork)
license: mit
height: 100
!function(){
var bP={};
var b=30, bb=150, height=600, buffMargin=1, minHeight=14;
var c1=[-130, 40], c2=[-50, 100], c3=[-10, 140]; //Column positions of labels.
var colors =["#3366CC", "#DC3912", "#FF9900","#109618", "#990099", "#0099C6"];
bP.partData = function(data,p){
var sData={};
sData.keys=[
@timelyportfolio
timelyportfolio / .block
Last active January 22, 2019 04:58 — forked from cmgiven/.block
Zoomable Treemap Bar Chart
license: mit
@timelyportfolio
timelyportfolio / README.md
Last active October 29, 2018 13:58 — forked from mbostock/.block
Adaptation of Mike Bostock's Force-Directed Graph of Les Mis Characters using .csv dataset instead of json

##Fork of Mike Bostock's original force-directed example. This fork uses an ugly csv which unfortunately is just a fact of life in my world. JSON is highly recommended unless it is unavailable.

##Original readme.md is below and does a very nice job of explaining the graph.

This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.

@timelyportfolio
timelyportfolio / .block
Last active February 4, 2018 17:24 — forked from wavded/fipsToState.json
State FIPS JSON
license: mit
@timelyportfolio
timelyportfolio / .block
Last active March 16, 2017 11:35 — forked from andrea2910/index.html
Zoomable Icicle with Labels and Breadcrumb (d3v4)
license: mit
@timelyportfolio
timelyportfolio / multi-crowbar-no-d3.js
Last active October 25, 2016 20:31 — forked from gka/multi-crowbar.js
like svg-crowbar, but for multiple svg elements!
// no d3 so assumes d3 v3 already loaded
var multiCrowbar = (function() {
/*
* SVG Export
* converts html labels to svg text nodes
* will produce incorrect results when used with multi-line html texts
*
* Author: Gregor Aisch
* based on https://github.com/NYTimes/svg-crowbar/blob/gh-pages/svg-crowbar-2.js