Schemaball is an SQL database schema viewer. It requires Perl and a few modules, such as GD and optionally Math::Bezier and SQL::Translator. Schemaball creates flexible visualizations of database schemas. Schemas may be read from an SQL schema dump, flat file or live database.

schemaball

home about screenshots requirements

documentation

tour tutorials README CHANGES man page

download

Perl code

Tutorials

These tutorials illustrate different features of Schemaball. Tutorials are divided into sections. Each section covers a particular aspect of a feature or set of features. Each section has its own documentation, configuration file and schema ball image.

tutorial 4.0.description

all tutorials | description | Sections 1 2 3 4 5

NAME

sbtut_04 - highlighting schema elements

SYNOPSIS

  <table>
  <highlight_rx>
  misc
  feature
  </highlight_rx>
  fill_hi    = acff96
  outline_hi = ffffff
  </table>

  <table>
  <highlight_rx>
  !_feature
  </highlight_rx>
  fill_hi    = c2cdef
  outline_hi = ffffff
  </table>

  <highlight_rx>
  ^.*feature.*__
  </highlight_rx>

  <highlight_rx>
  __.*feature.*$
  </highlight_rx>

PURPOSE

This tutorial will illustrate how to use highlighting to apply a different colour scheme to elements in the schema diagram.

TUTORIAL

Highlighting is controlled in a similar manner to visibility. The element blocks <link> and <table> have a highlight_file parameter and a <highlight_rx> block, used to store regular expressions applied to the names of the elements. When an element name matches, its colour scheme will be determined by FIELD_hi elements (e.g. stroke_hi, fill_hi, etc).

Highlighting Tables

Highlighting specific tables is best done using the <highlight_rx> block. Here, tables whose names contain the strings ``misc'' or ``feature'' will be coloured differently. You can independently adjust the fill colour and the width and colour of the glyph outline.

  <table>
  ...
  <highlight_rx>
  misc
  feature
  </highlight_rx>
  ...
  fill_hi    = acff96
  outline_hi = ffffff
  ...
  </table>

The resulting image is sbtut_04_01.png

Fading Tables

The highlight feature can be subverted to fade all but a given set of tables. To select all tables except those that match a regular expression, append !_ to the regular expression. This configuration will apply the highlight colours, designed to fade into the background, to all tables except those which have ``feature'' in their names.

  <table>
  ...
  <highlight_rx>
  !_feature
  </highlight_rx>
  ...
  fill_hi    = c2cdef
  outline_hi = ffffff
  ...
  </table>

The resulting image is sbtut_04_02.png

Highlighting Links

Highlighting constraint links is done the same way as tables. Remember that links are named like table1__table2. This convention allows you to create regular expressions to select links that start at a table (e.g. table1__) or end at a table (e.g. __table2).

When highlighting links, you can control the colour and thickness of the line. This configuration will highlight all links starting and ending at a table whose name contains the string ``feature''.

  <link>
  ...
  <highlight_rx>
  feature
  </highlight_rx>
  ...
  color_hi  = acff96
  stroke_hi = 3
  ...
  </link>

The resulting image is sbtut_04_03.png.

To highlight only links which start at a given table, or tables, use the fact that the link name is table1__table2. The following highlights only those links which start at a table with a name containing ``feature''.

  <link>
  ...
  <highlight_rx>
  ^.*feature.*__
  </highlight_rx>
  ...
  color_hi  = acff96
  stroke_hi = 3
  ...
  </link>

The resulting image is sbtut_04_04.png.

Similarly, to highlight all links which lead to feature tables,

  <link>
  ...
  <highlight_rx>
  __.*feature.*$
  </highlight_rx>
  ...
  color_hi  = acff96
  stroke_hi = 3
  ...
  </link>

The resulting image is sbtut_04_05.png.

By creating multiple layers with specific links highlighted in different colours you can achieve flexible compositions.

HISTORY

BUGS

Please report errors and suggestions to martink@bcgsc.ca

AUTHOR

Martin Krzywinski, mkweb.bcgsc.ca, martink@bcgsc.ca

$Id: schemaball,v 1.5 2003/10/27 20:25:11 martink Exp $

CONTACT

  Martin Krzywinski
  Genome Sciences Centre
  Vancouver BC Canada
  www.bcgsc.ca
  mkweb.bcgsc.ca
  martink@bcgsc.ca