○RAWGraphsの画面
○構築方法
以下のVagrantfileを使用して、RAWGraphsがインストールされた仮想マシン(Debian Stretch/9.5)を構築できます。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/debian-9.5"
config.vm.hostname = "db95rawgraphs"
config.vm.network "public_network", ip:"192.168.1.103", :netmask => "255.255.255.0"
config.vm.network "private_network", ip: "192.168.55.103", :netmask => "255.255.255.0"
config.vm.provider :virtualbox do |vbox|
vbox.name = "db95rawgraphs"
vbox.gui = true
vbox.cpus = 4
vbox.memory = 4096
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
apt-get -y install task-japanese gawk
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
apt-get -y install curl git
mkdir -p /opt/rawgraph
cd /opt/rawgraph
# install nodejs11
curl -sL https://deb.nodesource.com/setup_11.x | bash -
apt-get install -y nodejs
node -v
# install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="/root/.nvm"
source /root/.bashrc
nvm --version
# install bower
npm install -g bower
bower -v
# install rawgraphs
git clone https://github.com/densitydesign/raw.git
cd raw
bower install --allow-root
cp js/analytics.sample.js js/analytics.js
# register as a service
cat << EOF > /etc/systemd/system/rawgraph.service
[Unit]
Description=rawgraph
[Service]
Type=simple
ExecStart=/usr/bin/python -m SimpleHTTPServer 4000
WorkingDirectory=/opt/rawgraph/raw
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable rawgraph
sudo systemctl start rawgraph
SHELL
end
○関連情報
・csvkitを使用して、CSVファイルの操作をコマンドで行うことができます。csvkitに関する記事はこちらを参照してください。
・RAWGraphsに関する他の記事はこちらを参照してください。