Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mmzeeman/mod_sparky
Easily create sparklines in pages on your Zotonic site.
https://github.com/mmzeeman/mod_sparky
Last synced: 6 days ago
JSON representation
Easily create sparklines in pages on your Zotonic site.
- Host: GitHub
- URL: https://github.com/mmzeeman/mod_sparky
- Owner: mmzeeman
- Created: 2013-01-19T19:53:54.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-19T20:28:08.000Z (almost 12 years ago)
- Last Synced: 2024-10-12T04:31:53.349Z (about 1 month ago)
- Language: JavaScript
- Size: 136 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
mod_sparky
==========Mod_sparky allows you to easily create sparklines in pages on your
[Zotonic](http://zotonic.com) site.I've always loved the little graphics called
[sparklines](http://en.wikipedia.org/wiki/Sparkline). In the words of
[Edward Tufte](http://www.edwardtufte.com/tufte/):> Sparklines mean that graphics are no longer cartoonish special occasions
> with captions and boxes, but rather a sparkline graphic can be everywhere a
> word or number can be: embedded in a sentence, table, headline, map,
> spreadsheet, graphic.Now you can add them to your Zotonic site too!
Once you enable the mod_sparky you can embed them in your templates like this:
'''
{% sparkline points=[145,136,145,136,127,136,145,136,136,172,127,136,
127,127,172,172,181,172,200,127,136,118,109,100,128]
preset="hilite-peaks"
label="Glucose" %}
'''This will generate a sparkline with a label and display labels
for the start and stop variables and the minimum and maximum value of the
numbers.All the rendering is done by [sparky.js](http://prag.ma/code/sparky/)
designed by [Shawn Allen](http://stamen.com/studio/shawn) and a little
help from [rafael.js](http://raphaeljs.com/).prerequisites
-------------You have to have include some css, ```css/sparky.css``` and load
and initialize the javascript libraries responsible for rendering the
sparkline by including ```{% include "_js_include_sparky.tpl" %}``` in
your template.