Skip to content

Instantly share code, notes, and snippets.

View PBrockmann's full-sized avatar
🙂
Working

Patrick Brockmann PBrockmann

🙂
Working
  • Climate and Environment Sciences Laboratory (LSCE)
  • Paris-Saclay - France
View GitHub Profile
@PBrockmann
PBrockmann / Licence.txt
Last active March 5, 2024 12:15
Interactive D3.js heatmap
MIT License
Copyright (c) 2019 Patrick Brockmann / LSCE
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@PBrockmann
PBrockmann / pythreejs_07.ipynb
Last active April 2, 2019 15:13
pythreejs test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PBrockmann
PBrockmann / legend_interactiv.ipynb
Last active May 24, 2017 16:00
bokeh interactiv legend CustomJS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PBrockmann
PBrockmann / README.md
Last active August 29, 2015 14:15
Bivariate map

IPython notebook to explore bivariate mapping

@PBrockmann
PBrockmann / README.md
Last active August 29, 2015 14:14
bokeh spatial map

A example to explore spatial plot with bokeh (0.7.1) using plt.image

@PBrockmann
PBrockmann / README.md
Last active November 3, 2021 21:17
CollapsibleTree Search
@PBrockmann
PBrockmann / README.md
Last active August 29, 2015 14:01
ESGF Data Visibility
@PBrockmann
PBrockmann / README.md
Last active March 8, 2024 00:53
Bubbles map
@gisminister
gisminister / README.md
Last active April 11, 2024 18:52
Markercluster pie charts

The map shows traffic accidents recorded in Oslo, Norway, for the year 2013.

The Leaflet Markercluster plugin is wonderful. Since the markerclusters are divIcons you can put whatever you want inside them using the iconCreateFunction. I wanted my clusters to reveal more information than just the marker count and figured a pie chart would do the job. So I told the iconCreateFunction to do some D3 magic and this is the result.

The example is a bit more complicated than necessary due to how my dataset is structured. But if you take a look at the defineClusterIcon() function you'll see that I use d3.nest() to build a dataset for the pie chart based on a given property from all the cluster's children. Then I pass this dataset over to the bakeThePie() function together with instructions on how to style the chart. The function returns svg markup which in turn is placed inside the divIcon.

Feel free to suggest improvements.

@jgbos
jgbos / README.md
Last active February 25, 2018 20:23
Simple Single Axis Zoom

This is an example of adding simple interface for single axis zoom and pan capability using the mouse. When the mouse is over the x or y axes, the panning and zooming with the mouse will execute on only those axes. When the mouse is over the main plotting canvas, pan and zoom with the mouse works on both axes. Feel free to comment on the gist.