function renderCircle(config,first_time){ if(first_time){ var svg = d3.select(config.dom_element).append("svg") .style("width", config.width + config.margin.left + config.margin.right) .style("height", config.height + config.margin.top + config.margin.bottom); svg .append("circle") .attr("cx",config.x) .attr("cy",config.y) .attr("r",config.radius) .style("fill",config.fill_color) .style("stroke",config.stroke_color) .style("stroke-width",config.stroke_width) $("#x").val(config.x); $("#y").val(config.y); $("#radius").val(config.radius); $("#width").val(config.width); $("#height").val(config.height); $("#fillColor").val(config.fill_color); $("#strokeColor").val(config.stroke_color); $("#strokeWidth").val(config.stroke_width); }else{ var dom_element = d3.select("svg") .style("width", config.width + config.margin.left + config.margin.right) .style("height", config.height + config.margin.top + config.margin.bottom); dom_element.select("circle") .attr("cx",config.x) .attr("cy",config.y) .attr("r",config.radius) .style("fill",config.fill_color) .style("stroke",config.stroke_color) .style("stroke-width",config.stroke_width) } }