<commit_before>var margin = {top:30, right:10, bottom:20, left:80};

var width = 960 - margin.left - margin.right;

var height = 500 - margin.top - margin.bottom;

var svgContainer = d3.select("#chartID").append("svg").attr("width", width+margin.left + margin.right).attr("height",height+margin.top + margin.bottom).append("g").attr("transform", "translate("+ margin.left +","+ margin.top +")");

var xScale = d3.scale.linear().domain([0,100]).range([0,400]);

var yScale = d3.scale.linear().range([height, 0]);

var xAxis = d3.svg.axis().scale(xScale).orient("bottom");

var yAxis = d3.svg.axis().scale(yScale).orient("left");

var xAxis_g = svgContainer.append("g").attr("class", "x axis").attr("transform", "translate(0," + height + ")").call(xAxis);

var yAxis_g = svgContainer.append("g").attr("class", "y axis").call(yAxis).append("text").attr("transform", "rotate(-90)").attr("y", 6).attr("dy", ".71em").style("text-anchor", "end").text("Price ($)");
<commit_msg>responsive axis code - commit<commit_after>var margin = {top:30, right:10, bottom:20, left:80};

var width = 960 - margin.left - margin.right;

var height = 500 - margin.top - margin.bottom;

var svgContainer = d3.select("#chartID").append("svg").attr("width", width+margin.left + margin.right).attr("height",height+margin.top + margin.bottom).append("g").attr("transform", "translate("+ margin.left +","+ margin.top +")");

var xScale = d3.scale.linear().domain([0,100]).range([0,width]);

var yScale = d3.scale.linear().range([height, 0]);

var xAxis = d3.svg.axis().scale(xScale).orient("bottom");

var yAxis = d3.svg.axis().scale(yScale).orient("left");

var xAxis_g = svgContainer.append("g").attr("class", "x axis").attr("transform", "translate(0," + height + ")").call(xAxis);

var yAxis_g = svgContainer.append("g").attr("class", "y axis").call(yAxis).append("text").attr("transform", "rotate(-90)").attr("y", 6).attr("dy", ".71em").style("text-anchor", "end").text("Price ($)");

d3.select(window).on('resize', resize); 

function resize() {
	console.log('----resize function----');
    // update width
    width = parseInt(d3.select('#chartID').style('width'), 10);
    width = width - margin.left - margin.right;
	console.log('----resiz width----'+width);
    // resize the chart
    if(width<870){
    	xScale.range([0, width]);

    d3.select(svgContainer.node().parentNode)
        .style('width', (width + margin.left + margin.right) + 'px');
    svgContainer.select('.x.axis').call(xAxis.orient('bottom'));	
    }
}
{'fraction_non_alphanumeric': 0.2419032387045182, 'fraction_numerical': 0.02958816473410636, 'mean_word_length': 5.058111380145278, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '288141', 'n_tokens_mistral': 886, 'n_tokens_neox': 846, 'n_words': 143}