Truncated table names in diagrams on Ubuntu

92 Views Asked by At

My SchemaCrawler (version 15.01.03) schema diagrams are truncating table names on Ubuntu 18.04 LTS. It looks like the tables are drawn too narrow in general because the "[TABLE]" notation also bleeds out of the box. The same looks fine when rendered on my Mac.

Is there a way to fix this?

---update---
I've tried changing the font in _schemacrawler/config/schemacrawler.config.properties. It's set to Helvetica by default, but Ubuntu doesn't have Helvetica so I changed it to Mukti Narrow... schemacrawler.graph.graphviz.node.fontname=Mukti Narrow This causes less of the text to be truncated but doesn't fix it completely. Comparing with different fonts makes me think the width calculation is done the same regardless of font.

The properties file lists these two URLs for graphviz settings...
https://www.graphviz.org/doc/info/attrs.html
https://www.graphviz.org/doc/info/command.html
I've tried a number of the settings listed there but so far haven't found one that changes the font width calculation.

I've also installed Helvetica but get the same results.

3

There are 3 best solutions below

0
On

Actually I had the same problem - table names were cut (kind of overflow). I had been using the pure Java Graphviz library as stated https://www.schemacrawler.com/diagramming.html . Once I installed complete Graphviz, all table names fit in diagram as expected.

Solution: Dont use only pure Java Graphviz library.

0
On

Boz,

I am sorry, but SchemaCrawler does not directly control the graph output - this is delegated to Graphviz. You are on the right track by investigating Graphviz options. One thing you could try is to use is SchemaCrawler's "pure Java" Graphviz integration. Download the main distribution, and go through the instructions on how to download "pure Java" Graphviz. Please see if that makes a difference.

Sualeh Fatehi, SchemaCrawler

0
On

Solved...

I hadn't installed graphviz. Thought I had but nope. So...
sudo apt install graphviz fixed it.

Thanks for the reply Sualeh. I'm not sure how the graphs were being generated without graphviz installed. Looking at the code I see a place where it attempts to use graphviz and then tries Java if graphviz isn't available. I didn't run it in a debugger or anything, but it seems like it ended up using Java. In retrospect, it might have helped if schemacrawler printed a caution or warning that graphviz was missing. But really I look at this as my own mistake. ... Liked reading your code, by the way. #thumbsup