-for opt_name in sorted(docs.keys()):
- opt = docs[opt_name]
- tests = opt['tests']
- if not tests:
- examples_html = '<font color=red>NONE</font>'
- else:
- examples_html = ' '.join(
- '<a href="%s">%s</a>' % (f, name(f)) for f in tests)
-
- print """
-<p><b>%(name)s</b><br/>
-%(desc)s<br/>
-<i>Type: %(type)s<br/>
-Default: %(default)s</i><br/>
-Examples: %(examples_html)s<br/>
-<br/>
-""" % { 'name': opt_name,
- 'type': opt['type'],
- 'default': opt['default'],
- 'desc': opt['description'],
- 'examples_html': examples_html}
+def gallery_name(f):
+ """Takes 'gallery/demo.js' -> 'demo'"""
+ return f.replace('gallery/', '').replace('.js', '')
+
+def urlify_gallery(f):
+ """Takes 'gallery/demo.js' -> 'demo'"""
+ return f.replace('gallery/', 'gallery/#g/').replace('.js', '')
+
+
+for label in sorted(labels):
+ print '<a name="%s"><h3>%s</h3>\n' % (label, label)
+
+ for opt_name in sorted(docs.keys()):
+ opt = docs[opt_name]
+ if label not in opt['labels']: continue
+ tests = opt['tests']
+ if not tests:
+ examples_html = '<font color=red>NONE</font>'
+ else:
+ examples_html = ' '.join(
+ '<a href="%s">%s</a>' % (f, test_name(f)) for f in tests)
+
+ gallery = opt['gallery']
+ if not gallery:
+ gallery_html = '<font color=red>NONE</font>'
+ else:
+ gallery_html = ' '.join(
+ '<a href="%s">%s</a>' % (urlify_gallery(f), gallery_name(f)) for f in gallery)
+
+ if 'parameters' in opt:
+ parameters = opt['parameters']
+ parameters_html = '\n'.join("<i>%s</i>: %s<br/>" % (p[0], p[1]) for p in parameters)
+ parameters_html = "\n <div class='parameters'>\n%s</div>" % (parameters_html);
+ else:
+ parameters_html = ''
+
+ if not opt['type']: opt['type'] = '(missing)'
+ if not opt['default']: opt['default'] = '(missing)'
+ if not opt['description']: opt['description'] = '(missing)'
+
+ print """
+ <div class='option'><a name="%(name)s"></a><b>%(name)s</b><br/>
+ <p>%(desc)s</p>
+ <i>Type: %(type)s</i><br/>%(parameters)s
+ <i>Default: %(default)s</i></p>
+ Gallery Samples: %(gallery_html)s<br/>
+ Other Examples: %(examples_html)s<br/>
+ <br/></div>
+ """ % { 'name': opt_name,
+ 'type': opt['type'],
+ 'parameters': parameters_html,
+ 'default': opt['default'],
+ 'desc': opt['description'],
+ 'examples_html': examples_html,
+ 'gallery_html': gallery_html}
+
+
+print """
+<a name="point_properties"></a><h3>Point Properties</h3>
+Some callbacks take a point argument. Its properties are:<br/>
+<ul>
+<li>xval/yval: The data coordinates of the point (with dates/times as millis since epoch)</li>
+<li>canvasx/canvasy: The canvas coordinates at which the point is drawn.</li>
+<li>name: The name of the data series to which the point belongs</li>
+<li>idx: The row number of the point in the data set</li>
+</ul>
+</div> <!-- #content -->
+
+<!--#include virtual="footer.html" -->
+"""