5
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Gvizでユースケース図を書く

Last updated at Posted at 2016-01-27

Gvizでユースケース図を書いてみます

プログラム

※同一ディレクトリに ./actor.png を配置

# encoding: UTF-8
require 'gviz'

Graph do
  global overlap: false
  normal_edge = { arrowhead: :none }

  subgraph do
    global label: "ウルトラ帳票管理システム"
    basic_node = {fontname:'MS GOTHIC', shape: :ellipse, style: :filled }
    node :createUser, {label: 'ユーザー登録'}.merge(basic_node)
    node :updateUser, {label: 'ユーザー更新'}.merge(basic_node)
    node :applyRole, {label: '権限の付与'}.merge(basic_node)

    node :outputReport, {label: '帳票出力'}.merge(basic_node)
    node :downloadReport, {label: '帳票ダウンロード'}.merge(basic_node)
    node :createReportTemplate, {label: '帳票テンプレート登録'}.merge(basic_node)
  end

  subgraph do
    global style: :invis
    node :user, { label: "一般ユーザー", labelloc: "b", fontname:'MS GOTHIC', shape: :none, style: :filled, image: "./actor.png" }
  end

  subgraph do
    global style: :invis
    node :adminUser, { label: "管理者", labelloc: "b", fontname:'MS GOTHIC', shape: :none, style: :filled, image: "./actor.png" }
  end

  edge :user_createUser, {label: "ユーザー情報を登録する" }.merge(normal_edge)
  edge :user_updateUser, {label: "ユーザー情報を更新する" }.merge(normal_edge)
  edge :adminUser_applyRole, {label: "権限を付与する" }.merge(normal_edge)
  edge :user_outputReport, {label: "帳票を出力する" }.merge(normal_edge)
  edge :user_downloadReport, {label: "帳票をダウンロードする" }.merge(normal_edge)
  edge :adminUser_createReportTemplate, {label: "帳票テンプレートを登録する" }.merge(normal_edge)

  save(:use_case, :png)
end

出力結果

use_case.png

5
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?