Sha256: 9c6dca802d64d85fe3df838af87fb922e0639cad5156185209698b6001fdc090

Contents?: true

Size: 852 Bytes

Versions: 24

Compression:

Stored size: 852 Bytes

Contents

- filename = 'R-png_' << rand(10000).to_s unless defined? filename and filename
- text = filename unless defined? text and text

- size = 500 unless defined? size and size
- width = size unless defined? width and width
- height = size unless defined? height and height
- plot = block.call unless (defined? plot and plot) or not defined? block

- filename += '.png' unless filename =~ /\.png$/i
- require 'rbbt/util/R'
= resource filename, text, :image do |filename|
  - TmpFile.with_file(plot) do |plot_file|
    - if defined? data
      - data.R "rbbt.require('readr'); plot_str <- read_file('#{ plot_file }'); rbbt.png_plot('#{filename}', plot_str, width=#{width}, height=#{height})"
    - else
      - R.run "rbbt.require('readr'); plot_str <- read_file('#{ plot_file }'); rbbt.png_plot('#{filename}', plot_str, width=#{width}, height=#{height})"


Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rbbt-rest-1.9.1 share/views/tools/Rpng.haml
rbbt-rest-1.9.0 share/views/tools/Rpng.haml
rbbt-rest-1.8.157 share/views/tools/Rpng.haml
rbbt-rest-1.8.156 share/views/tools/Rpng.haml
rbbt-rest-1.8.155 share/views/tools/Rpng.haml
rbbt-rest-1.8.154 share/views/tools/Rpng.haml
rbbt-rest-1.8.152 share/views/tools/Rpng.haml
rbbt-rest-1.8.151 share/views/tools/Rpng.haml
rbbt-rest-1.8.150 share/views/tools/Rpng.haml
rbbt-rest-1.8.148 share/views/tools/Rpng.haml
rbbt-rest-1.8.147 share/views/tools/Rpng.haml
rbbt-rest-1.8.146 share/views/tools/Rpng.haml
rbbt-rest-1.8.145 share/views/tools/Rpng.haml
rbbt-rest-1.8.144 share/views/tools/Rpng.haml
rbbt-rest-1.8.143 share/views/tools/Rpng.haml
rbbt-rest-1.8.142 share/views/tools/Rpng.haml
rbbt-rest-1.8.140 share/views/tools/Rpng.haml
rbbt-rest-1.8.139 share/views/tools/Rpng.haml
rbbt-rest-1.8.138 share/views/tools/Rpng.haml
rbbt-rest-1.8.137 share/views/tools/Rpng.haml