Skip to content

Instantly share code, notes, and snippets.

@KatiRG
KatiRG / index.html
Last active Feb 21, 2020
Demonstrate d3 enter-update-exit pattern for divs
View index.html
<!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 May 1, 2020
Running Flask with Gunicorn
View flask_gunicorn_app.py
# 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 Jan 2, 2018
d3js clickable, sortable stacked bar chart
View .block
Released under the GNU General Public License, version 3.
(or, optionlly, any higher version)
@KatiRG
KatiRG / README.md
Last active Feb 19, 2018
d3js clickable stacked bar chart
View README.md
@KatiRG
KatiRG / README.md
Last active Mar 23, 2019
Sankey set node position
View README.md

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

@KatiRG
KatiRG / data.csv
Last active Dec 2, 2015
dcjs resize
View data.csv
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 Dec 8, 2015
dc.js checkbox
View README.md

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

@KatiRG
KatiRG / FRA_admin13.json
Last active Nov 28, 2019
dc choropleth
View FRA_admin13.json
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 Sep 23, 2015
dc-leaflet legend feature (creates a static legend based on range of the data)
View legend snipptets
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)
You can’t perform that action at this time.