Skip to content

Instantly share code, notes, and snippets.

View timelyportfolio's full-sized avatar

timelyportfolio timelyportfolio

View GitHub Profile
@jcheng5
jcheng5 / addDynamicTiles.R
Created January 19, 2019 16:38
Leaflet dynamic tiles
library(shiny)
library(leaflet)
#' Add a tile layer whose source is an R function
#'
#' @param tileFunc A function(x, y, z) that returns a 256x256 image object
#' suitable for passing to `png::writePNG`.
#' @seealso [leaflet::addTiles()] for other parameters
addDynamicTiles <- function(map, tileFunc,
layerId = paste0("leafletRaster", sample.int(9999999, 1)),
@domoritz
domoritz / .block
Last active January 8, 2020 16:14
Vega-Lite with Websockets
license: bsd-3-clause
@bumbeishvili
bumbeishvili / .block
Last active September 22, 2022 12:59
Employees Hierarchy Chart using d3.js
license: mit
@gabrielflorit
gabrielflorit / .gitignore
Last active September 13, 2019 12:21
Speedy Racer
.DS_Store
@stephlocke
stephlocke / LockeTree.css
Last active January 5, 2018 12:50
Working Site Tree
.collapsibleTree .node circle {
fill: #E8830C;
stroke: #E8830C;
}
.collapsibleTree .node text {
fill: white;
}
.collapsibleTree .link {
@veltman
veltman / README.md
Created December 27, 2017 18:28
Automatic label placement along a path #2

A method for automatically finding the best eligible label position and font size for a label that's going to go along a path inside of an area, similar to this example but with two embellishments:

  • Using d3plus.polygonRayCast() to more accurately measure the vertical clearance available at a given x position with any rotation.
  • Avoiding label positions that would cause the text to be overlapped by another shape for a case like this bump chart.

The measurement gets thrown off a little bit by the curve function and the fact that text is rotated letter by letter instead of continuously, but the results seem good enough.

See also: Automatic label placement along a path Streamgraph label positions #2

@EE2dev
EE2dev / index.html
Last active December 21, 2017 01:42
Sequence explorer - single chart (with JSON file)
<!DOCTYPE html>
<meta charset="utf-8"> <!-- also save this file as unicode-8 ! -->
<head>
<link rel="stylesheet" type="text/css" href="https://ee2dev.github.io/libs/sankeySeqExplorer.v20.css">
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://ee2dev.github.io/libs/sequence-explorer.v20.min.js"></script>
</head>
<body>
<script>
@romsson
romsson / .block
Last active December 21, 2017 01:42
vertical horizontal nesting (grids)
license: mit
@Kcnarf
Kcnarf / .block
Last active August 17, 2018 14:16
d3-voronoi-map usage
license: mit
@vasturiano
vasturiano / .ne_110m_admin_0_countries.json
Last active October 25, 2018 11:06
World cartogram on d3 v4
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.