Skip to content

Instantly share code, notes, and snippets.

@mbostock
mbostock / .block
Last active July 29, 2019 14:26 — forked from mbostock/.block
DRY Bar Chart
license: gpl-3.0
@mbostock
mbostock / .block
Last active March 30, 2023 20:59
Dispatching Events
license: gpl-3.0
@mbostock
mbostock / .block
Last active March 7, 2017 22:12 — forked from mbostock/.block
Pie Chart Update, V
license: gpl-3.0
@mbostock
mbostock / .block
Last active February 9, 2016 02:04
Pie Chart Update, IV
license: gpl-3.0
@mbostock
mbostock / .block
Last active February 9, 2016 02:04
Pie Chart Update, III
license: gpl-3.0
@ramnathv
ramnathv / server.R
Created May 7, 2013 10:40
rCharts NVD3 Shiny App
require(rCharts)
shinyServer(function(input, output) {
output$myChart <- renderChart({
hair_eye = as.data.frame(HairEyeColor)
p6 <- nPlot(Freq ~ Hair, group = 'Eye', data = subset(hair_eye, Sex == input$gender),
type = input$type, dom = 'myChart', width = 800)
p6$chart(color = c('brown', 'blue', '#594c26', 'green'), stacked = input$stack)
return(p6)
})
})
@biovisualize
biovisualize / index.html
Last active October 15, 2018 01:29
D3.js Reusable Bar Chart with Angularjs
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
font: 14px sans-serif;
}
.axis path, .axis line {
fill: none;
Year Make Model Length
1997 Ford E350 2.34
2000 Mercury Cougar 2.38
@jcheng5
jcheng5 / server.R
Created November 10, 2012 08:13
Shiny file upload demo
shinyServer(function(input, output) {
output$filetable <- reactiveTable(function() {
if (is.null(input$files)) {
# User has not uploaded a file yet
return(NULL)
}
input$files
})
})
@mbostock
mbostock / .block
Last active January 8, 2020 02:47 — forked from mbostock/.block
Sortable Bar Chart
license: gpl-3.0
redirect: https://beta.observablehq.com/@mbostock/d3-sortable-bar-chart