• This repository has been archived on 01/May/2020
  • Stars
    star
    371
  • Rank 115,103 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 12 years ago
  • Updated about 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DViz

by Alan Kang (@alankang)

DViz is a declarative data visualization library written in Javascript.

See live example on tumblr.

What is Declarative Data Visualization?

I coined the term declarative data visualization to describe a way of embedding visual representations such as sparklines or conventional statistical charts into HTML document without using the hand-written scripts or graph drawing tools.

All you need to do is writing a plain HTML document. DViz then automatically detects data elements embedded in the document and turns them into cognitively efficient visualizations on the fly.

Documentation

Basic Usage

Paste following code into the <head> element of your HTML:

<link rel="stylesheet" href="http://akngs.github.com/dviz/css/dviz.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://akngs.github.com/dviz/js/dviz.js"></script>
<script type="text/javascript">$(function() {dviz.run();});</script>

Or you can add ?autorun=true parameter instead of direct call to dviz.run:

<link rel="stylesheet" href="http://akngs.github.com/dviz/css/dviz.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://akngs.github.com/dviz/js/dviz.js?autorun=true"></script>

And add dviz-content class to somewhere in the <body> tag. DViz will scan and process all elements in there:

<div class="dviz-content"> ... </div>

Now you can do some magic. Add following code into dviz-content area:

<p>Here goes sparkline: <code>1,3,6,3,5,2,4 (@sparkline)</p>

It will replace the <code> element into a sparkline.

Or you can draw a bar chart:

<pre>
   <code>
   Name, A, B
   Apple, 1323, 1232
   Orange, 3563, 2452
   Banana, 1356, 3222
   </code>
</pre>
<p><code>(@bar)</code></p>

DViz currently supports following declarations:

  • scatter (scatter plot)
  • scattermatrix (scatter plot matrix)
  • bar (horizontal bar chart)
  • line (line chart)
  • column (vertical bar chart)
  • area (area chart)
  • steppedarea (stepped area chart)
  • sparkline (sparkline)
  • table (table chart)
  • graph (force-directed graph)

See following examples:

Dependencies

You can explicitly load optional javascript files using script tags, but you can also let DViz to load them when they are needed.

Browser Support

DViz supports all major modern browsers including:

  • Safari (and Mobile Safari)
  • Chrome
  • Firefox
  • Opera
  • Internet Explorer 9+

License

Licensed under the MIT license.

More Repositories

1

ecogwiki

Wiki engine for Google App Engine written in Python
Python
78
star
2

petitions

์ฒญ์™€๋Œ€ ๊ตญ๋ฏผ์ฒญ์› ๋ฐ์ดํ„ฐ
Python
39
star
3

noto-sans-kr-var-distilled

์šฉ๋Ÿ‰์„ 0.3MB๋กœ ์ค„์ธ ๋…ธํ† ์‚ฐ์Šค KR ๊ฐ€๋ณ€ ํฐํŠธ
Python
34
star
4

noto-kr-vf-distilled

์šฉ๋Ÿ‰์„ ์ค„์ธ Noto Sans ๋ฐ Noto Serif ๊ฐ€๋ณ€ํฐํŠธ
Python
29
star
5

d3-boxplot

d3js box plot plugin
JavaScript
21
star
6

smallworld

๋Œ€ํ•œ๋ฏผ๊ตญ ์ธ๋งฅ์ง€๋„
TypeScript
19
star
7

knews-rss

ํ•œ๊ตญ ์–ธ๋ก ์‚ฌ RSS ๋ชจ์Œ
TypeScript
18
star
8

nlpip

A unix pipeline utils based on LLM
Python
11
star
9

k-families-data

์ž˜ ์•Œ๋ ค์ง„ ํ•œ๋ฐ˜๋„ ์‚ฌ๋žŒ๋“ค์˜ ๊ฐ€์กฑ ๊ด€๊ณ„ ๊ทธ๋ž˜ํ”„
JavaScript
5
star
10

motionchart

A simple javascript motion chart
TypeScript
2
star
11

measurementprotocol

Google Analytics Measurement Protocol specification in YAML and JSON
JavaScript
2
star
12

jstdd

ํฌ๋กฌ์—์„œ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ TDD ์‹ค์Šตํ•˜๊ธฐ
HTML
2
star
13

csvsample

Creates small samples from large CSV files
Python
1
star
14

snake

snake.g15e.com
CSS
1
star
15

qs2csv

Transform logs in URL-encoded query string format into CSV format
Go
1
star
16

feed-bundler

TypeScript
1
star
17

mw-docker

Mediawiki server in Docker container
Dockerfile
1
star
18

guitar-sheets

LilyPond
1
star
19

mw-containers

Mediawiki and related services in Docker containers
Shell
1
star