• Stars
    star
    236
  • Rank 170,480 (Top 4 %)
  • Language
    Ruby
  • License
    BSD 2-Clause "Sim...
  • Created about 14 years ago
  • Updated about 2 years ago

Reviews

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

Repository Details

Ruby version of Protovis, a visualization toolkit.

Rubyvis

Build Status

DESCRIPTION:

Ruby port of Protovis, a Javascript visualization toolkit.

FEATURES/PROBLEMS:

This library implements almost completely core API of protovis, including all static marks, SVG builder class and data classes. Spec coverage is near 90%

Implemented:

  • Marks: All, except transient and transitions.
  • Layout: Arc, Cluster, Grid, Horizon, Indent, Matrix, Pack, Partition, Stack, Tree and Treemap. To implement: Bullet, Force, and Rollup.

Using protovis examples[http://vis.stanford.edu/protovis/ex/] as reference

  • Conventional: All working
  • Custom:
  • Backer's Barley
  • Burtin's Antibiotics: Scatterplot matrix
  • Cars: Parallel Coordinates
  • Crimea war: Grouped bar chart and line chart
  • Hierarchies:
  • Treemap
  • Bubble Charts
  • Circle Packing
  • Dendogram
  • Icicle
  • Indent
  • Node-Link Tree
  • Sunburst
  • Treemap
  • Networks:
  • Arc
  • Matrix

I try to maintain, when posible, complete compatibility with Javascript API, including camel case naming of functions.

User could use +pv+ freely, cause is defined as a global method which call Rubyvis.

Nokogiri is used as XML library. If not available, or $rubyvis_no_nokogiri is set to true, REXML is used. Nokogiri is 30%-35% faster that REXML on our test.

CURRENT PROGRESS

  • pv.js
  • pv-internals.js
  • color/Color.js
  • color/Colors.js
  • data/Arrays.js
  • data/Flatten.js
  • data/Histogram.js
  • data/Numbers.js
  • data/LinearScale.js
  • data/LogScale.js (incomplete)
  • data/Nest.js
  • data/QuantitativeScale.js
  • data/OrdinalScale.js
  • data/Scale.js
  • layout/Arc.js
  • layout/Cluster.js
  • layout/Grid.js
  • layout/Hierarchy.js
  • layout/Horizon.js
  • layout/Indent.js
  • layout/Layout.js
  • layout/Matrix.js
  • layout/Network.js
  • layout/Pack.js
  • layout/Partition.js
  • layout/Stack.js
  • layout/Tree.js
  • layout/Treemap.js
  • mark/Anchor.js
  • mark/Area.js
  • mark/Bar.js
  • mark/Dot.js
  • mark/Label.js
  • mark/Line.js
  • mark/Mark.js
  • mark/Panel.js
  • mark/Rule.js
  • mark/Wedge.js
  • scene/SvgBar.js
  • scene/SvgLabel.js
  • scene/SvgLine.js
  • scene/SvgPanel.js
  • scene/SvgRule.js
  • scene/SvgScene.js
  • scene/SvgWedge.js
  • text/Format.js (incomplete)
  • text/NumberFormat.js (incomplete)

SYNOPSIS:

The primary API, based on Gregory Brown's Ruby Best Practices, uses blocks and name of marks as methods

require 'rubyvis'

vis = Rubyvis::Panel.new do 
  width 150
  height 150
  bar do
    data [1, 1.2, 1.7, 1.5, 0.7, 0.3]
    width 20
    height {|d| d * 80}
    bottom(0)
    left {index * 25}
  end
end

vis.render
puts vis.to_svg

The library allows you to use chain methods API, like original protovis

require 'rubyvis'

vis = Rubyvis::Panel.new.width(150).height(150);

vis.add(pv.Bar).
  data([1, 1.2, 1.7, 1.5, 0.7, 0.3]).
  width(20).
  height(lambda {|d| d * 80}).
  bottom(0).
  left(lambda {self.index * 25});

vis.render
puts vis.to_svg

See examples directory for original protovis examples adaptations and others graphics. You can see all of them online on the documentation page.

THE MOST FREQUENT QUESTION (MFQ)

¿Why use a server-side technology if I can use a client-side, which is faster and more economic for developer?

If you want to present graphs: (a) complex and/or dynamically generated, (b) only on the web and (c) on modern browsers, Protovis is an excellent option. For simpler charts, Protovis is overkill. I recomend jqPlot.

Rubyvis is designed mainly for off-line operation, like batch creation of graphs for use on printed documents (rtf-pdf), with possibility of use easily the script for on-line use.

REQUIREMENTS:

Tested on Ruby 2.1 to 2.6 and Jruby (mode 1.9)

INSTALL:

$ gem install rubyvis

LICENSE:

BSD 2-Clause (see LICENSE.txt)

More Repositories

1

statsample

A suite for basic and advanced statistics on Ruby.
Ruby
401
star
2

rinruby

Ruby library that integrates the R interpreter in Ruby, making R's statistical routines and graphics available within Ruby.
Ruby
152
star
3

distribution

Statistical Distributions multi library wrapper. Uses Ruby by default and C (statistics2/GSL) or Java extensions where available.
Ruby
141
star
4

Rserve-Ruby-client

Pure Ruby client for Rserve. Based on 'new' Java client provided with server, but with modifications to adhere to POLS
Ruby
126
star
5

PHP_Beautifier

This program reformat and beautify PHP 4 and PHP 5 source code files automatically. The program is Open Source and distributed under the terms of PHP Licence. It is written in PHP 5 and has a command line tool.
PHP
106
star
6

extendmatrix

Cosmin Bonchis's enhancements to the Ruby "Vector" and "Matrix" module and includes: LU and QR (Householder, Givens, Gram Schmidt, Hessenberg) decompositions, bidiagonalization, eigenvalue and eigenvector calculations. Work on Ruby 1.8.7, 1.9.1 and 1.9.2 (SVN version)
Ruby
33
star
7

buhos

Web based systematic literature review software
Ruby
27
star
8

dominanceAnalysis

Dominance Analysis (Azen and Bodescu), for multiple regression models: OLS (univariate, multivariate), beta regression, Dynamic Linear Models, GLM and HLM
R
21
star
9

minimization

Minimization algorithms on pure Ruby
Ruby
19
star
10

integration

Integration methods, based on original work by Beng
Ruby
15
star
11

svg-graph

SVG:::Graph is a pure Ruby library for generating charts, which are a type of graph where the values of one axis are not scalar. SVG::Graph has a verry similar API to the Perl library SVG::TT::Graph, and the resulting charts also look the same. This isn't surprising, because SVG::Graph started as a loose port of SVG::TT::Graph, although the internal code no longer resembles the Perl original at all.
Ruby
13
star
12

reportbuilder

Ruby report abstract interface. Creates text, html and rtf output, based on a common framework.
JavaScript
11
star
13

analisis_covid19_chile

Ejemplo de analisis de serie de tiempo sobre casos Covid-19. Se presenta un reporte comparativo de Chile con otros países, así como por regiones.
HTML
6
star
14

web-plotter3d

A web based 3d plotter, using canvas and JS
JavaScript
6
star
15

statsample-optimization

Extension for statsample, that speed some methods.
C
5
star
16

gsl_narray_stdlib_comparison

Compare perfomance of GSL, Narray and stdlib Matrix on matrix and vectors operations
Ruby
4
star
17

statsample-sem

Structural Equation Modeling on Ruby, using statsample and R
Ruby
4
star
18

exner

Create structural summary for Rorschach Comprehensive System. Works with Znudic method for Zulliger test, based on Exner's RCS.
Ruby
3
star
19

analisis_constitucion

Análisis de contenido de las diferencias entre la versión de 1980 y la versión de 2005 de la Constitución Chilena
Ruby
3
star
20

coolcat-r

Clustering algorithm Coolcat(Barbará, Couto, Li) implemented on R
R
3
star
21

buhos-windows-tk

Windows toolkit to build Buhos installer
HTML
2
star
22

dirty-memoize

Like Memoize, but designed for mutable and parametizable objects
Ruby
2
star
23

rcebn

Just some random methods I use on R. Mainly mplus interfaces and some utilities
R
1
star
24

statsample-bivariate-extension

Polychoric and Tetrachoric support for statsample
Ruby
1
star