A tool like would be a wonderful addition to the PostgreSQL ecosystem!
That being said, this tool won't work well for anything but trivial queries. PostgreSQL query plans have many quirks around CTEs, Loops, etc. that cause problems when trying to determine the true inclusive/exclusive time for each node without forgetting stuff or counting it twice. The only tool that tackles them fairly in my experiences it the good old https://explain.depesz.com/ using it's own Pg--Explain library [1].
I'm currently working on my own version of a tool like the one presented by OP (called FlameExplain), and hope to release it soon.
That being said, this tool won't work well for anything but trivial queries. PostgreSQL query plans have many quirks around CTEs, Loops, etc. that cause problems when trying to determine the true inclusive/exclusive time for each node without forgetting stuff or counting it twice. The only tool that tackles them fairly in my experiences it the good old https://explain.depesz.com/ using it's own Pg--Explain library [1].
I'm currently working on my own version of a tool like the one presented by OP (called FlameExplain), and hope to release it soon.
[1] https://gitlab.com/depesz/Pg--Explain/blob/master/lib/Pg/Exp...