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

pageflow-chart

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pageflow-chart

  • 2.6.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Pageflow Chart

Gem Version Build Status

Page type showing scraped svg diagramms from Datawrapper.

Installation

Add this line to your application's Gemfile:

# Gemfile
gem 'pageflow-chart'

Mount the engine:

# config/routes.rb
mount Pageflow::Chart::Engine, at: '/chart'

Register the plugin:

# config/initializers/pageflow.rb
config.plugin(Pageflow::Chart.plugin)

Include javascript/stylesheets:

# app/assets/javascripts/pageflow/application.js
//= require "pageflow/chart"

# app/assets/javascripts/pageflow/editor.js
//= require pageflow/chart/editor

# app/assets/stylesheets/pageflow/application.scss;
@import "pageflow/chart";


# app/assets/stylesheets/pageflow/editor.scss;
@import "pageflow/chart/editor";

# Adding basic style to your theme
# app/assets/stylesheets/pageflow/themes/default.scss
@import "pageflow/chart/themes/default";

Execute bundle install. Then Install and run migrations:

rake pageflow_chart:install:migrations
rake db:migrate SCOPE=pageflow_chart

Create Proxy

Create a proxy (via Apache, Nginx, ...) from your domain to your configured S3_HOST_ALIAS to circumvent the same-domain policy. Configure this in your Pageflow Chart initializer config/initializers/pageflow_chart.rb.

Example conf snippet for Nginx. Add this location block inside every server that's being used by Ruby/Rails.

location /datawrapper/ {
  proxy_pass http://bucketname.s3-website-eu-west-1.amazonaws.com/;
  proxy_redirect http://bucketname.s3-website-eu-west-1.amazonaws.com/ $scheme://$host/datawrapper/;
}

Normally you will do in two servers: the one that has listen 80 in it and the other one which has `listen 443' in it (for https). This is needed so the charts can be servered from the same origin a the entry.

Configuration

Configure Pageflow Chart by creating an initializer in your app config/initializers/pageflow_chart.rb.

Example:

Pageflow::Chart.configure do |config|
  config.scraped_sites_root_url = '/datawrapper'

  # Allow scraping charts from custom account URLs
  config.supported_hosts << 'http://mycustom.datawrapper.de'

  # Uncomment to inject custom css into iframe.
  # config.use_custom_theme = true
end

Also see lib/pageflow/chart/configuration.rb for the additional options.

Troubleshooting

If you run into problems while installing the page type, please also refer to the Troubleshooting wiki page in the Pageflow repository. If that doesn't help, consider filing an issue.

Contributing Locales

Edit the translations directly on the pageflow-chart locale project.

FAQs

Package last updated on 15 Jan 2024

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