概述:交互式數據可視化在很大程度上取決於JavaScript庫的任務能力。在這篇文章中,我們將看看四個JavaScript庫:D3,InfoVis,Processing.js,和Recline.js。所有這些JavaScript庫可以用來裝飾您的網頁與動態數據可視化,但每個采用不同的方法來提供這種能力。所有四個都可以免費使用和分發。
HTML5中新的圖形元素和JavaScript引發了交互式數據顯示技術的復興。如今的瀏覽器用戶界面不僅功能豐富、令人賞心悅目,而且還作為數據可視化的載體,用於顯示柱狀體、氣泡圖和豐富多彩的地圖等。
交互式數據可視化在很大程度上取決於JavaScript庫的任務能力。在這篇文章中,我們將看看四個JavaScript庫:D3,InfoVis,Processing.js,和Recline.js。所有這些庫可以用來裝飾您的網頁與動態數據可視化,但每個采用不同的方法來提供這種能力。所有四個都可以免費使用和分發。
D3
D3是一種奇妙的基於Javascript的數據可視化庫,允許您將數據綁定到DOM,然后將數據驅動轉換應用到Document中。你可以使用它用一個數組創建基本的HMTL表格,或是利用它的流體過度和交互,用相似的數據創建驚人的SVG條形圖。
優點
- 豐富的實例
- 使用標准的DOM對象,容易調試
- 可通過擴展來創建任意數據可視化
- 可以處理多種數據格式,包括 XML、CSV 和 JSON 等
缺點
- D3 非常強大,因此與其他庫相比,學習成本要多一些
- D3 與早期的 IE 版本不兼容
- 需要深入了解JavaScript
InfoVis
InfoVis是一個在Web上創建可交互式的數據圖表的JavaScript 庫。InfoVis有點類似Moo工具,它是一個模塊化的對象指向型JavaScript架構,通常這些架構都是高級JavaScript程序員要借助的中介。由於它具有模塊化的格式,因此用戶可以使用JavaScript InfoVis保持頁面的簡潔。它還包括一個動畫效果功能,多種繪圖類型和一個用於操作JSON數據的類。
優點
- API很容易理解
缺點
- 圖表庫不太靈活
- 不如其他工具那樣易於擴展
Processing
Processing.js是一個基於Java圖形系統的JavaScript 庫。它不僅僅提供數據可視化,還可以實現程序圖像、動畫和互動的應用。
優點
- 可用於創建動畫
- 很大程度上兼容Processing Java
- 輕量,易於了解掌握
缺點
- 需要學習Processing language
Recline.js
Recline.js可以幫助你使用Javascript和html快速地創建基於數據的應用。Recline.js已經內置支持從、CSV files, Google Docs, ElasticSearch, CouchDB等來加載數據。並能夠以表格,地圖,時間線等方式來漂亮地展示數據。展示的方式可以很方便地按自己的需要進行擴展。
優點
- 在線練習
- 可與其他JavaScript庫整合
缺點
- 圖表類型有限
element
Font | |
---|---|
font-family | |
font-size | |
font-style | |
font-variant | |
font-weight | |
letter-spacing | |
line-height | |
text-decoration | |
text-align | |
text-indent | |
text-transform | |
white-space | |
word-spacing | |
color | |
Background | |
bg-attachment | |
bg-color | |
bg-image | |
bg-position | |
bg-repeat | |
Box | |
width | |
height | |
border-top | |
border-right | |
border-bottom | |
border-left | |
margin | |
padding | |
max-height | |
min-height | |
max-width | |
min-width | |
outline-color | |
outline-style | |
outline-width | |
Positioning | |
position | |
top | |
bottom | |
right | |
left | |
float | |
display | |
clear | |
z-index | |
List | |
list-style-image | |
list-style-type | |
list-style-position | |
Table | |
vertical-align | |
border-collapse | |
border-spacing | |
caption-side | |
empty-cells | |
table-layout | |
Effects | |
text-shadow | |
-webkit-box-shadow | |
border-radius | |
Other | |
overflow | |
cursor | |
visibility |
element
Font | |
---|---|
font-family | |
font-size | |
font-style | |
font-variant | |
font-weight | |
letter-spacing | |
line-height | |
text-decoration | |
text-align | |
text-indent | |
text-transform | |
white-space | |
word-spacing | |
color | |
Background | |
bg-attachment | |
bg-color | |
bg-image | |
bg-position | |
bg-repeat | |
Box | |
width | |
height | |
border-top | |
border-right | |
border-bottom | |
border-left | |
margin | |
padding | |
max-height | |
min-height | |
max-width | |
min-width | |
outline-color | |
outline-style | |
outline-width | |
Positioning | |
position | |
top | |
bottom | |
right | |
left | |
float | |
display | |
clear | |
z-index | |
List | |
list-style-image | |
list-style-type | |
list-style-position | |
Table | |
vertical-align | |
border-collapse | |
border-spacing | |
caption-side | |
empty-cells | |
table-layout | |
Effects | |
text-shadow | |
-webkit-box-shadow | |
border-radius | |
Other | |
overflow | |
cursor | |
visibility |
element
Font | |
---|---|
font-family | |
font-size | |
font-style | |
font-variant | |
font-weight | |
letter-spacing | |
line-height | |
text-decoration | |
text-align | |
text-indent | |
text-transform | |
white-space | |
word-spacing | |
color | |
Background | |
bg-attachment | |
bg-color | |
bg-image | |
bg-position | |
bg-repeat | |
Box | |
width | |
height | |
border-top | |
border-right | |
border-bottom | |
border-left | |
margin | |
padding | |
max-height | |
min-height | |
max-width | |
min-width | |
outline-color | |
outline-style | |
outline-width | |
Positioning | |
position | |
top | |
bottom | |
right | |
left | |
float | |
display | |
clear | |
z-index | |
List | |
list-style-image | |
list-style-type | |
list-style-position | |
Table | |
vertical-align | |
border-collapse | |
border-spacing | |
caption-side | |
empty-cells | |
table-layout | |
Effects | |
text-shadow | |
-webkit-box-shadow | |
border-radius | |
Other | |
overflow | |
cursor | |
visibility |