{"size": 628, "ext": "js", "max_stars_repo_path": "src/app/viz_7_entreprises/scales.js", "max_stars_repo_name": "INF8808-Equipe19/INF8808-Equipe19", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/app/viz_7_entreprises/scales.js", "max_issues_repo_name": "INF8808-Equipe19/INF8808-Equipe19", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/app/viz_7_entreprises/scales.js", "max_forks_repo_name": "INF8808-Equipe19/INF8808-Equipe19", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.2580645161, "max_line_length": 71, "alphanum_fraction": 0.5127388535}

import * as d3 from 'd3';


/** set the scale for the x axis
 * 
 * @param {*} data 
 * @param {*} width 
 * @returns 
 */
export function setXScale (data, width) {
    
    const borneSup = Math.max(
                        d3.max(data, d => d["tous les propriétaires"]),
                        d3.max(data, d => d["femme"])
                    );
    
    return d3.scaleLinear().domain([0,borneSup]).range([0, width]) 

}

export function setYScale (data, height) {
    
    return d3.scaleBand()
        .domain(data.map(d => d["Caractéristiques de l'entreprise"]))
        .range([ 0, height ])
        .padding(.2);

}

