diagram editor rewritten from scratch