This chart should represent ticket sales over time and features a gradient fill as well as tooltips on data points.
It should look like:
A line chart with mouseover so that you can read the y-value based on the closest x-value. The x-value is found using d3.mouse and scale.invert. The y-value is then found by bisecting the data.
Attention: if you attempt to fork this gist, github will think that you are a spammer and you will have to confirm that you are human with them. Apparantly there are too many links in this list. Also I update it rather frequently (see revisions on the left), so it's probably wise to not fork it anyway.
This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="author" content="Martin Bean" /> | |
<title>Twitter’s Bootstrap with Ryan Fait’s Sticky Footer</title> | |
<link rel="stylesheet" href="https://raw.github.com/twitter/bootstrap/master/docs/assets/css/bootstrap.css" /> | |
<style> | |
html, body { | |
height: 100%; |
"""A management command for extracting translation messages for the whole project.""" | |
import glob | |
import os | |
from django.conf import settings | |
from django.core.management.base import NoArgsCommand | |
class Command(NoArgsCommand): |
def elem2dict(node): | |
""" | |
Convert an lxml.etree node tree into a dict. | |
""" | |
d = {} | |
for e in node.iterchildren(): | |
key = e.tag.split('}')[1] if '}' in e.tag else e.tag | |
value = e.text if e.text else elem2dict(e) | |
d[key] = value | |
return d |
#!/usr/bin/env python | |
""" | |
A script to query the Amazon Web Services usage reports programmatically. | |
Ideally this wouldn't exist, and Amazon would provide an API we can use | |
instead, but hey - that's life. | |
Basically takes your AWS account username and password, logs into the | |
website as you, and grabs the data out. Always gets the 'All Usage Types' |
Hosting Sphinx docs at GitHub | |
----------------------------- | |
Before: Run sphinx-quickstart in docs/ | |
1. Follow "Project Pages" instructions from http://pages.github.com/ to create a gh-pages branch | |
2. Add Sphinx html build dir as git submodule: | |
git checkout master | |
git submodule add -b gh-pages [email protected]:arthurk/django-disqus.git docs/_build/html |
#!/bin/bash | |
# | |
# pylink.sh - Link a Python module to your site packages directory. | |
# | |
# See http://gist.github.com/21649 for updates. | |
# Check that an argument has been given. If not, print usage string. | |
if [ -z $1 ] | |
then | |
echo "Usage: `basename $0` <path_to_module> [<link_name>]" |