New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

c2po

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

c2po

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

C2PO Ruby language bindings

C2PO is a grammar of graphics implementation inspired by Hadley Wickham's ggplot2 library. This Rubygem uses the free online C2PO compiler and is limited to 1 MB of data. Plot specifications are compiled directly to an SVG string, which is returned:

require 'c2po'

#Make some random data:
data = 20.times.collect do
  {:a => 10*rand, :b => 5*rand}
end

#Specify a simple scatterplot graphic:
scatterplot_spec = {
  :data => data,
  :geom => :point,
  :mapping => {:x => :a, :y => :b}}

#Render an SVG string:
C2PO.render scatterplot_spec
  #=> 

Install

For the plain client library, run

gem install c2po

or add

c2po, "0.0.1"

to your Gemfile.

If you want to learn the grammar and work interactively with the examples in /examples, just clone this repo:

git clone https://github.com/keminglabs/c2po-ruby

install the deps:

cd examples
bundle install

then run:

bundle exec guard

to launch a live-reloading web server on localhost:3000 for displaying graphics. Walk through and execute the example code in examples/1-usage.rb to get started.

FAQs

Package last updated on 05 Dec 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc