Frappe Generating HTML code mechanism

Hey Frappe monsters,

I’m trying to understand frappe mechanism in all frontend component, I want to know where html code for any component is written in frappe files, and how does frappe generate and render any component.

let’s take Chart as an example:
I want to know where the chart html code is written ?
if I added a chart in a dashboard, how frappe will call the html code for this chart?