How to write an editor window like Animator Window?

I would like to implement a window which allows user to draw flow chart, just like unity animator window or PlayMaker editor window.

But I can’t find any source code.

Any ideas?
Thank you very much.

I found this thread