I had this exact idea almost a year ago:
https://github.com/m1el/du-flamegraph
find $1 -type f | xargs -n32 -d'\n' -- du -ab \
| awk -F'\t' '{print $2" "$1;}' | sed 's#/##;s#/#;#g' \
| flamegraph.pl --title "Disk usage" --countname "bytes" \
--nametype "file" --width 1900 --minwidth 0.05
... and tested it using linux sources:http://m1el.github.io/du-flamegraph/linux-sources.svg