Collapsible/expandible, can change root, and full user interface.
See the gist in action at http://bl.ocks.org/wmleler/raw/a734fb2bb3319a2cb386/.
There is also a help file.
The source is at https://bl.ocks.org/wmleler/a734fb2bb3319a2cb386/.
Collapsible/expandible, can change root, and full user interface.
See the gist in action at http://bl.ocks.org/wmleler/raw/a734fb2bb3319a2cb386/.
There is also a help file.
The source is at https://bl.ocks.org/wmleler/a734fb2bb3319a2cb386/.
# Obtain 'dogs.csv' | |
# Created by Alex Bresler, available at: | |
# https://github.com/abresler/abresler.github.io/blob/master/blog/2015/february/exploring_agility_show/data/dogs.csv | |
dat_url <- "http://asbcllc.com/blog/2015/february/exploring_agility_show/data/dogs.csv" | |
dogs <- read.csv(dat_url, header = TRUE, stringsAsFactors = FALSE) | |
library(shiny) | |
# Install the latest DiagrammeR package from GitHub | |
# devtools::install_github("rich-iannone/DiagrammeR") |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<style> | |
body { | |
font: 10px sans-serif; | |
} | |
#main { |
/** | |
* Copyright (c) 2014, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
*/ | |
#Run hclust | |
hc <- hclust(dist(USArrests[1:40,]), "ave") | |
#Function for extracting nodes and links | |
extractGraph<-function(hc){ | |
n<-length(hc$order) | |
m<-hc$merge | |
links<-data.frame(source=as.numeric(), target=as.numeric(), value=as.numeric()) |
Forked from Mike Bostock's brush as slider example, I use the brush/slider to drive an interactive exploration of the US Yield Curve. I think this is a much more helpful way of showing the data than the animated GIF from Treasury yield curve from the Volcker era through Greenspan, Bernanke, and Yellen.
By customizing the display of D3'��s [brush component](https://github.com/mbostock/d3/wiki/SVG-Controls), you can make a single-handle slider. Or, by using [custom resize handles](/mbostock/4349545), you can make a two-handled slider.!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=[ |
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:
This example pulls together various examples of work with trees in D3.js.
The panning functionality can certainly be improved in my opinion and I would be thrilled to see better solutions contributed.
One can do all manner of housekeeping or server related calls on the drop event to manage a remote tree dataset for example.
Dragging can be performed on any node other than root (flare). Dropping can be done on any node.
Panning can either be done by dragging an empty part of the SVG around or dragging a node towards an edge.
#setwd('~/uhk/dev/ar_ondrej_plachy/institution/') | |
data = read.table('data.tsv',sep="\t",header=TRUE) | |
data$time = data$year - 1983 | |
data$random1 = rnorm(336, mean=0, sd=0.01) | |
data$random2 = rnorm(336, mean=0, sd=0.01) | |
attach(data) | |
fbalm2 = | |
ifelse(balance_of_parties_mandates<= 0.25, '0.0-0.25', | |
ifelse(balance_of_parties_mandates <= 0.5, '0.25-0.5', |