################################################################ # # Parameters that describe the size and features of the # schema image. # ################################################################ # $Id: schemaball.conf,v 1.4 2003/10/27 20:25:11 martink Exp $ ################################################################ ################################################################ # # *** CHANGE values for your environment # # Database to connect to # ################################################################ database = zencart host = localhost user = root password = gulahula sqlfile = /home/hjm/schemaball-0.11/schemas/zencart.sql #tablefile = tables.txt ################################################################ # # *** CHANGE for your environment # # Rules to determine how to determine which table fields # are foreign keys # ################################################################ fieldrx = ^(idx)_(\w+)_([a-z]+)_(zen)$ #^idx_(\w+)_([a-z]+)_zen$ #^idx_[a-z_]* #fieldrx = ^(\w+)_([a-z]+)$ # ^(\w+)_([a-z]+)$ use = yes avoidself = yes table = 1 field = 2 #file = fk.txt use = no sql = tablestatus rx = REFER \w+\/(\w+) use = no sql = tablecreate rx = REFERENCES `?(\w+) use = no ################################################################ # # *** CHANGE "file" for your environment # # Image properties ################################################################ # output file file = /home/hjm/nacs/zencart.png # dump image element coordinates to stdout? image_element_dump = no # the output image is square and 'size' determines its width/height size = 1000 # the tables are located along a circle at 'glyphradius' fraction distance # from the center of the image (e.g. if size = 1000, then if glyphradius = 0.75 the # table circle will have a radius of 1000/2 * 0.75 = 375) glyphradius = 0.7 # annotate the image with a time stamp and information about # the db host annotation = no # image background background = ffffff # colour of foreground text (labels, etc) foreground = 000000 ################################################################ # # rules for various image elements like links and tables # ################################################################ ################################################################ # image link element properties ################################################################ # properties of table-table link lines which represent lookup relationships # formed by foreign keys ################################################################ # show or hide all links? show_links = yes # colour of the link line color = 79a3ed # colour of a highlighted link line color_hi = ffdc00 #79a3ed # colour of the origin of the link, anchored to the table which contains the foreign key color_from = 666666 # thickness of a link line stroke = 1 # thickness of a highlighted link line stroke_hi = 2 # thickness of the origin of the link, anchored to the table which contains the foreign key stroke_from = 2 # approximate fraction of the link which acts as the anchor footer, coloured differently # to give the link directionality; depending on whether you choose 'bezier' or 'line' as the # type of the link, this fractional distance works differently foot_fraction = 0.0 # anchor location of the link line relative to the table glyph # options are # center - link line goes to the center of the table glyph # edge - link line goes to the edge of the table glyph anchor = edge # type of link line # options are # line - well, a line # bezier - well, a bezier curve (see bezier options below) type = bezier # Should links be drawn to tables which are invisible? (see invisible_hide in # the table section) link_to_invisible = yes # Regular expressions which appear in this file determine which links are not drawn # in the schema ball. A link which is hidden by this method is NEVER shown. hide_file = hide_link.txt # Regular expressions within hide_rx block act the same way as those in the hide_file # but appear here # A file with regular expressions used to highlight links. Each line in the file # contains a regular expression applied to the string TABLE1____TABLE2 where # TABLE1 is the source table (contains the foreign key) and TABLE2 is the # target table (is pointed to by the foreign key). See the file for some # examples. highlight_file = highlight_link.txt ################################################################ # image bezier element properties ################################################################ # Parameters for drawing of Bezier links. These are useful only if type = bezier is set # in the image/elements/link section of this file. # The curve is constructed from piece-wise lines. Indicate here how many nodes you want in the # curve. The higher the number, the smoother the curve, but don't go crazy. 50-100 should be ample. resolution = 100 # The bezier curve requires three points. Two of the points are the anchors of the link line # at the table glyphs. The third is midway between the points, in terms of polar angle, and # at a radius 'radius' of the table glyph radius ('glyphradius' above) radius = 0.1 ################################################################ # image label element properties ################################################################ ################################################################ # image table element properties ################################################################ # The DB tables are arranged around a circle as small circles. These parameters # describe how these circles should be drawn. # The size of the table glyph. If this is set to 0 then no glyph is drawn. size = 20 # Fill colour of table glyph fill = 79a3ed #fill = 000000 # Fill color of highlighted tables fill_hi = ffdc00 #ffffff #ffe052 # Thickness of glyph edge stroke = 1 # Colour of glyph edge outline = 1b4896 # Colour of highlighted glyph edge outline_hi = 79a3ed # 000000 #79a3ed # Do tables have labels? label = yes # Should the labels be anonymized? This is useful if you're showing your schema to others # but don't want to expose your table names for some reason anonymize = no # Regular expressions which appear in this file determine which tables are not drawn # in the schema ball. A table which is hidden by this method is NEVER shown. hide_file = hide_tables.txt # Hiding a table can be accomplished in one of two ways (a) turning the table invisible # and keeping a gap in the schema ball in the place of the table or (b) removing the # table from the schema view completely and reorganizing the remaining visible tables # in such a way that they fill the ball. invisible_hide = no # Regular expressions which appear in this file will cause matching tables to be highlighted # using the fill_hi and outline_hi colours highlight_file = highlight_tables.txt ^Equipment
################################################################ # highlighting properties ################################################################ # # Rules determining how highlighting is inherited. There are several rounds of determining whether # a table or table-table link is highlighted. # # First, a table or link are highlighted if their name matches a regular expression in # the 'highlight_file' in the image/elements/table or image/elements/link section, respectively. # # Second, a table which is linked by a highlighted link may become # highlighted if highlight_by_link is set. This feature is useful if you wish to highlight # tables linked to a specific table or set of tables. For example, you can highlight # all links by the regular expression "Table5$", which will highlight all links which point # to Table5. If you set highlight_by_link then all tables which point to Table5 will also # be highlighted. highlight_by_link = yes # A link may be highlighted if it touches a highlighted table. The effect will be # to highlight all links anchored to a table. highlight_by_table = yes highlight_by_table_forward = yes highlight_by_table_reverse = yes # How many times do you want to iterate through the highlight_by_XXX cycle? This is fun # to play with. highlight_by_iterations = 2 # Colours can be diluted according to the iteration number in the highlight # inheritance step. The dilution is done using the formula # # color_rgb = RGB( # HSB(color_highlight) * fade_factor ^(iteration-1) + # HSB(color) * (1-fade_factor)^(iteration-1) # ) # # For the 1st iteration, the colour will be as defined by the highlight colour. # For subsequent iterations, the colour will be diluted to be closer to the # unhighlited colour with each iteration. The dilution is done in HSB space. fade_factor_table = .8 fade_factor_link = .5
################################################################ # # DBI database driver and SQL commands to explore the database # ################################################################ # only 'mysql' has been tested dbtype = mysql # schemaball needs to be able to (a) get a list of tables in the databse and # (b) get a list of fields in each of these tables. Each database query # is described here by the associated SQL statement "sql" and the # column number "colnum" (0-indexed) in the result which contains the required answer # string. # # _TABLE_ is substituted by the table name as schemaball iterates through # all tables obtained from the "listtables" query. # sql = "show tables" colnum = 0 sql = "describe _TABLE_" colnum = 0 sql = "show create table _TABLE_" colnum = 1 sql = "show table status from _DB_ like '_TABLE_'" colnum = 14