Skip to content

Instantly share code, notes, and snippets.

View nicolaskruchten's full-sized avatar

Nicolas Kruchten nicolaskruchten

View GitHub Profile
@nicolaskruchten
nicolaskruchten / Readme.md
Last active December 31, 2015 22:48
Mapping the Montreal 2013 election

Mapping the Montreal 2013 election

./makeTopo.sh will create the TopoJSON file from data available from the Montreal Open Data portal.

{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "Name": "Caserne 02", "description": "<p>Caserne 02<br\/>1 Chemin du Tour-de-L'Isle<br\/>Montréal<\/P><P><\/P><P> <\/P>", "timestamp": null, "begin": null, "end": null, "altitudeMode": null, "tessellate": -1, "extrude": -1, "visibility": 1, "drawOrder": null, "icon": null }, "geometry": { "type": "Point", "coordinates": [ -73.534726, 45.518966 ] } },
{ "type": "Feature", "properties": { "Name": "Caserne 03", "description": "<p>Caserne 03<br\/>256 rue Young<br\/>Montréal<\/P><P><\/P><P> <\/P>", "timestamp": null, "begin": null, "end": null, "altitudeMode": null, "tessellate": -1, "extrude": -1, "visibility": 1, "drawOrder": null, "icon": null }, "geometry": { "type": "Point", "coordinates": [ -73.560172, 45.493454 ] } },
{ "type": "Feature", "properties": { "Name
This is my gist
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
gapminder = px.data.gapminder().query("year == 2007")
input_figure = px.scatter(gapminder, x="gdpPercap", y="lifeExp", size="pop",
custom_data=[gapminder.index], # this is the special bit!
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nicolaskruchten
nicolaskruchten / spec.json
Created February 6, 2024 00:00
Vega spec from Mon Feb 05 2024
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"background": "white",
"padding": 5,
"width": 200,
"height": 200,
"style": "cell",
"data": [
{"name": "pivot_hover_862a830d_f0c0_47d5_9ac9_eb7216fb8ddf_store"},
{
@nicolaskruchten
nicolaskruchten / spec.json
Created February 6, 2024 19:21
Vega spec from Tue Feb 06 2024
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"autosize": {"type": "fit", "contains": "padding"},
"background": "white",
"padding": 5,
"style": "cell",
"data": [
{"name": "interval_intervalselection_0_store"},
{"name": "click_pointselection_0_store"},
{
@nicolaskruchten
nicolaskruchten / spec.json
Created February 6, 2024 19:24
Vega spec from Tue Feb 06 2024
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"data": [
{"name": "interval_intervalselection_0_store"},
{"name": "click_pointselection_0_store"},
{"name": "df"},
{
"name": "data_0",
"values": [
{
@nicolaskruchten
nicolaskruchten / spec.json
Created February 6, 2024 19:28
Vega spec from Tue Feb 06 2024
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"data": [
{"name": "interval_intervalselection_0_store"},
{"name": "click_pointselection_0_store"},
{"name": "df"},
{
"name": "data_0",
"values": [
{"date": 946702800000, "sum_price": 230.82999999999998},