def get_framework_overview_layers(controls, mappings, attack, domain, framework_name, version):
    """ingest mappings and controls and attack_data, and return an array of layer jsons for layers
     according to control family"""
    dashed_framework = framework_name.replace('_', '-')
    # build list of control families
    family_id_to_controls, family_id_to_name, id_to_family = parse_family_data(controls)

    out_layers = [
        {
            "outfile": f"{dashed_framework}-overview.json",
            "layer": create_layer(
                f"{framework_name} overview",
                f"{framework_name} heatmap overview of control mappings, where scores are "
                f"the number of associated controls",
                domain,
                to_technique_list(controls, mappings, attack, family_id_to_controls,
                                  family_id_to_name, id_to_family),
                version
            )
        }
    ]
    for family_id in family_id_to_controls:
        controls_in_family = family_id_to_controls[family_id]
        techniques_in_family = to_technique_list(controls_in_family, mappings, attack,
                                                 family_id_to_controls, family_id_to_name, id_to_family)
        if len(techniques_in_family) > 0:  # don't build heatmaps with no mappings
            # build family overview mapping
            out_layers.append({
                "outfile": os.path.join("by_family",
                                        family_id_to_name[family_id].replace(" ", "_"),
                                        f"{family_id}-overview.json"),
                "layer": create_layer(
                    f"{family_id_to_name[family_id]} overview",
                    f"{framework_name} heatmap for controls in the {family_id_to_name[family_id]} family, "
                    f"where scores are the number of associated controls",
                    domain,
                    techniques_in_family,
                    version
                )
            })
            # build layer for each control
            for control in family_id_to_controls[family_id]:
                control_id = control["external_references"][0]["external_id"]
                techniques_mapped_to_control = to_technique_list([control], mappings, attack,
                                                                 family_id_to_controls, family_id_to_name, id_to_family)
                if len(techniques_mapped_to_control) > 0:  # don't build heatmaps with no mappings
                    out_layers.append({
                        "outfile": os.path.join("by_family",
                                                family_id_to_name[family_id].replace(" ", "_"),
                                                f"{'_'.join(control_id.split(' '))}.json"),
                        "layer": create_layer(
                            f"{control_id} mappings",
                            f"{framework_name} {control_id} mappings",
                            domain,
                            techniques_mapped_to_control,
                            version
                        )
                    })

    return out_layers
ingest mappings and controls and attack_data, and return an array of layer jsons for layers
     according to control family
src/mappings_to_heatmaps.py