JavaScript is function scoped, not block scoped.  Also, I don't think `containerSize` is particularly clear as a name, something along tipContainerWidth would be clearer.  My vote would be to eliminate this `var` declaration altogether and reduce the `if` blocks to:

```
if (tipContainer && tipContainer.width() > graph.options.tooltip.width) {
  graph.$tooltip.width(tipContainer.width() + 20);
}
```