fix issue where linear tree goes off right end of svg