Create an alias for the directory where we'll do our installation and computing.
$WORK = /vega/<group>/users/<username>
Now, install and setup the latest version of Python (2 or 3).
cd $WORK
mkdir applications
cd applications
# SEAS_evaluations.py | |
# https://github.com/rasmi | |
import json | |
import urllib2 | |
import re | |
from bs4 import BeautifulSoup | |
site_url ='http://oracle.seas.columbia.edu/' | |
course_list_url = site_url + 'viewcourse_m.php' | |
course_sections_url = site_url + 'viewresults.php?course=' |
#!/usr/bin/env python | |
# halo_gas_stars_dm_projections.py | |
# Create halo projections for gas, stars, and dm density for a given enzo directory. | |
# halo_projections.py RD0006 | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("directory", type=str, help="List one or more directories to analyze.") | |
args = parser.parse_args() | |
directory = args.directory |
#!/usr/bin/env python | |
# findhalos.py | |
# Find halos for a given enzo directory. | |
# findhalos.py RD0006 | |
import yt | |
from yt.analysis_modules.halo_analysis.api import HaloCatalog | |
from yt.analysis_modules.halo_analysis.halo_filters import add_filter | |
directory = 'RD0009' |
#!/usr/bin/env python | |
# halo_profiles.py | |
# Create halo profiles for gas, stars, and dm density for a given enzo directory. | |
# halo_profiles.py RD0006 | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("directory", type=str, help="List one or more directories to analyze.") | |
args = parser.parse_args() | |
directory = args.directory |
I hereby claim:
To claim this, I am signing this object:
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.