Skip to content

Instantly share code, notes, and snippets.

View timelyportfolio's full-sized avatar

timelyportfolio timelyportfolio

View GitHub Profile
@timelyportfolio
timelyportfolio / code.R
Last active August 29, 2015 13:58 — forked from ramnathv/code.R
library(rCharts)
p2 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'scatterChart')
p2$xAxis(axisLabel = 'Weight')
p2$chart(size = '#! function(d){return d.gear} !#')
p2$chart(color = c('red', 'green', 'blue'))
p2$chart(
tooltipXContent = NA,
tooltipYContent = NA
)
p2$chart(
@timelyportfolio
timelyportfolio / code.R
Last active August 29, 2015 13:57 — forked from ramnathv/code.R
hair_eye_male = subset(as.data.frame(HairEyeColor), Sex == "Male")
n1 <- nPlot(Freq ~ Hair,
group = 'Eye',
data = hair_eye_male,
type = 'multiBarChart'
)
n1
example.md: example.Rmd
Rscript ./knit
example.ipynb: example.md
c://python27_64/scripts/notedown example.md | sed 's/%%r/%%R/' > example.ipynb
@timelyportfolio
timelyportfolio / README.md
Last active December 30, 2015 04:19 — forked from mbostock/.block

Quick fork of https://gist.github.com/mbostock/5925375 to see if OriDomi plays nicely with d3.js. Please note the original source from Mike Bostock for any praise or admiration. All errors and mistakes please attribute to me.

original Readme.md

This variation of the unemployment choropleth uses TopoJSON 1.2’s new --projection argument to created projected TopoJSON. This example also uses the -e argument to join the county geometries with a TSV file of unemployment rates, simplifying the implementation and eliminating the need to load multiple data files.

variable Annualized Return Annualized Standard Deviation Maximum Drawdown
Convertible Arbitrage 0.0770203710991655 0.0694461870173684 0.292688394529575
CTA Global 0.0767109922711062 0.0870559916457339 0.11676813742079
Distressed Securities 0.0975096216543971 0.0635590261337229 0.229232535454022
Emerging Markets 0.0936124939942315 0.133615370977481 0.359789528051813
Equity Market Neutral 0.0739359541312794 0.031197069331753 0.110823378150652
Event Driven 0.093190424075422 0.0635679064016912 0.200817391305532
Fixed Income Arbitrage 0.0506750901161104 0.0490908049045477 0.178792725850406
Global Macro 0.0942083012167199 0.0589577044136273 0.0792292782044611
Long Short Equity 0.0940147333764296 0.0768123568274029 0.218197216318131

Like a box plot, a quartile plot summarises a distribution with five statistics: the median (the dot); the upper quartile and the maximum value (either end of the upper centre line); and the lower quartile and the minimum value (either end of the lower centre line). However, a quartile plot reduces a box plot's glyphs to one dot and two lines, so it has a larger data-ink ratio.

For more information about quartile plots, see:

  • Tufte, E.R., 2001. The Visual Display of Quantitative Information. 2nd ed. Cheshire, CT, USA: Graphics Press.

Data

Refractive indices of samples of six types of glass, gathered for criminological investigation (source).

A box-and-whisker plot uses simple glyphs that summarize a quantitative distribution with five standard statistics: the smallest value, lower quartile, median, upper quartile, and largest value. This summary approach allows the viewer to easily recognize differences between distributions. Data from the Michelson–Morley experiment. Implementation contributed by Jason Davies. This example periodically randomizes the values to demonstrate transitions.

Click on any arc to zoom in. Click in the center to zoom out.

A sunburst is similar to a treemap, except it uses a radial layout. The root node of the tree is at the center, with leaves on the circumference. The area (or angle, depending on implementation) of each arc corresponds to its value. Sunburst design by John Stasko. Data courtesy Jeff Heer.

@timelyportfolio
timelyportfolio / Readme.md
Last active December 17, 2015 09:19 — forked from mbostock/.block
BIS Derivative Data using Mike Bostock's stacked to multiple bar

BIS Derivative Data

Explore Using Mike Bostock's Stacked to Multiple Bar Example

To make this work, I had to change up the data transformation. Also, I changed the stack to use the entire height. Thanks to Jason Davies eyedropper I was able to match the colors used in the original BIS publication.

Data Source

BIS OTC Derivatives statistics