
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
= PhantomGraph
PhantomGraph helps complex process to generate javascript charts to image or pdf without requesting or rendering view to the application. PhantomGraph is pure server-side process by using phantomjs and suitable for background process. It is lighweight solution for wkhtmltopdf alternative.
= Installation
gem 'phantom_graph'
or gem install 'phantom_graph'
Do not forget to install phantomjs
See http://phantomjs.org/download.html on how to install phatomjs
= How To Use
add initialize file to "config/initializers/phantom_graph.rb"
PhantomGraph.configure do |config|
# default: `which phantomjs` or `bundle exec which phantomjs`
config.phantomjs = "/usr/local/bin/phantomjs"
# default: false
config.logger = true
# Some javascript plugins are included in Gem
# if you override please change configuration below
# config.highcharts_convert_path = "/path/app/js/highcharts-convert.js"
# config.highcharts_theme_path = "/path/app/js/highcharts-theme.js"
# config.highcharts_path = "/path/app/js/highcharts.js"
# config.highstock_path = "/path/app/js/highstock.js"
# config.jquery_path = "/path/app/js/jquery.js"
end
=== For more samples of json string or file please check:
* highchart json, please check: http://www.highcharts.com/demo/
* highstock json, please check: http://www.highcharts.com/stock/demo
==== Highchart
# sample script: spec/phantom_graph/convert/highchart_spec.rb
options = {image_file_path: "#{Rails.root}/tmp", filename: "output.png"}
callback_json = "customCallback"
highchart = PhantomGraph::Convert::Highchart.new(json_str, options, callback_json)
highchart.result
==== Highstock
# sample script: spec/phantom_graph/convert/higstock_spec.rb
options = {image_file_path: "/path/project/public", filename: "report.pdf"}
highstock = PhantomGraph::Convert::Highstock.new(json_str, options, callback_json)
highstock.result
==== Outputs: PDF, SVG, PNG, JPG
===== Default options for Highstock and Highchart:
{width: 1200,
scale: 0.5,
constr: "Chart",
json_file_path: "/tmp",
image_file_path: "/tmp",
filename: nil,
callback_file_path: "/tmp"
}
= TODO
1. Add Google Chart Module
2. Add Custom Theme Support
3. Add Synchronous Processor
FAQs
Unknown package
We found that phantom_graph demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.