Journeyviz is a journey visualization gem. It defines journey as code so it can be versioned together with changes.
When defined, you can view your journey through a rack application.
Supports Ruby 2.6.x officially.
Add this line to your application's Gemfile:
gem 'journeyviz'
And then execute:
$ bundle
Or install it yourself as:
$ gem install journeyviz
Start by defining a journey. It is consisted of for elements: blocks, screens, actions and transitions.
Let's start from screens:
# This is the journey definition block
Journeyviz.configure do |journey|
# Here we're defining a screen called landing page
journey.screen :landing_page
end
Now supose our landing page has a share button and we'd like to include it into our journey. We should define an action to represent it.
Journeyviz.configure do |journey|
journey.screen :landing_page do |landing|
# Landing has an action called :share
landing.action :share
end
end
Imagine that the landing page also has an login form that sends the user to a logged-in area, into a dashboard page. Now we're going to use blocks and transitions.
Journeyviz.configure do |journey|
journey.screen :landing_page do |landing|
landing.action :share
# Define an action `login` that transitions the user to dashboard page
# %i[logged dashboard] is the path to that screen. It includes every
# block and finally the screen name.
landing.action :login, transition: %i[logged dashboard]
end
# Defining the logged area
journey.block :logged do |logged_area|
# Dashboard inside logged area
logged_area.screen :dashboard
# Blocks can have blocks, you can call `logged_area.block :sublock` how many
# times you want.
end
end
With journey definition loaded, you just have to mount the journeyviz server into your
rack application with mount
command:
mount Journeyviz::Server => '/journeyviz'
No just go to /journeyviz
path on your application!
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/gabteles/journeyviz.
The gem is available as open source under the terms of the MIT License.