Skip to content

Instantly share code, notes, and snippets.

@KatiRG
KatiRG / index.html
Last active February 21, 2020 18:29
Demonstrate d3 enter-update-exit pattern for divs
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 16px sans-serif;
margin: 50px;
}
#pudomap-legend {
margin-top: 30px;
}
@KatiRG
KatiRG / flask_gunicorn_app.py
Last active January 22, 2024 06:00
Running Flask with Gunicorn
# This gist shows how to integrate Flask into a
# custom Gunicorn-WSGI application described
# here: http://docs.gunicorn.org/en/stable/custom.html
from __future__ import unicode_literals
import multiprocessing
import gunicorn.app.base
@KatiRG
KatiRG / .block
Last active March 14, 2022 11:12
d3js clickable, sortable stacked bar chart
Released under the GNU General Public License, version 3.
(or, optionlly, any higher version)
@KatiRG
KatiRG / README.md
Last active February 19, 2018 19:28
d3js clickable stacked bar chart
@KatiRG
KatiRG / README.md
Last active March 23, 2019 21:32
Sankey set node position

Sets y-position of selected nodes according to a defined array after sankey.js has calculated their position.

@KatiRG
KatiRG / data.csv
Last active December 2, 2015 13:02
dcjs resize
Index Year
1 1961
1 1964
1 1968
1 1972
1 1973
1 1974
1 1988
1 2013
1 2018
@KatiRG
KatiRG / README.md
Last active December 8, 2015 16:42
dc.js checkbox

Fakes a pair of checkboxes using a dc rowChart and making the bars square.

gistup
@KatiRG
KatiRG / FRA_admin13.json
Last active November 28, 2019 00:58
dc choropleth
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@KatiRG
KatiRG / legend snipptets
Last active September 23, 2015 20:32
dc-leaflet legend feature (creates a static legend based on range of the data)
function drawChoropleth(data,geojson) {
choroChart = dc.leafletChoroplethChart("#choro-map .map")
.dimension(regionDimension)
.group(avgRegionGroup)
.valueAccessor(function(p) { return p.value.average; })
.width(800)
.height(400)
.center([47.00, 2.00])
.zoom(5)
.geojson(geojson)