openscopeproject/InteractiveHtmlBom

Board Heatmap Feature

ankithavn opened this issue · 2 comments

Hi,

Thanks for an awesome plugin!

Additionally, I am trying to use this plugin as a base to create a heatmap of a motherboard to show which parts have the most defects during production. How would you recommend going about it? I am currently planning on adding the defect gradient to each reference in the JSON and then adding JavaScript functions to also parse that data into colors on the HTML. Or should I edit the already created HTML? Can you point me to the right sections in the code to do so?

Thanks!

To change how rendering looks you can use custom javascript and override drawing code where needed. This is how the footprint and highlight box around it is drawn

function drawFootprint(ctx, layer, scalefactor, footprint, colors, highlight, outline) {

You can trace where that function is called and add your own calls to draw differently colored boxes on top or whatever you want.

In terms of how to inject the gradient data you can either have that as a custom field in kicad and then use that custom field in bom and your rendering code or modify the python code to add the gradient to footprint structure itself. Check DATAFORMAT.md file and look around this area for code responsible for fp data

Thanks!